blob: 4c4c709a7b65591c8aa20fadc0f691891a9b7882 [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';
37import {actionTypes, enums} from './OnboardingConstants.js';
talig8e9c0652017-12-20 14:30:43 +020038import {actionTypes as SoftwareProductActionTypes, onboardingOriginTypes} from 'sdc-app/onboarding/softwareProduct/SoftwareProductConstants.js';
Avi Zivb8e2faf2017-07-18 19:45:38 +030039import ActivityLogActionHelper from 'sdc-app/common/activity-log/ActivityLogActionHelper.js';
talig8e9c0652017-12-20 14:30:43 +020040import ItemsHelper from 'sdc-app/common/helpers/ItemsHelper.js';
41import SoftwareProductComponentsImageActionHelper from './softwareProduct/components/images/SoftwareProductComponentsImageActionHelper.js';
Michael Lando4d97d5f2017-06-17 22:40:44 +030042import licenseModelOverviewActionHelper from 'sdc-app/onboarding/licenseModel/overview/licenseModelOverviewActionHelper.js';
shrek2000c8a540b2017-09-11 15:45:37 +030043import {tabsMapping as attachmentsTabsMapping} from 'sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsConstants.js';
44import SoftwareProductAttachmentsActionHelper from 'sdc-app/onboarding/softwareProduct/attachments/SoftwareProductAttachmentsActionHelper.js';
Michael Landoefa037d2017-02-19 12:57:33 +020045
46function setCurrentScreen(dispatch, screen, props = {}) {
47 dispatch({
48 type: actionTypes.SET_CURRENT_SCREEN,
49 currentScreen: {
50 screen,
AviZi280f8012017-06-09 02:39:56 +030051 props,
52 forceBreadCrumbsUpdate: true
Michael Landoefa037d2017-02-19 12:57:33 +020053 }
54 });
55}
56
talig8e9c0652017-12-20 14:30:43 +020057export function updateCurrentScreenProps(dispatch, props = {}) {
58 dispatch({
59 type: actionTypes.UPDATE_CURRENT_SCREEN_PROPS,
60 props
61 });
Michael Landoefa037d2017-02-19 12:57:33 +020062}
63
talig8e9c0652017-12-20 14:30:43 +020064const OnboardingActionHelper = {
AviZi280f8012017-06-09 02:39:56 +030065
talig8e9c0652017-12-20 14:30:43 +020066 loadItemsLists(dispatch) {
Michael Landoefa037d2017-02-19 12:57:33 +020067 LicenseModelActionHelper.fetchLicenseModels(dispatch);
AviZi280f8012017-06-09 02:39:56 +030068 LicenseModelActionHelper.fetchFinalizedLicenseModels(dispatch);
Michael Landoefa037d2017-02-19 12:57:33 +020069 SoftwareProductActionHelper.fetchSoftwareProductList(dispatch);
AviZi280f8012017-06-09 02:39:56 +030070 SoftwareProductActionHelper.fetchFinalizedSoftwareProductList(dispatch);
talig8e9c0652017-12-20 14:30:43 +020071 },
72
73 navigateToOnboardingCatalog(dispatch) {
74 UsersActionHelper.fetchUsersList(dispatch);
75 this.loadItemsLists(dispatch);
AviZi280f8012017-06-09 02:39:56 +030076 OnboardActionHelper.resetOnboardStore(dispatch);
Michael Landoefa037d2017-02-19 12:57:33 +020077 setCurrentScreen(dispatch, enums.SCREEN.ONBOARDING_CATALOG);
78 },
79
AviZi280f8012017-06-09 02:39:56 +030080 autoSaveBeforeNavigate(dispatch, {softwareProductId, version, vspComponentId, dataToSave}) {
81 if(softwareProductId) {
82 if(vspComponentId) {
83 return SoftwareProductComponentsActionHelper.updateSoftwareProductComponent(dispatch, {
84 softwareProductId, version, vspComponentId,
85 componentData: dataToSave.componentData,
86 qdata: dataToSave.qdata
87 });
88 }
89 return SoftwareProductActionHelper.updateSoftwareProduct(dispatch, {
90 softwareProduct: dataToSave.softwareProduct,
talig8e9c0652017-12-20 14:30:43 +020091 version,
AviZi280f8012017-06-09 02:39:56 +030092 qdata: dataToSave.qdata
93 });
94 }
95 return Promise.resolve();
96 },
97
98 navigateToLicenseModelOverview(dispatch, {licenseModelId, version}) {
AviZi280f8012017-06-09 02:39:56 +030099
100 /**
101 * TODO change to specific rest
102 */
103
104 LicenseModelActionHelper.fetchLicenseModelById(dispatch, {licenseModelId, version}).then(() => {
talig8e9c0652017-12-20 14:30:43 +0200105 LicenseModelActionHelper.fetchLicenseModelItems(dispatch, {licenseModelId, version}).then(() => {
AviZi280f8012017-06-09 02:39:56 +0300106 setCurrentScreen(dispatch, enums.SCREEN.LICENSE_MODEL_OVERVIEW, {licenseModelId, version});
107 });
ilanapc6a41de2017-11-07 11:54:10 +0200108 licenseModelOverviewActionHelper.selectVLMListView(dispatch, {buttonTab: null});
AviZi280f8012017-06-09 02:39:56 +0300109 });
110 },
Michael Landoefa037d2017-02-19 12:57:33 +0200111 navigateToLicenseAgreements(dispatch, {licenseModelId, version}) {
Michael Landoefa037d2017-02-19 12:57:33 +0200112 LicenseAgreementActionHelper.fetchLicenseAgreementList(dispatch, {licenseModelId, version});
113 LicenseModelActionHelper.fetchLicenseModelById(dispatch, {licenseModelId, version}).then(() => {
AviZi280f8012017-06-09 02:39:56 +0300114 setCurrentScreen(dispatch, enums.SCREEN.LICENSE_AGREEMENTS, {licenseModelId, version});
Michael Landoefa037d2017-02-19 12:57:33 +0200115 });
116 },
117
118 navigateToFeatureGroups(dispatch, {licenseModelId, version}) {
Michael Landoefa037d2017-02-19 12:57:33 +0200119 FeatureGroupsActionHelper.fetchFeatureGroupsList(dispatch, {licenseModelId, version});
AviZi280f8012017-06-09 02:39:56 +0300120 setCurrentScreen(dispatch, enums.SCREEN.FEATURE_GROUPS, {licenseModelId, version});
Michael Landoefa037d2017-02-19 12:57:33 +0200121 },
122
123 navigateToEntitlementPools(dispatch, {licenseModelId, version}) {
Michael Landoefa037d2017-02-19 12:57:33 +0200124 EntitlementPoolsActionHelper.fetchEntitlementPoolsList(dispatch, {licenseModelId, version});
AviZi280f8012017-06-09 02:39:56 +0300125 setCurrentScreen(dispatch, enums.SCREEN.ENTITLEMENT_POOLS, {licenseModelId, version});
Michael Landoefa037d2017-02-19 12:57:33 +0200126 },
127
128 navigateToLicenseKeyGroups(dispatch, {licenseModelId, version}) {
Michael Landoefa037d2017-02-19 12:57:33 +0200129 LicenseKeyGroupsActionHelper.fetchLicenseKeyGroupsList(dispatch, {licenseModelId, version});
AviZi280f8012017-06-09 02:39:56 +0300130 setCurrentScreen(dispatch, enums.SCREEN.LICENSE_KEY_GROUPS, {licenseModelId, version});
131 },
132
133 navigateToLicenseModelActivityLog(dispatch, {licenseModelId, version}){
AviZi280f8012017-06-09 02:39:56 +0300134 ActivityLogActionHelper.fetchActivityLog(dispatch, {itemId: licenseModelId, versionId: version.id});
135 setCurrentScreen(dispatch, enums.SCREEN.ACTIVITY_LOG, {licenseModelId, version});
Michael Landoefa037d2017-02-19 12:57:33 +0200136 },
137
talig8e9c0652017-12-20 14:30:43 +0200138 navigateToSoftwareProductLandingPage(dispatch, {softwareProductId, version}) {
AviZi280f8012017-06-09 02:39:56 +0300139 SoftwareProductComponentsActionHelper.clearComponentsStore(dispatch);
Michael Landoefa037d2017-02-19 12:57:33 +0200140 SoftwareProductActionHelper.fetchSoftwareProduct(dispatch, {softwareProductId, version}).then(response => {
talig8e9c0652017-12-20 14:30:43 +0200141 let {vendorId: licenseModelId, licensingVersion} = response[0];
Michael Landoefa037d2017-02-19 12:57:33 +0200142 SoftwareProductActionHelper.loadSoftwareProductDetailsData(dispatch, {licenseModelId, licensingVersion});
talig8e9c0652017-12-20 14:30:43 +0200143 SoftwareProductComponentsActionHelper.fetchSoftwareProductComponents(dispatch, {softwareProductId, version: version});
shrek2000c8a540b2017-09-11 15:45:37 +0300144 if(response[0].onboardingOrigin === onboardingOriginTypes.ZIP) {
talig8e9c0652017-12-20 14:30:43 +0200145 SoftwareProductActionHelper.loadSoftwareProductHeatCandidate(dispatch, {softwareProductId, version: version});
shrek2000c8a540b2017-09-11 15:45:37 +0300146 }
talig8e9c0652017-12-20 14:30:43 +0200147 setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_LANDING_PAGE, {softwareProductId, licenseModelId, version});
Michael Landoefa037d2017-02-19 12:57:33 +0200148 });
149 },
150
AviZi280f8012017-06-09 02:39:56 +0300151 navigateToSoftwareProductDetails(dispatch, {softwareProductId, version}) {
talig8e9c0652017-12-20 14:30:43 +0200152 SoftwareProductActionHelper.fetchSoftwareProduct(dispatch, {softwareProductId, version}).then(response => {
153 let {vendorId: licenseModelId, licensingVersion} = response[0];
154 SoftwareProductActionHelper.loadLicensingVersionsList(dispatch, {licenseModelId});
155 SoftwareProductActionHelper.loadSoftwareProductDetailsData(dispatch, {licenseModelId, licensingVersion});
156 setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_DETAILS, {softwareProductId, version});
157 });
Michael Landoefa037d2017-02-19 12:57:33 +0200158 },
159
shrek2000c8a540b2017-09-11 15:45:37 +0300160 navigateToSoftwareProductAttachmentsSetupTab(dispatch, {softwareProductId, version}) {
AviZi280f8012017-06-09 02:39:56 +0300161 SoftwareProductActionHelper.loadSoftwareProductHeatCandidate(dispatch, {softwareProductId, version});
shrek2000c8a540b2017-09-11 15:45:37 +0300162 SoftwareProductAttachmentsActionHelper.setActiveTab(dispatch, {activeTab: attachmentsTabsMapping.SETUP});
AviZi280f8012017-06-09 02:39:56 +0300163 setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS, {softwareProductId, version});
Michael Landoefa037d2017-02-19 12:57:33 +0200164 },
shrek2000c8a540b2017-09-11 15:45:37 +0300165 navigateToSoftwareProductAttachmentsValidationTab(dispatch, {softwareProductId, version}) {
166 SoftwareProductActionHelper.processAndValidateHeatCandidate(dispatch, {softwareProductId, version}).then(() => {
167 SoftwareProductAttachmentsActionHelper.setActiveTab(dispatch, {activeTab: attachmentsTabsMapping.VALIDATION});
168 setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_ATTACHMENTS, {softwareProductId, version});
169 });
170 },
171
Michael Landoefa037d2017-02-19 12:57:33 +0200172 navigateToSoftwareProductProcesses(dispatch, {softwareProductId, version}) {
173 if (softwareProductId) {
174 SoftwareProductProcessesActionHelper.fetchProcessesList(dispatch, {softwareProductId, version});
175 }
AviZi280f8012017-06-09 02:39:56 +0300176 setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_PROCESSES, {softwareProductId, version});
Michael Landoefa037d2017-02-19 12:57:33 +0200177 },
178
179 navigateToSoftwareProductNetworks(dispatch, {softwareProductId, version}) {
180 if (softwareProductId) {
181 SoftwareProductNetworksActionHelper.fetchNetworksList(dispatch, {softwareProductId, version});
182 }
AviZi280f8012017-06-09 02:39:56 +0300183 setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_NETWORKS, {softwareProductId, version});
Michael Landoefa037d2017-02-19 12:57:33 +0200184 },
185
AviZi280f8012017-06-09 02:39:56 +0300186 navigateToSoftwareProductDependencies(dispatch, {softwareProductId, version}) {
talig8e9c0652017-12-20 14:30:43 +0200187 SoftwareProductComponentsActionHelper.fetchSoftwareProductComponents(dispatch, {softwareProductId, version}).then(result => {
188 if(result.listCount >= 2) {
189 SoftwareProductDependenciesActionHelper.fetchDependencies(dispatch, {softwareProductId, version});
190 setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_DEPENDENCIES, {softwareProductId, version});
191 }
192 else {
193 this.navigateToSoftwareProductLandingPage(dispatch, {softwareProductId, version});
194 }
195 });
AviZi280f8012017-06-09 02:39:56 +0300196 },
197
198 navigateToSoftwareProductComponents(dispatch, {softwareProductId, version}) {
199 SoftwareProductComponentsActionHelper.fetchSoftwareProductComponents(dispatch, {softwareProductId, version});
200 setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENTS, {softwareProductId, version});
201 },
Avi Zivb8e2faf2017-07-18 19:45:38 +0300202 navigateToSoftwareProductDeployment(dispatch, {softwareProductId, version}) {
203 SoftwareProductDeploymentActionHelper.fetchDeploymentFlavorsList(dispatch, {softwareProductId, version});
204 ComputeFlavorActionHelper.fetchComputesListForVSP(dispatch, {softwareProductId, version});
205 setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_DEPLOYMENT, {softwareProductId, version});
206 },
AviZi280f8012017-06-09 02:39:56 +0300207 navigateToSoftwareProductActivityLog(dispatch, {softwareProductId, version}){
208 ActivityLogActionHelper.fetchActivityLog(dispatch, {itemId: softwareProductId, versionId: version.id});
209 setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_ACTIVITY_LOG, {softwareProductId, version});
Michael Landoefa037d2017-02-19 12:57:33 +0200210 },
211
212 navigateToSoftwareProductComponentProcesses(dispatch, {softwareProductId, componentId, version}) {
213 if (componentId && softwareProductId) {
214 SoftwareProductComponentProcessesActionHelper.fetchProcessesList(dispatch, {componentId, softwareProductId, version});
215 }
AviZi280f8012017-06-09 02:39:56 +0300216 setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_PROCESSES, {softwareProductId, componentId, version});
Michael Landoefa037d2017-02-19 12:57:33 +0200217 },
218
AviZi280f8012017-06-09 02:39:56 +0300219 navigateToSoftwareProductComponentMonitoring(dispatch, {softwareProductId, version, componentId}){
220 if (componentId && softwareProductId && version) {
221 SoftwareProductComponentsMonitoringAction.fetchExistingFiles(dispatch, {componentId, softwareProductId, version});
Michael Landoefa037d2017-02-19 12:57:33 +0200222 }
AviZi280f8012017-06-09 02:39:56 +0300223 setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_MONITORING, {softwareProductId, componentId, version});
Michael Landoefa037d2017-02-19 12:57:33 +0200224 },
225
AviZi280f8012017-06-09 02:39:56 +0300226 navigateToComponentStorage(dispatch, {softwareProductId, componentId, version}) {
227 SoftwareProductComponentsActionHelper.fetchSoftwareProductComponent(dispatch, {softwareProductId, vspComponentId: componentId, version});
228 setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_STORAGE, {softwareProductId, version, componentId});
Michael Landoefa037d2017-02-19 12:57:33 +0200229 },
230
AviZi280f8012017-06-09 02:39:56 +0300231 navigateToComponentCompute(dispatch, {softwareProductId, componentId, version}) {
232 SoftwareProductComponentsActionHelper.fetchSoftwareProductComponent(dispatch, {softwareProductId, vspComponentId: componentId, version});
Avi Zivb8e2faf2017-07-18 19:45:38 +0300233 if (componentId && softwareProductId) {
234 ComputeFlavorActionHelper.fetchComputesList(dispatch, {softwareProductId, componentId, version});
235 }
AviZi280f8012017-06-09 02:39:56 +0300236 setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_COMPUTE, {softwareProductId, version, componentId});
Michael Landoefa037d2017-02-19 12:57:33 +0200237 },
238
239 navigateToComponentNetwork(dispatch, {softwareProductId, componentId, version}) {
240 SoftwareProductComponentsNetworkActionHelper.fetchNICsList(dispatch, {softwareProductId, componentId, version});
AviZi280f8012017-06-09 02:39:56 +0300241 setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_NETWORK, {softwareProductId, version, componentId});
Michael Landoefa037d2017-02-19 12:57:33 +0200242 },
243
244 navigateToSoftwareProductComponentGeneral(dispatch, {softwareProductId, componentId, version}) {
245 if (componentId && softwareProductId) {
246 SoftwareProductComponentsActionHelper.fetchSoftwareProductComponent(dispatch, {softwareProductId, vspComponentId: componentId, version});
Michael Landoefa037d2017-02-19 12:57:33 +0200247 }
AviZi280f8012017-06-09 02:39:56 +0300248 setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_GENERAL, {softwareProductId, version, componentId});
Michael Landoefa037d2017-02-19 12:57:33 +0200249 },
250
251 navigateToSoftwareProductComponentGeneralAndUpdateLeftPanel(dispatch, {softwareProductId, componentId, version}) {
252 this.navigateToSoftwareProductComponentGeneral(dispatch, {softwareProductId, componentId, version});
253 dispatch({
254 type: SoftwareProductActionTypes.TOGGLE_NAVIGATION_ITEM,
255 mapOfExpandedIds: {
talig8e9c0652017-12-20 14:30:43 +0200256 [enums.SCREEN.SOFTWARE_PRODUCT_COMPONENTS]: true,
257 [enums.SCREEN.SOFTWARE_PRODUCT_COMPONENTS + '|' + componentId]: true
Michael Landoefa037d2017-02-19 12:57:33 +0200258 }
259 });
260 },
261
AviZi280f8012017-06-09 02:39:56 +0300262 navigateToComponentLoadBalancing(dispatch, {softwareProductId, componentId, version}) {
263 SoftwareProductComponentsActionHelper.fetchSoftwareProductComponent(dispatch, {softwareProductId, vspComponentId: componentId, version});
264 setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_LOAD_BALANCING, {softwareProductId, version, componentId});
Avi Zivb8e2faf2017-07-18 19:45:38 +0300265 },
266
267 navigateToComponentImages(dispatch, {softwareProductId, componentId, version}) {
268 SoftwareProductComponentsImageActionHelper.fetchImagesList(dispatch, {
269 softwareProductId,
270 componentId,
271 version
272 });
273 setCurrentScreen(dispatch, enums.SCREEN.SOFTWARE_PRODUCT_COMPONENT_IMAGES, {softwareProductId, version, componentId});
az2497644017c2017-08-10 17:49:40 +0300274 },
275
talig8e9c0652017-12-20 14:30:43 +0200276 navigateToVersionsPage(dispatch, {itemType, itemId, itemName, additionalProps, users}) {
277 PermissionsActionHelper.fetchItemUsers(dispatch, {itemId, allUsers: users});
278 VersionsPageActionHelper.selectNone(dispatch);
279 VersionsPageActionHelper.fetchVersions(dispatch, {itemType, itemId}).then(() => {
280 setCurrentScreen(dispatch, enums.SCREEN.VERSIONS_PAGE, {itemType, itemId, itemName, additionalProps});
281 });
282 },
283
284 checkMergeStatus(dispatch, {itemId, versionId, version}) {
285 return ItemsHelper.fetchVersion({itemId, versionId}).then(response => {
286 let state = response && response.state || {};
287 let {synchronizationState} = state;
288 // let inMerge = synchronizationState === SyncStates.MERGE;
289 MergeEditorActionHelper.fetchConflicts(dispatch, {itemId, version}).then(data => {
290 dispatch({
291 type: actionTypes.CHECK_MERGE_STATUS,
292 synchronizationState,
293 conflictInfoList: data.conflictInfoList
294 });
295 });
296 });
297 },
298
299 forceBreadCrumbsUpdate(dispatch) {
300 dispatch({
301 type: actionTypes.SET_CURRENT_SCREEN,
302 currentScreen: {
303 forceBreadCrumbsUpdate: true
304 }
305 });
306 },
307
az2497644017c2017-08-10 17:49:40 +0300308 updateCurrentScreenVersion(dispatch, version) {
309 dispatch({
310 type: actionTypes.SET_CURRENT_SCREEN_VERSION,
311 version
312 });
Michael Landoefa037d2017-02-19 12:57:33 +0200313 }
Michael Landoefa037d2017-02-19 12:57:33 +0200314};
talig8e9c0652017-12-20 14:30:43 +0200315
316export default OnboardingActionHelper;