-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: iframe plugin support (#2110)
* chore: convert to functional component * feat: enable EVENT_VISUALIZATION dashboard item types * feat: allow iframe plugin overrides for dev/test * feat: render LL plugin in iframe * chore: add dependency for post-robot * chore: update pot file * fix: lookup in installed apps for the plugin URL to use in the iframe * chore: remove TODO comment * chore: update pot file * chore: add handy deduplicate yarn command * fix: fix ui dependency * chore: run prettier * refactor: rewrite condition for better readability * fix: remove Suspense which might interfere with the iframe * fix: ensure the selector content fits in the container This is a ui issue: dhis2/ui#1152. * refactor: use Layer + Popper to avoid bottom double border * fix: remove redundant overflow rule, fixed in ui This reverts commit a36ab37. * chore: deduplicate yarn.lock * refactor: preserve height/width if provided, update props passed * refactor: use iframe for DV plugin * chore: remove unused import * feat: add recording props to plugin (#2125) * fix(pwa): make cache filters more specifc * feat(plugins): add `record` prop to iframe plugins when caching dashboard * feat: remove cached plugin data with dashboard * chore: run Prettier * test: fix failing tests * chore: remove unused code * chore: run Prettier * fix: pass correct prop for display property Also do not pass the whole userSettings object, not used in the plugins where the only thing really needed is the displayProperty for the analytics request. * chore: deduplicate yarn.lock * fix: add more paths to omit from cache Replaced deprecated config key with new one. * fix: show error when iframe src is not available Also avoid adding postRobot handlers when the iframeRef is not available, this removes some extra errors. * fix: do not pass filtered AO to LL plugin Filters don't work in LL without modifications. For now just disable filtering for LL items. * fix: set error when pluginLaunchUrl is not available The app could be installed and the entry in apps api returned, but the plugin launch URL can be missing, in that case the plugin cannot be loaded in the iframe. * refactor: use specific reducer selector * fix: remove View As in context menu for LL items * fix: clear selected from Redux when editing a new dashboard * feat: add tags on item header, used for filters in LL For LL items we don't apply filters. Show a tag in the item header to indicate this to the user. * feat: add overlay on LL items to inform about not applied filters * refactor: move the overlay handling to the parent component In this way both the tag in the item header and the overlay in the item content can be controlled at the same time allowing for toggling the tag depending on whether the overlay is shown or not. * test: update snapshots * fix: remove tag icon and fix styles Approved by Joe. * chore: update pot file * fix: remove context menu when plugin is not installed * fetch schema for eventVisualizations, required by the interpretations component * fix: rename Event visualizations to Line lists This appears as section title in the dashboard item search. * feat: add custom message for when the plugin is not installed More friendly than the generic error message. In this case there isn't any problem with the dashboard item, but the plugin for rendering the item is not installed. We inform the user about it and suggest to install the missing app from the app hub. * refactor: propagate d2 needed to check installed apps * feat: use iframe for Map items * chore: update d2-ui-interpretations component * fix: update iframe src and props when using View As * chore: fix linting issue * fix: fix re-render of visualizations when interpretations panel toggles (#2199) * fix: add app id for DV when fetched from installed apps * fix: detect plugin availability via plugin launch URL * fix: add fallback to bundled plugin path for core apps This addresses the case of core apps plugins which are always served from the bundled app's path, instead of from api/apps. For core (bundled) apps: * first we look at the api/apps, if there is an entry there for the app it means it has been manually installed from the app hub overriding the bundled version. The plugin URL in this case is not in the format api/apps but dhis-web-*. * if no entry is returned from api/apps we use the "hardcoded" path (as before) thus using the bundled version of the plugin. This should work for situations where a new version of a core app is installed or uninstalled from the app hub. * chore: remove accidentally committed temp files * fix: use base url without api version This should solve the issue of bundled apps plugin not working in iframes. * fix: deduplicate yarn.lock * fix: attempt at fixing the sizing issue in DV iframe content * feat: map plugin (#2229) --------- Co-authored-by: Kai Vandivier <[email protected]> Co-authored-by: Jen Jones Arnesen <[email protected]>
- Loading branch information
1 parent
3901e2d
commit 7f3eb17
Showing
34 changed files
with
930 additions
and
424 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import PropTypes from 'prop-types' | ||
import React from 'react' | ||
import classes from './styles/ItemHeader.module.css' | ||
|
||
const ViewItemTags = ({ tags }) => | ||
tags ? <div className={classes.itemTagsWrap}>{tags}</div> : null | ||
|
||
ViewItemTags.propTypes = { | ||
tags: PropTypes.node, | ||
} | ||
|
||
export default ViewItemTags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.