Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ public async Task<HealthCheckResult> 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)
Expand Down
7 changes: 4 additions & 3 deletions source/backend/geocoder/Parameters/AddressesParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ public class AddressesParameters : BaseParameters
{
#region Properties

/// <summary>
/// <summary
/// >
/// <para>
/// 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.
Expand All @@ -28,7 +29,7 @@ public class AddressesParameters : BaseParameters
/// get/set - The maximum number of search results to return.
/// </summary>
/// <value>Default value: <c>5</c>.</value>
public int MaxResults { get; set; } = 5;
public int MaxResults { get; set; } = 25;

/// <summary>
/// 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.
Expand All @@ -52,7 +53,7 @@ public class AddressesParameters : BaseParameters
/// get/set - If <c>true</c>, autoComplete suggestions are limited to addresses beginning with the provided partial address.
/// </summary>
/// <value>Default value: <c>true</c>.</value>
public bool ExactSpelling { get; set; } = true;
public bool ExactSpelling { get; set; } = false;

/// <summary>
/// get/set - If <c>true</c>, autoComplete suggestions are sorted using a fuzzy match comparison to the addressString.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<FeatureCollectionModel>(url), Times.Once());
result.Should().Be(features);
Expand Down Expand Up @@ -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<FeatureCollectionModel>(url), Times.Once());
result.Should().Be(features);
Expand Down Expand Up @@ -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<FeatureCollectionModel>(url), Times.Once());
result.Should().Be(features);
Expand Down Expand Up @@ -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<FeatureCollectionModel>(url), Times.Once());
result.Should().Be(features);
Expand Down Expand Up @@ -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<FeatureCollectionModel>(url), Times.Once());
result.Should().Be(features);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,13 @@ export const MapStateMachineProvider: React.FC<React.PropsWithChildren<unknown>>
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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import '@/assets/scss/styles.scss';

.suggestionList {
.addressSuggestionList {
background-color: white;
border-style: solid;
border-color: lightslategray;
Expand All @@ -18,7 +18,7 @@
left: 0rem;
}

.suggestionList li {
.addressSuggestionList li {
padding: 1rem 0.5rem;
word-wrap: break-word;
width: 25rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const LayerFilter: React.FunctionComponent<React.PropsWithChildren<ILayer
return null;
}
return (
<div className="suggestionList">
<div className="addressSuggestionList">
{addressResults?.map((geoResponse: IGeocoderResponse, index: number) => (
<option
key={index}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ describe('PropertySelectorSearchContainer component', () => {
// typing on address search field should bring up address suggestions
let addressSuggestions: HTMLElement;
await waitFor(async () => {
addressSuggestions = container.querySelector('.suggestionList') as HTMLElement;
addressSuggestions = container.querySelector('.addressSuggestionList') as HTMLElement;
expect(addressSuggestions).toBeInTheDocument();
// clicking on a suggestion should initiate a search by address
const firstAddress = addressSuggestions?.firstElementChild as HTMLElement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ exports[`LayerFilter component > renders as expected 1`] = `
</div>
</div>
<div
class="suggestionList"
class="addressSuggestionList"
>
<option>
1234 Fake St
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@
.GeocoderAutoComplete {
font-size: 1.6rem;
position: relative;
overflow: visible;
}

.GeographicNameInput {
position: relative;
overflow: visible;
}

// Allow suggestion list to escape Bootstrap input group clipping
.idir-input-group,
.idir-input-group .input-group,
.idir-input-group .form-group,
.GeocoderAutoComplete .form-group,
.GeographicNameInput .form-group {
position: relative;
overflow: visible;
}

.GeocoderAutoComplete form.Control,
Expand All @@ -14,10 +30,13 @@
flex: 1 1;
min-width: 0;
margin-bottom: 0;

}

.suggestionList {
z-index: 999;
background-color: white;
opacity: 1;
border-style: solid;
border-color: lightslategray;
border-width: thin;
Expand All @@ -26,11 +45,32 @@
max-height: 60rem;
margin: 0;
padding: 0;
position: absolute;
max-height: 40rem;
overflow-y: auto;
z-index: 999;
top: 0rem;
left: -5rem;
box-shadow: 0 0.6rem 1.6rem rgba(0, 0, 0, 0.2);
}

.suggestionList li {
padding: 1rem 0.5rem;
word-wrap: break-word;
width: 25rem;
overflow: hidden;
cursor: pointer;
color: var(--typography-color-secondary);

&:hover {
background-color: var(--surface-color-primary-button-hover);
color: #fff;
}
}

.suggestionList--floating {
position: fixed;
z-index: 4000;
}

.suggestionOverlay {
z-index: 5000;
}

.GeocoderAutoComplete option,
Expand Down
Loading
Loading