svishnev | 091edfd | 2018-03-19 12:15:19 +0200 | [diff] [blame] | 1 | /* |
| 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 |
svishnev | 091edfd | 2018-03-19 12:15:19 +0200 | [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, |
svishnev | 091edfd | 2018-03-19 12:15:19 +0200 | [diff] [blame] | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * 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 | |
Avi Ziv | b8e2faf | 2017-07-18 19:45:38 +0300 | [diff] [blame] | 18 | export const DATE_FORMAT = 'MM/DD/YYYY'; |
| 19 | |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 20 | export const actionTypes = keyMirror({ |
svishnev | fa538a1 | 2018-05-31 15:01:00 +0300 | [diff] [blame] | 21 | SET_CURRENT_SCREEN: 'SET_CURRENT_SCREEN', |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 22 | SET_CURRENT_LICENSE_MODEL: null, |
| 23 | SET_CURRENT_SCREEN_VERSION: null, |
svishnev | fa538a1 | 2018-05-31 15:01:00 +0300 | [diff] [blame] | 24 | UPDATE_CURRENT_SCREEN_PROPS: 'UPDATE_CURRENT_SCREEN_PROPS', |
| 25 | UPDATE_ITEM_STATUS: 'UPDATE_ITEM_STATUS', |
| 26 | UPDATE_ITEM_ARCHIVE_STATUS: 'UPDATE_ITEM_ARCHIVE_STATUS' |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 27 | }); |
| 28 | |
talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 29 | export const screenTypes = keyMirror({ |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 30 | LICENSE_MODEL: null, |
| 31 | SOFTWARE_PRODUCT: null, |
| 32 | SOFTWARE_PRODUCT_COMPONENT_DEFAULT_GENERAL: null |
talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 33 | }); |
| 34 | |
| 35 | const breadcrumbsEnum = { |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 36 | LICENSE_MODEL: 'LICENSE_MODEL', |
| 37 | VERSIONS_PAGE: 'VERSIONS_PAGE', |
| 38 | LICENSE_MODEL_OVERVIEW: 'LICENSE_MODEL_OVERVIEW', |
| 39 | LICENSE_AGREEMENTS: 'LICENSE_AGREEMENTS', |
| 40 | FEATURE_GROUPS: 'FEATURE_GROUPS', |
| 41 | ENTITLEMENT_POOLS: 'ENTITLEMENT_POOLS', |
| 42 | LICENSE_KEY_GROUPS: 'LICENSE_KEY_GROUPS', |
| 43 | ACTIVITY_LOG: 'ACTIVITY_LOG', |
talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 44 | |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 45 | SOFTWARE_PRODUCT: 'SOFTWARE_PRODUCT', |
| 46 | SOFTWARE_PRODUCT_VERSIONS_PAGE: 'SOFTWARE_PRODUCT_VERSIONS_PAGE', |
| 47 | SOFTWARE_PRODUCT_LANDING_PAGE: 'SOFTWARE_PRODUCT_LANDING_PAGE', |
| 48 | SOFTWARE_PRODUCT_DETAILS: 'SOFTWARE_PRODUCT_DETAILS', |
| 49 | SOFTWARE_PRODUCT_ATTACHMENTS: 'SOFTWARE_PRODUCT_ATTACHMENTS', |
| 50 | SOFTWARE_PRODUCT_PROCESSES: 'SOFTWARE_PRODUCT_PROCESSES', |
| 51 | SOFTWARE_PRODUCT_DEPLOYMENT: 'SOFTWARE_PRODUCT_DEPLOYMENT', |
| 52 | SOFTWARE_PRODUCT_NETWORKS: 'SOFTWARE_PRODUCT_NETWORKS', |
| 53 | SOFTWARE_PRODUCT_DEPENDENCIES: 'SOFTWARE_PRODUCT_DEPENDENCIES', |
| 54 | SOFTWARE_PRODUCT_ACTIVITY_LOG: 'SOFTWARE_PRODUCT_ACTIVITY_LOG', |
| 55 | SOFTWARE_PRODUCT_COMPONENTS: 'SOFTWARE_PRODUCT_COMPONENTS', |
| 56 | SOFTWARE_PRODUCT_COMPONENT_PROCESSES: |
| 57 | 'SOFTWARE_PRODUCT_COMPONENT_PROCESSES', |
| 58 | SOFTWARE_PRODUCT_COMPONENT_NETWORK: 'SOFTWARE_PRODUCT_COMPONENT_NETWORK', |
| 59 | SOFTWARE_PRODUCT_COMPONENT_STORAGE: 'SOFTWARE_PRODUCT_COMPONENT_STORAGE', |
| 60 | SOFTWARE_PRODUCT_COMPONENT_GENERAL: 'SOFTWARE_PRODUCT_COMPONENT_GENERAL', |
| 61 | SOFTWARE_PRODUCT_COMPONENT_COMPUTE: 'SOFTWARE_PRODUCT_COMPONENT_COMPUTE', |
| 62 | SOFTWARE_PRODUCT_COMPONENT_LOAD_BALANCING: |
| 63 | 'SOFTWARE_PRODUCT_COMPONENT_LOAD_BALANCING', |
| 64 | SOFTWARE_PRODUCT_COMPONENT_MONITORING: |
| 65 | 'SOFTWARE_PRODUCT_COMPONENT_MONITORING', |
| 66 | SOFTWARE_PRODUCT_COMPONENT_IMAGES: 'SOFTWARE_PRODUCT_COMPONENT_IMAGES' |
talig | 8e9c065 | 2017-12-20 14:30:43 +0200 | [diff] [blame] | 67 | }; |
| 68 | |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 69 | export const enums = keyMirror({ |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 70 | BREADCRUMS: { ...breadcrumbsEnum }, |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 71 | |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 72 | SCREEN: { |
| 73 | ONBOARDING_CATALOG: 'ONBOARDING_CATALOG', |
| 74 | VERSIONS_PAGE: breadcrumbsEnum.VERSIONS_PAGE, |
| 75 | LICENSE_MODEL_OVERVIEW: breadcrumbsEnum.LICENSE_MODEL_OVERVIEW, |
| 76 | LICENSE_AGREEMENTS: breadcrumbsEnum.LICENSE_AGREEMENTS, |
| 77 | FEATURE_GROUPS: breadcrumbsEnum.FEATURE_GROUPS, |
| 78 | ENTITLEMENT_POOLS: breadcrumbsEnum.ENTITLEMENT_POOLS, |
| 79 | LICENSE_KEY_GROUPS: breadcrumbsEnum.LICENSE_KEY_GROUPS, |
| 80 | ACTIVITY_LOG: breadcrumbsEnum.ACTIVITY_LOG, |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 81 | |
Einav Weiss Keidar | 7fdf733 | 2018-03-20 14:45:40 +0200 | [diff] [blame] | 82 | SOFTWARE_PRODUCT_VERSIONS_PAGE: |
| 83 | breadcrumbsEnum.SOFTWARE_PRODUCT_VERSIONS_PAGE, |
| 84 | SOFTWARE_PRODUCT_LANDING_PAGE: |
| 85 | breadcrumbsEnum.SOFTWARE_PRODUCT_LANDING_PAGE, |
| 86 | SOFTWARE_PRODUCT_DETAILS: breadcrumbsEnum.SOFTWARE_PRODUCT_DETAILS, |
| 87 | SOFTWARE_PRODUCT_ATTACHMENTS: |
| 88 | breadcrumbsEnum.SOFTWARE_PRODUCT_ATTACHMENTS, |
| 89 | SOFTWARE_PRODUCT_ATTACHMENTS_SETUP: |
| 90 | 'SOFTWARE_PRODUCT_ATTACHMENTS_SETUP', |
| 91 | SOFTWARE_PRODUCT_ATTACHMENTS_VALIDATION: |
| 92 | 'SOFTWARE_PRODUCT_ATTACHMENTS_VALIDATION', |
| 93 | SOFTWARE_PRODUCT_PROCESSES: breadcrumbsEnum.SOFTWARE_PRODUCT_PROCESSES, |
| 94 | SOFTWARE_PRODUCT_DEPLOYMENT: |
| 95 | breadcrumbsEnum.SOFTWARE_PRODUCT_DEPLOYMENT, |
| 96 | SOFTWARE_PRODUCT_NETWORKS: breadcrumbsEnum.SOFTWARE_PRODUCT_NETWORKS, |
| 97 | SOFTWARE_PRODUCT_DEPENDENCIES: |
| 98 | breadcrumbsEnum.SOFTWARE_PRODUCT_DEPENDENCIES, |
| 99 | SOFTWARE_PRODUCT_ACTIVITY_LOG: |
| 100 | breadcrumbsEnum.SOFTWARE_PRODUCT_ACTIVITY_LOG, |
| 101 | SOFTWARE_PRODUCT_COMPONENTS: |
| 102 | breadcrumbsEnum.SOFTWARE_PRODUCT_COMPONENTS, |
| 103 | SOFTWARE_PRODUCT_COMPONENT_PROCESSES: |
| 104 | breadcrumbsEnum.SOFTWARE_PRODUCT_COMPONENT_PROCESSES, |
| 105 | SOFTWARE_PRODUCT_COMPONENT_COMPUTE: |
| 106 | breadcrumbsEnum.SOFTWARE_PRODUCT_COMPONENT_COMPUTE, |
| 107 | SOFTWARE_PRODUCT_COMPONENT_STORAGE: |
| 108 | breadcrumbsEnum.SOFTWARE_PRODUCT_COMPONENT_STORAGE, |
| 109 | SOFTWARE_PRODUCT_COMPONENT_NETWORK: |
| 110 | breadcrumbsEnum.SOFTWARE_PRODUCT_COMPONENT_NETWORK, |
| 111 | SOFTWARE_PRODUCT_COMPONENT_GENERAL: |
| 112 | breadcrumbsEnum.SOFTWARE_PRODUCT_COMPONENT_GENERAL, |
| 113 | SOFTWARE_PRODUCT_COMPONENT_LOAD_BALANCING: |
| 114 | breadcrumbsEnum.SOFTWARE_PRODUCT_COMPONENT_LOAD_BALANCING, |
| 115 | SOFTWARE_PRODUCT_COMPONENT_MONITORING: |
| 116 | breadcrumbsEnum.SOFTWARE_PRODUCT_COMPONENT_MONITORING, |
| 117 | SOFTWARE_PRODUCT_COMPONENT_IMAGES: |
| 118 | breadcrumbsEnum.SOFTWARE_PRODUCT_COMPONENT_IMAGES |
| 119 | } |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 120 | }); |
svishnev | fa538a1 | 2018-05-31 15:01:00 +0300 | [diff] [blame] | 121 | |
| 122 | export const onboardingActions = { |
| 123 | updateItemArchivedStatus: isArchived => ({ |
| 124 | type: actionTypes.UPDATE_ITEM_ARCHIVE_STATUS, |
| 125 | isArchived |
| 126 | }) |
| 127 | }; |