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

List style report cards #1256

Closed
Tracked by #1461
mahalakshme opened this issue Dec 26, 2023 · 4 comments
Closed
Tracked by #1461

List style report cards #1256

mahalakshme opened this issue Dec 26, 2023 · 4 comments
Assignees
Labels

Comments

@mahalakshme
Copy link
Contributor

mahalakshme commented Dec 26, 2023

Motivation:

  • Frequently there are cases where across report cards very similar logic is used and only a value used for comparison, changes. Eg: in one of our partner organisations, we load 'Total SAM children' and 'Total MAM children'. For rendering each takes around 20-30s. And hence the dashboard nos doesn't load until both the report card results are calculated and it makes the user to wait for a minute. If the logic is combined, we can render the results in 30s since it would need only retrieval from db and iterating once.
  • The above kind of scenarios also lead to code duplication across report cards and when some requirement changes - say for the above SAM and MAM children less than 5 years then the change needs to be done in both.

Acceptance criteria:

  • Modify the return structure to be able to render multiple report cards on UI from single ReportCard rule definition as mentioned in the Technical details
  • The card name and the colour (Text and card background) defined in report card rule will override whatever defined/selected via webapp UI
  • Should be backward compatible - should work with old return object structure as well
  • The colour we define in the UI is used as background color in Tile view and background colour of Text in List View(right side box). Let it remain/work the same.
  • The value of colour should accept hexcode values and colors that can be defined in css styling.
  • Documentation has to be updated related to custom dashboard Report-cards
  • When the Number in the nested report card and the number of cards in the return structure dont match show the error Configured number of cards don't match with the number of cards in the rule on the cards rendered by the nested report card(independent of whether the configured number is greater than or less than the no of cards in the rule)
  • Show an appropriate default rule

Technical details:

Current structure:

{
        primaryValue: undernourishedCount,
        secondaryValue: `${percentValue}%`,
        lineListFunction: undernourishedIndividuals,
    };

Structure to be:

{
  reportCards: [
  {
        primaryValue: undernourishedCount,
        secondaryValue: `${percentValue}%`,
        lineListFunction: undernourishedIndividuals,
        cardName: 'name value',
        cardColor: '#hexone',
        textColor: '#hextwo',
    },
....
 ]
}
@mahalakshme mahalakshme converted this from a draft issue Dec 26, 2023
@mahalakshme mahalakshme moved this from In Analysis to Ready in Avni Product Jan 8, 2024
@himeshr himeshr self-assigned this Jan 11, 2024
@himeshr himeshr moved this from Ready to In Progress in Avni Product Jan 11, 2024
himeshr added a commit to avniproject/avni-models that referenced this issue Jan 15, 2024
himeshr added a commit that referenced this issue Jan 16, 2024
himeshr added a commit to avniproject/avni-server that referenced this issue Jan 23, 2024
himeshr added a commit to avniproject/avni-models that referenced this issue Jan 23, 2024
himeshr added a commit to avniproject/avni-server that referenced this issue Jan 23, 2024
himeshr added a commit to avniproject/avni-webapp that referenced this issue Jan 23, 2024
himeshr added a commit that referenced this issue Jan 23, 2024
himeshr added a commit that referenced this issue Jan 23, 2024
himeshr added a commit to avniproject/avni-webapp that referenced this issue Jan 24, 2024
himeshr added a commit that referenced this issue Jan 24, 2024
himeshr added a commit to avniproject/avni-webapp that referenced this issue Jan 24, 2024
himeshr added a commit that referenced this issue Jan 25, 2024
himeshr added a commit to avniproject/avni-webapp that referenced this issue Jan 25, 2024
himeshr added a commit that referenced this issue Jan 25, 2024
@himeshr
Copy link
Contributor

himeshr commented Jan 25, 2024

Related screenshots


Count Mismatch on client

Count Mismatch on client

Nested Report cards on client

Nested Report cards on client

Edit Report card on webapp

Edit Report card on webapp

@himeshr himeshr moved this from In Progress to Code Review Ready in Avni Product Jan 25, 2024
@himeshr
Copy link
Contributor

himeshr commented Jan 25, 2024

Related documentation has also been added here

himeshr added a commit that referenced this issue Jan 29, 2024
@petmongrels petmongrels moved this from Code Review Ready to In Code Review in Avni Product Jan 30, 2024
@petmongrels
Copy link
Contributor

  • CustomDashboardActions.js L:123 - instead of _.map, we should use _.forEach as there is no return value (same for L:131)
  • Translation will be required for secondaryValue in different places
  • not able to understand the meaning of finding # in a UUID

@petmongrels petmongrels moved this from In Code Review to Code Review with Comments in Avni Product Jan 30, 2024
himeshr added a commit to avniproject/avni-models that referenced this issue Jan 31, 2024
himeshr added a commit that referenced this issue Jan 31, 2024
@himeshr himeshr moved this from Code Review with Comments to Code Review Ready in Avni Product Jan 31, 2024
@himeshr
Copy link
Contributor

himeshr commented Jan 31, 2024

Added platform translations, sample of which is available below.
Screenshot 2024-01-31 at 2 03 58 PM

@petmongrels petmongrels moved this from Code Review Ready to QA Ready in Avni Product Jan 31, 2024
@AchalaBelokar AchalaBelokar moved this from QA Ready to In QA in Avni Product Feb 1, 2024
@AchalaBelokar AchalaBelokar moved this from In QA to Done in Avni Product Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

4 participants