Преглед изворни кода

[CE/SP] Fix default footer (#28947)

* [CE/SP] Fix default footer

Fixes the default `right_footer`. Only 'text' should be defined when it contains HTML code.

* Remove font-awesome github icon

* Added acceptance test

GitOrigin-RevId: 1a1ba04673f35affcec4bb17bc7cd860d589b13f
Miguel Serrano пре 1 година
родитељ
комит
d54efe78f7
2 измењених фајлова са 32 додато и 19 уклоњено
  1. 31 17
      server-ce/test/customization.spec.ts
  2. 1 2
      services/web/config/settings.defaults.js

+ 31 - 17
server-ce/test/customization.spec.ts

@@ -2,25 +2,39 @@ import { isExcludedBySharding, startWith } from './helpers/config'
 
 describe('Customization', () => {
   if (isExcludedBySharding('CE_CUSTOM_1')) return
-  startWith({
-    vars: {
-      OVERLEAF_APP_NAME: 'CUSTOM APP NAME',
-      OVERLEAF_LEFT_FOOTER: JSON.stringify([{ text: 'CUSTOM LEFT FOOTER' }]),
-      OVERLEAF_RIGHT_FOOTER: JSON.stringify([{ text: 'CUSTOM RIGHT FOOTER' }]),
-    },
-  })
 
-  it('should display custom name', () => {
-    cy.visit('/')
-    cy.get('nav').findByText('CUSTOM APP NAME')
-  })
+  describe('default settings', () => {
+    startWith({})
 
-  it('should display custom left footer', () => {
-    cy.visit('/')
-    cy.get('footer').findByText('CUSTOM LEFT FOOTER')
+    it('should display the default right footer', () => {
+      cy.visit('/')
+      cy.get('footer').findByRole('link', { name: 'Fork on GitHub!' })
+    })
   })
-  it('should display custom right footer', () => {
-    cy.visit('/')
-    cy.get('footer').findByText('CUSTOM RIGHT FOOTER')
+
+  describe('custom settings', () => {
+    startWith({
+      vars: {
+        OVERLEAF_APP_NAME: 'CUSTOM APP NAME',
+        OVERLEAF_LEFT_FOOTER: JSON.stringify([{ text: 'CUSTOM LEFT FOOTER' }]),
+        OVERLEAF_RIGHT_FOOTER: JSON.stringify([
+          { text: 'CUSTOM RIGHT FOOTER' },
+        ]),
+      },
+    })
+
+    it('should display custom name', () => {
+      cy.visit('/')
+      cy.get('nav').findByText('CUSTOM APP NAME')
+    })
+
+    it('should display custom left footer', () => {
+      cy.visit('/')
+      cy.get('footer').findByText('CUSTOM LEFT FOOTER')
+    })
+    it('should display custom right footer', () => {
+      cy.visit('/')
+      cy.get('footer').findByText('CUSTOM RIGHT FOOTER')
+    })
   })
 })

+ 1 - 2
services/web/config/settings.defaults.js

@@ -778,8 +778,7 @@ module.exports = {
 
     right_footer: [
       {
-        text: "<i class='fa fa-github-square'></i> Fork on GitHub!",
-        url: 'https://github.com/overleaf/overleaf',
+        text: '<a href="https://github.com/overleaf/overleaf">Fork on GitHub!</a>',
       },
     ],