Skip to content

Commit

Permalink
fix: undefined project labels
Browse files Browse the repository at this point in the history
adds a condition to check for the existence of the label or title before turning it into a string, otherwise null is return so the h4 is not rendered. It was causing unintended "undefined" to be shown as labels on conditional approval
  • Loading branch information
rafasdc authored and ccbc-service-account committed May 23, 2024
1 parent 74b891c commit a14cb05
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ const ProjectFieldTemplate: React.FC<FieldTemplateProps> = ({
children,
uiSchema,
}) => {
const uiTitle = `${uiSchema?.['ui:label'] ?? uiSchema?.['ui:title']}`;
const uiTitle =
uiSchema?.['ui:label'] || uiSchema?.['ui:title']
? `${uiSchema?.['ui:label'] ?? uiSchema?.['ui:title']}`
: null;
const hidden = uiSchema?.['ui:widget'] === 'HiddenWidget' || false;
return (
<>
Expand Down

0 comments on commit a14cb05

Please sign in to comment.