From 563315b2f02d929997932b9ba7a11aee0024e32e Mon Sep 17 00:00:00 2001 From: Mutasem Date: Tue, 18 Oct 2022 15:27:32 +0200 Subject: [PATCH 1/2] replace cron with schedule --- packages/editor-ui/src/components/InputPanel.vue | 4 ++-- .../components/Node/NodeCreator/TriggerHelperPanel.vue | 6 +++--- packages/editor-ui/src/constants.ts | 1 + packages/editor-ui/src/modules/userHelpers.ts | 8 ++++---- .../nodes-base/nodes/Schedule/ScheduleTrigger.node.ts | 2 +- packages/nodes-base/nodes/Schedule/schedule.svg | 1 - 6 files changed, 11 insertions(+), 11 deletions(-) delete mode 100644 packages/nodes-base/nodes/Schedule/schedule.svg diff --git a/packages/editor-ui/src/components/InputPanel.vue b/packages/editor-ui/src/components/InputPanel.vue index ccabb60d570d8..05cf6e22b5cd1 100644 --- a/packages/editor-ui/src/components/InputPanel.vue +++ b/packages/editor-ui/src/components/InputPanel.vue @@ -75,7 +75,7 @@ import { workflowHelpers } from '@/components/mixins/workflowHelpers'; import mixins from 'vue-typed-mixins'; import NodeExecuteButton from './NodeExecuteButton.vue'; import WireMeUp from './WireMeUp.vue'; -import { CRON_NODE_TYPE, INTERVAL_NODE_TYPE, LOCAL_STORAGE_MAPPING_FLAG, START_NODE_TYPE } from '@/constants'; +import { CRON_NODE_TYPE, INTERVAL_NODE_TYPE, LOCAL_STORAGE_MAPPING_FLAG, MANUAL_TRIGGER_NODE_TYPE, SCHEDULE_TRIGGER_NODE_TYPE, START_NODE_TYPE } from '@/constants'; export default mixins( workflowHelpers, @@ -118,7 +118,7 @@ export default mixins( return window.localStorage.getItem(LOCAL_STORAGE_MAPPING_FLAG) === 'true'; }, showDraggableHint(): boolean { - const toIgnore = [START_NODE_TYPE, CRON_NODE_TYPE, INTERVAL_NODE_TYPE]; + const toIgnore = [START_NODE_TYPE, MANUAL_TRIGGER_NODE_TYPE, CRON_NODE_TYPE, INTERVAL_NODE_TYPE]; if (!this.currentNode || toIgnore.includes(this.currentNode.type)) { return false; } diff --git a/packages/editor-ui/src/components/Node/NodeCreator/TriggerHelperPanel.vue b/packages/editor-ui/src/components/Node/NodeCreator/TriggerHelperPanel.vue index 4cd6ddf6bed63..5d885c84e6d55 100644 --- a/packages/editor-ui/src/components/Node/NodeCreator/TriggerHelperPanel.vue +++ b/packages/editor-ui/src/components/Node/NodeCreator/TriggerHelperPanel.vue @@ -25,7 +25,7 @@ import mixins from 'vue-typed-mixins'; import { externalHooks } from '@/components/mixins/externalHooks'; import { INodeCreateElement } from '@/Interface'; -import { CORE_NODES_CATEGORY, CRON_NODE_TYPE, WEBHOOK_NODE_TYPE, OTHER_TRIGGER_NODES_SUBCATEGORY, EXECUTE_WORKFLOW_TRIGGER_NODE_TYPE, MANUAL_TRIGGER_NODE_TYPE, COMMUNICATION_CATEGORY } from '@/constants'; +import { CORE_NODES_CATEGORY, WEBHOOK_NODE_TYPE, OTHER_TRIGGER_NODES_SUBCATEGORY, EXECUTE_WORKFLOW_TRIGGER_NODE_TYPE, MANUAL_TRIGGER_NODE_TYPE, COMMUNICATION_CATEGORY, SCHEDULE_TRIGGER_NODE_TYPE } from '@/constants'; import ItemIterator from './ItemIterator.vue'; import CategorizedItems from './CategorizedItems.vue'; @@ -66,13 +66,13 @@ export default mixins(externalHooks).extend({ }, }, { - key: CRON_NODE_TYPE, + key: SCHEDULE_TRIGGER_NODE_TYPE, type: "node", properties: { nodeType: { group: [], - name: CRON_NODE_TYPE, + name: SCHEDULE_TRIGGER_NODE_TYPE, displayName: this.$locale.baseText('nodeCreator.triggerHelperPanel.scheduleTriggerDisplayName'), description: this.$locale.baseText('nodeCreator.triggerHelperPanel.scheduleTriggerDescription'), icon: "fa:clock", diff --git a/packages/editor-ui/src/constants.ts b/packages/editor-ui/src/constants.ts index d9a6390c7e9b7..5fd508042609b 100644 --- a/packages/editor-ui/src/constants.ts +++ b/packages/editor-ui/src/constants.ts @@ -101,6 +101,7 @@ export const PAGERDUTY_NODE_TYPE = 'n8n-nodes-base.pagerDuty'; export const SALESFORCE_NODE_TYPE = 'n8n-nodes-base.salesforce'; export const SEGMENT_NODE_TYPE = 'n8n-nodes-base.segment'; export const SET_NODE_TYPE = 'n8n-nodes-base.set'; +export const SCHEDULE_TRIGGER_NODE_TYPE = 'n8n-nodes-base.scheduleTrigger'; export const SERVICENOW_NODE_TYPE = 'n8n-nodes-base.serviceNow'; export const SLACK_NODE_TYPE = 'n8n-nodes-base.slack'; export const SPREADSHEET_FILE_NODE_TYPE = 'n8n-nodes-base.spreadsheetFile'; diff --git a/packages/editor-ui/src/modules/userHelpers.ts b/packages/editor-ui/src/modules/userHelpers.ts index 35e8a253d9608..44eb5655cdf20 100644 --- a/packages/editor-ui/src/modules/userHelpers.ts +++ b/packages/editor-ui/src/modules/userHelpers.ts @@ -1,5 +1,5 @@ -import { CALENDLY_TRIGGER_NODE_TYPE, CLEARBIT_NODE_TYPE, COMPANY_SIZE_1000_OR_MORE, COMPANY_SIZE_500_999, CRON_NODE_TYPE, ELASTIC_SECURITY_NODE_TYPE, EMAIL_SEND_NODE_TYPE, EXECUTE_COMMAND_NODE_TYPE, FINANCE_WORK_AREA, GITHUB_TRIGGER_NODE_TYPE, HTTP_REQUEST_NODE_TYPE, IF_NODE_TYPE, ITEM_LISTS_NODE_TYPE, IT_ENGINEERING_WORK_AREA, JIRA_TRIGGER_NODE_TYPE, MICROSOFT_EXCEL_NODE_TYPE, MICROSOFT_TEAMS_NODE_TYPE, PAGERDUTY_NODE_TYPE, PRODUCT_WORK_AREA, QUICKBOOKS_NODE_TYPE, SALESFORCE_NODE_TYPE, SALES_BUSINESSDEV_WORK_AREA, SECURITY_WORK_AREA, SEGMENT_NODE_TYPE, SET_NODE_TYPE, SLACK_NODE_TYPE, SPREADSHEET_FILE_NODE_TYPE, SWITCH_NODE_TYPE, WEBHOOK_NODE_TYPE, XERO_NODE_TYPE, COMPANY_SIZE_KEY, WORK_AREA_KEY, CODING_SKILL_KEY, COMPANY_TYPE_KEY, ECOMMERCE_COMPANY_TYPE, MSP_COMPANY_TYPE, PERSONAL_COMPANY_TYPE, AUTOMATION_GOAL_KEY, OTHER_AUTOMATION_GOAL, NOT_SURE_YET_GOAL, CUSTOMER_INTEGRATIONS_GOAL, CUSTOMER_SUPPORT_GOAL, FINANCE_ACCOUNTING_GOAL, ZENDESK_TRIGGER_NODE_TYPE, WOOCOMMERCE_TRIGGER_NODE_TYPE, SALES_MARKETING_GOAL, HUBSPOT_TRIGGER_NODE_TYPE, HR_GOAL, WORKABLE_TRIGGER_NODE_TYPE, OPERATIONS_GOAL, PRODUCT_GOAL, NOTION_TRIGGER_NODE_TYPE, SECURITY_GOAL, THE_HIVE_TRIGGER_NODE_TYPE, ZENDESK_NODE_TYPE, SERVICENOW_NODE_TYPE, JIRA_NODE_TYPE, BAMBOO_HR_NODE_TYPE, GOOGLE_SHEETS_NODE_TYPE, CODE_NODE_TYPE } from '@/constants'; +import { CALENDLY_TRIGGER_NODE_TYPE, CLEARBIT_NODE_TYPE, COMPANY_SIZE_1000_OR_MORE, COMPANY_SIZE_500_999, SCHEDULE_TRIGGER_NODE_TYPE, ELASTIC_SECURITY_NODE_TYPE, EMAIL_SEND_NODE_TYPE, EXECUTE_COMMAND_NODE_TYPE, FINANCE_WORK_AREA, GITHUB_TRIGGER_NODE_TYPE, HTTP_REQUEST_NODE_TYPE, IF_NODE_TYPE, ITEM_LISTS_NODE_TYPE, IT_ENGINEERING_WORK_AREA, JIRA_TRIGGER_NODE_TYPE, MICROSOFT_EXCEL_NODE_TYPE, MICROSOFT_TEAMS_NODE_TYPE, PAGERDUTY_NODE_TYPE, PRODUCT_WORK_AREA, QUICKBOOKS_NODE_TYPE, SALESFORCE_NODE_TYPE, SALES_BUSINESSDEV_WORK_AREA, SECURITY_WORK_AREA, SEGMENT_NODE_TYPE, SET_NODE_TYPE, SLACK_NODE_TYPE, SPREADSHEET_FILE_NODE_TYPE, SWITCH_NODE_TYPE, WEBHOOK_NODE_TYPE, XERO_NODE_TYPE, COMPANY_SIZE_KEY, WORK_AREA_KEY, CODING_SKILL_KEY, COMPANY_TYPE_KEY, ECOMMERCE_COMPANY_TYPE, MSP_COMPANY_TYPE, PERSONAL_COMPANY_TYPE, AUTOMATION_GOAL_KEY, OTHER_AUTOMATION_GOAL, NOT_SURE_YET_GOAL, CUSTOMER_INTEGRATIONS_GOAL, CUSTOMER_SUPPORT_GOAL, FINANCE_ACCOUNTING_GOAL, ZENDESK_TRIGGER_NODE_TYPE, WOOCOMMERCE_TRIGGER_NODE_TYPE, SALES_MARKETING_GOAL, HUBSPOT_TRIGGER_NODE_TYPE, HR_GOAL, WORKABLE_TRIGGER_NODE_TYPE, OPERATIONS_GOAL, PRODUCT_GOAL, NOTION_TRIGGER_NODE_TYPE, SECURITY_GOAL, THE_HIVE_TRIGGER_NODE_TYPE, ZENDESK_NODE_TYPE, SERVICENOW_NODE_TYPE, JIRA_NODE_TYPE, BAMBOO_HR_NODE_TYPE, GOOGLE_SHEETS_NODE_TYPE, CODE_NODE_TYPE } from '@/constants'; import { IPermissions, IPersonalizationSurveyAnswersV1, IPersonalizationSurveyAnswersV2, IPersonalizationSurveyAnswersV3, IPersonalizationSurveyVersions, IUser } from '@/Interface'; import { ILogInStatus, IRole, IUserPermissions } from "@/Interface"; @@ -144,7 +144,7 @@ function getPersonalizationV2(answers: IPersonalizationSurveyAnswersV2 | IPerson } else if((companyType === PERSONAL_COMPANY_TYPE || automationGoal === OTHER_AUTOMATION_GOAL || automationGoal === NOT_SURE_YET_GOAL) && codingSkill !== null && codingSkill >= 4) { nodeTypes = nodeTypes.concat(WEBHOOK_NODE_TYPE); } else if((companyType === PERSONAL_COMPANY_TYPE || automationGoal === OTHER_AUTOMATION_GOAL || automationGoal === NOT_SURE_YET_GOAL) && codingSkill !== null && codingSkill < 3) { - nodeTypes = nodeTypes.concat(CRON_NODE_TYPE); + nodeTypes = nodeTypes.concat(SCHEDULE_TRIGGER_NODE_TYPE); } else if (automationGoal === CUSTOMER_INTEGRATIONS_GOAL) { nodeTypes = nodeTypes.concat(WEBHOOK_NODE_TYPE); } else if (automationGoal === CUSTOMER_SUPPORT_GOAL || automationGoal === FINANCE_ACCOUNTING_GOAL) { @@ -154,7 +154,7 @@ function getPersonalizationV2(answers: IPersonalizationSurveyAnswersV2 | IPerson } else if (automationGoal === HR_GOAL) { nodeTypes = nodeTypes.concat(WORKABLE_TRIGGER_NODE_TYPE); } else if (automationGoal === OPERATIONS_GOAL) { - nodeTypes = nodeTypes.concat(CRON_NODE_TYPE); + nodeTypes = nodeTypes.concat(SCHEDULE_TRIGGER_NODE_TYPE); } else if (automationGoal === PRODUCT_GOAL) { nodeTypes = nodeTypes.concat(NOTION_TRIGGER_NODE_TYPE); } else if (automationGoal === SECURITY_GOAL) { @@ -268,7 +268,7 @@ function getPersonalizationV1(answers: IPersonalizationSurveyAnswersV1) { nodeTypes = nodeTypes.concat(WEBHOOK_NODE_TYPE); } else { - nodeTypes = nodeTypes.concat(CRON_NODE_TYPE); + nodeTypes = nodeTypes.concat(SCHEDULE_TRIGGER_NODE_TYPE); } if (codingSkill !== null && codingSkill >= 4) { diff --git a/packages/nodes-base/nodes/Schedule/ScheduleTrigger.node.ts b/packages/nodes-base/nodes/Schedule/ScheduleTrigger.node.ts index 34833f2e8b41c..cd1a3cbb3ecb5 100644 --- a/packages/nodes-base/nodes/Schedule/ScheduleTrigger.node.ts +++ b/packages/nodes-base/nodes/Schedule/ScheduleTrigger.node.ts @@ -15,7 +15,7 @@ export class ScheduleTrigger implements INodeType { description: INodeTypeDescription = { displayName: 'Schedule Trigger', name: 'scheduleTrigger', - icon: 'file:schedule.svg', + icon: 'fa:clock', group: ['trigger', 'schedule'], version: 1, description: 'Triggers the workflow on a given schedule', diff --git a/packages/nodes-base/nodes/Schedule/schedule.svg b/packages/nodes-base/nodes/Schedule/schedule.svg deleted file mode 100644 index b496e09d6b893..0000000000000 --- a/packages/nodes-base/nodes/Schedule/schedule.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file From 8c9de3336035c51509f0f99dba1fa4b4f34e9819 Mon Sep 17 00:00:00 2001 From: Mutasem Date: Tue, 18 Oct 2022 15:34:30 +0200 Subject: [PATCH 2/2] update col --- packages/nodes-base/nodes/Schedule/ScheduleTrigger.node.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/Schedule/ScheduleTrigger.node.ts b/packages/nodes-base/nodes/Schedule/ScheduleTrigger.node.ts index cd1a3cbb3ecb5..7f6166a6d3f43 100644 --- a/packages/nodes-base/nodes/Schedule/ScheduleTrigger.node.ts +++ b/packages/nodes-base/nodes/Schedule/ScheduleTrigger.node.ts @@ -24,7 +24,7 @@ export class ScheduleTrigger implements INodeType { 'Your schedule trigger will now trigger executions on the schedule you have defined.', defaults: { name: 'Schedule Trigger', - color: '#00FF00', + color: '#31C49F', }, // eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node inputs: [],