mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor(core): Port workflows config (no-changelog) (#10173)
This commit is contained in:
@@ -43,6 +43,7 @@ import type { Project } from '@/databases/entities/Project';
|
||||
import { ProjectRelationRepository } from '@/databases/repositories/projectRelation.repository';
|
||||
import { z } from 'zod';
|
||||
import { EventService } from '@/eventbus/event.service';
|
||||
import { GlobalConfig } from '@n8n/config';
|
||||
|
||||
@RestController('/workflows')
|
||||
export class WorkflowsController {
|
||||
@@ -67,6 +68,7 @@ export class WorkflowsController {
|
||||
private readonly projectService: ProjectService,
|
||||
private readonly projectRelationRepository: ProjectRelationRepository,
|
||||
private readonly eventService: EventService,
|
||||
private readonly globalConfig: GlobalConfig,
|
||||
) {}
|
||||
|
||||
@Post('/')
|
||||
@@ -204,12 +206,12 @@ export class WorkflowsController {
|
||||
|
||||
@Get('/new')
|
||||
async getNewName(req: WorkflowRequest.NewName) {
|
||||
const requestedName = req.query.name ?? config.getEnv('workflows.defaultName');
|
||||
const requestedName = req.query.name ?? this.globalConfig.workflows.defaultName;
|
||||
|
||||
const name = await this.namingService.getUniqueWorkflowName(requestedName);
|
||||
|
||||
const onboardingFlowEnabled =
|
||||
!config.getEnv('workflows.onboardingFlowDisabled') &&
|
||||
!this.globalConfig.workflows.onboardingFlowDisabled &&
|
||||
!req.user.settings?.isOnboarded &&
|
||||
(await this.userOnboardingService.isBelowThreshold(req.user));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user