AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 1 | /*! |
svishnev | 8f13330 | 2018-08-06 23:08:39 +0300 | [diff] [blame] | 2 | * Copyright © 2016-2018 European Support Limited |
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 keyMirror from 'nfvo-utils/KeyMirror.js'; |
| 17 | import i18n from 'nfvo-utils/i18n/i18n.js'; |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 18 | import InputOptions, { |
| 19 | other as optionInputOther |
| 20 | } from 'nfvo-components/input/validation/InputOptions.jsx'; |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 21 | |
| 22 | export const actionTypes = keyMirror({ |
svishnev | 8f13330 | 2018-08-06 23:08:39 +0300 | [diff] [blame] | 23 | LICENSE_KEY_GROUPS_LIST_LOADED: 'LICENSE_KEY_GROUPS_LIST_LOADED', |
| 24 | LICENSE_KEY_GROUPS_DELETE_CONFIRM: 'LICENSE_KEY_GROUPS_DELETE_CONFIRM', |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 25 | licenseKeyGroupsEditor: { |
svishnev | 8f13330 | 2018-08-06 23:08:39 +0300 | [diff] [blame] | 26 | OPEN: 'licenseKeyGroupsEditor/OPEN', |
| 27 | CLOSE: 'licenseKeyGroupsEditor/CLOSE', |
| 28 | DATA_CHANGED: 'licenseKeyGroupsEditor/DATA_CHANGED', |
| 29 | LIMITS_LIST_LOADED: 'licenseKeyGroupsEditor/LIMITS_LIST_LOADED' |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 30 | } |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 31 | }); |
| 32 | |
| 33 | export const defaultState = { |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 34 | licenseKeyGroupsEditor: { |
Arielk | bce8986 | 2018-05-30 14:52:00 +0300 | [diff] [blame] | 35 | type: '' |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 36 | } |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 37 | }; |
| 38 | |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 39 | export const LKG_FORM_NAME = 'LKGFORM'; |
| 40 | |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 41 | export const optionsInputValues = { |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 42 | 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 Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 48 | }; |
| 49 | |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 50 | export const extractValue = item => { |
| 51 | if (item === undefined) { |
| 52 | return ''; |
| 53 | } //TODO fix it later |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 54 | |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 55 | return item |
| 56 | ? item === optionInputOther.OTHER |
| 57 | ? item |
| 58 | : InputOptions.getTitleByName(optionsInputValues, item) |
| 59 | : ''; |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 60 | }; |
| 61 | |
Avi Ziv | 61070c9 | 2017-07-26 17:37:57 +0300 | [diff] [blame] | 62 | export const tabIds = { |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 63 | GENERAL: 'GENERAL', |
| 64 | SP_LIMITS: 'SP_LIMITS', |
| 65 | VENDOR_LIMITS: 'VENDOR_LIMITS', |
| 66 | ADD_LIMIT_BUTTON: 'ADD_LIMIT_BUTTON' |
Avi Ziv | 61070c9 | 2017-07-26 17:37:57 +0300 | [diff] [blame] | 67 | }; |