2 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
3 * Modifications Copyright (C) 2021 Nordix Foundation.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
14 * or implied. See the License for the specific language governing
15 * permissions and limitations under the License.
17 import { combineReducers } from 'redux';
21 } from './SoftwareProductConstants.js';
22 import SoftwareProductAttachmentsReducer from './attachments/SoftwareProductAttachmentsReducer.js';
23 import HeatValidationReducer from './attachments/validation/HeatValidationReducer.js';
24 import HeatSetupReducer from './attachments/setup/HeatSetupReducer.js';
25 import { actionTypes as heatSetupActionTypes } from './attachments/setup/HeatSetupConstants.js';
26 import SoftwareProductCreationReducer from './creation/SoftwareProductCreationReducer.js';
27 import SoftwareProductDetailsReducer from './details/SoftwareProductDetailsReducer.js';
28 import SoftwareProductProcessesListReducer from './processes/SoftwareProductProcessesListReducer.js';
29 import SoftwareProductValidationReducer from './validation/SoftwareProductValidationReducer.js';
30 import SoftwareProductProcessesEditorReducer from './processes/SoftwareProductProcessesEditorReducer.js';
31 import SoftwareProductDeploymentListReducer from './deployment/SoftwareProductDeploymentListReducer.js';
32 import SoftwareProductDeploymentEditorReducer from './deployment/editor/SoftwareProductDeploymentEditorReducer.js';
33 import SoftwareProductNetworksListReducer from './networks/SoftwareProductNetworksListReducer.js';
34 import SoftwareProductComponentsListReducer from './components/SoftwareProductComponentsListReducer.js';
35 import SoftwareProductComponentEditorReducer from './components/SoftwareProductComponentEditorReducer.js';
36 import { actionTypes as processesActionTypes } from './processes/SoftwareProductProcessesConstants.js';
37 import SoftwareProductComponentProcessesListReducer from './components/processes/SoftwareProductComponentProcessesListReducer.js';
38 import SoftwareProductComponentProcessesEditorReducer from './components/processes/SoftwareProductComponentProcessesEditorReducer.js';
39 import { actionTypes as componentProcessesActionTypes } from './components/processes/SoftwareProductComponentProcessesConstants.js';
40 import SoftwareProductComponentsNICListReducer from './components/network/SoftwareProductComponentsNICListReducer.js';
41 import SoftwareProductComponentsNICEditorReducer from './components/network/SoftwareProductComponentsNICEditorReducer.js';
42 import SoftwareProductComponentsImageListReducer from './components/images/SoftwareProductComponentsImageListReducer.js';
43 import SoftwareProductComponentsImageEditorReducer from './components/images/SoftwareProductComponentsImageEditorReducer.js';
44 import SoftwareProductComponentsNICCreationReducer from './components/network/NICCreation/NICCreationReducer.js';
45 import SoftwareProductComponentsMonitoringReducer from './components/monitoring/SoftwareProductComponentsMonitoringReducer.js';
46 import SoftwareProductComponentsComputeFlavorListReducer from './components/compute/computeComponents/computeFlavor/ComputeFlavorListReducer.js';
47 import SoftwareProductComponentsComputeFlavorReducer from './components/compute/computeComponents/computeFlavor/ComputeFlavorReducer.js';
48 import { createPlainDataReducer } from 'sdc-app/common/reducers/PlainDataReducer.js';
49 import SoftwareProductDependenciesReducer from './dependencies/SoftwareProductDependenciesReducer.js';
50 import SoftwareProductValidationResultsViewReducer from './validationResults/SoftwareProductValidationResultsViewReducer.js';
52 createJSONSchemaReducer,
53 createComposedJSONSchemaReducer
54 } from 'sdc-app/common/reducers/JSONSchemaReducer.js';
56 COMPONENTS_QUESTIONNAIRE,
57 COMPONENTS_COMPUTE_QUESTIONNAIRE
58 } from 'sdc-app/onboarding/softwareProduct/components/SoftwareProductComponentsConstants.js';
59 import { NIC_QUESTIONNAIRE } from 'sdc-app/onboarding/softwareProduct/components/network/SoftwareProductComponentsNetworkConstants.js';
60 import { IMAGE_QUESTIONNAIRE } from 'sdc-app/onboarding/softwareProduct/components/images/SoftwareProductComponentsImageConstants.js';
62 import VNFImportReducer from './vnfMarketPlace/VNFImportReducer.js';
64 export default combineReducers({
65 softwareProductAttachments: combineReducers({
66 attachmentsDetails: SoftwareProductAttachmentsReducer,
67 heatValidation: HeatValidationReducer,
68 heatSetup: HeatSetupReducer,
69 heatSetupCache: (state = {}, action) =>
70 action.type === heatSetupActionTypes.FILL_HEAT_SETUP_CACHE
74 softwareProductCreation: createPlainDataReducer(
75 SoftwareProductCreationReducer
77 softwareProductEditor: createPlainDataReducer(
78 SoftwareProductDetailsReducer
80 softwareProductValidation: createPlainDataReducer(
81 SoftwareProductValidationReducer
83 softwareProductValidationResult: createPlainDataReducer(
84 SoftwareProductValidationResultsViewReducer
86 softwareProductProcesses: combineReducers({
87 processesList: SoftwareProductProcessesListReducer,
88 processesEditor: createPlainDataReducer(
89 SoftwareProductProcessesEditorReducer
91 processToDelete: (state = false, action) =>
93 processesActionTypes.SOFTWARE_PRODUCT_PROCESS_DELETE_CONFIRM
94 ? action.processToDelete
97 softwareProductDeployment: combineReducers({
98 deploymentFlavors: SoftwareProductDeploymentListReducer,
99 deploymentFlavorEditor: createPlainDataReducer(
100 SoftwareProductDeploymentEditorReducer
103 softwareProductNetworks: combineReducers({
104 networksList: SoftwareProductNetworksListReducer
106 softwareProductDependencies: SoftwareProductDependenciesReducer,
107 softwareProductComponents: combineReducers({
108 componentsList: SoftwareProductComponentsListReducer,
109 componentEditor: createPlainDataReducer(
110 createComposedJSONSchemaReducer(
111 COMPONENTS_QUESTIONNAIRE,
112 SoftwareProductComponentEditorReducer
115 componentProcesses: combineReducers({
116 processesList: SoftwareProductComponentProcessesListReducer,
117 processesEditor: createPlainDataReducer(
118 SoftwareProductComponentProcessesEditorReducer
120 processToDelete: (state = false, action) =>
122 componentProcessesActionTypes.SOFTWARE_PRODUCT_PROCESS_DELETE_COMPONENTS_CONFIRM
123 ? action.processToDelete
126 network: combineReducers({
127 nicList: SoftwareProductComponentsNICListReducer,
128 nicEditor: createPlainDataReducer(
129 createComposedJSONSchemaReducer(
131 SoftwareProductComponentsNICEditorReducer
134 nicCreation: createPlainDataReducer(
135 SoftwareProductComponentsNICCreationReducer
138 images: combineReducers({
139 imagesList: SoftwareProductComponentsImageListReducer,
140 imageEditor: createPlainDataReducer(
141 createComposedJSONSchemaReducer(
143 SoftwareProductComponentsImageEditorReducer
147 computeFlavor: combineReducers({
148 computesList: SoftwareProductComponentsComputeFlavorListReducer,
149 computeEditor: createPlainDataReducer(
150 createComposedJSONSchemaReducer(
151 COMPONENTS_COMPUTE_QUESTIONNAIRE,
152 SoftwareProductComponentsComputeFlavorReducer
156 monitoring: SoftwareProductComponentsMonitoringReducer
158 softwareProductCategories: (state = [], action) => {
159 if (action.type === actionTypes.SOFTWARE_PRODUCT_CATEGORIES_LOADED) {
160 return action.softwareProductCategories;
164 modelList: (state = [], action) => {
165 if (action.type === actionTypes.SOFTWARE_PRODUCT_MODELS_LOADED) {
166 return action.modelList;
170 softwareProductQuestionnaire: createJSONSchemaReducer(
171 PRODUCT_QUESTIONNAIRE
173 VNFMarketPlaceImport: VNFImportReducer