From 34991d6f58c60f36a8cb0a8fee4753c5de09eb51 Mon Sep 17 00:00:00 2001 From: Suguru Inoue Date: Thu, 31 Jul 2025 09:41:00 +0200 Subject: [PATCH] fix(editor): Pass down correct props to NodeSettings (no-changelog) (#17820) --- .../src/components/NodeDetailsViewV2.vue | 25 +++---------------- .../editor-ui/src/components/NodeSettings.vue | 8 ++---- .../ExperimentalCanvasNodeSettings.vue | 24 ++++++++++++------ 3 files changed, 21 insertions(+), 36 deletions(-) diff --git a/packages/frontend/editor-ui/src/components/NodeDetailsViewV2.vue b/packages/frontend/editor-ui/src/components/NodeDetailsViewV2.vue index e7082cefca..659f6f7f1b 100644 --- a/packages/frontend/editor-ui/src/components/NodeDetailsViewV2.vue +++ b/packages/frontend/editor-ui/src/components/NodeDetailsViewV2.vue @@ -25,7 +25,6 @@ import { useTelemetry } from '@/composables/useTelemetry'; import { useWorkflowActivate } from '@/composables/useWorkflowActivate'; import { APP_MODALS_ELEMENT_ID, - EnterpriseEditionFeature, EXECUTABLE_TRIGGER_NODE_TYPES, MODAL_CONFIRM, START_NODE_TYPE, @@ -35,7 +34,6 @@ import type { DataPinningDiscoveryEvent } from '@/event-bus'; import { dataPinningEventBus } from '@/event-bus'; import { useNDVStore } from '@/stores/ndv.store'; import { useNodeTypesStore } from '@/stores/nodeTypes.store'; -import { useSettingsStore } from '@/stores/settings.store'; import { useUIStore } from '@/stores/ui.store'; import { useWorkflowsStore } from '@/stores/workflows.store'; import { getNodeIconSource } from '@/utils/nodeIcon'; @@ -77,7 +75,6 @@ const workflowActivate = useWorkflowActivate(); const nodeTypesStore = useNodeTypesStore(); const uiStore = useUIStore(); const workflowsStore = useWorkflowsStore(); -const settingsStore = useSettingsStore(); const deviceSupport = useDeviceSupport(); const telemetry = useTelemetry(); const i18n = useI18n(); @@ -309,25 +306,9 @@ const isExecutionWaitingForWebhook = computed(() => workflowsStore.executionWait const blockUi = computed(() => isWorkflowRunning.value || isExecutionWaitingForWebhook.value); -const foreignCredentials = computed(() => { - const credentials = activeNode.value?.credentials; - const usedCredentials = workflowsStore.usedCredentials; - - const foreignCredentialsArray: string[] = []; - if (credentials && settingsStore.isEnterpriseFeatureEnabled[EnterpriseEditionFeature.Sharing]) { - Object.values(credentials).forEach((credential) => { - if ( - credential.id && - usedCredentials[credential.id] && - !usedCredentials[credential.id].currentUserHasAccess - ) { - foreignCredentialsArray.push(credential.id); - } - }); - } - - return foreignCredentialsArray; -}); +const foreignCredentials = computed(() => + nodeHelpers.getForeignCredentialsIfSharingEnabled(activeNode.value?.credentials), +); const hasForeignCredential = computed(() => foreignCredentials.value.length > 0); diff --git a/packages/frontend/editor-ui/src/components/NodeSettings.vue b/packages/frontend/editor-ui/src/components/NodeSettings.vue index a4d6a6cc16..7daec52d8b 100644 --- a/packages/frontend/editor-ui/src/components/NodeSettings.vue +++ b/packages/frontend/editor-ui/src/components/NodeSettings.vue @@ -59,24 +59,20 @@ import NodeSettingsInvalidNodeWarning from '@/components/NodeSettingsInvalidNode const props = withDefaults( defineProps<{ - eventBus: EventBus; + eventBus?: EventBus; dragging: boolean; pushRef: string; readOnly: boolean; foreignCredentials: string[]; blockUI: boolean; executable: boolean; - inputSize: number; + inputSize?: number; activeNode?: INodeUi; isEmbeddedInCanvas?: boolean; subTitle?: string; }>(), { - foreignCredentials: () => [], - readOnly: false, - executable: true, inputSize: 0, - blockUI: false, activeNode: undefined, isEmbeddedInCanvas: false, subTitle: undefined, diff --git a/packages/frontend/editor-ui/src/components/canvas/experimental/components/ExperimentalCanvasNodeSettings.vue b/packages/frontend/editor-ui/src/components/canvas/experimental/components/ExperimentalCanvasNodeSettings.vue index 7605dc2f45..f6a09b2125 100644 --- a/packages/frontend/editor-ui/src/components/canvas/experimental/components/ExperimentalCanvasNodeSettings.vue +++ b/packages/frontend/editor-ui/src/components/canvas/experimental/components/ExperimentalCanvasNodeSettings.vue @@ -1,9 +1,11 @@