feat(editor): Prevent saving of workflow when canvas is loading (#6497)

* feat(editor): Prevent saving of pristine workflow

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>

* Prevent saving if loading

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>

* Fix 7-workflow-actions spec

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>

* Restrict delay intercept to GET only

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>

* Wait for WF patch

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>

* Add helper to remove all active WFs in e2e

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>

* Use META_KEY env var

* Remove cy.wait

* Delete debugging DB reset console log

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>

* Fix clashin mixins `isReadOnly` property

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>

---------

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
OlegIvaniv
2023-06-27 13:05:20 +02:00
committed by GitHub
parent d70a1cb0c8
commit f89ef83c76
11 changed files with 146 additions and 84 deletions

View File

@@ -12,6 +12,7 @@ import { Container } from 'typedi';
import config from '@/config';
import * as Db from '@/Db';
import type { Role } from '@db/entities/Role';
import { ActiveWorkflowRunner } from '@/ActiveWorkflowRunner';
import { RoleRepository } from '@db/repositories';
import { hashPassword } from '@/UserManagement/UserManagementHelper';
import { eventBus } from '@/eventbus/MessageEventBus/MessageEventBus';
@@ -108,10 +109,18 @@ const resetLogStreaming = async () => {
}
};
const removeActiveWorkflows = async () => {
const workflowRunner = Container.get(ActiveWorkflowRunner);
workflowRunner.removeAllQueuedWorkflowActivations();
await workflowRunner.removeAll();
};
export const e2eController = Router();
e2eController.post('/db/reset', async (req, res) => {
await resetLogStreaming();
await removeActiveWorkflows();
await truncateAll();
await setupUserManagement();