Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): Add versionControl feature flag #6000

Merged
merged 2 commits into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/cli/src/Interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ export interface IN8nUISettings {
logStreaming: boolean;
advancedExecutionFilters: boolean;
variables: boolean;
versionControl: boolean;
};
hideUsagePage: boolean;
license: {
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/src/License.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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() ?? [];
}
Expand Down
3 changes: 3 additions & 0 deletions packages/cli/src/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -320,6 +321,7 @@ class Server extends AbstractServer {
logStreaming: false,
advancedExecutionFilters: false,
variables: false,
versionControl: false,
},
hideUsagePage: config.getEnv('hideUsagePage'),
license: {
Expand Down Expand Up @@ -354,6 +356,7 @@ class Server extends AbstractServer {
saml: isSamlLicensed(),
advancedExecutionFilters: isAdvancedExecutionFiltersEnabled(),
variables: isVariablesEnabled(),
versionControl: isVersionControlEnabled(),
});

if (isLdapEnabled()) {
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/api/e2e.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Container from 'typedi';
import { License } from '../../License';

export function isVersionControlEnabled() {
const license = Container.get(License);
return license.isVersionControlEnabled();
}
1 change: 1 addition & 0 deletions packages/editor-ui/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ export enum EnterpriseEditionFeature {
LogStreaming = 'logStreaming',
Variables = 'variables',
Saml = 'saml',
VersionControl = 'versionControl',
}
export const MAIN_NODE_PANEL_WIDTH = 360;

Expand Down