Skip to content

Commit

Permalink
Fix PSP-7927 (#3862)
Browse files Browse the repository at this point in the history
* Updated timeouts to be 30s instead of 3s when retrieving information for adding properties

* Fixed lint

* Added timeout for subdivision

---------

Co-authored-by: Alejandro Sanchez <[email protected]>
  • Loading branch information
FuriousLlama and asanchezr committed Mar 14, 2024
1 parent d072205 commit 0eb0316
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 14 deletions.
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, 30000);
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

0 comments on commit 0eb0316

Please sign in to comment.