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 plugin (DHIS2-17283) #3051

Open
wants to merge 72 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
f0c0334
chore: use alpha versions of platform and runtime
edoardo Jun 22, 2023
e636371
refactor: use generic Plugin component from the platform
edoardo Jun 22, 2023
e6d6110
chore: update app-runtime, cli-app-scripts deps
edoardo Oct 4, 2023
8e8af7c
refactor: handle recording on first load, pass width and height
edoardo Oct 9, 2023
08b2b61
fix: regenerate yarn.lock file
edoardo Oct 9, 2023
beed98f
chore: update app-runtime and cli-app-scripts to latest
edoardo May 24, 2024
f58f82d
fix: replace deprecated prop with new one
edoardo May 27, 2024
e167e9d
fix: avoid warning about nested a tags
edoardo May 27, 2024
e8f11ef
fix: silence linter warning
edoardo May 27, 2024
d9748f2
refactor: simplify communication for offline caching
edoardo May 27, 2024
62a47d1
chore: bump cli-app-scripts dependency
edoardo Jun 3, 2024
61afc0c
chore: bump cli-app-scripts
edoardo Jun 7, 2024
2f4e642
chore: remove unused post-robot dependency
edoardo Jul 1, 2024
05a652b
chore: fix duplicate app-runtime
edoardo Jul 5, 2024
c5b94ae
chore: resolve i18next to <21 to avoid plural strings issues
edoardo Jul 5, 2024
008e832
chore: remove i18next direct dep, resolve i18next-scanner
edoardo Jul 5, 2024
1113168
chore: cleanup deps to fix failing build
edoardo Jul 10, 2024
4088228
chore: add missing cli-style dep, remove ui resolution
edoardo Jul 10, 2024
d4d8162
fix: fix linting error
edoardo Jul 10, 2024
eda8671
chore: run prettier to fix linting errors
edoardo Jul 10, 2024
e2fccbe
test: update snapshots
edoardo Jul 10, 2024
e2efb09
fix: move visualization fetch in try/catch
edoardo Jul 11, 2024
ef8de94
chore: update cli-app-scripts, remove resolution for i18next-scanner
edoardo Jul 29, 2024
5c40e73
chore: restore lost deps
edoardo Aug 2, 2024
ee8624e
chore(deps): bump the security group with 3 updates (#3046)
dependabot[bot] Aug 6, 2024
14d6de5
chore(deps): bump ansi-regex from 3.0.0 to 3.0.1 (#3047)
dependabot[bot] Aug 6, 2024
4ef7006
chore: use alpha versions of platform and runtime
edoardo Jun 22, 2023
f88216c
chore: update app-runtime, cli-app-scripts deps
edoardo Oct 4, 2023
4132585
fix: regenerate yarn.lock file
edoardo Oct 9, 2023
6186102
chore: update app-runtime and cli-app-scripts to latest
edoardo May 24, 2024
9d40c02
feat: support custom dashboard plugins (DHIS2-17283)
edoardo Aug 9, 2024
5281d44
chore: fix linting errors
edoardo Aug 15, 2024
4a58dba
chore: restore @dhis2/ui dep that got lost
edoardo Aug 15, 2024
1a42f9e
Merge remote-tracking branch 'origin/master' into feat/support-custom…
edoardo Aug 15, 2024
f90d9db
Merge remote-tracking branch 'origin/master' into refactor/use-platfo…
edoardo Aug 16, 2024
84d44af
Merge branch 'refactor/use-platform-plugin-components' into feat/supp…
edoardo Aug 16, 2024
fe16adf
chore: remove direct dependency for @dhis2/ui
edoardo Aug 19, 2024
1fc9af9
fix: avoid crash if app details are not available
edoardo Aug 19, 2024
722f644
refactor: make the missing plugin error more generic
edoardo Aug 22, 2024
81f81f1
fix: pass dashboard filters to custom plugins
edoardo Aug 22, 2024
c840b95
refactor: use same styles for error messages
edoardo Aug 22, 2024
32aac8b
refactor: move item size logic to GridItem
edoardo Aug 30, 2024
d3a3bad
refactor: pass width/height to AppItem to fix resize/refresh issue (D…
edoardo Aug 30, 2024
2f971ce
fix: force fixed dimensions (DHIS2-17947)
edoardo Aug 30, 2024
b6b1f20
refactor: use cached callback to avoid re-render
edoardo Aug 30, 2024
a2be2f6
chore: regenerate pot file
edoardo Aug 30, 2024
a4cbdd9
fix: extend compatible version check to DV/Maps
edoardo Sep 3, 2024
c8c970e
chore: regenerate pot file
edoardo Sep 3, 2024
0935585
Merge remote-tracking branch 'origin/master' into refactor/use-platfo…
edoardo Sep 3, 2024
d283611
test: fix test for version compatibility
edoardo Sep 3, 2024
82359d8
chore: regenerate yarn.lock
edoardo Sep 3, 2024
ee9a44e
refactor: move error screen to component for easier reuse
edoardo Sep 3, 2024
269545e
Merge remote-tracking branch 'origin/refactor/use-platform-plugin-com…
edoardo Sep 4, 2024
43509c0
refactor: move fullscreen functions together in Item folder
edoardo Sep 4, 2024
e54d5a5
refactor: move FatalErrorBoundary and memoizeOne in Item folder
edoardo Sep 4, 2024
7918a23
refactor: adjust imports and use shared fullscreen functions
edoardo Sep 4, 2024
4da285e
feat: enable View fullscreen and Open in for custom plugin items
edoardo Sep 4, 2024
9deef76
chore: regenerate pot file
edoardo Sep 4, 2024
6dfc103
refactor: update resize logic
edoardo Sep 5, 2024
3628645
fix: remove unused prop
edoardo Sep 5, 2024
63899c6
chore: update deps
edoardo Sep 5, 2024
b594313
chore: regenerate pot file
edoardo Sep 5, 2024
5472ff5
test: update snapshots
edoardo Sep 5, 2024
b5ff702
test: update imports and use of data from cached data query
edoardo Sep 5, 2024
1c948a6
chore: fix linting error
edoardo Sep 5, 2024
a03b39c
test: update test for AppItem
edoardo Sep 6, 2024
27f259a
fix: update app-runtime with fix for item resize
edoardo Sep 11, 2024
437c52b
refactor: set custom title also in edit mode
edoardo Oct 10, 2024
df72351
Merge remote-tracking branch 'origin/master' into feat/support-custom…
edoardo Oct 10, 2024
10208be
fix: convert CSS for rtl support
edoardo Oct 10, 2024
927bf34
chore: regenerate yarn.lock
edoardo Oct 10, 2024
eaeb759
fix: update next app versions
edoardo Oct 15, 2024
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
73 changes: 47 additions & 26 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-08-27T07:26:05.058Z\n"
"PO-Revision-Date: 2024-08-27T07:26:05.060Z\n"
"POT-Creation-Date: 2024-09-05T09:50:00.214Z\n"
"PO-Revision-Date: 2024-09-05T09:50:00.215Z\n"

msgid "Untitled dashboard"
msgstr "Untitled dashboard"
Expand All @@ -26,12 +26,33 @@ msgstr "Show fewer dashboards"
msgid "Show more dashboards"
msgstr "Show more dashboards"

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 for rendering this item is not available"
msgstr "The plugin for rendering 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 @@ -77,9 +98,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 @@ -89,9 +107,6 @@ msgstr "Show details and interpretations"
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 @@ -116,39 +131,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 "Not available offline"
msgstr "Not available offline"

Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@
"license": "BSD-3-Clause",
"dependencies": {
"@dhis2/analytics": "^26.8.2",
"@dhis2/app-runtime": "^3.10.6",
"@dhis2/app-runtime": "^3.11.0",
"@dhis2/app-runtime-adapter-d2": "^1.1.0",
"@dhis2/d2-i18n": "^1.1.3",
"@dhis2/ui": "^9.11.3",
"@krakenjs/post-robot": "^11.0.0",
"classnames": "^2.3.2",
"d2": "^31.10.0",
"d2-utilizr": "^0.2.16",
"i18next": "^20.3.5",
"lodash": "^4.17.21",
"moment": "^2.30.1",
"react": "^16.14.0",
Expand Down
8 changes: 7 additions & 1 deletion 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',
rootOrgUnits: rootOrgUnits.organisationUnits,
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