mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor: Fix type issues for parameter input components (#9449)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import type { IUpdateInformation, ResourceMapperReqParams } from '@/Interface';
|
||||
import type { IUpdateInformation, DynamicNodeParameters } from '@/Interface';
|
||||
import { resolveRequiredParameters } from '@/composables/useWorkflowHelpers';
|
||||
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
|
||||
import type {
|
||||
@@ -37,6 +37,7 @@ const workflowsStore = useWorkflowsStore();
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
teleported: true,
|
||||
dependentParametersValues: null,
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -235,7 +236,13 @@ async function loadFieldsToMap(): Promise<void> {
|
||||
if (!props.node) {
|
||||
return;
|
||||
}
|
||||
const requestParams: ResourceMapperReqParams = {
|
||||
|
||||
const methodName = props.parameter.typeOptions?.resourceMapper?.resourceMapperMethod;
|
||||
if (typeof methodName !== 'string') {
|
||||
return;
|
||||
}
|
||||
|
||||
const requestParams: DynamicNodeParameters.ResourceMapperFieldsRequest = {
|
||||
nodeTypeAndVersion: {
|
||||
name: props.node?.type,
|
||||
version: props.node.typeVersion,
|
||||
@@ -245,7 +252,7 @@ async function loadFieldsToMap(): Promise<void> {
|
||||
props.node.parameters,
|
||||
) as INodeParameters,
|
||||
path: props.path,
|
||||
methodName: props.parameter.typeOptions?.resourceMapper?.resourceMapperMethod,
|
||||
methodName,
|
||||
credentials: props.node.credentials,
|
||||
};
|
||||
const fetchedFields = await nodeTypesStore.getResourceMapperFields(requestParams);
|
||||
@@ -310,7 +317,7 @@ function setDefaultFieldValues(forceMatchingFieldsUpdate = false): void {
|
||||
function updateNodeIssues(): void {
|
||||
if (props.node) {
|
||||
const parameterIssues = NodeHelpers.getNodeParametersIssues(
|
||||
nodeType.value?.properties || [],
|
||||
nodeType.value?.properties ?? [],
|
||||
props.node,
|
||||
);
|
||||
if (parameterIssues) {
|
||||
@@ -319,10 +326,10 @@ function updateNodeIssues(): void {
|
||||
}
|
||||
}
|
||||
|
||||
function onMatchingColumnsChanged(matchingColumns: string[]): void {
|
||||
function onMatchingColumnsChanged(columns: string[]): void {
|
||||
state.paramValue = {
|
||||
...state.paramValue,
|
||||
matchingColumns,
|
||||
matchingColumns: columns,
|
||||
};
|
||||
// Set all matching fields to be visible
|
||||
state.paramValue.schema.forEach((field) => {
|
||||
|
||||
Reference in New Issue
Block a user