Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let projectContext = this.get('projectContext');
let store = this.get('store');
projectContext.setCurrentConfiguration(project.get('configuration'));
projectContext.setCurrentStage(project);
// Clear store.
store.unloadAll('fd-dev-class');
store.unloadAll('fd-dev-association');
store.unloadAll('fd-dev-aggregation');
store.unloadAll('fd-dev-inheritance');
store.unloadAll('fd-dev-system');
store.unloadAll('new-platform-flexberry-services-lock');
this.get('appState').loading();
FdPreloadStageMetadata.call(this, store, projectContext.getCurrentStage()).then(() =>
projectContext.getAutogeneratedSystemPromise()).then(() => {
this.get('appState').reset();
this.transitionToRoute('fd-application-model');
});
},
store.query(modelName, builder.build()).then((result) => {
if (result && result.get('length') !== undefined && result.get('length') === 1) {
let stage = result.objectAt(0);
context.setCurrentConfiguration(stage.get('configuration'));
context.setCurrentStage(stage);
FdPreloadStageMetadata.call(this, store, context.getCurrentStage()).then(() =>
context.getAutogeneratedSystemPromise()).then(() => {
if (this.get('controller.currentRouteName') === 'fd-appstruct-form') {
this.refresh();
} else {
this.transitionTo('fd-appstruct-form');
}
this.get('appState').reset();
});
}
});
} else if (this.get('router.location.location.href').split('?').length < 2) {
objectListViewRowClick(stage, options) {
if (options.column === null) {
return this._super(...arguments);
} else {
this.get('currentContext').setCurrentStage(stage);
this.get('appState').loading();
FdPreloadStageMetadata.call(this, this.get('store'), this.get('currentContext').getCurrentStage()).then(() =>
this.get('currentContext').getAutogeneratedSystemPromise()).then(() => {
this.get('appState').reset();
this.transitionTo('fd-appstruct-form');
});
}
},
},
adapter.callFunction('Prototype', data, null, { withCredentials: true }).then((result) => {
if (result.value) {
FdPreloadStageMetadata.call(this, this.get('store'), this.get('currentProjectContext').getCurrentStage()).then(() =>
this.get('currentProjectContext').getAutogeneratedSystemPromise()).then(() => {
this.set('model', this.get('modelFunction')());
}).finally(() => {
this.get('appState').reset();
});
} else {
this.get('appState').reset();
this.get('fdDialogService').showErrorMessage({ message: this.get('i18n').t('forms.fd-navigation.create-prototype-error') });
}
}).catch(() => {
this.get('appState').reset();
.then(() => {
currentProjectContext.setCurrentConfiguration(configuration);
currentProjectContext.setCurrentStage(stage);
return FdPreloadStageMetadata.call(this, store, currentProjectContext.getCurrentStage());
})
.then(() => currentProjectContext.getAutogeneratedSystemPromise())