4513e232054745c2a980b703d4c3b68e5cf4384e
[sdc.git] / openecomp-ui / src / sdc-app / onboarding / softwareProduct / validation / SoftwareProductValidationReducer.js
1 /**
2  * Copyright (c) 2019 Vodafone Group
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 import { actionTypes } from './SoftwareProductValidationConstants.js';
17
18 export default (state = {}, action) => {
19     switch (action.type) {
20         case actionTypes.POST_VSP_TESTS:
21             return {
22                 ...state,
23                 vspTestResults: action.vspTestResults
24             };
25         case actionTypes.FETCH_VSP_CHECKS:
26             return {
27                 ...state,
28                 vspChecks: action.vspChecks
29             };
30         case actionTypes.SET_ACTIVE_TAB:
31             return { ...state, activeTab: action.activeTab };
32         case actionTypes.SET_VSP_TESTS_MAP:
33             return {
34                 ...state,
35                 vspTestsMap: action.vspTestsMap
36             };
37         case actionTypes.SET_COMPLIANCE_CHECKED:
38             return {
39                 ...state,
40                 complianceChecked: action.complianceChecked
41             };
42         case actionTypes.SET_CERTIFICATION_CHECKED:
43             return {
44                 ...state,
45                 certificationChecked: action.certificationChecked
46             };
47         case actionTypes.SET_TESTS_REQUEST:
48             return {
49                 ...state,
50                 testsRequest: action.testsRequest,
51                 generalInfo: action.generalInfo
52             };
53         case actionTypes.SET_GENERAL_INFO:
54             return {
55                 ...state,
56                 generalInfo: action.generalInfo
57             };
58         case actionTypes.SET_VSP_VALIDATION_DISABLED:
59             return {
60                 ...state,
61                 isValidationDisabled: action.isValidationDisabled
62             };
63         default:
64             return state;
65     }
66 };