From e95e8de5000df646916853623b02ddf75031008b Mon Sep 17 00:00:00 2001 From: Ricardo Espinoza Date: Mon, 5 Jun 2023 13:47:06 -0400 Subject: [PATCH] refactor(editor): Remove user activation modal (no-changelog) (#6361) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remove user activation modal * remove export from index.ts * Update pnpm-lock.yaml --------- Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ --- cypress/e2e/22-user-activation-modal.cy.ts | 66 ------- ...ettings_user_activation_modal_enabled.json | 90 --------- cypress/pages/modals/index.ts | 2 - .../modals/user-activation-survey-modal.ts | 10 - packages/cli/src/Server.ts | 2 - packages/cli/src/config/schema.ts | 9 - packages/cli/src/events/WorkflowStatistics.ts | 1 - packages/cli/src/requests.ts | 4 - packages/editor-ui/package.json | 1 - .../__tests__/server/endpoints/settings.ts | 1 - packages/editor-ui/src/__tests__/utils.ts | 1 - packages/editor-ui/src/components/Modals.vue | 8 - .../components/UserActivationSurveyModal.vue | 181 ------------------ packages/editor-ui/src/constants.ts | 1 - packages/editor-ui/src/main.ts | 7 +- .../src/plugins/i18n/locales/en.json | 9 - .../editor-ui/src/stores/settings.store.ts | 7 - packages/editor-ui/src/stores/ui.store.ts | 4 - packages/editor-ui/src/stores/users.store.ts | 12 +- packages/workflow/src/Interfaces.ts | 2 - pnpm-lock.yaml | 7 - 21 files changed, 2 insertions(+), 423 deletions(-) delete mode 100644 cypress/e2e/22-user-activation-modal.cy.ts delete mode 100644 cypress/fixtures/Settings_user_activation_modal_enabled.json delete mode 100644 cypress/pages/modals/user-activation-survey-modal.ts delete mode 100644 packages/editor-ui/src/components/UserActivationSurveyModal.vue diff --git a/cypress/e2e/22-user-activation-modal.cy.ts b/cypress/e2e/22-user-activation-modal.cy.ts deleted file mode 100644 index e9a730623d..0000000000 --- a/cypress/e2e/22-user-activation-modal.cy.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { WorkflowPage, NDV, UserActivationSurveyModal } from '../pages'; -import SettingsWithActivationModalEnabled from '../fixtures/Settings_user_activation_modal_enabled.json'; -import { v4 as uuid } from 'uuid'; - -const workflowPage = new WorkflowPage(); -const ndv = new NDV(); -const userActivationSurveyModal = new UserActivationSurveyModal(); - -const BASE_WEBHOOK_URL = 'http://localhost:5678/webhook'; - -describe('User activation survey', () => { - before(() => { - cy.skipSetup(); - }); - - it('Should show activation survey', () => { - cy.intercept('GET', '/rest/settings', (req) => { - req.reply(SettingsWithActivationModalEnabled); - }); - - const path = uuid(); - const method = 'GET'; - - workflowPage.actions.addInitialNodeToCanvas('Webhook'); - workflowPage.actions.openNode('Webhook'); - - //input http method - cy.getByTestId('parameter-input-httpMethod').click(); - cy.getByTestId('parameter-input-httpMethod') - .find('.el-select-dropdown') - .find('.option-headline') - .contains(method) - .click(); - - //input path method - cy.getByTestId('parameter-input-path') - .find('.parameter-input') - .find('input') - .clear() - .type(path); - - ndv.actions.close(); - - workflowPage.actions.saveWorkflowOnButtonClick(); - - workflowPage.actions.activateWorkflow(); - - cy.intercept('GET', '/rest/workflows').as('getWorkflows'); - cy.intercept('GET', '/rest/credentials').as('getCredentials'); - cy.intercept('GET', '/rest/active').as('getActive'); - - cy.request(method, `${BASE_WEBHOOK_URL}/${path}`).then((response) => { - expect(response.status).to.eq(200); - cy.visit('/'); - cy.reload(); - - cy.wait(['@getWorkflows', '@getCredentials', '@getActive']); - userActivationSurveyModal.getters.modalContainer().should('be.visible'); - userActivationSurveyModal.getters.feedbackInput().should('be.visible'); - userActivationSurveyModal.getters.skipButton().should('be.visible'); - userActivationSurveyModal.getters.feedbackInput().type('testing'); - userActivationSurveyModal.getters.feedbackInput().should('have.value', 'testing'); - userActivationSurveyModal.getters.sendFeedbackButton().click(); - }); - }); -}); diff --git a/cypress/fixtures/Settings_user_activation_modal_enabled.json b/cypress/fixtures/Settings_user_activation_modal_enabled.json deleted file mode 100644 index 8ce6a5fca6..0000000000 --- a/cypress/fixtures/Settings_user_activation_modal_enabled.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "data": { - "endpointWebhook": "webhook", - "endpointWebhookTest": "webhook-test", - "saveDataErrorExecution": "all", - "saveDataSuccessExecution": "all", - "saveManualExecutions": false, - "executionTimeout": -1, - "maxExecutionTimeout": 3600, - "workflowCallerPolicyDefaultOption": "workflowsFromSameOwner", - "timezone": "America/New_York", - "urlBaseWebhook": "http://localhost:5678/", - "urlBaseEditor": "http://localhost:5678", - "versionCli": "0.221.2", - "oauthCallbackUrls": { - "oauth1": "http://localhost:5678/rest/oauth1-credential/callback", - "oauth2": "http://localhost:5678/rest/oauth2-credential/callback" - }, - "versionNotifications": { - "enabled": true, - "endpoint": "https://api.n8n.io/api/versions/", - "infoUrl": "https://docs.n8n.io/release-notes/" - }, - "instanceId": "c229842c6d1e217486d04caf7223758e08385156ca87a58286c850760c7161f4", - "telemetry": { - "enabled": true - }, - "posthog": { - "enabled": false, - "apiHost": "https://ph.n8n.io", - "apiKey": "phc_4URIAm1uYfJO7j8kWSe0J8lc8IqnstRLS7Jx8NcakHo", - "autocapture": false, - "disableSessionRecording": true, - "debug": false - }, - "personalizationSurveyEnabled": false, - "userActivationSurveyEnabled": true, - "defaultLocale": "en", - "userManagement": { - "enabled": true, - "showSetupOnFirstLoad": false, - "smtpSetup": false - }, - "sso": { - "saml": { - "loginEnabled": false, - "loginLabel": "" - }, - "ldap": { - "loginEnabled": false, - "loginLabel": "" - } - }, - "publicApi": { - "enabled": false, - "latestVersion": 1, - "path": "api", - "swaggerUi": { - "enabled": true - } - }, - "workflowTagsDisabled": false, - "logLevel": "info", - "hiringBannerEnabled": true, - "templates": { - "enabled": true, - "host": "https://api.n8n.io/api/" - }, - "onboardingCallPromptEnabled": true, - "executionMode": "regular", - "pushBackend": "sse", - "communityNodesEnabled": true, - "deployment": { - "type": "default" - }, - "isNpmAvailable": false, - "allowedModules": {}, - "enterprise": { - "sharing": true, - "ldap": true, - "saml": false, - "logStreaming": false, - "advancedExecutionFilters": false - }, - "hideUsagePage": false, - "license": { - "environment": "production" - } - } -} diff --git a/cypress/pages/modals/index.ts b/cypress/pages/modals/index.ts index 358ba0cf78..3d1981d027 100644 --- a/cypress/pages/modals/index.ts +++ b/cypress/pages/modals/index.ts @@ -1,5 +1,3 @@ export * from './credentials-modal'; export * from './message-box'; export * from './workflow-sharing-modal'; -export * from './user-activation-survey-modal'; - diff --git a/cypress/pages/modals/user-activation-survey-modal.ts b/cypress/pages/modals/user-activation-survey-modal.ts deleted file mode 100644 index cc8f139fb6..0000000000 --- a/cypress/pages/modals/user-activation-survey-modal.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { BasePage } from './../base'; - -export class UserActivationSurveyModal extends BasePage { - getters = { - modalContainer: () => cy.getByTestId('userActivationSurvey-modal').last(), - feedbackInput: () => cy.getByTestId('activation-feedback-input').find('textarea'), - sendFeedbackButton: () => cy.getByTestId('send-activation-feedback-button'), - skipButton: () => cy.getByTestId('skip-button'), - }; -} diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index a0caf908ab..521b8de00c 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -258,8 +258,6 @@ export class Server extends AbstractServer { }, personalizationSurveyEnabled: config.getEnv('personalization.enabled') && config.getEnv('diagnostics.enabled'), - userActivationSurveyEnabled: - config.getEnv('userActivationSurvey.enabled') && config.getEnv('diagnostics.enabled'), defaultLocale: config.getEnv('defaultLocale'), userManagement: { enabled: isUserManagementEnabled(), diff --git a/packages/cli/src/config/schema.ts b/packages/cli/src/config/schema.ts index bdb44b9789..c25db2b255 100644 --- a/packages/cli/src/config/schema.ts +++ b/packages/cli/src/config/schema.ts @@ -1043,15 +1043,6 @@ export const schema = { }, }, - userActivationSurvey: { - enabled: { - doc: 'Whether user activation survey is enabled.', - format: Boolean, - default: true, - env: 'N8N_USER_ACTIVATION_SURVEY_ENABLED', - }, - }, - diagnostics: { enabled: { doc: 'Whether diagnostic mode is enabled.', diff --git a/packages/cli/src/events/WorkflowStatistics.ts b/packages/cli/src/events/WorkflowStatistics.ts index 6a500399c5..b2a15b4919 100644 --- a/packages/cli/src/events/WorkflowStatistics.ts +++ b/packages/cli/src/events/WorkflowStatistics.ts @@ -118,7 +118,6 @@ export async function workflowExecutionCompleted( await UserService.updateUserSettings(owner.id, { firstSuccessfulWorkflowId: workflowId, userActivated: true, - showUserActivationSurvey: true, }); } diff --git a/packages/cli/src/requests.ts b/packages/cli/src/requests.ts index 498d56c392..9b4adf94ad 100644 --- a/packages/cli/src/requests.ts +++ b/packages/cli/src/requests.ts @@ -33,10 +33,6 @@ export class UserUpdatePayload implements Pick new Promise((resolve) => setTimeout(r export const SETTINGS_STORE_DEFAULT_STATE: ISettingsState = { settings: { - userActivationSurveyEnabled: false, allowedModules: {}, communityNodesEnabled: false, defaultLocale: '', diff --git a/packages/editor-ui/src/components/Modals.vue b/packages/editor-ui/src/components/Modals.vue index 72562046d2..cc1ee84136 100644 --- a/packages/editor-ui/src/components/Modals.vue +++ b/packages/editor-ui/src/components/Modals.vue @@ -91,10 +91,6 @@ - - - -