From a12606828ee1c88c79790c96ca35b0c4ff18eecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Fri, 23 Dec 2022 13:37:32 +0100 Subject: [PATCH] ci: Enforce code formatting on editor-ui (no-changelog) (#5022) * ci: Enforce code formatting on editor-ui (no-changelog) * pnpm format on all frontend code --- .../src/components/N8nAlert/Alert.vue | 18 ++++++++---------- packages/editor-ui/.eslintrc.js | 1 - .../src/components/ExecutionsList.vue | 17 ++++++++++++++--- .../ExecutionsView/ExecutionsSidebar.vue | 4 +++- .../ExecutionsView/ExecutionsView.vue | 2 +- .../editor-ui/src/components/MappingPill.vue | 1 - .../editor-ui/src/components/RunDataJson.vue | 3 +-- .../editor-ui/src/components/RunDataSchema.vue | 3 +-- .../editor-ui/src/components/RunDataTable.vue | 7 +++++-- packages/editor-ui/src/router.ts | 9 ++++++--- packages/editor-ui/src/stores/workflows.ts | 4 ++-- packages/editor-ui/src/views/NodeView.vue | 15 +++++++++++++-- .../src/views/SettingsUsageAndPlan.vue | 4 +--- 13 files changed, 55 insertions(+), 33 deletions(-) diff --git a/packages/design-system/src/components/N8nAlert/Alert.vue b/packages/design-system/src/components/N8nAlert/Alert.vue index 390d9a6805..b48be58892 100644 --- a/packages/design-system/src/components/N8nAlert/Alert.vue +++ b/packages/design-system/src/components/N8nAlert/Alert.vue @@ -45,18 +45,16 @@ const props = withDefaults(defineProps(), { }); const icon = computed(() => { - /* eslint-disable prettier/prettier */ switch (props.type) { - case 'success': - return 'check-circle'; - case 'warning': - return 'exclamation-triangle'; - case 'error': - return 'times-circle'; - default: - return 'info-circle'; + case 'success': + return 'check-circle'; + case 'warning': + return 'exclamation-triangle'; + case 'error': + return 'times-circle'; + default: + return 'info-circle'; } - /* eslint-enable */ }); const style = useCssModule(); diff --git a/packages/editor-ui/.eslintrc.js b/packages/editor-ui/.eslintrc.js index b70c0ffcc1..f02707cc30 100644 --- a/packages/editor-ui/.eslintrc.js +++ b/packages/editor-ui/.eslintrc.js @@ -19,7 +19,6 @@ module.exports = { 'import/order': 'off', 'import/no-cycle': 'warn', indent: 'off', - 'prettier/prettier': 'off', '@typescript-eslint/ban-types': 'off', '@typescript-eslint/dot-notation': 'off', '@typescript-eslint/lines-between-class-members': 'off', diff --git a/packages/editor-ui/src/components/ExecutionsList.vue b/packages/editor-ui/src/components/ExecutionsList.vue index 34414b117e..0d8f043477 100644 --- a/packages/editor-ui/src/components/ExecutionsList.vue +++ b/packages/editor-ui/src/components/ExecutionsList.vue @@ -273,7 +273,12 @@ import WorkflowActivator from '@/components/WorkflowActivator.vue'; import Modal from '@/components/Modal.vue'; import { externalHooks } from '@/mixins/externalHooks'; -import { WAIT_TIME_UNLIMITED, EXECUTIONS_MODAL_KEY, VIEWS, PLACEHOLDER_EMPTY_WORKFLOW_ID } from '@/constants'; +import { + WAIT_TIME_UNLIMITED, + EXECUTIONS_MODAL_KEY, + VIEWS, + PLACEHOLDER_EMPTY_WORKFLOW_ID, +} from '@/constants'; import { restApi } from '@/mixins/restApi'; import { genericHelpers } from '@/mixins/genericHelpers'; @@ -435,8 +440,14 @@ export default mixins(externalHooks, genericHelpers, restApi, showMessage).exten }, convertToDisplayDate, displayExecution(execution: IExecutionsSummary, e: PointerEvent) { - if (!this.workflowsStore.workflowId || this.workflowsStore.workflowId === PLACEHOLDER_EMPTY_WORKFLOW_ID || execution.workflowId !== this.workflowsStore.workflowId) { - const workflowExecutions: IExecutionsSummary[] = this.combinedExecutions.filter(ex => ex.workflowId === execution.workflowId); + if ( + !this.workflowsStore.workflowId || + this.workflowsStore.workflowId === PLACEHOLDER_EMPTY_WORKFLOW_ID || + execution.workflowId !== this.workflowsStore.workflowId + ) { + const workflowExecutions: IExecutionsSummary[] = this.combinedExecutions.filter( + (ex) => ex.workflowId === execution.workflowId, + ); this.workflowsStore.currentWorkflowExecutions = workflowExecutions; this.workflowsStore.activeWorkflowExecution = execution; } diff --git a/packages/editor-ui/src/components/ExecutionsView/ExecutionsSidebar.vue b/packages/editor-ui/src/components/ExecutionsView/ExecutionsSidebar.vue index f78d77ffe0..135b3d2eeb 100644 --- a/packages/editor-ui/src/components/ExecutionsView/ExecutionsSidebar.vue +++ b/packages/editor-ui/src/components/ExecutionsView/ExecutionsSidebar.vue @@ -211,7 +211,9 @@ export default Vue.extend({ }, scrollToActiveCard(): void { const executionsList = this.$refs.executionList as HTMLElement; - const currentExecutionCard = this.$refs[`execution-${this.workflowsStore.activeWorkflowExecution?.id}`] as Vue[]; + const currentExecutionCard = this.$refs[ + `execution-${this.workflowsStore.activeWorkflowExecution?.id}` + ] as Vue[]; if (executionsList && currentExecutionCard && this.workflowsStore.activeWorkflowExecution) { const cardElement = currentExecutionCard[0].$el as HTMLElement; diff --git a/packages/editor-ui/src/components/ExecutionsView/ExecutionsView.vue b/packages/editor-ui/src/components/ExecutionsView/ExecutionsView.vue index 909e88917c..f45dd6e99d 100644 --- a/packages/editor-ui/src/components/ExecutionsView/ExecutionsView.vue +++ b/packages/editor-ui/src/components/ExecutionsView/ExecutionsView.vue @@ -192,7 +192,7 @@ export default mixins( } await this.openWorkflow(this.$route.params.name); this.uiStore.nodeViewInitialized = false; - if(this.workflowsStore.currentWorkflowExecutions.length === 0) { + if (this.workflowsStore.currentWorkflowExecutions.length === 0) { this.setExecutions(); } if (this.activeExecution) { diff --git a/packages/editor-ui/src/components/MappingPill.vue b/packages/editor-ui/src/components/MappingPill.vue index a49cf15448..76485bf117 100644 --- a/packages/editor-ui/src/components/MappingPill.vue +++ b/packages/editor-ui/src/components/MappingPill.vue @@ -7,7 +7,6 @@ type Props = { withDefaults(defineProps(), { canDrop: false, }); -