fix(core): Deactivate active workflows during import (#5840)

* deactivate imported workflows

* improve test

* fix for combined import (and test)

* cleanup
This commit is contained in:
Michael Auerswald
2023-03-30 15:33:30 +02:00
committed by GitHub
parent e4796c169b
commit fa5bc814b0
6 changed files with 407 additions and 0 deletions

View File

@@ -131,6 +131,13 @@ export class ImportWorkflowsCommand extends BaseCommand {
await setTagsForImport(transactionManager, workflow, tags);
}
if (workflow.active) {
this.logger.info(
`Deactivating workflow "${workflow.name}" during import, remember to activate it later.`,
);
workflow.active = false;
}
await this.storeWorkflow(workflow, user);
}
});
@@ -174,6 +181,12 @@ export class ImportWorkflowsCommand extends BaseCommand {
if (Object.prototype.hasOwnProperty.call(workflow, 'tags')) {
await setTagsForImport(transactionManager, workflow, tags);
}
if (workflow.active) {
this.logger.info(
`Deactivating workflow "${workflow.name}" during import, remember to activate it later.`,
);
workflow.active = false;
}
await this.storeWorkflow(workflow, user);
}