Update URL with ID after import
This commit is contained in:
parent
0da556b5a9
commit
439218c78f
|
|
@ -95,6 +95,7 @@ export class ElsaWorkflowDefinitionEditorScreen {
|
|||
const workflowDefinition = await client.workflowDefinitionsApi.import(this.workflowDefinition.definitionId, file);
|
||||
this.workflowDefinition = workflowDefinition;
|
||||
this.workflowModel = this.mapWorkflowModel(workflowDefinition);
|
||||
this.updateUrl(workflowDefinition.definitionId)
|
||||
|
||||
this.importing = false;
|
||||
this.imported = true;
|
||||
|
|
@ -261,7 +262,7 @@ export class ElsaWorkflowDefinitionEditorScreen {
|
|||
setTimeout(() => this.saved = false, 500);
|
||||
this.workflowSaved.emit(workflowDefinition);
|
||||
if (isNew) {
|
||||
this.history.push(`/workflow-definitions/${workflowDefinition.definitionId}`, {});
|
||||
this.updateUrl(workflowDefinition.definitionId);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
|
|
@ -291,6 +292,10 @@ export class ElsaWorkflowDefinitionEditorScreen {
|
|||
}
|
||||
}
|
||||
|
||||
updateUrl(id){
|
||||
this.history.push(`/workflow-definitions/${id}`, {});
|
||||
}
|
||||
|
||||
mapWorkflowModel(workflowDefinition: WorkflowDefinition): WorkflowModel {
|
||||
return {
|
||||
activities: workflowDefinition.activities.map(this.mapActivityModel),
|
||||
|
|
|
|||
Loading…
Reference in a new issue