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: Update NPS Value Survey #9638

Merged
merged 72 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
c5923c3
fix: refactor value component
mutdmour May 23, 2024
931ab36
feat: add nps score to value survey
mutdmour May 23, 2024
6295b8d
feat: add value survey endpoints
mutdmour May 23, 2024
a6fdb1e
Merge branch 'master' of github.com:n8n-io/n8n into ado-768
mutdmour May 24, 2024
213fb7a
fix: add logic to decide to show value survey
mutdmour May 24, 2024
c6e195c
feat: add logic to update survey
mutdmour May 24, 2024
0c4a75e
feat: update logic to show
mutdmour May 24, 2024
1858e28
merge master
mutdmour Jun 3, 2024
08acc4e
reduce changes
mutdmour Jun 3, 2024
e55a241
handle edge case for ignoring users
mutdmour Jun 3, 2024
4a4b9fa
add migration to set for existing users
mutdmour Jun 4, 2024
2a8ce40
prevent if telemetry disabled
mutdmour Jun 4, 2024
b7acea8
Merge branch 'master' of github.com:n8n-io/n8n into ado-768
mutdmour Jun 5, 2024
7c0c2ff
refactor: add clear state to api, add store
mutdmour Jun 5, 2024
33f5c46
refactor to seperate store
mutdmour Jun 5, 2024
9b31e25
clean up
mutdmour Jun 5, 2024
995946e
Merge branch 'master' of github.com:n8n-io/n8n into ado-768
mutdmour Jun 5, 2024
7ef0d9d
add tests
mutdmour Jun 5, 2024
e07e054
refactor, add tests
mutdmour Jun 5, 2024
a560053
add tests for controller
mutdmour Jun 5, 2024
29b19f3
fix up package
mutdmour Jun 5, 2024
cc6b2fc
remove import
mutdmour Jun 5, 2024
007cee7
add initial e2e tests
mutdmour Jun 5, 2024
0436667
Add test for email part
mutdmour Jun 5, 2024
e67caad
lint fix
mutdmour Jun 6, 2024
0aec1b4
rename var
mutdmour Jun 6, 2024
135737e
refactor: rename to nps survey
mutdmour Jun 6, 2024
efc7c74
refactor: rename to nps survey
mutdmour Jun 6, 2024
a48601d
fix: update key name
mutdmour Jun 6, 2024
81a29fc
last bit of rename
mutdmour Jun 6, 2024
3841598
refactor to make more restful
mutdmour Jun 6, 2024
6e90a25
update to add vars on top
mutdmour Jun 7, 2024
9cfef22
refactor to reduce dep cycle
mutdmour Jun 7, 2024
61d2ba0
fix lint issue
mutdmour Jun 7, 2024
c333361
refactor continue
mutdmour Jun 7, 2024
87a14ef
override for postgres
mutdmour Jun 7, 2024
10bdd1c
fix migrations
mutdmour Jun 7, 2024
2d5963e
fix migrations
mutdmour Jun 7, 2024
aaf4aa3
merge master
mutdmour Jun 7, 2024
52b4ad0
add tests
mutdmour Jun 7, 2024
26db1df
add more tests
mutdmour Jun 7, 2024
0854acd
fix tests
mutdmour Jun 7, 2024
fcd5998
fix migrations
mutdmour Jun 8, 2024
1403e5e
update unit tests
mutdmour Jun 8, 2024
aa71cc8
Merge branch 'master' of github.com:n8n-io/n8n into ado-768
mutdmour Jun 8, 2024
cd1224a
fix mysql queries
mutdmour Jun 8, 2024
f846d65
update unit tests
mutdmour Jun 8, 2024
4a5ee8f
clean up
mutdmour Jun 8, 2024
14fa060
fix: bug with e2e
mutdmour Jun 8, 2024
dc7ff61
Merge branch 'master' of github.com:n8n-io/n8n into ado-768
mutdmour Jun 10, 2024
3200e7e
refactor: add comment
mutdmour Jun 10, 2024
7a3a95b
refactor: address feedback
mutdmour Jun 10, 2024
22ba1d1
fix: remove telemetry check
mutdmour Jun 10, 2024
8058b39
fix: add telemetry config
mutdmour Jun 10, 2024
8ab51ca
fix: e2e
mutdmour Jun 10, 2024
ff9218f
fix: remove console log
mutdmour Jun 10, 2024
c50b9ba
Merge branch 'master' of github.com:n8n-io/n8n into ado-768
mutdmour Jun 10, 2024
ebc1e86
fix types
mutdmour Jun 10, 2024
9ec6414
fix last type issues
mutdmour Jun 10, 2024
0be328e
fix: bug with retry logic
mutdmour Jun 10, 2024
b60e4cd
merge in masteR
mutdmour Jun 10, 2024
683848a
update to test domains
mutdmour Jun 10, 2024
962a3e8
clean up unused import
mutdmour Jun 10, 2024
e84151d
make tests less flaky
mutdmour Jun 10, 2024
04db697
remove only
mutdmour Jun 10, 2024
51f58b4
lintfix
netroy Jun 10, 2024
aa72281
Merge branch 'master' of github.com:n8n-io/n8n into ado-768
mutdmour Jun 11, 2024
d4d6829
skip failing test
mutdmour Jun 11, 2024
dd03c94
fix lint
mutdmour Jun 11, 2024
f517535
Update cypress/e2e/42-nps-survey.cy.ts
mutdmour Jun 11, 2024
d8a9b47
address feedback
mutdmour Jun 11, 2024
9fb993d
user assert instead of type check
mutdmour Jun 11, 2024
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
9 changes: 5 additions & 4 deletions cypress/e2e/12-canvas-actions.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { WorkflowPage as WorkflowPageClass } from '../pages/workflow';
import { successToast } from '../pages/notifications';
import {
MANUAL_TRIGGER_NODE_NAME,
MANUAL_TRIGGER_NODE_DISPLAY_NAME,
Expand Down Expand Up @@ -166,8 +167,8 @@ describe('Canvas Actions', () => {
.findChildByTestId('execute-node-button')
.click({ force: true });
WorkflowPage.actions.executeNode(CODE_NODE_NAME);
WorkflowPage.getters.successToast().should('have.length', 2);
WorkflowPage.getters.successToast().should('contain.text', 'Node executed successfully');
successToast().should('have.length', 2);
successToast().should('contain.text', 'Node executed successfully');
});

it('should disable and enable node', () => {
Expand Down Expand Up @@ -201,10 +202,10 @@ describe('Canvas Actions', () => {
WorkflowPage.actions.selectAll();

WorkflowPage.actions.hitCopy();
WorkflowPage.getters.successToast().should('contain', 'Copied!');
successToast().should('contain', 'Copied!');

WorkflowPage.actions.copyNode(CODE_NODE_NAME);
WorkflowPage.getters.successToast().should('contain', 'Copied!');
successToast().should('contain', 'Copied!');
});

it('should select/deselect all nodes', () => {
Expand Down
7 changes: 3 additions & 4 deletions cypress/e2e/13-pinning.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
BACKEND_BASE_URL,
} from '../constants';
import { WorkflowPage, NDV } from '../pages';
import { errorToast } from '../pages/notifications';

const workflowPage = new WorkflowPage();
const ndv = new NDV();
Expand Down Expand Up @@ -139,9 +140,7 @@ describe('Data pinning', () => {
test: '1'.repeat(Cypress.env('MAX_PINNED_DATA_SIZE') as number),
},
]);
workflowPage.getters
.errorToast()
.should('contain', 'Workflow has reached the maximum allowed pinned data size');
errorToast().should('contain', 'Workflow has reached the maximum allowed pinned data size');
});

it('Should show an error when pin data JSON in invalid', () => {
Expand All @@ -152,7 +151,7 @@ describe('Data pinning', () => {
ndv.getters.editPinnedDataButton().should('be.visible');

ndv.actions.setPinnedData('[ { "name": "First item", "code": 2dsa }]');
workflowPage.getters.errorToast().should('contain', 'Unable to save due to invalid JSON');
errorToast().should('contain', 'Unable to save due to invalid JSON');
});

it('Should be able to reference paired items in a node located before pinned data', () => {
Expand Down
3 changes: 2 additions & 1 deletion cypress/e2e/1338-ADO-ndv-missing-input-panel.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { v4 as uuid } from 'uuid';
import { NDV, WorkflowPage as WorkflowPageClass } from '../pages';
import { successToast } from '../pages/notifications';

const workflowPage = new WorkflowPageClass();
const ndv = new NDV();
Expand All @@ -16,7 +17,7 @@ describe('ADO-1338-ndv-missing-input-panel', () => {
workflowPage.getters.zoomToFitButton().click();
workflowPage.getters.executeWorkflowButton().click();
// Check success toast (works because Cypress waits enough for the element to show after the http request node has finished)
workflowPage.getters.successToast().should('be.visible');
successToast().should('be.visible');

workflowPage.actions.openNode('Discourse1');
ndv.getters.inputPanel().should('be.visible');
Expand Down
19 changes: 8 additions & 11 deletions cypress/e2e/18-user-management.cy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { INSTANCE_MEMBERS, INSTANCE_OWNER, INSTANCE_ADMIN } from '../constants';
import { MainSidebar, SettingsSidebar, SettingsUsersPage, WorkflowPage } from '../pages';
import { MainSidebar, SettingsSidebar, SettingsUsersPage } from '../pages';
import { PersonalSettingsPage } from '../pages/settings-personal';
import { getVisibleSelect } from '../utils';
import { errorToast, successToast } from '../pages/notifications';

/**
* User A - Instance owner
Expand All @@ -24,7 +25,6 @@ const updatedPersonalData = {
};

const usersSettingsPage = new SettingsUsersPage();
const workflowPage = new WorkflowPage();
const personalSettingsPage = new PersonalSettingsPage();
const settingsSidebar = new SettingsSidebar();
const mainSidebar = new MainSidebar();
Expand Down Expand Up @@ -174,7 +174,7 @@ describe('User Management', { disableAutoLogin: true }, () => {
usersSettingsPage.getters.deleteDataRadioButton().click();
usersSettingsPage.getters.deleteDataInput().type('delete all data');
usersSettingsPage.getters.deleteUserButton().click();
workflowPage.getters.successToast().should('contain', 'User deleted');
successToast().should('contain', 'User deleted');
});

it('should delete user and transfer their data', () => {
Expand All @@ -184,7 +184,7 @@ describe('User Management', { disableAutoLogin: true }, () => {
usersSettingsPage.getters.userSelectDropDown().click();
usersSettingsPage.getters.userSelectOptions().first().click();
usersSettingsPage.getters.deleteUserButton().click();
workflowPage.getters.successToast().should('contain', 'User deleted');
successToast().should('contain', 'User deleted');
});

it('should allow user to change their personal data', () => {
Expand All @@ -196,7 +196,7 @@ describe('User Management', { disableAutoLogin: true }, () => {
personalSettingsPage.getters
.currentUserName()
.should('contain', `${updatedPersonalData.newFirstName} ${updatedPersonalData.newLastName}`);
workflowPage.getters.successToast().should('contain', 'Personal details updated');
successToast().should('contain', 'Personal details updated');
});

it("shouldn't allow user to set weak password", () => {
Expand All @@ -211,10 +211,7 @@ describe('User Management', { disableAutoLogin: true }, () => {
personalSettingsPage.actions.loginAndVisit(INSTANCE_OWNER.email, INSTANCE_OWNER.password);
personalSettingsPage.getters.changePasswordLink().click();
personalSettingsPage.actions.updatePassword('iCannotRemember', updatedPersonalData.newPassword);
workflowPage.getters
.errorToast()
.closest('div')
.should('contain', 'Provided current password is incorrect.');
errorToast().closest('div').should('contain', 'Provided current password is incorrect.');
});

it('should change current user password', () => {
Expand All @@ -224,7 +221,7 @@ describe('User Management', { disableAutoLogin: true }, () => {
INSTANCE_OWNER.password,
updatedPersonalData.newPassword,
);
workflowPage.getters.successToast().should('contain', 'Password updated');
successToast().should('contain', 'Password updated');
personalSettingsPage.actions.loginWithNewData(
INSTANCE_OWNER.email,
updatedPersonalData.newPassword,
Expand All @@ -248,7 +245,7 @@ describe('User Management', { disableAutoLogin: true }, () => {
updatedPersonalData.newPassword,
);
personalSettingsPage.actions.updateEmail(updatedPersonalData.newEmail);
workflowPage.getters.successToast().should('contain', 'Personal details updated');
successToast().should('contain', 'Personal details updated');
personalSettingsPage.actions.loginWithNewData(
updatedPersonalData.newEmail,
updatedPersonalData.newPassword,
Expand Down
15 changes: 8 additions & 7 deletions cypress/e2e/19-execution.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { v4 as uuid } from 'uuid';
import { NDV, WorkflowExecutionsTab, WorkflowPage as WorkflowPageClass } from '../pages';
import { SCHEDULE_TRIGGER_NODE_NAME, EDIT_FIELDS_SET_NODE_NAME } from '../constants';
import { errorToast, successToast } from '../pages/notifications';

const workflowPage = new WorkflowPageClass();
const executionsTab = new WorkflowExecutionsTab();
Expand Down Expand Up @@ -68,7 +69,7 @@ describe('Execution', () => {
workflowPage.getters.clearExecutionDataButton().should('not.exist');

// Check success toast (works because Cypress waits enough for the element to show after the http request node has finished)
workflowPage.getters.successToast().should('be.visible');
successToast().should('be.visible');
});

it('should test manual workflow stop', () => {
Expand Down Expand Up @@ -127,7 +128,7 @@ describe('Execution', () => {
workflowPage.getters.clearExecutionDataButton().should('not.exist');

// Check success toast (works because Cypress waits enough for the element to show after the http request node has finished)
workflowPage.getters.successToast().should('be.visible');
successToast().should('be.visible');
});

it('should test webhook workflow', () => {
Expand Down Expand Up @@ -200,7 +201,7 @@ describe('Execution', () => {
workflowPage.getters.clearExecutionDataButton().should('not.exist');

// Check success toast (works because Cypress waits enough for the element to show after the http request node has finished)
workflowPage.getters.successToast().should('be.visible');
successToast().should('be.visible');
});

it('should test webhook workflow stop', () => {
Expand Down Expand Up @@ -274,7 +275,7 @@ describe('Execution', () => {
workflowPage.getters.clearExecutionDataButton().should('not.exist');

// Check success toast (works because Cypress waits enough for the element to show after the http request node has finished)
workflowPage.getters.successToast().should('be.visible');
successToast().should('be.visible');
});

describe('execution preview', () => {
Expand All @@ -286,7 +287,7 @@ describe('Execution', () => {
executionsTab.actions.deleteExecutionInPreview();

executionsTab.getters.successfulExecutionListItems().should('have.length', 0);
workflowPage.getters.successToast().contains('Execution deleted');
successToast().contains('Execution deleted');
});
});

Expand Down Expand Up @@ -587,7 +588,7 @@ describe('Execution', () => {
cy.wait('@workflowRun');
// Wait again for the websocket message to arrive and the UI to update.
cy.wait(100);
workflowPage.getters.errorToast({ timeout: 1 }).should('not.exist');
errorToast({ timeout: 1 }).should('not.exist');
});

it('should execute workflow partially up to the node that has issues', () => {
Expand All @@ -614,6 +615,6 @@ describe('Execution', () => {
.within(() => cy.get('.fa-check'))
.should('exist');

workflowPage.getters.errorToast().should('contain', 'Problem in node ‘Telegram‘');
errorToast().should('contain', 'Problem in node ‘Telegram‘');
});
});
3 changes: 2 additions & 1 deletion cypress/e2e/2-credentials.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
TRELLO_NODE_NAME,
} from '../constants';
import { CredentialsModal, CredentialsPage, NDV, WorkflowPage } from '../pages';
import { successToast } from '../pages/notifications';
import { getVisibleSelect } from '../utils';

const credentialsPage = new CredentialsPage();
Expand Down Expand Up @@ -153,7 +154,7 @@ describe('Credentials', () => {
credentialsModal.getters.credentialsEditModal().should('be.visible');
credentialsModal.getters.deleteButton().click();
cy.get('.el-message-box').find('button').contains('Yes').click();
workflowPage.getters.successToast().contains('Credential deleted');
successToast().contains('Credential deleted');
workflowPage.getters
.nodeCredentialsSelect()
.find('input')
Expand Down
11 changes: 3 additions & 8 deletions cypress/e2e/2230-ADO-ndv-reset-data-pagination.cy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { NDV, WorkflowPage } from '../pages';
import { clearNotifications } from '../pages/notifications';

const workflowPage = new WorkflowPage();
const ndv = new NDV();
Expand All @@ -12,10 +13,7 @@ describe('ADO-2230 NDV Pagination Reset', () => {

// execute node outputting 10 pages, check output of first page
ndv.actions.execute();
workflowPage.getters
.successToast()
.find('.el-notification__closeBtn')
.click({ multiple: true });
clearNotifications();
ndv.getters.outputTbodyCell(1, 1).invoke('text').should('eq', '[email protected]');

// open 4th page, check output
Expand All @@ -27,10 +25,7 @@ describe('ADO-2230 NDV Pagination Reset', () => {
// output a lot less data
ndv.getters.parameterInput('randomDataCount').find('input').clear().type('20');
ndv.actions.execute();
workflowPage.getters
.successToast()
.find('.el-notification__closeBtn')
.click({ multiple: true });
clearNotifications();

// check we are back to second page now
ndv.getters.pagination().find('li.number').should('have.length', 2);
Expand Down
14 changes: 5 additions & 9 deletions cypress/e2e/33-settings-personal.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { WorkflowPage } from '../pages';

const workflowPage = new WorkflowPage();
import { errorToast, successToast } from '../pages/notifications';

const INVALID_NAMES = [
'https://n8n.io',
Expand Down Expand Up @@ -33,8 +31,8 @@ describe('Personal Settings', () => {
cy.getByTestId('personal-data-form').find('input[name="firstName"]').clear().type(name[0]);
cy.getByTestId('personal-data-form').find('input[name="lastName"]').clear().type(name[1]);
cy.getByTestId('save-settings-button').click();
workflowPage.getters.successToast().should('contain', 'Personal details updated');
workflowPage.getters.successToast().find('.el-notification__closeBtn').click();
successToast().should('contain', 'Personal details updated');
successToast().find('.el-notification__closeBtn').click();
});
});
it('not allow malicious values for personal data', () => {
Expand All @@ -43,10 +41,8 @@ describe('Personal Settings', () => {
cy.getByTestId('personal-data-form').find('input[name="firstName"]').clear().type(name);
cy.getByTestId('personal-data-form').find('input[name="lastName"]').clear().type(name);
cy.getByTestId('save-settings-button').click();
workflowPage.getters
.errorToast()
.should('contain', 'Malicious firstName | Malicious lastName');
workflowPage.getters.errorToast().find('.el-notification__closeBtn').click();
errorToast().should('contain', 'Malicious firstName | Malicious lastName');
errorToast().find('.el-notification__closeBtn').click();
});
});
});
9 changes: 5 additions & 4 deletions cypress/e2e/39-import-workflow.cy.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { WorkflowPage } from '../pages';
import { MessageBox as MessageBoxClass } from '../pages/modals/message-box';
import { errorToast, successToast } from '../pages/notifications';

const workflowPage = new WorkflowPage();
const messageBox = new MessageBoxClass();
Expand Down Expand Up @@ -29,9 +30,9 @@ describe('Import workflow', () => {

workflowPage.getters.canvasNodes().should('have.length', 4);

workflowPage.getters.errorToast().should('not.exist');
errorToast().should('not.exist');

workflowPage.getters.successToast().should('not.exist');
successToast().should('not.exist');
});

it('clicking outside modal should not show error toast', () => {
Expand All @@ -42,7 +43,7 @@ describe('Import workflow', () => {

cy.get('body').click(0, 0);

workflowPage.getters.errorToast().should('not.exist');
errorToast().should('not.exist');
});

it('canceling modal should not show error toast', () => {
Expand All @@ -52,7 +53,7 @@ describe('Import workflow', () => {
workflowPage.getters.workflowMenuItemImportFromURLItem().click();
messageBox.getters.cancel().click();

workflowPage.getters.errorToast().should('not.exist');
errorToast().should('not.exist');
});
});

Expand Down
Loading
Loading