From bae3098e4e1d7ec9da4ad6ce1a4666a2e40efd00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milorad=20FIlipovi=C4=87?= Date: Wed, 9 Nov 2022 10:01:50 +0100 Subject: [PATCH] refactor(editor): Finish pinia migration, remove all vuex dependancies (#4533) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ✨ Added pinia support. Migrated community nodes module. * ✨ Added ui pinia store, moved some data from root store to it, updated modals to work with pinia stores * ✨ Added ui pinia store and migrated a part of the root store * ✨ Migrated `settings` store to pinia * ✨ Removing vuex store refs from router * ✨ Migrated `users` module to pinia store * ⚡ Fixing errors after sync with master * ⚡ One more error after merge * ⚡ Created `workflows` pinia store. Moved large part of root store to it. Started updating references. * ✨ Finished migrating workflows store to pinia * ⚡ Renaming some getters and actions to make more sense * ✨ Finished migrating the root store to pinia * ✨ Migrated ndv store to pinia * ⚡ Renaming main panel dimensions getter so it doesn't clash with data prop name * ✔️ Fixing lint errors * ✨ Migrated `templates` store to pinia * ✨ Migrated the `nodeTypes`store * ⚡ Removed unused pieces of code and oold vuex modules * ✨ Adding vuex calls to pinia store, fixing wrong references * 💄 Removing leftover $store refs * ⚡ Added legacy getters and mutations to store to support webhooks * ⚡ Added missing front-end hooks, updated vuex state subscriptions to pinia * ✔️ Fixing linting errors * ⚡ Removing vue composition api plugin * ⚡ Fixing main sidebar state when loading node view * 🐛 Fixing an error when activating workflows * 🐛 Fixing isses with workflow settings and executions auto-refresh * 🐛 Removing duplicate listeners which cause import error * 🐛 Fixing route authentication * ⚡ Updating freshly pulled $store refs * ⚡ Adding deleted const * ⚡ Updating store references in ee features. Reseting NodeView credentials update flag when resetting workspace * ⚡ Adding return type to email submission modal * ⚡ Making NodeView only react to paste event when active * 🐛 Fixing signup view errors * ✨ Started migrating the `credentials` module to pinia * 👌 Addressing PR review comments * ✨ Migrated permissions module to pinia * ✨ Migrated `nodeCreator`, `tags` and `versions` modules to pinia * ✨ Implemented webhooks pinia store * ⚡ Removing all leftover vuex files and references * ✨ Removing final vuex refs * ⚡ Updating expected credentialId type * ⚡ Removing node credentials subscription code, reducing node click debounce timeout * 🐛 Fixing pushing nodes downstream when inserting new node * ✔️ Fixing a lint error in new type guard * ⚡ Updating helper reference * ✔️ Removing unnecessary awaits * ⚡ fix(editor): remove unnecessary imports from NDV * ⚡ Merging mapStores blocks in NodeView * ⚡ fix(editor): make sure JS Plumb not loaded earlier than needed * ⚡ Updating type guard nad credentials subscriptions * ⚡ Updating type guard so it doesn't use `any` type Co-authored-by: Csaba Tuncsik --- packages/editor-ui/package.json | 1 - packages/editor-ui/src/Interface.ts | 2 +- .../src/components/CredentialCard.vue | 20 +- .../CredentialEdit/CredentialConfig.vue | 4 +- .../CredentialEdit/CredentialEdit.vue | 88 ++--- .../CredentialEdit/CredentialSharing.ee.vue | 8 +- .../src/components/CredentialIcon.vue | 22 +- .../src/components/CredentialsSelect.vue | 16 +- .../src/components/CredentialsSelectModal.vue | 8 +- .../ExecutionsView/ExecutionsView.vue | 4 +- .../src/components/InviteUsersModal.vue | 2 +- .../components/MainHeader/WorkflowDetails.vue | 5 +- .../editor-ui/src/components/MainSidebar.vue | 14 +- packages/editor-ui/src/components/Node.vue | 2 +- .../Node/NodeCreator/CategorizedItems.vue | 24 +- .../Node/NodeCreator/CategoryItem.vue | 4 +- .../components/Node/NodeCreator/MainPanel.vue | 8 +- .../Node/NodeCreator/NodeCreator.vue | 6 +- .../Node/NodeCreator/TypeSelector.vue | 14 +- .../src/components/NodeCredentials.vue | 78 ++--- .../src/components/NodeDetailsView.vue | 1 - .../editor-ui/src/components/NodeSettings.vue | 2 +- .../src/components/ParameterInput.vue | 10 +- .../src/components/PersonalizationModal.vue | 2 +- .../editor-ui/src/components/ScopesNotice.vue | 9 +- .../src/components/TagsContainer.vue | 7 +- .../editor-ui/src/components/TagsDropdown.vue | 22 +- .../components/TagsManager/TagsManager.vue | 28 +- .../TagsManager/TagsView/TagsView.vue | 1 - .../editor-ui/src/components/Telemetry.vue | 1 - packages/editor-ui/src/components/TimeAgo.vue | 1 - .../editor-ui/src/components/UpdatesPanel.vue | 17 +- .../editor-ui/src/components/WorkflowCard.vue | 2 +- .../src/components/WorkflowSettings.vue | 2 - .../src/components/mixins/externalHooks.ts | 8 +- .../src/components/mixins/newVersions.ts | 17 +- .../src/components/mixins/nodeHelpers.ts | 24 +- .../src/components/mixins/pushConnection.ts | 4 +- .../src/components/mixins/userHelpers.ts | 2 +- packages/editor-ui/src/constants.ts | 5 + packages/editor-ui/src/main.ts | 12 +- .../editor-ui/src/modules/credentials.ee.ts | 54 --- packages/editor-ui/src/modules/credentials.ts | 313 ------------------ packages/editor-ui/src/modules/nodeCreator.ts | 39 --- packages/editor-ui/src/modules/tags.ts | 112 ------- packages/editor-ui/src/modules/versions.ts | 64 ---- packages/editor-ui/src/permissions.ts | 5 +- packages/editor-ui/src/plugins/i18n/index.ts | 3 +- .../editor-ui/src/plugins/telemetry/index.ts | 16 +- packages/editor-ui/src/router.ts | 2 +- packages/editor-ui/src/store.ts | 89 ----- packages/editor-ui/src/stores/credentials.ts | 305 +++++++++++++++++ packages/editor-ui/src/stores/nodeCreator.ts | 12 + packages/editor-ui/src/stores/nodeTypes.ts | 8 +- .../{modules => stores}/nodeTypesHelpers.ts | 0 packages/editor-ui/src/stores/settings.ts | 4 +- packages/editor-ui/src/stores/tags.ts | 102 ++++++ .../src/{modules => stores}/userHelpers.ts | 0 packages/editor-ui/src/stores/users.ts | 2 +- packages/editor-ui/src/stores/versions.ts | 50 +++ packages/editor-ui/src/stores/webhooks.ts | 65 ++++ packages/editor-ui/src/stores/workflows.ts | 2 +- packages/editor-ui/src/typeGuards.ts | 5 + .../editor-ui/src/views/CanvasAddButton.vue | 7 +- .../editor-ui/src/views/CredentialsView.vue | 17 +- .../src/views/ForgotMyPasswordView.vue | 1 - packages/editor-ui/src/views/NodeView.vue | 48 +-- packages/editor-ui/src/views/SetupView.vue | 4 +- packages/editor-ui/vite.config.ts | 2 +- 69 files changed, 891 insertions(+), 947 deletions(-) delete mode 100644 packages/editor-ui/src/modules/credentials.ee.ts delete mode 100644 packages/editor-ui/src/modules/credentials.ts delete mode 100644 packages/editor-ui/src/modules/nodeCreator.ts delete mode 100644 packages/editor-ui/src/modules/tags.ts delete mode 100644 packages/editor-ui/src/modules/versions.ts delete mode 100644 packages/editor-ui/src/store.ts create mode 100644 packages/editor-ui/src/stores/credentials.ts create mode 100644 packages/editor-ui/src/stores/nodeCreator.ts rename packages/editor-ui/src/{modules => stores}/nodeTypesHelpers.ts (100%) create mode 100644 packages/editor-ui/src/stores/tags.ts rename packages/editor-ui/src/{modules => stores}/userHelpers.ts (100%) create mode 100644 packages/editor-ui/src/stores/versions.ts create mode 100644 packages/editor-ui/src/stores/webhooks.ts diff --git a/packages/editor-ui/package.json b/packages/editor-ui/package.json index 87ee34d555..a4903a9bba 100644 --- a/packages/editor-ui/package.json +++ b/packages/editor-ui/package.json @@ -76,7 +76,6 @@ "vue2-boring-avatars": "0.3.4", "vue2-teleport": "^1.0.1", "vue2-touch-events": "^3.2.1", - "vuex": "^3.6.2", "xss": "^1.0.10" }, "devDependencies": { diff --git a/packages/editor-ui/src/Interface.ts b/packages/editor-ui/src/Interface.ts index 5b41b9b9ec..32881943f6 100644 --- a/packages/editor-ui/src/Interface.ts +++ b/packages/editor-ui/src/Interface.ts @@ -992,7 +992,7 @@ export interface ICredentialsState { export interface ITagsState { tags: { [id: string]: ITag }; - isLoading: boolean; + loading: boolean; fetchedAll: boolean; fetchedUsageCount: boolean; } diff --git a/packages/editor-ui/src/components/CredentialCard.vue b/packages/editor-ui/src/components/CredentialCard.vue index 0f593172aa..782c549582 100644 --- a/packages/editor-ui/src/components/CredentialCard.vue +++ b/packages/editor-ui/src/components/CredentialCard.vue @@ -50,6 +50,7 @@ import dateformat from "dateformat"; import { mapStores } from 'pinia'; import { useUIStore } from '@/stores/ui'; import { useUsersStore } from '@/stores/users'; +import { useCredentialsStore } from '@/stores/credentials'; export const CREDENTIAL_LIST_ITEM_ACTIONS = { OPEN: 'open', @@ -89,19 +90,24 @@ export default mixins( }, computed: { ...mapStores( + useCredentialsStore, useUIStore, useUsersStore, ), - currentUser (): IUser { - return this.usersStore.currentUser || {} as IUser; + currentUser (): IUser | null { + return this.usersStore.currentUser; }, credentialType(): ICredentialType { - return this.$store.getters['credentials/getCredentialTypeByName'](this.data.type); + return this.credentialsStore.getCredentialTypeByName(this.data.type); }, - credentialPermissions(): IPermissions { - return getCredentialPermissions(this.currentUser, this.data, this.$store); + credentialPermissions(): IPermissions | null { + return !this.currentUser ? null : getCredentialPermissions(this.currentUser, this.data); }, actions(): Array<{ label: string; value: string; }> { + if (!this.credentialPermissions) { + return []; + } + return [ { label: this.$locale.baseText('credentials.item.open'), @@ -136,9 +142,7 @@ export default mixins( ); if (deleteConfirmed) { - await this.$store.dispatch('credentials/deleteCredential', { - id: this.data.id, - }); + this.credentialsStore.deleteCredential({ id: this.data.id }); } } }, diff --git a/packages/editor-ui/src/components/CredentialEdit/CredentialConfig.vue b/packages/editor-ui/src/components/CredentialEdit/CredentialConfig.vue index 70da5ade5b..eb72666044 100644 --- a/packages/editor-ui/src/components/CredentialEdit/CredentialConfig.vue +++ b/packages/editor-ui/src/components/CredentialEdit/CredentialConfig.vue @@ -107,6 +107,7 @@ import { useUIStore } from '@/stores/ui'; import { useWorkflowsStore } from '@/stores/workflows'; import { useRootStore } from '@/stores/n8nRootStore'; import { useNDVStore } from '@/stores/ndv'; +import { useCredentialsStore } from '@/stores/credentials'; export default mixins(restApi).extend({ name: 'CredentialConfig', @@ -182,6 +183,7 @@ export default mixins(restApi).extend({ }, computed: { ...mapStores( + useCredentialsStore, useNDVStore, useRootStore, useUIStore, @@ -202,7 +204,7 @@ export default mixins(restApi).extend({ return (this.credentialType as ICredentialType).name; }, credentialOwnerName(): string { - return this.$store.getters['credentials/getCredentialOwnerName'](this.credentialId); + return this.credentialsStore.getCredentialOwnerName(this.credentialId); }, documentationUrl(): string { const type = this.credentialType as ICredentialType; diff --git a/packages/editor-ui/src/components/CredentialEdit/CredentialEdit.vue b/packages/editor-ui/src/components/CredentialEdit/CredentialEdit.vue index 87690a47e7..caca64a435 100644 --- a/packages/editor-ui/src/components/CredentialEdit/CredentialEdit.vue +++ b/packages/editor-ui/src/components/CredentialEdit/CredentialEdit.vue @@ -106,7 +106,6 @@ import Vue from 'vue'; import { - ICredentialsDecryptedResponse, ICredentialsResponse, IFakeDoor, IUser, @@ -150,6 +149,8 @@ import { useSettingsStore } from '@/stores/settings'; import { useUsersStore } from '@/stores/users'; import { useWorkflowsStore } from '@/stores/workflows'; import { useNDVStore } from '@/stores/ndv'; +import { useCredentialsStore } from '@/stores/credentials'; +import { isValidCredentialResponse } from '@/typeGuards'; interface NodeAccessMap { [nodeType: string]: ICredentialNodeAccess | null; @@ -184,7 +185,7 @@ export default mixins(showMessage, nodeHelpers).extend({ return { activeTab: 'connection', authError: '', - credentialId: '' as string | number, + credentialId: '', credentialName: '', credentialData: {} as ICredentialDataDecryptedObject, modalBus: new Vue(), @@ -214,18 +215,17 @@ export default mixins(showMessage, nodeHelpers).extend({ {}, ); - if (this.mode === 'new') { - this.credentialName = await this.$store.dispatch( - 'credentials/getNewCredentialName', - { credentialTypeName: this.credentialTypeName }, - ); + if (this.mode === 'new' && this.credentialTypeName) { + this.credentialName = await this.credentialsStore.getNewCredentialName({ credentialTypeName: this.credentialTypeName }); - Vue.set(this.credentialData, 'ownedBy', { - id: this.currentUser.id, - firstName: this.currentUser.firstName, - lastName: this.currentUser.lastName, - email: this.currentUser.email, - }); + if (this.currentUser) { + Vue.set(this.credentialData, 'ownedBy', { + id: this.currentUser.id, + firstName: this.currentUser.firstName, + lastName: this.currentUser.lastName, + email: this.currentUser.email, + }); + } } else { await this.loadCurrentCredential(); } @@ -259,23 +259,22 @@ export default mixins(showMessage, nodeHelpers).extend({ }, computed: { ...mapStores( + useCredentialsStore, useNDVStore, useSettingsStore, useUIStore, useUsersStore, useWorkflowsStore, ), - currentUser(): IUser { - return this.usersStore.currentUser || {} as IUser; + currentUser(): IUser | null { + return this.usersStore.currentUser; }, currentCredential(): ICredentialsResponse | null { if (!this.credentialId) { return null; } - return this.$store.getters['credentials/getCredentialById']( - this.credentialId, - ); + return this.credentialsStore.getCredentialById(this.credentialId); }, credentialTypeName(): string | null { if (this.mode === 'edit') { @@ -293,9 +292,7 @@ export default mixins(showMessage, nodeHelpers).extend({ return null; } - const type = this.$store.getters['credentials/getCredentialTypeByName']( - this.credentialTypeName, - ); + const type = this.credentialsStore.getCredentialTypeByName(this.credentialTypeName); if (!type) { return null; @@ -333,9 +330,7 @@ export default mixins(showMessage, nodeHelpers).extend({ }, nodesWithAccess(): INodeTypeDescription[] { if (this.credentialTypeName) { - return this.$store.getters['credentials/getNodesWithAccess']( - this.credentialTypeName, - ); + return this.credentialsStore.getNodesWithAccess(this.credentialTypeName); } return []; @@ -408,7 +403,7 @@ export default mixins(showMessage, nodeHelpers).extend({ return {}; } - return getCredentialPermissions(this.currentUser, (this.credentialId ? this.currentCredential : this.credentialData) as ICredentialsResponse, this.$store); + return getCredentialPermissions(this.currentUser, (this.credentialId ? this.currentCredential : this.credentialData) as ICredentialsResponse); }, sidebarItems(): IMenuItem[] { const items: IMenuItem[] = [ @@ -502,8 +497,7 @@ export default mixins(showMessage, nodeHelpers).extend({ ); }, getCredentialProperties(name: string): INodeProperties[] { - const credentialTypeData = - this.$store.getters['credentials/getCredentialTypeByName'](name); + const credentialTypeData = this.credentialsStore.getCredentialTypeByName(name); if (!credentialTypeData) { return []; @@ -536,9 +530,7 @@ export default mixins(showMessage, nodeHelpers).extend({ this.credentialId = this.activeId; try { - const currentCredentials: ICredentialsDecryptedResponse = await this.$store.dispatch('credentials/getCredentialData', { - id: this.credentialId, - }); + const currentCredentials = await this.credentialsStore.getCredentialData({ id: this.credentialId }); if (!currentCredentials) { throw new Error( @@ -622,8 +614,7 @@ export default mixins(showMessage, nodeHelpers).extend({ }, getParentTypes(name: string): string[] { - const credentialType = - this.$store.getters['credentials/getCredentialTypeByName'](name); + const credentialType = this.credentialsStore.getCredentialTypeByName(name); if ( credentialType === undefined || @@ -691,7 +682,7 @@ export default mixins(showMessage, nodeHelpers).extend({ }, async testCredential(credentialDetails: ICredentialsDecrypted) { - const result: INodeCredentialTestResult = await this.$store.dispatch('credentials/testCredential', credentialDetails); + const result = await this.credentialsStore.testCredential(credentialDetails); if (result.status === 'Error') { this.authError = result.message; this.testedSuccessfully = false; @@ -812,10 +803,7 @@ export default mixins(showMessage, nodeHelpers).extend({ let credential; try { - credential = (await this.$store.dispatch( - 'credentials/createNewCredential', - credentialDetails, - )) as ICredentialsResponse; + credential = await this.credentialsStore.createNewCredential(credentialDetails); this.hasUnsavedChanges = false; } catch (error) { this.$showError( @@ -846,10 +834,7 @@ export default mixins(showMessage, nodeHelpers).extend({ ): Promise { let credential; try { - credential = (await this.$store.dispatch( - 'credentials/updateCredential', - { id: this.credentialId, data: credentialDetails }, - )) as ICredentialsResponse; + credential = await this.credentialsStore.updateCredential({ id: this.credentialId, data: credentialDetails }); this.hasUnsavedChanges = false; } catch (error) { this.$showError( @@ -893,9 +878,7 @@ export default mixins(showMessage, nodeHelpers).extend({ try { this.isDeleting = true; - await this.$store.dispatch('credentials/deleteCredential', { - id: this.credentialId, - }); + this.credentialsStore.deleteCredential({ id: this.credentialId }); this.hasUnsavedChanges = false; } catch (error) { this.$showError( @@ -929,22 +912,21 @@ export default mixins(showMessage, nodeHelpers).extend({ const types = this.parentTypes; try { + const credData = { id: credential.id, ...this.credentialData }; if ( this.credentialTypeName === 'oAuth2Api' || types.includes('oAuth2Api') ) { - url = (await this.$store.dispatch('credentials/oAuth2Authorize', { - ...this.credentialData, - id: credential.id, - })) as string; + if (isValidCredentialResponse(credData)) { + url = await this.credentialsStore.oAuth2Authorize(credData); + } } else if ( this.credentialTypeName === 'oAuth1Api' || types.includes('oAuth1Api') ) { - url = (await this.$store.dispatch('credentials/oAuth1Authorize', { - ...this.credentialData, - id: credential.id, - })) as string; + if (isValidCredentialResponse(credData)) { + url = await this.credentialsStore.oAuth1Authorize(credData); + } } } catch (error) { this.$showError( @@ -971,7 +953,7 @@ export default mixins(showMessage, nodeHelpers).extend({ // Set some kind of data that status changes. // As data does not get displayed directly it does not matter what data. Vue.set(this.credentialData, 'oauthTokenData', {}); - this.$store.commit('credentials/enableOAuthCredential', credential); + this.credentialsStore.enableOAuthCredential(credential); // Close the window if (oauthPopup) { diff --git a/packages/editor-ui/src/components/CredentialEdit/CredentialSharing.ee.vue b/packages/editor-ui/src/components/CredentialEdit/CredentialSharing.ee.vue index d8575f548c..1cd94be649 100644 --- a/packages/editor-ui/src/components/CredentialEdit/CredentialSharing.ee.vue +++ b/packages/editor-ui/src/components/CredentialEdit/CredentialSharing.ee.vue @@ -39,6 +39,7 @@ import mixins from "vue-typed-mixins"; import {showMessage} from "@/components/mixins/showMessage"; import { mapStores } from 'pinia'; import { useUsersStore } from '@/stores/users'; +import { useCredentialsStore } from "@/stores/credentials"; export default mixins( showMessage, @@ -46,7 +47,10 @@ export default mixins( name: 'CredentialSharing', props: ['credential', 'credentialId', 'credentialData', 'sharedWith', 'credentialPermissions'], computed: { - ...mapStores(useUsersStore), + ...mapStores( + useCredentialsStore, + useUsersStore, + ), usersList(): IUser[] { return this.usersStore.allUsers.filter((user: IUser) => { const isCurrentUser = user.id === this.usersStore.currentUser?.id; @@ -64,7 +68,7 @@ export default mixins( ].concat(this.credentialData.sharedWith || []); }, credentialOwnerName(): string { - return this.$store.getters['credentials/getCredentialOwnerName'](this.credentialId); + return this.credentialsStore.getCredentialOwnerName(this.credentialId); }, }, methods: { diff --git a/packages/editor-ui/src/components/CredentialIcon.vue b/packages/editor-ui/src/components/CredentialIcon.vue index 084c311873..f4524cba59 100644 --- a/packages/editor-ui/src/components/CredentialIcon.vue +++ b/packages/editor-ui/src/components/CredentialIcon.vue @@ -7,6 +7,7 @@ diff --git a/packages/editor-ui/src/components/NodeDetailsView.vue b/packages/editor-ui/src/components/NodeDetailsView.vue index fbe3fe0248..d4c03a4f2f 100644 --- a/packages/editor-ui/src/components/NodeDetailsView.vue +++ b/packages/editor-ui/src/components/NodeDetailsView.vue @@ -132,7 +132,6 @@ import Vue from 'vue'; import OutputPanel from './OutputPanel.vue'; import InputPanel from './InputPanel.vue'; import TriggerPanel from './TriggerPanel.vue'; -import { mapGetters } from 'vuex'; import { BASE_NODE_SURVEY_URL, START_NODE_TYPE, diff --git a/packages/editor-ui/src/components/NodeSettings.vue b/packages/editor-ui/src/components/NodeSettings.vue index 8233284a80..4d0fa649e9 100644 --- a/packages/editor-ui/src/components/NodeSettings.vue +++ b/packages/editor-ui/src/components/NodeSettings.vue @@ -669,7 +669,7 @@ export default mixins(externalHooks, nodeHelpers).extend({ } // Update the data in vuex - const updateInformation = { + const updateInformation: IUpdateInformation = { name: node.name, value: nodeParameters, }; diff --git a/packages/editor-ui/src/components/ParameterInput.vue b/packages/editor-ui/src/components/ParameterInput.vue index 8cc801f8d1..8b52f585a7 100644 --- a/packages/editor-ui/src/components/ParameterInput.vue +++ b/packages/editor-ui/src/components/ParameterInput.vue @@ -335,7 +335,6 @@ import { isResourceLocatorValue } from '@/typeGuards'; import mixins from 'vue-typed-mixins'; import { CUSTOM_API_CALL_KEY } from '@/constants'; -import { mapGetters } from 'vuex'; import { CODE_NODE_TYPE } from '@/constants'; import { PropType } from 'vue'; import { debounceHelper } from './mixins/debounce'; @@ -343,6 +342,7 @@ import { mapStores } from 'pinia'; import { useWorkflowsStore } from '@/stores/workflows'; import { useNDVStore } from '@/stores/ndv'; import { useNodeTypesStore } from '@/stores/nodeTypes'; +import { useCredentialsStore } from '@/stores/credentials'; export default mixins( externalHooks, @@ -477,11 +477,11 @@ export default mixins( }, computed: { ...mapStores( + useCredentialsStore, useNodeTypesStore, useNDVStore, useWorkflowsStore, ), - ...mapGetters('credentials', ['allCredentialTypes']), expressionDisplayValue(): string { if (this.activeDrop || this.forceShowExpression) { return ''; @@ -563,14 +563,14 @@ export default mixins( returnValue = this.expressionEvaluated; } - if (this.parameter.type === 'credentialsSelect') { - const credType = this.$store.getters['credentials/getCredentialTypeByName'](this.value); + if (this.parameter.type === 'credentialsSelect' && typeof this.value === 'string') { + const credType = this.credentialsStore.getCredentialTypeByName(this.value); if (credType) { returnValue = credType.displayName; } } - if (this.parameter.type === 'color' && this.getArgument('showAlpha') === true && returnValue.charAt(0) === '#') { + if (Array.isArray(returnValue) && this.parameter.type === 'color' && this.getArgument('showAlpha') === true && returnValue.charAt(0) === '#') { // Convert the value to rgba that el-color-picker can display it correctly const bigint = parseInt(returnValue.slice(1), 16); const h = []; diff --git a/packages/editor-ui/src/components/PersonalizationModal.vue b/packages/editor-ui/src/components/PersonalizationModal.vue index b4f5348930..beb98f6e90 100644 --- a/packages/editor-ui/src/components/PersonalizationModal.vue +++ b/packages/editor-ui/src/components/PersonalizationModal.vue @@ -118,7 +118,7 @@ import { showMessage } from '@/components/mixins/showMessage'; import Modal from './Modal.vue'; import { IFormInputs, IPersonalizationLatestVersion, IPersonalizationSurveyAnswersV3, IUser } from '@/Interface'; import Vue from 'vue'; -import { getAccountAge } from '@/modules/userHelpers'; +import { getAccountAge } from '@/stores/userHelpers'; import { GenericValue } from 'n8n-workflow'; import { mapStores } from 'pinia'; import { useUIStore } from '@/stores/ui'; diff --git a/packages/editor-ui/src/components/ScopesNotice.vue b/packages/editor-ui/src/components/ScopesNotice.vue index 739ee8aa3a..c01d0cbc85 100644 --- a/packages/editor-ui/src/components/ScopesNotice.vue +++ b/packages/editor-ui/src/components/ScopesNotice.vue @@ -6,8 +6,9 @@