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

feat: support custom 3rd party plugins #3184

Open
wants to merge 58 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
986cb88
refactor: use generic Plugin component from the platform
edoardo Jun 22, 2023
85c4772
refactor: handle recording on first load, pass width and height
edoardo Oct 9, 2023
50b6dbc
chore: update app-runtime and cli-app-scripts to latest
edoardo May 24, 2024
f391aac
fix: replace deprecated prop with new one
edoardo May 27, 2024
26dc96b
fix: silence linter warning
edoardo May 27, 2024
7649773
refactor: simplify communication for offline caching
edoardo May 27, 2024
dd256ea
fix: fix linting error
edoardo Jul 10, 2024
50771b2
fix: move visualization fetch in try/catch
edoardo Jul 11, 2024
27ff14e
chore(deps): bump the security group with 3 updates (#3046)
dependabot[bot] Aug 6, 2024
a911ab4
feat: support custom dashboard plugins (DHIS2-17283)
edoardo Aug 9, 2024
198777d
fix: avoid crash if app details are not available
edoardo Aug 19, 2024
55eb811
refactor: make the missing plugin error more generic
edoardo Aug 22, 2024
c645022
fix: pass dashboard filters to custom plugins
edoardo Aug 22, 2024
0dd46dd
refactor: use same styles for error messages
edoardo Aug 22, 2024
9294c08
refactor: move item size logic to GridItem
edoardo Aug 30, 2024
df41ff6
refactor: pass width/height to AppItem to fix resize/refresh issue (D…
edoardo Aug 30, 2024
a604989
fix: force fixed dimensions (DHIS2-17947)
edoardo Aug 30, 2024
d26d952
refactor: use cached callback to avoid re-render
edoardo Aug 30, 2024
0f2bcf5
fix: extend compatible version check to DV/Maps
edoardo Sep 3, 2024
ac795a3
test: fix test for version compatibility
edoardo Sep 3, 2024
0cfb58a
refactor: move error screen to component for easier reuse
edoardo Sep 3, 2024
8c60abe
refactor: move fullscreen functions together in Item folder
edoardo Sep 4, 2024
18d29b3
refactor: move FatalErrorBoundary and memoizeOne in Item folder
edoardo Sep 4, 2024
4ed8f29
refactor: adjust imports and use shared fullscreen functions
edoardo Sep 4, 2024
5f217df
feat: enable View fullscreen and Open in for custom plugin items
edoardo Sep 4, 2024
e5e49da
refactor: update resize logic
edoardo Sep 5, 2024
7f7defc
fix: remove unused prop
edoardo Sep 5, 2024
2f900cf
test: update snapshots
edoardo Sep 5, 2024
73560e6
test: update imports and use of data from cached data query
edoardo Sep 5, 2024
e007763
chore: fix linting error
edoardo Sep 5, 2024
42a2681
test: update test for AppItem
edoardo Sep 6, 2024
1346cf3
refactor: set custom title also in edit mode
edoardo Oct 10, 2024
ed48787
fix: convert CSS for rtl support
edoardo Oct 10, 2024
9ab3c59
fix: update next app versions
edoardo Oct 15, 2024
0b90335
feat: pass dashboardMode to plugins
edoardo Oct 21, 2024
21f9305
refactor: update message about missing plugin
edoardo Oct 21, 2024
d95355a
fix: fix URL to App management app
edoardo Oct 31, 2024
550fcd0
test: fix app-runtime resolution for Jest, updated snapshot
edoardo Nov 4, 2024
e5f29db
chore: remove debug log
edoardo Nov 15, 2024
891cb9e
feat: use delete callback from plugins
edoardo Nov 22, 2024
ff83690
test: fix failing test
edoardo Nov 25, 2024
830c69f
fix: fix bug which caused 3rd party plugins to not always load
edoardo Dec 2, 2024
62c8dbd
refactor: wrap ref callback in useCallback
edoardo Dec 2, 2024
e334775
refactor: fix sonarcloud issues
edoardo Dec 2, 2024
43e5591
fix: fix arguments order
edoardo Dec 3, 2024
9f79651
test: fix tests after refactoring
edoardo Dec 3, 2024
5d423d2
refactor: remove unnecessary filterVersion prop
edoardo Dec 6, 2024
1bd7d4c
fix: make filterVersion actually change
edoardo Dec 6, 2024
7b2040b
refactor: use same style for errors
edoardo Dec 11, 2024
f8a0faa
test: fix test snapshot
edoardo Dec 11, 2024
e65eede
chore: remove unused code
edoardo Dec 12, 2024
6e065c7
chore: remove unused import
edoardo Dec 12, 2024
fc58c75
chore: regenerate en.pot
jenniferarnesen Jan 15, 2025
6d18415
chore: update dependencies
jenniferarnesen Jan 15, 2025
0bbb851
chore: merge conflict adjustments
jenniferarnesen Jan 15, 2025
0c7ec29
chore: fix jest test setup
HendrikThePendric Jan 16, 2025
9bfff22
chore: update snapshot to fix jest test
HendrikThePendric Jan 16, 2025
881354a
chore: updated yarn lock after deduplicating deps
HendrikThePendric Jan 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 46 additions & 28 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2024-12-19T11:30:27.893Z\n"
"PO-Revision-Date: 2024-12-19T11:30:27.893Z\n"
"POT-Creation-Date: 2025-01-15T14:37:33.573Z\n"
"PO-Revision-Date: 2025-01-15T14:37:33.574Z\n"

msgid "Untitled dashboard"
msgstr "Untitled dashboard"
Expand Down Expand Up @@ -120,15 +120,33 @@ msgstr "Search for a dashboard"
msgid "No dashboards found"
msgstr "No dashboards found"

msgid "{{appKey}} app not found"
msgstr "{{appKey}} app not found"
msgid "There was a problem loading this dashboard item"
msgstr "There was a problem loading this dashboard item"

msgid "Open in {{appName}}"
msgstr "Open in {{appName}}"

msgid "View fullscreen"
msgstr "View fullscreen"

msgid "Remove this item"
msgstr "Remove this item"

msgid "This item has been shortened to fit on one page"
msgstr "This item has been shortened to fit on one page"

msgid "The plugin needed to display this item is not available"
msgstr "The plugin needed to display this item is not available"

msgid "Install the {{pluginName}} plugin from the App Hub"
msgstr "Install the {{pluginName}} plugin from the App Hub"

msgid "There was an error loading data for this item"
msgstr "There was an error loading data for this item"

msgid "Open this item in {{appName}}"
msgstr "Open this item in {{appName}}"

msgid "Remove"
msgstr "Remove"

Expand Down Expand Up @@ -174,9 +192,6 @@ msgstr "Only Period and Organisation unit filters can be applied to this item"
msgid "Some filters not applied"
msgstr "Some filters not applied"

msgid "There was a problem loading this dashboard item"
msgstr "There was a problem loading this dashboard item"

msgid "Hide details and interpretations"
msgstr "Hide details and interpretations"

Expand All @@ -189,9 +204,6 @@ msgstr "Open menu"
msgid "Open in {{appName}} app"
msgstr "Open in {{appName}} app"

msgid "View fullscreen"
msgstr "View fullscreen"

msgid "This map can't be displayed as a chart"
msgstr "This map can't be displayed as a chart"

Expand All @@ -216,39 +228,45 @@ msgstr "View as Map"
msgid "There was a problem loading interpretations for this item"
msgstr "There was a problem loading interpretations for this item"

msgid "The plugin for rendering this item is not available"
msgstr "The plugin for rendering this item is not available"

msgid "Install the {{appName}} app from the App Hub"
msgstr "Install the {{appName}} app from the App Hub"

msgid "No data to display"
msgstr "No data to display"

msgid ""
"Install Line Listing app version ${minLLVersion.join(\n"
" '.'\n"
" )} or higher in order to display this item."
"Install Data Visualizer app ${minDVVersion.join(\n"
" '.'\n"
" )} or higher in order to display this item."
msgstr ""
"Install Line Listing app version ${minLLVersion.join(\n"
" '.'\n"
" )} or higher in order to display this item."
"Install Data Visualizer app ${minDVVersion.join(\n"
" '.'\n"
" )} or higher in order to display this item."

msgid "Show without filters"
msgstr "Show without filters"

msgid ""
"Install Line Listing app ${minLLVersion.join(\n"
" '.'\n"
" )} or higher in order to display this item."
msgstr ""
"Install Line Listing app ${minLLVersion.join(\n"
" '.'\n"
" )} or higher in order to display this item."

msgid "Maps with Earth Engine layers cannot be displayed when offline"
msgstr "Maps with Earth Engine layers cannot be displayed when offline"

msgid ""
"Install Maps app ${minMapsVersion.join(\n"
" '.'\n"
" )} or higher in order to display this item."
msgstr ""
"Install Maps app ${minMapsVersion.join(\n"
" '.'\n"
" )} or higher in order to display this item."

msgid "Unable to load the plugin for this item"
msgstr "Unable to load the plugin for this item"

msgid "There was an error loading data for this item"
msgstr "There was an error loading data for this item"

msgid "Open this item in {{appName}}"
msgstr "Open this item in {{appName}}"

msgid "Resources"
msgstr "Resources"

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
"license": "BSD-3-Clause",
"dependencies": {
"@dhis2/analytics": "^26.9.4",
"@dhis2/app-runtime": "^3.10.6",
"@dhis2/app-runtime": "^3.11.3",
"@dhis2/app-runtime-adapter-d2": "^1.1.0",
"@dhis2/d2-i18n": "^1.1.3",
"@dhis2/ui": "^10.1.4",
"@krakenjs/post-robot": "^11.0.0",
"classnames": "^2.3.2",
"d2": "^31.10.0",
"d2-utilizr": "^0.2.16",
Expand Down Expand Up @@ -68,7 +67,8 @@
},
"jest": {
"moduleNameMapper": {
"^.+\\.(css|sass|scss)$": "identity-obj-proxy"
"^.+\\.(css|sass|scss)$": "identity-obj-proxy",
"@dhis2/app-runtime/experimental": "<rootDir>/node_modules/@dhis2/app-runtime/build/cjs/experimental.js"
},
"setupFilesAfterEnv": [
"<rootDir>/config/testSetup.js"
Expand Down
6 changes: 6 additions & 0 deletions src/AppWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,16 @@ const query = {
}

const providerDataTransformation = ({ rootOrgUnits, apps, currentUser }) => {
const dataVisualizerApp =
apps.find((app) => app.key === 'data-visualizer') || {}
const lineListingApp = apps.find((app) => app.key === 'line-listing') || {}
const mapsApp = apps.find((app) => app.key === 'maps') || {}

return {
rootOrgUnits: rootOrgUnits.organisationUnits,
dataVisualizerAppVersion: dataVisualizerApp.version || '0.0.0',
lineListingAppVersion: lineListingApp.version || '0.0.0',
mapsAppVersion: mapsApp.version || '0.0.0',
currentUser,
apps,
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/DropdownButton/DropdownButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const DropdownButton = ({
</Button>
</OfflineTooltip>
{open && (
<Layer onClick={onClick} transparent>
<Layer onBackdropClick={onClick} transparent>
<Popper placement="bottom-start" reference={anchorRef}>
{component}
</Popper>
Expand Down
Loading
Loading