mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 05:17:28 -08:00
fix(core): Fix frontend.settings
external hook execution (#7496)
This commit is contained in:
parent
4e66023cd4
commit
774fe202bf
|
@ -30,11 +30,14 @@ import {
|
|||
getWorkflowHistoryPruneTime,
|
||||
} from '@/workflows/workflowHistory/workflowHistoryHelper.ee';
|
||||
import { UserManagementMailer } from '@/UserManagement/email';
|
||||
import type { CommunityPackagesService } from '@/services/communityPackages.service';
|
||||
|
||||
@Service()
|
||||
export class FrontendService {
|
||||
settings: IN8nUISettings;
|
||||
|
||||
private communityPackagesService?: CommunityPackagesService;
|
||||
|
||||
constructor(
|
||||
private readonly loadNodesAndCredentials: LoadNodesAndCredentials,
|
||||
private readonly credentialTypes: CredentialTypes,
|
||||
|
@ -44,6 +47,13 @@ export class FrontendService {
|
|||
private readonly instanceSettings: InstanceSettings,
|
||||
) {
|
||||
this.initSettings();
|
||||
|
||||
if (config.getEnv('nodes.communityPackages.enabled')) {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
void import('@/services/communityPackages.service').then(({ CommunityPackagesService }) => {
|
||||
this.communityPackagesService = Container.get(CommunityPackagesService);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private initSettings() {
|
||||
|
@ -198,7 +208,7 @@ export class FrontendService {
|
|||
this.writeStaticJSON('credentials', credentials);
|
||||
}
|
||||
|
||||
async getSettings(): Promise<IN8nUISettings> {
|
||||
getSettings(): IN8nUISettings {
|
||||
const restEndpoint = config.getEnv('endpoints.rest');
|
||||
|
||||
// Update all urls, in case `WEBHOOK_URL` was updated by `--tunnel`
|
||||
|
@ -275,10 +285,8 @@ export class FrontendService {
|
|||
});
|
||||
}
|
||||
|
||||
if (config.getEnv('nodes.communityPackages.enabled')) {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
const { CommunityPackagesService } = await import('@/services/communityPackages.service');
|
||||
this.settings.missingPackages = Container.get(CommunityPackagesService).hasMissingPackages;
|
||||
if (this.communityPackagesService) {
|
||||
this.settings.missingPackages = this.communityPackagesService.hasMissingPackages;
|
||||
}
|
||||
|
||||
this.settings.mfa.enabled = config.get('mfa.enabled');
|
||||
|
|
Loading…
Reference in a new issue