From 2603a9d2ea5bd62fa79b9949434dfe11ec3bfc48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Henrik=20=C3=98verland?= Date: Wed, 10 Apr 2024 09:56:16 +0200 Subject: [PATCH] fix(deps): data visualizer plugin [v38] (DHIS2-16888) (#2915) --- .../edit/edit_dashboard/show_description.js | 10 +++++----- .../view/dashboard_filter/dashboard_filter.js | 2 +- .../view_dashboard/resize_dashboards_bar.js | 4 ++-- .../toggle_show_more_dashboards.js | 13 +++++++++---- .../error_while_show_description.js | 12 ++++++++---- package.json | 2 +- yarn.lock | 19 ++++++++++--------- 7 files changed, 36 insertions(+), 26 deletions(-) diff --git a/cypress/integration/edit/edit_dashboard/show_description.js b/cypress/integration/edit/edit_dashboard/show_description.js index cdea4582f..b02c3668e 100644 --- a/cypress/integration/edit/edit_dashboard/show_description.js +++ b/cypress/integration/edit/edit_dashboard/show_description.js @@ -1,10 +1,10 @@ import { When, Then } from 'cypress-cucumber-preprocessor/steps' -import { clickViewActionButton } from '../../../elements/viewDashboard' -import { getApiBaseUrl } from '../../../support/server/utils' +import { clickViewActionButton } from '../../../elements/viewDashboard.js' +import { getApiBaseUrl } from '../../../support/server/utils.js' const RESP_CODE_200 = 200 const RESP_CODE_201 = 201 -const SHOW_DESC_RESP_CODE_FAIL = 409 +const RESP_CODE_FAIL = 409 before(() => { //ensure that the description is not currently shown @@ -45,14 +45,14 @@ When('I click to hide the description', () => { // Error scenario When('clicking to show description fails', () => { cy.intercept('PUT', 'userDataStore/dashboard/showDescription', { - statusCode: SHOW_DESC_RESP_CODE_FAIL, + statusCode: RESP_CODE_FAIL, }).as('showDescriptionFails') clickViewActionButton('More') cy.contains('Show description').click() cy.wait('@showDescriptionFails') .its('response.statusCode') - .should('eq', SHOW_DESC_RESP_CODE_FAIL) + .should('eq', RESP_CODE_FAIL) }) Then( diff --git a/cypress/integration/view/dashboard_filter/dashboard_filter.js b/cypress/integration/view/dashboard_filter/dashboard_filter.js index 2b80d1df0..655f317b7 100644 --- a/cypress/integration/view/dashboard_filter/dashboard_filter.js +++ b/cypress/integration/view/dashboard_filter/dashboard_filter.js @@ -42,7 +42,7 @@ Then('the Period filter is applied to the dashboard', () => { }) /* -Scenario: I add an Organisation init filter +Scenario: I add an Organisation unit filter */ Then('the Organisation unit filter is applied to the dashboard', () => { diff --git a/cypress/integration/view/view_dashboard/resize_dashboards_bar.js b/cypress/integration/view/view_dashboard/resize_dashboards_bar.js index d6803afff..3d8162f0c 100644 --- a/cypress/integration/view/view_dashboard/resize_dashboards_bar.js +++ b/cypress/integration/view/view_dashboard/resize_dashboards_bar.js @@ -2,8 +2,8 @@ import { When, Then } from 'cypress-cucumber-preprocessor/steps' import { dragHandleSel, dashboardsBarSel, -} from '../../../elements/viewDashboard' -import { EXTENDED_TIMEOUT } from '../../../support/utils' +} from '../../../elements/viewDashboard.js' +import { EXTENDED_TIMEOUT } from '../../../support/utils.js' const RESP_CODE_200 = 200 const RESP_CODE_201 = 201 diff --git a/cypress/integration/view/view_dashboard/toggle_show_more_dashboards.js b/cypress/integration/view/view_dashboard/toggle_show_more_dashboards.js index 5c98255dd..e856e6972 100644 --- a/cypress/integration/view/view_dashboard/toggle_show_more_dashboards.js +++ b/cypress/integration/view/view_dashboard/toggle_show_more_dashboards.js @@ -3,13 +3,16 @@ import { dashboardTitleSel, dashboardsBarContainerSel, showMoreLessSel, -} from '../../../elements/viewDashboard' -import { getApiBaseUrl } from '../../../support/server/utils' -import { EXTENDED_TIMEOUT } from '../../../support/utils' +} from '../../../elements/viewDashboard.js' +import { getApiBaseUrl } from '../../../support/server/utils.js' +import { EXTENDED_TIMEOUT } from '../../../support/utils.js' const MIN_DASHBOARDS_BAR_HEIGHT = 71 const MAX_DASHBOARDS_BAR_HEIGHT = 431 +const RESP_CODE_200 = 200 +const RESP_CODE_201 = 201 + beforeEach(() => { cy.request({ method: 'PUT', @@ -18,7 +21,9 @@ beforeEach(() => { 'content-type': 'application/json', }, body: '1', - }).then(response => expect(response.status).to.be.oneOf([200, 201])) + }).then(response => + expect(response.status).to.be.oneOf([RESP_CODE_201, RESP_CODE_200]) + ) }) When('I toggle show more dashboards', () => { diff --git a/cypress/integration/view/view_errors/error_while_show_description.js b/cypress/integration/view/view_errors/error_while_show_description.js index f46d9740d..4c7ea1993 100644 --- a/cypress/integration/view/view_errors/error_while_show_description.js +++ b/cypress/integration/view/view_errors/error_while_show_description.js @@ -1,7 +1,9 @@ import { When, Then } from 'cypress-cucumber-preprocessor/steps' -import { getApiBaseUrl } from '../../../support/server/utils' +import { getApiBaseUrl } from '../../../support/server/utils.js' -// Error scenario +const RESP_CODE_200 = 200 +const RESP_CODE_201 = 201 +const RESP_CODE_FAIL = 409 before(() => { //first ensure that the description is not currently shown @@ -12,7 +14,9 @@ before(() => { 'content-type': 'application/json', }, body: 'false', - }).then(response => expect(response.status).to.be.oneOf([200, 201])) + }).then(response => + expect(response.status).to.be.oneOf([RESP_CODE_201, RESP_CODE_200]) + ) }) When('clicking to show description fails', () => { @@ -25,7 +29,7 @@ When('clicking to show description fails', () => { cy.wait('@showDescriptionFails') .its('response.statusCode') - .should('eq', 409) + .should('eq', RESP_CODE_FAIL) }) Then( diff --git a/package.json b/package.json index c638abafa..775836db1 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "@dhis2/d2-ui-interpretations": "^7.4.1", "@dhis2/d2-ui-mentions-wrapper": "^7.4.1", "@dhis2/d2-ui-rich-text": "^7.4.1", - "@dhis2/data-visualizer-plugin": "^38.3.6", + "@dhis2/data-visualizer-plugin": "^38.3.27", "@dhis2/ui": "^8.12.4", "@krakenjs/post-robot": "^11.0.0", "classnames": "^2.3.1", diff --git a/yarn.lock b/yarn.lock index e0dd087c6..f4b9b89be 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2152,12 +2152,13 @@ classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2/analytics@^21.8.1": - version "21.8.1" - resolved "https://registry.yarnpkg.com/@dhis2/analytics/-/analytics-21.8.1.tgz#2e04e80cb2f80336c80a6a1605c295702e1f8d65" - integrity sha512-UXkCmZEWhwMaJgx5kJVP7dCr8evbTuyQaPi9jZGvbPeClX+2dg98ewyaVQ3AVdAc+DXdY93uG9nWAygrGXVuBA== +"@dhis2/analytics@^21.9.1": + version "21.9.1" + resolved "https://registry.yarnpkg.com/@dhis2/analytics/-/analytics-21.9.1.tgz#8ed76ac090cd3215885591813ccbbe8b18d1b402" + integrity sha512-klH32VRLefd2X9KdsbzQJxhKHeMidwv2MSVb24vHUySmiBZ6JBeS7ZsxTQhudQEa6abYLEtpgENljKAtcJ8lxA== dependencies: "@dhis2/d2-ui-translation-dialog" "^7.3.1" + "@dhis2/multi-calendar-dates" "1.0.0" classnames "^2.3.1" d2-utilizr "^0.2.16" d3-color "^1.2.3" @@ -2478,12 +2479,12 @@ react-select "^2.0.0" rxjs "^5.5.7" -"@dhis2/data-visualizer-plugin@^38.3.6": - version "38.3.6" - resolved "https://registry.yarnpkg.com/@dhis2/data-visualizer-plugin/-/data-visualizer-plugin-38.3.6.tgz#0a99c1996f9d74897b4e490166661ab8a6a0cbbf" - integrity sha512-hPuUFfFB1PcBi8C8lD/ObCDBLzbN3OaZx/Q6Nrmt2bSC19aRT5xsQDlvi4b07jtxqUE9YO4YvU1dPn6bF2Oz1w== +"@dhis2/data-visualizer-plugin@^38.3.27": + version "38.3.27" + resolved "https://registry.yarnpkg.com/@dhis2/data-visualizer-plugin/-/data-visualizer-plugin-38.3.27.tgz#cbaadf86b8deea3f989fa52809ddf15e4897bff6" + integrity sha512-eUF1qynfzDPAfx5RQZArtUTwTGTStbFoXtMkFtyRsR+Gr2nZxJE5cEkr4smjOSvYK7zitOHYcxrxIr74qGsZ5Q== dependencies: - "@dhis2/analytics" "^21.8.1" + "@dhis2/analytics" "^21.9.1" "@dhis2/app-runtime" "^3.2.0" "@dhis2/d2-i18n" "^1.1.0" "@dhis2/ui" "^7.7.3"