2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017 Amdocs
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
21 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
24 import {vnfActionTypes} from 'app/vnfSearch/VnfSearchConstants.js';
31 } from 'app/vnfSearch/VnfSearchConstants.js';
32 import {ERROR_RETRIEVING_DATA} from 'app/networking/NetworkConstants.js';
33 import {MESSAGE_LEVEL_DANGER} from 'utils/GlobalConstants.js';
35 globalAutoCompleteSearchBarActionTypes
36 } from 'app/globalAutoCompleteSearchBar/GlobalAutoCompleteSearchBarConstants.js';
39 } from 'generic-components/filterBar/FilterBarConstants.js';
41 export default (state = {}, action) => {
42 let data = action.data;
43 switch (action.type) {
44 case vnfActionTypes.VNF_NETWORK_ERROR:
47 processedProvStatusCountChartData: CHART_PROV_STATUS.emptyData,
48 processedOrchStatusCountChartData: CHART_ORCH_STATUS.emptyData,
49 processedNfTypeCountChartData: CHART_NF_TYPE.emptyData,
50 processedNfRoleCountChartData: CHART_NF_ROLE.emptyData,
51 count: TOTAL_VNF_COUNT.emptyValue,
52 feedbackMsgText: ERROR_RETRIEVING_DATA,
53 feedbackMsgSeverity: MESSAGE_LEVEL_DANGER
55 case globalAutoCompleteSearchBarActionTypes.SEARCH_WARNING_EVENT:
58 processedProvStatusCountChartData: CHART_PROV_STATUS.emptyData,
59 processedOrchStatusCountChartData: CHART_ORCH_STATUS.emptyData,
60 processedNfTypeCountChartData: CHART_NF_TYPE.emptyData,
61 processedNfRoleCountChartData: CHART_NF_ROLE.emptyData,
62 count: TOTAL_VNF_COUNT.emptyValue
64 case filterBarActionTypes.NEW_SELECTIONS:
67 vnfFilterValues: data.selectedValuesMap,
68 unifiedFilterValues: data.unifiedValues
70 case filterBarActionTypes.SET_UNIFIED_VALUES:
73 unifiedFilterValues: data
75 case vnfActionTypes.VNF_SEARCH_RESULTS_RECEIVED:
79 processedProvStatusCountChartData: data.provStatusData,
80 processedOrchStatusCountChartData: data.orchStatusData,
81 processedNfTypeCountChartData: data.nfTypeData,
82 processedNfRoleCountChartData: data.nfRoleData,
84 feedbackMsgSeverity: ''
86 case vnfActionTypes.VNF_FILTER_PANEL_TOGGLED:
89 vnfVisualizationPanelClass: data.vnfVisualizationPanelClass
91 case vnfActionTypes.VNF_SEARCH_FILTERS_RECEIVED:
96 case filterBarActionTypes.SET_NON_CONVERTED_VALUES:
99 nonConvertedFilters: data
101 case filterBarActionTypes.SET_CONVERTED_VALUES:
104 nonConvertedFilters: {},
105 unifiedFilterValues: data.convertedValues,
106 vnfFilterValues: data.nonConvertedValues // launching DI view via menu button requires this
107 // to be set so visualizations and table will populate themselves
109 case filterBarActionTypes.CLEAR_FILTERS:
114 nonConvertedFilters: {},
115 unifiedFilterValues: {}