feat(core): Show a banner when running a non-prod license (no-changelog) (#6849)

* add feat:showNonProdBanner

* fix linting

* fix linting
This commit is contained in:
Cornelius Suermann 2023-08-16 10:05:03 +02:00 committed by GitHub
parent 775e73e0c3
commit 198a977f57
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 0 deletions

View file

@ -66,6 +66,7 @@ import {
GENERATED_STATIC_DIR,
inDevelopment,
inE2ETests,
LICENSE_FEATURES,
N8N_VERSION,
RESPONSE_ERROR_MESSAGES,
TEMPLATES_DIR,
@ -311,6 +312,7 @@ export class Server extends AbstractServer {
variables: false,
sourceControl: false,
auditLogs: false,
showNonProdBanner: false,
debugInEditor: false,
},
hideUsagePage: config.getEnv('hideUsagePage'),
@ -441,6 +443,9 @@ export class Server extends AbstractServer {
advancedExecutionFilters: isAdvancedExecutionFiltersEnabled(),
variables: isVariablesEnabled(),
sourceControl: isSourceControlLicensed(),
showNonProdBanner: Container.get(License).isFeatureEnabled(
LICENSE_FEATURES.SHOW_NON_PROD_BANNER,
),
debugInEditor: isDebugInEditorLicensed(),
});

View file

@ -75,6 +75,7 @@ export const LICENSE_FEATURES = {
VARIABLES: 'feat:variables',
SOURCE_CONTROL: 'feat:sourceControl',
API_DISABLED: 'feat:apiDisabled',
SHOW_NON_PROD_BANNER: 'feat:showNonProdBanner',
WORKFLOW_HISTORY: 'feat:workflowHistory',
DEBUG_IN_EDITOR: 'feat:debugInEditor',
} as const;

View file

@ -61,6 +61,7 @@ export class E2EController {
[LICENSE_FEATURES.SOURCE_CONTROL]: false,
[LICENSE_FEATURES.VARIABLES]: false,
[LICENSE_FEATURES.API_DISABLED]: false,
[LICENSE_FEATURES.SHOW_NON_PROD_BANNER]: false,
[LICENSE_FEATURES.WORKFLOW_HISTORY]: false,
[LICENSE_FEATURES.DEBUG_IN_EDITOR]: false,
};

View file

@ -18,6 +18,8 @@ const defaultSettings: IN8nUISettings = {
variables: true,
sourceControl: false,
auditLogs: false,
versionControl: false,
showNonProdBanner: false,
},
executionMode: 'regular',
executionTimeout: 0,

View file

@ -2185,6 +2185,7 @@ export interface IN8nUISettings {
variables: boolean;
sourceControl: boolean;
auditLogs: boolean;
showNonProdBanner: boolean;
debugInEditor: boolean;
};
hideUsagePage: boolean;