2 * ============LICENSE_START===================================================
3 * SPARKY (AAI UI service)
4 * ============================================================================
5 * Copyright © 2017 AT&T Intellectual Property.
6 * Copyright © 2017 Amdocs
8 * ============================================================================
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
20 * ============LICENSE_END=====================================================
22 * ECOMP and OpenECOMP are trademarks
23 * and service marks of AT&T Intellectual Property.
26 import {dateRangeActionTypes} from 'generic-components/dateRange/DateRangeConstants.js';
27 import {dateRangeSelectorActionTypes} from 'generic-components/dateRangeSelector/DateRangeSelectorConstants.js';
28 import {MESSAGE_LEVEL_DANGER} from 'utils/GlobalConstants.js';
30 export default (state = {}, action) => {
32 switch (action.type) {
34 case dateRangeActionTypes.DATE_RANGE_CHANGE:
37 startDate: action.data.dateRange.startDate,
38 endDate: action.data.dateRange.endDate,
43 case dateRangeActionTypes.INVALID_DATE_RANGE:
46 startDate: action.data.dateRange.startDate,
47 endDate: action.data.dateRange.endDate,
48 periodErrText: action.data.errorMsg,
49 periodErrSev: MESSAGE_LEVEL_DANGER
52 case dateRangeSelectorActionTypes.EVENT_PERIOD_CHANGE:
55 startDate: action.data.dateRange.startDate,
56 endDate: action.data.dateRange.endDate,
57 period: action.data.period,