Skip to content
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

feat: implement configurable localization for datasets detail view #1700

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

Conversation

Junjiequan
Copy link
Contributor

@Junjiequan Junjiequan commented Jan 9, 2025

Description

This PR aims to implement the ngx-translate package to enable customizable labels for the dataset detail page at runtime. Added a CustomTranslateLoader that fetches label sets dynamically from AppConfigService. Labels can be configured via frontend.config.json using the DatasetDetailView structure (currentLabelSet and labelSets). If no configuration is provided, it falls back to default labels. This enhancement allows runtime flexibility for label customization.

Motivation

The labels on the dataset detail page should not be fixed, as different facilities require the flexibility to customize labels according to their specific needs.

Fixes:

Please provide a list of the fixes implemented in this PR

  • Items added

Changes:

Please provide a list of the changes implemented by this PR

  • changes made

Tests included

  • Included for each change/fix?
  • Passing? (Merge will not be approved unless this is checked)

Documentation

  • swagger documentation updated [required]
  • official documentation updated [nice-to-have]

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
  • which version of the backend is required:

Summary by Sourcery

Implement dataset label sets based on configuration to allow dynamic switching between different sets of labels for the dataset detail view.

New Features:

  • Added the ability to switch between different sets of labels for the dataset detail view.

Tests:

  • Added tests for the new translate loader.

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 @Junjiequan - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Please fill out the PR description properly, including motivation and specific changes made. This helps reviewers understand the context and purpose of adding translation support.
  • Consider adding unit tests for the CustomTranslateLoader to ensure proper handling of valid and invalid label sets.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 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.

src/app/app-config.service.ts Outdated Show resolved Hide resolved
@Junjiequan Junjiequan changed the title init feat: Implement configurable localization for datasets detail view Jan 9, 2025
@Junjiequan Junjiequan changed the title feat: Implement configurable localization for datasets detail view feat: implement configurable localization for datasets detail view Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant