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

Csfd 15 ungrey back button #1706

Open
wants to merge 98 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 56 commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
9c8b822
Work in progress regarding CSFD-16
joeevanshmcts Feb 12, 2024
cc20f76
Merge branch 'master' into csfd-15-ungrey-back-button
joeevanshmcts Feb 13, 2024
500d762
Resolved a couple of bugs associated with the changes for CSFD-16
joeevanshmcts Feb 13, 2024
cafd3e1
Work in progress regarding CSFD-8
joeevanshmcts Feb 13, 2024
52889ba
Included changes for the case unlink component, regarding CSFD-8
joeevanshmcts Feb 13, 2024
e847534
Work in progress regarding CSFD-15, ungrey back button
joeevanshmcts Feb 13, 2024
ce26aa4
Merge branch 'master' into csfd-15-ungrey-back-button
joeevanshmcts Feb 13, 2024
b19805a
Removed console log & also allowed previous button to work as expecte…
joeevanshmcts Feb 13, 2024
7aed3d3
I've added a change to allow the previous button to work nicely for t…
joeevanshmcts Feb 14, 2024
97c0fd5
Work in progress, unregey previous button for the case link journey
joeevanshmcts Feb 14, 2024
994bf2d
WIP: Case link previous button in progress.
joeevanshmcts Feb 16, 2024
4925d68
Merge branch 'master' into csfd-15-ungrey-back-button
joeevanshmcts Mar 5, 2024
d43ab0d
Merged with master & fixed tests
joeevanshmcts Mar 5, 2024
9a6e777
CSFD-18
johnbenjamin-hmcts Mar 5, 2024
4d8be9d
CSFD-18 v2
johnbenjamin-hmcts Mar 5, 2024
815661a
CSFD-18 v2
johnbenjamin-hmcts Mar 5, 2024
7989911
CSFD-18 v2
johnbenjamin-hmcts Mar 5, 2024
bbd3def
Merge branch 'master' into csfd-15-ungrey-back-button
joeevanshmcts Mar 12, 2024
4e92e80
Merge branch 'csfd-15-ungrey-back-button' into feature/CSFD-18-v2
johnbenjamin-hmcts Mar 15, 2024
206b342
Merge pull request #1690 from hmcts/feature/CSFD-18-v2
johnbenjamin-hmcts Mar 15, 2024
a2adad0
Merge branch 'master' into csfd-15-ungrey-back-button
joeevanshmcts Mar 26, 2024
9f93d04
More tests & removed comments
joeevanshmcts Mar 26, 2024
2718944
Fixed some tests for CaseEditPageComponent
joeevanshmcts Mar 26, 2024
e1c22f7
WIP to fixing tests
joeevanshmcts Mar 26, 2024
0caac8f
Updated version & fixed tests
joeevanshmcts Mar 26, 2024
1204083
Merge branch 'master' into csfd-15-ungrey-back-button
Josh-HMCTS Jul 8, 2024
56dba5d
Fix for navigating to select-flag-type from CYA not showing end node …
Josh-HMCTS Jul 12, 2024
37dd646
Fix navigation through subjourney, fix flow when going forward and su…
Josh-HMCTS Jul 16, 2024
ad08e1b
Fix broken tests
Josh-HMCTS Jul 16, 2024
e3b6d57
Add unit tests
Josh-HMCTS Jul 16, 2024
ecc5a97
basic unit tests for select flag
Josh-HMCTS Jul 16, 2024
40a9749
Up code coverage
Josh-HMCTS Jul 17, 2024
9ab2310
Merge branch 'master' into csfd-15-ungrey-back-button
Josh-HMCTS Jul 17, 2024
c603a6a
change version number
Josh-HMCTS Jul 17, 2024
6668e63
Fix when navigating from CYA not default to last sub journey
Josh-HMCTS Jul 17, 2024
6854e7a
up ver num
Josh-HMCTS Jul 17, 2024
3438afa
Merge branch 'master' into csfd-15-ungrey-back-button
Josh-HMCTS Jul 25, 2024
500e7d3
change ver name
Josh-HMCTS Jul 25, 2024
9b3eb74
Merge branch 'master' into csfd-15-ungrey-back-button
Josh-HMCTS Aug 1, 2024
3d7dba0
exui-2208
Josh-HMCTS Aug 1, 2024
1aab82f
2210
Josh-HMCTS Aug 2, 2024
a752f70
EXUI-2213
Josh-HMCTS Aug 7, 2024
763cd65
resolve broken unit tests
Josh-HMCTS Aug 7, 2024
3941532
Merge branch 'master' into csfd-15-ungrey-back-button
Josh-HMCTS Aug 7, 2024
398cbd3
Update coverage
Josh-HMCTS Aug 8, 2024
071b2ed
Up code coverage
Josh-HMCTS Aug 8, 2024
00928bc
Update version name
Josh-HMCTS Aug 8, 2024
1198ce7
code review comments
Josh-HMCTS Aug 8, 2024
25937b4
Merge branch 'master' into csfd-15-ungrey-back-button
Josh-HMCTS Aug 22, 2024
c140bd8
fix AC1 issue 1
Josh-HMCTS Aug 22, 2024
9f49840
Issue 2 - Ensure data is retained when navigating from type to location
Josh-HMCTS Aug 27, 2024
3960bb4
Issue 3 - Blocked from progressing journey
Josh-HMCTS Aug 29, 2024
4cfa3f5
Issue 5 - Previous button showing at start of journey
Josh-HMCTS Sep 2, 2024
7dc3b0c
Merge branch 'master' into csfd-15-ungrey-back-button
Josh-HMCTS Sep 2, 2024
54e014b
Fix unit tests
Josh-HMCTS Sep 2, 2024
26a15d0
Update ver name
Josh-HMCTS Sep 2, 2024
73eb8f7
Remove console log
Josh-HMCTS Sep 9, 2024
e50d25a
Merge branch 'master' into csfd-15-ungrey-back-button
Josh-HMCTS Sep 9, 2024
2f2b707
Fix for when user navigates using previous
Josh-HMCTS Sep 10, 2024
434773f
Fix backwards navigation not hiding previous when at start of journey
Josh-HMCTS Sep 10, 2024
61e2d0a
Manage case not progressable when adding translation
Josh-HMCTS Sep 12, 2024
9cb2033
Update ver num for translation journey
Josh-HMCTS Sep 12, 2024
6c9c31b
Merge branch 'master' into csfd-15-ungrey-back-button
Josh-HMCTS Sep 12, 2024
bbdb0ca
Fix being unable to enter multiple links
Josh-HMCTS Sep 12, 2024
2b00237
fix navigating via change link not taking user to end of subjourney
Josh-HMCTS Sep 12, 2024
24c0e70
Up ver num
Josh-HMCTS Sep 12, 2024
3cb9415
Fix manage flag not showing selected value when navigating back to pa…
Josh-HMCTS Sep 13, 2024
4470a5f
reset form values if flag location is changed
Josh-HMCTS Sep 16, 2024
7d97943
Update version number
Josh-HMCTS Sep 16, 2024
02373c7
fix unit tests
Josh-HMCTS Sep 16, 2024
a9ed864
add test for new funciton
Josh-HMCTS Sep 16, 2024
46700e9
add new tests for new fuctions
Josh-HMCTS Sep 16, 2024
729787c
Merge branch 'master' into csfd-15-ungrey-back-button
Josh-HMCTS Sep 25, 2024
d3f5173
Resolve issues on navigating using previous button on CYA page
Josh-HMCTS Sep 25, 2024
d68b2a2
Update version name to new pre-release ver
Josh-HMCTS Sep 25, 2024
037f65e
Update ver num, fix nav on CYA
Josh-HMCTS Sep 26, 2024
b20d3fa
add extra test case
Josh-HMCTS Sep 26, 2024
2980b1c
Fix bugs on manage case links journey
Josh-HMCTS Sep 27, 2024
4ccd198
Update ver name
Josh-HMCTS Sep 27, 2024
85bbd74
Merge branch 'master' into csfd-15-ungrey-back-button
Josh-HMCTS Sep 27, 2024
bdc05ee
Merge branch 'master' into csfd-15-ungrey-back-button
Josh-HMCTS Oct 24, 2024
259391a
Merge branch 'master' into csfd-15-ungrey-back-button
Josh-HMCTS Oct 28, 2024
55cd544
Merge branch 'master' into csfd-15-ungrey-back-button
Josh-HMCTS Oct 29, 2024
8fd59d3
temp commit
Josh-HMCTS Nov 4, 2024
ef639f5
Remove testing log
Josh-HMCTS Nov 6, 2024
bc5f4ff
Avoid changing page number on specific pages
Josh-HMCTS Nov 6, 2024
698af49
update to remove data that should not be included in request on updat…
Josh-HMCTS Nov 6, 2024
0c140fe
Merge branch 'master' into csfd-15-ungrey-back-button
Josh-HMCTS Nov 6, 2024
718ab59
Improve resilience when potential missing props, fix unit tests
Josh-HMCTS Nov 6, 2024
53742f9
resolve user geting stuck in navigation on manage case links
Josh-HMCTS Nov 14, 2024
ffa917b
up ver num to test force build
Josh-HMCTS Nov 14, 2024
39ff4a1
Fix reload issue
Josh-HMCTS Nov 20, 2024
a8fe846
change ver num
Josh-HMCTS Nov 20, 2024
58795a2
update yarn audit
Josh-HMCTS Nov 20, 2024
944aade
Update code to account for challenged cases, add test
Josh-HMCTS Nov 22, 2024
4b142ee
up ver num
Josh-HMCTS Nov 22, 2024
5192946
fix ver num
Josh-HMCTS Nov 22, 2024
c99fa77
set ver num
Josh-HMCTS Nov 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
### Version 7.0.20
**EUI-1300** accessibility change

### Version 7.0.18-event-flow-cancel-navigation-v2
**CSFD-18** Ungrey back button - event flow cancel navigation

### Version 7.0.19
**EUI-1067** No error message is displayed when entering incorrect postcode
**EUI-1123** TextArea fields are not preloaded even the data is present in response intermittently
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hmcts/ccd-case-ui-toolkit",
"version": "7.0.61",
"version": "7.0.61-ungrey-back-button",
"engines": {
"node": ">=18.19.0"
},
Expand Down
2 changes: 1 addition & 1 deletion projects/ccd-case-ui-toolkit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hmcts/ccd-case-ui-toolkit",
"version": "7.0.61",
"version": "7.0.61-ungrey-back-button",
"engines": {
"node": ">=18.19.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
DRAFT_PREFIX,
FieldType,
HttpError,
Jurisdiction,
} from '../../../domain';
import { aCaseField } from '../../../fixture/shared.test.fixture';
import { CcdPageFieldsPipe } from '../../../pipes';
Expand All @@ -42,7 +43,10 @@ import {
FieldTypeSanitiser,
FormErrorService,
FormValueService,
JurisdictionService,
LoadingService,
MultipageComponentStateService,
SearchService,
} from '../../../services';
import { ValidPageListCaseFieldsService } from '../services/valid-page-list-caseFields.service';
import { FieldsUtils } from '../../../services/fields/fields.utils';
Expand All @@ -58,6 +62,7 @@ import { CaseEditPageText } from './case-edit-page-text.enum';
import { CaseEditPageComponent } from './case-edit-page.component';
import { ShowCondition } from '../../../directives';
import createSpyObj = jasmine.createSpyObj;
import { LinkedCasesService } from '../../palette/linked-cases/services/linked-cases.service';

describe('CaseEditPageComponent - creation and update event trigger tests', () => {
let component: CaseEditPageComponent;
Expand All @@ -69,6 +74,27 @@ describe('CaseEditPageComponent - creation and update event trigger tests', () =
]);
const mockStore = jasmine.createSpyObj('Store', ['dispatch']);

const CASE_TYPES_2 = [
{
id: 'Benefit_Xui',
name: 'Benefit_Xui',
description: '',
states: [],
events: [],
}];
const MOCK_JURISDICTION: Jurisdiction[] = [{
id: 'JURI_1',
name: 'Jurisdiction 1',
description: '',
caseTypes: CASE_TYPES_2
}];

const searchService = createSpyObj<SearchService>('SearchService', ['searchCases', 'searchCasesByIds', 'search']);
searchService.searchCasesByIds.and.returnValue(of({}));
const jurisdictionService = createSpyObj<JurisdictionService>('JurisdictionService', ['getJurisdictions']);
jurisdictionService.getJurisdictions.and.returnValue(of(MOCK_JURISDICTION));
const linkedCasesService = new LinkedCasesService(jurisdictionService, searchService);

const initializeComponent = ({
caseEdit = {},
formValueService = {},
Expand All @@ -81,7 +107,9 @@ describe('CaseEditPageComponent - creation and update event trigger tests', () =
caseEditDataService = {},
loadingService = {},
validPageListCaseFieldsService = {},
addressesService = {}
multipageComponentStateService = new MultipageComponentStateService(),
addressesService = {},
linkedCasesService = {}
}) =>
new CaseEditPageComponent(
caseEdit as CaseEditComponent,
Expand All @@ -95,7 +123,9 @@ describe('CaseEditPageComponent - creation and update event trigger tests', () =
caseEditDataService as CaseEditDataService,
loadingService as LoadingService,
validPageListCaseFieldsService as ValidPageListCaseFieldsService,
addressesService as AddressesService
multipageComponentStateService as MultipageComponentStateService,
addressesService as AddressesService,
linkedCasesService as LinkedCasesService
);

it('should create', () => {
Expand All @@ -104,6 +134,43 @@ describe('CaseEditPageComponent - creation and update event trigger tests', () =
expect(component).toBeTruthy();
});

describe('multipageComponentStateService', () => {
it('should trigger previous step with the multi-page component state service', () => {
const multipageComponentStateService: MultipageComponentStateService = new MultipageComponentStateService();
const component:CaseEditPageComponent = initializeComponent({ multipageComponentStateService });
multipageComponentStateService.resetJourneyCollection();
spyOn(multipageComponentStateService, 'previous');

multipageComponentStateService.setInstigator(component);
component.previousStep();

expect(multipageComponentStateService.previous).toHaveBeenCalled();
});

it('should trigger next step with the multi-page component state service', () => {
const multipageComponentStateService: MultipageComponentStateService = new MultipageComponentStateService();
const caseEditDataService: CaseEditDataService = new CaseEditDataService();
const component:CaseEditPageComponent = initializeComponent({ multipageComponentStateService, caseEditDataService });
spyOn(multipageComponentStateService, 'next');

multipageComponentStateService.setInstigator(component);
component.nextStep();

expect(multipageComponentStateService.next).toHaveBeenCalled();
});

it('should reset the multi-page component state service on destruction', () => {
const multipageComponentStateService: MultipageComponentStateService = new MultipageComponentStateService();
const component:CaseEditPageComponent = initializeComponent({ multipageComponentStateService });
spyOn(multipageComponentStateService, 'reset');

multipageComponentStateService.setInstigator(component);
component.ngOnDestroy();

expect(multipageComponentStateService.reset).toHaveBeenCalled();
});
});

describe('updateEventTriggerCaseFields', () => {
it(`should NOT update event trigger's case fields as eventTrigger is null`, () => {
component = initializeComponent({});
Expand Down Expand Up @@ -353,6 +420,8 @@ describe('CaseEditPageComponent - all other tests', () => {
const caseField1 = new CaseField();
const caseField2 = new CaseField();
const eventData = new CaseEventData();
let multipageComponentStateService = new MultipageComponentStateService();

const caseEventDataPrevious: CaseEventData = {
data: {
field1: 'Updated value',
Expand All @@ -364,6 +433,28 @@ describe('CaseEditPageComponent - all other tests', () => {
ignore_warning: true,
};

const CASE_TYPES_2 = [
{
id: 'Benefit_Xui',
name: 'Benefit_Xui',
description: '',
states: [],
events: [],
}];
const MOCK_JURISDICTION: Jurisdiction[] = [{
id: 'JURI_1',
name: 'Jurisdiction 1',
description: '',
caseTypes: CASE_TYPES_2
}];

const searchService = createSpyObj<SearchService>('SearchService', ['searchCases', 'searchCasesByIds', 'search']);
searchService.searchCasesByIds.and.returnValue(of({}));
const jurisdictionService = createSpyObj<JurisdictionService>('JurisdictionService', ['getJurisdictions']);
jurisdictionService.getJurisdictions.and.returnValue(of(MOCK_JURISDICTION));
const linkedCasesService = new LinkedCasesService(jurisdictionService, searchService);


describe('Save and Resume enabled', () => {
const eventTrigger = {
case_fields: [caseField1],
Expand Down Expand Up @@ -458,6 +549,7 @@ describe('CaseEditPageComponent - all other tests', () => {
};
loadingServiceMock = createSpyObj<LoadingService>('LoadingService', ['register', 'unregister']);
const addressesServiceMock = jasmine.createSpyObj('addressesService', ['setMandatoryError']);
multipageComponentStateService = new MultipageComponentStateService();

TestBed.configureTestingModule({
imports: [FormsModule, ReactiveFormsModule],
Expand All @@ -481,7 +573,10 @@ describe('CaseEditPageComponent - all other tests', () => {
PlaceholderService,
{ provide: LoadingService, useValue: loadingServiceMock },
{ provide: ValidPageListCaseFieldsService, useValue: validPageListCaseFieldsService},
{ provide: AddressesService, useValue: addressesServiceMock }
{ provide: AddressesService, useValue: addressesServiceMock },
{ provide: MultipageComponentStateService, useValue: multipageComponentStateService },
{ provide: LinkedCasesService, useValue: linkedCasesService }

],
}).compileComponents();
fixture = TestBed.createComponent(CaseEditPageComponent);
Expand Down Expand Up @@ -878,7 +973,9 @@ describe('CaseEditPageComponent - all other tests', () => {
PlaceholderService,
{ provide: LoadingService, useValue: loadingServiceMock },
{ provide: ValidPageListCaseFieldsService, useValue: validPageListCaseFieldsService},
{ provide: AddressesService, useValue: addressesServiceMock }
{ provide: AddressesService, useValue: addressesServiceMock },
{ provide: LinkedCasesService, useValue: linkedCasesService }

],
}).compileComponents();
})
Expand Down Expand Up @@ -1045,7 +1142,8 @@ describe('CaseEditPageComponent - all other tests', () => {
PlaceholderService,
{ provide: LoadingService, useValue: loadingServiceMock },
{ provide: ValidPageListCaseFieldsService, useValue: validPageListCaseFieldsService},
{ provide: AddressesService, useValue: addressesServiceMock }
{ provide: AddressesService, useValue: addressesServiceMock },
{ provide: LinkedCasesService, useValue: linkedCasesService }
],
}).compileComponents();
})
Expand Down Expand Up @@ -1217,7 +1315,8 @@ describe('CaseEditPageComponent - all other tests', () => {
PlaceholderService,
{ provide: LoadingService, useValue: loadingServiceMock },
{ provide: ValidPageListCaseFieldsService, useValue: validPageListCaseFieldsService},
{ provide: AddressesService, useValue: addressesServiceMock }
{ provide: AddressesService, useValue: addressesServiceMock },
{ provide: LinkedCasesService, useValue: linkedCasesService }
],
}).compileComponents();
})
Expand Down Expand Up @@ -1564,7 +1663,8 @@ describe('CaseEditPageComponent - all other tests', () => {
PlaceholderService,
{ provide: LoadingService, useValue: loadingServiceMock },
{ provide: ValidPageListCaseFieldsService, useValue: validPageListCaseFieldsService},
{ provide: AddressesService, useValue: addressesServiceMock}
{ provide: AddressesService, useValue: addressesServiceMock},
{ provide: LinkedCasesService, useValue: linkedCasesService }
],
}).compileComponents();
})
Expand Down Expand Up @@ -1783,7 +1883,9 @@ describe('CaseEditPageComponent - all other tests', () => {
PlaceholderService,
{ provide: LoadingService, useValue: loadingServiceMock },
{ provide: ValidPageListCaseFieldsService, useValue: validPageListCaseFieldsService},
{ provide: AddressesService, useValue: addressesServiceMock }
{ provide: AddressesService, useValue: addressesServiceMock },
{ provide: LinkedCasesService, useValue: linkedCasesService }

],
}).compileComponents();
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { CaseEventData } from '../../../domain/case-event-data.model';
import { CaseEventTrigger } from '../../../domain/case-view/case-event-trigger.model';
import { CaseField } from '../../../domain/definition';
import { DRAFT_PREFIX } from '../../../domain/draft.model';
import { AddressesService, LoadingService } from '../../../services';
import { AddressesService, LoadingService, MultipageComponentStateService } from '../../../services';
import { CaseFieldService } from '../../../services/case-fields/case-field.service';
import { FieldsUtils } from '../../../services/fields';
import { FormErrorService } from '../../../services/form/form-error.service';
Expand All @@ -22,13 +22,15 @@ import { WizardPage } from '../domain/wizard-page.model';
import { Wizard } from '../domain/wizard.model';
import { PageValidationService } from '../services/page-validation.service';
import { ValidPageListCaseFieldsService } from '../services/valid-page-list-caseFields.service';
import { JourneyInstigator } from '../../../domain/journey';
import { LinkedCasesService } from '../../palette/linked-cases/services/linked-cases.service';

@Component({
selector: 'ccd-case-edit-page',
templateUrl: 'case-edit-page.html',
styleUrls: ['./case-edit-page.scss']
})
export class CaseEditPageComponent implements OnInit, AfterViewChecked, OnDestroy {
export class CaseEditPageComponent implements OnInit, AfterViewChecked, OnDestroy, JourneyInstigator {
public static readonly RESUMED_FORM_DISCARD = 'RESUMED_FORM_DISCARD';
public static readonly NEW_FORM_DISCARD = 'NEW_FORM_DISCARD';
public static readonly NEW_FORM_SAVE = 'NEW_FORM_CHANGED_SAVE';
Expand Down Expand Up @@ -85,8 +87,33 @@ export class CaseEditPageComponent implements OnInit, AfterViewChecked, OnDestro
private readonly caseEditDataService: CaseEditDataService,
private readonly loadingService: LoadingService,
private readonly validPageListCaseFieldsService: ValidPageListCaseFieldsService,
private readonly addressService: AddressesService
private readonly multipageComponentStateService: MultipageComponentStateService,
private readonly addressService: AddressesService,
private readonly linkedCasesService: LinkedCasesService,
) {
this.multipageComponentStateService.setInstigator(this);
}

public onFinalNext(): void {
this.submit();
}

public onFinalPrevious(): void {
this.cancel();
}

public isAtStart(): boolean {
return this.multipageComponentStateService.getJourneyCollection()[0]?.journeyPageNumber === this.multipageComponentStateService.getJourneyCollection()[0]?.journeyStartPageNumber;
}

// This method will be triggered by the next button in the app component
public nextStep(): void {
this.multipageComponentStateService.next();
}

// This method will be triggered by the previous button in the app component
public previousStep(): void {
this.multipageComponentStateService.previous();
}

public ngOnInit(): void {
Expand Down Expand Up @@ -148,6 +175,7 @@ export class CaseEditPageComponent implements OnInit, AfterViewChecked, OnDestro
this.dialogRefAfterClosedSub?.unsubscribe();
this.saveDraftSub?.unsubscribe();
this.caseFormValidationErrorsSub?.unsubscribe();
this.multipageComponentStateService.reset();
}

public applyValuesChanged(valuesChanged: boolean): void {
Expand Down Expand Up @@ -175,11 +203,11 @@ export class CaseEditPageComponent implements OnInit, AfterViewChecked, OnDestro
*/
public toPreviousPage(): void {
this.caseEditDataService.clearFormValidationErrors();

const caseEventData: CaseEventData = this.buildCaseEventData(true);
caseEventData.data = caseEventData.event_data;
this.updateFormData(caseEventData);
this.previous();
this.previousStep();
CaseEditPageComponent.setFocusToTop();
}

Expand Down Expand Up @@ -434,6 +462,9 @@ export class CaseEditPageComponent implements OnInit, AfterViewChecked, OnDestro
}

public cancel(): void {
if (this.isLinkedCasesJourney()){
this.linkedCasesService.resetLinkedCaseData();
}
if (this.eventTrigger.can_save_draft) {
if (this.formValuesChanged) {
const dialogRef = this.dialog.open(SaveOrDiscardDialogComponent, this.dialogConfig);
Expand All @@ -457,6 +488,7 @@ export class CaseEditPageComponent implements OnInit, AfterViewChecked, OnDestro
}

this.caseEditDataService.clearFormValidationErrors();
this.multipageComponentStateService.reset();
}

public submitting(): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ <h2 class="govuk-error-summary__title" id="error-summary-title">
(callbackErrorsContext)="callbackErrorsNotify($event)">
</ccd-callback-errors>
<div class="width-50">
<form *ngIf="currentPage" class="form" [formGroup]="editForm" (submit)="submit()">
<form *ngIf="currentPage" class="form" [formGroup]="editForm" (submit)="nextStep()">
<fieldset id="fieldset-case-data">
<legend style="display: none;"></legend>
<!-- single column -->
Expand All @@ -62,7 +62,7 @@ <h2 class="govuk-error-summary__title" id="error-summary-title">
</fieldset>

<div class="form-group form-group-related">
<button class="button button-secondary" type="button" [disabled]="!(hasPreviousPage$ | async)" (click)="toPreviousPage()">
<button class="button button-secondary" type="button" (click)="toPreviousPage()" *ngIf="!isAtStart()" [disabled]="isAtStart()">
{{'Previous' | rpxTranslate}}
</button>
<button class="button" type="submit" [disabled]="submitting()">{{triggerText | rpxTranslate}}</button>
Expand Down
Loading
Loading