mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
fix: Fix foreign credentials being shown for new nodes (#4622)
* feat: Extract usedCredentials into separate store entry and fix foreign credentials being shown for new nodes * chore: adjust spacing
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
STORES,
|
||||
} from "@/constants";
|
||||
import {
|
||||
ICredentialMap,
|
||||
IExecutionResponse,
|
||||
IExecutionsCurrentSummaryExtended,
|
||||
IExecutionsSummary,
|
||||
@@ -16,6 +17,7 @@ import {
|
||||
IPushDataExecutionFinished,
|
||||
IPushDataNodeExecuteAfter,
|
||||
IUpdateInformation,
|
||||
IUsedCredential,
|
||||
IWorkflowDb,
|
||||
IWorkflowsMap,
|
||||
WorkflowsState,
|
||||
@@ -37,6 +39,7 @@ import {
|
||||
IWorkflowSettings,
|
||||
} from 'n8n-workflow';
|
||||
import Vue from "vue";
|
||||
|
||||
import {useRootStore} from "./n8nRootStore";
|
||||
import {
|
||||
getActiveWorkflows,
|
||||
@@ -73,6 +76,7 @@ const createEmptyWorkflow = (): IWorkflowDb => ({
|
||||
export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
|
||||
state: (): WorkflowsState => ({
|
||||
workflow: createEmptyWorkflow(),
|
||||
usedCredentials: {},
|
||||
activeWorkflows: [],
|
||||
activeExecutions: [],
|
||||
currentWorkflowExecutions: [],
|
||||
@@ -266,6 +270,13 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
|
||||
this.workflow.id = id === 'new' ? PLACEHOLDER_EMPTY_WORKFLOW_ID : id;
|
||||
},
|
||||
|
||||
setUsedCredentials(data: IUsedCredential[]) {
|
||||
this.usedCredentials = data.reduce<{ [name: string]: IUsedCredential }>((accu, credential) => {
|
||||
accu[credential.id!] = credential;
|
||||
return accu;
|
||||
}, {});
|
||||
},
|
||||
|
||||
setWorkflowName(data: { newName: string, setStateDirty: boolean }): void {
|
||||
if (data.setStateDirty === true) {
|
||||
const uiStore = useUIStore();
|
||||
|
||||
Reference in New Issue
Block a user