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.
25 import {vnfActionTypes} from 'app/vnfSearch/VnfSearchConstants.js';
32 } from 'app/vnfSearch/VnfSearchConstants.js';
33 import {ERROR_RETRIEVING_DATA} from 'app/networking/NetworkConstants.js';
34 import {MESSAGE_LEVEL_DANGER} from 'utils/GlobalConstants.js';
36 globalAutoCompleteSearchBarActionTypes
37 } from 'app/globalAutoCompleteSearchBar/GlobalAutoCompleteSearchBarConstants.js';
40 } from 'generic-components/filterBar/FilterBarConstants.js';
42 export default (state = {}, action) => {
43 let data = action.data;
44 switch (action.type) {
45 case vnfActionTypes.VNF_NETWORK_ERROR:
48 processedProvStatusCountChartData: CHART_PROV_STATUS.emptyData,
49 processedOrchStatusCountChartData: CHART_ORCH_STATUS.emptyData,
50 processedNfTypeCountChartData: CHART_NF_TYPE.emptyData,
51 processedNfRoleCountChartData: CHART_NF_ROLE.emptyData,
52 count: TOTAL_VNF_COUNT.emptyValue,
53 feedbackMsgText: ERROR_RETRIEVING_DATA,
54 feedbackMsgSeverity: MESSAGE_LEVEL_DANGER
56 case globalAutoCompleteSearchBarActionTypes.SEARCH_WARNING_EVENT:
59 processedProvStatusCountChartData: CHART_PROV_STATUS.emptyData,
60 processedOrchStatusCountChartData: CHART_ORCH_STATUS.emptyData,
61 processedNfTypeCountChartData: CHART_NF_TYPE.emptyData,
62 processedNfRoleCountChartData: CHART_NF_ROLE.emptyData,
63 count: TOTAL_VNF_COUNT.emptyValue
65 case filterBarActionTypes.NEW_SELECTIONS:
68 vnfFilterValues: data.selectedValuesMap,
69 unifiedFilterValues: data.unifiedValues
71 case filterBarActionTypes.SET_UNIFIED_VALUES:
74 unifiedFilterValues: data
76 case vnfActionTypes.VNF_SEARCH_RESULTS_RECEIVED:
80 processedProvStatusCountChartData: data.provStatusData,
81 processedOrchStatusCountChartData: data.orchStatusData,
82 processedNfTypeCountChartData: data.nfTypeData,
83 processedNfRoleCountChartData: data.nfRoleData,
85 feedbackMsgSeverity: ''
87 case vnfActionTypes.VNF_FILTER_PANEL_TOGGLED:
90 vnfVisualizationPanelClass: data.vnfVisualizationPanelClass
92 case vnfActionTypes.VNF_SEARCH_FILTERS_RECEIVED:
97 case filterBarActionTypes.SET_NON_CONVERTED_VALUES:
100 nonConvertedFilters: data
102 case filterBarActionTypes.SET_CONVERTED_VALUES:
105 nonConvertedFilters: {},
106 unifiedFilterValues: data.convertedValues,
107 vnfFilterValues: data.nonConvertedValues // launching DI view via menu button requires this
108 // to be set so visualizations and table will populate themselves
110 case filterBarActionTypes.CLEAR_FILTERS:
115 nonConvertedFilters: {},
116 unifiedFilterValues: {}