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 | |
| 37 | import {actionTypes as licenseModelOverviewConstants, selectedButton, VLM_DESCRIPTION_FORM} from './overview/LicenseModelOverviewConstants.js'; |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 38 | |
| 39 | export default combineReducers({ |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 40 | licenseModelCreation: createPlainDataReducer(licenseModelCreationReducer), |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 41 | licenseModelEditor: licenseModelEditorReducer, |
| 42 | |
| 43 | licenseAgreement: combineReducers({ |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 44 | licenseAgreementEditor: createPlainDataReducer(licenseAgreementEditorReducer), |
| 45 | licenseAgreementList: licenseAgreementListReducer |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 46 | }), |
| 47 | featureGroup: combineReducers({ |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 48 | featureGroupEditor: createPlainDataReducer(featureGroupsEditorReducer), |
| 49 | featureGroupsList: featureGroupsListReducer |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 50 | }), |
| 51 | entitlementPool: combineReducers({ |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 52 | entitlementPoolEditor: createPlainDataReducer(entitlementPoolsEditorReducer), |
| 53 | entitlementPoolsList: entitlementPoolsListReducer |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 54 | }), |
| 55 | licenseKeyGroup: combineReducers({ |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 56 | licenseKeyGroupsEditor: createPlainDataReducer(licenseKeyGroupsEditorReducer), |
| 57 | licenseKeyGroupsList: licenseKeyGroupsListReducer |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 58 | }), |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 59 | licenseModelOverview: combineReducers({ |
| 60 | selectedTab: (state = selectedButton.VLM_LIST_VIEW, action) => action.type === licenseModelOverviewConstants.LICENSE_MODEL_OVERVIEW_TAB_SELECTED ? action.buttonTab : state, |
| 61 | descriptionEditor: createPlainDataReducer(function(state = false, action) { |
| 62 | if (action.type === licenseModelOverviewConstants.LM_DATA_CHANGED) { |
| 63 | return { |
| 64 | ...state, |
| 65 | data : { |
| 66 | description : action.description |
| 67 | }, |
| 68 | formReady: null, |
| 69 | formName: VLM_DESCRIPTION_FORM, |
| 70 | genericFieldInfo: { |
| 71 | 'description': { |
| 72 | isValid: true, |
| 73 | errorText: '', |
| 74 | validations: [{type: 'required', data: true}, {type: 'maxLength', data: 1000}] |
| 75 | } |
| 76 | } |
| 77 | }; |
| 78 | //return action.description; |
| 79 | } else { |
| 80 | return state; |
| 81 | } |
| 82 | } |
| 83 | )}), |
| 84 | activityLog: activityLogReducer |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 85 | }); |