mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(editor): Improve how we show default Agent prompt and Memory session parameters (#11491)
This commit is contained in:
@@ -1417,6 +1417,7 @@ export interface INodeProperties {
|
||||
default: NodeParameterValueType;
|
||||
description?: string;
|
||||
hint?: string;
|
||||
disabledOptions?: IDisplayOptions;
|
||||
displayOptions?: IDisplayOptions;
|
||||
options?: Array<INodePropertyOptions | INodeProperties | INodePropertyCollection>;
|
||||
placeholder?: string;
|
||||
@@ -1657,6 +1658,7 @@ export interface INodeCredentialDescription {
|
||||
name: string;
|
||||
required?: boolean;
|
||||
displayName?: string;
|
||||
disabledOptions?: ICredentialsDisplayOptions;
|
||||
displayOptions?: ICredentialsDisplayOptions;
|
||||
testedBy?: ICredentialTestRequest | string; // Name of a function inside `loadOptions.credentialTest`
|
||||
}
|
||||
|
||||
@@ -639,12 +639,13 @@ export function displayParameter(
|
||||
parameter: INodeProperties | INodeCredentialDescription,
|
||||
node: Pick<INode, 'typeVersion'> | null, // Allow null as it does also get used by credentials and they do not have versioning yet
|
||||
nodeValuesRoot?: INodeParameters,
|
||||
displayKey: 'displayOptions' | 'disabledOptions' = 'displayOptions',
|
||||
) {
|
||||
if (!parameter.displayOptions) {
|
||||
if (!parameter[displayKey]) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const { show, hide } = parameter.displayOptions;
|
||||
const { show, hide } = parameter[displayKey];
|
||||
|
||||
nodeValuesRoot = nodeValuesRoot || nodeValues;
|
||||
|
||||
@@ -691,6 +692,7 @@ export function displayParameterPath(
|
||||
parameter: INodeProperties | INodeCredentialDescription,
|
||||
path: string,
|
||||
node: Pick<INode, 'typeVersion'> | null,
|
||||
displayKey: 'displayOptions' | 'disabledOptions' = 'displayOptions',
|
||||
) {
|
||||
let resolvedNodeValues = nodeValues;
|
||||
if (path !== '') {
|
||||
@@ -703,7 +705,7 @@ export function displayParameterPath(
|
||||
nodeValuesRoot = get(nodeValues, 'parameters') as INodeParameters;
|
||||
}
|
||||
|
||||
return displayParameter(resolvedNodeValues, parameter, node, nodeValuesRoot);
|
||||
return displayParameter(resolvedNodeValues, parameter, node, nodeValuesRoot, displayKey);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user