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