blob: 2fccfcbd2ab009a0e82d13376ba2e5efb388087d [file] [log] [blame]
svishnev1eb66b72018-01-11 14:39:45 +02001/*
2 * Copyright © 2016-2017 European Support Limited
AviZi280f8012017-06-09 02:39:56 +03003 *
Michael Landoefa037d2017-02-19 12:57:33 +02004 * 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
svishnev1eb66b72018-01-11 14:39:45 +02007 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
Michael Landoefa037d2017-02-19 12:57:33 +020010 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
svishnev1eb66b72018-01-11 14:39:45 +020012 * 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 Landoefa037d2017-02-19 12:57:33 +020015 */
svishnev1eb66b72018-01-11 14:39:45 +020016
talig8e9c0652017-12-20 14:30:43 +020017import UsersActionHelper from './users/UsersActionHelper.js';
18import VersionsPageActionHelper from './versionsPage/VersionsPageActionHelper.js';
19import PermissionsActionHelper from './permissions/PermissionsActionHelper.js';
Michael Landoefa037d2017-02-19 12:57:33 +020020import LicenseModelActionHelper from './licenseModel/LicenseModelActionHelper.js';
21import LicenseAgreementActionHelper from './licenseModel/licenseAgreement/LicenseAgreementActionHelper.js';
22import FeatureGroupsActionHelper from './licenseModel/featureGroups/FeatureGroupsActionHelper.js';
23import LicenseKeyGroupsActionHelper from './licenseModel/licenseKeyGroups/LicenseKeyGroupsActionHelper.js';
24import EntitlementPoolsActionHelper from './licenseModel/entitlementPools/EntitlementPoolsActionHelper.js';
25import SoftwareProductActionHelper from './softwareProduct/SoftwareProductActionHelper.js';
26import SoftwareProductProcessesActionHelper from './softwareProduct/processes/SoftwareProductProcessesActionHelper.js';
Avi Zivb8e2faf2017-07-18 19:45:38 +030027import SoftwareProductDeploymentActionHelper from './softwareProduct/deployment/SoftwareProductDeploymentActionHelper.js';
Michael Landoefa037d2017-02-19 12:57:33 +020028import SoftwareProductNetworksActionHelper from './softwareProduct/networks/SoftwareProductNetworksActionHelper.js';
29import SoftwareProductComponentsActionHelper from './softwareProduct/components/SoftwareProductComponentsActionHelper.js';
30import SoftwareProductComponentProcessesActionHelper from './softwareProduct/components/processes/SoftwareProductComponentProcessesActionHelper.js';
31import SoftwareProductComponentsNetworkActionHelper from './softwareProduct/components/network/SoftwareProductComponentsNetworkActionHelper.js';
AviZi280f8012017-06-09 02:39:56 +030032import SoftwareProductDependenciesActionHelper from './softwareProduct/dependencies/SoftwareProductDependenciesActionHelper.js';
Avi Zivb8e2faf2017-07-18 19:45:38 +030033import ComputeFlavorActionHelper from './softwareProduct/components/compute/ComputeFlavorActionHelper.js';
AviZi280f8012017-06-09 02:39:56 +030034import OnboardActionHelper from './onboard/OnboardActionHelper.js';
talig8e9c0652017-12-20 14:30:43 +020035import MergeEditorActionHelper from 'sdc-app/common/merge/MergeEditorActionHelper.js';
Michael Landoefa037d2017-02-19 12:57:33 +020036import SoftwareProductComponentsMonitoringAction from './softwareProduct/components/monitoring/SoftwareProductComponentsMonitoringActionHelper.js';
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020037import { actionTypes, enums } from './OnboardingConstants.js';
38import {
39 actionTypes as SoftwareProductActionTypes,
40 onboardingOriginTypes
41} from 'sdc-app/onboarding/softwareProduct/SoftwareProductConstants.js';
Avi Zivb8e2faf2017-07-18 19:45:38 +030042import ActivityLogActionHelper from 'sdc-app/common/activity-log/ActivityLogActionHelper.js';
talig8e9c0652017-12-20 14:30:43 +020043import ItemsHelper from 'sdc-app/common/helpers/ItemsHelper.js';
44import SoftwareProductComponentsImageActionHelper from './softwareProduct/components/images/SoftwareProductComponentsImageActionHelper.js';
Michael Lando4d97d5f2017-06-17 22:40:44 +030045import licenseModelOverviewActionHelper from 'sdc-app/onboarding/licenseModel/overview/licenseModelOverviewActionHelper.js';
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020046import { tabsMapping as attachmentsTabsMapping } from 'sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsConstants.js';
shrek2000c8a540b2017-09-11 15:45:37 +030047import SoftwareProductAttachmentsActionHelper from 'sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsActionHelper.js';
Michael Landoefa037d2017-02-19 12:57:33 +020048
49function setCurrentScreen(dispatch, screen, props = {}) {
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020050 dispatch({
51 type: actionTypes.SET_CURRENT_SCREEN,
52 currentScreen: {
53 screen,
54 props,
55 forceBreadCrumbsUpdate: true
56 }
57 });
Michael Landoefa037d2017-02-19 12:57:33 +020058}
59
talig8e9c0652017-12-20 14:30:43 +020060export function updateCurrentScreenProps(dispatch, props = {}) {
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020061 dispatch({
62 type: actionTypes.UPDATE_CURRENT_SCREEN_PROPS,
63 props
64 });
Michael Landoefa037d2017-02-19 12:57:33 +020065}
66
talig8e9c0652017-12-20 14:30:43 +020067const OnboardingActionHelper = {
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020068 loadItemsLists(dispatch) {
69 LicenseModelActionHelper.fetchLicenseModels(dispatch);
70 LicenseModelActionHelper.fetchFinalizedLicenseModels(dispatch);
71 LicenseModelActionHelper.fetchArchivedLicenseModels(dispatch);
72 SoftwareProductActionHelper.fetchSoftwareProductList(dispatch);
73 SoftwareProductActionHelper.fetchFinalizedSoftwareProductList(dispatch);
74 SoftwareProductActionHelper.fetchArchivedSoftwareProductList(dispatch);
75 },
AviZi280f8012017-06-09 02:39:56 +030076
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020077 navigateToOnboardingCatalog(dispatch) {
78 UsersActionHelper.fetchUsersList(dispatch);
79 this.loadItemsLists(dispatch);
80 OnboardActionHelper.resetOnboardStore(dispatch);
81 setCurrentScreen(dispatch, enums.SCREEN.ONBOARDING_CATALOG);
82 },
talig8e9c0652017-12-20 14:30:43 +020083
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +020084 autoSaveBeforeNavigate(
85 dispatch,
86 { softwareProductId, version, vspComponentId, dataToSave }
87 ) {
88 if (softwareProductId) {
89 if (vspComponentId) {
90 return SoftwareProductComponentsActionHelper.updateSoftwareProductComponent(
91 dispatch,
92 {
93 softwareProductId,
94 version,
95 vspComponentId,
96 componentData: dataToSave.componentData,
97 qdata: dataToSave.qdata
98 }
99 );
100 }
101 return SoftwareProductActionHelper.updateSoftwareProduct(dispatch, {
102 softwareProduct: dataToSave.softwareProduct,
103 version,
104 qdata: dataToSave.qdata
105 });
106 }
107 return Promise.resolve();
108 },
Michael Landoefa037d2017-02-19 12:57:33 +0200109
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200110 navigateToLicenseModelOverview(
111 dispatch,
112 { licenseModelId, version, status }
113 ) {
114 /**
115 * TODO change to specific rest
116 */
AviZi280f8012017-06-09 02:39:56 +0300117
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200118 LicenseModelActionHelper.fetchLicenseModelById(dispatch, {
119 licenseModelId,
120 version
121 }).then(() => {
122 LicenseModelActionHelper.fetchLicenseModelItems(dispatch, {
123 licenseModelId,
124 version
125 }).then(() => {
126 setCurrentScreen(
127 dispatch,
128 enums.SCREEN.LICENSE_MODEL_OVERVIEW,
129 { licenseModelId, version, status }
130 );
131 });
132 licenseModelOverviewActionHelper.selectVLMListView(dispatch, {
133 buttonTab: null
134 });
135 });
136 },
137 navigateToLicenseAgreements(dispatch, { licenseModelId, version, status }) {
138 LicenseAgreementActionHelper.fetchLicenseAgreementList(dispatch, {
139 licenseModelId,
140 version
141 });
142 LicenseModelActionHelper.fetchLicenseModelById(dispatch, {
143 licenseModelId,
144 version
145 }).then(() => {
146 setCurrentScreen(dispatch, enums.SCREEN.LICENSE_AGREEMENTS, {
147 licenseModelId,
148 version,
149 status
150 });
151 });
152 },
AviZi280f8012017-06-09 02:39:56 +0300153
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200154 navigateToFeatureGroups(dispatch, { licenseModelId, version, status }) {
155 FeatureGroupsActionHelper.fetchFeatureGroupsList(dispatch, {
156 licenseModelId,
157 version
158 });
159 setCurrentScreen(dispatch, enums.SCREEN.FEATURE_GROUPS, {
160 licenseModelId,
161 version,
162 status
163 });
164 },
AviZi280f8012017-06-09 02:39:56 +0300165
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200166 navigateToEntitlementPools(dispatch, { licenseModelId, version, status }) {
167 EntitlementPoolsActionHelper.fetchEntitlementPoolsList(dispatch, {
168 licenseModelId,
169 version
170 });
171 setCurrentScreen(dispatch, enums.SCREEN.ENTITLEMENT_POOLS, {
172 licenseModelId,
173 version,
174 status
175 });
176 },
Michael Landoefa037d2017-02-19 12:57:33 +0200177
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200178 navigateToLicenseKeyGroups(dispatch, { licenseModelId, version, status }) {
179 LicenseKeyGroupsActionHelper.fetchLicenseKeyGroupsList(dispatch, {
180 licenseModelId,
181 version
182 });
183 setCurrentScreen(dispatch, enums.SCREEN.LICENSE_KEY_GROUPS, {
184 licenseModelId,
185 version,
186 status
187 });
188 },
Michael Landoefa037d2017-02-19 12:57:33 +0200189
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200190 navigateToLicenseModelActivityLog(
191 dispatch,
192 { licenseModelId, version, status }
193 ) {
194 ActivityLogActionHelper.fetchActivityLog(dispatch, {
195 itemId: licenseModelId,
196 versionId: version.id
197 });
198 setCurrentScreen(dispatch, enums.SCREEN.ACTIVITY_LOG, {
199 licenseModelId,
200 version,
201 status
202 });
203 },
Michael Landoefa037d2017-02-19 12:57:33 +0200204
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200205 navigateToSoftwareProductLandingPage(
206 dispatch,
207 { softwareProductId, version, status }
208 ) {
209 SoftwareProductComponentsActionHelper.clearComponentsStore(dispatch);
210 SoftwareProductActionHelper.fetchSoftwareProduct(dispatch, {
211 softwareProductId,
212 version
213 }).then(response => {
214 let { vendorId: licenseModelId, licensingVersion } = response[0];
215 SoftwareProductActionHelper.loadSoftwareProductDetailsData(
216 dispatch,
217 { licenseModelId, licensingVersion }
218 );
219 SoftwareProductComponentsActionHelper.fetchSoftwareProductComponents(
220 dispatch,
221 { softwareProductId, version: version }
222 );
223 if (response[0].onboardingOrigin === onboardingOriginTypes.ZIP) {
224 SoftwareProductActionHelper.loadSoftwareProductHeatCandidate(
225 dispatch,
226 { softwareProductId, version: version }
227 );
228 }
229 setCurrentScreen(
230 dispatch,
231 enums.SCREEN.SOFTWARE_PRODUCT_LANDING_PAGE,
232 { softwareProductId, licenseModelId, version, status }
233 );
234 });
235 },
AviZi280f8012017-06-09 02:39:56 +0300236
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200237 navigateToSoftwareProductDetails(
238 dispatch,
239 { softwareProductId, version, status }
240 ) {
241 SoftwareProductActionHelper.fetchSoftwareProduct(dispatch, {
242 softwareProductId,
243 version
244 }).then(response => {
245 let { vendorId: licenseModelId, licensingVersion } = response[0];
246 SoftwareProductActionHelper.loadLicensingVersionsList(dispatch, {
247 licenseModelId
248 });
249 SoftwareProductActionHelper.loadSoftwareProductDetailsData(
250 dispatch,
251 { licenseModelId, licensingVersion }
252 );
253 setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_DETAILS, {
254 softwareProductId,
255 version,
256 status
257 });
258 });
259 },
Michael Landoefa037d2017-02-19 12:57:33 +0200260
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200261 navigateToSoftwareProductAttachmentsSetupTab(
262 dispatch,
263 { softwareProductId, version, status }
264 ) {
265 SoftwareProductActionHelper.loadSoftwareProductHeatCandidate(dispatch, {
266 softwareProductId,
267 version
268 });
269 SoftwareProductAttachmentsActionHelper.setActiveTab(dispatch, {
270 activeTab: attachmentsTabsMapping.SETUP
271 });
272 setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS, {
273 softwareProductId,
274 version,
275 status
276 });
277 },
278 navigateToSoftwareProductAttachmentsValidationTab(
279 dispatch,
280 { softwareProductId, version, status }
281 ) {
282 SoftwareProductActionHelper.processAndValidateHeatCandidate(dispatch, {
283 softwareProductId,
284 version
285 }).then(() => {
286 SoftwareProductAttachmentsActionHelper.setActiveTab(dispatch, {
287 activeTab: attachmentsTabsMapping.VALIDATION
288 });
289 setCurrentScreen(
290 dispatch,
291 enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS,
292 { softwareProductId, version, status }
293 );
294 });
295 },
Michael Landoefa037d2017-02-19 12:57:33 +0200296
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200297 navigateToSoftwareProductProcesses(
298 dispatch,
299 { softwareProductId, version, status }
300 ) {
301 if (softwareProductId) {
302 SoftwareProductProcessesActionHelper.fetchProcessesList(dispatch, {
303 softwareProductId,
304 version
305 });
306 }
307 setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_PROCESSES, {
308 softwareProductId,
309 version,
310 status
311 });
312 },
Michael Landoefa037d2017-02-19 12:57:33 +0200313
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200314 navigateToSoftwareProductNetworks(
315 dispatch,
316 { softwareProductId, version, status }
317 ) {
318 if (softwareProductId) {
319 SoftwareProductNetworksActionHelper.fetchNetworksList(dispatch, {
320 softwareProductId,
321 version
322 });
323 }
324 setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_NETWORKS, {
325 softwareProductId,
326 version,
327 status
328 });
329 },
shrek2000c8a540b2017-09-11 15:45:37 +0300330
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200331 navigateToSoftwareProductDependencies(
332 dispatch,
333 { softwareProductId, version, status }
334 ) {
335 SoftwareProductComponentsActionHelper.fetchSoftwareProductComponents(
336 dispatch,
337 { softwareProductId, version }
338 ).then(result => {
339 if (result.listCount >= 2) {
340 SoftwareProductDependenciesActionHelper.fetchDependencies(
341 dispatch,
342 { softwareProductId, version }
343 );
344 setCurrentScreen(
345 dispatch,
346 enums.SCREEN.SOFTWARE_PRODUCT_DEPENDENCIES,
347 { softwareProductId, version, status }
348 );
349 } else {
350 this.navigateToSoftwareProductLandingPage(dispatch, {
351 softwareProductId,
352 version,
353 status
354 });
355 }
356 });
357 },
Michael Landoefa037d2017-02-19 12:57:33 +0200358
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200359 navigateToSoftwareProductComponents(
360 dispatch,
361 { softwareProductId, version, status }
362 ) {
363 SoftwareProductComponentsActionHelper.fetchSoftwareProductComponents(
364 dispatch,
365 { softwareProductId, version }
366 );
367 setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENTS, {
368 softwareProductId,
369 version,
370 status
371 });
372 },
373 navigateToSoftwareProductDeployment(
374 dispatch,
375 { softwareProductId, version, status }
376 ) {
377 SoftwareProductDeploymentActionHelper.fetchDeploymentFlavorsList(
378 dispatch,
379 { softwareProductId, version }
380 );
381 ComputeFlavorActionHelper.fetchComputesListForVSP(dispatch, {
382 softwareProductId,
383 version
384 });
385 setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_DEPLOYMENT, {
386 softwareProductId,
387 version,
388 status
389 });
390 },
391 navigateToSoftwareProductActivityLog(
392 dispatch,
393 { softwareProductId, version, status }
394 ) {
395 ActivityLogActionHelper.fetchActivityLog(dispatch, {
396 itemId: softwareProductId,
397 versionId: version.id
398 });
399 setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_ACTIVITY_LOG, {
400 softwareProductId,
401 version,
402 status
403 });
404 },
Michael Landoefa037d2017-02-19 12:57:33 +0200405
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200406 navigateToSoftwareProductComponentProcesses(
407 dispatch,
408 { softwareProductId, componentId, version, status }
409 ) {
410 if (componentId && softwareProductId) {
411 SoftwareProductComponentProcessesActionHelper.fetchProcessesList(
412 dispatch,
413 { componentId, softwareProductId, version }
414 );
415 }
416 setCurrentScreen(
417 dispatch,
418 enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_PROCESSES,
419 { softwareProductId, componentId, version, status }
420 );
421 },
AviZi280f8012017-06-09 02:39:56 +0300422
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200423 navigateToSoftwareProductComponentMonitoring(
424 dispatch,
425 { softwareProductId, version, componentId, status }
426 ) {
427 if (componentId && softwareProductId && version) {
428 SoftwareProductComponentsMonitoringAction.fetchExistingFiles(
429 dispatch,
430 { componentId, softwareProductId, version }
431 );
432 }
433 setCurrentScreen(
434 dispatch,
435 enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_MONITORING,
436 { softwareProductId, componentId, version, status }
437 );
438 },
Michael Landoefa037d2017-02-19 12:57:33 +0200439
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200440 navigateToComponentStorage(
441 dispatch,
442 { softwareProductId, componentId, version, status }
443 ) {
444 SoftwareProductComponentsActionHelper.fetchSoftwareProductComponent(
445 dispatch,
446 { softwareProductId, vspComponentId: componentId, version }
447 );
448 setCurrentScreen(
449 dispatch,
450 enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_STORAGE,
451 { softwareProductId, version, componentId, status }
452 );
453 },
Michael Landoefa037d2017-02-19 12:57:33 +0200454
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200455 navigateToComponentCompute(
456 dispatch,
457 { softwareProductId, componentId, version, status }
458 ) {
459 SoftwareProductComponentsActionHelper.fetchSoftwareProductComponent(
460 dispatch,
461 { softwareProductId, vspComponentId: componentId, version }
462 );
463 if (componentId && softwareProductId) {
464 ComputeFlavorActionHelper.fetchComputesList(dispatch, {
465 softwareProductId,
466 componentId,
467 version
468 });
469 }
470 setCurrentScreen(
471 dispatch,
472 enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_COMPUTE,
473 { softwareProductId, version, componentId, status }
474 );
475 },
Michael Landoefa037d2017-02-19 12:57:33 +0200476
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200477 navigateToComponentNetwork(
478 dispatch,
479 { softwareProductId, componentId, version, status }
480 ) {
481 SoftwareProductComponentsNetworkActionHelper.fetchNICsList(dispatch, {
482 softwareProductId,
483 componentId,
484 version
485 });
486 setCurrentScreen(
487 dispatch,
488 enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_NETWORK,
489 { softwareProductId, version, componentId, status }
490 );
491 },
Michael Landoefa037d2017-02-19 12:57:33 +0200492
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200493 navigateToSoftwareProductComponentGeneral(
494 dispatch,
495 { softwareProductId, componentId, version, status }
496 ) {
497 if (componentId && softwareProductId) {
498 SoftwareProductComponentsActionHelper.fetchSoftwareProductComponent(
499 dispatch,
500 { softwareProductId, vspComponentId: componentId, version }
501 );
502 }
503 setCurrentScreen(
504 dispatch,
505 enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_GENERAL,
506 { softwareProductId, version, componentId, status }
507 );
508 },
Michael Landoefa037d2017-02-19 12:57:33 +0200509
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200510 navigateToSoftwareProductComponentGeneralAndUpdateLeftPanel(
511 dispatch,
512 { softwareProductId, componentId, version, status }
513 ) {
514 this.navigateToSoftwareProductComponentGeneral(dispatch, {
515 softwareProductId,
516 componentId,
517 version,
518 status
519 });
520 dispatch({
521 type: SoftwareProductActionTypes.TOGGLE_NAVIGATION_ITEM,
522 mapOfExpandedIds: {
523 [enums.SCREEN.SOFTWARE_PRODUCT_COMPONENTS]: true,
524 [enums.SCREEN.SOFTWARE_PRODUCT_COMPONENTS +
525 '|' +
526 componentId]: true
527 }
528 });
529 },
Michael Landoefa037d2017-02-19 12:57:33 +0200530
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200531 navigateToComponentLoadBalancing(
532 dispatch,
533 { softwareProductId, componentId, version, status }
534 ) {
535 SoftwareProductComponentsActionHelper.fetchSoftwareProductComponent(
536 dispatch,
537 { softwareProductId, vspComponentId: componentId, version }
538 );
539 setCurrentScreen(
540 dispatch,
541 enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_LOAD_BALANCING,
542 { softwareProductId, version, componentId, status }
543 );
544 },
Michael Landoefa037d2017-02-19 12:57:33 +0200545
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200546 navigateToComponentImages(
547 dispatch,
548 { softwareProductId, componentId, version, status }
549 ) {
550 SoftwareProductComponentsImageActionHelper.fetchImagesList(dispatch, {
551 softwareProductId,
552 componentId,
553 version
554 });
555 setCurrentScreen(
556 dispatch,
557 enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_IMAGES,
558 { softwareProductId, version, componentId, status }
559 );
560 },
Michael Landoefa037d2017-02-19 12:57:33 +0200561
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200562 navigateToVersionsPage(
563 dispatch,
564 { itemType, itemId, itemName, additionalProps, users }
565 ) {
566 PermissionsActionHelper.fetchItemUsers(dispatch, {
567 itemId,
568 allUsers: users
569 });
570 VersionsPageActionHelper.selectNone(dispatch);
571 VersionsPageActionHelper.fetchVersions(dispatch, {
572 itemType,
573 itemId
574 }).then(() => {
575 ItemsHelper.fetchItem(itemId).then(result => {
576 setCurrentScreen(dispatch, enums.SCREEN.VERSIONS_PAGE, {
577 status: result.status,
578 itemType,
579 itemId,
580 itemName,
581 additionalProps
582 });
583 });
584 });
585 },
Avi Zivb8e2faf2017-07-18 19:45:38 +0300586
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200587 checkMergeStatus(dispatch, { itemId, versionId, version }) {
588 return ItemsHelper.fetchVersion({ itemId, versionId }).then(
589 response => {
590 let state = (response && response.state) || {};
591 let { synchronizationState } = state;
592 // let inMerge = synchronizationState === SyncStates.MERGE;
593 MergeEditorActionHelper.fetchConflicts(dispatch, {
594 itemId,
595 version
596 }).then(data => {
597 dispatch({
598 type: actionTypes.CHECK_MERGE_STATUS,
599 synchronizationState,
600 conflictInfoList: data.conflictInfoList
601 });
602 });
603 }
604 );
605 },
az2497644017c2017-08-10 17:49:40 +0300606
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200607 forceBreadCrumbsUpdate(dispatch) {
608 dispatch({
609 type: actionTypes.SET_CURRENT_SCREEN,
610 currentScreen: {
611 forceBreadCrumbsUpdate: true
612 }
613 });
614 },
talig8e9c0652017-12-20 14:30:43 +0200615
Einav Weiss Keidar7fdf7332018-03-20 14:45:40 +0200616 updateCurrentScreenVersion(dispatch, version) {
617 dispatch({
618 type: actionTypes.SET_CURRENT_SCREEN_VERSION,
619 version
620 });
621 }
Michael Landoefa037d2017-02-19 12:57:33 +0200622};
talig8e9c0652017-12-20 14:30:43 +0200623
624export default OnboardingActionHelper;