blob: 7ab8a4f49af0c43216a24eeb46a2ede16cffe596 [file] [log] [blame]
AviZi280f8012017-06-09 02:39:56 +03001/*!
svishnev8f133302018-08-06 23:08:39 +03002 * Copyright © 2016-2018 European Support Limited
AviZi280f8012017-06-09 02:39:56 +03003 *
Michael Landoefa037d2017-02-19 12:57:33 +02004 * 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
AviZi280f8012017-06-09 02:39:56 +03007 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
Michael Landoefa037d2017-02-19 12:57:33 +020010 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
AviZi280f8012017-06-09 02:39:56 +030012 * 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 Landoefa037d2017-02-19 12:57:33 +020015 */
Michael Landoefa037d2017-02-19 12:57:33 +020016import keyMirror from 'nfvo-utils/KeyMirror.js';
17import i18n from 'nfvo-utils/i18n/i18n.js';
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020018import InputOptions, {
19 other as optionInputOther
20} from 'nfvo-components/input/validation/InputOptions.jsx';
Michael Landoefa037d2017-02-19 12:57:33 +020021
22export const actionTypes = keyMirror({
svishnev8f133302018-08-06 23:08:39 +030023 LICENSE_KEY_GROUPS_LIST_LOADED: 'LICENSE_KEY_GROUPS_LIST_LOADED',
24 LICENSE_KEY_GROUPS_DELETE_CONFIRM: 'LICENSE_KEY_GROUPS_DELETE_CONFIRM',
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020025 licenseKeyGroupsEditor: {
svishnev8f133302018-08-06 23:08:39 +030026 OPEN: 'licenseKeyGroupsEditor/OPEN',
27 CLOSE: 'licenseKeyGroupsEditor/CLOSE',
28 DATA_CHANGED: 'licenseKeyGroupsEditor/DATA_CHANGED',
29 LIMITS_LIST_LOADED: 'licenseKeyGroupsEditor/LIMITS_LIST_LOADED'
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020030 }
Michael Landoefa037d2017-02-19 12:57:33 +020031});
32
33export const defaultState = {
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020034 licenseKeyGroupsEditor: {
Arielkbce89862018-05-30 14:52:00 +030035 type: ''
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020036 }
Michael Landoefa037d2017-02-19 12:57:33 +020037};
38
AviZi280f8012017-06-09 02:39:56 +030039export const LKG_FORM_NAME = 'LKGFORM';
40
Michael Landoefa037d2017-02-19 12:57:33 +020041export const optionsInputValues = {
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020042 TYPE: [
43 { enum: '', title: i18n('please select…') },
44 { enum: 'Universal', title: 'Universal' },
45 { enum: 'Unique', title: 'Unique' },
46 { enum: 'One_Time', title: 'One Time' }
47 ]
Michael Landoefa037d2017-02-19 12:57:33 +020048};
49
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020050export const extractValue = item => {
51 if (item === undefined) {
52 return '';
53 } //TODO fix it later
Michael Landoefa037d2017-02-19 12:57:33 +020054
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020055 return item
56 ? item === optionInputOther.OTHER
57 ? item
58 : InputOptions.getTitleByName(optionsInputValues, item)
59 : '';
AviZi280f8012017-06-09 02:39:56 +030060};
61
Avi Ziv61070c92017-07-26 17:37:57 +030062export const tabIds = {
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020063 GENERAL: 'GENERAL',
64 SP_LIMITS: 'SP_LIMITS',
65 VENDOR_LIMITS: 'VENDOR_LIMITS',
66 ADD_LIMIT_BUTTON: 'ADD_LIMIT_BUTTON'
Avi Ziv61070c92017-07-26 17:37:57 +030067};