refactor(core): Move methods from WorkflowHelpers into various workflow services (no-changelog) (#8348)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-01-17 10:16:13 +01:00
committed by GitHub
parent ab52aaf7e9
commit 7cdbb424e3
21 changed files with 896 additions and 802 deletions

View File

@@ -28,7 +28,6 @@ import history from 'connect-history-api-fallback';
import config from '@/config';
import { Queue } from '@/Queue';
import { getSharedWorkflowIds } from '@/WorkflowHelpers';
import { WorkflowsController } from '@/workflows/workflows.controller';
import {
@@ -103,6 +102,7 @@ import { RoleController } from './controllers/role.controller';
import { BadRequestError } from './errors/response-errors/bad-request.error';
import { NotFoundError } from './errors/response-errors/not-found.error';
import { MultiMainSetup } from './services/orchestration/main/MultiMainSetup.ee';
import { WorkflowSharingService } from './workflows/workflowSharing.service';
const exec = promisify(callbackExec);
@@ -436,7 +436,9 @@ export class Server extends AbstractServer {
},
};
const sharedWorkflowIds = await getSharedWorkflowIds(req.user);
const sharedWorkflowIds = await Container.get(
WorkflowSharingService,
).getSharedWorkflowIds(req.user);
if (!sharedWorkflowIds.length) return [];
@@ -484,7 +486,9 @@ export class Server extends AbstractServer {
const filter = req.query.filter ? jsonParse<any>(req.query.filter) : {};
const sharedWorkflowIds = await getSharedWorkflowIds(req.user);
const sharedWorkflowIds = await Container.get(
WorkflowSharingService,
).getSharedWorkflowIds(req.user);
for (const data of executingWorkflows) {
if (
@@ -517,7 +521,9 @@ export class Server extends AbstractServer {
ResponseHelper.send(async (req: ExecutionRequest.Stop): Promise<IExecutionsStopData> => {
const { id: executionId } = req.params;
const sharedWorkflowIds = await getSharedWorkflowIds(req.user);
const sharedWorkflowIds = await Container.get(WorkflowSharingService).getSharedWorkflowIds(
req.user,
);
if (!sharedWorkflowIds.length) {
throw new NotFoundError('Execution not found');