feat(core): Add versionControl feature flag (#6000)

add versionControl feature flag
This commit is contained in:
Michael Auerswald 2023-04-18 13:29:26 +02:00 committed by GitHub
parent 0c10fbc83f
commit 33299ca61a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 18 additions and 0 deletions

View file

@ -542,6 +542,7 @@ export interface IN8nUISettings {
logStreaming: boolean;
advancedExecutionFilters: boolean;
variables: boolean;
versionControl: boolean;
};
hideUsagePage: boolean;
license: {

View file

@ -128,6 +128,10 @@ export class License {
return this.isFeatureEnabled(LICENSE_FEATURES.VARIABLES);
}
isVersionControlEnabled() {
return this.isFeatureEnabled(LICENSE_FEATURES.VERSION_CONTROL);
}
getCurrentEntitlements() {
return this.manager?.getCurrentEntitlements() ?? [];
}

View file

@ -160,6 +160,7 @@ import { variablesController } from './environments/variables.controller';
import { LdapManager } from './Ldap/LdapManager.ee';
import { getVariablesLimit, isVariablesEnabled } from '@/environments/enviromentHelpers';
import { getCurrentAuthenticationMethod } from './sso/ssoHelpers';
import { isVersionControlEnabled } from './environment/versionControl/versionControlHelper';
const exec = promisify(callbackExec);
@ -320,6 +321,7 @@ class Server extends AbstractServer {
logStreaming: false,
advancedExecutionFilters: false,
variables: false,
versionControl: false,
},
hideUsagePage: config.getEnv('hideUsagePage'),
license: {
@ -354,6 +356,7 @@ class Server extends AbstractServer {
saml: isSamlLicensed(),
advancedExecutionFilters: isAdvancedExecutionFiltersEnabled(),
variables: isVariablesEnabled(),
versionControl: isVersionControlEnabled(),
});
if (isLdapEnabled()) {

View file

@ -29,6 +29,7 @@ const enabledFeatures = {
[LICENSE_FEATURES.SAML]: false,
[LICENSE_FEATURES.LOG_STREAMING]: false,
[LICENSE_FEATURES.ADVANCED_EXECUTION_FILTERS]: false,
[LICENSE_FEATURES.VERSION_CONTROL]: false,
};
type Feature = keyof typeof enabledFeatures;

View file

@ -75,6 +75,7 @@ export enum LICENSE_FEATURES {
LOG_STREAMING = 'feat:logStreaming',
ADVANCED_EXECUTION_FILTERS = 'feat:advancedExecutionFilters',
VARIABLES = 'feat:variables',
VERSION_CONTROL = 'feat:versionControl',
}
export enum LICENSE_QUOTAS {

View file

@ -0,0 +1,7 @@
import Container from 'typedi';
import { License } from '../../License';
export function isVersionControlEnabled() {
const license = Container.get(License);
return license.isVersionControlEnabled();
}

View file

@ -461,6 +461,7 @@ export enum EnterpriseEditionFeature {
LogStreaming = 'logStreaming',
Variables = 'variables',
Saml = 'saml',
VersionControl = 'versionControl',
}
export const MAIN_NODE_PANEL_WIDTH = 360;