-
Notifications
You must be signed in to change notification settings - Fork 1
PO-1848 #2406
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
Open
Arnabsubedi233
wants to merge
11
commits into
master
Choose a base branch
from
PO-1848
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
PO-1848 #2406
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f2b773b
PO-1848
Arnabsubedi233 6863f9f
Merge branch 'master' into PO-1848
Arnabsubedi233 618ccc2
linting
Arnabsubedi233 0f0091b
Merge branch 'PO-1848' of https://github.com/hmcts/opal-frontend into…
Arnabsubedi233 fa9ada8
small refactoring
Arnabsubedi233 8c56fe9
comment response
Arnabsubedi233 8c32b4d
comment response
Arnabsubedi233 0954330
Adding missing requirement to redirect user back if selection is same…
Arnabsubedi233 c975c82
comment response
Arnabsubedi233 9b04cc7
Merge branch 'master' into PO-1848
Arnabsubedi233 0527a42
converting to inline radios and buttons
Arnabsubedi233 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
.../fines-acc-enf-collo-change/constants/fines-acc-enf-collo-change-field-errors.constant.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import { IFinesAccEnfColloChangeFieldErrors } from '../interfaces/fines-acc-enf-collo-change-field-errors.interface'; | ||
|
|
||
| export const FINES_ACC_ENF_COLLO_CHANGE_FIELD_ERRORS: IFinesAccEnfColloChangeFieldErrors = { | ||
| facc_enf_collection_order_made: { | ||
| required: { | ||
| message: 'Select whether the account is subject to a Collection Order', | ||
| priority: 1, | ||
| }, | ||
| }, | ||
| }; |
8 changes: 8 additions & 0 deletions
8
...ines-acc-enf-collo-change/constants/fines-acc-enf-collo-change-routing-titles.constant.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import { IFinesAccEnfColloChangeRoutingTitles } from '../interfaces/fines-acc-enf-collo-change-routing-titles.interface'; | ||
|
|
||
| export const FINES_ACC_ENF_COLLO_CHANGE_ROUTING_TITLES: IFinesAccEnfColloChangeRoutingTitles = { | ||
| root: 'Collection Order', | ||
| children: { | ||
| change: 'Change Collection Order status', | ||
| }, | ||
| }; |
1 change: 1 addition & 0 deletions
1
...nes-acc-enf-collo-change/constants/fines-acc-enf-collo-change-success-message.constant.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const FINES_ACC_ENF_COLLO_CHANGE_SUCCESS_MESSAGE = 'Collection Order status changed'; |
69 changes: 69 additions & 0 deletions
69
...llo-change/fines-acc-enf-collo-change-form/fines-acc-enf-collo-change-form.component.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| <opal-lib-govuk-error-summary | ||
| [errors]="formErrorSummaryMessage" | ||
| (errorClick)="scrollTo($event)" | ||
| ></opal-lib-govuk-error-summary> | ||
|
|
||
| <opal-lib-govuk-heading-with-caption | ||
| [captionText]="`${accountNumber} - ${partyName}`" | ||
| [headingText]="'Change Collection Order Status'" | ||
| headingClasses="govuk-heading-l govuk-!-margin-bottom-6" | ||
| > | ||
| </opal-lib-govuk-heading-with-caption> | ||
|
|
||
| <p class="govuk-body">If the status of a Collection Order is incorrect you can change it.</p> | ||
| <p class="govuk-body govuk-!-font-weight-bold">This will not issue a new notice.</p> | ||
| <p class="govuk-body"> | ||
| To add a new Collection Order and issue a notice you should | ||
| <a | ||
Arnabsubedi233 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| class="govuk-link govuk-link--no-visited-state" | ||
| href="" | ||
| id="facc_enf_collection_order_go_back" | ||
| (click)="handleRoute(defendantAccRoutingPaths.children.details, { fragment: 'enforcement', event: $event })" | ||
| >go back</a | ||
| > | ||
| and add an enforcement action. | ||
| </p> | ||
|
|
||
| <form (submit)="handleFormSubmit($event)" [formGroup]="form" class="govuk-form"> | ||
| <opal-lib-govuk-radio | ||
| radioClasses="govuk-radios--inline" | ||
| fieldSetId="facc_enf_collection_order_made" | ||
| legendText="Is this account subject to a Collection Order?" | ||
| legendClasses="govuk-fieldset__legend--m" | ||
| [errors]="formControlErrorMessages['facc_enf_collection_order_made']" | ||
| > | ||
| <div | ||
| opal-lib-govuk-radios-item | ||
| labelText="Yes" | ||
| inputId="facc_enf_collection_order_made_true" | ||
| inputName="facc_enf_collection_order_made" | ||
| [inputValue]="true" | ||
| [control]="form.get('facc_enf_collection_order_made')" | ||
| ></div> | ||
| <div | ||
| opal-lib-govuk-radios-item | ||
| labelText="No" | ||
| inputId="facc_enf_collection_order_made_false" | ||
| inputName="facc_enf_collection_order_made" | ||
| [inputValue]="false" | ||
| [control]="form.get('facc_enf_collection_order_made')" | ||
| ></div> | ||
| </opal-lib-govuk-radio> | ||
|
|
||
| <div class="govuk-grid-row"> | ||
| <div class="govuk-grid-column-two-thirds govuk-!-margin-bottom-0"> | ||
| <div class="govuk-button-group govuk-!-margin-bottom-0"> | ||
| <opal-lib-govuk-button | ||
| buttonId="submitForm" | ||
| type="submit" | ||
| buttonClasses="nested-flow govuk-button--primary govuk-!-margin-bottom-0" | ||
| > | ||
| Change | ||
| </opal-lib-govuk-button> | ||
| <opal-lib-govuk-cancel-link | ||
| (linkClickEvent)="handleRoute(defendantAccRoutingPaths.children.details, { fragment: 'enforcement' })" | ||
| ></opal-lib-govuk-cancel-link> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </form> | ||
36 changes: 36 additions & 0 deletions
36
...-change/fines-acc-enf-collo-change-form/fines-acc-enf-collo-change-form.component.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
| import { ActivatedRoute } from '@angular/router'; | ||
| import { beforeEach, describe, expect, it } from 'vitest'; | ||
| import { FinesAccEnfColloChangeFormComponent } from './fines-acc-enf-collo-change-form.component'; | ||
|
|
||
| describe('FinesAccEnfColloChangeFormComponent', () => { | ||
| let component: FinesAccEnfColloChangeFormComponent; | ||
| let fixture: ComponentFixture<FinesAccEnfColloChangeFormComponent>; | ||
|
|
||
| beforeEach(async () => { | ||
| await TestBed.configureTestingModule({ | ||
| imports: [FinesAccEnfColloChangeFormComponent], | ||
| providers: [{ provide: ActivatedRoute, useValue: { snapshot: { params: {}, data: {} } } }], | ||
| }).compileComponents(); | ||
|
|
||
| fixture = TestBed.createComponent(FinesAccEnfColloChangeFormComponent); | ||
| component = fixture.componentInstance; | ||
| component.accountNumber = '177A'; | ||
| component.partyName = 'Mr Robert THOMSON'; | ||
| fixture.detectChanges(); | ||
| }); | ||
|
|
||
| it('should create', () => { | ||
| expect(component).toBeTruthy(); | ||
| }); | ||
|
|
||
| it('should initialize the collection order control', () => { | ||
| expect(component.form.get('facc_enf_collection_order_made')).toBeTruthy(); | ||
| expect(component.form.get('facc_enf_collection_order_made')?.value).toBeNull(); | ||
| }); | ||
|
|
||
| it('should render the account caption in account-number-first format', () => { | ||
| const compiled = fixture.nativeElement as HTMLElement; | ||
| expect(compiled.textContent).toContain('177A - Mr Robert THOMSON'); | ||
| }); | ||
| }); |
64 changes: 64 additions & 0 deletions
64
...collo-change/fines-acc-enf-collo-change-form/fines-acc-enf-collo-change-form.component.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit } from '@angular/core'; | ||
| import { FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; | ||
| import { AbstractFormBaseComponent } from '@hmcts/opal-frontend-common/components/abstract/abstract-form-base'; | ||
| import { | ||
| IAbstractFormBaseFieldErrors, | ||
| IAbstractFormBaseForm, | ||
| } from '@hmcts/opal-frontend-common/components/abstract/abstract-form-base/interfaces'; | ||
| import { IAbstractFormControlErrorMessage } from '@hmcts/opal-frontend-common/components/abstract/interfaces'; | ||
| import { GovukButtonComponent } from '@hmcts/opal-frontend-common/components/govuk/govuk-button'; | ||
| import { GovukCancelLinkComponent } from '@hmcts/opal-frontend-common/components/govuk/govuk-cancel-link'; | ||
| import { GovukErrorSummaryComponent } from '@hmcts/opal-frontend-common/components/govuk/govuk-error-summary'; | ||
| import { GovukHeadingWithCaptionComponent } from '@hmcts/opal-frontend-common/components/govuk/govuk-heading-with-caption'; | ||
| import { | ||
| GovukRadioComponent, | ||
| GovukRadiosItemComponent, | ||
| } from '@hmcts/opal-frontend-common/components/govuk/govuk-radio'; | ||
| import { FINES_ACC_DEFENDANT_ROUTING_PATHS } from '../../routing/constants/fines-acc-defendant-routing-paths.constant'; | ||
| import { IFinesAccEnfColloChangeFormState } from '../interfaces/fines-acc-enf-collo-change-form-state.interface'; | ||
| import { FINES_ACC_ENF_COLLO_CHANGE_FIELD_ERRORS } from '../constants/fines-acc-enf-collo-change-field-errors.constant'; | ||
|
|
||
| @Component({ | ||
| selector: 'app-fines-acc-enf-collo-change-form', | ||
| imports: [ | ||
| FormsModule, | ||
| ReactiveFormsModule, | ||
| GovukButtonComponent, | ||
| GovukCancelLinkComponent, | ||
| GovukErrorSummaryComponent, | ||
| GovukHeadingWithCaptionComponent, | ||
| GovukRadioComponent, | ||
| GovukRadiosItemComponent, | ||
| ], | ||
| templateUrl: './fines-acc-enf-collo-change-form.component.html', | ||
| changeDetection: ChangeDetectionStrategy.OnPush, | ||
| standalone: true, | ||
| }) | ||
| export class FinesAccEnfColloChangeFormComponent extends AbstractFormBaseComponent implements OnInit { | ||
| protected override fieldErrors: IAbstractFormBaseFieldErrors = { | ||
| ...FINES_ACC_ENF_COLLO_CHANGE_FIELD_ERRORS, | ||
| }; | ||
| protected override formSubmit = new EventEmitter<IAbstractFormBaseForm<IFinesAccEnfColloChangeFormState>>(); | ||
| public override formControlErrorMessages: IAbstractFormControlErrorMessage = {}; | ||
| public readonly defendantAccRoutingPaths = FINES_ACC_DEFENDANT_ROUTING_PATHS; | ||
|
|
||
| @Input({ required: true }) partyName!: string; | ||
| @Input({ required: true }) accountNumber!: string; | ||
|
|
||
| /** | ||
| * Creates the form group for changing the Collection Order status. | ||
| */ | ||
| private setupForm(): void { | ||
| this.form = new FormGroup({ | ||
| facc_enf_collection_order_made: new FormControl<boolean | null>(null, Validators.required), | ||
| }); | ||
| } | ||
|
|
||
| /** | ||
| * Initialises the form before running the shared abstract form setup. | ||
| */ | ||
| public override ngOnInit(): void { | ||
| this.setupForm(); | ||
| super.ngOnInit(); | ||
| } | ||
| } |
8 changes: 8 additions & 0 deletions
8
...lows/fines/fines-acc/fines-acc-enf-collo-change/fines-acc-enf-collo-change.component.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <div class="govuk-grid-column-two-thirds"> | ||
| <app-fines-acc-enf-collo-change-form | ||
| [accountNumber]="accountNumber" | ||
| [partyName]="partyName" | ||
| (unsavedChanges)="handleUnsavedChanges($event)" | ||
| (formSubmit)="handleSubmit($event)" | ||
| ></app-fines-acc-enf-collo-change-form> | ||
| </div> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.