From 0d6a05417b1e90e43f848e8756d93cfab798bd8b Mon Sep 17 00:00:00 2001 From: Aaron Briggs Date: Thu, 29 Sep 2022 14:41:14 -0500 Subject: [PATCH 01/15] convert data download to script tag --- .../vue-components/download-data.vue | 46 +++++--------- .../vue-components/uswds/USWDSRadioButton.vue | 58 ++++++++++++++++++ .../vue-components/uswds/radio-button-set.vue | 60 +++++++++++++++++++ 3 files changed, 132 insertions(+), 32 deletions(-) create mode 100644 assets/src/scripts/vue-components/uswds/USWDSRadioButton.vue create mode 100644 assets/src/scripts/vue-components/uswds/radio-button-set.vue diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/vue-components/download-data.vue b/assets/src/scripts/monitoring-location/components/hydrograph/vue-components/download-data.vue index 01d6b5fd1..33d0ba505 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/vue-components/download-data.vue +++ b/assets/src/scripts/monitoring-location/components/hydrograph/vue-components/download-data.vue @@ -5,7 +5,7 @@ Select data to retrieve -
+
-
+
-
+
-
+
-
+
- - diff --git a/assets/src/scripts/vue-components/uswds/USWDSRadioButton.vue b/assets/src/scripts/vue-components/uswds/USWDSRadioButton.vue new file mode 100644 index 000000000..8be97d8e5 --- /dev/null +++ b/assets/src/scripts/vue-components/uswds/USWDSRadioButton.vue @@ -0,0 +1,58 @@ + + + diff --git a/assets/src/scripts/vue-components/uswds/radio-button-set.vue b/assets/src/scripts/vue-components/uswds/radio-button-set.vue new file mode 100644 index 000000000..883735af4 --- /dev/null +++ b/assets/src/scripts/vue-components/uswds/radio-button-set.vue @@ -0,0 +1,60 @@ + + + -- GitLab From b1471eb6c44161235e6ba5193f3496f375bf8eb3 Mon Sep 17 00:00:00 2001 From: Aaron Briggs Date: Thu, 29 Sep 2022 18:05:18 -0500 Subject: [PATCH 02/15] download data buttons working --- .../vue-components/download-data.vue | 364 ++++++++---------- .../vue-components/uswds/radio-button-set.vue | 15 +- 2 files changed, 172 insertions(+), 207 deletions(-) diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/vue-components/download-data.vue b/assets/src/scripts/monitoring-location/components/hydrograph/vue-components/download-data.vue index 33d0ba505..9997d5311 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/vue-components/download-data.vue +++ b/assets/src/scripts/monitoring-location/components/hydrograph/vue-components/download-data.vue @@ -1,112 +1,19 @@ -- GitLab From 74414f8e3b4f25f34fc1ac7d7599e784ca6c8a24 Mon Sep 17 00:00:00 2001 From: Aaron Briggs Date: Fri, 30 Sep 2022 18:47:53 -0500 Subject: [PATCH 13/15] convert dvgraphcontrols to stepup tag and fix tests --- .../vue-components/DvGraphControls.test.js | 28 ++++--- .../vue-components/DvGraphControls.vue | 74 ++++++++----------- .../vue-components/download-data.vue | 2 +- 3 files changed, 51 insertions(+), 53 deletions(-) diff --git a/assets/src/scripts/monitoring-location/components/daily-value-hydrograph/vue-components/DvGraphControls.test.js b/assets/src/scripts/monitoring-location/components/daily-value-hydrograph/vue-components/DvGraphControls.test.js index f7e4c5c36..b1c52b0e1 100644 --- a/assets/src/scripts/monitoring-location/components/daily-value-hydrograph/vue-components/DvGraphControls.test.js +++ b/assets/src/scripts/monitoring-location/components/daily-value-hydrograph/vue-components/DvGraphControls.test.js @@ -1,4 +1,3 @@ - import {bindActionCreators} from 'redux'; import ReduxConnectVue from 'redux-connect-vue'; import {createStructuredSelector} from 'reselect'; @@ -9,6 +8,8 @@ import {configureStore} from 'ml/store'; import {Actions} from 'ml/store/daily-value-time-series'; +import {USWDSRadioButton, USWDSRadioButtonSet} from '@wma/wdfn-vue-components'; + import DvGraphControls from './DvGraphControls.vue'; describe('monitoring-location/components/daily-value-hydrograph/vue-components/DvGraphControls.vue', () => { @@ -136,7 +137,6 @@ describe('monitoring-location/components/daily-value-hydrograph/vue-components/D }); describe('Creating the graph controls with data', () => { - let store; let retrieveDVTimeSeriesSpy; @@ -171,20 +171,30 @@ describe('monitoring-location/components/daily-value-hydrograph/vue-components/D }); it('Should render the radio buttons', () => { - const radioButtons = wrapper.findAll('input[type="radio"]'); - const firstRadioButton = wrapper.find('#code-72019-radio'); + expect(wrapper.findAllComponents(USWDSRadioButtonSet)).toHaveLength(1); + const radioButtons = wrapper.findAllComponents(USWDSRadioButton); expect(radioButtons).toHaveLength(2); - expect(firstRadioButton.element.checked).toBe(true); + expect(radioButtons[0].props('isButtonChecked')).toBe(true); + expect(radioButtons[0].props('radioButtonId')).toBe('code-72019-radio'); + expect(radioButtons[0].props('radioButtonLabel')).toBe('72019'); + expect(radioButtons[0].props('radioButtonName')).toBe('dv-parameter-code-selector-radio-button-set'); + expect(radioButtons[0].props('radioButtonValue')).toBe('72019'); + + expect(radioButtons[1].props('isButtonChecked')).toBe(false); + expect(radioButtons[1].props('radioButtonId')).toBe('code-62610-radio'); + expect(radioButtons[1].props('radioButtonLabel')).toBe('62610'); + expect(radioButtons[1].props('radioButtonName')).toBe('dv-parameter-code-selector-radio-button-set'); + expect(radioButtons[1].props('radioButtonValue')).toBe('62610'); }); it('Should update the selected parameter code', async() => { - const radioButtons = wrapper.findAll('input[type="radio"]'); + const radioButtons = wrapper.findAllComponents(USWDSRadioButton); expect(store.getState().dailyValueTimeSeriesState.currentDVTimeSeriesId.max).toBe('1123'); - await radioButtons[1].trigger('click'); + await radioButtons[1].find('input').trigger('click'); const dvState = store.getState().dailyValueTimeSeriesState; - expect(radioButtons[1].element.checked).toBe(true); - expect(radioButtons[0].element.checked).toBe(false); + expect(radioButtons[1].props('isButtonChecked')).toBe(true); + expect(radioButtons[0].props('isButtonChecked')).toBe(false); expect(retrieveDVTimeSeriesSpy.mock.calls).toHaveLength(3); expect(dvState.currentDVTimeSeriesId.max).toBe('1124'); expect(dvState.dvGraphBrushOffset).toEqual({ diff --git a/assets/src/scripts/monitoring-location/components/daily-value-hydrograph/vue-components/DvGraphControls.vue b/assets/src/scripts/monitoring-location/components/daily-value-hydrograph/vue-components/DvGraphControls.vue index cfc1353d1..8f5463eb3 100644 --- a/assets/src/scripts/monitoring-location/components/daily-value-hydrograph/vue-components/DvGraphControls.vue +++ b/assets/src/scripts/monitoring-location/components/daily-value-hydrograph/vue-components/DvGraphControls.vue @@ -18,7 +18,7 @@
- \ No newline at end of file + const retrieveAndSetTimeSeries = function(parameterCode) { + const timeSeries = getAvailableGWDVTimeSeriesIdsForParameterCode(parameterCode)(store.getState()); + actions.retrieveDVTimeSeries(monitoringLocationId, timeSeries.min); + actions.retrieveDVTimeSeries(monitoringLocationId, timeSeries.mean); + actions.retrieveDVTimeSeries(monitoringLocationId, timeSeries.max); + actions.clearDVGraphBrushOffset(); + actions.setCurrentDVTimeSeriesIds(timeSeries.min, timeSeries.mean, timeSeries.max); + }; + diff --git a/assets/src/scripts/monitoring-location/components/hydrograph/vue-components/download-data.vue b/assets/src/scripts/monitoring-location/components/hydrograph/vue-components/download-data.vue index ed44a2768..928eb43b6 100644 --- a/assets/src/scripts/monitoring-location/components/hydrograph/vue-components/download-data.vue +++ b/assets/src/scripts/monitoring-location/components/hydrograph/vue-components/download-data.vue @@ -145,7 +145,7 @@ const buttonList = computed(() => { id: `${props.buttonSetName}-primary-data-download-button`, label: 'Primary time series', checked: false, - buttonValue: 'primary' + buttonValue: 'primary' }); } -- GitLab From f660ca003fa501ab2e7e3a9eea38cca79ac677fc Mon Sep 17 00:00:00 2001 From: Aaron Briggs Date: Mon, 3 Oct 2022 08:47:25 -0500 Subject: [PATCH 14/15] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed424d427..d2f558631 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - The D3 CursorSlider component is now generic and used for both the DV and IV graphs. - The monitoring location map component now implemented in Vue. - Replaced the jest test framework with vitest +- All radio buttons and radio button sets now use the wdfn-vue-components npm package. ### Fixed - If the data reports that a parameter has a period of record, yet the observations service returns no data, the application will no longer hang. -- GitLab From 401caad251b470606400dc63d2ada46c92487171 Mon Sep 17 00:00:00 2001 From: Aaron Briggs Date: Wed, 5 Oct 2022 11:07:55 -0500 Subject: [PATCH 15/15] adjust gitlab-ci for pa11y --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d414a9262..f6f363dc4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -111,7 +111,9 @@ integration_test: - apk add --no-cache docker-compose - export WMA_NPM_AUTH_TOKEN=${CI_JOB_TOKEN} - docker-compose up -d web_server - - docker-compose up --exit-code-from=pa11y_ci pa11y_ci + - docker-compose up + - docker-compose build pa11yci + docker-compose run --exit-code-from=pa11y_ci artifacts: paths: - pa11y-ci-report -- GitLab