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

refactor: use platform/runtime plugin components #2431

Draft
wants to merge 31 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 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
f90d9db
Merge remote-tracking branch 'origin/master' into refactor/use-platfo…
edoardo Aug 16, 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
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
34 changes: 26 additions & 8 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-03-19T12:31:03.302Z\n"
"PO-Revision-Date: 2024-03-19T12:31:03.302Z\n"
"POT-Creation-Date: 2024-09-02T10:19:20.774Z\n"
"PO-Revision-Date: 2024-09-02T10:19:20.774Z\n"

msgid "Untitled dashboard"
msgstr "Untitled dashboard"
Expand Down Expand Up @@ -126,20 +126,38 @@ 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"

Expand Down
13 changes: 3 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@
"private": true,
"license": "BSD-3-Clause",
"dependencies": {
"@dhis2/app-runtime": "^3.10.6",
"@dhis2/analytics": "^26.8.2",
"@dhis2/app-runtime": "^3.10.2",
"@dhis2/app-runtime-adapter-d2": "^1.1.0",
"@dhis2/d2-i18n": "^1.1.3",
"@dhis2/ui": "^9.2.0",
"@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 Expand Up @@ -46,8 +42,8 @@
"@badeball/cypress-cucumber-preprocessor": "^20.1.0",
"@bahmutov/cypress-esbuild-preprocessor": "^2.2.1",
"@cypress/webpack-preprocessor": "^6.0.2",
"@dhis2/cli-app-scripts": "^10.3.10",
"@dhis2/cli-style": "^10.5.1",
"@dhis2/cli-app-scripts": "^11.7.0",
"@dhis2/cli-style": "^10.7.3",
"@dhis2/cypress-commands": "^10.0.6",
"@dhis2/cypress-plugins": "^10.0.6",
"@semantic-release/changelog": "^6",
Expand All @@ -70,8 +66,5 @@
"moduleNameMapper": {
"^.+\\.(css|sass|scss)$": "identity-obj-proxy"
}
},
"resolutions": {
"@dhis2/ui": "^9.2.0"
}
}
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
16 changes: 8 additions & 8 deletions src/components/Item/VisualizationItem/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ class Item extends Component {
}

async componentDidMount() {
// Avoid refetching the visualization already in the Redux store
// when the same dashboard item is added again.
// This also solves a flashing of all the "duplicated" dashboard items.
!this.props.visualization.id &&
this.props.setVisualization(
await apiFetchVisualization(this.props.item)
)

try {
// Avoid refetching the visualization already in the Redux store
// when the same dashboard item is added again.
// This also solves a flashing of all the "duplicated" dashboard items.
!this.props.visualization.id &&
this.props.setVisualization(
await apiFetchVisualization(this.props.item)
)

if (
this.props.settings
.keyGatherAnalyticalObjectStatisticsInDashboardViews &&
Expand Down
Loading
Loading