Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PSP-7927 #3862

Merged
merged 7 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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 @@ -109,7 +109,7 @@ export const LeasePropertySelector: React.FunctionComponent<LeasePropertySelecto
const formProperty = FormLeaseProperty.fromMapProperty(property);

const bcaSummary = property?.pid
? await getPrimaryAddressByPid(property.pid, 3000)
? await getPrimaryAddressByPid(property.pid, 30000)
: undefined;

// Retrieve the pims id of the property if it exists
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const AcquisitionPropertiesSubForm: React.FunctionComponent<
return promise.then(async () => {
const formProperty = PropertyForm.fromMapProperty(property);
if (property.pid) {
const bcaSummary = await getPrimaryAddressByPid(property.pid, 3000);
const bcaSummary = await getPrimaryAddressByPid(property.pid, 30000);
formProperty.address = bcaSummary?.address
? AddressForm.fromBcaAddress(bcaSummary?.address)
: undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const AddConsolidationContainer: React.FC<IAddConsolidationContainerProps> = ({

const getAddress = useCallback(
async (pid: string): Promise<AddressForm | undefined> => {
const bcaSummary = await getPrimaryAddressByPid(pid, 3000);
const bcaSummary = await getPrimaryAddressByPid(pid, 30000);
return bcaSummary?.address ? AddressForm.fromBcaAddress(bcaSummary?.address) : undefined;
},
[getPrimaryAddressByPid],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const DispositionPropertiesSubForm: React.FunctionComponent<
return promise.then(async () => {
const formProperty = PropertyForm.fromMapProperty(property);
if (property.pid) {
const bcaSummary = await getPrimaryAddressByPid(property.pid, 3000);
const bcaSummary = await getPrimaryAddressByPid(property.pid, 30000);
formProperty.address = bcaSummary?.address
? AddressForm.fromBcaAddress(bcaSummary?.address)
: undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const ResearchProperties: React.FunctionComponent<React.PropsWithChildren<unknow
return promise.then(async () => {
const formProperty = PropertyForm.fromMapProperty(property);
if (property.pid) {
const bcaSummary = await getPrimaryAddressByPid(property.pid, 3000);
const bcaSummary = await getPrimaryAddressByPid(property.pid, 30000);
formProperty.address = bcaSummary?.address
? AddressForm.fromBcaAddress(bcaSummary?.address)
: undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ export const UpdateProperties: React.FunctionComponent<
return promise.then(async () => {
const formProperty = PropertyForm.fromMapProperty(property);
if (property.pid) {
const bcaSummary = await getPrimaryAddressByPid(property.pid, 3000);
const bcaSummary = await getPrimaryAddressByPid(
property.pid,
30000,
);
formProperty.address = bcaSummary?.address
? AddressForm.fromBcaAddress(bcaSummary?.address)
: undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const AddSubdivisionContainer: React.FC<IAddSubdivisionContainerProps> = ({ onCl

const getAddress = useCallback(
async (pid: string): Promise<AddressForm | undefined> => {
const bcaSummary = await getPrimaryAddressByPid(pid, 3000);
const bcaSummary = await getPrimaryAddressByPid(pid);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you mean to delete the timeout here? the other changes put the timeout at 30000ms but here it gets removed - why?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I aligned it with the rest of the additions, so 30s timeout

return bcaSummary?.address ? AddressForm.fromBcaAddress(bcaSummary?.address) : undefined;
},
[getPrimaryAddressByPid],
Expand Down
15 changes: 8 additions & 7 deletions source/frontend/src/mocks/msw/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ import {

export const handlers = [
rest.get('https://delivery.apps.gov.bc.ca/ext/sgw/geo.bca', (req, res, ctx) => {
if (req.url.search.includes('BCA_FOLIO_ADDRESSES_SV')) {
const search = req.url.search;
if (search.includes('BCA_FOLIO_ADDRESSES_SV')) {
return res(ctx.delay(500), ctx.status(200), ctx.json(getMockAddresses()));
} else if (req.url.search.includes('BCA_FOLIO_LEGAL_DESCRIPTS_SV')) {
return res(ctx.delay(500), ctx.status(200), ctx.json(getMockLegalDescriptions()));
} else if (req.url.search.includes('BCA_FOLIO_GNRL_PROP_VALUES_SV')) {
} else if (search.includes('BCA_FOLIO_LEGAL_DESCRIPTS_SV')) {
return res(ctx.delay(5000), ctx.status(200), ctx.json(getMockLegalDescriptions()));
} else if (search.includes('BCA_FOLIO_GNRL_PROP_VALUES_SV')) {
return res(ctx.delay(500), ctx.status(200), ctx.json(getMockValues()));
} else if (req.url.search.includes('BCA_FOLIO_SALES_SV')) {
} else if (search.includes('BCA_FOLIO_SALES_SV')) {
return res(ctx.delay(500), ctx.status(200), ctx.json(getMockSales()));
} else if (req.url.search.includes('BCA_FOLIO_DESCRIPTIONS_SV')) {
} else if (search.includes('BCA_FOLIO_DESCRIPTIONS_SV')) {
return res(ctx.delay(500), ctx.status(200), ctx.json(getMockDescription()));
} else if (req.url.search.includes('BCA_FOLIO_LAND_CHARS_SV')) {
} else if (search.includes('BCA_FOLIO_LAND_CHARS_SV')) {
return res(ctx.delay(500), ctx.status(200), ctx.json(getMockLandChars()));
}
}),
Expand Down
Loading