From 5ca2148c7ed06c90f999508928b7a51f9ac7a788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Wed, 14 Dec 2022 10:04:10 +0100 Subject: [PATCH] refactor(editor): Apply Prettier (no-changelog) (#4920) * :zap: Adjust `format` script * :fire: Remove exemption for `editor-ui` * :art: Prettify * :shirt: Fix lint --- .prettierignore | 1 - packages/editor-ui/.eslintrc.js | 2 +- packages/editor-ui/README.md | 9 +- packages/editor-ui/index.html | 35 +- packages/editor-ui/package.json | 2 +- packages/editor-ui/src/App.vue | 49 +- packages/editor-ui/src/Interface.ts | 171 +- .../src/__tests__/permissions.spec.ts | 8 +- packages/editor-ui/src/__tests__/setup.ts | 1 - packages/editor-ui/src/api/api-keys.ts | 4 +- packages/editor-ui/src/api/communityNodes.ts | 14 +- packages/editor-ui/src/api/credentials.ee.ts | 23 +- packages/editor-ui/src/api/credentials.ts | 50 +- packages/editor-ui/src/api/curlHelper.ts | 9 +- packages/editor-ui/src/api/nodeTypes.ts | 19 +- packages/editor-ui/src/api/settings.ts | 46 +- packages/editor-ui/src/api/tags.ts | 6 +- packages/editor-ui/src/api/templates.ts | 62 +- packages/editor-ui/src/api/users.ts | 82 +- packages/editor-ui/src/api/versions.ts | 8 +- .../editor-ui/src/api/workflow-webhooks.ts | 68 +- packages/editor-ui/src/api/workflows.ee.ts | 23 +- .../editor-ui/src/components/AboutModal.vue | 5 +- .../src/components/ActivationModal.vue | 53 +- packages/editor-ui/src/components/Badge.vue | 57 +- packages/editor-ui/src/components/Banner.vue | 31 +- .../src/components/BinaryDataDisplay.vue | 105 +- .../src/components/BinaryDataDisplayEmbed.vue | 125 +- .../src/components/BreakpointsObserver.vue | 43 +- .../src/components/CanvasControls.vue | 58 +- .../src/components/ChangePasswordModal.vue | 34 +- .../editor-ui/src/components/CodeEdit.vue | 118 +- .../CodeNodeEditor/CodeNodeEditor.vue | 4 +- .../CodeNodeEditor/baseExtensions.ts | 7 +- .../CodeNodeEditor/completions/js.snippets.ts | 2 +- .../completions/jsonField.completions.ts | 5 +- .../completions/luxon.completions.ts | 32 +- .../src/components/CodeNodeEditor/theme.ts | 73 +- .../src/components/CollectionCard.vue | 10 +- .../src/components/CollectionParameter.vue | 280 +- .../src/components/CollectionWorkflowCard.vue | 12 +- .../src/components/CollectionsCarousel.vue | 55 +- .../src/components/CommunityPackageCard.vue | 17 +- .../CommunityPackageInstallModal.vue | 54 +- .../CommunityPackageManageConfirmModal.vue | 79 +- .../src/components/ContactPromptModal.vue | 9 +- .../editor-ui/src/components/CopyInput.vue | 13 +- .../src/components/CredentialCard.vue | 132 +- .../CredentialEdit/CredentialConfig.vue | 88 +- .../CredentialEdit/CredentialEdit.vue | 316 +- .../CredentialEdit/CredentialInfo.vue | 32 +- .../CredentialEdit/CredentialInputs.vue | 12 +- .../CredentialEdit/CredentialSharing.ee.vue | 68 +- .../components/CredentialEdit/OauthButton.vue | 4 +- .../src/components/CredentialIcon.vue | 10 +- .../src/components/CredentialsSelect.vue | 49 +- .../src/components/CredentialsSelectModal.vue | 19 +- .../src/components/DeleteUserModal.vue | 71 +- .../editor-ui/src/components/Draggable.vue | 29 +- .../src/components/DraggableTarget.vue | 15 +- .../components/DuplicateWorkflowDialog.vue | 60 +- .../src/components/EnterpriseEdition.ee.vue | 7 +- .../src/components/Error/NodeErrorView.vue | 142 +- .../src/components/ExecutionTime.vue | 80 +- .../src/components/ExecutionsList.vue | 396 +- .../ExecutionsView/ExecutionCard.vue | 108 +- .../ExecutionsView/ExecutionPreview.vue | 100 +- .../ExecutionsInfoAccordion.vue | 97 +- .../ExecutionsView/ExecutionsLandingPage.vue | 8 +- .../ExecutionsView/ExecutionsSidebar.vue | 30 +- .../ExecutionsView/ExecutionsView.vue | 269 +- .../ExpandableInput/ExpandableInputBase.vue | 9 +- .../ExpandableInput/ExpandableInputEdit.vue | 6 +- .../ExpandableInputPreview.vue | 8 +- .../src/components/ExpressionEdit.vue | 101 +- .../n8nLanguagePack/index.cjs | 63 +- .../n8nLanguagePack/index.d.cts | 4 +- .../n8nLanguagePack/index.d.ts | 4 +- .../n8nLanguagePack/index.js | 63 +- .../src/components/FeatureComingSoon.vue | 27 +- .../components/FixedCollectionParameter.vue | 374 +- .../src/components/GiftNotificationIcon.vue | 55 +- .../editor-ui/src/components/GoBackButton.vue | 2 +- .../src/components/HoverableNodeIcon.vue | 4 +- .../src/components/ImportCurlModal.vue | 5 +- .../src/components/InlineNameEdit.vue | 9 +- .../src/components/InlineTextEdit.vue | 16 +- .../editor-ui/src/components/InputPanel.vue | 167 +- .../src/components/IntersectionObserved.vue | 1 - .../src/components/IntersectionObserver.vue | 6 +- .../src/components/InviteUsersModal.vue | 87 +- packages/editor-ui/src/components/Logo.vue | 10 +- .../ExecutionDetails/ExecutionDetails.vue | 45 +- .../MainHeader/ExecutionDetails/ReadOnly.vue | 4 +- .../src/components/MainHeader/MainHeader.vue | 224 +- .../src/components/MainHeader/TabBar.vue | 20 +- .../components/MainHeader/WorkflowDetails.vue | 178 +- .../editor-ui/src/components/MainSidebar.vue | 788 +- packages/editor-ui/src/components/Modal.vue | 32 +- .../editor-ui/src/components/ModalDrawer.vue | 15 +- .../editor-ui/src/components/ModalRoot.vue | 10 +- packages/editor-ui/src/components/Modals.vue | 62 +- .../src/components/MultipleParameter.vue | 282 +- .../src/components/NDVDraggablePanels.vue | 122 +- packages/editor-ui/src/components/Node.vue | 468 +- .../src/components/Node/NodeCreation.vue | 60 +- .../Node/NodeCreator/ActionItem.vue | 51 +- .../Node/NodeCreator/CategorizedItems.vue | 552 +- .../Node/NodeCreator/CategoryItem.vue | 14 +- .../Node/NodeCreator/ItemIterator.vue | 65 +- .../components/Node/NodeCreator/MainPanel.vue | 44 +- .../components/Node/NodeCreator/NoResults.vue | 12 +- .../Node/NodeCreator/NoResultsIcon.vue | 65 +- .../Node/NodeCreator/NodeCreator.vue | 41 +- .../components/Node/NodeCreator/NodeItem.vue | 50 +- .../components/Node/NodeCreator/SearchBar.vue | 10 +- .../Node/NodeCreator/SubcategoryItem.vue | 6 +- .../Node/NodeCreator/TriggerHelperPanel.vue | 233 +- .../Node/NodeCreator/TypeSelector.vue | 27 +- .../src/components/NodeCredentials.vue | 200 +- .../src/components/NodeDetailsView.vue | 64 +- .../src/components/NodeExecuteButton.vue | 56 +- .../editor-ui/src/components/NodeIcon.vue | 22 +- .../editor-ui/src/components/NodeList.vue | 11 +- .../editor-ui/src/components/NodeSettings.vue | 42 +- .../src/components/NodeSettingsTabs.vue | 54 +- .../editor-ui/src/components/NodeTitle.vue | 21 +- .../editor-ui/src/components/NodeWebhooks.vue | 144 +- .../components/OnboardingCallSignupModal.vue | 16 +- .../editor-ui/src/components/OutputPanel.vue | 58 +- .../editor-ui/src/components/PageAlert.vue | 5 +- .../src/components/PageContentWrapper.vue | 10 +- .../src/components/PanelDragButton.vue | 31 +- .../src/components/ParameterInput.vue | 1487 ++-- .../src/components/ParameterInputExpanded.vue | 40 +- .../src/components/ParameterInputFull.vue | 396 +- .../src/components/ParameterInputHint.vue | 40 +- .../src/components/ParameterInputList.vue | 446 +- .../src/components/ParameterInputWrapper.vue | 348 +- .../src/components/ParameterIssues.vue | 6 +- .../src/components/ParameterOptions.vue | 27 +- .../src/components/PersonalizationModal.vue | 51 +- .../src/components/PushConnectionTracker.vue | 17 +- .../ResourceLocator/ResourceLocator.vue | 97 +- .../ResourceLocatorDropdown.vue | 80 +- packages/editor-ui/src/components/RunData.vue | 1763 +++-- .../src/components/RunDataJson.test.ts | 27 +- .../editor-ui/src/components/RunDataJson.vue | 79 +- .../src/components/RunDataJsonActions.vue | 54 +- .../src/components/RunDataSchema.test.ts | 26 +- .../src/components/RunDataSchema.vue | 43 +- .../src/components/RunDataSchemaItem.vue | 60 +- .../editor-ui/src/components/RunDataTable.vue | 90 +- .../editor-ui/src/components/SaveButton.vue | 2 +- .../editor-ui/src/components/ScopesNotice.vue | 57 +- .../src/components/SettingsSidebar.vue | 49 +- .../editor-ui/src/components/ShortenName.vue | 14 +- packages/editor-ui/src/components/Sticky.vue | 85 +- .../src/components/TagsContainer.vue | 89 +- .../editor-ui/src/components/TagsDropdown.vue | 86 +- .../src/components/TagsManager/NoTagsView.vue | 19 +- .../components/TagsManager/TagsManager.vue | 78 +- .../TagsManager/TagsView/TagsTable.vue | 79 +- .../TagsManager/TagsView/TagsTableHeader.vue | 19 +- .../TagsManager/TagsView/TagsView.vue | 96 +- .../editor-ui/src/components/Telemetry.vue | 30 +- .../editor-ui/src/components/TemplateCard.vue | 12 +- .../src/components/TemplateDetails.vue | 4 +- .../src/components/TemplateFilters.vue | 4 +- .../editor-ui/src/components/TemplateList.vue | 5 +- .../editor-ui/src/components/TextEdit.vue | 45 +- packages/editor-ui/src/components/TimeAgo.vue | 9 +- .../editor-ui/src/components/TitledList.vue | 4 +- .../editor-ui/src/components/TriggerPanel.vue | 13 +- .../editor-ui/src/components/UpdatesPanel.vue | 52 +- .../editor-ui/src/components/ValueSurvey.vue | 19 +- .../src/components/VariableSelector.vue | 1372 ++-- .../src/components/VariableSelectorItem.vue | 79 +- .../editor-ui/src/components/VersionCard.vue | 127 +- .../src/components/WarningTooltip.vue | 13 +- .../src/components/WorkflowActivator.vue | 173 +- .../editor-ui/src/components/WorkflowCard.vue | 168 +- .../src/components/WorkflowPreview.vue | 29 +- .../src/components/WorkflowSettings.vue | 349 +- .../src/components/WorkflowShareModal.ee.vue | 222 +- .../src/components/forms/CodeEditor.vue | 4 +- .../forms/ResourceFiltersDropdown.vue | 39 +- .../forms/ResourceOwnershipSelect.ee.vue | 12 +- .../layouts/ResourcesListLayout.vue | 135 +- .../transitions/SlideTransition.vue | 1 - .../src/composables/useGlobalLinkActions.ts | 5 +- packages/editor-ui/src/constants.ts | 91 +- .../src/declarations/normalize-wheel.d.ts | 9 +- packages/editor-ui/src/main.ts | 8 +- packages/editor-ui/src/mixins/copyPaste.ts | 107 +- packages/editor-ui/src/mixins/debounce.ts | 13 +- packages/editor-ui/src/mixins/emitter.ts | 11 +- .../editor-ui/src/mixins/executionsHelpers.ts | 35 +- .../editor-ui/src/mixins/externalHooks.ts | 11 +- .../editor-ui/src/mixins/genericHelpers.ts | 30 +- packages/editor-ui/src/mixins/history.ts | 26 +- packages/editor-ui/src/mixins/mouseSelect.ts | 76 +- .../editor-ui/src/mixins/moveNodeWorkflow.ts | 14 +- packages/editor-ui/src/mixins/newVersions.ts | 9 +- packages/editor-ui/src/mixins/nodeBase.ts | 101 +- packages/editor-ui/src/mixins/nodeHelpers.ts | 925 +-- packages/editor-ui/src/mixins/pinData.ts | 26 +- .../editor-ui/src/mixins/pushConnection.ts | 752 +- packages/editor-ui/src/mixins/restApi.ts | 44 +- packages/editor-ui/src/mixins/showMessage.ts | 76 +- packages/editor-ui/src/mixins/titleChange.ts | 5 +- packages/editor-ui/src/mixins/userHelpers.ts | 2 +- .../editor-ui/src/mixins/workflowActivate.ts | 184 +- .../editor-ui/src/mixins/workflowHelpers.ts | 1686 ++-- packages/editor-ui/src/mixins/workflowRun.ts | 37 +- packages/editor-ui/src/models/history.ts | 71 +- .../editor-ui/src/n8n-theme-variables.scss | 22 +- packages/editor-ui/src/n8n-theme.scss | 3 - packages/editor-ui/src/permissions.ts | 95 +- .../src/plugins/N8nCustomConnectorType.js | 390 +- .../editor-ui/src/plugins/PlusEndpointType.js | 53 +- packages/editor-ui/src/plugins/components.ts | 30 +- packages/editor-ui/src/plugins/directives.ts | 2 +- .../src/plugins/i18n/docs/ADDENDUM.md | 8 +- .../editor-ui/src/plugins/i18n/docs/README.md | 16 +- packages/editor-ui/src/plugins/i18n/index.ts | 102 +- packages/editor-ui/src/plugins/i18n/utils.ts | 15 +- packages/editor-ui/src/plugins/icons.ts | 8 +- .../editor-ui/src/plugins/telemetry/index.ts | 128 +- .../src/plugins/telemetry/telemetry.types.ts | 37 +- packages/editor-ui/src/router.ts | 9 +- packages/editor-ui/src/shims.d.ts | 7 +- packages/editor-ui/src/stores/canvas.ts | 39 +- .../editor-ui/src/stores/communityNodes.ts | 49 +- packages/editor-ui/src/stores/credentials.ts | 136 +- packages/editor-ui/src/stores/history.ts | 11 +- packages/editor-ui/src/stores/n8nRootStore.ts | 8 +- packages/editor-ui/src/stores/ndv.ts | 64 +- packages/editor-ui/src/stores/nodeCreator.ts | 244 +- packages/editor-ui/src/stores/nodeTypes.ts | 145 +- packages/editor-ui/src/stores/settings.ts | 108 +- packages/editor-ui/src/stores/tags.ts | 33 +- packages/editor-ui/src/stores/templates.ts | 539 +- packages/editor-ui/src/stores/ui.ts | 57 +- packages/editor-ui/src/stores/users.ts | 110 +- packages/editor-ui/src/stores/versions.ts | 15 +- packages/editor-ui/src/stores/webhooks.ts | 38 +- packages/editor-ui/src/stores/workflows.ee.ts | 57 +- packages/editor-ui/src/stores/workflows.ts | 295 +- .../src/utils/__tests__/typesUtils.test.ts | 547 +- packages/editor-ui/src/utils/apiUtils.ts | 46 +- packages/editor-ui/src/utils/canvasUtils.ts | 40 +- packages/editor-ui/src/utils/htmlUtils.ts | 10 +- .../editor-ui/src/utils/nodeTypesUtils.ts | 279 +- packages/editor-ui/src/utils/nodeViewUtils.ts | 298 +- .../editor-ui/src/utils/pairedItemUtils.ts | 52 +- packages/editor-ui/src/utils/sortUtils.ts | 89 +- packages/editor-ui/src/utils/typeGuards.ts | 7 +- packages/editor-ui/src/utils/typesUtils.ts | 138 +- packages/editor-ui/src/utils/userUtils.ts | 181 +- packages/editor-ui/src/views/AuthView.vue | 13 +- .../editor-ui/src/views/CanvasAddButton.vue | 22 +- .../src/views/ChangePasswordView.vue | 42 +- .../editor-ui/src/views/CredentialsView.vue | 55 +- packages/editor-ui/src/views/ErrorView.vue | 7 +- .../src/views/ForgotMyPasswordView.vue | 24 +- packages/editor-ui/src/views/LoadingView.vue | 2 +- packages/editor-ui/src/views/NodeView.vue | 6929 +++++++++-------- .../editor-ui/src/views/SettingsApiView.vue | 28 +- .../src/views/SettingsCommunityNodesView.vue | 127 +- .../src/views/SettingsFakeDoorView.vue | 2 +- .../src/views/SettingsPersonalView.vue | 47 +- .../editor-ui/src/views/SettingsUsersView.vue | 60 +- packages/editor-ui/src/views/SettingsView.vue | 2 +- packages/editor-ui/src/views/SetupView.vue | 56 +- packages/editor-ui/src/views/SigninView.vue | 11 +- packages/editor-ui/src/views/SignupView.vue | 53 +- .../src/views/TemplatesCollectionView.vue | 15 +- .../src/views/TemplatesSearchView.vue | 45 +- .../src/views/TemplatesWorkflowView.vue | 7 +- .../editor-ui/src/views/WorkflowsView.vue | 91 +- packages/editor-ui/tslint.json | 63 +- packages/editor-ui/vite.config.ts | 28 +- packages/editor-ui/vue.config.js | 24 +- 284 files changed, 19247 insertions(+), 15540 deletions(-) diff --git a/.prettierignore b/.prettierignore index bf2e30613a..c5faf0aa47 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,5 +1,4 @@ coverage dist -packages/editor-ui package.json .pnpm-lock.yml diff --git a/packages/editor-ui/.eslintrc.js b/packages/editor-ui/.eslintrc.js index 448f378e82..af3078e56a 100644 --- a/packages/editor-ui/.eslintrc.js +++ b/packages/editor-ui/.eslintrc.js @@ -19,7 +19,7 @@ module.exports = { 'import/no-default-export': 'off', 'import/no-extraneous-dependencies': 'off', 'import/order': 'off', - 'indent': 'off', + indent: 'off', 'prettier/prettier': 'off', '@typescript-eslint/ban-types': 'off', '@typescript-eslint/dot-notation': 'off', diff --git a/packages/editor-ui/README.md b/packages/editor-ui/README.md index 49e1a4f7b2..3edb2965e7 100644 --- a/packages/editor-ui/README.md +++ b/packages/editor-ui/README.md @@ -9,43 +9,50 @@ npm install n8n -g ``` ## Project setup + ``` pnpm install ``` ### Compiles and hot-reloads for development + ``` pnpm serve ``` ### Compiles and minifies for production + ``` pnpm build ``` ### Run your tests + ``` pnpm test ``` ### Lints and fixes files + ``` pnpm lint ``` ### Run your end-to-end tests + ``` pnpm test:e2e ``` ### Run your unit tests + ``` pnpm test:unit ``` ### Customize configuration -See [Configuration Reference](https://cli.vuejs.org/config/). +See [Configuration Reference](https://cli.vuejs.org/config/). ## License diff --git a/packages/editor-ui/index.html b/packages/editor-ui/index.html index 2eea7165e0..0dc44757dc 100644 --- a/packages/editor-ui/index.html +++ b/packages/editor-ui/index.html @@ -1,18 +1,23 @@ - - - - - - - n8n.io - Workflow Automation - - - -
- - + + + + + + + n8n.io - Workflow Automation + + + +
+ + diff --git a/packages/editor-ui/package.json b/packages/editor-ui/package.json index b486e37796..2aa39a53c6 100644 --- a/packages/editor-ui/package.json +++ b/packages/editor-ui/package.json @@ -20,7 +20,7 @@ "dev": "pnpm serve", "lint": "tslint -p tsconfig.json -c tslint.json && eslint --ext .js,.ts,.vue src", "lintfix": "tslint --fix -p tsconfig.json -c tslint.json && eslint --ext .js,.ts,.vue src --fix", - "format": "prettier **/**.{ts,vue} --write", + "format": "prettier --write . --ignore-path ../../.prettierignore", "serve": "cross-env VUE_APP_URL_BASE_API=http://localhost:5678/ vite --host 0.0.0.0 --port 8080 dev", "test": "vitest run", "test:ci": "vitest run --coverage", diff --git a/packages/editor-ui/src/App.vue b/packages/editor-ui/src/App.vue index 62027afc37..3052a95712 100644 --- a/packages/editor-ui/src/App.vue +++ b/packages/editor-ui/src/App.vue @@ -6,7 +6,7 @@ id="app" :class="{ [$style.container]: true, - [$style.sidebarCollapsed]: uiStore.sidebarMenuCollapsed + [$style.sidebarCollapsed]: uiStore.sidebarMenuCollapsed, }" >