From 983d4cfaaa3c6e11d1414befc2ed224f837bda70 Mon Sep 17 00:00:00 2001 From: devinleighsmith Date: Tue, 3 Feb 2026 15:16:53 -0800 Subject: [PATCH 1/2] allow users to search for road names using the geocoder. --- .../Parameters/AddressesParameters.cs | 7 +- .../common/mapFSM/MapStateMachineContext.tsx | 7 + .../propertySelector/search/LayerFilter.scss | 4 +- .../search/LayerFilter.test.tsx | 2 +- .../propertySelector/search/LayerFilter.tsx | 2 +- .../PropertySelectorSearchContainer.test.tsx | 2 +- .../__snapshots__/LayerFilter.test.tsx.snap | 2 +- .../components/GeocoderAutoComplete.scss | 48 ++++++- .../components/GeocoderAutoComplete.tsx | 133 ++++++++++++------ .../properties/filter/GeographicNameInput.tsx | 129 +++++++++++------ .../properties/filter/PropertyFilter.tsx | 42 +++--- 11 files changed, 260 insertions(+), 118 deletions(-) diff --git a/source/backend/geocoder/Parameters/AddressesParameters.cs b/source/backend/geocoder/Parameters/AddressesParameters.cs index 2592cfa92c..9dda537464 100644 --- a/source/backend/geocoder/Parameters/AddressesParameters.cs +++ b/source/backend/geocoder/Parameters/AddressesParameters.cs @@ -10,7 +10,8 @@ public class AddressesParameters : BaseParameters { #region Properties - /// + /// /// /// get/set - Civic address or intersection address as a single string in Single-line Address Format. If not present in an address request, individual address elements, such as streetName, localityName, and provinceCode must be provided. /// In an occupant/addresses resource, addressString represents an Occupant name followed by a frontGate delimiter('--') followed by an optional address. @@ -28,7 +29,7 @@ public class AddressesParameters : BaseParameters /// get/set - The maximum number of search results to return. /// /// Default value: 5. - public int MaxResults { get; set; } = 5; + public int MaxResults { get; set; } = 25; /// /// get/set - In the case of a block level match, the method of interpolation to determine how far down the block the accessPoint should be. The geocoder supports none, linear and adaptive interpolation. @@ -52,7 +53,7 @@ public class AddressesParameters : BaseParameters /// get/set - If true, autoComplete suggestions are limited to addresses beginning with the provided partial address. /// /// Default value: true. - public bool ExactSpelling { get; set; } = true; + public bool ExactSpelling { get; set; } = false; /// /// get/set - If true, autoComplete suggestions are sorted using a fuzzy match comparison to the addressString. diff --git a/source/frontend/src/components/common/mapFSM/MapStateMachineContext.tsx b/source/frontend/src/components/common/mapFSM/MapStateMachineContext.tsx index fbdc6eff79..d8de4162ed 100644 --- a/source/frontend/src/components/common/mapFSM/MapStateMachineContext.tsx +++ b/source/frontend/src/components/common/mapFSM/MapStateMachineContext.tsx @@ -185,6 +185,13 @@ export const MapStateMachineProvider: React.FC> actions: { navigateToProperty: context => { const selectedFeatureData = context.mapLocationFeatureDataset; + const hasPimsFeatures = (selectedFeatureData?.pimsFeatures?.length ?? 0) > 0; + const hasParcelFeatures = (selectedFeatureData?.parcelFeatures?.length ?? 0) > 0; + const hasResults = hasPimsFeatures || hasParcelFeatures; + + if (!context.mapFeatureSelected && !hasResults) { + return; + } // if there is more that one property on the location, further action is needed. if (selectedFeatureData.parcelFeatures?.length > 1) { diff --git a/source/frontend/src/components/propertySelector/search/LayerFilter.scss b/source/frontend/src/components/propertySelector/search/LayerFilter.scss index 38183061ba..54e7dac38e 100644 --- a/source/frontend/src/components/propertySelector/search/LayerFilter.scss +++ b/source/frontend/src/components/propertySelector/search/LayerFilter.scss @@ -1,6 +1,6 @@ @import '@/assets/scss/styles.scss'; -.suggestionList { +.addressSuggestionList { background-color: white; border-style: solid; border-color: lightslategray; @@ -18,7 +18,7 @@ left: 0rem; } -.suggestionList li { +.addressSuggestionList li { padding: 1rem 0.5rem; word-wrap: break-word; width: 25rem; diff --git a/source/frontend/src/components/propertySelector/search/LayerFilter.test.tsx b/source/frontend/src/components/propertySelector/search/LayerFilter.test.tsx index 9d8c56282f..aa86c181e9 100644 --- a/source/frontend/src/components/propertySelector/search/LayerFilter.test.tsx +++ b/source/frontend/src/components/propertySelector/search/LayerFilter.test.tsx @@ -80,7 +80,7 @@ describe('LayerFilter component', () => { await fillInput(container, 'address', '1234 Fake'); }); - const addressInput = container.querySelector('.suggestionList'); + const addressInput = container.querySelector('.addressSuggestionList'); expect(addressInput).toBeInTheDocument(); }); diff --git a/source/frontend/src/components/propertySelector/search/LayerFilter.tsx b/source/frontend/src/components/propertySelector/search/LayerFilter.tsx index 936a16982f..9caefd5d71 100644 --- a/source/frontend/src/components/propertySelector/search/LayerFilter.tsx +++ b/source/frontend/src/components/propertySelector/search/LayerFilter.tsx @@ -62,7 +62,7 @@ export const LayerFilter: React.FunctionComponent +
{addressResults?.map((geoResponse: IGeocoderResponse, index: number) => (