Skip to content

🏗️(frontend) footer configurable #959

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 22, 2025
Merged

Conversation

AntoLC
Copy link
Collaborator

@AntoLC AntoLC commented May 12, 2025

Purpose

We need to have different footer per instance.
The footer has to be displayable or not.

Proposal

Bind the frontend footer with the theme configuration file:
https://github.com/suitenumerique/docs/blob/main/src/backend/impress/configuration/theme/default.json

  • The footer is configured from a json to be easily overwritable
  • The legal pages are removed from the codebase, for our instances they will be stored directly in Docs, as a doc.

  • 🏗️(frontend) Footer configurable
  • 🔥(frontend) remove legal pages

Demo

footer-configurable

@AntoLC AntoLC self-assigned this May 12, 2025
@AntoLC AntoLC force-pushed the refacto/footer-from-json branch from 13b6929 to 24febb9 Compare May 13, 2025 10:14
@AntoLC AntoLC marked this pull request as ready for review May 13, 2025 10:15
@AntoLC AntoLC added the refacto label May 13, 2025
@AntoLC AntoLC force-pushed the refacto/footer-from-json branch from 24febb9 to f1d2050 Compare May 13, 2025 10:38
@AntoLC AntoLC changed the title 💄(frontend) footer configurable 🏗️(frontend) footer configurable May 13, 2025
@AntoLC AntoLC requested review from rvveber and PanchoutNathan May 13, 2025 10:39
@AntoLC AntoLC mentioned this pull request May 13, 2025
9 tasks
@AntoLC AntoLC force-pushed the refacto/footer-from-json branch from 98267cd to 027bdf9 Compare May 13, 2025 20:34
@AntoLC AntoLC requested review from rvveber and lunika May 15, 2025 07:49
"logo": {
"src": "/assets/icon-docs.svg",
"width": "54px",
"alt": "Docs Logo",
Copy link
Collaborator

@rvveber rvveber May 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we consider a more direct approach for translating strings?

If we used translation slugs instead of plain text:

  1. It could simplify things by removing the need for default, fr, en and similar sub-keys.

  2. It would also alleviate the burden of updating the full theme configuration when a new language is added, a process currently more involved than maintaining a flat JSON for translations.

  3. This shift would also enhance modularity and better separate responsibilities.

  4. It would allow translators of crowdin to properly translate the default values.

  5. It would reduce the size of the theming file significantly - potentially improving payload transfer speed and overall reactivity of the app

  6. It would allow nested translations to be integrated in the future, further reducing complexity and improving flexibility

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Until we cannot override translations per instance we cannot do this way.
But I think you're right, we should refacto this part as soon we can override translations, I will open an issue about it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Saved for later: #994

<IconLink width={18} />
</StyledLink>
</Text>
{bottomInformation.label}{' '}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a big to add a space like this

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is rewrote like that by prettier.

@AntoLC AntoLC force-pushed the refacto/footer-from-json branch 2 times, most recently from ae05629 to 8494fd9 Compare May 21, 2025 09:04
@AntoLC AntoLC requested a review from rvveber May 21, 2025 09:05
AntoLC added 4 commits May 22, 2025 14:07
The rule @typescript-eslint/no-unused-vars didn't
have a ignore pattern. A ignore pattern can be
usefull in some cases.
Improve config testcases:
- let THEME_CUSTOMIZATION_FILE_PATH to be set to
check the default value
- add helper function overrideConfig
To have different footer per instance the
content of the footer is now configurable
from the theme customization file.

See THEME_CUSTOMIZATION_FILE_PATH env var.
Legal pages are not needed anymore in the application.
In the dsfr instances, the legal pages will be
displayed on a Docs pages.
We let the users of Docs managing the legal pages
on their own instances.
@AntoLC AntoLC force-pushed the refacto/footer-from-json branch from 8494fd9 to 7a38395 Compare May 22, 2025 12:08
@AntoLC AntoLC merged commit 7a38395 into main May 22, 2025
20 of 21 checks passed
@AntoLC AntoLC deleted the refacto/footer-from-json branch May 22, 2025 12:20
@AntoLC AntoLC mentioned this pull request May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants