feat(core): Add special @tool displayOption (#14318)

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
Charlie Kolb
2025-04-04 09:22:13 +02:00
committed by GitHub
parent 9104743a5f
commit 73748e300e
24 changed files with 589 additions and 48 deletions

View File

@@ -663,6 +663,7 @@ async function saveCredential(): Promise<ICredentialsResponse | null> {
false,
false,
null,
null,
);
assert(credentialTypeName.value);

View File

@@ -337,7 +337,7 @@ const removeMismatchedOptionValues = (
);
}
if (!hasValidOptions && displayParameter(nodeParameterValues, prop, node.value)) {
if (!hasValidOptions && displayParameter(nodeParameterValues, prop, node.value, nodeType)) {
unset(nodeParameterValues as object, prop.name);
}
});
@@ -395,6 +395,7 @@ const valueChanged = (parameterData: IUpdateInformation) => {
false,
false,
_node,
nodeType,
);
const oldNodeParameters = Object.assign({}, nodeParameters);
@@ -453,6 +454,7 @@ const valueChanged = (parameterData: IUpdateInformation) => {
true,
false,
_node,
nodeType,
);
for (const key of Object.keys(nodeParameters as object)) {
@@ -487,6 +489,7 @@ const valueChanged = (parameterData: IUpdateInformation) => {
false,
false,
_node,
nodeType,
);
const oldNodeParameters = Object.assign({}, nodeParameters);
@@ -535,6 +538,7 @@ const valueChanged = (parameterData: IUpdateInformation) => {
true,
false,
_node,
nodeType,
);
for (const key of Object.keys(nodeParameters as object)) {

View File

@@ -81,6 +81,7 @@ describe('ParameterInput.vue', () => {
};
mockNodeTypesState = {
allNodeTypes: [],
getNodeType: vi.fn().mockReturnValue(null),
};
createAppModals();
});

View File

@@ -346,6 +346,7 @@ const getIssues = computed<string[]>(() => {
node.value.parameters,
newPath.join('.'),
node.value,
nodeTypesStore.getNodeType(node.value.type, node.value.typeVersion),
);
if (props.parameter.type === 'credentialsSelect' && displayValue.value === '') {

View File

@@ -466,7 +466,13 @@ function getParameterIssues(parameter: INodeProperties): string[] {
if (!node.value || !showIssuesInLabelFor.includes(parameter.type)) {
return [];
}
const issues = NodeHelpers.getParameterIssues(parameter, node.value.parameters, '', node.value);
const issues = NodeHelpers.getParameterIssues(
parameter,
node.value.parameters,
'',
node.value,
nodeType.value,
);
return issues.parameters?.[parameter.name] ?? [];
}

View File

@@ -407,6 +407,7 @@ function updateNodeIssues(): void {
const parameterIssues = NodeHelpers.getNodeParametersIssues(
nodeType.value?.properties ?? [],
props.node,
nodeType.value,
);
if (parameterIssues) {
ndvStore.updateNodeParameterIssues(parameterIssues);