diff --git a/assets/src/scripts/components/hydrograph/index.js b/assets/src/scripts/components/hydrograph/index.js index 81a17ee17813dd5a5b5c56cfeb0c4c85f7870c7b..f22da3903d362f0cb5548ca90b6b445283ed49a2 100644 --- a/assets/src/scripts/components/hydrograph/index.js +++ b/assets/src/scripts/components/hydrograph/index.js @@ -393,7 +393,7 @@ const dateRangeControls = function(elem, siteno) { .attr('hidden', true); const customDateValidationContainer = customDateContainer.append('div') - .attr('class', 'usa-alert usa-alert--info usa-alert--validation') + .attr('class', 'usa-alert usa-alert--warning usa-alert--validation') .attr('hidden', true); const dateAlertBody = customDateValidationContainer.append('div') @@ -408,6 +408,7 @@ const dateRangeControls = function(elem, siteno) { customDateContainer.append('label') .attr('for', 'date-input') + .attr('class', 'usa-label') .text('Enter Dates'); const dateInputContainer = customDateContainer.append('div') diff --git a/assets/src/scripts/models.js b/assets/src/scripts/models.js index 36f333e9da134611993240142f189d7400480c00..4de2ef38cf0b312d5edb5567d9532d0267881a6d 100644 --- a/assets/src/scripts/models.js +++ b/assets/src/scripts/models.js @@ -40,25 +40,14 @@ export const getTimeSeries = function ({sites, params=null, startDate=null, endD timeParams = 'period=P7D'; serviceRoot = SERVICE_ROOT; } else { - let dateParams = []; - if (startDate !== null) { - const startString = startDate ? isoFormatTime(startDate) : ''; - dateParams.push(`startDT=${startString}`); - } - if (endDate !== null) { - const endString = endDate ? isoFormatTime(endDate) : ''; - dateParams.push(`endDT=${endString}`); - } - // let startString = startDate ? isoFormatTime(startDate) : ''; - // let endString = endDate ? isoFormatTime(endDate) : ''; - // timeParams = `startDT=${startString}&endDT=${endString}`; - timeParams = dateParams !== null ? dateParams.join('&') : ''; + let startString = startDate ? isoFormatTime(startDate) : ''; + let endString = endDate ? isoFormatTime(endDate) : ''; + timeParams = `startDT=${startString}&endDT=${endString}`; serviceRoot = tsServiceRoot(startDate); } let paramCds = params !== null ? `¶meterCd=${params.join(',')}` : ''; let url = `${serviceRoot}/iv/?sites=${sites.join(',')}${paramCds}&${timeParams}&siteStatus=all&format=json`; - console.log(url); return get(url) .then(response => JSON.parse(response)) .catch(reason => { diff --git a/assets/src/scripts/schema.js b/assets/src/scripts/schema.js index 05fccdf02c535458d81d1989ca06e3b18e4f9383..1e215085c8e4b02bf7f8d6176fcddf884d158fbe 100644 --- a/assets/src/scripts/schema.js +++ b/assets/src/scripts/schema.js @@ -92,37 +92,14 @@ const queryInfo = memoize(tsKey => new schema.Entity('queryInfo', {}, { // If this is a "range" query (start and end times specified) } else if (queryInfo.notes['filter:timeRange'].indexOf('RANGE') > -1) { - let regEx; - let parts; - let startTime; - let endTime; - if (queryInfo.notes['filter:timeRange'].indexOf('INTERVAL') > -1) { - regEx = /\[mode=(.+), modifiedSince=(.+)\] interval={INTERVAL\[(.+)\/(.+)\]}/; - parts = regEx.exec(queryInfo.notes['filter:timeRange']); - startTime = parts[3]; - endTime = parts[4]; - } else if (queryInfo.notes['filter:timeRange'].indexOf('startDT') > -1) { - regEx = /\[mode=(.+), modifiedSince=(.+)\] startDT={(.+)}/; - parts = regEx.exec(queryInfo.notes['filter:timeRange']); - startTime = parts[3]; - endTime = null; - } else if (queryInfo.notes['filter:timeRange'].indexOf('endDT') > -1) { - regEx = /\[mode=(.+), modifiedSince=(.+)\] endDT={(.+)}/; - parts = regEx.exec(queryInfo.notes['filter:timeRange']); - startTime = null; - endTime = parts[3]; - } else { - regEx = /\[mode=(.+), modifiedSince=(.+)\]/; - parts = regEx.exec(queryInfo.notes['filter:timeRange']); - startTime = null; - endTime = null; - } + const regEx = /\[mode=(.+), modifiedSince=(.+)\] interval={INTERVAL\[(.+)\/(.+)\]}/; + const parts = regEx.exec(queryInfo.notes['filter:timeRange']); queryInfo.notes['filter:timeRange'] = { mode: parts[1], modifiedSince: parts[2] === 'null' ? null : parts[3], interval: { - start: startTime !== null ? new Date(startTime).getTime() : startTime, - end: endTime !== null ? new Date(endTime).getTime() : endTime + start: new Date(parts[3]).getTime(), + end: new Date(parts[4]).getTime() } }; } else { diff --git a/assets/src/scripts/store/index.js b/assets/src/scripts/store/index.js index a9a34479306e778e6b234ae69471879626d95f1d..e0cf59ad7e0241b839d768f2e8a7b75fd995f1c3 100644 --- a/assets/src/scripts/store/index.js +++ b/assets/src/scripts/store/index.js @@ -9,15 +9,8 @@ import { calcStartTime } from '../utils'; import { normalize } from '../schema'; import { fetchFloodFeatures, fetchFloodExtent } from '../flood-data'; import { fetchSiteStatistics } from '../statistics-data'; -import { - getCurrentParmCd, - getCurrentDateRange, - hasTimeSeries, - getTsRequestKey, - getRequestTimeRange, - getRequestedTimeRange, - getIanaTimeZone -} from '../selectors/time-series-selector'; +import { getCurrentParmCd, getCurrentDateRange, hasTimeSeries, getTsRequestKey, getRequestTimeRange, + getRequestedTimeRange, getIanaTimeZone } from '../selectors/time-series-selector'; import { floodDataReducer as floodData } from './flood-data-reducer'; import { floodStateReducer as floodState } from './flood-state-reducer'; import { seriesReducer as series } from './series-reducer'; @@ -283,13 +276,6 @@ export const Actions = { show }; }, - timeRangeMode(key, show) { - return { - type: 'TIME_RANGE_MODE', - key, - show - }; - }, addSeriesCollection(key, data) { return { type: 'ADD_TIME_SERIES_COLLECTION',