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

[MDS-6374] Change addressing duplicate report on extraction #3423

Merged
merged 2 commits into from
Feb 20, 2025

Conversation

asinn134
Copy link
Collaborator

Objective

MDS-6374

  • Change to check report name to address duplicate report on permit extraction
  • Change to address blank page showing when clicking a report
  • Change to address report name sometimes not showing up
  • I noticed when doing a permit amalgamation using the same document as the original permit extraction sometimes the previous report doesn't show in the comparison modal. Included a change for this.

image

@@ -31,7 +31,7 @@ const ComparePermitConditionHistoryModal: FC<ComparePermitConditionHistoryModalP
getMineReportPermitRequirementsByAmendment(props.permitGuid, props.previousAmendment?.permit_amendment_guid)
);

const oldReports = getConditionsWithRequirements([props.currentAmendmentCondition], previousMineReportPermitRequirements);
const oldReports = getConditionsWithRequirements([props.previousAmendmentCondition], previousMineReportPermitRequirements);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is mainly the change for the previous report not showing in the comparison modal when amalgamating with same document

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good catch! Looking at it, this seems obvious. 😂

@classmethod
def find_by_permit_condition_id(cls, _id) -> "MineReportPermitRequirement":
try:
return cls.query.filter_by(permit_condition_id=_id, deleted_ind=False).first()
Copy link
Collaborator

Choose a reason for hiding this comment

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

minor convention thing- what's with the underscore in _id?

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 think I just saw other functions doing that in this file and followed along. The underscore has been removed now.

/>
</Collapse.Panel>
))}
{conditionsWithRequirements.map((cond, index) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

is the condition no longer IPermitCondition? Wondering why typing was removed. Does it make sense to add optional property mineReportPermitRequirement to the interface?

Copy link
Collaborator Author

@asinn134 asinn134 Feb 19, 2025

Choose a reason for hiding this comment

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

I ran into an issue here with the getConditionsWithRequirements function, in it's if condition where requirements && condition?.permit_condition_id the code there would return an object of type IMineReportPermitRequirement. So sometimes the function would return a type of IMineReportPermitRequirement[] and sometimes a type of IPermitCondition[].

I think the way I tried to handled it initially in my PR isn't the best, I adjusted it now so getConditionsWithRequirements function will always return IPermitCondition[]

Copy link

Quality Gate Passed Quality Gate passed for 'bcgov-sonarcloud_mds_minespace-web'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

Copy link

Copy link

Copy link

Quality Gate Failed Quality Gate failed for 'bcgov-sonarcloud_mds_core-api'

Failed conditions
59.1% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@taraepp taraepp merged commit 7c85bfe into develop Feb 20, 2025
19 of 20 checks passed
@taraepp taraepp deleted the mds-6374-bugs-around-amalgamated-permit branch February 20, 2025 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants