Add Templates (#2720)

* Templates Bugs / Fixed Various Bugs / Multiply Api Request, Carousel Gradient, Core Nodes Filters ...

* Updated MainSidebar Paddings

* N8N-Templates Bugfixing - Remove Unnecesairy Icon (Shape), Refatctor infiniteScrollEnabled Prop + updated infiniterScroll functinality

* N8N-2853 Fixed Carousel Arrows Bug after Cleaning the SearchBar

* fix telemetry init

* fix search tracking issues

* N8N-2853 Created FilterTemplateNode Constant Array, Filter PlayButton and WebhookRespond from Nodes, Added Box for showing more nodes inside TemplateList, Updated NewWorkflowButton to primary, Fixed Markdown issue with Code

* N8N-2853 Removed Placeholder if Workflows Or Collections are not found, Updated the Logic

* fix telemetry events

* clean up session id

* update user inserted event

* N8N-2853 Fixed Categories to Moving if the names are long

* Add todos

* Update Routes on loading

* fix spacing

* Update Border Color

* Update Border Readius

* fix filter fn

* fix constant, console error

* N8N-2853 PR Fixes, Refactoring, Removing unnecesairy code ..

* N8N-2853 PR Fixes - Editor-ui Fixes, Refactoring, Removing Dead Code ...

* N8N-2853 Refactor Card to LongCard

* clean up spacing, replace css var

* clean up spacing

* set categories as optional in node

* replace vars

* refactor store

* remove unnesssary import

* fix error

* fix templates view to start

* add to cache

* fix coll view data

* fix categories

* fix category event

* fix collections carousel

* fix initial load and search

* fix infinite load

* fix query param

* fix scrolling issues

* fix scroll to top

* fix search

* fix collections search

* fix navigation bug

* rename view

* update package lock

* rename workflow view

* rename coll view

* update routes

* add wrapper component

* set session id

* fix search tracking

* fix session tracking

* remove deleted mutation

* remove check for unsupported nodes

* refactor filters

* lazy load template

* clean up types

* refactor infinte scroll

* fix end of search

* Fix spacing

* fix coll loading

* fix types

* fix coll view list

* fix navigation

* rename types

* rename state

* fix search responsiveness

* fix coll view spacing

* fix search view spacing

* clean up views

* set background color

* center page not vert

* fix workflow view

* remove import

* fix background color

* fix background

* clean props

* clean up imports

* refactor button

* update background color

* fix spacing issue

* rename event

* update telemetry event

* update endpoints, add loading view, check for endpoint health

* remove conolse log

* N8N-2853 Fixed Menu Items Padding

* replace endpoints

* fix type issues

* fix categories

* N8N-2853 Fixed ParameterInput Placeholder after ElementUI Upgrade

* update createdAt

*  Fix placeholder in creds config modal

* ✏️ Adjust docstring to `credText` placeholder version

* N8N-2853 Optimized

* N8N-2853 Optimized code

*  Add deployment type to FE settings

*  Add deployment type to interfaces

* N8N-2853 Removed Animated prop from components

*  Add deployment type to store module

*  Create hiring banner

*  Display hiring banner

*  Undo unrelated change

* N8N-2853 Refactor TemplateFilters

*  Fix indentation

* N8N-2853 Reorder items / TemplateList

* 👕 Fix lint

* N8N-2853 Refactor TemplateFilters Component

* N8N-2853 Reorder TemplateList

* refactor template card

* update timeout

* fix removelistener

* fix spacing

* split enabled from offline

* add spacing to go back

* N8N-2853 Fixed Screens for Tablet & Mobile

* N8N-2853 Update Stores Order

* remove image componet

* remove placeholder changes

* N8N-2853 Fixed Chinnese Placeholders for El Select Component that comes from the Library Upgrade

* N8N-2853 Fixed Vue Agile Console Warnings

* N8N-2853 Update Collection Route

* ✏️ Update jobs URL

* 🚚 Move logging to root component

*  Refactor `deploymentType` to `isInternalUser`

*  Improve syntax

* fix cut bug in readonly view

* N8N-3012 Fixed Details section in templates with lots of description, Fixed Mardown Block with overflox-x

* N8N-3012 Increased Font-size, Spacing and Line-height of the Categories Items

* N8N-3012 Fixed Vue-agile client width error on resize

* only delay redirect for root path

* N8N-3012 Fixed Carousel Arrows that Disappear

* N8N-3012 Make Loading Screen same color as Templates

* N8N-3012 Markdown renders inline block as block code

* add offline warning

* hide log from workflow iframe

* update text

* make search button larger

* N8N-3012 Categories / Tags extended all the way in details section

* load data in cred modals

* remove deleted message

* add external hook

* remove import

* update env variable description

* fix markdown width issue

* disable telemetry for demo, add session id to template pages

* fix telemetery bugs

* N8N-3012 Not found Collections/Wokrkflow

* N8N-3012 Checkboxes change order when categories are changed

* N8N-3012 Refactor SortedCategories inside TemplateFilters component

* fix firefox bug

* add telemetry requirements

* add error check

* N8N-3012 Update GoBackButton to check if Route History is present

* N8N-3012 Fixed WF Nodes Icons

* hide workflow screenshots

* remove unnessary mixins

* rename prop

* fix design a bit

* rename data

* clear workspace on destroy

* fix copy paste bug

* fix disabled state

* N8N-3012 Fixed Saving/Leave without saving Modal

* fix telemetry issue

* fix telemetry issues, error bug

* fix error notification

* disable workflow menu items on templates

* fix i18n elementui issue

* Remove Emit - NodeType from HoverableNodeIcon component

* TechnicalFixes: NavigateTo passed down as function should be helper

* TechnicalFixes: Update NavigateTo function

* TechnicalFixes: Add FilterCoreNodes directly as function

* check for empty connecitions

* fix titles

* respect new lines

* increase categories to be sliced

* rename prop

* onUseWorkflow

* refactor click event

* fix bug, refactor

* fix loading story

* add default

* fix styles at right level of abstraction

* add wrapper with width

* remove loading blocks component

* add story

* rename prop

* fix spacing

* refactor tag, add story

* move margin to container

* fix tag redirect, remove unnessary check

* make version optional

* rename view

* move from workflows to templates store

* remove unnessary change

* remove unnessary css

* rename component

* refactor collection card

* add boolean to prevent shrink

* clean up carousel

* fix redirection bug on save

* remove listeners to fix multiple listeners bug

* remove unnessary types

* clean up boolean set

* fix node select bug

* rename component

* remove unnessary class

* fix redirection bug

* remove unnessary error

* fix typo

* fix blockquotes, pre

* refactor markdown rendering

* remove console log

* escape markdown

* fix safari bug

* load active workflows to fix modal bug

* ⬆️ Update package-lock.json file

*  Add n8n version as header

Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com>
Co-authored-by: Mutasem <mutdmour@gmail.com>
Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
This commit is contained in:
Oliver Trajceski
2022-02-28 10:57:44 +01:00
committed by GitHub
parent 401e626a64
commit cfa91cda27
74 changed files with 4409 additions and 433 deletions

View File

@@ -37,6 +37,7 @@ import MessageBox from 'element-ui/lib/message-box';
import Message from 'element-ui/lib/message';
import Notification from 'element-ui/lib/notification';
import CollapseTransition from 'element-ui/lib/transitions/collapse-transition';
import VueAgile from 'vue-agile';
// @ts-ignore
import lang from 'element-ui/lib/locale/lang/en';
@@ -50,12 +51,16 @@ import {
N8nInput,
N8nInputLabel,
N8nInputNumber,
N8nLoading,
N8nHeading,
N8nMarkdown,
N8nMenu,
N8nMenuItem,
N8nSelect,
N8nSpinner,
N8nSquareButton,
N8nTags,
N8nTag,
N8nText,
N8nTooltip,
N8nOption,
@@ -71,12 +76,16 @@ Vue.use(N8nInfoTip);
Vue.use(N8nInput);
Vue.use(N8nInputLabel);
Vue.use(N8nInputNumber);
Vue.component('n8n-loading', N8nLoading);
Vue.use(N8nHeading);
Vue.component('n8n-markdown', N8nMarkdown);
Vue.use(N8nMenu);
Vue.use(N8nMenuItem);
Vue.use(N8nSelect);
Vue.use(N8nSpinner);
Vue.component('n8n-square-button', N8nSquareButton);
Vue.use(N8nTags);
Vue.use(N8nTag);
Vue.component('n8n-text', N8nText);
Vue.use(N8nTooltip);
Vue.use(N8nOption);
@@ -111,6 +120,7 @@ Vue.use(Badge);
Vue.use(Card);
Vue.use(ColorPicker);
Vue.use(Container);
Vue.use(VueAgile);
Vue.component(CollapseTransition.name, CollapseTransition);
@@ -141,7 +151,8 @@ Vue.prototype.$confirm = async (message: string, configOrTitle: string | ElMessa
roundButton: true,
cancelButtonClass: 'btn--cancel',
confirmButtonClass: 'btn--confirm',
showClose: false,
distinguishCancelAndClose: true,
showClose: config.showClose || false,
closeOnClickModal: false,
};

View File

@@ -131,7 +131,8 @@
},
"type": "Type",
"updated": "Updated",
"yourSavedCredentials": "Your saved credentials"
"yourSavedCredentials": "Your saved credentials",
"errorLoadingCredentials": "Error loading credentials"
},
"dataDisplay": {
"needHelp": "Need help?",
@@ -289,10 +290,10 @@
"message": "Are you sure that you want to delete '{workflowName}'?"
},
"workflowNew": {
"cancelButtonText": "",
"confirmButtonText": "Yes, switch workflows and forget changes",
"headline": "Switch workflows without saving?",
"message": "When you switch workflows without saving, your current changes will be lost."
"cancelButtonText": "Leave without saving",
"confirmButtonText": "Save",
"headline": "Save changes before leaving?",
"message": "If you don't save, you will lose your changes."
}
},
"credentials": "Credentials",
@@ -309,6 +310,7 @@
"importFromFile": "Import from File",
"importFromUrl": "Import from URL",
"new": "New",
"newTemplate": "New from template",
"open": "Open",
"prompt": {
"cancel": "@:reusableBaseText.cancel",
@@ -342,6 +344,7 @@
"title": "Execution stopped"
}
},
"templates": "Templates",
"workflows": "Workflows"
},
"multipleParameter": {
@@ -488,16 +491,16 @@
"addNode": "Add node",
"confirmMessage": {
"beforeRouteLeave": {
"cancelButtonText": "",
"confirmButtonText": "Yes, switch workflows and forget changes",
"headline": "Switch workflows without saving?",
"message": "When you switch workflows without saving, your current changes will be lost."
"cancelButtonText": "Leave without saving",
"confirmButtonText": "Save",
"headline": "Save changes before leaving?",
"message": "If you don't save, you will lose your changes."
},
"initView": {
"cancelButtonText": "",
"confirmButtonText": "Yes, switch workflows and forget changes",
"headline": "Switch workflows without saving?",
"message": "When you switch workflows without saving, your current changes will be lost."
"cancelButtonText": "Leave without saving",
"confirmButtonText": "Save",
"headline": "Save changes before leaving?",
"message": "If you don't save, you will lose your changes."
},
"receivedCopyPasteData": {
"cancelButtonText": "",
@@ -620,7 +623,8 @@
"refreshList": "Refresh List",
"removeExpression": "Remove Expression",
"resetValue": "Reset Value",
"selectDateAndTime": "Select date and time"
"selectDateAndTime": "Select date and time",
"select": "Select"
},
"parameterInputExpanded": {
"openDocs": "Open docs",
@@ -729,6 +733,14 @@
"saved": "Saved",
"saving": "Saving"
},
"settings": {
"errors": {
"connectionError": {
"title": "Error connecting to n8n",
"message": "Could not connect to server. <a onclick='window.location.reload(false);'>Refresh</a> to try again"
}
}
},
"showMessage": {
"cancel": "@:reusableBaseText.cancel",
"ok": "OK",
@@ -795,6 +807,38 @@
},
"notBeingUsed": "Not being used"
},
"template": {
"buttons": {
"goBackButton": "Go back",
"useThisWorkflowButton": "Use this workflow"
},
"details": {
"appsInTheWorkflow": "Apps in this workflow",
"appsInTheCollection": "This collection features",
"by": "by",
"categories": "Categories",
"created": "Created",
"details": "Details",
"times": "times",
"viewed": "Viewed"
}
},
"templates": {
"allCategories": "All Categories",
"categoriesHeading": "Categories",
"collection": "Collection",
"collections": "Collections",
"collectionsNotFound": "Collection could not be found",
"endResult": "Share your own useful workflows through your <a href='https://n8n.io/dashboard' target='_blank'>n8n.io account</a>",
"heading": "Workflow templates",
"newButton": "New blank workflow",
"noSearchResults": "Nothing found. Try adjusting your search to see more.",
"searchPlaceholder": "Search workflows",
"workflow": "Workflow",
"workflows": "Workflows",
"workflowsNotFound": "Workflow could not be found",
"connectionWarning": "⚠️ There was a problem fetching workflow templates. Check your internet connection."
},
"textEdit": {
"edit": "Edit"
},
@@ -898,10 +942,10 @@
"workflowOpen": {
"active": "Active",
"confirmMessage": {
"cancelButtonText": "",
"confirmButtonText": "Yes, switch workflows and forget changes",
"headline": "Switch workflows without saving?",
"message": "If you do this, your current changes will be lost."
"cancelButtonText": "Leave without saving",
"confirmButtonText": "Save",
"headline": "Save changes before leaving?",
"message": "If you don't save, you will lose your changes."
},
"created": "Created",
"name": "@:reusableBaseText.name",
@@ -915,7 +959,8 @@
"message": "This is the current workflow",
"title": "Workflow already open"
},
"updated": "Updated"
"updated": "Updated",
"couldNotLoadActiveWorkflows": "Could not load active workflows"
},
"workflowRun": {
"noActiveConnectionToTheServer": "Lost connection to the server",
@@ -1009,5 +1054,15 @@
"yourWorkflowWillNowRegularlyCheck": "Your workflow will now regularly check {serviceName} for events and trigger executions for them.",
"yourWorkflowWillNowListenForEvents": "Your workflow will now listen for events from {serviceName} and trigger executions.",
"gotIt": "Got it"
},
"workflowPreview": {
"showError": {
"previewError": {
"message": "Unable to preview workflow",
"title": "Preview error"
},
"missingWorkflow": "Missing workflow",
"arrayEmpty": "Must have an array of nodes"
}
}
}

