dashboard-app icon indicating copy to clipboard operation
dashboard-app copied to clipboard

fix: reload iframe plugins when filters causing errors are changed/removed

Open edoardo opened this issue 2 years ago • 1 comments

Implements DHIS2-XXXX


Key features

  1. fix a bug that prevented iframe plugins from reloading when filters causing errors are changed/removed

Description

Sometimes when applying certain filters some iframe plugin can show an error, for example if no analytics data is returned. When this happens, an error screen is shown in place of the iframe tag. When removing the filter, the error screen was still shown and the iframe plugin was not reloaded.

The PR addresses 2 issues.

  1. filterVersion which controls the clearing of the error in the IframePlugin component was never changing, thus not clearing the error when filters were changed/removed.
  2. the getProps listener was not initialised when the iframe tag was added again, causing the plugin to fail to load.

TODO

  • [ ] fix Cypress tests

Known issues

  • [ ] Cypress tests related to dashboard filters are still failing. The issue seem to be that IframePlugin re-render more than needed and Cypress runs the tests after the first re-render which still has the "outdated" UI.

Screenshots

Filter causing an error: Screenshot 2023-08-16 at 13 03 49

Before, removing the filter did not reload the iframe plugin: Screenshot 2023-08-16 at 13 04 09

After, removing the filter correctly reloads the iframe plugin: Screenshot 2023-08-16 at 13 04 20

edoardo avatar Aug 16 '23 11:08 edoardo

🚀 Deployed on https://pr-2675--dhis2-dashboard.netlify.app

dhis2-bot avatar Aug 16 '23 11:08 dhis2-bot