2 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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
13 * or implied. See the License for the specific language governing
14 * permissions and limitations under the License.
16 import { combineReducers } from 'redux';
20 } from './SoftwareProductConstants.js';
21 import SoftwareProductAttachmentsReducer from './attachments/SoftwareProductAttachmentsReducer.js';
22 import HeatValidationReducer from './attachments/validation/HeatValidationReducer.js';
23 import HeatSetupReducer from './attachments/setup/HeatSetupReducer.js';
24 import { actionTypes as heatSetupActionTypes } from './attachments/setup/HeatSetupConstants.js';
25 import SoftwareProductCreationReducer from './creation/SoftwareProductCreationReducer.js';
26 import SoftwareProductDetailsReducer from './details/SoftwareProductDetailsReducer.js';
27 import SoftwareProductProcessesListReducer from './processes/SoftwareProductProcessesListReducer.js';
28 import SoftwareProductValidationReducer from './validation/SoftwareProductValidationReducer.js';
29 import SoftwareProductProcessesEditorReducer from './processes/SoftwareProductProcessesEditorReducer.js';
30 import SoftwareProductDeploymentListReducer from './deployment/SoftwareProductDeploymentListReducer.js';
31 import SoftwareProductDeploymentEditorReducer from './deployment/editor/SoftwareProductDeploymentEditorReducer.js';
32 import SoftwareProductNetworksListReducer from './networks/SoftwareProductNetworksListReducer.js';
33 import SoftwareProductComponentsListReducer from './components/SoftwareProductComponentsListReducer.js';
34 import SoftwareProductComponentEditorReducer from './components/SoftwareProductComponentEditorReducer.js';
35 import { actionTypes as processesActionTypes } from './processes/SoftwareProductProcessesConstants.js';
36 import SoftwareProductComponentProcessesListReducer from './components/processes/SoftwareProductComponentProcessesListReducer.js';
37 import SoftwareProductComponentProcessesEditorReducer from './components/processes/SoftwareProductComponentProcessesEditorReducer.js';
38 import { actionTypes as componentProcessesActionTypes } from './components/processes/SoftwareProductComponentProcessesConstants.js';
39 import SoftwareProductComponentsNICListReducer from './components/network/SoftwareProductComponentsNICListReducer.js';
40 import SoftwareProductComponentsNICEditorReducer from './components/network/SoftwareProductComponentsNICEditorReducer.js';
41 import SoftwareProductComponentsImageListReducer from './components/images/SoftwareProductComponentsImageListReducer.js';
42 import SoftwareProductComponentsImageEditorReducer from './components/images/SoftwareProductComponentsImageEditorReducer.js';
43 import SoftwareProductComponentsNICCreationReducer from './components/network/NICCreation/NICCreationReducer.js';
44 import SoftwareProductComponentsMonitoringReducer from './components/monitoring/SoftwareProductComponentsMonitoringReducer.js';
45 import SoftwareProductComponentsComputeFlavorListReducer from './components/compute/computeComponents/computeFlavor/ComputeFlavorListReducer.js';
46 import SoftwareProductComponentsComputeFlavorReducer from './components/compute/computeComponents/computeFlavor/ComputeFlavorReducer.js';
47 import { createPlainDataReducer } from 'sdc-app/common/reducers/PlainDataReducer.js';
48 import SoftwareProductDependenciesReducer from './dependencies/SoftwareProductDependenciesReducer.js';
49 import SoftwareProductValidationResultsViewReducer from './validationResults/SoftwareProductValidationResultsViewReducer.js';
51 createJSONSchemaReducer,
52 createComposedJSONSchemaReducer
53 } from 'sdc-app/common/reducers/JSONSchemaReducer.js';
55 COMPONENTS_QUESTIONNAIRE,
56 COMPONENTS_COMPUTE_QUESTIONNAIRE
57 } from 'sdc-app/onboarding/softwareProduct/components/SoftwareProductComponentsConstants.js';
58 import { NIC_QUESTIONNAIRE } from 'sdc-app/onboarding/softwareProduct/components/network/SoftwareProductComponentsNetworkConstants.js';
59 import { IMAGE_QUESTIONNAIRE } from 'sdc-app/onboarding/softwareProduct/components/images/SoftwareProductComponentsImageConstants.js';
61 import VNFImportReducer from './vnfMarketPlace/VNFImportReducer.js';
63 export default combineReducers({
64 softwareProductAttachments: combineReducers({
65 attachmentsDetails: SoftwareProductAttachmentsReducer,
66 heatValidation: HeatValidationReducer,
67 heatSetup: HeatSetupReducer,
68 heatSetupCache: (state = {}, action) =>
69 action.type === heatSetupActionTypes.FILL_HEAT_SETUP_CACHE
73 softwareProductCreation: createPlainDataReducer(
74 SoftwareProductCreationReducer
76 softwareProductEditor: createPlainDataReducer(
77 SoftwareProductDetailsReducer
79 softwareProductValidation: createPlainDataReducer(
80 SoftwareProductValidationReducer
82 softwareProductValidationResult: createPlainDataReducer(
83 SoftwareProductValidationResultsViewReducer
85 softwareProductProcesses: combineReducers({
86 processesList: SoftwareProductProcessesListReducer,
87 processesEditor: createPlainDataReducer(
88 SoftwareProductProcessesEditorReducer
90 processToDelete: (state = false, action) =>
92 processesActionTypes.SOFTWARE_PRODUCT_PROCESS_DELETE_CONFIRM
93 ? action.processToDelete
96 softwareProductDeployment: combineReducers({
97 deploymentFlavors: SoftwareProductDeploymentListReducer,
98 deploymentFlavorEditor: createPlainDataReducer(
99 SoftwareProductDeploymentEditorReducer
102 softwareProductNetworks: combineReducers({
103 networksList: SoftwareProductNetworksListReducer
105 softwareProductDependencies: SoftwareProductDependenciesReducer,
106 softwareProductComponents: combineReducers({
107 componentsList: SoftwareProductComponentsListReducer,
108 componentEditor: createPlainDataReducer(
109 createComposedJSONSchemaReducer(
110 COMPONENTS_QUESTIONNAIRE,
111 SoftwareProductComponentEditorReducer
114 componentProcesses: combineReducers({
115 processesList: SoftwareProductComponentProcessesListReducer,
116 processesEditor: createPlainDataReducer(
117 SoftwareProductComponentProcessesEditorReducer
119 processToDelete: (state = false, action) =>
121 componentProcessesActionTypes.SOFTWARE_PRODUCT_PROCESS_DELETE_COMPONENTS_CONFIRM
122 ? action.processToDelete
125 network: combineReducers({
126 nicList: SoftwareProductComponentsNICListReducer,
127 nicEditor: createPlainDataReducer(
128 createComposedJSONSchemaReducer(
130 SoftwareProductComponentsNICEditorReducer
133 nicCreation: createPlainDataReducer(
134 SoftwareProductComponentsNICCreationReducer
137 images: combineReducers({
138 imagesList: SoftwareProductComponentsImageListReducer,
139 imageEditor: createPlainDataReducer(
140 createComposedJSONSchemaReducer(
142 SoftwareProductComponentsImageEditorReducer
146 computeFlavor: combineReducers({
147 computesList: SoftwareProductComponentsComputeFlavorListReducer,
148 computeEditor: createPlainDataReducer(
149 createComposedJSONSchemaReducer(
150 COMPONENTS_COMPUTE_QUESTIONNAIRE,
151 SoftwareProductComponentsComputeFlavorReducer
155 monitoring: SoftwareProductComponentsMonitoringReducer
157 softwareProductCategories: (state = [], action) => {
158 if (action.type === actionTypes.SOFTWARE_PRODUCT_CATEGORIES_LOADED) {
159 return action.softwareProductCategories;
163 softwareProductQuestionnaire: createJSONSchemaReducer(
164 PRODUCT_QUESTIONNAIRE
166 VNFMarketPlaceImport: VNFImportReducer