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.
17 import {actionTypes, FG_EDITOR_FORM, state as FeatureGroupStateConstants} from './FeatureGroupsConstants.js';
21 export default (state = {}, action) => {
22 switch (action.type) {
23 case actionTypes.featureGroupsEditor.OPEN:
26 data: action.featureGroup || {},
28 formName: FG_EDITOR_FORM,
33 validations: [{type: 'required', data: true}, {type: 'maxLength', data: 1000}],
34 tabId: FeatureGroupStateConstants.SELECTED_FEATURE_GROUP_TAB.GENERAL
39 validations: [{type: 'required', data: true}],
40 tabId: FeatureGroupStateConstants.SELECTED_FEATURE_GROUP_TAB.GENERAL
45 validations: [{type: 'required', data: true}, {type: 'maxLength', data: 120}],
46 tabId: FeatureGroupStateConstants.SELECTED_FEATURE_GROUP_TAB.GENERAL
50 case actionTypes.featureGroupsEditor.CLOSE:
52 case actionTypes.featureGroupsEditor.SELECT_TAB:
55 selectedTab: action.tab
58 case actionTypes.featureGroupsEditor.SELECTED_ENTITLEMENT_POOLS_BUTTONTAB:
61 selectedEntitlementPoolsButtonTab: action.buttonTab
63 case actionTypes.featureGroupsEditor.SELECTED_LICENSE_KEY_GROUPS_BUTTONTAB:
66 selectedLicenseKeyGroupsButtonTab: action.buttonTab