Skip to content

PO-1849#2417

Open
Arnabsubedi233 wants to merge 2 commits intomasterfrom
PO-1849
Open

PO-1849#2417
Arnabsubedi233 wants to merge 2 commits intomasterfrom
PO-1849

Conversation

@Arnabsubedi233
Copy link
Copy Markdown
Contributor

Jira link

See https://tools.hmcts.net/jira/browse/PO-1849

Change description

  • Added the enforcement court change attribute

Testing done

  • Unit tested
  • Local tested

Security Vulnerability Assessment

CVE Suppression: Are there any CVEs present in the codebase (either newly introduced or pre-existing) that are being intentionally suppressed or ignored by this commit?

  • Yes
  • No

Checklist

  • commit messages are meaningful and follow good commit message guidelines
  • README and other documentation has been updated / added (if needed)
  • tests have been updated / new tests has been added (if needed)
  • Does this PR introduce a breaking change

Copy link
Copy Markdown
Contributor

@iamfrankiemoran iamfrankiemoran left a comment

Choose a reason for hiding this comment

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

Some changes, but talk on Tuesday about it

@Input() hasAccountMaintenancePermission: boolean = false;
@Input() hasEnterEnforcementPermission: boolean = false;
@Output() addEnforcementOverride = new EventEmitter<void>();
@Output() changeEnforcementCourt = new EventEmitter<number | null>();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure if the null should be here

Comment on lines +61 to +65
public handleChangeEnforcementCourt(): void {
if (this.hasAccountMaintenancePermission) {
this.changeEnforcementCourt.emit(this.tabData.enforcement_overview.enforcement_court?.court_id ?? null);
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would the link not be wrapped around this permission to prevent users who didn't have this permission to click a link they can't actually click on. Also, I don't think the link should show if the court_id was null. We could put an if statement in the HTML which looks for the permission and the court_id and pass that into the handleChangeEnforcementCourt() method as a parameter

summaryListId="enforcementOverviewDetails"
summaryListRowId="enforcement_court"
[actionEnabled]="hasAccountMaintenancePermission ? true : false"
(actionClick)="handleChangeEnforcementCourt()"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could pass in tabData.enforcement_overview.enforcement_court.court_id here

<app-fines-not-provided></app-fines-not-provided>
}
</ng-container>
@if (hasAccountMaintenancePermission) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The change link is already wrapped around a permission so no need to add a further check in the typescript

*
* @param currentEnforcementCourtId The current enforcement court id shown on the enforcement tab.
*/
public navigateToChangeEnforcementCourtPage(currentEnforcementCourtId: number | null): void {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure about passing in the enforcement court id here. This would be cached data so we could just grab that on the component, this is being treated as throwaway data

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we not use the resolver here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This exports a type, but should export an interface also you are missing the following:

export interface IFinesAccEnfCourtChangeForm extends IAbstractFormBaseForm<IFinesAccEnfCourtChangeFormState> {
  formData: IFinesAccEnfCourtChangeFormState;
}

Comment on lines +32 to +34
private readonly currentEnforcementCourtId = this.navigationRouter.currentNavigation()?.extras.state?.[
'currentEnforcementCourtId'
] as number | null | undefined;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure about this as we should be able to get it from cache

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This already exists within the Fines Mac journey. Probably need to bring it up a level

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.

2 participants