diff --git a/CHANGELOG.md b/CHANGELOG.md index 5149f6d2e6..7e754d0167 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# [1.234.0](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.233.0...v1.234.0) (2025-01-31) + +### Features + +- allow selects to not have null value ([a7c798c](https://github.com/bcgov/CONN-CCBC-portal/commit/a7c798cd3e5ef0486458c4bf124412d32a4809cf)) + # [1.233.0](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.232.0...v1.233.0) (2025-01-31) ### Features diff --git a/app/formSchema/uiSchema/analyst/assessmentsUiSchema.ts b/app/formSchema/uiSchema/analyst/assessmentsUiSchema.ts index 10e7df19b7..6a0cd3d388 100644 --- a/app/formSchema/uiSchema/analyst/assessmentsUiSchema.ts +++ b/app/formSchema/uiSchema/analyst/assessmentsUiSchema.ts @@ -45,12 +45,14 @@ const assessmentsUiSchema = { }, connectedCoastNetworkDependent: { 'ui:widget': 'SelectWidget', + 'ui:shownull': false, 'ui:options': { boldTitle: true, }, }, crtcProjectDependent: { 'ui:widget': 'SelectWidget', + 'ui:shownull': false, 'ui:options': { boldTitle: true, }, diff --git a/app/lib/theme/widgets/SelectWidget.tsx b/app/lib/theme/widgets/SelectWidget.tsx index 687782d904..a37e45549a 100644 --- a/app/lib/theme/widgets/SelectWidget.tsx +++ b/app/lib/theme/widgets/SelectWidget.tsx @@ -76,8 +76,8 @@ const SelectWidget: React.FC = ({ // @ts-ignore const options = objectOptions ?? (schema.enum as Array); const description = uiSchema ? uiSchema['ui:description'] : null; + const showNull = uiSchema?.['ui:shownull'] ?? true; const isError = rawErrors && rawErrors.length > 0 && !value; - return ( = ({ value={value} aria-label={label} > - + {showNull && ( + + )} + ; {options?.map((opt, index) => { return (