View File

@@ -10,12 +10,15 @@ import {
faArrowRight,
faAt,
faBook,
faBoxOpen,
faBug,
faCalendar,
faCheck,
faCheckCircle,
faChevronDown,
faChevronUp,
faChevronLeft,
faChevronRight,
faCode,
faCodeBranch,
faCog,
@@ -99,10 +102,13 @@ addIcon(faArrowLeft);
addIcon(faArrowRight);
addIcon(faAt);
addIcon(faBook);
addIcon(faBoxOpen);
addIcon(faBug);
addIcon(faCalendar);
addIcon(faCheck);
addIcon(faCheckCircle);
addIcon(faChevronLeft);
addIcon(faChevronRight);
addIcon(faChevronDown);
addIcon(faChevronUp);
addIcon(faCode);

View File

@@ -3,7 +3,9 @@ import {
ITelemetrySettings,
IDataObject,
} from 'n8n-workflow';
import { ILogLevel, INodeCreateElement } from "@/Interface";
import { ILogLevel, INodeCreateElement, IRootState } from "@/Interface";
import { Route } from "vue-router";
import { Store } from "vuex";
declare module 'vue/types/vue' {
interface Vue {
@@ -35,7 +37,9 @@ interface IUserNodesPanelSession {
class Telemetry {
private pageEventQueue: Array<{category?: string, name?: string | null}>;
private pageEventQueue: Array<{category: string, route: Route}>;
private previousPath: string;
private store: Store<IRootState> | null;
private get telemetry() {
// @ts-ignore
@@ -53,17 +57,20 @@ class Telemetry {
constructor() {
this.pageEventQueue = [];
this.previousPath = '';
this.store = null;
}
init(options: ITelemetrySettings, instanceId: string, logLevel?: ILogLevel) {
init(options: ITelemetrySettings, props: {instanceId: string, logLevel?: ILogLevel, store: Store<IRootState>}) {
if (options.enabled && !this.telemetry) {
if(!options.config) {
return;
}
const logging = logLevel === 'debug' ? { logLevel: 'DEBUG'} : {};
this.store = props.store;
const logging = props.logLevel === 'debug' ? { logLevel: 'DEBUG'} : {};
this.loadTelemetryLibrary(options.config.key, options.config.url, { integrations: { All: false }, loadIntegration: false, ...logging});
this.telemetry.identify(instanceId);
this.telemetry.identify(props.instanceId);
this.flushPageEvents();
}
}
@@ -74,14 +81,24 @@ class Telemetry {
}
}
page(category?: string, name?: string | null) {
page(category: string, route: Route) {
if (this.telemetry) {
this.telemetry.page(category, name);
if (route.path === this.previousPath) { // avoid duplicate requests query is changed for example on search page
return;
}
this.previousPath = route.path;
const pageName = route.name;
let properties: {[key: string]: string} = {};
if (this.store && route.meta && route.meta.telemetry && typeof route.meta.telemetry.getProperties === 'function') {
properties = route.meta.telemetry.getProperties(route, this.store);
}
this.telemetry.page(category, pageName, properties);
}
else {
this.pageEventQueue.push({
category,
name,
route,
});
}
}
@@ -89,10 +106,8 @@ class Telemetry {
flushPageEvents() {
const queue = this.pageEventQueue;
this.pageEventQueue = [];
queue.forEach(({category, name}) => {
if (this.telemetry) {
this.telemetry.page(category, name);
}
queue.forEach(({category, route}) => {
this.page(category, route);
});
}