Add display name to error message in validateNode function
This commit is contained in:
parent
725566d527
commit
5b0b101f37
1 changed files with 5 additions and 1 deletions
|
|
@ -273,6 +273,8 @@ export function validateNode(node: NodeType, edges: Edge[]): Array<string> {
|
|||
node: { template },
|
||||
} = node.data;
|
||||
|
||||
const displayName = node.data.node.display_name;
|
||||
|
||||
return Object.keys(template).reduce((errors: Array<string>, t) => {
|
||||
if (
|
||||
template[t].required &&
|
||||
|
|
@ -288,7 +290,9 @@ export function validateNode(node: NodeType, edges: Edge[]): Array<string> {
|
|||
node.id
|
||||
)
|
||||
) {
|
||||
errors.push(`${type} is missing ${getFieldTitle(template, t)}.`);
|
||||
errors.push(
|
||||
`${displayName || type} is missing ${getFieldTitle(template, t)}.`
|
||||
);
|
||||
} else if (
|
||||
template[t].type === "dict" &&
|
||||
template[t].required &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue