-
Notifications
You must be signed in to change notification settings - Fork 7
AMP-31022 Indicators module changes #4430
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
base: develop
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.
Pull Request Overview
This PR implements comprehensive enhancements to the AMP Indicators module, adding support for new indicator fields, outcome/output management, and improved UI. The changes introduce additional categorization capabilities and a management interface for outcomes and outputs.
Key changes include:
- Addition of new indicator fields (outcome, output, type, disaggregation, unit of measure, etc.)
- Implementation of outcome and output management with CRUD operations
- Enhanced UI with improved filtering, search, and visual organization
- Database schema updates with new entities and Hibernate mappings
Reviewed Changes
Copilot reviewed 41 out of 41 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| Java entity classes | Added AmpOutcome and AmpOutput entities with bidirectional relationships |
| Hibernate mappings | New mapping files for outcome/output entities and updated indicator mappings |
| Service classes | New service for outcome/output CRUD operations and updated indicator service |
| Database patches | SQL script to create indicator category values |
| Frontend components | New React pages for outcome/output management with improved UI |
| API endpoints | New REST endpoints for outcome/output operations |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| public List<AmpOutputDTO> getOutputsByOutcomeId(Long outcomeId) { | ||
| Session session = PersistenceManager.getSession(); | ||
| AmpOutcome outcome = (AmpOutcome) session.get(AmpOutcome.class, outcomeId); |
Copilot
AI
Sep 1, 2025
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.
Unnecessary explicit casting. The session.get() method with a Class parameter already returns the correct type. Remove the explicit cast: AmpOutcome outcome = session.get(AmpOutcome.class, outcomeId);
| AmpOutcome outcome = (AmpOutcome) session.get(AmpOutcome.class, outcomeId); | |
| AmpOutcome outcome = session.get(AmpOutcome.class, outcomeId); |
|
|
||
| public void deleteOutcome(Long outcomeId) { | ||
| Session session = PersistenceManager.getSession(); | ||
| AmpOutcome outcome = (AmpOutcome) session.get(AmpOutcome.class, outcomeId); |
Copilot
AI
Sep 1, 2025
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.
Same unnecessary explicit casting as above. Remove the cast: AmpOutcome outcome = session.get(AmpOutcome.class, outcomeId);
| AmpOutcome outcome = (AmpOutcome) session.get(AmpOutcome.class, outcomeId); | |
| AmpOutcome outcome = session.get(AmpOutcome.class, outcomeId); |
| @@ -1,2 +1,2 @@ | |||
| export const TRN_PREFIX = 'amp.inidcatormanager.dashboard:'; | |||
| export const TRN_PREFIX_DASHBOARD = 'amp.inidcatormanager.dashboard:'; | |||
| export const TRN_PREFIX = 'amp.indicatormanager.dashboard:'; | |||
Copilot
AI
Sep 1, 2025
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.
[nitpick] Fixed typo in constant name from 'inidcator' to 'indicator', but consider if TRN_PREFIX and TRN_PREFIX_DASHBOARD should have different values since they're now identical.
| export const TRN_PREFIX = 'amp.indicatormanager.dashboard:'; | |
| export const TRN_PREFIX = 'amp.indicatormanager:'; |
| }, | ||
| csvFormatter: (_cell: any, row: any) => { | ||
| if (outcomesReducer.loading) return ''; | ||
| const foundOutcome = !outcomesReducer.loading && outcomesReducer.programs.find((outcome: any) => outcome.id === row.outcomeId); |
Copilot
AI
Sep 1, 2025
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.
Incorrect property access. Should be outcomesReducer.outcomes instead of outcomesReducer.programs to find outcomes correctly.
| const foundOutcome = !outcomesReducer.loading && outcomesReducer.programs.find((outcome: any) => outcome.id === row.outcomeId); | |
| const foundOutcome = !outcomesReducer.loading && outcomesReducer.outcomes.find((outcome: any) => outcome.id === row.outcomeId); |
| calculationMethod: values.calculationMethod, | ||
| responsibleOrganizations: values.responsibleOrganizations, | ||
| frequency: values.frequency, | ||
| programId: values.programId ? values.programId: null, |
Copilot
AI
Sep 1, 2025
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.
[nitpick] Missing space after colon. Should be values.programId ? values.programId : null for consistent formatting.
| programId: values.programId ? values.programId: null, | |
| programId: values.programId ? values.programId : null, |
| .collect(Collectors.toSet()); | ||
| indicator.setResponsibleOrganizations(orgs); | ||
| } else { | ||
| indicator.setResponsibleOrganizations(new java.util.HashSet<>()); |
Copilot
AI
Sep 1, 2025
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.
[nitpick] Use the already imported HashSet class instead of the fully qualified name: new HashSet<>()
| indicator.setResponsibleOrganizations(new java.util.HashSet<>()); | |
| indicator.setResponsibleOrganizations(new HashSet<>()); |
| .collect(Collectors.toSet()); | ||
| indicator.setResponsibleOrganizations(orgs); | ||
| } else { | ||
| indicator.setResponsibleOrganizations(new java.util.HashSet<>()); |
Copilot
AI
Sep 1, 2025
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.
[nitpick] Same issue as above - use the imported HashSet class: new HashSet<>()
| indicator.setResponsibleOrganizations(new java.util.HashSet<>()); | |
| indicator.setResponsibleOrganizations(new HashSet<>()); |
AMP-31027: List/View Existing Outcomes and Outputs AMP-31028:Add New Outcome AMP-31029:Add New Output
AMP-31044: break down target and original value by dissagregation
a6db9b2 to
8c3fb35
Compare
…t similar logic for NPO/Theme/Program x indicator.
No description provided.