mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor(editor): Refine INodeUpdatePropertiesInformation type and remove unnecessary type assertions (#17783)
This commit is contained in:
@@ -160,10 +160,7 @@ export interface IUpdateInformation<T extends NodeParameterValueType = NodeParam
|
||||
|
||||
export interface INodeUpdatePropertiesInformation {
|
||||
name: string; // Node-Name
|
||||
properties: {
|
||||
position: XYPosition;
|
||||
[key: string]: IDataObject | XYPosition;
|
||||
};
|
||||
properties: Partial<INodeUi>;
|
||||
}
|
||||
|
||||
export type XYPosition = [number, number];
|
||||
|
||||
@@ -295,7 +295,6 @@ function clearSelectedCredential(credentialType: string) {
|
||||
name: props.node.name,
|
||||
properties: {
|
||||
credentials,
|
||||
position: props.node.position,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -412,7 +411,6 @@ function onCredentialSelected(
|
||||
name: props.node.name,
|
||||
properties: {
|
||||
credentials,
|
||||
position: props.node.position,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -24,13 +24,7 @@ import {
|
||||
} from 'n8n-workflow';
|
||||
import { computed, defineAsyncComponent, onBeforeUnmount, onMounted, ref, toRef, watch } from 'vue';
|
||||
|
||||
import type {
|
||||
INodeUi,
|
||||
INodeUpdatePropertiesInformation,
|
||||
IRunDataDisplayMode,
|
||||
ITab,
|
||||
NodePanelType,
|
||||
} from '@/Interface';
|
||||
import type { INodeUi, IRunDataDisplayMode, ITab, NodePanelType } from '@/Interface';
|
||||
|
||||
import {
|
||||
CORE_NODES_CATEGORY,
|
||||
@@ -1311,8 +1305,8 @@ function enableNode() {
|
||||
name: node.value.name,
|
||||
properties: {
|
||||
disabled: !node.value.disabled,
|
||||
} as IDataObject,
|
||||
} as INodeUpdatePropertiesInformation;
|
||||
},
|
||||
};
|
||||
|
||||
workflowsStore.updateNodeProperties(updateInformation);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import set from 'lodash/set';
|
||||
import unset from 'lodash/unset';
|
||||
|
||||
import type {
|
||||
IDataObject,
|
||||
NodeParameterValue,
|
||||
MessageEventBusDestinationOptions,
|
||||
INodeParameters,
|
||||
@@ -252,7 +251,7 @@ function valueChanged(parameterData: IUpdateInformation) {
|
||||
nodeParameters.value = deepCopy(nodeParametersCopy);
|
||||
workflowsStore.updateNodeProperties({
|
||||
name: node.value.name,
|
||||
properties: { parameters: nodeParameters.value as unknown as IDataObject, position: [0, 0] },
|
||||
properties: { parameters: nodeParameters.value, position: [0, 0] },
|
||||
});
|
||||
if (hasOnceBeenSaved.value) {
|
||||
logStreamingStore.updateDestination(nodeParameters.value);
|
||||
|
||||
@@ -66,7 +66,6 @@ export const useSetupWorkflowCredentialsModalState = () => {
|
||||
workflowsStore.updateNodeProperties({
|
||||
name: node.name,
|
||||
properties: {
|
||||
position: node.position,
|
||||
credentials: {
|
||||
...node.credentials,
|
||||
[usages.credentialType]: credential,
|
||||
@@ -101,7 +100,6 @@ export const useSetupWorkflowCredentialsModalState = () => {
|
||||
workflowsStore.updateNodeProperties({
|
||||
name: node.name,
|
||||
properties: {
|
||||
position: node.position,
|
||||
credentials,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -20,7 +20,6 @@ import type {
|
||||
ITaskDataConnections,
|
||||
IRunData,
|
||||
IBinaryKeyData,
|
||||
IDataObject,
|
||||
INode,
|
||||
INodePropertyOptions,
|
||||
INodeCredentialsDetails,
|
||||
@@ -722,8 +721,8 @@ export function useNodeHelpers() {
|
||||
name: node.name,
|
||||
properties: {
|
||||
disabled: newDisabledState,
|
||||
} as IDataObject,
|
||||
} as INodeUpdatePropertiesInformation;
|
||||
},
|
||||
};
|
||||
|
||||
telemetry.track('User set node enabled status', {
|
||||
node_type: node.type,
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
import type {
|
||||
AppliedThemeOption,
|
||||
INodeUi,
|
||||
INodeUpdatePropertiesInformation,
|
||||
NodeAuthenticationOption,
|
||||
} from '@/Interface';
|
||||
import type { AppliedThemeOption, INodeUi, NodeAuthenticationOption } from '@/Interface';
|
||||
import type { ITemplatesNode } from '@n8n/rest-api-client/api/templates';
|
||||
import {
|
||||
CORE_NODES_CATEGORY,
|
||||
@@ -386,8 +381,8 @@ export const updateNodeAuthType = (node: INodeUi | null, type: string) => {
|
||||
...node.parameters,
|
||||
[nodeAuthField.name]: type,
|
||||
},
|
||||
} as IDataObject,
|
||||
} as INodeUpdatePropertiesInformation;
|
||||
},
|
||||
};
|
||||
useWorkflowsStore().updateNodeProperties(updateInformation);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user