-
Notifications
You must be signed in to change notification settings - Fork 45
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
Refactor constants to interface in menu factories #7023
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Move all constants to the `MenuItemConstants` interface and update subclasses to implement the interface. * Add `MenuItemConstants` interface in `citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemConstants.java` to hold all constants. * Update `CommitteeRankingMenuItemFactoryImpl` to implement `MenuItemConstants` and remove constants from the class. * Update `CountryMenuItemFactoryImpl` to implement `MenuItemConstants` and remove constants from the class. * Update `DocumentMenuItemFactoryImpl` to implement `MenuItemConstants` and remove constants from the class. * Update `GovernmentBodyMenuItemFactoryImpl` to implement `MenuItemConstants` and remove constants from the class. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/Hack23/cia?shareId=XXXX-XXXX-XXXX-XXXX).
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. OpenSSF Scorecard
Scanned Files
|
* **MenuItemConstants.java** - Add import for `ChartIndicators` - Prefix duplicate constant names with class names - Add missing symbols for `UserHomeMenuItemFactoryImpl` * **CountryMenuItemFactoryImpl.java** - Update references to use constants from `MenuItemConstants` - Define missing symbols in `CountryMenuItemFactoryImpl`
…odyMenuItemFactoryImpl` and update references to use `MenuItemConstants`. * Remove all constants from `CommitteeMenuItemFactoryImpl` and `GovernmentBodyMenuItemFactoryImpl`. * Implement `MenuItemConstants` interface in `CommitteeMenuItemFactoryImpl`. * Update references in `CommitteeMenuItemFactoryImpl` and `GovernmentBodyMenuItemFactoryImpl` to use constants from `MenuItemConstants`. * Remove unused import in `UserHomeMenuItemFactoryImpl`.
… and `DocumentMenuItemFactoryImpl` to use `MenuItemConstants` interface * **UserHomeMenuItemFactoryImpl** - Import `MenuItemConstants` interface - Update references to use constants from `MenuItemConstants` * **CommitteeMenuItemFactoryImpl** - Import `MenuItemConstants` interface - Update references to use constants from `MenuItemConstants` * **DocumentMenuItemFactoryImpl** - Import `MenuItemConstants` interface - Update references to use constants from `MenuItemConstants` - Remove all constants from `DocumentMenuItemFactoryImpl` * **MenuItemConstants** - Add missing constants and commands
* Add constants for user events, roles, current members, member history, role ghant, documents, document history, ballots, ballot decision summary, decision summary, decision type daily summary, decision flow, country ranking, country overview, country indicators, country page visit history, by topic, data points, document details, document references, document decision, document attachments, government body ranking, government body overview, headcount, income, expenditure, ministry ranking, government bodies headcount, government bodies income, government bodies expenditure, and user home overview. * Add corresponding descriptions for each constant.
* Add 'LIST' symbol in alphabetical order * Add 'SEARCH' symbol in alphabetical order
…ses to use them * **MenuItemConstants.java** - Add constants for menu items like `SWEDEN_DASHBOARD`, `COMMAND_COMMITTEE_RANKING_DATAGRID`, `COMMAND_DOCUMENTS`, etc. - Add descriptive text constants like `COMMITTEE_RANKING_TEXT`, `MINISTRIES_LEADER_SCOREBOARD`, etc. * **AbstractMenuItemFactoryImpl.java** - Implement `MenuItemConstants` interface. - Remove local constants and use constants from `MenuItemConstants`. * **ApplicationMenuItemFactoryImpl.java** - Implement `MenuItemConstants` interface. - Remove local constants and use constants from `MenuItemConstants`. - Update `createOverviewPage` method to use `SWEDEN_DASHBOARD` constant.
…Impl` class * Remove constants from the class and use constants from `MenuItemConstants`
… class * Remove constants from the class and use constants from `MenuItemConstants`
…ryImpl` and `PoliticianMenuItemFactoryImpl` classes * Remove constants from `PartyRankingMenuItemFactoryImpl` and use constants from `MenuItemConstants` * Remove constants from `PoliticianMenuItemFactoryImpl` and use constants from `MenuItemConstants`
…onstants` * Replace hardcoded string "Useraccount" with `USERACCOUNT` constant * Replace hardcoded string "User Home Overview" with `USER_HOME_OVERVIEW_TEXT` constant Add `MenuItemConstants` interface with constants for menu items * Define constants like `USERACCOUNT`, `USER_HOME_OVERVIEW_TEXT`, `COMMAND_APPLICATION_CONFIGURATION`, etc. * Remove unused imports and redundant constants from the interface * Organize constants into logical groups for better readability
* **Constants**: Add constants with unique names combining context and descriptive names. * **Imports**: Add necessary imports for `PageModeMenuCommand`, `AdminViews`, `ApplicationPageMode`, `ChartIndicators`, `CommonsViews`, `DataSummaryPageMode`, `PageMode`, and `UserViews`.
* Add `HEADCOUNT` constant * Add `COMMAND_GOVERNMENT_BODIES_HEADCOUNT` constant * Add `COMMAND_GOVERNMENT_BODIES_INCOME` constant * Add `COMMAND_GOVERNMENT_BODIES_EXPENDITURE` constant * Add `GOVERNMENT_OUTCOME` constant * Add `COMMAND_GOVERNMENT_OUTCOME` constant * Add `GOVERNMENT_OUTCOME_DESCRIPTION` constant * Add `GOVERNMENT_ROLES_CHART` constant * Add `COMMAND_CHARTS_ALL_GOVERNMENT_ROLE_GANTT` constant * Add `GOVERNMENT_ROLES_CHART_DESCRIPTION` constant * Add `CURRENT_MINISTRIES_CURRENT_MEMBERS_TEXT` constant * Add `COMMAND_CHARTS_CURRENT_MINISTRIES_BY_HEADCOUNT` constant * Add `CURRENT_PARTIES_ACTIVE_IN_MINISTRIES_CURRENT_ASSIGNMENTS` constant * Add `COMMAND_CHARTS_CURRENT_PARTIES_BY_HEADCOUNT` constant * Add `ALL_PARTIES_TOTAL_DAYS_SERVED_IN_MINISTRIES` constant * Add `COMMAND_CHARTS_ALLMINISTRIES_BY_TOTAL_DAYS` constant * Add `ALL_MINISTRIES_TOTAL_MEMBERS` constant * Add `COMMAND_CHARTS_ALL_MINISTRIES_BY_HEADCOUNT` constant * Add `COMMAND_PAGEVISITHISTORY` constant * Add `PARTY_WINNER` constant * Add `COMMAND_CHARTS_PARTY_WINNER` constant * Add `PARTY_WINNER_DESCRIPTION` constant * Add `PARTY_GENDER` constant * Add `COMMAND_CHARTS_PARTY_GENDER` constant * Add `PARTY_GENDER_DESCRIPTION` constant * Add `PARTY_AGE` constant * Add `COMMAND_CHARTS_PARTY_AGE` constant * Add `PARTY_AGE_DESCRIPTION` constant * Add `RISK_SUMMARY` constant * Add `COMMAND_RISK_SUMMARY` constant * Add `RISK_SUMMARY_DESCRIPTION` constant * Add `RULE_VIOLATIONS` constant * Add `COMMAND_RULE_VIOLATION` constant * Add `RULE_VIOLATIONS_DESCRIPTION` constant * Add `DOCUMENT_ACTIVITY_BY_TYPE` constant * Add `COMMAND_DOCUMENT_ACTIVITY` constant * Add `DECISION_ACTIVITY_BY_TYPE` constant * Add `COMMAND_DECISION_ACTIVITY` constant * Add `DECISION_ACTIVITY_DESCRIPTION` constant * Add `DECISION_FLOW` constant * Add `COMMAND_CHARTS_DECISION_FLOW` constant * Add `PARLIAMENT_RANKING_TEXT` constant * Add `SWEDISH_PARLIAMENT_INDICATORS` constant * Add `CURRENT_LEADERS` constant * Add `CURRENT_LEADERS_DESCRIPTION` constant * Add `LEADER_HISTORY` constant * Add `LEADER_HISTORY_DESCRIPTION` constant * Add `GOVERMENT_ROLES` constant * Add `GOVERMENT_ROLES_DESCRIPTION` constant * Add `COMMITTEE_ROLES` constant * Add `COMMITTEE_ROLES_DESCRIPTION` constant
* Add constants for government bodies headcount, income, and expenditure * Add constants for government outcome and its description * Add constants for government roles chart and its description * Add constants for current ministries and parties by headcount * Add constants for all parties total days served in ministries * Add constants for all ministries total members * Add constants for party winner, gender, and age with their descriptions * Add constants for risk summary and rule violations with their descriptions * Add constants for document and decision activity by type with their descriptions * Add constants for decision flow * Add constants for parliament ranking and Swedish parliament indicators * Add constants for current leaders and leader history with their descriptions * Add constants for government and committee roles with their descriptions
…nuCommand` instead of `MenuItemConstants`
…dConstants` instead of `MenuItemConstants`
…ed module accessibility
…, government, politician, and committee
…ry, decision, ministry, page visit, and admin functionalities
Quality Gate passedIssues Measures |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Move all constants to the
MenuItemConstants
interface and update subclasses to implement the interface.MenuItemConstants
interface incitizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/common/menufactory/api/MenuItemConstants.java
to hold all constants.CommitteeRankingMenuItemFactoryImpl
to implementMenuItemConstants
and remove constants from the class.CountryMenuItemFactoryImpl
to implementMenuItemConstants
and remove constants from the class.DocumentMenuItemFactoryImpl
to implementMenuItemConstants
and remove constants from the class.GovernmentBodyMenuItemFactoryImpl
to implementMenuItemConstants
and remove constants from the class.For more details, open the Copilot Workspace session.