fix(editor): Pass down correct props to NodeSettings (no-changelog) (#17820)

This commit is contained in:
Suguru Inoue
2025-07-31 09:41:00 +02:00
committed by GitHub
parent 84d7376e6e
commit 34991d6f58
3 changed files with 21 additions and 36 deletions

View File

@@ -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);

View File

@@ -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,

View File

@@ -1,9 +1,11 @@
<script setup lang="ts">
import NodeSettings from '@/components/NodeSettings.vue';
import { useCanvasOperations } from '@/composables/useCanvasOperations';
import { useNodeHelpers } from '@/composables/useNodeHelpers';
import { type IUpdateInformation } from '@/Interface';
import { useNDVStore } from '@/stores/ndv.store';
import { useUIStore } from '@/stores/ui.store';
import { useWorkflowsStore } from '@/stores/workflows.store';
import { createEventBus } from '@n8n/utils/event-bus';
import { computed } from 'vue';
const { nodeId, isReadOnly, subTitle } = defineProps<{
@@ -14,11 +16,19 @@ const { nodeId, isReadOnly, subTitle } = defineProps<{
defineSlots<{ actions?: {} }>();
const settingsEventBus = createEventBus();
const workflowsStore = useWorkflowsStore();
const uiStore = useUIStore();
const { renameNode } = useCanvasOperations();
const nodeHelpers = useNodeHelpers();
const ndvStore = useNDVStore();
const activeNode = computed(() => workflowsStore.getNodeById(nodeId));
const foreignCredentials = computed(() =>
nodeHelpers.getForeignCredentialsIfSharingEnabled(activeNode.value?.credentials),
);
const isWorkflowRunning = computed(() => uiStore.isActionActive.workflowRunning);
const isExecutionWaitingForWebhook = computed(() => workflowsStore.executionWaitingForWebhook);
const blockUi = computed(() => isWorkflowRunning.value || isExecutionWaitingForWebhook.value);
function handleValueChanged(parameterData: IUpdateInformation) {
if (parameterData.name === 'name' && parameterData.oldValue) {
@@ -52,15 +62,13 @@ function handleCaptureWheelEvent(event: WheelEvent) {
<template>
<NodeSettings
:event-bus="settingsEventBus"
:dragging="false"
:active-node="activeNode"
push-ref=""
:foreign-credentials="[]"
:push-ref="ndvStore.pushRef"
:foreign-credentials="foreignCredentials"
:read-only="isReadOnly"
:block-u-i="false"
:executable="false"
:input-size="0"
:block-u-i="blockUi"
:executable="!isReadOnly"
is-embedded-in-canvas
:sub-title="subTitle"
@value-changed="handleValueChanged"