mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
fix(editor): Pass down correct props to NodeSettings (no-changelog) (#17820)
This commit is contained in:
@@ -25,7 +25,6 @@ import { useTelemetry } from '@/composables/useTelemetry';
|
|||||||
import { useWorkflowActivate } from '@/composables/useWorkflowActivate';
|
import { useWorkflowActivate } from '@/composables/useWorkflowActivate';
|
||||||
import {
|
import {
|
||||||
APP_MODALS_ELEMENT_ID,
|
APP_MODALS_ELEMENT_ID,
|
||||||
EnterpriseEditionFeature,
|
|
||||||
EXECUTABLE_TRIGGER_NODE_TYPES,
|
EXECUTABLE_TRIGGER_NODE_TYPES,
|
||||||
MODAL_CONFIRM,
|
MODAL_CONFIRM,
|
||||||
START_NODE_TYPE,
|
START_NODE_TYPE,
|
||||||
@@ -35,7 +34,6 @@ import type { DataPinningDiscoveryEvent } from '@/event-bus';
|
|||||||
import { dataPinningEventBus } from '@/event-bus';
|
import { dataPinningEventBus } from '@/event-bus';
|
||||||
import { useNDVStore } from '@/stores/ndv.store';
|
import { useNDVStore } from '@/stores/ndv.store';
|
||||||
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
|
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
|
||||||
import { useSettingsStore } from '@/stores/settings.store';
|
|
||||||
import { useUIStore } from '@/stores/ui.store';
|
import { useUIStore } from '@/stores/ui.store';
|
||||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||||
import { getNodeIconSource } from '@/utils/nodeIcon';
|
import { getNodeIconSource } from '@/utils/nodeIcon';
|
||||||
@@ -77,7 +75,6 @@ const workflowActivate = useWorkflowActivate();
|
|||||||
const nodeTypesStore = useNodeTypesStore();
|
const nodeTypesStore = useNodeTypesStore();
|
||||||
const uiStore = useUIStore();
|
const uiStore = useUIStore();
|
||||||
const workflowsStore = useWorkflowsStore();
|
const workflowsStore = useWorkflowsStore();
|
||||||
const settingsStore = useSettingsStore();
|
|
||||||
const deviceSupport = useDeviceSupport();
|
const deviceSupport = useDeviceSupport();
|
||||||
const telemetry = useTelemetry();
|
const telemetry = useTelemetry();
|
||||||
const i18n = useI18n();
|
const i18n = useI18n();
|
||||||
@@ -309,25 +306,9 @@ const isExecutionWaitingForWebhook = computed(() => workflowsStore.executionWait
|
|||||||
|
|
||||||
const blockUi = computed(() => isWorkflowRunning.value || isExecutionWaitingForWebhook.value);
|
const blockUi = computed(() => isWorkflowRunning.value || isExecutionWaitingForWebhook.value);
|
||||||
|
|
||||||
const foreignCredentials = computed(() => {
|
const foreignCredentials = computed(() =>
|
||||||
const credentials = activeNode.value?.credentials;
|
nodeHelpers.getForeignCredentialsIfSharingEnabled(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 hasForeignCredential = computed(() => foreignCredentials.value.length > 0);
|
const hasForeignCredential = computed(() => foreignCredentials.value.length > 0);
|
||||||
|
|
||||||
|
|||||||
@@ -59,24 +59,20 @@ import NodeSettingsInvalidNodeWarning from '@/components/NodeSettingsInvalidNode
|
|||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
eventBus: EventBus;
|
eventBus?: EventBus;
|
||||||
dragging: boolean;
|
dragging: boolean;
|
||||||
pushRef: string;
|
pushRef: string;
|
||||||
readOnly: boolean;
|
readOnly: boolean;
|
||||||
foreignCredentials: string[];
|
foreignCredentials: string[];
|
||||||
blockUI: boolean;
|
blockUI: boolean;
|
||||||
executable: boolean;
|
executable: boolean;
|
||||||
inputSize: number;
|
inputSize?: number;
|
||||||
activeNode?: INodeUi;
|
activeNode?: INodeUi;
|
||||||
isEmbeddedInCanvas?: boolean;
|
isEmbeddedInCanvas?: boolean;
|
||||||
subTitle?: string;
|
subTitle?: string;
|
||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
foreignCredentials: () => [],
|
|
||||||
readOnly: false,
|
|
||||||
executable: true,
|
|
||||||
inputSize: 0,
|
inputSize: 0,
|
||||||
blockUI: false,
|
|
||||||
activeNode: undefined,
|
activeNode: undefined,
|
||||||
isEmbeddedInCanvas: false,
|
isEmbeddedInCanvas: false,
|
||||||
subTitle: undefined,
|
subTitle: undefined,
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import NodeSettings from '@/components/NodeSettings.vue';
|
import NodeSettings from '@/components/NodeSettings.vue';
|
||||||
import { useCanvasOperations } from '@/composables/useCanvasOperations';
|
import { useCanvasOperations } from '@/composables/useCanvasOperations';
|
||||||
|
import { useNodeHelpers } from '@/composables/useNodeHelpers';
|
||||||
import { type IUpdateInformation } from '@/Interface';
|
import { type IUpdateInformation } from '@/Interface';
|
||||||
|
import { useNDVStore } from '@/stores/ndv.store';
|
||||||
|
import { useUIStore } from '@/stores/ui.store';
|
||||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||||
import { createEventBus } from '@n8n/utils/event-bus';
|
|
||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
|
|
||||||
const { nodeId, isReadOnly, subTitle } = defineProps<{
|
const { nodeId, isReadOnly, subTitle } = defineProps<{
|
||||||
@@ -14,11 +16,19 @@ const { nodeId, isReadOnly, subTitle } = defineProps<{
|
|||||||
|
|
||||||
defineSlots<{ actions?: {} }>();
|
defineSlots<{ actions?: {} }>();
|
||||||
|
|
||||||
const settingsEventBus = createEventBus();
|
|
||||||
const workflowsStore = useWorkflowsStore();
|
const workflowsStore = useWorkflowsStore();
|
||||||
|
const uiStore = useUIStore();
|
||||||
const { renameNode } = useCanvasOperations();
|
const { renameNode } = useCanvasOperations();
|
||||||
|
const nodeHelpers = useNodeHelpers();
|
||||||
|
const ndvStore = useNDVStore();
|
||||||
|
|
||||||
const activeNode = computed(() => workflowsStore.getNodeById(nodeId));
|
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) {
|
function handleValueChanged(parameterData: IUpdateInformation) {
|
||||||
if (parameterData.name === 'name' && parameterData.oldValue) {
|
if (parameterData.name === 'name' && parameterData.oldValue) {
|
||||||
@@ -52,15 +62,13 @@ function handleCaptureWheelEvent(event: WheelEvent) {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<NodeSettings
|
<NodeSettings
|
||||||
:event-bus="settingsEventBus"
|
|
||||||
:dragging="false"
|
:dragging="false"
|
||||||
:active-node="activeNode"
|
:active-node="activeNode"
|
||||||
push-ref=""
|
:push-ref="ndvStore.pushRef"
|
||||||
:foreign-credentials="[]"
|
:foreign-credentials="foreignCredentials"
|
||||||
:read-only="isReadOnly"
|
:read-only="isReadOnly"
|
||||||
:block-u-i="false"
|
:block-u-i="blockUi"
|
||||||
:executable="false"
|
:executable="!isReadOnly"
|
||||||
:input-size="0"
|
|
||||||
is-embedded-in-canvas
|
is-embedded-in-canvas
|
||||||
:sub-title="subTitle"
|
:sub-title="subTitle"
|
||||||
@value-changed="handleValueChanged"
|
@value-changed="handleValueChanged"
|
||||||
|
|||||||
Reference in New Issue
Block a user