-
Notifications
You must be signed in to change notification settings - Fork 38
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
Conversation
@@ -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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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[]
|
|
|
|
Objective
MDS-6374