diff --git a/assets/package-lock.json b/assets/package-lock.json index a5a81a6197865947e3193225e23013606b5da94c..b6d52258c45626e2ebd420fec70f1208396b2ae0 100644 --- a/assets/package-lock.json +++ b/assets/package-lock.json @@ -4173,9 +4173,9 @@ } }, "eslint": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.0.0.tgz", - "integrity": "sha512-qY1cwdOxMONHJfGqw52UOpZDeqXy8xmD0u8CT6jIstil72jkhURC704W8CFyTPDPllz4z4lu0Ql1+07PG/XdIg==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.1.0.tgz", + "integrity": "sha512-DfS3b8iHMK5z/YLSme8K5cge168I8j8o1uiVmFCgnnjxZQbCGyraF8bMl7Ju4yfBmCuxD7shOF7eqGkcuIHfsA==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -4258,9 +4258,9 @@ "dev": true }, "cross-spawn": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.2.tgz", - "integrity": "sha512-PD6G8QG3S4FK/XCGFbEQrDqO2AnMMsy0meR7lerlIOHAAbkuavGU/pOqprrlvfTNjvowivTeBsjebAL0NSoMxw==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "requires": { "path-key": "^3.1.0", @@ -4304,9 +4304,9 @@ "dev": true }, "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -12491,9 +12491,9 @@ "dev": true }, "tslib": { - "version": "1.11.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.11.2.tgz", - "integrity": "sha512-tTSkux6IGPnUGUd1XAZHcpu85MOkIl5zX49pO+jfsie3eP0B6pyhOlLXm3cAC6T7s+euSDDUUV+Acop5WmtkVg==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", + "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", "dev": true }, "type-check": { diff --git a/assets/package.json b/assets/package.json index 2f206957e35a1721e5eb7164df44748a4ba55a06..fcf7f77a427176b4a1ee5a500e4b511faceaf6de 100644 --- a/assets/package.json +++ b/assets/package.json @@ -45,7 +45,7 @@ "devDependencies": { "autoprefixer": "^9.7.6", "concat": "^1.0.3", - "eslint": "^7.0.0", + "eslint": "^7.1.0", "eslint-plugin-jasmine": "^4.1.1", "gulp": "^4.0.2", "gulp-rev-all": "^2.0.3", diff --git a/assets/src/scripts/components/hydrograph/index.js b/assets/src/scripts/components/hydrograph/index.js index ac8e997caa268790f84e57a6220195d292cfad88..454c463fa25946178de70ef533b91da30919a601 100644 --- a/assets/src/scripts/components/hydrograph/index.js +++ b/assets/src/scripts/components/hydrograph/index.js @@ -146,7 +146,11 @@ export const attachToNode = function (store, nodeElem.select('.ts-legend-controls-container') .call(drawGraphControls, store); - + nodeElem.select('#iv-data-table-container') + .call(drawDataTable, store); + nodeElem.select('.provisional-data-alert') + .attr('hidden', null); + //TODO: Find out why putting this before drawDataTable causes the tests to not work correctly nodeElem.select('.select-time-series-container') .call(link(store, plotSeriesSelectTable, createStructuredSelector({ siteno: () => siteno, @@ -154,10 +158,7 @@ export const attachToNode = function (store, lineSegmentsByParmCd: lineSegmentsByParmCdSelector('current', 'P7D'), timeSeriesScalesByParmCd: timeSeriesScalesByParmCdSelector('current', 'P7D', SPARK_LINE_DIM) }), store)); - nodeElem.select('#iv-data-table-container') - .call(drawDataTable, store); - nodeElem.select('.provisional-data-alert') - .attr('hidden', null); + renderTimeSeriesUrlParams(store); } diff --git a/assets/src/scripts/components/hydrograph/index.spec.js b/assets/src/scripts/components/hydrograph/index.spec.js index 1f4685631b44cde58cb2f013c36978f2b6795bb5..d56ddb3c48f1541a54c30e1f51f9a1bbbcb09f43 100644 --- a/assets/src/scripts/components/hydrograph/index.spec.js +++ b/assets/src/scripts/components/hydrograph/index.spec.js @@ -162,6 +162,7 @@ describe('Hydrograph charting and Loading indicators and data alerts', () => { component.append('div').attr('class', 'graph-container'); component.append('div').attr('class', 'select-time-series-container'); component.append('div').attr('class', 'provisional-data-alert'); + component.append('div').attr('id', 'iv-data-table-container'); graphNode = document.getElementById('hydrograph'); @@ -511,6 +512,15 @@ describe('Hydrograph charting and Loading indicators and data alerts', () => { // one for each of the two parameters expect(selectAll('table .tooltip-item').size()).toBe(2); }); + + it('should render the data table', (done) => { + window.requestAnimationFrame(() => { + const container = select('#iv-data-table-container'); + expect(container.selectAll('table').size()).toBe(1); + expect(container.select('.pagination').size()).toBe(1); + done(); + }); + }); }); describe('hide elements when showOnlyGraph is set to true', () => { @@ -583,5 +593,9 @@ describe('Hydrograph charting and Loading indicators and data alerts', () => { it('should not have the select time series element', () => { expect(selectAll('#select-time-series').size()).toBe(0); }); + + it('should not have the data table', () => { + expect(select('#iv-data-table-container').selectAll('table').size()).toBe(0); + }); }); }); \ No newline at end of file