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';
30 } from 'app/vnfSearch/VnfSearchConstants.js';
31 import {ERROR_RETRIEVING_DATA} from 'app/networking/NetworkConstants.js';
32 import {MESSAGE_LEVEL_DANGER} from 'utils/GlobalConstants.js';
34 globalAutoCompleteSearchBarActionTypes
35 } from 'app/globalAutoCompleteSearchBar/GlobalAutoCompleteSearchBarConstants.js';
37 export default (state = {}, action) => {
38 let data = action.data;
39 switch (action.type) {
41 case vnfActionTypes.COUNT_BY_PROV_STATUS_RECEIVED:
44 processedProvStatusCountChartData: data.provStatusCountChartData.chartData,
46 feedbackMsgSeverity: ''
49 case vnfActionTypes.COUNT_BY_ORCH_STATUS_RECEIVED:
52 processedOrchStatusCountChartData: data.orchStatusCountChartData.chartData,
54 feedbackMsgSeverity: ''
56 case vnfActionTypes.TOTAL_VNF_COUNT_RECEIVED:
61 feedbackMsgSeverity: ''
63 case vnfActionTypes.ERROR_NO_DATA_FOR_PROV_STATUS_IN_SEARCH_RANGE_RECEIVED:
66 processedProvStatusCountChartData: CHART_PROV_STATUS.emptyData,
68 case vnfActionTypes.ERROR_NO_DATA_FOR_ORCH_STATUS_IN_SEARCH_RANGE_RECEIVED:
71 processedOrchStatusCountChartData: CHART_ORCH_STATUS.emptyData,
73 case vnfActionTypes.ERROR_NO_COUNT_RECEIVED:
76 count: TOTAL_VNF_COUNT.emptyValue,
78 case vnfActionTypes.VNF_NETWORK_ERROR:
81 processedProvStatusCountChartData: CHART_PROV_STATUS.emptyData,
82 processedOrchStatusCountChartData: CHART_ORCH_STATUS.emptyData,
83 count: TOTAL_VNF_COUNT.emptyValue,
84 feedbackMsgText: ERROR_RETRIEVING_DATA,
85 feedbackMsgSeverity: MESSAGE_LEVEL_DANGER
87 case globalAutoCompleteSearchBarActionTypes.SEARCH_WARNING_EVENT:
90 processedProvStatusCountChartData: CHART_PROV_STATUS.emptyData,
91 processedOrchStatusCountChartData: CHART_ORCH_STATUS.emptyData,
92 count: TOTAL_VNF_COUNT.emptyValue