Refresh option in validation result page
[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                 testResultKeys: action.testResultKeys
25             };
26         case actionTypes.FETCH_VSP_CHECKS:
27             return {
28                 ...state,
29                 vspChecks: action.vspChecks
30             };
31         case actionTypes.SET_ACTIVE_TAB:
32             return { ...state, activeTab: action.activeTab };
33         case actionTypes.SET_VSP_TESTS_MAP:
34             return {
35                 ...state,
36                 vspTestsMap: action.vspTestsMap
37             };
38         case actionTypes.SET_COMPLIANCE_CHECKED:
39             return {
40                 ...state,
41                 complianceChecked: action.complianceChecked
42             };
43         case actionTypes.SET_CERTIFICATION_CHECKED:
44             return {
45                 ...state,
46                 certificationChecked: action.certificationChecked
47             };
48         case actionTypes.SET_TESTS_REQUEST:
49             return {
50                 ...state,
51                 testsRequest: action.testsRequest,
52                 generalInfo: action.generalInfo
53             };
54         case actionTypes.SET_GENERAL_INFO:
55             return {
56                 ...state,
57                 generalInfo: action.generalInfo
58             };
59         case actionTypes.SET_VSP_VALIDATION_DISABLED:
60             return {
61                 ...state,
62                 isValidationDisabled: action.isValidationDisabled
63             };
64         default:
65             return state;
66     }
67 };