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-7622 | Added Subdivision view and backend retrieval of property operations #3816

Merged
merged 5 commits into from
Feb 26, 2024

Conversation

FuriousLlama
Copy link
Collaborator

No description provided.

@FuriousLlama FuriousLlama added the enhancement New feature or request label Feb 26, 2024
@FuriousLlama FuriousLlama self-assigned this Feb 26, 2024
Copy link
Contributor

✅ No secrets were detected in the code.

1 similar comment
Copy link
Contributor

✅ No secrets were detected in the code.

Copy link

codecov bot commented Feb 26, 2024

Codecov Report

Attention: Patch coverage is 37.26708% with 101 lines in your changes are missing coverage. Please review.

Project coverage is 75.26%. Comparing base (4ada249) to head (1f05ce9).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #3816      +/-   ##
==========================================
- Coverage   75.42%   75.26%   -0.17%     
==========================================
  Files        1415     1424       +9     
  Lines       38470    38628     +158     
  Branches     7908     7928      +20     
==========================================
+ Hits        29015    29072      +57     
- Misses       9161     9262     +101     
  Partials      294      294              
Flag Coverage Δ
unittests 75.26% <37.26%> (-0.17%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
.../apimodels/Models/Concepts/Property/PropertyMap.cs 100.00% <100.00%> (ø)
...Concepts/PropertyOperation/PropertyOperationMap.cs 100.00% <100.00%> (ø)
...frontend/src/components/common/Section/Section.tsx 79.31% <100.00%> (+1.53%) ⬆️
.../propertyDetails/detail/PropertyDetailsTabView.tsx 93.18% <100.00%> (+0.32%) ⬆️
...ls/update/models/UpdatePropertyDetailsFormModel.ts 98.01% <100.00%> (+0.04%) ⬆️
.../frontend/src/features/mapSideBar/shared/models.ts 89.89% <100.00%> (+0.20%) ⬆️
...oks/repositories/usePropertyOperationRepository.ts 100.00% <100.00%> (ø)
source/frontend/src/models/defaultInitializers.ts 88.88% <ø> (ø)
source/frontend/src/utils/utils.ts 84.21% <0.00%> (-2.28%) ⬇️
...tend/src/hooks/pims-api/useApiPropertyOperation.ts 20.00% <20.00%> (ø)
... and 6 more

#region Constructors

/// <summary>
/// Creates a new instance of a NoteRepository, and initializes it with the specified arguments.
Copy link
Collaborator

@asanchezr asanchezr Feb 26, 2024

Choose a reason for hiding this comment

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

nit: "Create an instance of <PropertyOperationRepository> ..."

Comment on lines 80 to 83
public int Count()
{
return this.Context.PimsNotes.Count();
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, this doesn't seem right. Either delete it of return the count for Context.PimsPropertyOperations

Comment on lines +27 to +28
"no-prototype-builtins": "off",
"no-debugger": "off"
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: I'm all for improving our linting rules but this PR seemed focused on backend changes. Fine for now, but we should try to keep changes relevant to their stories

@@ -19,6 +21,18 @@ const storeState = {

// mock keycloak auth library
jest.mock('@react-keycloak/web');
jest.mock('@/hooks/pims-api/useApiPropertyOperation.ts');
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure if this works but we don't put ".ts" in jest.mock() calls. I searched our codebase and we typically do:

// no .ts extension here
jest.mock('@/hooks/pims-api/useApiPropertyOperation');
...

}));


jest.mock('@/hooks/pims-api/useApiProperties.ts');
Copy link
Collaborator

Choose a reason for hiding this comment

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

same comment here regarding .ts extension in mock calls

import { booleanToYesNoUnknownString, stringToBoolean } from '@/utils/formUtils';
import { getPrettyLatLng } from '@/utils/mapPropertyUtils';

import { IPropertyDetailsForm, readOnlyMultiSelectStyle } from './PropertyDetailsTabView.helpers';
import { SubsivisionContainer } from './propertyOperation/SubdivisionContainer';
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: SubsivisionContainer -> SubdivisionContainer

export const SubsivisionContainer: React.FunctionComponent<ISubdivisionContainer> = ({
propertyId,
}) => {
const View = SubdivisionView;
Copy link
Collaborator

Choose a reason for hiding this comment

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

quick question - we usually pass in the "View" as parameter to the container so we can de-couple and test them independently. This doesn't seem the case here as we are "hardcoding" the view by using the imported view directly in the container.

Is there any special reasoning for this departure of our standards? If so, a comment would go a long way to explain to other devs looking at this code

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's right I will change it once the tests are implementented

Comment on lines +64 to +65
const retrievedSources = await Promise.all(sourcePromises);
const retrievedDestinations = await Promise.all(destinationPromises);
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: something to thing about/ tech-debt: this will (potentially) make a lot of requests to the GetProperty api endpoint. We should consider a "batch" get endpoint where we pass an array of Ids and get back the matching properties

Copy link
Contributor

✅ No secrets were detected in the code.

Copy link
Contributor

✅ No secrets were detected in the code.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 33.33333% with 48 lines in your changes are missing coverage. Please review.

Project coverage is 76.99%. Comparing base (487cdb6) to head (f7b6ecb).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #3816      +/-   ##
==========================================
+ Coverage   75.42%   76.99%   +1.56%     
==========================================
  Files        1415      483     -932     
  Lines       38470    17228   -21242     
  Branches     7908     1166    -6742     
==========================================
- Hits        29015    13264   -15751     
+ Misses       9161     3670    -5491     
  Partials      294      294              
Flag Coverage Δ
unittests 76.99% <33.33%> (+1.56%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
.../apimodels/Models/Concepts/Property/PropertyMap.cs 100.00% <100.00%> (ø)
...Concepts/PropertyOperation/PropertyOperationMap.cs 100.00% <100.00%> (ø)
...e/backend/dal/Repositories/EntityNoteRepository.cs 100.00% <ø> (ø)
...roperty/Controllers/PropertyOperationController.cs 0.00% <0.00%> (ø)
...e/backend/api/Services/PropertyOperationService.cs 0.00% <0.00%> (ø)
...nd/dal/Repositories/PropertyOperationRepository.cs 0.00% <0.00%> (ø)

... and 936 files with indirect coverage changes

@FuriousLlama FuriousLlama merged commit ba785ea into bcgov:dev Feb 26, 2024
7 checks passed
@FuriousLlama FuriousLlama deleted the features/psp-7622 branch May 23, 2024 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants