Skip to content

feat: make "About" and "Help" sections configurable #1758

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

armandobermudezmartinez
Copy link

@armandobermudezmartinez armandobermudezmartinez commented Feb 21, 2025

Description

This pull request introduces configurable Help and About texts to the SciCat Frontend, which addresses the problem described in Issue #1745.
Users can now provide the desired texts in the frontend.config as a json item, for instance:

"aboutText": "This catalog allows users to access publicly available data and metadata from experiments and simulations provided by members of the scientific community. All data available has been curated to the best effort and knowledge but is provided without warranty. If you need support or have general questions, please contact us via [email protected]",

The main changes include:
Added configurable attributes in AboutComponent class:
aboutText
accessText
termsText
termsTextContinued
and in the HelpComponent class:
docText
gettingStartedExtraText
whereIsMyDataText
howToPublishDataText
ingestManualExtraText
whereAreMyProposalsExtraText
whereAreMySamplesExtraText
The attributes were also added to the AppConfigService to manage the configurable values.
Added linky module to the HelpComponent to automatically render URLs from text.
Unit tests were added for the new configurable attributes in AppConfigService, AboutComponent, and HelpComponent.

Motivation

This update will enable users to easily add or modify institution-specific information such as license details, privacy policies, and help content without requiring code changes.

Fixes:

Please provide a list of the fixes implemented in this PR

  • Items added
    The following attributes to AppConfigService class (app-config-service.ts), and unit tests (app-config-service-spec.ts)
    aboutText
    accessText
    termsText
    termsTextContinued
    docText
    gettingStartedExtraText
    whereIsMyDataText
    howToPublishDataText
    ingestManualExtraText
    whereAreMyProposalsExtraText
    whereAreMySamplesExtraText

The following attributes to the AboutComponentClass (about.component.ts), and there reference in the about.component.html using the linky module
aboutText
accessText
termsText
termsTextContinued

The following attributes to the HelpComponentClass (about.component.ts), and there reference in the help.component.html using the linky module
docText
gettingStartedExtraText
whereIsMyDataText
howToPublishDataText
ingestManualExtraText
whereAreMyProposalsExtraText
whereAreMySamplesExtraText
For the HelpComponentClass the linky module was added as an import in help.module.ts.

Changes:

Please provide a list of the changes implemented by this PR

  • changes made

Removed hardcoded institution-specific text from about.component.html and help.component.html, making the text configurable from the frontend config file.

Tests included

  • Included for each change/fix?
    Yes, tests have been added for the new components and bug fixes.
  • Passing? (Merge will not be approved unless this is checked)
    Yes, all tests are passing.

Documentation

  • swagger documentation updated [required]
    No, this change does not require updates to the Swagger documentation.
  • official documentation updated [nice-to-have]
    No

official documentation info

If you have updated the official documentation, please provide PR # and URL of the pages where the updates are included

Backend version

  • Does it require a specific version of the backend
    No specific backend version required. This change only impacts the frontend.
  • which version of the backend is required:

Summary by Sourcery

This pull request introduces configurable Help and About texts to the SciCat Frontend. It removes hardcoded institution-specific text from the about.component.html and help.component.html, making the text configurable from the frontend config file.

New Features:

  • Makes the About and Help sections configurable via the frontend config file, allowing users to modify institution-specific information without code changes.

Enhancements:

  • Adds the linky module to the HelpComponent to automatically render URLs from text.

Tests:

  • Adds unit tests for the new configurable attributes in AppConfigService, AboutComponent, and HelpComponent.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @armandobermudezmartinez - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Member

@Junjiequan Junjiequan left a comment

Choose a reason for hiding this comment

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

Hi @armandobermudezmartinez,
Thank you for your contribution to the SciCat project. However, we cannot review this PR until the mixed commit history is cleaned up, as it includes unrelated code changes.

@armandobermudezmartinez armandobermudezmartinez force-pushed the dynamical-help-and-about-texts-frontend-5.0.2 branch from 31930b4 to 05c1092 Compare March 6, 2025 10:41
@armandobermudezmartinez armandobermudezmartinez changed the title Fixes Issue #1745: Make "About" and "Help" sections configurable feat: make "About" and "Help" sections configurable Mar 13, 2025
Copy link
Member

@nitrosx nitrosx left a comment

Choose a reason for hiding this comment

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

@armandobermudezmartinez thank you so much for your contribution.
Could you please merge the master in to your branch and update this PR?

Copy link
Author

@armandobermudezmartinez armandobermudezmartinez left a comment

Choose a reason for hiding this comment

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

I agree with the changes

Copy link
Member

@nitrosx nitrosx left a comment

Choose a reason for hiding this comment

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

@armandobermudezmartinez before we can review and approve it, you should merge the latest master into this PR.
Also, we suggest to place the help text in a separate json file. Look at the functionalAccounts.json as an example

@nitrosx
Copy link
Member

nitrosx commented Mar 25, 2025

@armandobermudezmartinez any updates on this?

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.

3 participants