From a2ec9bfc9b4c9bed4297a72e19e8ebef9572c9e4 Mon Sep 17 00:00:00 2001 From: R Ranathunga Date: Thu, 26 Sep 2024 16:08:55 -0700 Subject: [PATCH 1/3] fix: autocomplete community source widget --- .../widgets/custom/CommunitySourceWidget.tsx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/app/lib/theme/widgets/custom/CommunitySourceWidget.tsx b/app/lib/theme/widgets/custom/CommunitySourceWidget.tsx index e1d42d46e..076862c26 100644 --- a/app/lib/theme/widgets/custom/CommunitySourceWidget.tsx +++ b/app/lib/theme/widgets/custom/CommunitySourceWidget.tsx @@ -43,6 +43,9 @@ const CommunitySourceWidget: React.FC = (props) => { value: geographicNameId, label: bcGeographicName, }); + const [economicRegionInputValue, setEconomicRegionInputValue] = useState(''); + const [regionalDistrictInputValue, setRegionalDistrictValue] = useState(''); + const [geographicNameInputValue, setGeographicNameInputValue] = useState(''); useEffect(() => { setSelectedEconomicRegion(economicRegion); @@ -119,9 +122,12 @@ const CommunitySourceWidget: React.FC = (props) => { setSelectedEconomicRegion(val); } }} + onInputChange={(e, val) => { + setEconomicRegionInputValue(val); + }} style={{ width: '200px' }} value={selectedEconomicRegion} - inputValue={selectedEconomicRegion ?? ''} + inputValue={economicRegionInputValue} options={economicRegionOptions} getOptionLabel={(option) => option} renderInput={(params) => ( @@ -147,8 +153,11 @@ const CommunitySourceWidget: React.FC = (props) => { setSelectedRegionalDistrict(val); } }} + onInputChange={(e, val) => { + setRegionalDistrictValue(val); + }} value={selectedRegionalDistrict} - inputValue={selectedRegionalDistrict ?? ''} + inputValue={regionalDistrictInputValue} options={ regionalDistrictOptions[selectedEconomicRegion] ? [...regionalDistrictOptions[selectedEconomicRegion]] @@ -189,7 +198,7 @@ const CommunitySourceWidget: React.FC = (props) => { return option.label ?? ''; }} value={selectedGeographicName} - inputValue={selectedGeographicName?.label ?? ''} + inputValue={geographicNameInputValue} onChange={(e, val, reason) => { if (reason === 'clear') { setSelectedGeographicName({ value: null, label: '' }); @@ -205,6 +214,9 @@ const CommunitySourceWidget: React.FC = (props) => { }); } }} + onInputChange={(e, val) => { + setGeographicNameInputValue(val); + }} /> {!rowId && ( Date: Fri, 4 Oct 2024 12:44:08 -0700 Subject: [PATCH 2/3] fix: duplicates on geoname dropdown --- app/lib/theme/widgets/custom/CommunitySourceWidget.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/lib/theme/widgets/custom/CommunitySourceWidget.tsx b/app/lib/theme/widgets/custom/CommunitySourceWidget.tsx index 076862c26..49b570872 100644 --- a/app/lib/theme/widgets/custom/CommunitySourceWidget.tsx +++ b/app/lib/theme/widgets/custom/CommunitySourceWidget.tsx @@ -186,6 +186,11 @@ const CommunitySourceWidget: React.FC = (props) => { label="Geographic Name" /> )} + renderOption={(renderProps, option) => ( +
  • + {option.label} +
  • + )} options={getGeographicNameOptions( selectedRegionalDistrict, selectedEconomicRegion From 3cec08684c2e65cfbda48c62b305fed0a8aa1bfb Mon Sep 17 00:00:00 2001 From: CCBC Service Account <116113628+ccbc-service-account@users.noreply.github.com> Date: Fri, 4 Oct 2024 20:22:06 +0000 Subject: [PATCH 3/3] chore: release v1.195.5 --- CHANGELOG.md | 7 +++++++ db/sqitch.plan | 1 + package.json | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0391427b..3be979c85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [1.195.5](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.195.4...v1.195.5) (2024-10-04) + +### Bug Fixes + +- autocomplete community source widget ([57c3c00](https://github.com/bcgov/CONN-CCBC-portal/commit/57c3c00a3576b5b199a2b6f77a047e29d30097a9)) +- duplicates on geoname dropdown ([f764b30](https://github.com/bcgov/CONN-CCBC-portal/commit/f764b30765bf334667bb69c95c29c614c277fae9)) + ## [1.195.4](https://github.com/bcgov/CONN-CCBC-portal/compare/v1.195.3...v1.195.4) (2024-10-03) ### Bug Fixes diff --git a/db/sqitch.plan b/db/sqitch.plan index 9a3ce2209..2dc201046 100644 --- a/db/sqitch.plan +++ b/db/sqitch.plan @@ -695,3 +695,4 @@ computed_columns/cbc_history 2024-09-03T15:16:07Z Anthony Bushara # release v1.195.2 @1.195.3 2024-10-03T15:51:06Z CCBC Service Account # release v1.195.3 @1.195.4 2024-10-03T22:15:09Z CCBC Service Account # release v1.195.4 +@1.195.5 2024-10-04T20:22:04Z CCBC Service Account # release v1.195.5 diff --git a/package.json b/package.json index 66273134e..0a872e108 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "CONN-CCBC-portal", - "version": "1.195.4", + "version": "1.195.5", "main": "index.js", "repository": "https://github.com/bcgov/CONN-CCBC-portal.git", "author": "Romer, Meherzad CITZ:EX ",