AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 1 | /*! |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 2 | * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. |
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 LicenseModelActionHelper from './licenseModel/LicenseModelActionHelper.js'; |
| 17 | import LicenseAgreementActionHelper from './licenseModel/licenseAgreement/LicenseAgreementActionHelper.js'; |
| 18 | import FeatureGroupsActionHelper from './licenseModel/featureGroups/FeatureGroupsActionHelper.js'; |
| 19 | import LicenseKeyGroupsActionHelper from './licenseModel/licenseKeyGroups/LicenseKeyGroupsActionHelper.js'; |
| 20 | import EntitlementPoolsActionHelper from './licenseModel/entitlementPools/EntitlementPoolsActionHelper.js'; |
| 21 | import SoftwareProductActionHelper from './softwareProduct/SoftwareProductActionHelper.js'; |
| 22 | import SoftwareProductProcessesActionHelper from './softwareProduct/processes/SoftwareProductProcessesActionHelper.js'; |
Avi Ziv | b8e2faf | 2017-07-18 19:45:38 +0300 | [diff] [blame] | 23 | import SoftwareProductDeploymentActionHelper from './softwareProduct/deployment/SoftwareProductDeploymentActionHelper.js'; |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 24 | import SoftwareProductNetworksActionHelper from './softwareProduct/networks/SoftwareProductNetworksActionHelper.js'; |
| 25 | import SoftwareProductComponentsActionHelper from './softwareProduct/components/SoftwareProductComponentsActionHelper.js'; |
| 26 | import SoftwareProductComponentProcessesActionHelper from './softwareProduct/components/processes/SoftwareProductComponentProcessesActionHelper.js'; |
| 27 | import SoftwareProductComponentsNetworkActionHelper from './softwareProduct/components/network/SoftwareProductComponentsNetworkActionHelper.js'; |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 28 | import SoftwareProductDependenciesActionHelper from './softwareProduct/dependencies/SoftwareProductDependenciesActionHelper.js'; |
Avi Ziv | b8e2faf | 2017-07-18 19:45:38 +0300 | [diff] [blame] | 29 | import ComputeFlavorActionHelper from './softwareProduct/components/compute/ComputeFlavorActionHelper.js'; |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 30 | import OnboardActionHelper from './onboard/OnboardActionHelper.js'; |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 31 | import SoftwareProductComponentsMonitoringAction from './softwareProduct/components/monitoring/SoftwareProductComponentsMonitoringActionHelper.js'; |
| 32 | import {actionTypes, enums} from './OnboardingConstants.js'; |
Avi Ziv | b8e2faf | 2017-07-18 19:45:38 +0300 | [diff] [blame] | 33 | import SoftwareProductComponentsImageActionHelper from './softwareProduct/components/images/SoftwareProductComponentsImageActionHelper.js'; |
shrek2000 | c8a540b | 2017-09-11 15:45:37 +0300 | [diff] [blame^] | 34 | import {navigationItems as SoftwareProductNavigationItems, actionTypes as SoftwareProductActionTypes, onboardingOriginTypes} from 'sdc-app/onboarding/softwareProduct/SoftwareProductConstants.js'; |
Avi Ziv | b8e2faf | 2017-07-18 19:45:38 +0300 | [diff] [blame] | 35 | import ActivityLogActionHelper from 'sdc-app/common/activity-log/ActivityLogActionHelper.js'; |
Michael Lando | 4d97d5f | 2017-06-17 22:40:44 +0300 | [diff] [blame] | 36 | import licenseModelOverviewActionHelper from 'sdc-app/onboarding/licenseModel/overview/licenseModelOverviewActionHelper.js'; |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 37 | import store from 'sdc-app/AppStore.js'; |
Michael Lando | 4d97d5f | 2017-06-17 22:40:44 +0300 | [diff] [blame] | 38 | import {selectedButton as licenseModelOverviewSelectedButton} from 'sdc-app/onboarding/licenseModel/overview/LicenseModelOverviewConstants.js'; |
shrek2000 | c8a540b | 2017-09-11 15:45:37 +0300 | [diff] [blame^] | 39 | import {tabsMapping as attachmentsTabsMapping} from 'sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsConstants.js'; |
| 40 | import SoftwareProductAttachmentsActionHelper from 'sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsActionHelper.js'; |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 41 | |
| 42 | function setCurrentScreen(dispatch, screen, props = {}) { |
| 43 | dispatch({ |
| 44 | type: actionTypes.SET_CURRENT_SCREEN, |
| 45 | currentScreen: { |
| 46 | screen, |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 47 | props, |
| 48 | forceBreadCrumbsUpdate: true |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 49 | } |
| 50 | }); |
| 51 | } |
| 52 | |
| 53 | function getCurrentLicenseModelVersion(licenseModelId) { |
| 54 | return store.getState().licenseModelList.find(({id}) => id === licenseModelId).version; |
| 55 | } |
| 56 | |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 57 | function getCurrentSoftwareProductVersion(softwareProductId) { |
| 58 | return store.getState().softwareProductList.find(({id}) => id === softwareProductId).version; |
| 59 | } |
| 60 | |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 61 | export default { |
| 62 | |
| 63 | navigateToOnboardingCatalog(dispatch) { |
| 64 | LicenseModelActionHelper.fetchLicenseModels(dispatch); |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 65 | LicenseModelActionHelper.fetchFinalizedLicenseModels(dispatch); |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 66 | SoftwareProductActionHelper.fetchSoftwareProductList(dispatch); |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 67 | SoftwareProductActionHelper.fetchFinalizedSoftwareProductList(dispatch); |
| 68 | OnboardActionHelper.resetOnboardStore(dispatch); |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 69 | setCurrentScreen(dispatch, enums.SCREEN.ONBOARDING_CATALOG); |
| 70 | }, |
| 71 | |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 72 | autoSaveBeforeNavigate(dispatch, {softwareProductId, version, vspComponentId, dataToSave}) { |
| 73 | if(softwareProductId) { |
| 74 | if(vspComponentId) { |
| 75 | return SoftwareProductComponentsActionHelper.updateSoftwareProductComponent(dispatch, { |
| 76 | softwareProductId, version, vspComponentId, |
| 77 | componentData: dataToSave.componentData, |
| 78 | qdata: dataToSave.qdata |
| 79 | }); |
| 80 | } |
| 81 | return SoftwareProductActionHelper.updateSoftwareProduct(dispatch, { |
| 82 | softwareProduct: dataToSave.softwareProduct, |
| 83 | qdata: dataToSave.qdata |
| 84 | }); |
| 85 | } |
| 86 | return Promise.resolve(); |
| 87 | }, |
| 88 | |
| 89 | navigateToLicenseModelOverview(dispatch, {licenseModelId, version}) { |
| 90 | if (!version) { |
| 91 | version = getCurrentLicenseModelVersion(licenseModelId); |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * TODO change to specific rest |
| 96 | */ |
| 97 | |
| 98 | LicenseModelActionHelper.fetchLicenseModelById(dispatch, {licenseModelId, version}).then(() => { |
| 99 | LicenseModelActionHelper.fetchLicenseModelItems(dispatch, {licenseModelId, version}).then(() =>{ |
| 100 | setCurrentScreen(dispatch, enums.SCREEN.LICENSE_MODEL_OVERVIEW, {licenseModelId, version}); |
| 101 | }); |
Michael Lando | 4d97d5f | 2017-06-17 22:40:44 +0300 | [diff] [blame] | 102 | licenseModelOverviewActionHelper.selectVLMListView(dispatch, {buttonTab: licenseModelOverviewSelectedButton.VLM_LIST_VIEW}); |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 103 | }); |
| 104 | }, |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 105 | navigateToLicenseAgreements(dispatch, {licenseModelId, version}) { |
| 106 | if(!version) { |
| 107 | version = getCurrentLicenseModelVersion(licenseModelId); |
| 108 | } |
| 109 | LicenseAgreementActionHelper.fetchLicenseAgreementList(dispatch, {licenseModelId, version}); |
| 110 | LicenseModelActionHelper.fetchLicenseModelById(dispatch, {licenseModelId, version}).then(() => { |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 111 | setCurrentScreen(dispatch, enums.SCREEN.LICENSE_AGREEMENTS, {licenseModelId, version}); |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 112 | }); |
| 113 | }, |
| 114 | |
| 115 | navigateToFeatureGroups(dispatch, {licenseModelId, version}) { |
| 116 | if(!version) { |
| 117 | version = getCurrentLicenseModelVersion(licenseModelId); |
| 118 | } |
| 119 | FeatureGroupsActionHelper.fetchFeatureGroupsList(dispatch, {licenseModelId, version}); |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 120 | setCurrentScreen(dispatch, enums.SCREEN.FEATURE_GROUPS, {licenseModelId, version}); |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 121 | }, |
| 122 | |
| 123 | navigateToEntitlementPools(dispatch, {licenseModelId, version}) { |
| 124 | if(!version) { |
| 125 | version = getCurrentLicenseModelVersion(licenseModelId); |
| 126 | } |
| 127 | EntitlementPoolsActionHelper.fetchEntitlementPoolsList(dispatch, {licenseModelId, version}); |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 128 | setCurrentScreen(dispatch, enums.SCREEN.ENTITLEMENT_POOLS, {licenseModelId, version}); |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 129 | }, |
| 130 | |
| 131 | navigateToLicenseKeyGroups(dispatch, {licenseModelId, version}) { |
| 132 | if(!version) { |
| 133 | version = getCurrentLicenseModelVersion(licenseModelId); |
| 134 | } |
| 135 | LicenseKeyGroupsActionHelper.fetchLicenseKeyGroupsList(dispatch, {licenseModelId, version}); |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 136 | setCurrentScreen(dispatch, enums.SCREEN.LICENSE_KEY_GROUPS, {licenseModelId, version}); |
| 137 | }, |
| 138 | |
| 139 | navigateToLicenseModelActivityLog(dispatch, {licenseModelId, version}){ |
| 140 | if(!version) { |
| 141 | version = getCurrentLicenseModelVersion(licenseModelId); |
| 142 | } |
| 143 | ActivityLogActionHelper.fetchActivityLog(dispatch, {itemId: licenseModelId, versionId: version.id}); |
| 144 | setCurrentScreen(dispatch, enums.SCREEN.ACTIVITY_LOG, {licenseModelId, version}); |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 145 | }, |
| 146 | |
| 147 | navigateToSoftwareProductLandingPage(dispatch, {softwareProductId, licenseModelId, version, licensingVersion}) { |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 148 | |
| 149 | if (!version) { |
| 150 | version = getCurrentSoftwareProductVersion(softwareProductId); |
| 151 | } |
| 152 | |
| 153 | SoftwareProductComponentsActionHelper.clearComponentsStore(dispatch); |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 154 | SoftwareProductActionHelper.fetchSoftwareProduct(dispatch, {softwareProductId, version}).then(response => { |
| 155 | if(!licensingVersion) { |
| 156 | licensingVersion = response[0].licensingVersion; |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 157 | if (!licensingVersion) { |
| 158 | licensingVersion = {id: '1.0', label: '1.0'}; |
| 159 | } |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 160 | } |
| 161 | if (!licenseModelId) { |
| 162 | licenseModelId = response[0].vendorId; |
| 163 | } |
| 164 | |
Michael Lando | b3d4898 | 2017-06-11 14:22:02 +0300 | [diff] [blame] | 165 | const newVersion = response[0].version ? response[0].version : version; |
| 166 | |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 167 | SoftwareProductActionHelper.loadSoftwareProductDetailsData(dispatch, {licenseModelId, licensingVersion}); |
Avi Ziv | 61070c9 | 2017-07-26 17:37:57 +0300 | [diff] [blame] | 168 | |
| 169 | SoftwareProductComponentsActionHelper.fetchSoftwareProductComponents(dispatch, {softwareProductId, version: newVersion}); |
shrek2000 | c8a540b | 2017-09-11 15:45:37 +0300 | [diff] [blame^] | 170 | if(response[0].onboardingOrigin === onboardingOriginTypes.ZIP) { |
| 171 | SoftwareProductActionHelper.loadSoftwareProductHeatCandidate(dispatch, {softwareProductId, version: newVersion}); |
| 172 | } |
Avi Ziv | 61070c9 | 2017-07-26 17:37:57 +0300 | [diff] [blame] | 173 | setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_LANDING_PAGE, {softwareProductId, licenseModelId, version: newVersion}); |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 174 | }); |
| 175 | }, |
| 176 | |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 177 | navigateToSoftwareProductDetails(dispatch, {softwareProductId, version}) { |
| 178 | SoftwareProductActionHelper.fetchSoftwareProduct(dispatch, {softwareProductId, version}); |
| 179 | setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_DETAILS, {softwareProductId, version}); |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 180 | }, |
| 181 | |
shrek2000 | c8a540b | 2017-09-11 15:45:37 +0300 | [diff] [blame^] | 182 | navigateToSoftwareProductAttachmentsSetupTab(dispatch, {softwareProductId, version}) { |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 183 | SoftwareProductActionHelper.loadSoftwareProductHeatCandidate(dispatch, {softwareProductId, version}); |
shrek2000 | c8a540b | 2017-09-11 15:45:37 +0300 | [diff] [blame^] | 184 | SoftwareProductAttachmentsActionHelper.setActiveTab(dispatch, {activeTab: attachmentsTabsMapping.SETUP}); |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 185 | setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS, {softwareProductId, version}); |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 186 | }, |
| 187 | |
shrek2000 | c8a540b | 2017-09-11 15:45:37 +0300 | [diff] [blame^] | 188 | navigateToSoftwareProductAttachmentsValidationTab(dispatch, {softwareProductId, version}) { |
| 189 | SoftwareProductActionHelper.processAndValidateHeatCandidate(dispatch, {softwareProductId, version}).then(() => { |
| 190 | SoftwareProductAttachmentsActionHelper.setActiveTab(dispatch, {activeTab: attachmentsTabsMapping.VALIDATION}); |
| 191 | setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS, {softwareProductId, version}); |
| 192 | }); |
| 193 | }, |
| 194 | |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 195 | navigateToSoftwareProductProcesses(dispatch, {softwareProductId, version}) { |
| 196 | if (softwareProductId) { |
| 197 | SoftwareProductProcessesActionHelper.fetchProcessesList(dispatch, {softwareProductId, version}); |
| 198 | } |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 199 | setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_PROCESSES, {softwareProductId, version}); |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 200 | }, |
| 201 | |
| 202 | navigateToSoftwareProductNetworks(dispatch, {softwareProductId, version}) { |
| 203 | if (softwareProductId) { |
| 204 | SoftwareProductNetworksActionHelper.fetchNetworksList(dispatch, {softwareProductId, version}); |
| 205 | } |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 206 | setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_NETWORKS, {softwareProductId, version}); |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 207 | }, |
| 208 | |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 209 | navigateToSoftwareProductDependencies(dispatch, {softwareProductId, version}) { |
| 210 | SoftwareProductDependenciesActionHelper.fetchDependencies(dispatch, {softwareProductId, version}); |
| 211 | setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_DEPENDENCIES, {softwareProductId, version}); |
| 212 | }, |
| 213 | |
| 214 | navigateToSoftwareProductComponents(dispatch, {softwareProductId, version}) { |
| 215 | SoftwareProductComponentsActionHelper.fetchSoftwareProductComponents(dispatch, {softwareProductId, version}); |
| 216 | setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENTS, {softwareProductId, version}); |
| 217 | }, |
Avi Ziv | b8e2faf | 2017-07-18 19:45:38 +0300 | [diff] [blame] | 218 | navigateToSoftwareProductDeployment(dispatch, {softwareProductId, version}) { |
| 219 | SoftwareProductDeploymentActionHelper.fetchDeploymentFlavorsList(dispatch, {softwareProductId, version}); |
| 220 | ComputeFlavorActionHelper.fetchComputesListForVSP(dispatch, {softwareProductId, version}); |
| 221 | setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_DEPLOYMENT, {softwareProductId, version}); |
| 222 | }, |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 223 | navigateToSoftwareProductActivityLog(dispatch, {softwareProductId, version}){ |
| 224 | ActivityLogActionHelper.fetchActivityLog(dispatch, {itemId: softwareProductId, versionId: version.id}); |
| 225 | setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_ACTIVITY_LOG, {softwareProductId, version}); |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 226 | }, |
| 227 | |
| 228 | navigateToSoftwareProductComponentProcesses(dispatch, {softwareProductId, componentId, version}) { |
| 229 | if (componentId && softwareProductId) { |
| 230 | SoftwareProductComponentProcessesActionHelper.fetchProcessesList(dispatch, {componentId, softwareProductId, version}); |
| 231 | } |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 232 | setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_PROCESSES, {softwareProductId, componentId, version}); |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 233 | }, |
| 234 | |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 235 | navigateToSoftwareProductComponentMonitoring(dispatch, {softwareProductId, version, componentId}){ |
| 236 | if (componentId && softwareProductId && version) { |
| 237 | SoftwareProductComponentsMonitoringAction.fetchExistingFiles(dispatch, {componentId, softwareProductId, version}); |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 238 | } |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 239 | setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_MONITORING, {softwareProductId, componentId, version}); |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 240 | }, |
| 241 | |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 242 | navigateToComponentStorage(dispatch, {softwareProductId, componentId, version}) { |
| 243 | SoftwareProductComponentsActionHelper.fetchSoftwareProductComponent(dispatch, {softwareProductId, vspComponentId: componentId, version}); |
| 244 | setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_STORAGE, {softwareProductId, version, componentId}); |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 245 | }, |
| 246 | |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 247 | navigateToComponentCompute(dispatch, {softwareProductId, componentId, version}) { |
| 248 | SoftwareProductComponentsActionHelper.fetchSoftwareProductComponent(dispatch, {softwareProductId, vspComponentId: componentId, version}); |
Avi Ziv | b8e2faf | 2017-07-18 19:45:38 +0300 | [diff] [blame] | 249 | if (componentId && softwareProductId) { |
| 250 | ComputeFlavorActionHelper.fetchComputesList(dispatch, {softwareProductId, componentId, version}); |
| 251 | } |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 252 | setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_COMPUTE, {softwareProductId, version, componentId}); |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 253 | }, |
| 254 | |
| 255 | navigateToComponentNetwork(dispatch, {softwareProductId, componentId, version}) { |
| 256 | SoftwareProductComponentsNetworkActionHelper.fetchNICsList(dispatch, {softwareProductId, componentId, version}); |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 257 | setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_NETWORK, {softwareProductId, version, componentId}); |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 258 | }, |
| 259 | |
| 260 | navigateToSoftwareProductComponentGeneral(dispatch, {softwareProductId, componentId, version}) { |
| 261 | if (componentId && softwareProductId) { |
| 262 | SoftwareProductComponentsActionHelper.fetchSoftwareProductComponent(dispatch, {softwareProductId, vspComponentId: componentId, version}); |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 263 | } |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 264 | setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_GENERAL, {softwareProductId, version, componentId}); |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 265 | }, |
| 266 | |
| 267 | navigateToSoftwareProductComponentGeneralAndUpdateLeftPanel(dispatch, {softwareProductId, componentId, version}) { |
| 268 | this.navigateToSoftwareProductComponentGeneral(dispatch, {softwareProductId, componentId, version}); |
| 269 | dispatch({ |
| 270 | type: SoftwareProductActionTypes.TOGGLE_NAVIGATION_ITEM, |
| 271 | mapOfExpandedIds: { |
| 272 | [SoftwareProductNavigationItems.COMPONENTS]: true, |
| 273 | [SoftwareProductNavigationItems.COMPONENTS + '|' + componentId]: true |
| 274 | } |
| 275 | }); |
| 276 | }, |
| 277 | |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 278 | navigateToComponentLoadBalancing(dispatch, {softwareProductId, componentId, version}) { |
| 279 | SoftwareProductComponentsActionHelper.fetchSoftwareProductComponent(dispatch, {softwareProductId, vspComponentId: componentId, version}); |
| 280 | setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_LOAD_BALANCING, {softwareProductId, version, componentId}); |
Avi Ziv | b8e2faf | 2017-07-18 19:45:38 +0300 | [diff] [blame] | 281 | }, |
| 282 | |
| 283 | navigateToComponentImages(dispatch, {softwareProductId, componentId, version}) { |
| 284 | SoftwareProductComponentsImageActionHelper.fetchImagesList(dispatch, { |
| 285 | softwareProductId, |
| 286 | componentId, |
| 287 | version |
| 288 | }); |
| 289 | setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_IMAGES, {softwareProductId, version, componentId}); |
az2497 | 644017c | 2017-08-10 17:49:40 +0300 | [diff] [blame] | 290 | }, |
| 291 | |
| 292 | updateCurrentScreenVersion(dispatch, version) { |
| 293 | dispatch({ |
| 294 | type: actionTypes.SET_CURRENT_SCREEN_VERSION, |
| 295 | version |
| 296 | }); |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 297 | } |
AviZi | 280f801 | 2017-06-09 02:39:56 +0300 | [diff] [blame] | 298 | |
Michael Lando | efa037d | 2017-02-19 12:57:33 +0200 | [diff] [blame] | 299 | }; |