Skip to content

Commit 34991d6

Browse files
authored
fix(editor): Pass down correct props to NodeSettings (no-changelog) (#17820)
1 parent 84d7376 commit 34991d6

File tree

3 files changed

+21
-36
lines changed

3 files changed

+21
-36
lines changed

packages/frontend/editor-ui/src/components/NodeDetailsViewV2.vue

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import { useTelemetry } from '@/composables/useTelemetry';
2525
import { useWorkflowActivate } from '@/composables/useWorkflowActivate';
2626
import {
2727
APP_MODALS_ELEMENT_ID,
28-
EnterpriseEditionFeature,
2928
EXECUTABLE_TRIGGER_NODE_TYPES,
3029
MODAL_CONFIRM,
3130
START_NODE_TYPE,
@@ -35,7 +34,6 @@ import type { DataPinningDiscoveryEvent } from '@/event-bus';
3534
import { dataPinningEventBus } from '@/event-bus';
3635
import { useNDVStore } from '@/stores/ndv.store';
3736
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
38-
import { useSettingsStore } from '@/stores/settings.store';
3937
import { useUIStore } from '@/stores/ui.store';
4038
import { useWorkflowsStore } from '@/stores/workflows.store';
4139
import { getNodeIconSource } from '@/utils/nodeIcon';
@@ -77,7 +75,6 @@ const workflowActivate = useWorkflowActivate();
7775
const nodeTypesStore = useNodeTypesStore();
7876
const uiStore = useUIStore();
7977
const workflowsStore = useWorkflowsStore();
80-
const settingsStore = useSettingsStore();
8178
const deviceSupport = useDeviceSupport();
8279
const telemetry = useTelemetry();
8380
const i18n = useI18n();
@@ -309,25 +306,9 @@ const isExecutionWaitingForWebhook = computed(() => workflowsStore.executionWait
309306
310307
const blockUi = computed(() => isWorkflowRunning.value || isExecutionWaitingForWebhook.value);
311308
312-
const foreignCredentials = computed(() => {
313-
const credentials = activeNode.value?.credentials;
314-
const usedCredentials = workflowsStore.usedCredentials;
315-
316-
const foreignCredentialsArray: string[] = [];
317-
if (credentials && settingsStore.isEnterpriseFeatureEnabled[EnterpriseEditionFeature.Sharing]) {
318-
Object.values(credentials).forEach((credential) => {
319-
if (
320-
credential.id &&
321-
usedCredentials[credential.id] &&
322-
!usedCredentials[credential.id].currentUserHasAccess
323-
) {
324-
foreignCredentialsArray.push(credential.id);
325-
}
326-
});
327-
}
328-
329-
return foreignCredentialsArray;
330-
});
309+
const foreignCredentials = computed(() =>
310+
nodeHelpers.getForeignCredentialsIfSharingEnabled(activeNode.value?.credentials),
311+
);
331312
332313
const hasForeignCredential = computed(() => foreignCredentials.value.length > 0);
333314

packages/frontend/editor-ui/src/components/NodeSettings.vue

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,24 +59,20 @@ import NodeSettingsInvalidNodeWarning from '@/components/NodeSettingsInvalidNode
5959
6060
const props = withDefaults(
6161
defineProps<{
62-
eventBus: EventBus;
62+
eventBus?: EventBus;
6363
dragging: boolean;
6464
pushRef: string;
6565
readOnly: boolean;
6666
foreignCredentials: string[];
6767
blockUI: boolean;
6868
executable: boolean;
69-
inputSize: number;
69+
inputSize?: number;
7070
activeNode?: INodeUi;
7171
isEmbeddedInCanvas?: boolean;
7272
subTitle?: string;
7373
}>(),
7474
{
75-
foreignCredentials: () => [],
76-
readOnly: false,
77-
executable: true,
7875
inputSize: 0,
79-
blockUI: false,
8076
activeNode: undefined,
8177
isEmbeddedInCanvas: false,
8278
subTitle: undefined,

packages/frontend/editor-ui/src/components/canvas/experimental/components/ExperimentalCanvasNodeSettings.vue

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<script setup lang="ts">
22
import NodeSettings from '@/components/NodeSettings.vue';
33
import { useCanvasOperations } from '@/composables/useCanvasOperations';
4+
import { useNodeHelpers } from '@/composables/useNodeHelpers';
45
import { type IUpdateInformation } from '@/Interface';
6+
import { useNDVStore } from '@/stores/ndv.store';
7+
import { useUIStore } from '@/stores/ui.store';
58
import { useWorkflowsStore } from '@/stores/workflows.store';
6-
import { createEventBus } from '@n8n/utils/event-bus';
79
import { computed } from 'vue';
810
911
const { nodeId, isReadOnly, subTitle } = defineProps<{
@@ -14,11 +16,19 @@ const { nodeId, isReadOnly, subTitle } = defineProps<{
1416
1517
defineSlots<{ actions?: {} }>();
1618
17-
const settingsEventBus = createEventBus();
1819
const workflowsStore = useWorkflowsStore();
20+
const uiStore = useUIStore();
1921
const { renameNode } = useCanvasOperations();
22+
const nodeHelpers = useNodeHelpers();
23+
const ndvStore = useNDVStore();
2024
2125
const activeNode = computed(() => workflowsStore.getNodeById(nodeId));
26+
const foreignCredentials = computed(() =>
27+
nodeHelpers.getForeignCredentialsIfSharingEnabled(activeNode.value?.credentials),
28+
);
29+
const isWorkflowRunning = computed(() => uiStore.isActionActive.workflowRunning);
30+
const isExecutionWaitingForWebhook = computed(() => workflowsStore.executionWaitingForWebhook);
31+
const blockUi = computed(() => isWorkflowRunning.value || isExecutionWaitingForWebhook.value);
2232
2333
function handleValueChanged(parameterData: IUpdateInformation) {
2434
if (parameterData.name === 'name' && parameterData.oldValue) {
@@ -52,15 +62,13 @@ function handleCaptureWheelEvent(event: WheelEvent) {
5262

5363
<template>
5464
<NodeSettings
55-
:event-bus="settingsEventBus"
5665
:dragging="false"
5766
:active-node="activeNode"
58-
push-ref=""
59-
:foreign-credentials="[]"
67+
:push-ref="ndvStore.pushRef"
68+
:foreign-credentials="foreignCredentials"
6069
:read-only="isReadOnly"
61-
:block-u-i="false"
62-
:executable="false"
63-
:input-size="0"
70+
:block-u-i="blockUi"
71+
:executable="!isReadOnly"
6472
is-embedded-in-canvas
6573
:sub-title="subTitle"
6674
@value-changed="handleValueChanged"

0 commit comments

Comments
 (0)