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

[Dashboard] Create default custom dashboard #749

Open
mahalakshme opened this issue Jul 10, 2024 · 7 comments
Open

[Dashboard] Create default custom dashboard #749

mahalakshme opened this issue Jul 10, 2024 · 7 comments
Assignees
Labels

Comments

@mahalakshme
Copy link
Contributor

mahalakshme commented Jul 10, 2024

AC:

On creating a new organisation,

  • store a default custom dashboard with name(Default dashboard) with MyDashboard report cards within the dashboard sections and names like in MyDashboard. For 'Last 24 hours' report card, recent filters need to be selected.
  • In the Everyone group, mark it as primary dashboard
  • 'Primary dashboard' configuration in custom user groups will override the configuration in 'Everyone' group
  • The colour of the report cards need to be set to the hardcoded colours now - Scheduled - green(#388e3c), Overdue - red, other cards in white
  • Add 'As on date' and 'Subject type' as filters of the default custom dashboard.
  • Do not delete MyDashboardFilters in db and UI. It will be removed in the next release once this is stabilised and they are need for testing.
  • The default custom dashboard and report cards should be editable/deletable like any other custom dashboard
  • Any missing steps from the above to achieve configuration of MyDashboard via CustomDashboard
  • Expose the above functionality via API, to handle creation of default custom dashboard for the existing organisations. API should input organisation id and return status code(success or failure for the organisation).
    - Add readme documentation with steps/strategy and do's/dont's to guide the support team to handle creation of default custom dashboard for existing organisations and to manually create the filters
    - Should be able to execute the API only on an org whose category is UAT
    - In some orgs already, default report cards are added to a custom dashboard. Eg: in JSCS, 'Lab Facility' user group users, use a custom dashboard to which some default report cards are added. Other user groups have default dashboard, as the primary dashboard. To deal with such cases, add the already existing report card to the default custom dashboard(when the name of the report card and the standard_report_card_type_id matches) to avoid confusions since it is not possible to create a report card with same name from the UI.
  • Should be backward compatible, - meaning should work with old apk

Tech inputs:

  • The above migration to be done, by having an endpoint and not SQL migration. Feel free to change it.

Few points on testing:

  • Use the endpoint to migrate the MyDashboard in the relevant orgs and make sure it works. Update the prerelease db to be inline with the prod for the same if needed.
  • On upgrading an app in older version, the old cached filters and counts(on disabling dashboard autorefresh) for users in mobile app UI, should not cause failure
  • Some of the Shelter and JSSCP users have 'disableAutoRefresh' set to true
  • Configuration to not show Total when any program selected.
  • bundle import and update of default dashboard and report cards. And also bundle import/export when a default report card added to a custom dashboard

Analyst notes: Ignore

To communicate:

  • Mydashboard filters used by 6 orgs. So not much manual work.
  • will be deprecated after stabilised
  • support/implementation to do it for : 'Shelter UAT' and 'Adoloscent Sewa Rural UAT'
  • Cached filters and counts of MyDashboard will not be retained.
  • Default custom dashboard will appear in the More menu -> Dashboards
@mahalakshme mahalakshme changed the title Migrate MyDashboard to Custom Dashboard for pilot orgs Create default custom dashboard Jul 15, 2024
@mahalakshme mahalakshme changed the title Create default custom dashboard [Dashboard] Create default custom dashboard Jul 15, 2024
@1t5j0y 1t5j0y self-assigned this Aug 5, 2024
@1t5j0y
Copy link
Contributor

1t5j0y commented Aug 12, 2024

Approach modified for existing orgs - bundle upload will be used to create default dashboard. Steps documented on readme (not published) - https://dash.readme.com/project/avni/v2.0/docs/move-org-to-custom-dashboard-from-mydashboard

1t5j0y added a commit that referenced this issue Aug 23, 2024
Using random uuids creates duplicate entities during bundle upload
@1t5j0y
Copy link
Contributor

1t5j0y commented Aug 23, 2024

Fixes for issues reported

  • Client fix (unrelated to this story) commit
  • Changed default dashboard sections view type to 'Tile'

Additional fixes

  • Changed all default dashboard entities to use fixed uuids to avoid creation of duplicates via bundle upload

@1t5j0y
Copy link
Contributor

1t5j0y commented Sep 2, 2024

@Dinesh2019 as discussed please try with a fresh org as orgs created before the latest fix would have incorrect uuids for the different entities.

@1t5j0y
Copy link
Contributor

1t5j0y commented Sep 4, 2024

created #781 for the issue on older apks.
Moving back to QA ready to retest the other cases with fresh orgs.

@mahalakshme
Copy link
Contributor Author

mahalakshme commented Sep 4, 2024

@1t5j0y uploaded the bundle from readme to shelter org in staging environment. It is showing error file. On clicking error file, it shows oops page

Image

Didn't create report cards or dashboard from the bundle.
Keeping this in QA Ready itself so that other cases can be tested.

@mahalakshme
Copy link
Contributor Author

@1t5j0y also tried in Adoloscent Sewa Rural UAT in staging, got the below error file:

errors-defaultdashboard.csv

@1t5j0y
Copy link
Contributor

1t5j0y commented Sep 5, 2024

Moved back to original approach of using an API to create default dashboard for an org to get around inconsistencies in uuids in different environments.
POST /api/defaultDashboard/create?orgId=1234

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: QA Ready
Development

No branches or pull requests

3 participants
@mahalakshme @1t5j0y and others