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

psp-8116 Update frontend layer configuration. #3928

Merged
merged 3 commits into from
Apr 5, 2024
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 @@ -119,7 +119,7 @@ describe('mapUtils tests', () => {
properties: {
...EmptyPropertyLocation,
PROPERTY_ID: 1,
IS_PROPERTY_OF_INTEREST: true,
HAS_ACTIVE_RESEARCH_FILE: true,
},
},
false,
Expand Down Expand Up @@ -158,7 +158,7 @@ describe('mapUtils tests', () => {
...EmptyPropertyLocation,
PROPERTY_ID: 1,
IS_OWNED: true,
IS_PROPERTY_OF_INTEREST: true,
HAS_ACTIVE_ACQUISITION_FILE: true,
},
},
false,
Expand All @@ -174,7 +174,8 @@ describe('mapUtils tests', () => {
...EmptyPropertyLocation,
PROPERTY_ID: 1,
IS_OWNED: null,
IS_PROPERTY_OF_INTEREST: null,
HAS_ACTIVE_ACQUISITION_FILE: null,
HAS_ACTIVE_RESEARCH_FILE: null,
IS_OTHER_INTEREST: null,
IS_DISPOSED: null,
},
Expand Down
17 changes: 10 additions & 7 deletions source/frontend/src/components/maps/leaflet/Layers/util.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ export function getMarkerIcon(
} else {
return null;
}
} else if (showDisposed && feature?.properties?.IS_DISPOSED === true) {
if (selected) {
return disposedIconSelect;
} else {
return disposedIcon;
}
} else if (feature?.properties?.IS_OWNED === true) {
if (selected) {
return parcelIconSelect;
Expand All @@ -191,18 +197,15 @@ export function getMarkerIcon(
} else {
return otherInterestIcon;
}
} else if (feature?.properties?.IS_PROPERTY_OF_INTEREST === true) {
} else if (
feature?.properties?.HAS_ACTIVE_ACQUISITION_FILE === true ||
feature?.properties?.HAS_ACTIVE_RESEARCH_FILE === true
) {
if (selected) {
return propertyOfInterestIconSelect;
} else {
return propertyOfInterestIcon;
}
} else if (showDisposed && feature?.properties?.IS_DISPOSED === true) {
if (selected) {
return disposedIconSelect;
} else {
return disposedIcon;
}
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,15 @@ describe('TakesUpdateForm component', () => {
});

it('hides the delete button when the take has been completed', () => {
let completeTake = getMockApiTakes()[0];
let completeTake = getMockApiTakes()[0];
const takeModel = new TakeModel(completeTake);
takeModel.takeStatusTypeCode = ApiGen_CodeTypes_AcquisitionTakeStatusTypes.COMPLETE;

const { queryByTitle, getByTestId } = setup({props: {
takes: [takeModel],
}});
const { queryByTitle, getByTestId } = setup({
props: {
takes: [takeModel],
},
});

const deleteButton = queryByTitle('delete take');
expect(deleteButton).toBeNull();
Expand All @@ -194,16 +196,16 @@ describe('TakesUpdateForm component', () => {
});

it('shows the edit button when the take has been completed for Admin users', () => {
let completeTake = getMockApiTakes()[0];
let completeTake = getMockApiTakes()[0];
const takeModel = new TakeModel(completeTake);
takeModel.takeStatusTypeCode = ApiGen_CodeTypes_AcquisitionTakeStatusTypes.COMPLETE;

const { queryByTitle } = setup({
props: {
takes: [takeModel],
takes: [takeModel],
},
claims: [Claims.ACQUISITION_EDIT],
roles: [Roles.SYSTEM_ADMINISTRATOR]
roles: [Roles.SYSTEM_ADMINISTRATOR],
});

const deleteButton = queryByTitle('delete take');
Expand Down
3 changes: 2 additions & 1 deletion source/frontend/src/mocks/data.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ export const mockWfsGetPropertyById = {
ENCUMBRANCE_REASON: null,
IS_SENSITIVE: false,
IS_OWNED: false,
IS_PROPERTY_OF_INTEREST: false,
HAS_ACTIVE_RESEARCH_FILE: false,
HAS_ACTIVE_ACQUISITION_FILE: false,
IS_VISIBLE_TO_OTHER_AGENCIES: false,
ZONING: null,
ZONING_POTENTIAL: null,
Expand Down
9 changes: 6 additions & 3 deletions source/frontend/src/models/layers/pimsPropertyLocationView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ export interface PIMS_Property_Location_View {
readonly IS_SENSITIVE: boolean | null;
readonly IS_OWNED: boolean | null;
readonly IS_DISPOSED: boolean | null;
readonly IS_PROPERTY_OF_INTEREST: boolean | null;
readonly IS_OTHER_INTEREST: boolean | null;
readonly HAS_ACTIVE_ACQUISITION_FILE: boolean | null;
readonly HAS_ACTIVE_RESEARCH_FILE: boolean | null;
readonly IS_RETIRED: boolean | null;
readonly IS_VISIBLE_TO_OTHER_AGENCIES: boolean | null;
readonly ZONING: string | null;
Expand Down Expand Up @@ -82,7 +83,8 @@ export const EmptyPropertyLocation: PIMS_Property_Location_View = {
IS_SENSITIVE: null,
IS_OWNED: null,
IS_DISPOSED: null,
IS_PROPERTY_OF_INTEREST: null,
HAS_ACTIVE_ACQUISITION_FILE: null,
HAS_ACTIVE_RESEARCH_FILE: null,
IS_OTHER_INTEREST: null,
IS_RETIRED: null,
IS_VISIBLE_TO_OTHER_AGENCIES: null,
Expand Down Expand Up @@ -130,7 +132,8 @@ export interface PIMS_Property_Boundary_View {
readonly IS_SENSITIVE: boolean | null;
readonly IS_OWNED: boolean | null;
readonly IS_DISPOSED: boolean | null;
readonly IS_PROPERTY_OF_INTEREST: boolean | null;
readonly HAS_ACTIVE_RESEARCH_FILE: boolean | null;
readonly HAS_ACTIVE_ACQUISITION_FILE: boolean | null;
readonly IS_OTHER_INTEREST: boolean | null;
readonly IS_RETIRED: boolean | null;
readonly IS_VISIBLE_TO_OTHER_AGENCIES: boolean | null;
Expand Down
Loading