From a48bff2eee9fc786744ecedb122507e0ca76b729 Mon Sep 17 00:00:00 2001 From: Elvina Valieva Date: Fri, 3 Dec 2021 13:19:23 +0100 Subject: [PATCH 01/20] :zap: Survey updates (#2495) * feat: update survey * feat: appearance tweaks * chore: hardcode survey showing * chore: fix survey options * feat: show survey for users with workflows * chore: take personalization into account * chore: revert survey conditions * chore: remove select override * chore: remove transfer component from editor * chore: more expressive flag name * :zap: Minor improvements Co-authored-by: Jan Oberhauser --- packages/editor-ui/src/Interface.ts | 3 +- .../src/components/PersonalizationModal.vue | 174 ++++++++++++------ packages/editor-ui/src/constants.ts | 16 +- packages/editor-ui/src/modules/helper.ts | 4 +- packages/editor-ui/src/modules/settings.ts | 1 + packages/editor-ui/src/n8n-theme.scss | 23 --- packages/editor-ui/src/plugins/components.ts | 2 - 7 files changed, 140 insertions(+), 83 deletions(-) diff --git a/packages/editor-ui/src/Interface.ts b/packages/editor-ui/src/Interface.ts index 7332f35480..cef30c8f98 100644 --- a/packages/editor-ui/src/Interface.ts +++ b/packages/editor-ui/src/Interface.ts @@ -458,7 +458,7 @@ export interface IVersionNotificationSettings { infoUrl: string; } -export type IPersonalizationSurveyKeys = 'companySize' | 'codingSkill' | 'workArea' | 'otherWorkArea'; +export type IPersonalizationSurveyKeys = 'codingSkill' | 'companyIndustry' | 'companySize' | 'otherCompanyIndustry' | 'otherWorkArea' | 'workArea'; export type IPersonalizationSurveyAnswers = { [key in IPersonalizationSurveyKeys]: string | null @@ -700,4 +700,3 @@ export interface IBounds { maxX: number; maxY: number; } - diff --git a/packages/editor-ui/src/components/PersonalizationModal.vue b/packages/editor-ui/src/components/PersonalizationModal.vue index dc4be6efbf..37727a4ccc 100644 --- a/packages/editor-ui/src/components/PersonalizationModal.vue +++ b/packages/editor-ui/src/components/PersonalizationModal.vue @@ -18,23 +18,52 @@ Look out for things marked with a ✨. They are personalized to make n8n more relevant to you.
- - - + + + + + + + + + + + + + - + - + + + - - - - - - - - - +
+ + + + + + + + + + + + + + @@ -99,6 +122,8 @@ /> + +
@@ -324,7 +324,14 @@ export default mixins( return false; }, convertToDisplayDate, - displayExecution (execution: IExecutionShortResponse) { + displayExecution (execution: IExecutionShortResponse, e: PointerEvent) { + if (e.metaKey || e.ctrlKey) { + const route = this.$router.resolve({name: 'ExecutionById', params: {id: execution.id}}); + window.open(route.href, '_blank'); + + return; + } + this.$router.push({ name: 'ExecutionById', params: { id: execution.id }, diff --git a/packages/editor-ui/src/components/WorkflowOpen.vue b/packages/editor-ui/src/components/WorkflowOpen.vue index 062d3a7167..81d08761c9 100644 --- a/packages/editor-ui/src/components/WorkflowOpen.vue +++ b/packages/editor-ui/src/components/WorkflowOpen.vue @@ -134,11 +134,18 @@ export default mixins( this.filterTagIds.push(tagId); } }, - async openWorkflow (data: IWorkflowShortResponse, column: any) { // tslint:disable-line:no-any + async openWorkflow (data: IWorkflowShortResponse, column: any, cell: any, e: PointerEvent) { // tslint:disable-line:no-any if (column.label !== 'Active') { const currentWorkflowId = this.$store.getters.workflowId; + if (e.metaKey || e.ctrlKey) { + const route = this.$router.resolve({name: 'NodeViewExisting', params: {name: data.id}}); + window.open(route.href, '_blank'); + + return; + } + if (data.id === currentWorkflowId) { this.$showMessage({ title: 'Already open', From 2081aedc814f345238edb94ab8b504e48acf8d64 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Fri, 3 Dec 2021 15:08:38 +0100 Subject: [PATCH 03/20] :bug: Improve expression security --- packages/workflow/src/Expression.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/workflow/src/Expression.ts b/packages/workflow/src/Expression.ts index e955df4170..370e5b0341 100644 --- a/packages/workflow/src/Expression.ts +++ b/packages/workflow/src/Expression.ts @@ -114,11 +114,11 @@ export class Expression { // @ts-ignore data.document = {}; + // @ts-ignore + data.constructor = {}; // Execute the expression try { - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call - // tmpl.tmpl('{{this.Promise=global.Promise;global=this;}}', data); // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call const returnValue = tmpl.tmpl(parameterValue, data); if (typeof returnValue === 'function') { From d62c7a7f3cda127e4a0e5dc4bbd2516ecce86812 Mon Sep 17 00:00:00 2001 From: Anuj Kapoor Date: Fri, 3 Dec 2021 20:07:04 +0530 Subject: [PATCH 04/20] :bug: Add error pop up and redirection for non existing workflow IDs (#2516) * :bug: Add error pop up and redirection for non existing workflow IDs * Remove code comments --- packages/editor-ui/src/views/NodeView.vue | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/editor-ui/src/views/NodeView.vue b/packages/editor-ui/src/views/NodeView.vue index de33d7e3bc..6a131c4e06 100644 --- a/packages/editor-ui/src/views/NodeView.vue +++ b/packages/editor-ui/src/views/NodeView.vue @@ -1633,11 +1633,19 @@ export default mixins( if (workflowId !== null) { const workflow = await this.restApi().getWorkflow(workflowId); if (!workflow) { - throw new Error('Could not find workflow'); + this.$router.push({ + name: "NodeViewNew", + }); + this.$showMessage({ + title: 'Error', + message: 'Could not find workflow', + type: 'error', + }); + } else { + this.$titleSet(workflow.name, 'IDLE'); + // Open existing workflow + await this.openWorkflow(workflowId); } - this.$titleSet(workflow.name, 'IDLE'); - // Open existing workflow - await this.openWorkflow(workflowId); } else { // Create new workflow await this.newWorkflow(); From 76c63790b43ec0d50e092390e78280562100aa78 Mon Sep 17 00:00:00 2001 From: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> Date: Fri, 3 Dec 2021 18:53:55 +0100 Subject: [PATCH 05/20] :sparkles: Add plus endpoint (#2450) * fix * refactor * clean up css * refactor setzoom level * refactor * refactor * refactor func * remove scope * remove localstorage caching * clean up imports * update zero case * add delete connection * update selected state * add base type, remove straight line * add stub offset back * rename param * add label offset * update font size of items * move up label * fix error state while executing * disrespect stubs * check for errors * refactor position * clean up extra space * make entire node connectable * Revert "make entire node connectable" e304f7c5b8ff1b41268450c60ca4bc3b2ada5d4a * always show border * add border to zoom buttons * update spacing * update colors * allow connecting to entire node * fix pull conn active * two line names * apply select to all lines * increase input margin * override target pos * reset conn after pull * fix types * update orientation * fix up connectors snapping * hide arrow on pull * update overrides for connectors * change text * update pull colors * set to 1 line when selected * fix executions bug * build * refactor node component * remove comment * refactor more * remove prop * fix build issue * fix input drag bug in executions * reset offset * update select background * handle issue when endpoints are not set * fix connection aborted issue * add try catch to help show errors * wrap bind with try/catch * set default styles * reset pos despite zoom * add more checks * clean up impl * update icon * handle unknown types * hide items on init * fix importing unknown types with credentials * change opacity * push up item label * update color * update label class and colors * add to drop distance * fix z-index to match node * disable eslint * fix lasso tool selection * update background color * update waiting state * update tooltip positions * update wait node border * fix selection bug mostly * if selected, move above other nodes * add line through disabled nodes * remove node color option * move label above connection * success color for line through * update options index * hide waiting icon when disabled * fix gmail icon * refactor icons * clear execution data on disable/delete * fix selected node * fix executing behavior * optional __meta * set grid size * remove default color * remove node color * add comments * comments * add comments * remove empty space * update comment * refactor uuids * fix type issue * Revert "fix type issue" 9523b34f9604f75253ae0631f29fc27267a99d78 * Revert "fix type issue" 9523b34f9604f75253ae0631f29fc27267a99d78 * Revert "refactor uuids" 07f6848065cb9a98475fddb8330846106f9e70ad * fix build issues * refactor * update uuid * child nodes * skip nodes behind when pushing in loop * shift output icon for switch node * don't show output if waiting * waiting on init * build * change to bezier * implement plus * revert connector change * add bezier type * fix snapping * clean up impl * refactor func * make const * rename type * refactor to simplify * Revert "refactor to simplify" 2db0ed504c752c33de975370d86a83a04ffcda14 * enable flowchart mode * clean up flowchart type * refactor type * merge types * configure curviness * set in localstorage * fix straight line arrow bug * show arrow when pulling * refactor / simplify * fix target gap in bezier * refactor target gap * add comments * add comment * fix dragging connections * fix bug when moving connection * update comment * rename file * update values * update minor * update straight line box * clean up conn types * clean up z-indexes * move color filters to node icon * update background color * update to use grid size value * fix endpoint offsets * set yspan range lower * remove overlays when moving conn * prevent unwanted connections * fix messed up connections * remove console log * clear execution issues on workflow run * update corner radius * fix drag/delete bug * increase offset * update disabled state * hide if endpoint has conn * node insert on click * simplify impl * fix z-indexes * add drop hover message * address comments * refactor * refactor func * remove drop conn overlay * update messagE * update colors * remove console log * rebuild impl * add stalk * fix disabled state * fix dragging bug * remove node selection * disable plus in executions * add success output to talk * add success output * set output * fix bug * fix switch size * update size for 3 output nodes * update loops * fix bug when node is renamed * set final values * update loop behavior * update comment * hide output labels on multi outputs * center output * fix flicker when deleting nodes * fix dragging space * increase stalk if if * more type checks * rename event source * rename event source * support touch when dragging * offset center * center plus * fix repaint behavior * remove extending output * add offset to switch * fix merge node bug * rename endpoint * refactor css, fix merge bug * fix unrelated issues * space out * remove flowchart type * rename constant key * clean up css * rename var * fix more type issues * update types * fix spacing * simplify vertical offset * refactor css * add license * update css * clean up scss * update to use css var * clean up code * update params * show message * fix plus position * fix merge node bugs * hide box when not dragging and hidden * fix potential issue * address comments --- packages/editor-ui/src/Interface.ts | 12 + packages/editor-ui/src/components/Node.vue | 106 +++- .../src/components/mixins/nodeBase.ts | 53 +- packages/editor-ui/src/constants.ts | 1 + .../editor-ui/src/plugins/PlusEndpointType.js | 495 ++++++++++++++++++ packages/editor-ui/src/store.ts | 2 +- packages/editor-ui/src/views/NodeView.vue | 93 +++- packages/editor-ui/src/views/canvasHelpers.ts | 62 ++- 8 files changed, 757 insertions(+), 67 deletions(-) create mode 100644 packages/editor-ui/src/plugins/PlusEndpointType.js diff --git a/packages/editor-ui/src/Interface.ts b/packages/editor-ui/src/Interface.ts index cef30c8f98..2518f1bb58 100644 --- a/packages/editor-ui/src/Interface.ts +++ b/packages/editor-ui/src/Interface.ts @@ -66,11 +66,22 @@ declare module 'jsplumb' { } interface Endpoint { + endpoint: any; // tslint:disable-line:no-any + elementId: string; __meta?: { nodeName: string, + nodeId: string, index: number, + totalEndpoints: number; }; + getUuid(): string; getOverlay(name: string): any; // tslint:disable-line:no-any + repaint(params?: object): void; + } + + interface N8nPlusEndpoint extends Endpoint { + setSuccessOutput(message: string): void; + clearSuccessOutput(): void; } interface Overlay { @@ -103,6 +114,7 @@ export interface IEndpointOptions { parameters?: any; // tslint:disable-line:no-any uuid?: string; enabled?: boolean; + cssClass?: string; } export interface IUpdateInformation { diff --git a/packages/editor-ui/src/components/Node.vue b/packages/editor-ui/src/components/Node.vue index 3c0df1ed85..96f57696e6 100644 --- a/packages/editor-ui/src/components/Node.vue +++ b/packages/editor-ui/src/components/Node.vue @@ -1,5 +1,5 @@