data-visualizer-app icon indicating copy to clipboard operation
data-visualizer-app copied to clipboard

fix: remove d2

Open edoardo opened this issue 3 years ago • 3 comments

Implements DHIS2-XXXX


Key features

  1. prepare to get rid of d2 entirely

Description

This branch has changes to remove the need for d2. There is still one place where d2 is needed and we don't have an alternative at the moment, the user data store.


TODO

  • [x] figure out how to use the user data store without d2
  • [ ] lots of regression testing
  • [x] fix tests, particularly the App.js tests, but before touching them we should figure out how we want to test, what should be tested in Cypress and what in unit tests
  • [ ] look for and clean up more code not needed
  • [x] see if it's possible to avoid fetching all user authorities to check for the ALL, do we really need the isSuperuser flag?

Known issues

  • [x] the user data store is used to store the visualization object when switching visualization from DV to Maps. Currently it relies on d2 as it's using some classes defined in that package.
  • [x] now that with this PR DV uses the app service data for getting/setting the current AO in the user data store, Maps should be updated in order to read the AO from the same key, since the app service stores the key under settings. Fixed here.

Screenshots

Not very meaningful but this is the app running on this branch: Screenshot 2022-07-21 at 15 16 34

edoardo avatar Jul 21 '22 13:07 edoardo

🚀 Deployed on https://pr-2125--dhis2-data-visualizer.netlify.app

dhis2-bot avatar Jul 21 '22 13:07 dhis2-bot

22 failed tests on run #1624 ↗︎

22 569 0 0 Flakiness 0

Details:

fix: set displayProperty from user settings required by Visualization
Project: Data Visualizer App Commit: 2840c2761c
Status: Failed Duration: 08:07 💡
Started: Feb 9, 2023 11:22 AM Ended: Feb 9, 2023 11:30 AM
Failed  open.cy.js • 14 failed tests

View Output Video

Test
opening a saved AO > Column > resets to a new AO Screenshot
opening a saved AO > Bar > resets to a new AO Screenshot
opening a saved AO > Stacked column > resets to a new AO Screenshot
opening a saved AO > Line > resets to a new AO Screenshot
opening a saved AO > Pie > resets to a new AO Screenshot
opening a saved AO > Gauge > resets to a new AO Screenshot
opening a saved AO > Radar > resets to a new AO Screenshot
opening a saved AO > Year over year (line) > resets to a new AO Screenshot
opening a saved AO > Pivot table > resets to a new AO Screenshot
opening a saved AO > Scatter > resets to a new AO Screenshot
The first 10 failed tests are shown, see all 14 tests in Cypress Cloud.
Failed  dimensions/period.cy.js • 3 failed tests

View Output Video

Test
Period dimension > initial state > period 'Last 3 months' is selected Screenshot
Period dimension > initial state > a period can be unselected by double click Screenshot
Period dimension > initial state > a period can be unselected by button Screenshot
Failed  visTypes/scatter.cy.js • 1 failed test

View Output Video

Test
using a Scatter chart > saves and displays items in the correct places Screenshot
Failed  confirmLeave.cy.js • 4 failed tests

View Output Video

Test
confirm leave modal > tries to open a new AO Screenshot
confirm leave modal > cancels leave Screenshot
confirm leave modal > tries to open a new AO Screenshot
confirm leave modal > confirms leave Screenshot

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

cypress[bot] avatar Nov 04 '22 14:11 cypress[bot]

🚀 Deployed on https://pr-2125--dhis2-data-visualizer.netlify.app

dhis2-bot avatar Nov 04 '22 14:11 dhis2-bot

Closing. Superseded by #3023 .

edoardo avatar Dec 05 '24 12:12 edoardo