From 4b1bcc17a231e5d4752413f2b33a60a27c8b8554 Mon Sep 17 00:00:00 2001 From: ricardo Date: Fri, 12 Nov 2021 10:43:39 -0500 Subject: [PATCH 1/4] :bug: Fixes issue that set content-type when downloading a file --- packages/nodes-base/nodes/HttpRequest.node.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/nodes-base/nodes/HttpRequest.node.ts b/packages/nodes-base/nodes/HttpRequest.node.ts index 6048595d2f..57db60f51b 100644 --- a/packages/nodes-base/nodes/HttpRequest.node.ts +++ b/packages/nodes-base/nodes/HttpRequest.node.ts @@ -864,7 +864,9 @@ export class HttpRequest implements INodeType { if (requestOptions.headers === undefined) { requestOptions.headers = {}; } - requestOptions.headers['Content-Type'] = 'application/json'; + if (['POST', 'PUT', 'PATCH'].includes(requestMethod)) { + requestOptions.headers['Content-Type'] = 'application/json'; + } } } else if (options.bodyContentType === 'raw') { requestOptions.json = false; @@ -918,7 +920,7 @@ export class HttpRequest implements INodeType { }; } this.sendMessageToUI(sendRequest); - } catch (e) {} + } catch (e) { } // Now that the options are all set make the actual http request if (oAuth1Api !== undefined) { From 57147910a91c3bc7789fec49f565da8226a54694 Mon Sep 17 00:00:00 2001 From: Harshil Agrawal Date: Thu, 18 Nov 2021 16:50:34 +0100 Subject: [PATCH 2/4] :bug: Fix One Simple API codex file (#2451) --- packages/nodes-base/nodes/OneSimpleApi/OneSimpleApi.node.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/OneSimpleApi/OneSimpleApi.node.json b/packages/nodes-base/nodes/OneSimpleApi/OneSimpleApi.node.json index bd85e8ee3b..ac863a7e88 100644 --- a/packages/nodes-base/nodes/OneSimpleApi/OneSimpleApi.node.json +++ b/packages/nodes-base/nodes/OneSimpleApi/OneSimpleApi.node.json @@ -8,7 +8,7 @@ "resources": { "credentialDocumentation": [ { - "url": "https://docs.n8n.io/credentials/OneSimpleAPI" + "url": "https://docs.n8n.io/credentials/oneSimpleApi/" } ], "primaryDocumentation": [ From 0c6af9fd952a0d380527441b587234da0a1c9266 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Fri, 19 Nov 2021 07:38:07 +0100 Subject: [PATCH 3/4] :zap: Pin @rudderstack/rudder-sdk-node to 1.0.6 in cli package to fix build issue --- packages/cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 070ab83f9f..8dc2ef1da8 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -83,7 +83,7 @@ "dependencies": { "@oclif/command": "^1.5.18", "@oclif/errors": "^1.2.2", - "@rudderstack/rudder-sdk-node": "^1.0.2", + "@rudderstack/rudder-sdk-node": "1.0.6", "@types/json-diff": "^0.5.1", "@types/jsonwebtoken": "^8.5.2", "basic-auth": "^2.0.1", From d8598b01269f56de99557b33a14bbb0b4d6f8f4a Mon Sep 17 00:00:00 2001 From: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> Date: Fri, 19 Nov 2021 10:17:13 +0100 Subject: [PATCH 4/4] :sparkles: Workflow canvas revamp (#2388) * bring back overrides * fix input output label positions * simply update label positions * refactor a bunch * update min x to show items * hide overlay on connection * only delete target connection, add maximum to push nodes out * rename const * rename const * set new insert position * fix insert behavior * update position handling * show arrow along with label * update connector * set endpoint styles * update pattern * push nodes up / down in case of if node * set position in switch * only one action at a time * add custom flow chart type * select start node by default when opening new workflow * add enter delay * fix delete bug * change connection type * add offset for if/switch/merge * fix gap * fix drag issue * implement new states * update disabled state * add selected state * make selects faster * update positioning * truncate when selected * remove offset for actions * fix icon scaling * refactor js plumb * fix looping behavior at close distance * lock version * change background to dots * update endpoints styling * increase spacing * udpate node z-index * fix output label positions * fix output label positions * reset location * add label offset * update border radius * fix height issue * fix parallaxing issue * fix zoomout issue * add success z-index * clean up js file * add package lock * fix z-index bug * update dot grid * update zoom level * set values, increase grid size * fix drop position * prevent duplicate connections * fix stub * use localstorage overrides for colors * add colors to system * revert no longer needed changes * revert no longer needed changes * add canvas colors * add canvas colors * use variable for id * force type * refactor helpers * add label constants * refactor func * refactor * 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 * 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 * address comments * refactor * refactor func * :zap: Add full license text to N8nCustomConnectorType.js Co-authored-by: Jan Oberhauser --- .../src/styleguide/border.stories.mdx | 2 +- .../src/styleguide/colors.stories.mdx | 17 +- packages/design-system/theme/src/_tokens.scss | 46 + packages/editor-ui/src/Interface.ts | 69 +- packages/editor-ui/src/components/Node.vue | 344 +++-- .../src/components/NodeCredentials.vue | 2 +- .../editor-ui/src/components/NodeIcon.vue | 85 +- .../editor-ui/src/components/NodeSettings.vue | 28 +- .../editor-ui/src/components/NodeWebhooks.vue | 2 +- packages/editor-ui/src/components/RunData.vue | 5 +- packages/editor-ui/src/components/helpers.ts | 5 + .../src/components/mixins/mouseSelect.ts | 32 +- .../src/components/mixins/moveNodeWorkflow.ts | 28 +- .../src/components/mixins/nodeBase.ts | 237 +--- .../src/components/mixins/nodeHelpers.ts | 1 + .../src/components/mixins/showMessage.ts | 3 +- .../src/components/mixins/workflowHelpers.ts | 15 +- .../src/components/mixins/workflowRun.ts | 1 + packages/editor-ui/src/constants.ts | 1 + .../editor-ui/src/n8n-theme-variables.scss | 2 - packages/editor-ui/src/n8n-theme.scss | 3 +- .../src/plugins/N8nCustomConnectorType.js | 779 +++++++++++ packages/editor-ui/src/store.ts | 36 +- packages/editor-ui/src/views/NodeView.vue | 1229 +++++++++-------- packages/editor-ui/src/views/canvasHelpers.ts | 725 ++++++++++ packages/editor-ui/src/views/helpers.ts | 85 -- 26 files changed, 2720 insertions(+), 1062 deletions(-) create mode 100644 packages/editor-ui/src/plugins/N8nCustomConnectorType.js create mode 100644 packages/editor-ui/src/views/canvasHelpers.ts delete mode 100644 packages/editor-ui/src/views/helpers.ts diff --git a/packages/design-system/src/styleguide/border.stories.mdx b/packages/design-system/src/styleguide/border.stories.mdx index d5a83e064d..b7f0785f33 100644 --- a/packages/design-system/src/styleguide/border.stories.mdx +++ b/packages/design-system/src/styleguide/border.stories.mdx @@ -16,7 +16,7 @@ import VariableTable from './VariableTable.vue'; {{ - template: ``, + template: ``, components: { VariableTable, }, diff --git a/packages/design-system/src/styleguide/colors.stories.mdx b/packages/design-system/src/styleguide/colors.stories.mdx index 16e372bcd3..7090bbde3f 100644 --- a/packages/design-system/src/styleguide/colors.stories.mdx +++ b/packages/design-system/src/styleguide/colors.stories.mdx @@ -44,7 +44,7 @@ import ColorCircles from './ColorCircles.vue'; {{ - template: ``, + template: ``, components: { ColorCircles, }, @@ -109,7 +109,7 @@ import ColorCircles from './ColorCircles.vue'; {{ - template: ``, + template: ``, components: { ColorCircles, }, @@ -129,3 +129,16 @@ import ColorCircles from './ColorCircles.vue'; }} + +## Canvas + + + + {{ + template: ``, + components: { + ColorCircles, + }, + }} + + diff --git a/packages/design-system/theme/src/_tokens.scss b/packages/design-system/theme/src/_tokens.scss index c2c836db90..24e245a344 100644 --- a/packages/design-system/theme/src/_tokens.scss +++ b/packages/design-system/theme/src/_tokens.scss @@ -75,6 +75,15 @@ var(--color-success-tint-2-l) ); + --color-success-light-h: 150; + --color-success-light-s: 54%; + --color-success-light-l: 70%; + --color-success-light: hsl( + var(--color-success-light-h), + var(--color-success-light-s), + var(--color-success-light-l) + ); + --color-warning-h: 36; --color-warning-s: 77%; --color-warning-l: 57%; @@ -187,6 +196,24 @@ var(--color-text-xlight-l) ); + --color-foreground-xdark-h: 220; + --color-foreground-xdark-s: 7.4%; + --color-foreground-xdark-l: 52.5%; + --color-foreground-xdark: hsl( + var(--color-foreground-xdark-h), + var(--color-foreground-xdark-s), + var(--color-foreground-xdark-l) + ); + + --color-foreground-dark-h: 228; + --color-foreground-dark-s: 9.6%; + --color-foreground-dark-l: 79.6%; + --color-foreground-dark: hsl( + var(--color-foreground-dark-h), + var(--color-foreground-dark-s), + var(--color-foreground-dark-l) + ); + --color-foreground-base-h: 220; --color-foreground-base-s: 20%; --color-foreground-base-l: 88.2%; @@ -259,6 +286,25 @@ var(--color-background-xlight-l) ); + --color-canvas-dot-h: 204; + --color-canvas-dot-s: 15.6%; + --color-canvas-dot-l: 87.5%; + --color-canvas-dot: hsl( + var(--color-canvas-dot-h), + var(--color-canvas-dot-s), + var(--color-canvas-dot-l) + ); + + --color-canvas-background-h: 260; + --color-canvas-background-s: 100%; + --color-canvas-background-l: 99.4%; + --color-canvas-background: hsl( + var(--color-canvas-background-h), + var(--color-canvas-background-s), + var(--color-canvas-background-l) + ); + + --border-radius-xlarge: 12px; --border-radius-large: 8px; --border-radius-base: 4px; --border-radius-small: 2px; diff --git a/packages/editor-ui/src/Interface.ts b/packages/editor-ui/src/Interface.ts index 02fe67ec4f..7332f35480 100644 --- a/packages/editor-ui/src/Interface.ts +++ b/packages/editor-ui/src/Interface.ts @@ -22,32 +22,61 @@ import { WorkflowExecuteMode, } from 'n8n-workflow'; -import { - PaintStyle, -} from 'jsplumb'; - declare module 'jsplumb' { + interface PaintStyle { + stroke?: string; + fill?: string; + strokeWidth?: number; + outlineStroke?: string; + outlineWidth?: number; + } + interface Anchor { lastReturnValue: number[]; } interface Connection { + __meta?: { + sourceNodeName: string, + sourceOutputIndex: number, + targetNodeName: string, + targetOutputIndex: number, + }; + canvas?: HTMLElement; + connector?: { + setTargetEndpoint: (endpoint: Endpoint) => void; + resetTargetEndpoint: () => void; + bounds: { + minX: number; + maxX: number; + minY: number; + maxY: number; + } + }; + // bind(event: string, (connection: Connection): void;): void; // tslint:disable-line:no-any - bind(event: string, callback: Function): void; // tslint:disable-line:no-any + bind(event: string, callback: Function): void; removeOverlay(name: string): void; removeOverlays(): void; setParameter(name: string, value: any): void; // tslint:disable-line:no-any setPaintStyle(arg0: PaintStyle): void; addOverlay(arg0: any[]): void; // tslint:disable-line:no-any setConnector(arg0: any[]): void; // tslint:disable-line:no-any + getUuids(): [string, string]; } interface Endpoint { + __meta?: { + nodeName: string, + index: number, + }; getOverlay(name: string): any; // tslint:disable-line:no-any } interface Overlay { setVisible(visible: boolean): void; + setLocation(location: number): void; + canvas?: HTMLElement; } interface OnConnectionBindInfo { @@ -66,18 +95,14 @@ export interface IEndpointOptions { dragProxy?: any; // tslint:disable-line:no-any endpoint?: string; endpointStyle?: object; + endpointHoverStyle?: object; isSource?: boolean; isTarget?: boolean; maxConnections?: number; overlays?: any; // tslint:disable-line:no-any parameters?: any; // tslint:disable-line:no-any uuid?: string; -} - -export interface IConnectionsUi { - [key: string]: { - [key: string]: IEndpointOptions; - }; + enabled?: boolean; } export interface IUpdateInformation { @@ -95,20 +120,16 @@ export interface INodeUpdatePropertiesInformation { }; } -export type XYPositon = [number, number]; +export type XYPosition = [number, number]; export type MessageType = 'success' | 'warning' | 'info' | 'error'; export interface INodeUi extends INode { - position: XYPositon; + position: XYPosition; color?: string; notes?: string; issues?: INodeIssues; - _jsPlumb?: { - endpoints?: { - [key: string]: IEndpointOptions[]; - }; - }; + name: string; } export interface INodeTypesMaxCount { @@ -604,7 +625,7 @@ export interface IRootState { lastSelectedNodeOutputIndex: number | null; nodeIndex: Array; nodeTypes: INodeTypeDescription[]; - nodeViewOffsetPosition: XYPositon; + nodeViewOffsetPosition: XYPosition; nodeViewMoveInProgress: boolean; selectedNodes: INodeUi[]; sessionId: string; @@ -670,5 +691,13 @@ export interface IRestApiContext { export interface IZoomConfig { scale: number; - offset: XYPositon; + offset: XYPosition; } + +export interface IBounds { + minX: number; + minY: number; + maxX: number; + maxY: number; +} + diff --git a/packages/editor-ui/src/components/Node.vue b/packages/editor-ui/src/components/Node.vue index adabe3b3f1..3f806432c2 100644 --- a/packages/editor-ui/src/components/Node.vue +++ b/packages/editor-ui/src/components/Node.vue @@ -1,25 +1,35 @@