-
Notifications
You must be signed in to change notification settings - Fork 31
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: swap 4462 proposal metadata and label localization #1717
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @nitrosx - I've reviewed your changes - here's some feedback:
Overall Comments:
- The TODO comment regarding proposal type suggests a dependency on an unreleased SDK version. Consider either waiting for the SDK update or implementing proper handling for both current and future cases.
- The package.json version was changed from 4.5.0 to local.dev which appears unintentional. Please verify if this change was meant to be included in this PR.
Here's what I looked at during the review
- 🟡 General issues: 3 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@@ -21,10 +21,12 @@ export interface LabelMaps { | |||
[key: string]: Record<string, string>; | |||
} | |||
|
|||
export interface datasetDetailViewLabelOption { | |||
export interface LabelsLocalization { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Consider enforcing consistent key naming across components using string literal types
Different components are using inconsistent keys (e.g., 'proposal' vs 'dataset-default'). Consider using a string literal union type to enforce consistency, like: currentLabelSet: { [K in 'proposal' | 'dataset-default']: string }
Suggested implementation:
export type LabelSetKey = 'proposal' | 'dataset-default';
export interface LabelsLocalization {
currentLabelSet: LabelSetKey;
labelSets: {
[K in LabelSetKey]: {
[key: string]: Record<string, string>;
};
};
}
This change will require:
- Updating any components that create or modify labelSets to ensure they only use the allowed keys
- Potentially adding more literal types to the LabelSetKey union if there are other valid label set keys in use
- Fixing any TypeScript errors in components that were previously using string keys not included in the LabelSetKey union
src/app/proposals/view-proposal-page/view-proposal-page.component.ts
Outdated
Show resolved
Hide resolved
1f0ddaf
to
53edef6
Compare
Description
This PR streamline showing the metadata for proposals and add localization to the proposals
Motivation
Showing metadata on proposals involves multiple configurations settings and a simplification was needed.
Following up the dataset labels localization, it was easy to extend to proposals
Changes:
Tests included
Documentation
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
Summary by Sourcery
Add localization to proposal metadata and simplify metadata display configuration.
New Features:
Tests: