mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(editor): Show template credential setup based on feature flag (#7989)
Replace the local storage based feature flag with posthog feature flag. Also: - Fix bunch of eslint warnings in posthog store
This commit is contained in:
@@ -1,40 +1,35 @@
|
||||
import { BasePage } from './base';
|
||||
|
||||
export type TemplateTestData = {
|
||||
id: number;
|
||||
fixture: string;
|
||||
};
|
||||
|
||||
export class TemplateCredentialSetupPage extends BasePage {
|
||||
testData = {
|
||||
simpleTemplate: {
|
||||
id: 1205,
|
||||
fixture: 'Test_Template_1.json',
|
||||
},
|
||||
};
|
||||
export const testData = {
|
||||
simpleTemplate: {
|
||||
id: 1205,
|
||||
fixture: 'Test_Template_1.json',
|
||||
},
|
||||
};
|
||||
|
||||
getters = {
|
||||
continueButton: () => cy.getByTestId('continue-button'),
|
||||
skipLink: () => cy.get('a:contains("Skip")'),
|
||||
title: (title: string) => cy.get(`h1:contains(${title})`),
|
||||
infoCallout: () => cy.getByTestId('info-callout'),
|
||||
createAppCredentialsButton: (appName: string) =>
|
||||
cy.get(`button:contains("Create new ${appName} credential")`),
|
||||
appCredentialSteps: () => cy.getByTestId('setup-credentials-form-step'),
|
||||
stepHeading: ($el: JQuery<HTMLElement>) =>
|
||||
cy.wrap($el).findChildByTestId('credential-step-heading'),
|
||||
stepDescription: ($el: JQuery<HTMLElement>) =>
|
||||
cy.wrap($el).findChildByTestId('credential-step-description'),
|
||||
};
|
||||
export const getters = {
|
||||
continueButton: () => cy.getByTestId('continue-button'),
|
||||
skipLink: () => cy.get('a:contains("Skip")'),
|
||||
title: (title: string) => cy.get(`h1:contains(${title})`),
|
||||
infoCallout: () => cy.getByTestId('info-callout'),
|
||||
createAppCredentialsButton: (appName: string) =>
|
||||
cy.get(`button:contains("Create new ${appName} credential")`),
|
||||
appCredentialSteps: () => cy.getByTestId('setup-credentials-form-step'),
|
||||
stepHeading: ($el: JQuery<HTMLElement>) =>
|
||||
cy.wrap($el).findChildByTestId('credential-step-heading'),
|
||||
stepDescription: ($el: JQuery<HTMLElement>) =>
|
||||
cy.wrap($el).findChildByTestId('credential-step-description'),
|
||||
};
|
||||
|
||||
actions = {
|
||||
visit: (templateId: number) => {
|
||||
cy.visit(`/templates/${templateId}/setup`);
|
||||
},
|
||||
enableFeatureFlag: () => {
|
||||
cy.window().then((window) => {
|
||||
window.localStorage.setItem('template-credentials-setup', 'true');
|
||||
});
|
||||
},
|
||||
};
|
||||
}
|
||||
export const visitTemplateCredentialSetupPage = (templateId: number) => {
|
||||
cy.visit(`/templates/${templateId}/setup`);
|
||||
};
|
||||
|
||||
export const enableTemplateCredentialSetupFeatureFlag = () => {
|
||||
cy.window().then((win) => {
|
||||
win.featureFlags.override('016_template_credential_setup', true);
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user