From 51fb913d37d3f8ba67d074bbe8e8200f3f4eabcc Mon Sep 17 00:00:00 2001 From: Csaba Tuncsik Date: Mon, 15 May 2023 18:41:13 +0200 Subject: [PATCH] refactor(editor): Turn showMessage mixin to composable (#6081) (#6244) * refactor(editor): Turn showMessage mixin to composable (#6081) * refactor(editor): move $getExecutionError from showMessages mixin to pushConnection (it is used there only) * refactor(editor): resolve showMessage mixin methods * fix(editor): use composable instead of mixin * fix(editor): resolve conflicts * fix(editor): replace clearAllStickyNotifications * fix(editor): replace confirmMessage * fix(editor): replace confirmMessage * fix(editor): replace confirmMessage * fix(editor): remove last confirmMessage usage * fix(editor): remove $prompt usage * fix(editor): remove $show methods * fix(editor): lint fix * fix(editor): lint fix * fix(editor): fixes after review * fix(editor): Fix external hook call in App * fix(editor): mixins & composables * fix: add pushConnection setup composables to components as well * fix(editor): mixins & composables * fix(editor): mixins & composables * fix: add void on non-await async calls * fix: fix close without connecting confirmation * fix: remove .only --------- Co-authored-by: Alex Grozav --- packages/editor-ui/src/App.vue | 42 ++-- .../src/components/ChangePasswordModal.vue | 19 +- .../src/components/CommunityPackageCard.vue | 7 +- .../CommunityPackageInstallModal.vue | 19 +- .../CommunityPackageManageConfirmModal.vue | 26 +- .../src/components/ContactPromptModal.vue | 10 +- .../editor-ui/src/components/CopyInput.vue | 11 +- .../src/components/CredentialCard.vue | 26 +- .../CredentialEdit/CredentialEdit.vue | 92 ++++--- .../CredentialEdit/CredentialSharing.ee.vue | 32 ++- .../src/components/DeleteUserModal.vue | 20 +- .../components/DuplicateWorkflowDialog.vue | 17 +- .../src/components/Error/NodeErrorView.vue | 12 +- .../src/components/ExecutionsList.vue | 50 ++-- .../ExecutionsView/ExecutionCard.vue | 3 +- .../ExecutionsView/ExecutionPreview.vue | 25 +- .../ExecutionsView/ExecutionsList.vue | 60 +++-- .../src/components/ExpressionEdit.vue | 4 +- .../src/components/ImportCurlModal.vue | 21 +- .../src/components/ImportParameter.vue | 5 +- .../src/components/InlineNameEdit.vue | 13 +- .../src/components/InviteUsersModal.vue | 19 +- .../src/components/MainHeader/MainHeader.vue | 11 +- .../components/MainHeader/WorkflowDetails.vue | 31 ++- .../editor-ui/src/components/MainSidebar.vue | 35 ++- .../src/components/NodeCredentials.vue | 11 +- .../src/components/NodeDetailsView.vue | 30 +-- .../src/components/NodeExecuteButton.vue | 27 +- .../src/components/NodeSettingsTabs.vue | 2 +- .../editor-ui/src/components/NodeWebhooks.vue | 11 +- .../components/OnboardingCallSignupModal.vue | 15 +- .../editor-ui/src/components/PageAlert.vue | 20 +- .../src/components/ParameterInput.vue | 17 +- .../src/components/ParameterInputFull.vue | 13 +- .../src/components/ParameterInputWrapper.vue | 5 +- .../src/components/PersonalizationModal.vue | 15 +- packages/editor-ui/src/components/RunData.vue | 17 +- .../src/components/RunDataJsonActions.vue | 12 +- .../EventDestinationCard.ee.vue | 29 ++- .../EventDestinationSettingsModal.ee.vue | 54 ++-- .../editor-ui/src/components/TagsDropdown.vue | 13 +- .../components/TagsManager/TagsManager.vue | 21 +- .../editor-ui/src/components/TriggerPanel.vue | 21 +- .../editor-ui/src/components/ValueSurvey.vue | 10 +- .../src/components/WorkflowActivator.vue | 18 +- .../editor-ui/src/components/WorkflowCard.vue | 33 ++- .../src/components/WorkflowPreview.vue | 17 +- .../src/components/WorkflowSettings.vue | 35 ++- .../src/components/WorkflowShareModal.ee.vue | 55 ++-- .../__tests__/ExecutionsList.test.ts | 3 +- .../layouts/ResourcesListLayout.vue | 5 +- packages/editor-ui/src/composables/index.ts | 7 +- .../src/composables/useTitleChange.ts | 30 ++- .../editor-ui/src/composables/useToast.ts | 26 +- packages/editor-ui/src/constants.ts | 2 +- .../editor-ui/src/mixins/genericHelpers.ts | 13 +- packages/editor-ui/src/mixins/newVersions.ts | 13 +- packages/editor-ui/src/mixins/nodeHelpers.ts | 4 +- packages/editor-ui/src/mixins/pinData.ts | 10 +- .../editor-ui/src/mixins/pushConnection.ts | 66 +++-- packages/editor-ui/src/mixins/showMessage.ts | 235 ------------------ .../editor-ui/src/mixins/workflowActivate.ts | 22 +- .../editor-ui/src/mixins/workflowHelpers.ts | 37 ++- packages/editor-ui/src/mixins/workflowRun.ts | 14 +- .../src/plugins/i18n/locales/en.json | 4 +- .../src/views/ChangePasswordView.vue | 21 +- .../editor-ui/src/views/CredentialsView.vue | 18 +- .../src/views/ForgotMyPasswordView.vue | 15 +- packages/editor-ui/src/views/NodeView.vue | 209 +++++++++------- .../editor-ui/src/views/SettingsApiView.vue | 33 ++- .../src/views/SettingsCommunityNodesView.vue | 15 +- .../editor-ui/src/views/SettingsLdapView.vue | 50 ++-- .../src/views/SettingsPersonalView.vue | 15 +- .../editor-ui/src/views/SettingsUsersView.vue | 17 +- packages/editor-ui/src/views/SetupView.vue | 38 +-- packages/editor-ui/src/views/SigninView.vue | 13 +- packages/editor-ui/src/views/SignoutView.vue | 13 +- packages/editor-ui/src/views/SignupView.vue | 19 +- .../src/views/TemplatesSearchView.vue | 10 +- .../editor-ui/src/views/WorkflowsView.vue | 18 +- 80 files changed, 1127 insertions(+), 979 deletions(-) delete mode 100644 packages/editor-ui/src/mixins/showMessage.ts diff --git a/packages/editor-ui/src/App.vue b/packages/editor-ui/src/App.vue index 7bbd5c668a400..1f89001a8a3e9 100644 --- a/packages/editor-ui/src/App.vue +++ b/packages/editor-ui/src/App.vue @@ -27,39 +27,43 @@