fix(UserFieldsModal): distinguish 'all configured' from 'no defs' in preview

This commit is contained in:
mateo-berri 2026-05-19 07:09:10 +00:00
parent 515023d1f0
commit d5529467e4
No known key found for this signature in database

View file

@ -75,9 +75,16 @@ const UserFieldsModal: React.FC<UserFieldsModalProps> = ({
return `${window.location.origin}${window.location.pathname}?${params.toString()}`;
};
const previewStatusLine =
defs.length === 0
? "No fields defined."
: missing.length === 0
? "All fields configured."
: `Missing field${missing.length === 1 ? "" : "s"}:`;
const errorPreview = `Error: MCP server "${serverDisplayName}" requires user configuration before use.
${missing.length > 0 ? `Missing field${missing.length === 1 ? "" : "s"}:` : "No fields defined."}
${previewStatusLine}
${missing.map((f) => ` • ${f.label || f.name}${f.description ? ` — ${f.description}` : ""}`).join("\n")}
Please configure your fields at: