blob: b9369b427664d63d4ad71f991131d2afcac728c9 [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
svishnevbacc7152018-11-05 12:11:30 +020022export const actionTypes = keyMirror(
23 {
24 LICENSE_KEY_GROUPS_LIST_LOADED: 'LICENSE_KEY_GROUPS_LIST_LOADED',
25 LICENSE_KEY_GROUPS_DELETE_CONFIRM: 'LICENSE_KEY_GROUPS_DELETE_CONFIRM',
26 licenseKeyGroupsEditor: {
27 OPEN: 'licenseKeyGroupsEditor/OPEN',
28 CLOSE: 'licenseKeyGroupsEditor/CLOSE',
29 DATA_CHANGED: 'licenseKeyGroupsEditor/DATA_CHANGED',
30 LIMITS_LIST_LOADED: 'licenseKeyGroupsEditor/LIMITS_LIST_LOADED'
31 }
32 },
33 'licenseKeyGroups'
34);
Michael Landoefa037d2017-02-19 12:57:33 +020035
36export const defaultState = {
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020037 licenseKeyGroupsEditor: {
Arielkbce89862018-05-30 14:52:00 +030038 type: ''
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020039 }
Michael Landoefa037d2017-02-19 12:57:33 +020040};
41
AviZi280f8012017-06-09 02:39:56 +030042export const LKG_FORM_NAME = 'LKGFORM';
43
Michael Landoefa037d2017-02-19 12:57:33 +020044export const optionsInputValues = {
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020045 TYPE: [
46 { enum: '', title: i18n('please select…') },
47 { enum: 'Universal', title: 'Universal' },
48 { enum: 'Unique', title: 'Unique' },
49 { enum: 'One_Time', title: 'One Time' }
50 ]
Michael Landoefa037d2017-02-19 12:57:33 +020051};
52
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020053export const extractValue = item => {
54 if (item === undefined) {
55 return '';
56 } //TODO fix it later
Michael Landoefa037d2017-02-19 12:57:33 +020057
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020058 return item
59 ? item === optionInputOther.OTHER
60 ? item
61 : InputOptions.getTitleByName(optionsInputValues, item)
62 : '';
AviZi280f8012017-06-09 02:39:56 +030063};
64
Avi Ziv61070c92017-07-26 17:37:57 +030065export const tabIds = {
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020066 GENERAL: 'GENERAL',
67 SP_LIMITS: 'SP_LIMITS',
68 VENDOR_LIMITS: 'VENDOR_LIMITS',
69 ADD_LIMIT_BUTTON: 'ADD_LIMIT_BUTTON'
Avi Ziv61070c92017-07-26 17:37:57 +030070};