@hmcts/ccd-case-ui-toolkit 6.13.10-g-exui-197 → 6.13.10-linked-cases-continue-button-validation-v4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/RELEASE-NOTES.md +3 -0
- package/dist/ccd-case-ui-toolkit/bundles/hmcts-ccd-case-ui-toolkit.umd.js +66 -100
- package/dist/ccd-case-ui-toolkit/bundles/hmcts-ccd-case-ui-toolkit.umd.js.map +1 -1
- package/dist/ccd-case-ui-toolkit/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js +1 -1
- package/dist/ccd-case-ui-toolkit/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js.map +1 -1
- package/dist/ccd-case-ui-toolkit/esm2015/lib/shared/commons/case-edit-data/case-edit-data.service.js +5 -8
- package/dist/ccd-case-ui-toolkit/esm2015/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.js +21 -3
- package/dist/ccd-case-ui-toolkit/esm2015/lib/shared/components/palette/linked-cases/domain/linked-cases-state.model.js +1 -1
- package/dist/ccd-case-ui-toolkit/esm2015/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.js +36 -86
- package/dist/ccd-case-ui-toolkit/esm2015/lib/shared/components/palette/palette.module.js +2 -2
- package/dist/ccd-case-ui-toolkit/esm2015/lib/shared/services/fields/fields.utils.js +8 -1
- package/dist/ccd-case-ui-toolkit/fesm2015/hmcts-ccd-case-ui-toolkit.js +66 -94
- package/dist/ccd-case-ui-toolkit/fesm2015/hmcts-ccd-case-ui-toolkit.js.map +1 -1
- package/dist/ccd-case-ui-toolkit/lib/shared/commons/case-edit-data/case-edit-data.service.d.ts +3 -5
- package/dist/ccd-case-ui-toolkit/lib/shared/commons/case-edit-data/case-edit-data.service.d.ts.map +1 -1
- package/dist/ccd-case-ui-toolkit/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.d.ts +2 -0
- package/dist/ccd-case-ui-toolkit/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.d.ts.map +1 -1
- package/dist/ccd-case-ui-toolkit/lib/shared/components/palette/linked-cases/domain/linked-cases-state.model.d.ts +0 -4
- package/dist/ccd-case-ui-toolkit/lib/shared/components/palette/linked-cases/domain/linked-cases-state.model.d.ts.map +1 -1
- package/dist/ccd-case-ui-toolkit/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.d.ts +0 -4
- package/dist/ccd-case-ui-toolkit/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.d.ts.map +1 -1
- package/dist/ccd-case-ui-toolkit/lib/shared/services/fields/fields.utils.d.ts +2 -0
- package/dist/ccd-case-ui-toolkit/lib/shared/services/fields/fields.utils.d.ts.map +1 -1
- package/dist/ccd-case-ui-toolkit/package.json +1 -1
- package/package.json +1 -1
- package/projects/ccd-case-ui-toolkit/package.json +1 -1
- package/projects/ccd-case-ui-toolkit/src/lib/shared/commons/case-edit-data/case-edit-data.service.ts +4 -9
- package/projects/ccd-case-ui-toolkit/src/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.ts +21 -2
- package/projects/ccd-case-ui-toolkit/src/lib/shared/components/palette/linked-cases/domain/linked-cases-state.model.ts +0 -5
- package/projects/ccd-case-ui-toolkit/src/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.html +0 -13
- package/projects/ccd-case-ui-toolkit/src/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.spec.ts +4 -19
- package/projects/ccd-case-ui-toolkit/src/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.ts +8 -31
- package/projects/ccd-case-ui-toolkit/src/lib/shared/services/fields/fields.utils.spec.ts +44 -0
- package/projects/ccd-case-ui-toolkit/src/lib/shared/services/fields/fields.utils.ts +10 -1
package/RELEASE-NOTES.md
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
## RELEASE NOTES
|
|
2
|
+
### Version 6.13.10-linked-cases-continue-button-validation-v3
|
|
3
|
+
**EUI-8025** Linked cases continue button validation
|
|
4
|
+
|
|
2
5
|
### Version 6.13.10-rc1
|
|
3
6
|
**EUI-5298** Release 6.13.10 including 6.13.0, linked cases (EUI-7676) and case file view fix (EUI-7417)
|
|
4
7
|
|
|
@@ -4144,6 +4144,13 @@
|
|
|
4144
4144
|
}
|
|
4145
4145
|
return caseField.field_type.type === 'ComponentLauncher';
|
|
4146
4146
|
};
|
|
4147
|
+
FieldsUtils.isLinkedCasesCaseField = function (caseField) {
|
|
4148
|
+
return FieldsUtils.isComponentLauncherCaseField(caseField) &&
|
|
4149
|
+
caseField.id === 'LinkedCasesComponentLauncher';
|
|
4150
|
+
};
|
|
4151
|
+
FieldsUtils.containsLinkedCasesCaseField = function (caseFields) {
|
|
4152
|
+
return caseFields === null || caseFields === void 0 ? void 0 : caseFields.some(function (caseField) { return FieldsUtils.isLinkedCasesCaseField(caseField); });
|
|
4153
|
+
};
|
|
4147
4154
|
FieldsUtils.isFlagsFieldType = function (fieldType) {
|
|
4148
4155
|
if (!fieldType) {
|
|
4149
4156
|
return false;
|
|
@@ -10033,14 +10040,14 @@
|
|
|
10033
10040
|
this.title$ = new rxjs.BehaviorSubject(null);
|
|
10034
10041
|
this.formValidationErrors$ = new rxjs.BehaviorSubject([]);
|
|
10035
10042
|
this.editForm$ = new rxjs.BehaviorSubject(null);
|
|
10036
|
-
this.
|
|
10043
|
+
this.isLinkedCasesJourneyAtFinalStep$ = new rxjs.BehaviorSubject(null);
|
|
10037
10044
|
this.eventTriggerName$ = new rxjs.BehaviorSubject(null);
|
|
10038
10045
|
this.triggerSubmitEvent$ = new rxjs.BehaviorSubject(null);
|
|
10039
10046
|
this.caseDetails$ = this.details$.asObservable();
|
|
10040
10047
|
this.caseTitle$ = this.title$.asObservable();
|
|
10041
10048
|
this.caseEditForm$ = this.editForm$.asObservable();
|
|
10042
10049
|
this.caseFormValidationErrors$ = this.formValidationErrors$.asObservable();
|
|
10043
|
-
this.
|
|
10050
|
+
this.caseIsLinkedCasesJourneyAtFinalStep$ = this.isLinkedCasesJourneyAtFinalStep$.asObservable();
|
|
10044
10051
|
this.caseEventTriggerName$ = this.eventTriggerName$.asObservable();
|
|
10045
10052
|
this.caseTriggerSubmitEvent$ = this.triggerSubmitEvent$.asObservable();
|
|
10046
10053
|
}
|
|
@@ -10053,9 +10060,6 @@
|
|
|
10053
10060
|
CaseEditDataService.prototype.setCaseEventTriggerName = function (triggerName) {
|
|
10054
10061
|
this.eventTriggerName$.next(triggerName);
|
|
10055
10062
|
};
|
|
10056
|
-
CaseEditDataService.prototype.setCaseLinkError = function (error) {
|
|
10057
|
-
this.linkError$.next(error);
|
|
10058
|
-
};
|
|
10059
10063
|
CaseEditDataService.prototype.setFormValidationErrors = function (validationErrors) {
|
|
10060
10064
|
this.formValidationErrors$.next(validationErrors);
|
|
10061
10065
|
};
|
|
@@ -10065,8 +10069,8 @@
|
|
|
10065
10069
|
CaseEditDataService.prototype.clearFormValidationErrors = function () {
|
|
10066
10070
|
this.formValidationErrors$.next([]);
|
|
10067
10071
|
};
|
|
10068
|
-
CaseEditDataService.prototype.
|
|
10069
|
-
this.
|
|
10072
|
+
CaseEditDataService.prototype.setLinkedCasesJourneyAtFinalStep = function (isAtFinalStep) {
|
|
10073
|
+
this.isLinkedCasesJourneyAtFinalStep$.next(isAtFinalStep);
|
|
10070
10074
|
};
|
|
10071
10075
|
CaseEditDataService.prototype.addFormValidationError = function (validationError) {
|
|
10072
10076
|
this.formValidationErrors$.next(this.formValidationErrors$.getValue().concat([validationError]));
|
|
@@ -10423,6 +10427,11 @@
|
|
|
10423
10427
|
this.caseEditDataService.caseEditForm$.subscribe({
|
|
10424
10428
|
next: function (editForm) { return _this.editForm = editForm; }
|
|
10425
10429
|
});
|
|
10430
|
+
this.caseEditDataService.caseIsLinkedCasesJourneyAtFinalStep$.subscribe({
|
|
10431
|
+
next: function (isLinkedCasesJourneyAtFinalStep) {
|
|
10432
|
+
_this.isLinkedCasesJourneyAtFinalStep = isLinkedCasesJourneyAtFinalStep;
|
|
10433
|
+
}
|
|
10434
|
+
});
|
|
10426
10435
|
this.caseEditDataService.caseTriggerSubmitEvent$.subscribe({
|
|
10427
10436
|
next: function (state) {
|
|
10428
10437
|
if (state) {
|
|
@@ -10442,7 +10451,11 @@
|
|
|
10442
10451
|
return this.caseEdit.first();
|
|
10443
10452
|
};
|
|
10444
10453
|
CaseEditPageComponent.prototype.currentPageIsNotValid = function () {
|
|
10445
|
-
return !this.pageValidationService.isPageValid(this.currentPage, this.editForm)
|
|
10454
|
+
return !this.pageValidationService.isPageValid(this.currentPage, this.editForm) ||
|
|
10455
|
+
(this.isLinkedCasesJourney() && !this.isLinkedCasesJourneyAtFinalStep);
|
|
10456
|
+
};
|
|
10457
|
+
CaseEditPageComponent.prototype.isLinkedCasesJourney = function () {
|
|
10458
|
+
return FieldsUtils.containsLinkedCasesCaseField(this.currentPage.case_fields);
|
|
10446
10459
|
};
|
|
10447
10460
|
/**
|
|
10448
10461
|
* caseEventData.event_data contains all the values from the previous pages so we set caseEventData.data = caseEventData.event_data
|
|
@@ -10542,7 +10555,16 @@
|
|
|
10542
10555
|
var _this = this;
|
|
10543
10556
|
this.caseEditDataService.clearFormValidationErrors();
|
|
10544
10557
|
if (this.currentPageIsNotValid()) {
|
|
10545
|
-
|
|
10558
|
+
// The generateErrorMessage method filters out the hidden fields.
|
|
10559
|
+
// The error message for LinkedCases journey will never get displayed because the
|
|
10560
|
+
// LinkedCases is configured with ComponentLauncher field as visible and caseLinks field as hidden.
|
|
10561
|
+
if (this.isLinkedCasesJourney()) {
|
|
10562
|
+
this.validationErrors.push({ id: 'next-button', message: 'Please select Next to go to the next page' });
|
|
10563
|
+
CaseEditPageComponent.scrollToTop();
|
|
10564
|
+
}
|
|
10565
|
+
else {
|
|
10566
|
+
this.generateErrorMessage(this.currentPage.case_fields);
|
|
10567
|
+
}
|
|
10546
10568
|
}
|
|
10547
10569
|
if (!this.isSubmitting && !this.currentPageIsNotValid()) {
|
|
10548
10570
|
this.isSubmitting = true;
|
|
@@ -17598,87 +17620,52 @@
|
|
|
17598
17620
|
}], function () { return [{ type: i1__namespace$1.ActivatedRoute }, { type: i1__namespace$1.Router }, { type: LinkedCasesService }, { type: AbstractAppConfig }, { type: CommonDataService }]; }, null);
|
|
17599
17621
|
})();
|
|
17600
17622
|
|
|
17601
|
-
function
|
|
17623
|
+
function WriteLinkedCasesFieldComponent_ng_container_2_Template(rf, ctx) {
|
|
17602
17624
|
if (rf & 1) {
|
|
17603
|
-
var
|
|
17604
|
-
i0__namespace.ɵɵ
|
|
17605
|
-
i0__namespace.ɵɵelementStart(1, "
|
|
17606
|
-
i0__namespace.ɵɵ
|
|
17607
|
-
i0__namespace.ɵɵelementStart(3, "a", 9);
|
|
17608
|
-
i0__namespace.ɵɵlistener("click", function WriteLinkedCasesFieldComponent_div_0_div_3_Template_a_click_3_listener() { i0__namespace.ɵɵrestoreView(_r9_1); var errorMessage_r7 = ctx.$implicit; var ctx_r8 = i0__namespace.ɵɵnextContext(2); return ctx_r8.navigateToErrorElement(errorMessage_r7.fieldId); });
|
|
17609
|
-
i0__namespace.ɵɵtext(4);
|
|
17610
|
-
i0__namespace.ɵɵelementEnd();
|
|
17611
|
-
i0__namespace.ɵɵelementEnd();
|
|
17612
|
-
i0__namespace.ɵɵelementEnd();
|
|
17613
|
-
i0__namespace.ɵɵelementEnd();
|
|
17614
|
-
}
|
|
17615
|
-
if (rf & 2) {
|
|
17616
|
-
var errorMessage_r7 = ctx.$implicit;
|
|
17617
|
-
i0__namespace.ɵɵadvance(4);
|
|
17618
|
-
i0__namespace.ɵɵtextInterpolate(errorMessage_r7.description);
|
|
17619
|
-
}
|
|
17620
|
-
}
|
|
17621
|
-
function WriteLinkedCasesFieldComponent_div_0_Template(rf, ctx) {
|
|
17622
|
-
if (rf & 1) {
|
|
17623
|
-
i0__namespace.ɵɵelementStart(0, "div", 4);
|
|
17624
|
-
i0__namespace.ɵɵelementStart(1, "h2", 5);
|
|
17625
|
-
i0__namespace.ɵɵtext(2, " There is a problem ");
|
|
17626
|
-
i0__namespace.ɵɵelementEnd();
|
|
17627
|
-
i0__namespace.ɵɵtemplate(3, WriteLinkedCasesFieldComponent_div_0_div_3_Template, 5, 1, "div", 6);
|
|
17625
|
+
var _r6_1 = i0__namespace.ɵɵgetCurrentView();
|
|
17626
|
+
i0__namespace.ɵɵelementContainerStart(0);
|
|
17627
|
+
i0__namespace.ɵɵelementStart(1, "ccd-linked-cases-before-you-start", 3);
|
|
17628
|
+
i0__namespace.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_2_Template_ccd_linked_cases_before_you_start_linkedCasesStateEmitter_1_listener($event) { i0__namespace.ɵɵrestoreView(_r6_1); var ctx_r5 = i0__namespace.ɵɵnextContext(); return ctx_r5.onLinkedCasesStateEmitted($event); });
|
|
17628
17629
|
i0__namespace.ɵɵelementEnd();
|
|
17629
|
-
|
|
17630
|
-
if (rf & 2) {
|
|
17631
|
-
var ctx_r0 = i0__namespace.ɵɵnextContext();
|
|
17632
|
-
i0__namespace.ɵɵadvance(3);
|
|
17633
|
-
i0__namespace.ɵɵproperty("ngForOf", ctx_r0.errorMessages);
|
|
17630
|
+
i0__namespace.ɵɵelementContainerEnd();
|
|
17634
17631
|
}
|
|
17635
17632
|
}
|
|
17636
17633
|
function WriteLinkedCasesFieldComponent_ng_container_3_Template(rf, ctx) {
|
|
17637
17634
|
if (rf & 1) {
|
|
17638
|
-
var
|
|
17635
|
+
var _r8_1 = i0__namespace.ɵɵgetCurrentView();
|
|
17639
17636
|
i0__namespace.ɵɵelementContainerStart(0);
|
|
17640
|
-
i0__namespace.ɵɵelementStart(1, "ccd-linked-cases
|
|
17641
|
-
i0__namespace.ɵɵlistener("linkedCasesStateEmitter", function
|
|
17637
|
+
i0__namespace.ɵɵelementStart(1, "ccd-no-linked-cases", 3);
|
|
17638
|
+
i0__namespace.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_3_Template_ccd_no_linked_cases_linkedCasesStateEmitter_1_listener($event) { i0__namespace.ɵɵrestoreView(_r8_1); var ctx_r7 = i0__namespace.ɵɵnextContext(); return ctx_r7.onLinkedCasesStateEmitted($event); });
|
|
17642
17639
|
i0__namespace.ɵɵelementEnd();
|
|
17643
17640
|
i0__namespace.ɵɵelementContainerEnd();
|
|
17644
17641
|
}
|
|
17645
17642
|
}
|
|
17646
17643
|
function WriteLinkedCasesFieldComponent_ng_container_4_Template(rf, ctx) {
|
|
17647
17644
|
if (rf & 1) {
|
|
17648
|
-
var
|
|
17645
|
+
var _r10_1 = i0__namespace.ɵɵgetCurrentView();
|
|
17649
17646
|
i0__namespace.ɵɵelementContainerStart(0);
|
|
17650
|
-
i0__namespace.ɵɵelementStart(1, "ccd-
|
|
17651
|
-
i0__namespace.ɵɵlistener("linkedCasesStateEmitter", function
|
|
17647
|
+
i0__namespace.ɵɵelementStart(1, "ccd-link-cases", 3);
|
|
17648
|
+
i0__namespace.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_4_Template_ccd_link_cases_linkedCasesStateEmitter_1_listener($event) { i0__namespace.ɵɵrestoreView(_r10_1); var ctx_r9 = i0__namespace.ɵɵnextContext(); return ctx_r9.onLinkedCasesStateEmitted($event); });
|
|
17652
17649
|
i0__namespace.ɵɵelementEnd();
|
|
17653
17650
|
i0__namespace.ɵɵelementContainerEnd();
|
|
17654
17651
|
}
|
|
17655
17652
|
}
|
|
17656
17653
|
function WriteLinkedCasesFieldComponent_ng_container_5_Template(rf, ctx) {
|
|
17657
17654
|
if (rf & 1) {
|
|
17658
|
-
var
|
|
17655
|
+
var _r12_1 = i0__namespace.ɵɵgetCurrentView();
|
|
17659
17656
|
i0__namespace.ɵɵelementContainerStart(0);
|
|
17660
|
-
i0__namespace.ɵɵelementStart(1, "ccd-
|
|
17661
|
-
i0__namespace.ɵɵlistener("linkedCasesStateEmitter", function
|
|
17657
|
+
i0__namespace.ɵɵelementStart(1, "ccd-unlink-cases", 3);
|
|
17658
|
+
i0__namespace.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_5_Template_ccd_unlink_cases_linkedCasesStateEmitter_1_listener($event) { i0__namespace.ɵɵrestoreView(_r12_1); var ctx_r11 = i0__namespace.ɵɵnextContext(); return ctx_r11.onLinkedCasesStateEmitted($event); });
|
|
17662
17659
|
i0__namespace.ɵɵelementEnd();
|
|
17663
17660
|
i0__namespace.ɵɵelementContainerEnd();
|
|
17664
17661
|
}
|
|
17665
17662
|
}
|
|
17666
17663
|
function WriteLinkedCasesFieldComponent_ng_container_6_Template(rf, ctx) {
|
|
17667
17664
|
if (rf & 1) {
|
|
17668
|
-
var
|
|
17669
|
-
i0__namespace.ɵɵelementContainerStart(0);
|
|
17670
|
-
i0__namespace.ɵɵelementStart(1, "ccd-unlink-cases", 10);
|
|
17671
|
-
i0__namespace.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_6_Template_ccd_unlink_cases_linkedCasesStateEmitter_1_listener($event) { i0__namespace.ɵɵrestoreView(_r17_1); var ctx_r16 = i0__namespace.ɵɵnextContext(); return ctx_r16.onLinkedCasesStateEmitted($event); });
|
|
17672
|
-
i0__namespace.ɵɵelementEnd();
|
|
17673
|
-
i0__namespace.ɵɵelementContainerEnd();
|
|
17674
|
-
}
|
|
17675
|
-
}
|
|
17676
|
-
function WriteLinkedCasesFieldComponent_ng_container_7_Template(rf, ctx) {
|
|
17677
|
-
if (rf & 1) {
|
|
17678
|
-
var _r19_1 = i0__namespace.ɵɵgetCurrentView();
|
|
17665
|
+
var _r14_1 = i0__namespace.ɵɵgetCurrentView();
|
|
17679
17666
|
i0__namespace.ɵɵelementContainerStart(0);
|
|
17680
|
-
i0__namespace.ɵɵelementStart(1, "ccd-linked-cases-check-your-answers",
|
|
17681
|
-
i0__namespace.ɵɵlistener("linkedCasesStateEmitter", function
|
|
17667
|
+
i0__namespace.ɵɵelementStart(1, "ccd-linked-cases-check-your-answers", 3);
|
|
17668
|
+
i0__namespace.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_6_Template_ccd_linked_cases_check_your_answers_linkedCasesStateEmitter_1_listener($event) { i0__namespace.ɵɵrestoreView(_r14_1); var ctx_r13 = i0__namespace.ɵɵnextContext(); return ctx_r13.onLinkedCasesStateEmitted($event); });
|
|
17682
17669
|
i0__namespace.ɵɵelementEnd();
|
|
17683
17670
|
i0__namespace.ɵɵelementContainerEnd();
|
|
17684
17671
|
}
|
|
@@ -17695,11 +17682,13 @@
|
|
|
17695
17682
|
_this.linkedCasesPages = exports.LinkedCasesPages;
|
|
17696
17683
|
_this.linkedCasesEventTriggers = exports.LinkedCasesEventTriggers;
|
|
17697
17684
|
_this.linkedCases = [];
|
|
17698
|
-
_this.errorMessages = [];
|
|
17699
17685
|
return _this;
|
|
17700
17686
|
}
|
|
17701
17687
|
WriteLinkedCasesFieldComponent.prototype.ngOnInit = function () {
|
|
17702
17688
|
var _this = this;
|
|
17689
|
+
// This is required to enable Continue button validation
|
|
17690
|
+
// Continue button should be enabled only at check your answers page
|
|
17691
|
+
this.caseEditDataService.setLinkedCasesJourneyAtFinalStep(false);
|
|
17703
17692
|
// Clear validation errors
|
|
17704
17693
|
this.caseEditDataService.clearFormValidationErrors();
|
|
17705
17694
|
// Get linked case reasons from ref data
|
|
@@ -17736,11 +17725,10 @@
|
|
|
17736
17725
|
};
|
|
17737
17726
|
WriteLinkedCasesFieldComponent.prototype.onLinkedCasesStateEmitted = function (linkedCasesState) {
|
|
17738
17727
|
var _this = this;
|
|
17739
|
-
|
|
17728
|
+
// Clear validation errors
|
|
17740
17729
|
this.caseEditDataService.clearFormValidationErrors();
|
|
17741
17730
|
if (linkedCasesState.navigateToNextPage) {
|
|
17742
17731
|
this.linkedCasesPage = this.getNextPage(linkedCasesState);
|
|
17743
|
-
this.setContinueButtonValidationErrorMessage();
|
|
17744
17732
|
this.proceedToNextPage();
|
|
17745
17733
|
}
|
|
17746
17734
|
else {
|
|
@@ -17764,27 +17752,19 @@
|
|
|
17764
17752
|
}
|
|
17765
17753
|
});
|
|
17766
17754
|
};
|
|
17767
|
-
WriteLinkedCasesFieldComponent.prototype.setContinueButtonValidationErrorMessage = function () {
|
|
17768
|
-
var errorMessage = this.linkedCasesService.isLinkedCasesEventTrigger
|
|
17769
|
-
? exports.LinkedCasesErrorMessages.LinkCasesNavigationError
|
|
17770
|
-
: exports.LinkedCasesErrorMessages.UnlinkCasesNavigationError;
|
|
17771
|
-
var buttonId = this.linkedCasesService.linkedCases.length === 0
|
|
17772
|
-
? 'back-button'
|
|
17773
|
-
: 'next-button';
|
|
17774
|
-
this.caseEditDataService.setCaseLinkError({
|
|
17775
|
-
componentId: buttonId,
|
|
17776
|
-
errorMessage: errorMessage
|
|
17777
|
-
});
|
|
17778
|
-
};
|
|
17779
17755
|
WriteLinkedCasesFieldComponent.prototype.proceedToNextPage = function () {
|
|
17780
17756
|
if (this.isAtFinalPage()) {
|
|
17781
17757
|
// Continue button event must be allowed in final page
|
|
17782
|
-
this.caseEditDataService.
|
|
17758
|
+
this.caseEditDataService.setLinkedCasesJourneyAtFinalStep(true);
|
|
17783
17759
|
// Trigger validation to clear the "notAtFinalPage" error if now at the final state
|
|
17784
17760
|
this.formGroup.updateValueAndValidity();
|
|
17785
17761
|
// update form value
|
|
17786
17762
|
this.submitLinkedCases();
|
|
17787
17763
|
}
|
|
17764
|
+
else {
|
|
17765
|
+
// Continue button event must not be allowed if not in final page
|
|
17766
|
+
this.caseEditDataService.setLinkedCasesJourneyAtFinalStep(false);
|
|
17767
|
+
}
|
|
17788
17768
|
};
|
|
17789
17769
|
WriteLinkedCasesFieldComponent.prototype.submitLinkedCases = function () {
|
|
17790
17770
|
if (!this.linkedCasesService.isLinkedCasesEventTrigger) {
|
|
@@ -17829,38 +17809,24 @@
|
|
|
17829
17809
|
&& !_this.linkedCasesService.serverLinkedApiError)
|
|
17830
17810
|
? exports.LinkedCasesPages.BEFORE_YOU_START
|
|
17831
17811
|
: exports.LinkedCasesPages.NO_LINKED_CASES;
|
|
17832
|
-
// Initialise the error to be displayed when clicked on Continue button
|
|
17833
|
-
_this.setContinueButtonValidationErrorMessage();
|
|
17834
17812
|
});
|
|
17835
17813
|
};
|
|
17836
|
-
WriteLinkedCasesFieldComponent.prototype.navigateToErrorElement = function (elementId) {
|
|
17837
|
-
if (elementId) {
|
|
17838
|
-
var htmlElement = document.getElementById(elementId);
|
|
17839
|
-
if (htmlElement) {
|
|
17840
|
-
htmlElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
|
17841
|
-
htmlElement.focus();
|
|
17842
|
-
}
|
|
17843
|
-
}
|
|
17844
|
-
};
|
|
17845
17814
|
return WriteLinkedCasesFieldComponent;
|
|
17846
17815
|
}(AbstractFieldWriteComponent));
|
|
17847
17816
|
WriteLinkedCasesFieldComponent.ɵfac = function WriteLinkedCasesFieldComponent_Factory(t) { return new (t || WriteLinkedCasesFieldComponent)(i0__namespace.ɵɵdirectiveInject(AbstractAppConfig), i0__namespace.ɵɵdirectiveInject(CommonDataService), i0__namespace.ɵɵdirectiveInject(CasesService), i0__namespace.ɵɵdirectiveInject(LinkedCasesService), i0__namespace.ɵɵdirectiveInject(CaseEditDataService)); };
|
|
17848
|
-
WriteLinkedCasesFieldComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: WriteLinkedCasesFieldComponent, selectors: [["ccd-write-linked-cases-field"]], features: [i0__namespace.ɵɵInheritDefinitionFeature], decls:
|
|
17817
|
+
WriteLinkedCasesFieldComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: WriteLinkedCasesFieldComponent, selectors: [["ccd-write-linked-cases-field"]], features: [i0__namespace.ɵɵInheritDefinitionFeature], decls: 7, vars: 7, consts: [[1, "form-group", "govuk-!-margin-bottom-2", 3, "formGroup"], [1, "govuk-form-group", 3, "ngSwitch"], [4, "ngSwitchCase"], [3, "linkedCasesStateEmitter"]], template: function WriteLinkedCasesFieldComponent_Template(rf, ctx) {
|
|
17849
17818
|
if (rf & 1) {
|
|
17850
|
-
i0__namespace.ɵɵ
|
|
17819
|
+
i0__namespace.ɵɵelementStart(0, "div", 0);
|
|
17851
17820
|
i0__namespace.ɵɵelementStart(1, "div", 1);
|
|
17852
|
-
i0__namespace.ɵɵ
|
|
17853
|
-
i0__namespace.ɵɵtemplate(3, WriteLinkedCasesFieldComponent_ng_container_3_Template, 2, 0, "ng-container",
|
|
17854
|
-
i0__namespace.ɵɵtemplate(4, WriteLinkedCasesFieldComponent_ng_container_4_Template, 2, 0, "ng-container",
|
|
17855
|
-
i0__namespace.ɵɵtemplate(5, WriteLinkedCasesFieldComponent_ng_container_5_Template, 2, 0, "ng-container",
|
|
17856
|
-
i0__namespace.ɵɵtemplate(6, WriteLinkedCasesFieldComponent_ng_container_6_Template, 2, 0, "ng-container",
|
|
17857
|
-
i0__namespace.ɵɵtemplate(7, WriteLinkedCasesFieldComponent_ng_container_7_Template, 2, 0, "ng-container", 3);
|
|
17821
|
+
i0__namespace.ɵɵtemplate(2, WriteLinkedCasesFieldComponent_ng_container_2_Template, 2, 0, "ng-container", 2);
|
|
17822
|
+
i0__namespace.ɵɵtemplate(3, WriteLinkedCasesFieldComponent_ng_container_3_Template, 2, 0, "ng-container", 2);
|
|
17823
|
+
i0__namespace.ɵɵtemplate(4, WriteLinkedCasesFieldComponent_ng_container_4_Template, 2, 0, "ng-container", 2);
|
|
17824
|
+
i0__namespace.ɵɵtemplate(5, WriteLinkedCasesFieldComponent_ng_container_5_Template, 2, 0, "ng-container", 2);
|
|
17825
|
+
i0__namespace.ɵɵtemplate(6, WriteLinkedCasesFieldComponent_ng_container_6_Template, 2, 0, "ng-container", 2);
|
|
17858
17826
|
i0__namespace.ɵɵelementEnd();
|
|
17859
17827
|
i0__namespace.ɵɵelementEnd();
|
|
17860
17828
|
}
|
|
17861
17829
|
if (rf & 2) {
|
|
17862
|
-
i0__namespace.ɵɵproperty("ngIf", ctx.errorMessages.length > 0);
|
|
17863
|
-
i0__namespace.ɵɵadvance(1);
|
|
17864
17830
|
i0__namespace.ɵɵproperty("formGroup", ctx.formGroup);
|
|
17865
17831
|
i0__namespace.ɵɵadvance(1);
|
|
17866
17832
|
i0__namespace.ɵɵproperty("ngSwitch", ctx.linkedCasesPage);
|
|
@@ -26057,7 +26023,7 @@
|
|
|
26057
26023
|
AddCommentsComponent,
|
|
26058
26024
|
ManageCaseFlagsComponent,
|
|
26059
26025
|
UpdateFlagComponent], []);
|
|
26060
|
-
i0__namespace.ɵɵsetComponentScope(WriteLinkedCasesFieldComponent, [
|
|
26026
|
+
i0__namespace.ɵɵsetComponentScope(WriteLinkedCasesFieldComponent, [i2__namespace.NgControlStatusGroup, i2__namespace.FormGroupDirective, i1__namespace.NgSwitch, i1__namespace.NgSwitchCase, BeforeYouStartComponent,
|
|
26061
26027
|
NoLinkedCasesComponent,
|
|
26062
26028
|
LinkCasesComponent,
|
|
26063
26029
|
UnLinkCasesComponent,
|