AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 1 | /*! |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 2 | * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 3 | * |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 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 |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 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. |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 15 | */ |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 16 | import {combineReducers} from 'redux'; |
| 17 | |
Avi Ziv | b8e2faf | 2017-07-18 19:45:38 +0300 | [diff] [blame] | 18 | import activityLogReducer from 'sdc-app/common/activity-log/ActivityLogReducer.js'; |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 19 | |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 20 | import licenseModelCreationReducer from './creation/LicenseModelCreationReducer.js'; |
| 21 | import licenseModelEditorReducer from './LicenseModelEditorReducer.js'; |
| 22 | |
| 23 | import licenseAgreementListReducer from './licenseAgreement/LicenseAgreementListReducer.js'; |
| 24 | import licenseAgreementEditorReducer from './licenseAgreement/LicenseAgreementEditorReducer.js'; |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 25 | |
| 26 | import featureGroupsEditorReducer from './featureGroups/FeatureGroupsEditorReducer.js'; |
| 27 | import featureGroupsListReducer from './featureGroups/FeatureGroupsListReducer.js'; |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 28 | |
| 29 | import entitlementPoolsListReducer from './entitlementPools/EntitlementPoolsListReducer.js'; |
| 30 | import entitlementPoolsEditorReducer from './entitlementPools/EntitlementPoolsEditorReducer.js'; |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 31 | |
| 32 | import licenseKeyGroupsEditorReducer from './licenseKeyGroups/LicenseKeyGroupsEditorReducer.js'; |
| 33 | import licenseKeyGroupsListReducer from './licenseKeyGroups/LicenseKeyGroupsListReducer.js'; |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 34 | |
| 35 | import {createPlainDataReducer} from 'sdc-app/common/reducers/PlainDataReducer.js'; |
| 36 | |
ilanap | c6a41de | 2017-11-07 11:54:10 +0200 | [diff] [blame] | 37 | import {actionTypes as licenseModelOverviewConstants, VLM_DESCRIPTION_FORM} from './overview/LicenseModelOverviewConstants.js'; |
Avi Ziv | 61070c9 | 2017-07-26 17:37:57 +0300 | [diff] [blame] | 38 | import limitEditorReducer from './limits/LimitEditorReducer.js'; |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 39 | |
| 40 | export default combineReducers({ |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 41 | licenseModelCreation: createPlainDataReducer(licenseModelCreationReducer), |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 42 | licenseModelEditor: licenseModelEditorReducer, |
| 43 | |
| 44 | licenseAgreement: combineReducers({ |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 45 | licenseAgreementEditor: createPlainDataReducer(licenseAgreementEditorReducer), |
| 46 | licenseAgreementList: licenseAgreementListReducer |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 47 | }), |
| 48 | featureGroup: combineReducers({ |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 49 | featureGroupEditor: createPlainDataReducer(featureGroupsEditorReducer), |
| 50 | featureGroupsList: featureGroupsListReducer |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 51 | }), |
| 52 | entitlementPool: combineReducers({ |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 53 | entitlementPoolEditor: createPlainDataReducer(entitlementPoolsEditorReducer), |
| 54 | entitlementPoolsList: entitlementPoolsListReducer |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 55 | }), |
| 56 | licenseKeyGroup: combineReducers({ |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 57 | licenseKeyGroupsEditor: createPlainDataReducer(licenseKeyGroupsEditorReducer), |
| 58 | licenseKeyGroupsList: licenseKeyGroupsListReducer |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 59 | }), |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 60 | licenseModelOverview: combineReducers({ |
ilanap | c6a41de | 2017-11-07 11:54:10 +0200 | [diff] [blame] | 61 | selectedTab: (state = null, action) => action.type === licenseModelOverviewConstants.LICENSE_MODEL_OVERVIEW_TAB_SELECTED ? action.buttonTab : state, |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 62 | descriptionEditor: createPlainDataReducer(function(state = false, action) { |
| 63 | if (action.type === licenseModelOverviewConstants.LM_DATA_CHANGED) { |
| 64 | return { |
| 65 | ...state, |
| 66 | data : { |
| 67 | description : action.description |
| 68 | }, |
| 69 | formReady: null, |
| 70 | formName: VLM_DESCRIPTION_FORM, |
| 71 | genericFieldInfo: { |
| 72 | 'description': { |
| 73 | isValid: true, |
| 74 | errorText: '', |
| 75 | validations: [{type: 'required', data: true}, {type: 'maxLength', data: 1000}] |
| 76 | } |
| 77 | } |
| 78 | }; |
| 79 | //return action.description; |
| 80 | } else { |
| 81 | return state; |
| 82 | } |
| 83 | } |
| 84 | )}), |
Avi Ziv | 61070c9 | 2017-07-26 17:37:57 +0300 | [diff] [blame] | 85 | limitEditor: createPlainDataReducer(limitEditorReducer), |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 86 | activityLog: activityLogReducer |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 87 | }); |