From 62ea6bdee897a55071013e628bdb556609dada86 Mon Sep 17 00:00:00 2001 From: Rafael Solorzano <61289255+rafasdc@users.noreply.github.com> Date: Wed, 22 May 2024 13:41:26 -0700 Subject: [PATCH] fix: undefined project labels 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 --- .../Analyst/Project/fields/ProjectFieldTemplate.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/components/Analyst/Project/fields/ProjectFieldTemplate.tsx b/app/components/Analyst/Project/fields/ProjectFieldTemplate.tsx index daf3dc10e1..d9fd5943ba 100644 --- a/app/components/Analyst/Project/fields/ProjectFieldTemplate.tsx +++ b/app/components/Analyst/Project/fields/ProjectFieldTemplate.tsx @@ -35,7 +35,10 @@ const ProjectFieldTemplate: React.FC = ({ 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 ( <>