diff --git a/source/backend/api/Helpers/Healthchecks/PimsCdogsHealthCheck.cs b/source/backend/api/Helpers/Healthchecks/PimsCdogsHealthCheck.cs index d88a58f669..83e7e1de8a 100644 --- a/source/backend/api/Helpers/Healthchecks/PimsCdogsHealthCheck.cs +++ b/source/backend/api/Helpers/Healthchecks/PimsCdogsHealthCheck.cs @@ -19,6 +19,12 @@ public async Task CheckHealthAsync(HealthCheckContext context { try { + const int maxJitterMilliseconds = 10000; + var jitter = Random.Shared.Next(0, maxJitterMilliseconds + 1); + if (jitter > 0) + { + await Task.Delay(TimeSpan.FromMilliseconds(jitter), cancellationToken); + } var health = await _generationRepository.TryGetHealthAsync(); if (health.StatusCode != System.Net.HttpStatusCode.OK) 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/backend/tests/dal/Libraries/Geocoder/GeocoderServiceTest.cs b/source/backend/tests/dal/Libraries/Geocoder/GeocoderServiceTest.cs index 786aad0a6f..787345daa4 100644 --- a/source/backend/tests/dal/Libraries/Geocoder/GeocoderServiceTest.cs +++ b/source/backend/tests/dal/Libraries/Geocoder/GeocoderServiceTest.cs @@ -89,7 +89,7 @@ public async Task GetSiteAddressesAsync_StringAddress_Success() var result = await service.GetSiteAddressesAsync("address"); // Assert - var url = "https://geocoder.api.gov.bc.ca/addresses?addressString=address&maxResults=5&interpolation=adaptive&echo=false&autoComplete=true&exactSpelling=true&fuzzyMatch=false&minScore=0&maxDistance=0&provinceCode=BC&extrapolate=false&outputSRS=4326&locationDescriptor=any&setBack=0&brief=false"; + var url = "https://geocoder.api.gov.bc.ca/addresses?addressString=address&maxResults=25&interpolation=adaptive&echo=false&autoComplete=true&exactSpelling=false&fuzzyMatch=false&minScore=0&maxDistance=0&provinceCode=BC&extrapolate=false&outputSRS=4326&locationDescriptor=any&setBack=0&brief=false"; result.Should().NotBeNull(); mockRequestClient.Verify(m => m.GetAsync(url), Times.Once()); result.Should().Be(features); @@ -119,7 +119,7 @@ public async Task GetSiteAddressesAsync_StringAddress_Encoding_Success() var result = await service.GetSiteAddressesAsync("address with encoding"); // Assert - var url = "https://geocoder.api.gov.bc.ca/addresses.json?addressString=address%2Bwith%2Bencoding&maxResults=5&interpolation=adaptive&echo=false&autoComplete=true&exactSpelling=true&fuzzyMatch=false&minScore=0&maxDistance=0&provinceCode=BC&extrapolate=false&outputSRS=4326&locationDescriptor=any&setBack=0&brief=false"; + var url = "https://geocoder.api.gov.bc.ca/addresses.json?addressString=address%2Bwith%2Bencoding&maxResults=25&interpolation=adaptive&echo=false&autoComplete=true&exactSpelling=false&fuzzyMatch=false&minScore=0&maxDistance=0&provinceCode=BC&extrapolate=false&outputSRS=4326&locationDescriptor=any&setBack=0&brief=false"; result.Should().NotBeNull(); mockRequestClient.Verify(m => m.GetAsync(url), Times.Once()); result.Should().Be(features); @@ -149,7 +149,7 @@ public async Task GetSiteAddressesAsync_StringAddress_Format_Encoding_Success() var result = await service.GetSiteAddressesAsync("address with encoding", "xml"); // Assert - var url = "https://geocoder.api.gov.bc.ca/addresses.xml?addressString=address%2Bwith%2Bencoding&maxResults=5&interpolation=adaptive&echo=false&autoComplete=true&exactSpelling=true&fuzzyMatch=false&minScore=0&maxDistance=0&provinceCode=BC&extrapolate=false&outputSRS=4326&locationDescriptor=any&setBack=0&brief=false"; + var url = "https://geocoder.api.gov.bc.ca/addresses.xml?addressString=address%2Bwith%2Bencoding&maxResults=25&interpolation=adaptive&echo=false&autoComplete=true&exactSpelling=false&fuzzyMatch=false&minScore=0&maxDistance=0&provinceCode=BC&extrapolate=false&outputSRS=4326&locationDescriptor=any&setBack=0&brief=false"; result.Should().NotBeNull(); mockRequestClient.Verify(m => m.GetAsync(url), Times.Once()); result.Should().Be(features); @@ -183,7 +183,7 @@ public async Task GetSiteAddressesAsync_Success() var result = await service.GetSiteAddressesAsync(parameters); // Assert - var url = "https://geocoder.api.gov.bc.ca/addresses.json?addressString=address%20with%20encoding&maxResults=5&interpolation=adaptive&echo=false&autoComplete=true&exactSpelling=true&fuzzyMatch=false&minScore=0&maxDistance=0&provinceCode=BC&extrapolate=false&outputSRS=4326&locationDescriptor=any&setBack=0&brief=false"; + var url = "https://geocoder.api.gov.bc.ca/addresses.json?addressString=address%20with%20encoding&maxResults=25&interpolation=adaptive&echo=false&autoComplete=true&exactSpelling=false&fuzzyMatch=false&minScore=0&maxDistance=0&provinceCode=BC&extrapolate=false&outputSRS=4326&locationDescriptor=any&setBack=0&brief=false"; result.Should().NotBeNull(); mockRequestClient.Verify(m => m.GetAsync(url), Times.Once()); result.Should().Be(features); @@ -217,7 +217,7 @@ public async Task GetSiteAddressesAsync_Format_Success() var result = await service.GetSiteAddressesAsync(parameters, "xml"); // Assert - var url = "https://geocoder.api.gov.bc.ca/addresses.xml?addressString=address%20with%20encoding&maxResults=5&interpolation=adaptive&echo=false&autoComplete=true&exactSpelling=true&fuzzyMatch=false&minScore=0&maxDistance=0&provinceCode=BC&extrapolate=false&outputSRS=4326&locationDescriptor=any&setBack=0&brief=false"; + var url = "https://geocoder.api.gov.bc.ca/addresses.xml?addressString=address%20with%20encoding&maxResults=25&interpolation=adaptive&echo=false&autoComplete=true&exactSpelling=false&fuzzyMatch=false&minScore=0&maxDistance=0&provinceCode=BC&extrapolate=false&outputSRS=4326&locationDescriptor=any&setBack=0&brief=false"; result.Should().NotBeNull(); mockRequestClient.Verify(m => m.GetAsync(url), Times.Once()); result.Should().Be(features); diff --git a/source/frontend/src/components/common/mapFSM/MapStateMachineContext.tsx b/source/frontend/src/components/common/mapFSM/MapStateMachineContext.tsx index bc83948920..b4aeaa56b8 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) => (