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 | |
svishnev | bacc715 | 2018-11-05 12:11:30 +0200 | [diff] [blame^] | 22 | export 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 Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 35 | |
| 36 | export const defaultState = { |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 37 | licenseKeyGroupsEditor: { |
Arielk | bce8986 | 2018-05-30 14:52:00 +0300 | [diff] [blame] | 38 | type: '' |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 39 | } |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 40 | }; |
| 41 | |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 42 | export const LKG_FORM_NAME = 'LKGFORM'; |
| 43 | |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 44 | export const optionsInputValues = { |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 45 | 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 Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 51 | }; |
| 52 | |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 53 | export const extractValue = item => { |
| 54 | if (item === undefined) { |
| 55 | return ''; |
| 56 | } //TODO fix it later |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 57 | |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 58 | return item |
| 59 | ? item === optionInputOther.OTHER |
| 60 | ? item |
| 61 | : InputOptions.getTitleByName(optionsInputValues, item) |
| 62 | : ''; |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 63 | }; |
| 64 | |
Avi Ziv | 61070c9 | 2017-07-26 17:37:57 +0300 | [diff] [blame] | 65 | export const tabIds = { |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 66 | GENERAL: 'GENERAL', |
| 67 | SP_LIMITS: 'SP_LIMITS', |
| 68 | VENDOR_LIMITS: 'VENDOR_LIMITS', |
| 69 | ADD_LIMIT_BUTTON: 'ADD_LIMIT_BUTTON' |
Avi Ziv | 61070c9 | 2017-07-26 17:37:57 +0300 | [diff] [blame] | 70 | }; |