2022-07-20 04:32:51 -07:00
|
|
|
import { CORE_NODES_CATEGORY, ERROR_TRIGGER_NODE_TYPE, MAPPING_PARAMS, TEMPLATES_NODES_FILTER } from '@/constants';
|
:sparkles: 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
* :zap: Fix placeholder in creds config modal
* :pencil2: Adjust docstring to `credText` placeholder version
* N8N-2853 Optimized
* N8N-2853 Optimized code
* :zap: Add deployment type to FE settings
* :zap: Add deployment type to interfaces
* N8N-2853 Removed Animated prop from components
* :zap: Add deployment type to store module
* :sparkles: Create hiring banner
* :zap: Display hiring banner
* :rewind: Undo unrelated change
* N8N-2853 Refactor TemplateFilters
* :zap: Fix indentation
* N8N-2853 Reorder items / TemplateList
* :shirt: 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
* :pencil2: Update jobs URL
* :truck: Move logging to root component
* :zap: Refactor `deploymentType` to `isInternalUser`
* :zap: 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
* :arrow_up: Update package-lock.json file
* :zap: 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>
2022-02-28 01:57:44 -08:00
|
|
|
import { INodeUi, ITemplatesNode } from '@/Interface';
|
2021-09-11 01:15:36 -07:00
|
|
|
import dateformat from 'dateformat';
|
2022-07-20 08:50:39 -07:00
|
|
|
import {IDataObject, INodeTypeDescription} from 'n8n-workflow';
|
2021-09-11 01:15:36 -07:00
|
|
|
|
|
|
|
const KEYWORDS_TO_FILTER = ['API', 'OAuth1', 'OAuth2'];
|
:sparkles: 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
* :zap: Fix placeholder in creds config modal
* :pencil2: Adjust docstring to `credText` placeholder version
* N8N-2853 Optimized
* N8N-2853 Optimized code
* :zap: Add deployment type to FE settings
* :zap: Add deployment type to interfaces
* N8N-2853 Removed Animated prop from components
* :zap: Add deployment type to store module
* :sparkles: Create hiring banner
* :zap: Display hiring banner
* :rewind: Undo unrelated change
* N8N-2853 Refactor TemplateFilters
* :zap: Fix indentation
* N8N-2853 Reorder items / TemplateList
* :shirt: 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
* :pencil2: Update jobs URL
* :truck: Move logging to root component
* :zap: Refactor `deploymentType` to `isInternalUser`
* :zap: 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
* :arrow_up: Update package-lock.json file
* :zap: 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>
2022-02-28 01:57:44 -08:00
|
|
|
const SI_SYMBOL = ['', 'k', 'M', 'G', 'T', 'P', 'E'];
|
|
|
|
|
2022-07-20 07:24:03 -07:00
|
|
|
const COMMUNITY_PACKAGE_NAME_REGEX = /(@\w+\/)?n8n-nodes-(?!base\b)\b\w+/g;
|
|
|
|
|
:sparkles: 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
* :zap: Fix placeholder in creds config modal
* :pencil2: Adjust docstring to `credText` placeholder version
* N8N-2853 Optimized
* N8N-2853 Optimized code
* :zap: Add deployment type to FE settings
* :zap: Add deployment type to interfaces
* N8N-2853 Removed Animated prop from components
* :zap: Add deployment type to store module
* :sparkles: Create hiring banner
* :zap: Display hiring banner
* :rewind: Undo unrelated change
* N8N-2853 Refactor TemplateFilters
* :zap: Fix indentation
* N8N-2853 Reorder items / TemplateList
* :shirt: 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
* :pencil2: Update jobs URL
* :truck: Move logging to root component
* :zap: Refactor `deploymentType` to `isInternalUser`
* :zap: 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
* :arrow_up: Update package-lock.json file
* :zap: 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>
2022-02-28 01:57:44 -08:00
|
|
|
export function abbreviateNumber(num: number) {
|
|
|
|
const tier = (Math.log10(Math.abs(num)) / 3) | 0;
|
|
|
|
|
|
|
|
if (tier === 0) return num;
|
|
|
|
|
|
|
|
const suffix = SI_SYMBOL[tier];
|
|
|
|
const scale = Math.pow(10, tier * 3);
|
|
|
|
const scaled = num / scale;
|
|
|
|
|
|
|
|
return Number(scaled.toFixed(1)) + suffix;
|
|
|
|
}
|
2021-09-11 01:15:36 -07:00
|
|
|
|
|
|
|
export function convertToDisplayDate (epochTime: number) {
|
|
|
|
return dateformat(epochTime, 'yyyy-mm-dd HH:MM:ss');
|
|
|
|
}
|
|
|
|
|
|
|
|
export function convertToHumanReadableDate (epochTime: number) {
|
|
|
|
return dateformat(epochTime, 'd mmmm, yyyy @ HH:MM Z');
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getAppNameFromCredType(name: string) {
|
|
|
|
return name.split(' ').filter((word) => !KEYWORDS_TO_FILTER.includes(word)).join(' ');
|
|
|
|
}
|
2021-11-19 01:17:13 -08:00
|
|
|
|
|
|
|
export function getStyleTokenValue(name: string): string {
|
|
|
|
const style = getComputedStyle(document.body);
|
|
|
|
return style.getPropertyValue(name);
|
|
|
|
}
|
2022-01-21 09:00:00 -08:00
|
|
|
|
2022-06-20 12:39:24 -07:00
|
|
|
export function getTriggerNodeServiceName(nodeType: INodeTypeDescription): string {
|
|
|
|
return nodeType.displayName.replace(/ trigger/i, '');
|
2022-01-21 09:00:00 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
export function getActivatableTriggerNodes(nodes: INodeUi[]) {
|
|
|
|
return nodes.filter((node: INodeUi) => {
|
|
|
|
// Error Trigger does not behave like other triggers and workflows using it can not be activated
|
|
|
|
return !node.disabled && node.type !== ERROR_TRIGGER_NODE_TYPE;
|
|
|
|
});
|
|
|
|
}
|
:sparkles: 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
* :zap: Fix placeholder in creds config modal
* :pencil2: Adjust docstring to `credText` placeholder version
* N8N-2853 Optimized
* N8N-2853 Optimized code
* :zap: Add deployment type to FE settings
* :zap: Add deployment type to interfaces
* N8N-2853 Removed Animated prop from components
* :zap: Add deployment type to store module
* :sparkles: Create hiring banner
* :zap: Display hiring banner
* :rewind: Undo unrelated change
* N8N-2853 Refactor TemplateFilters
* :zap: Fix indentation
* N8N-2853 Reorder items / TemplateList
* :shirt: 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
* :pencil2: Update jobs URL
* :truck: Move logging to root component
* :zap: Refactor `deploymentType` to `isInternalUser`
* :zap: 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
* :arrow_up: Update package-lock.json file
* :zap: 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>
2022-02-28 01:57:44 -08:00
|
|
|
|
|
|
|
export function filterTemplateNodes(nodes: ITemplatesNode[]) {
|
|
|
|
const notCoreNodes = nodes.filter((node: ITemplatesNode) => {
|
|
|
|
return !(node.categories || []).some(
|
|
|
|
(category) => category.name === CORE_NODES_CATEGORY,
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
const results = notCoreNodes.length > 0 ? notCoreNodes : nodes;
|
|
|
|
return results.filter((elem) => !TEMPLATES_NODES_FILTER.includes(elem.name));
|
|
|
|
}
|
|
|
|
|
|
|
|
export function setPageTitle(title: string) {
|
|
|
|
window.document.title = title;
|
|
|
|
}
|
feat(editor): Add Workflow Stickies (Notes) (#3154)
* N8N-3029 Add Node Type for Wokrflow Stickies/Notes
* N8N-3029 Update Content, Update Aliasses
* N8N-3030 Created N8N Sticky Component in Design System
* N8N-3030 Fixed Code spaccing Sticky Component
* N8N-3030 Fixed Code spaccing StickyStories Component
* N8N-3030 Fixed Code spaccing Markdown Component
* N8N-3030 Added Sticky Colors Pallete into Storybook, Update Color Variables for Sticky Component
* N8N-3030 Added Unfocus Event
* N8N-3030 Update Default Placeholder, Markdown Styles, Fixed Edit State, Added Text to EditState, Fixed Height of Area, Turned off Resize of textarea
* N8N-3030 Update Sticky Overflow, Update Hover States, Updated Markdown Overflow
* N8N-3030, N8N-3031 - Add Resize to Sticky, Created N8n-Resize component
* N8N-3031 Fixed Importing Components in Editor-ui
* N8N-3031 Fixed Resize Component, Fixed Gradient
* N8N-3030, N8N-3031 Update Note Description
* N8N-3032 Hotfix Building Storybook
* N8N-3032 - Select Behaviour, Changes in Resize Component, Emit on Width/Height/Top/Left Change
* N8N-3032 Update Resize Component to emmit left/top, Update Dynamic Resize on Selected Background
* N8N-3032 Updated / Dragging vs Resizing, prevent open Modal for stickies
* N8N-3032 Added ID props to n8n-sticky // dynamic id for multi resizing in NodeView
* N8N-3033 Add dynamic size Tooltip on Sticky
* N8N-3033 Updated Z-index for Sticky Component
* N8N-3033 Updated N8N-Resize Component, Fixed SelectedBackround for Sticky Component
* N8N-3033 Refactor
* N8N-3033 Focus/Defocus on TextArea
* N8N-3033 Fixed Resizing on NW Point
* N8N-3030 Save content in vuex on input change
* N8N-3033 Fixed Resizer, Save Width and Height in Vue
* N8N-3033 Hide Sticky Footer on small height/width
* N8N-3033 Fixed Resizer
* N8N-3033 Dynamic Z-index for Stickies
* N8N-3033 Dynamic Z-index for Stickies
* N8N-3033 Removed static z-index for select sticky class
* N8N-3034 Added Telemetry
* N8N-3030 Formatter
* N8N-3030 Format code
* N8N-3030 Fixed Selecting Stickies
* N8N-3033 Fixed Notifications
* N8N-3030 Added new paddings for Default Stickies
* N8N-3033 Prevent Scrolling NodeView when Sticky is in Edit mode and Mouse is Over the TextArea
* N8N-3030 Prevent double clicking to switch state of Sticky component in Edit Mode
* N8N-3033 Fixed Z-index of Stickies
* N8N-3033 Prevent delete node when in EditMode
* N8N-3030 Prevent Delete Button to delete the Sticky while in Edit Mode
* N8N-3030 Change EditMode (emit) on keyboard shortucts, update Markdown Links & Images, Added new props
* N8N-3030 Sticky Component - No padding when hiding footer text
* N8N-3033 Fix Resizing enter into Edit Mode
* N8N-3033 Selecting different nodes - exit the edit mode
* N8N-3033 Auto Select Text in text-area by default - Sticky Component
* N8N-3033 Prevent Default behaviour for CTRL + X, CTRL + A when Sticky is Active && inEditMode
* N8N-3033 Refactor Resizer, Refactor Sticky, Update zIndex inEditMode
* N8N-3033 Updated Default Text // Node-base, Storybook
* N8N-3033 Add Resizing in EditMode - Components update
* N8N-3033 Fixed Footer - Show/Hide on Resize in EditMode
* N8N-3033 Fix ActiveSticky on Init
* N8N-3033 Refactor Sticky in Vuex, Fixed Init Sticky Tweaks, Prevent Modal Openning, Save on Keyboard shortcuts
* Stickies - Update Note node with new props
* N8N-3030 Updated Default Note text, Update the Markdown Link
* N8N-3030 CMD-C does not copy the text fix
* N8N-3030 Fix Max Zoom / Zoom out shortcuts disabled in editState
* N8N-3030 Z-index fixed during Edit Mode typing
* N8N-3030 Prevent Autoselect Text in Stickies if the text is not default
* N8N-3030 Fixed ReadOnly Bugs / Prevent showing Tooltip, Resizing
* N8N-3030 Added Sticky Creator Button
* N8N-3030 Update Icon / Sticky Creator Button
* N8N-3033 Update Sticky Icon / StickyCreator Button
* update package lock
* 🔩 update note props
* 🚿 clean props
* 🔧 linting
* :wrench: fix spacing
* remove resize component
* remove resize component
* ✂ clean up sticky
* revert back to height width
* revert back to height/width
* replace zindex property
* replace default text property
* use i18n to translate
* update package lock
* move resize
* clean up how height/width are set
* fix resize for sticky to support left/top
* clean up resize
* fix lasso/highlight bug
* remove unused props
* fix zoom to fit
* fix padding for demo view
* fix readonly
* remove iseditable, use active state
* clean up keyboard events
* chang button size, no edit on insert
* scale resizing correctly
* make active on resize
* fix select on resize/move
* use outline icon
* allow for multiple line breaks
* fix multi line bug
* fix edit mode outline
* keep edit open as one resizes
* respect multiple spaces
* fix scrolling bug
* clean up hover impl
* clean up references to note
* disable for rename
* fix drifting while drag
* fix mouse cursor on resize
* fix sticky min height
* refactor resize into component
* fix pulling too far bug
* fix delete/cut all bug
* fix padding bottom
* fix active change on resize
* add transition to button
* Fix sticky markdown click
* add solid fa icon
* update node graph, telemetry event
* add snapping
* change alt text
* update package lock
* fix bug in button hover
* add back transition
* clean up resize
* add grid size as param
* remove breaks
* clean up markdown
* lint fixes
* fix spacing
* clean up markdown colors
* clean up classes in resize
* clean up resize
* update sticky story
* fix spacing
* clean up classes
* revert change
* revert change
* revert change
* clean up sticky component
* remove unused component
* remove unnessary data
* remove unnessary data
* clean up actions
* clean up sticky size
* clean up unnessary border style
* fix bug
* replace sticky note name
* update description
* remove support for multi spaces
* update tracking name
* update telemetry reqs
* fix enter bug
* update alt text
* update sticky notes doc url
* fix readonly bug
* update class name
* update quote marks
Co-authored-by: SchnapsterDog <olivertrajceski@yahoo.com>
2022-04-25 03:38:37 -07:00
|
|
|
|
|
|
|
export function isString(value: unknown): value is string {
|
|
|
|
return typeof value === 'string';
|
|
|
|
}
|
|
|
|
|
|
|
|
export function isNumber(value: unknown): value is number {
|
|
|
|
return typeof value === 'number';
|
|
|
|
}
|
2022-07-20 04:32:51 -07:00
|
|
|
|
2022-07-20 08:50:39 -07:00
|
|
|
export function stringSizeInBytes(input: string | IDataObject | IDataObject[] | undefined): number {
|
|
|
|
if (input === undefined) return 0;
|
|
|
|
|
|
|
|
return new Blob([typeof input === 'string' ? input : JSON.stringify(input)]).size;
|
|
|
|
}
|
|
|
|
|
2022-07-20 07:24:03 -07:00
|
|
|
export function isCommunityPackageName(packageName: string): boolean {
|
|
|
|
COMMUNITY_PACKAGE_NAME_REGEX.lastIndex = 0;
|
|
|
|
// Community packages names start with <@username/>n8n-nodes- not followed by word 'base'
|
|
|
|
const nameMatch = COMMUNITY_PACKAGE_NAME_REGEX.exec(packageName);
|
|
|
|
|
|
|
|
return !!nameMatch;
|
|
|
|
}
|
|
|
|
|
2022-07-20 04:32:51 -07:00
|
|
|
export function shorten(s: string, limit: number, keep: number) {
|
|
|
|
if (s.length <= limit) {
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
const first = s.slice(0, limit - keep);
|
|
|
|
const last = s.slice(s.length - keep, s.length);
|
|
|
|
|
|
|
|
return `${first}...${last}`;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function hasExpressionMapping(value: unknown) {
|
|
|
|
return typeof value === 'string' && !!MAPPING_PARAMS.find((param) => value.includes(param));
|
|
|
|
}
|