dashboard-app
dashboard-app copied to clipboard
fix: reload iframe plugins when filters causing errors are changed/removed
Implements DHIS2-XXXX
Key features
- 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.
-
filterVersionwhich controls the clearing of the error in theIframePlugincomponent was never changing, thus not clearing the error when filters were changed/removed. - the
getPropslistener 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
IframePluginre-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:
Before, removing the filter did not reload the iframe plugin:
After, removing the filter correctly reloads the iframe plugin:
🚀 Deployed on https://pr-2675--dhis2-dashboard.netlify.app