diff --git a/spiffworkflow-frontend/src/rjsf/carbon_theme/BaseInputTemplate/BaseInputTemplate.tsx b/spiffworkflow-frontend/src/rjsf/carbon_theme/BaseInputTemplate/BaseInputTemplate.tsx index 6e8af43a9..3daaf14dc 100644 --- a/spiffworkflow-frontend/src/rjsf/carbon_theme/BaseInputTemplate/BaseInputTemplate.tsx +++ b/spiffworkflow-frontend/src/rjsf/carbon_theme/BaseInputTemplate/BaseInputTemplate.tsx @@ -76,9 +76,6 @@ export default function BaseInputTemplate< } else if (schema && schema.title) { labelToUse = schema.title; } - if (required) { - labelToUse = `${labelToUse}*`; - } let helperText = null; if (uiSchema && uiSchema['ui:help']) { diff --git a/spiffworkflow-frontend/src/rjsf/custom_widgets/TypeaheadWidget/TypeaheadWidget.tsx b/spiffworkflow-frontend/src/rjsf/custom_widgets/TypeaheadWidget/TypeaheadWidget.tsx index 9931ddf1d..1800cdf8d 100644 --- a/spiffworkflow-frontend/src/rjsf/custom_widgets/TypeaheadWidget/TypeaheadWidget.tsx +++ b/spiffworkflow-frontend/src/rjsf/custom_widgets/TypeaheadWidget/TypeaheadWidget.tsx @@ -7,6 +7,7 @@ interface typeaheadArgs { onChange: any; options: any; value: any; + schema?: any; uiSchema?: any; disabled?: boolean; readonly?: boolean; @@ -20,6 +21,7 @@ export default function TypeaheadWidget({ onChange, options: { category, itemFormat }, value, + schema, uiSchema, disabled, readonly, @@ -45,8 +47,15 @@ export default function TypeaheadWidget({ } } + let labelToUse = label; + if (uiSchema && uiSchema['ui:title']) { + labelToUse = uiSchema['ui:title']; + } else if (schema && schema.title) { + labelToUse = schema.title; + } + if (!category) { - errorMessageForField = `category is not set in the ui:options for this field: ${label}`; + errorMessageForField = `category is not set in the ui:options for this field: ${labelToUse}`; invalid = true; } @@ -106,7 +115,13 @@ export default function TypeaheadWidget({ if (!invalid && rawErrors && rawErrors.length > 0) { invalid = true; - [errorMessageForField] = rawErrors; + if ('validationErrorMessage' in schema) { + errorMessageForField = (schema as any).validationErrorMessage; + } else { + errorMessageForField = `${(labelToUse || '').replace(/\*$/, '')} ${ + rawErrors[0] + }`; + } } return (