From 92f7315f2304302b14346a2a1e754d52046afaee Mon Sep 17 00:00:00 2001 From: SchnapsterDog Date: Tue, 1 Mar 2022 12:18:47 +0100 Subject: [PATCH 001/155] N8N-3029 Add Node Type for Wokrflow Stickies/Notes --- packages/editor-ui/src/plugins/icons.ts | 2 + packages/nodes-base/nodes/Note/Note.node.json | 24 ++++++++ packages/nodes-base/nodes/Note/Note.node.ts | 58 +++++++++++++++++++ packages/nodes-base/package.json | 1 + 4 files changed, 85 insertions(+) create mode 100644 packages/nodes-base/nodes/Note/Note.node.json create mode 100644 packages/nodes-base/nodes/Note/Note.node.ts diff --git a/packages/editor-ui/src/plugins/icons.ts b/packages/editor-ui/src/plugins/icons.ts index 864f5cc9400ea..5e3a1b42a9d90 100644 --- a/packages/editor-ui/src/plugins/icons.ts +++ b/packages/editor-ui/src/plugins/icons.ts @@ -75,6 +75,7 @@ import { faSignInAlt, faSlidersH, faSpinner, + faStickyNote, faStop, faSun, faSync, @@ -167,6 +168,7 @@ addIcon(faServer); addIcon(faSignInAlt); addIcon(faSlidersH); addIcon(faSpinner); +addIcon(faStickyNote); addIcon(faStop); addIcon(faSun); addIcon(faSync); diff --git a/packages/nodes-base/nodes/Note/Note.node.json b/packages/nodes-base/nodes/Note/Note.node.json new file mode 100644 index 0000000000000..198639afaaa29 --- /dev/null +++ b/packages/nodes-base/nodes/Note/Note.node.json @@ -0,0 +1,24 @@ +{ + "node": "n8n-nodes-base.note", + "nodeVersion": "1.0", + "codexVersion": "1.0", + "categories": [ + "Core Nodes" + ], + "resources": { + "primaryDocumentation": [ + { + "url": "https://docs.n8n.io/nodes/n8n-nodes-base.note/" + } + ] + }, + "alias": [ + "Comments", + "Sticky" + ], + "subcategories": { + "Core Nodes": [ + "Helpers" + ] + } +} diff --git a/packages/nodes-base/nodes/Note/Note.node.ts b/packages/nodes-base/nodes/Note/Note.node.ts new file mode 100644 index 0000000000000..c6aba541c7051 --- /dev/null +++ b/packages/nodes-base/nodes/Note/Note.node.ts @@ -0,0 +1,58 @@ +import { IExecuteFunctions } from 'n8n-core'; +import { + INodeExecutionData, + INodeType, + INodeTypeDescription, +} from 'n8n-workflow'; + + +export class Note implements INodeType { + description: INodeTypeDescription = { + displayName: 'Note', + name: 'note', + icon: 'fa:sticky-note', + group: ['input'], + version: 1, + description: 'Leave notes and organize your flow. Supports markdown.', + defaults: { + name: 'Note', + color: '#FFD233', + }, + inputs: ['main'], + outputs: ['main'], + properties: [ + { + displayName: 'Content', + name: 'content', + type: 'string', + required: true, + typeOptions: { + rows: 4, + }, + default: 'I am a heading. This is how you bold text and this is how you create an inline link.', + description: 'Content', + }, + { + displayName: 'Height', + name: 'height', + type: 'number', + required: true, + default: 160, + description: 'Height', + }, + { + displayName: 'Width', + name: 'width', + type: 'number', + required: true, + default: 220, + description: 'Width', + }, + ], + }; + + execute(this: IExecuteFunctions): Promise { + const items = this.getInputData(); + return this.prepareOutputData(items); + } +} diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index ad3e79ebdc845..ce5f4dad8b687 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -543,6 +543,7 @@ "dist/nodes/Netlify/NetlifyTrigger.node.js", "dist/nodes/NextCloud/NextCloud.node.js", "dist/nodes/NocoDB/NocoDB.node.js", + "dist/nodes/Note/Note.node.js", "dist/nodes/NoOp/NoOp.node.js", "dist/nodes/Onfleet/Onfleet.node.js", "dist/nodes/Onfleet/OnfleetTrigger.node.js", From d2b42c28f485eaa44380b5ae9bf7df561d0c7b46 Mon Sep 17 00:00:00 2001 From: SchnapsterDog Date: Tue, 1 Mar 2022 16:39:48 +0100 Subject: [PATCH 002/155] N8N-3029 Update Content, Update Aliasses --- packages/nodes-base/nodes/Note/Note.node.json | 8 +------- packages/nodes-base/nodes/Note/Note.node.ts | 6 +++--- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/packages/nodes-base/nodes/Note/Note.node.json b/packages/nodes-base/nodes/Note/Note.node.json index 198639afaaa29..af328bc27e557 100644 --- a/packages/nodes-base/nodes/Note/Note.node.json +++ b/packages/nodes-base/nodes/Note/Note.node.json @@ -5,15 +5,9 @@ "categories": [ "Core Nodes" ], - "resources": { - "primaryDocumentation": [ - { - "url": "https://docs.n8n.io/nodes/n8n-nodes-base.note/" - } - ] - }, "alias": [ "Comments", + "Notes", "Sticky" ], "subcategories": { diff --git a/packages/nodes-base/nodes/Note/Note.node.ts b/packages/nodes-base/nodes/Note/Note.node.ts index c6aba541c7051..bca0d54168e05 100644 --- a/packages/nodes-base/nodes/Note/Note.node.ts +++ b/packages/nodes-base/nodes/Note/Note.node.ts @@ -18,8 +18,8 @@ export class Note implements INodeType { name: 'Note', color: '#FFD233', }, - inputs: ['main'], - outputs: ['main'], + inputs: [], + outputs: [], properties: [ { displayName: 'Content', @@ -29,7 +29,7 @@ export class Note implements INodeType { typeOptions: { rows: 4, }, - default: 'I am a heading. This is how you bold text and this is how you create an inline link.', + default: '##I am a heading.\nThis is how you *bold* text and this is how you create an [inline link](https://n8n.io/)', description: 'Content', }, { From 7c78f1d0d140b996f3bdd22f9b3574b703f91301 Mon Sep 17 00:00:00 2001 From: SchnapsterDog Date: Wed, 9 Mar 2022 12:10:17 +0100 Subject: [PATCH 003/155] N8N-3030 Created N8N Sticky Component in Design System --- .../src/components/N8nMarkdown/Markdown.vue | 49 +++++++++- .../components/N8nSticky/Sticky.stories.js | 54 +++++++++++ .../src/components/N8nSticky/Sticky.vue | 95 +++++++++++++++++++ .../src/components/N8nSticky/index.js | 3 + .../design-system/src/components/index.js | 2 + packages/editor-ui/src/plugins/components.ts | 2 + packages/nodes-base/nodes/Note/Note.node.ts | 2 +- 7 files changed, 205 insertions(+), 2 deletions(-) create mode 100644 packages/design-system/src/components/N8nSticky/Sticky.stories.js create mode 100644 packages/design-system/src/components/N8nSticky/Sticky.vue create mode 100644 packages/design-system/src/components/N8nSticky/index.js diff --git a/packages/design-system/src/components/N8nMarkdown/Markdown.vue b/packages/design-system/src/components/N8nMarkdown/Markdown.vue index b94d93ac3c30a..1c7aa394304f8 100644 --- a/packages/design-system/src/components/N8nMarkdown/Markdown.vue +++ b/packages/design-system/src/components/N8nMarkdown/Markdown.vue @@ -1,6 +1,6 @@