Skip to content

Commit

Permalink
chore(deps): update app-runtime to latest (#36)
Browse files Browse the repository at this point in the history
* chore(deps): update app-runtime to latest beta

* test(display): update display test for new use-data-query behaviour

* chore: update pot file

Co-authored-by: Hendrik de Graaf <[email protected]>
  • Loading branch information
ismay and HendrikThePendric authored Aug 12, 2021
1 parent bf678c0 commit 5d618cd
Show file tree
Hide file tree
Showing 5 changed files with 155 additions and 66 deletions.
5 changes: 5 additions & 0 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2021-08-12T11:12:06.430Z\n"
"PO-Revision-Date: 2021-08-12T11:12:06.430Z\n"
"POT-Creation-Date: 2021-08-12T12:36:19.640Z\n"
"PO-Revision-Date: 2021-08-12T12:36:19.640Z\n"

msgid "Not authorized"
msgstr "Not authorized"
Expand Down Expand Up @@ -78,6 +80,9 @@ msgstr ""
"{{- workflowName}} has multiple data sets. Choose a data set from the tabs "
"above."

msgid "Loading data set"
msgstr "Loading data set"

msgid "There was a problem displaying this data set"
msgstr "There was a problem displaying this data set"

Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
"start": "d2-app-scripts start",
"test": "d2-app-scripts test"
},
"resolutions": {
"@dhis2/app-runtime": "2.9.0-beta.6"
},
"devDependencies": {
"@dhis2/cli-app-scripts": "^7.1.0",
"@dhis2/cli-app-scripts": "^7.1.1",
"@dhis2/cli-style": "^9.0.1",
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^12.0.0",
Expand All @@ -26,7 +29,7 @@
"mockdate": "^3.0.5"
},
"dependencies": {
"@dhis2/app-runtime": "^2.8.0",
"@dhis2/app-runtime": "^2.9.0-beta.6",
"@dhis2/ui": "^6.10.5",
"history": "^5.0.0",
"prop-types": "^15.7.2",
Expand Down
22 changes: 11 additions & 11 deletions src/data-workspace/display/display.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ const Display = ({ dataSetId }) => {
)
}

if ((!called && periodIds.length) || loading) {
return (
<div className={styles.display}>
<div className={styles.loadingWrapper}>
<CircularLoader small />
{i18n.t('Loading data set')}
</div>
</div>
)
}

if (error) {
return (
<div className={styles.display}>
Expand All @@ -88,17 +99,6 @@ const Display = ({ dataSetId }) => {
)
}

if ((!called && periodIds.length) || loading) {
return (
<div className={styles.display}>
<div className={styles.loadingWrapper}>
<CircularLoader small />
{i18n.t('Loading data set')}
</div>
</div>
)
}

if (!periodIds.length || !tables.length) {
return (
<div className={styles.noData}>
Expand Down
19 changes: 11 additions & 8 deletions src/data-workspace/display/display.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,17 @@ describe('<Display>', () => {

data.dataSetReport = []
userEvent.click(screen.getByRole('button', 'Retry loading data set'))
await waitForElementToBeRemoved(() => screen.getByRole('progressbar'))

expect(
screen.queryByRole(
'heading',
'There was a problem displaying this data set'
)
).not.toBeInTheDocument()
await waitFor(() => screen.getByRole('progressbar'))

await waitFor(() => {
expect(
screen.queryByRole(
'heading',
'There was a problem displaying this data set'
)
).not.toBeInTheDocument()
expect(screen.queryByRole('progressbar')).not.toBeInTheDocument()
})
})

it('shows a message if the data set report has no data for the seleted period and organisation unit', async () => {
Expand Down
Loading

0 comments on commit 5d618cd

Please sign in to comment.