diff --git a/web/src/components/config-form/theme/templates/FieldTemplate.tsx b/web/src/components/config-form/theme/templates/FieldTemplate.tsx index 39915457d..d16b05a38 100644 --- a/web/src/components/config-form/theme/templates/FieldTemplate.tsx +++ b/web/src/components/config-form/theme/templates/FieldTemplate.tsx @@ -378,6 +378,190 @@ export function FieldTemplate(props: FieldTemplateProps) { uiOptions, ); + const shouldRenderStandardLabel = + displayLabel && + finalLabel && + !isBoolean && + !useSplitLayout && + !isMultiSchemaWrapper && + !isObjectField && + !isAdditionalProperty; + + const shouldRenderSplitLabel = + displayLabel && + finalLabel && + !isMultiSchemaWrapper && + !isObjectField && + !isAdditionalProperty; + + const shouldRenderBooleanLabel = displayLabel && finalLabel; + + const renderDocsLink = (className?: string) => { + if (!fieldDocsUrl || !shouldShowDescription) { + return null; + } + + return ( +
+ {finalDescription} +
+ ); + }; + + const renderStandardLabel = () => { + if (!shouldRenderStandardLabel) { + return null; + } + + return ( + + ); + }; + + const renderBooleanLabel = () => { + if (!shouldRenderBooleanLabel) { + return null; + } + + return ( + + ); + }; + + const renderSplitLabel = () => { + if (!shouldRenderSplitLabel) { + return null; + } + + return ( + + ); + }; + + const renderBooleanSplitLayout = () => ( + <> +- {finalDescription} -
- )} - {fieldDocsUrl && shouldShowDescription && ( -- {finalDescription} -
- )} - {fieldDocsUrl && shouldShowDescription && ( -- {finalDescription} -
- )} - {fieldDocsUrl && shouldShowDescription && ( -- {finalDescription} -
- )} - {fieldDocsUrl && shouldShowDescription && ( -- {finalDescription} -
- )} - {fieldDocsUrl && shouldShowDescription && ( -- {finalDescription} -
- )} - {fieldDocsUrl && shouldShowDescription && ( -