@hmcts/ccd-case-ui-toolkit 7.0.60 → 7.0.61-ungrey-back-button

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.
Files changed (104) hide show
  1. package/esm2022/lib/app.config.mjs +1 -1
  2. package/esm2022/lib/shared/components/case-editor/case-edit/case-edit.component.mjs +12 -5
  3. package/esm2022/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.mjs +70 -33
  4. package/esm2022/lib/shared/components/case-editor/case-edit-submit/case-edit-submit.component.mjs +50 -37
  5. package/esm2022/lib/shared/components/case-editor/case-editor.module.mjs +7 -4
  6. package/esm2022/lib/shared/components/case-editor/services/case-flag-state.service.mjs +3 -1
  7. package/esm2022/lib/shared/components/case-editor/services/work-allocation.service.mjs +8 -5
  8. package/esm2022/lib/shared/components/case-viewer/case-event-trigger/case-event-trigger.component.mjs +14 -4
  9. package/esm2022/lib/shared/components/palette/base-field/abstract-field-write-journey.component.mjs +92 -0
  10. package/esm2022/lib/shared/components/palette/base-field/abstract-journey.component.mjs +82 -0
  11. package/esm2022/lib/shared/components/palette/base-field/index.mjs +3 -1
  12. package/esm2022/lib/shared/components/palette/case-flag/components/add-comments/add-comments.component.mjs +21 -21
  13. package/esm2022/lib/shared/components/palette/case-flag/components/confirm-flag-status/confirm-flag-status.component.mjs +22 -22
  14. package/esm2022/lib/shared/components/palette/case-flag/components/manage-case-flags/manage-case-flags.component.mjs +28 -28
  15. package/esm2022/lib/shared/components/palette/case-flag/components/search-language-interpreter/search-language-interpreter.component.mjs +32 -29
  16. package/esm2022/lib/shared/components/palette/case-flag/components/select-flag-location/select-flag-location.component.mjs +21 -28
  17. package/esm2022/lib/shared/components/palette/case-flag/components/select-flag-type/select-flag-type.component.mjs +128 -63
  18. package/esm2022/lib/shared/components/palette/case-flag/components/update-flag/update-flag-add-translation-form/update-flag-add-translation-form.component.mjs +28 -28
  19. package/esm2022/lib/shared/components/palette/case-flag/components/update-flag/update-flag.component.mjs +107 -105
  20. package/esm2022/lib/shared/components/palette/case-flag/write-case-flag-field.component.mjs +106 -31
  21. package/esm2022/lib/shared/components/palette/linked-cases/components/before-you-start/before-you-start.component.mjs +27 -18
  22. package/esm2022/lib/shared/components/palette/linked-cases/components/check-your-answers/check-your-answers.component.mjs +19 -7
  23. package/esm2022/lib/shared/components/palette/linked-cases/components/link-cases/link-cases.component.mjs +57 -45
  24. package/esm2022/lib/shared/components/palette/linked-cases/components/no-linked-cases/no-linked-cases.component.mjs +13 -9
  25. package/esm2022/lib/shared/components/palette/linked-cases/components/unlink-cases/unlink-cases.component.mjs +45 -39
  26. package/esm2022/lib/shared/components/palette/linked-cases/services/linked-cases.service.mjs +11 -1
  27. package/esm2022/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.mjs +69 -23
  28. package/esm2022/lib/shared/domain/index.mjs +2 -1
  29. package/esm2022/lib/shared/domain/journey/index.mjs +3 -0
  30. package/esm2022/lib/shared/domain/journey/journey-instigator.model.mjs +2 -0
  31. package/esm2022/lib/shared/domain/journey/journey.model.mjs +2 -0
  32. package/esm2022/lib/shared/pipes/complex/ccd-page-fields.pipe.mjs +2 -2
  33. package/esm2022/lib/shared/services/index.mjs +2 -1
  34. package/esm2022/lib/shared/services/journey/index.mjs +2 -0
  35. package/esm2022/lib/shared/services/journey/multipage-component-state.service.mjs +114 -0
  36. package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs +1264 -715
  37. package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
  38. package/lib/app.config.d.ts +1 -0
  39. package/lib/app.config.d.ts.map +1 -1
  40. package/lib/shared/components/case-editor/case-edit/case-edit.component.d.ts +3 -1
  41. package/lib/shared/components/case-editor/case-edit/case-edit.component.d.ts.map +1 -1
  42. package/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.d.ts +12 -3
  43. package/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.d.ts.map +1 -1
  44. package/lib/shared/components/case-editor/case-edit-submit/case-edit-submit.component.d.ts +7 -2
  45. package/lib/shared/components/case-editor/case-edit-submit/case-edit-submit.component.d.ts.map +1 -1
  46. package/lib/shared/components/case-editor/case-editor.module.d.ts.map +1 -1
  47. package/lib/shared/components/case-editor/services/case-flag-state.service.d.ts +1 -0
  48. package/lib/shared/components/case-editor/services/case-flag-state.service.d.ts.map +1 -1
  49. package/lib/shared/components/case-editor/services/work-allocation.service.d.ts.map +1 -1
  50. package/lib/shared/components/case-viewer/case-event-trigger/case-event-trigger.component.d.ts +2 -1
  51. package/lib/shared/components/case-viewer/case-event-trigger/case-event-trigger.component.d.ts.map +1 -1
  52. package/lib/shared/components/palette/base-field/abstract-field-write-journey.component.d.ts +30 -0
  53. package/lib/shared/components/palette/base-field/abstract-field-write-journey.component.d.ts.map +1 -0
  54. package/lib/shared/components/palette/base-field/abstract-journey.component.d.ts +27 -0
  55. package/lib/shared/components/palette/base-field/abstract-journey.component.d.ts.map +1 -0
  56. package/lib/shared/components/palette/base-field/index.d.ts +2 -0
  57. package/lib/shared/components/palette/base-field/index.d.ts.map +1 -1
  58. package/lib/shared/components/palette/case-flag/components/add-comments/add-comments.component.d.ts +4 -2
  59. package/lib/shared/components/palette/case-flag/components/add-comments/add-comments.component.d.ts.map +1 -1
  60. package/lib/shared/components/palette/case-flag/components/confirm-flag-status/confirm-flag-status.component.d.ts +4 -2
  61. package/lib/shared/components/palette/case-flag/components/confirm-flag-status/confirm-flag-status.component.d.ts.map +1 -1
  62. package/lib/shared/components/palette/case-flag/components/manage-case-flags/manage-case-flags.component.d.ts +5 -3
  63. package/lib/shared/components/palette/case-flag/components/manage-case-flags/manage-case-flags.component.d.ts.map +1 -1
  64. package/lib/shared/components/palette/case-flag/components/search-language-interpreter/search-language-interpreter.component.d.ts +6 -3
  65. package/lib/shared/components/palette/case-flag/components/search-language-interpreter/search-language-interpreter.component.d.ts.map +1 -1
  66. package/lib/shared/components/palette/case-flag/components/select-flag-location/select-flag-location.component.d.ts +4 -2
  67. package/lib/shared/components/palette/case-flag/components/select-flag-location/select-flag-location.component.d.ts.map +1 -1
  68. package/lib/shared/components/palette/case-flag/components/select-flag-type/select-flag-type.component.d.ts +12 -5
  69. package/lib/shared/components/palette/case-flag/components/select-flag-type/select-flag-type.component.d.ts.map +1 -1
  70. package/lib/shared/components/palette/case-flag/components/update-flag/update-flag-add-translation-form/update-flag-add-translation-form.component.d.ts +4 -2
  71. package/lib/shared/components/palette/case-flag/components/update-flag/update-flag-add-translation-form/update-flag-add-translation-form.component.d.ts.map +1 -1
  72. package/lib/shared/components/palette/case-flag/components/update-flag/update-flag.component.d.ts +6 -3
  73. package/lib/shared/components/palette/case-flag/components/update-flag/update-flag.component.d.ts.map +1 -1
  74. package/lib/shared/components/palette/case-flag/write-case-flag-field.component.d.ts +10 -5
  75. package/lib/shared/components/palette/case-flag/write-case-flag-field.component.d.ts.map +1 -1
  76. package/lib/shared/components/palette/linked-cases/components/before-you-start/before-you-start.component.d.ts +6 -3
  77. package/lib/shared/components/palette/linked-cases/components/before-you-start/before-you-start.component.d.ts.map +1 -1
  78. package/lib/shared/components/palette/linked-cases/components/check-your-answers/check-your-answers.component.d.ts +6 -2
  79. package/lib/shared/components/palette/linked-cases/components/check-your-answers/check-your-answers.component.d.ts.map +1 -1
  80. package/lib/shared/components/palette/linked-cases/components/link-cases/link-cases.component.d.ts +6 -3
  81. package/lib/shared/components/palette/linked-cases/components/link-cases/link-cases.component.d.ts.map +1 -1
  82. package/lib/shared/components/palette/linked-cases/components/no-linked-cases/no-linked-cases.component.d.ts +5 -2
  83. package/lib/shared/components/palette/linked-cases/components/no-linked-cases/no-linked-cases.component.d.ts.map +1 -1
  84. package/lib/shared/components/palette/linked-cases/components/unlink-cases/unlink-cases.component.d.ts +6 -3
  85. package/lib/shared/components/palette/linked-cases/components/unlink-cases/unlink-cases.component.d.ts.map +1 -1
  86. package/lib/shared/components/palette/linked-cases/services/linked-cases.service.d.ts +4 -0
  87. package/lib/shared/components/palette/linked-cases/services/linked-cases.service.d.ts.map +1 -1
  88. package/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.d.ts +6 -3
  89. package/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.d.ts.map +1 -1
  90. package/lib/shared/domain/index.d.ts +1 -0
  91. package/lib/shared/domain/index.d.ts.map +1 -1
  92. package/lib/shared/domain/journey/index.d.ts +3 -0
  93. package/lib/shared/domain/journey/index.d.ts.map +1 -0
  94. package/lib/shared/domain/journey/journey-instigator.model.d.ts +5 -0
  95. package/lib/shared/domain/journey/journey-instigator.model.d.ts.map +1 -0
  96. package/lib/shared/domain/journey/journey.model.d.ts +16 -0
  97. package/lib/shared/domain/journey/journey.model.d.ts.map +1 -0
  98. package/lib/shared/services/index.d.ts +1 -0
  99. package/lib/shared/services/index.d.ts.map +1 -1
  100. package/lib/shared/services/journey/index.d.ts +2 -0
  101. package/lib/shared/services/journey/index.d.ts.map +1 -0
  102. package/lib/shared/services/journey/multipage-component-state.service.d.ts +25 -0
  103. package/lib/shared/services/journey/multipage-component-state.service.d.ts.map +1 -0
  104. package/package.json +1 -1
@@ -8,7 +8,7 @@ import * as i1$1 from '@angular/router';
8
8
  import { RouterModule, NavigationStart, NavigationEnd } from '@angular/router';
9
9
  import * as i4 from '@angular/forms';
10
10
  import { NG_VALUE_ACCESSOR, NG_VALIDATORS, FormArray, FormGroup, FormControl, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms';
11
- import { throwError, Subject, EMPTY, Observable, BehaviorSubject, of, timer, fromEvent, forkJoin, Subscription, combineLatest } from 'rxjs';
11
+ import { throwError, Subject, EMPTY, Observable, BehaviorSubject, of, timer, forkJoin, fromEvent, Subscription, combineLatest } from 'rxjs';
12
12
  import * as i1$2 from '@angular/common/http';
13
13
  import { HttpErrorResponse, HttpHeaders, HttpParams } from '@angular/common/http';
14
14
  import { catchError, map, publish, refCount, switchMap, debounceTime, delay, distinctUntilChanged, finalize, timeout, mergeMap, retryWhen, tap, delayWhen, publishReplay, take, first, takeUntil, filter } from 'rxjs/operators';
@@ -58,7 +58,7 @@ import * as i10 from '@angular/material/legacy-tabs';
58
58
  import { MatLegacyTabsModule } from '@angular/material/legacy-tabs';
59
59
  import { decompressFromUTF16, compressToUTF16 } from 'lz-string';
60
60
 
61
- const _c0$14 = [[["", "footerSolsNavLinks", ""]], [["", "footerCaseWorkerNavLinks", ""]]];
61
+ const _c0$16 = [[["", "footerSolsNavLinks", ""]], [["", "footerCaseWorkerNavLinks", ""]]];
62
62
  const _c1$u = ["[footerSolsNavLinks]", "[footerCaseWorkerNavLinks]"];
63
63
  function FooterComponent_div_2_Template(rf, ctx) { if (rf & 1) {
64
64
  i0.ɵɵelementStart(0, "div", 3)(1, "div", 4);
@@ -136,7 +136,7 @@ class FooterComponent {
136
136
  workhours;
137
137
  static ɵfac = function FooterComponent_Factory(t) { return new (t || FooterComponent)(); };
138
138
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: FooterComponent, selectors: [["cut-footer-bar"]], inputs: { email: "email", isSolicitor: "isSolicitor", phone: "phone", workhours: "workhours" }, ngContentSelectors: _c1$u, decls: 4, vars: 4, consts: [["id", "footer", "role", "footer", 1, "group", "js-footer"], [1, "footer-wrapper"], ["class", "footer-meta", 4, "ngIf"], [1, "footer-meta"], [1, "footer-meta-inner"], [1, "open-government-licence"], [1, "logo"], ["href", "https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/", "rel", "license"], [1, "copyright"], ["href", "https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/copyright-and-re-use/crown-copyright/"], [1, "title"], [1, "footer-text"], [1, "email"], [3, "href"], [1, "phone"], [1, "work-hours"]], template: function FooterComponent_Template(rf, ctx) { if (rf & 1) {
139
- i0.ɵɵprojectionDef(_c0$14);
139
+ i0.ɵɵprojectionDef(_c0$16);
140
140
  i0.ɵɵelementStart(0, "footer", 0)(1, "div", 1);
141
141
  i0.ɵɵtemplate(2, FooterComponent_div_2_Template, 20, 15, "div", 2)(3, FooterComponent_div_3_Template, 20, 16, "div", 2);
142
142
  i0.ɵɵelementEnd()();
@@ -163,7 +163,7 @@ class FooterComponent {
163
163
  }] }); })();
164
164
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(FooterComponent, { className: "FooterComponent", filePath: "lib/components/footer/footer.component.ts", lineNumber: 8 }); })();
165
165
 
166
- const _c0$13 = [[["", "headerNavigation", ""]]];
166
+ const _c0$15 = [[["", "headerNavigation", ""]]];
167
167
  const _c1$t = ["[headerNavigation]"];
168
168
  function HeaderBarComponent_div_3_Template(rf, ctx) { if (rf & 1) {
169
169
  i0.ɵɵelementStart(0, "div")(1, "a", 12);
@@ -207,7 +207,7 @@ class HeaderBarComponent {
207
207
  }
208
208
  static ɵfac = function HeaderBarComponent_Factory(t) { return new (t || HeaderBarComponent)(); };
209
209
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HeaderBarComponent, selectors: [["cut-header-bar"]], inputs: { title: "title", isSolicitor: "isSolicitor", username: "username" }, outputs: { signOutRequest: "signOutRequest" }, ngContentSelectors: _c1$t, decls: 17, vars: 14, consts: [["role", "banner", "id", "global-header", 1, "with-proposition"], [1, "header-wrapper"], [1, "header-global"], [4, "ngIf"], ["class", "global-header", 4, "ngIf"], [1, "header-proposition"], [1, "content"], ["href", "#proposition-links", 1, "js-header-toggle", "menu"], ["id", "proposition-menu", 4, "ngIf"], [1, "proposition-right"], ["id", "user-name"], ["id", "sign-out", "href", "javascript:void(0)", 3, "click"], ["href", "https://www.gov.uk", "title", "Go to the GOV.UK homepage", "id", "logo", 1, "content", 2, "margin-left", "0px"], ["src", "/img/gov.uk_logotype_crown_invert_trans.png?0.23.0", "width", "36", "height", "32", "alt", ""], [1, "global-header"], [1, "title"], ["id", "proposition-menu"], [1, "title-solicitor"], ["id", "proposition-name"]], template: function HeaderBarComponent_Template(rf, ctx) { if (rf & 1) {
210
- i0.ɵɵprojectionDef(_c0$13);
210
+ i0.ɵɵprojectionDef(_c0$15);
211
211
  i0.ɵɵelementStart(0, "header", 0)(1, "div", 1)(2, "div", 2);
212
212
  i0.ɵɵtemplate(3, HeaderBarComponent_div_3_Template, 5, 3, "div", 3)(4, HeaderBarComponent_div_4_Template, 5, 3, "div", 4);
213
213
  i0.ɵɵelementEnd();
@@ -257,13 +257,13 @@ class HeaderBarComponent {
257
257
  }] }); })();
258
258
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HeaderBarComponent, { className: "HeaderBarComponent", filePath: "lib/components/header/header-bar/header-bar.component.ts", lineNumber: 8 }); })();
259
259
 
260
- const _c0$12 = [[["", "leftNavLinks", ""]], [["", "rightNavLinks", ""]]];
260
+ const _c0$14 = [[["", "leftNavLinks", ""]], [["", "rightNavLinks", ""]]];
261
261
  const _c1$s = ["[leftNavLinks]", "[rightNavLinks]"];
262
262
  class NavigationComponent {
263
263
  isSolicitor;
264
264
  static ɵfac = function NavigationComponent_Factory(t) { return new (t || NavigationComponent)(); };
265
265
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: NavigationComponent, selectors: [["cut-nav-bar"]], inputs: { isSolicitor: "isSolicitor" }, ngContentSelectors: _c1$s, decls: 4, vars: 2, consts: [[1, "cut-nav-bar"]], template: function NavigationComponent_Template(rf, ctx) { if (rf & 1) {
266
- i0.ɵɵprojectionDef(_c0$12);
266
+ i0.ɵɵprojectionDef(_c0$14);
267
267
  i0.ɵɵelementStart(0, "div")(1, "nav", 0);
268
268
  i0.ɵɵprojection(2);
269
269
  i0.ɵɵprojection(3, 1);
@@ -382,12 +382,12 @@ class HeadersModule {
382
382
  }], null, null); })();
383
383
  (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(HeadersModule, { declarations: [PhaseComponent, HeaderBarComponent, NavigationComponent, NavigationItemComponent], imports: [CommonModule, RouterModule, i1.RpxTranslationModule], exports: [PhaseComponent, HeaderBarComponent, NavigationComponent, NavigationItemComponent] }); })();
384
384
 
385
- const _c0$11 = [[["", "topBody", ""]], [["", "leftBody", ""]], [["", "rightBody", ""]]];
385
+ const _c0$13 = [[["", "topBody", ""]], [["", "leftBody", ""]], [["", "rightBody", ""]]];
386
386
  const _c1$r = ["[topBody]", "[leftBody]", "[rightBody]"];
387
387
  class BodyComponent {
388
388
  static ɵfac = function BodyComponent_Factory(t) { return new (t || BodyComponent)(); };
389
389
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: BodyComponent, selectors: [["cut-body"]], ngContentSelectors: _c1$r, decls: 4, vars: 0, consts: [[1, "global-display"]], template: function BodyComponent_Template(rf, ctx) { if (rf & 1) {
390
- i0.ɵɵprojectionDef(_c0$11);
390
+ i0.ɵɵprojectionDef(_c0$13);
391
391
  i0.ɵɵelementStart(0, "div", 0);
392
392
  i0.ɵɵprojection(1);
393
393
  i0.ɵɵprojection(2, 1);
@@ -401,7 +401,7 @@ class BodyComponent {
401
401
  }], null, null); })();
402
402
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BodyComponent, { className: "BodyComponent", filePath: "lib/components/body/body.component.ts", lineNumber: 9 }); })();
403
403
 
404
- const _c0$10 = a0 => ({ "govuk-input--error": a0 });
404
+ const _c0$12 = a0 => ({ "govuk-input--error": a0 });
405
405
  function DateInputComponent_div_19_Template(rf, ctx) { if (rf & 1) {
406
406
  const _r5 = i0.ɵɵgetCurrentView();
407
407
  i0.ɵɵelementStart(0, "div", 15)(1, "label", 8);
@@ -418,7 +418,7 @@ function DateInputComponent_div_19_Template(rf, ctx) { if (rf & 1) {
418
418
  i0.ɵɵadvance();
419
419
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 6, "Hour"));
420
420
  i0.ɵɵadvance(2);
421
- i0.ɵɵproperty("id", ctx_r6.hourId())("name", ctx_r6.hourId())("value", ctx_r6.displayHour)("ngClass", i0.ɵɵpureFunction1(8, _c0$10, ctx_r6.isInvalid));
421
+ i0.ɵɵproperty("id", ctx_r6.hourId())("name", ctx_r6.hourId())("value", ctx_r6.displayHour)("ngClass", i0.ɵɵpureFunction1(8, _c0$12, ctx_r6.isInvalid));
422
422
  } }
423
423
  function DateInputComponent_div_20_Template(rf, ctx) { if (rf & 1) {
424
424
  const _r8 = i0.ɵɵgetCurrentView();
@@ -436,7 +436,7 @@ function DateInputComponent_div_20_Template(rf, ctx) { if (rf & 1) {
436
436
  i0.ɵɵadvance();
437
437
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 6, "Minute"));
438
438
  i0.ɵɵadvance(2);
439
- i0.ɵɵproperty("id", ctx_r6.minuteId())("name", ctx_r6.minuteId())("value", ctx_r6.displayMinute)("ngClass", i0.ɵɵpureFunction1(8, _c0$10, ctx_r6.isInvalid));
439
+ i0.ɵɵproperty("id", ctx_r6.minuteId())("name", ctx_r6.minuteId())("value", ctx_r6.displayMinute)("ngClass", i0.ɵɵpureFunction1(8, _c0$12, ctx_r6.isInvalid));
440
440
  } }
441
441
  function DateInputComponent_div_21_Template(rf, ctx) { if (rf & 1) {
442
442
  const _r10 = i0.ɵɵgetCurrentView();
@@ -454,7 +454,7 @@ function DateInputComponent_div_21_Template(rf, ctx) { if (rf & 1) {
454
454
  i0.ɵɵadvance();
455
455
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 6, "Second"));
456
456
  i0.ɵɵadvance(2);
457
- i0.ɵɵproperty("id", ctx_r6.secondId())("name", ctx_r6.secondId())("value", ctx_r6.displaySecond)("ngClass", i0.ɵɵpureFunction1(8, _c0$10, ctx_r6.isInvalid));
457
+ i0.ɵɵproperty("id", ctx_r6.secondId())("name", ctx_r6.secondId())("value", ctx_r6.displaySecond)("ngClass", i0.ɵɵpureFunction1(8, _c0$12, ctx_r6.isInvalid));
458
458
  } }
459
459
  class DateInputComponent {
460
460
  id;
@@ -689,19 +689,19 @@ class DateInputComponent {
689
689
  i0.ɵɵadvance();
690
690
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(4, 21, "Day"));
691
691
  i0.ɵɵadvance(2);
692
- i0.ɵɵproperty("id", ctx.dayId())("name", ctx.dayId())("value", ctx.displayDay)("ngClass", i0.ɵɵpureFunction1(27, _c0$10, ctx.isInvalid));
692
+ i0.ɵɵproperty("id", ctx.dayId())("name", ctx.dayId())("value", ctx.displayDay)("ngClass", i0.ɵɵpureFunction1(27, _c0$12, ctx.isInvalid));
693
693
  i0.ɵɵadvance(3);
694
694
  i0.ɵɵproperty("for", ctx.monthId());
695
695
  i0.ɵɵadvance();
696
696
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(10, 23, "Month"));
697
697
  i0.ɵɵadvance(2);
698
- i0.ɵɵproperty("id", ctx.monthId())("name", ctx.monthId())("value", ctx.displayMonth)("ngClass", i0.ɵɵpureFunction1(29, _c0$10, ctx.isInvalid));
698
+ i0.ɵɵproperty("id", ctx.monthId())("name", ctx.monthId())("value", ctx.displayMonth)("ngClass", i0.ɵɵpureFunction1(29, _c0$12, ctx.isInvalid));
699
699
  i0.ɵɵadvance(3);
700
700
  i0.ɵɵproperty("for", ctx.yearId());
701
701
  i0.ɵɵadvance();
702
702
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(16, 25, "Year"));
703
703
  i0.ɵɵadvance(2);
704
- i0.ɵɵproperty("id", ctx.yearId())("name", ctx.yearId())("value", ctx.displayYear)("ngClass", i0.ɵɵpureFunction1(31, _c0$10, ctx.isInvalid));
704
+ i0.ɵɵproperty("id", ctx.yearId())("name", ctx.yearId())("value", ctx.displayYear)("ngClass", i0.ɵɵpureFunction1(31, _c0$12, ctx.isInvalid));
705
705
  i0.ɵɵadvance(2);
706
706
  i0.ɵɵproperty("ngIf", ctx.isDateTime);
707
707
  i0.ɵɵadvance();
@@ -737,7 +737,7 @@ class DateInputComponent {
737
737
  }] }); })();
738
738
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(DateInputComponent, { className: "DateInputComponent", filePath: "lib/components/form/date-input/date-input.component.ts", lineNumber: 20 }); })();
739
739
 
740
- const _c0$$ = ["*"];
740
+ const _c0$11 = ["*"];
741
741
  function AlertComponent_ng_container_2_Template(rf, ctx) { if (rf & 1) {
742
742
  i0.ɵɵelementContainerStart(0);
743
743
  i0.ɵɵnamespaceSVG();
@@ -787,7 +787,7 @@ class AlertComponent {
787
787
  showIcon = true;
788
788
  alertMessageType = AlertMessageType;
789
789
  static ɵfac = function AlertComponent_Factory(t) { return new (t || AlertComponent)(); };
790
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AlertComponent, selectors: [["cut-alert"]], inputs: { type: "type", showIcon: "showIcon" }, ngContentSelectors: _c0$$, decls: 11, vars: 12, consts: [[1, "hmcts-banner"], [3, "ngSwitch"], [4, "ngSwitchCase"], [1, "hmcts-banner__message"], [1, "hmcts-banner__assistive"], ["fill", "currentColor", "role", "presentation", "focusable", "false", "xmlns", "http://www.w3.org/2000/svg", "viewBox", "0 0 25 25", "height", "25", "width", "25", 1, "hmcts-banner__icon"], ["d", "M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z"], ["d", "M25,6.2L8.7,23.2L0,14.1l4-4.2l4.7,4.9L21,2L25,6.2z"], ["d", "M13.7,18.5h-2.4v-2.4h2.4V18.5z M12.5,13.7c-0.7,0-1.2-0.5-1.2-1.2V7.7c0-0.7,0.5-1.2,1.2-1.2s1.2,0.5,1.2,1.2v4.8\n C13.7,13.2,13.2,13.7,12.5,13.7z M12.5,0.5c-6.6,0-12,5.4-12,12s5.4,12,12,12s12-5.4,12-12S19.1,0.5,12.5,0.5z"]], template: function AlertComponent_Template(rf, ctx) { if (rf & 1) {
790
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AlertComponent, selectors: [["cut-alert"]], inputs: { type: "type", showIcon: "showIcon" }, ngContentSelectors: _c0$11, decls: 11, vars: 12, consts: [[1, "hmcts-banner"], [3, "ngSwitch"], [4, "ngSwitchCase"], [1, "hmcts-banner__message"], [1, "hmcts-banner__assistive"], ["fill", "currentColor", "role", "presentation", "focusable", "false", "xmlns", "http://www.w3.org/2000/svg", "viewBox", "0 0 25 25", "height", "25", "width", "25", 1, "hmcts-banner__icon"], ["d", "M13.6,15.4h-2.3v-4.5h2.3V15.4z M13.6,19.8h-2.3v-2.2h2.3V19.8z M0,23.2h25L12.5,2L0,23.2z"], ["d", "M25,6.2L8.7,23.2L0,14.1l4-4.2l4.7,4.9L21,2L25,6.2z"], ["d", "M13.7,18.5h-2.4v-2.4h2.4V18.5z M12.5,13.7c-0.7,0-1.2-0.5-1.2-1.2V7.7c0-0.7,0.5-1.2,1.2-1.2s1.2,0.5,1.2,1.2v4.8\n C13.7,13.2,13.2,13.7,12.5,13.7z M12.5,0.5c-6.6,0-12,5.4-12,12s5.4,12,12,12s12-5.4,12-12S19.1,0.5,12.5,0.5z"]], template: function AlertComponent_Template(rf, ctx) { if (rf & 1) {
791
791
  i0.ɵɵprojectionDef();
792
792
  i0.ɵɵelementStart(0, "div", 0);
793
793
  i0.ɵɵelementContainerStart(1, 1);
@@ -1000,14 +1000,14 @@ class NotificationBannerComponent {
1000
1000
  }] }); })();
1001
1001
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(NotificationBannerComponent, { className: "NotificationBannerComponent", filePath: "lib/components/banners/notification-banner/notification-banner.component.ts", lineNumber: 10 }); })();
1002
1002
 
1003
- const _c0$_ = ["*"];
1003
+ const _c0$10 = ["*"];
1004
1004
  const _c1$q = a0 => ({ "js-hidden": a0 });
1005
1005
  class TabComponent {
1006
1006
  id;
1007
1007
  title;
1008
1008
  selected;
1009
1009
  static ɵfac = function TabComponent_Factory(t) { return new (t || TabComponent)(); };
1010
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TabComponent, selectors: [["cut-tab"]], inputs: { id: "id", title: "title", selected: "selected" }, ngContentSelectors: _c0$_, decls: 2, vars: 5, consts: [["role", "tabpanel", 1, "tabs-panel", 3, "id", "ngClass"]], template: function TabComponent_Template(rf, ctx) { if (rf & 1) {
1010
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TabComponent, selectors: [["cut-tab"]], inputs: { id: "id", title: "title", selected: "selected" }, ngContentSelectors: _c0$10, decls: 2, vars: 5, consts: [["role", "tabpanel", 1, "tabs-panel", 3, "id", "ngClass"]], template: function TabComponent_Template(rf, ctx) { if (rf & 1) {
1011
1011
  i0.ɵɵprojectionDef();
1012
1012
  i0.ɵɵelementStart(0, "div", 0);
1013
1013
  i0.ɵɵprojection(1);
@@ -1029,7 +1029,7 @@ class TabComponent {
1029
1029
  }] }); })();
1030
1030
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TabComponent, { className: "TabComponent", filePath: "lib/components/tabs/tab.component.ts", lineNumber: 10 }); })();
1031
1031
 
1032
- const _c0$Z = ["tab"];
1032
+ const _c0$$ = ["tab"];
1033
1033
  const _c1$p = ["*"];
1034
1034
  const _c2$4 = () => ["."];
1035
1035
  const _c3 = a0 => ({ "tabs-toggle-selected": a0 });
@@ -1076,7 +1076,7 @@ class TabsComponent {
1076
1076
  let _t;
1077
1077
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.panels = _t);
1078
1078
  } }, viewQuery: function TabsComponent_Query(rf, ctx) { if (rf & 1) {
1079
- i0.ɵɵviewQuery(_c0$Z, 5);
1079
+ i0.ɵɵviewQuery(_c0$$, 5);
1080
1080
  } if (rf & 2) {
1081
1081
  let _t;
1082
1082
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.tabs = _t);
@@ -1135,7 +1135,7 @@ class TabsModule {
1135
1135
  RouterModule, i1.RpxTranslationModule], exports: [TabsComponent,
1136
1136
  TabComponent] }); })();
1137
1137
 
1138
- const _c0$Y = (a0, a1) => ({ caseLocked: a0, someoneViewing: a1 });
1138
+ const _c0$_ = (a0, a1) => ({ caseLocked: a0, someoneViewing: a1 });
1139
1139
  class ActivityBannerComponent {
1140
1140
  bannerType;
1141
1141
  description;
@@ -1154,7 +1154,7 @@ class ActivityBannerComponent {
1154
1154
  i0.ɵɵpipe(6, "rpxTranslate");
1155
1155
  i0.ɵɵelementEnd()();
1156
1156
  } if (rf & 2) {
1157
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(8, _c0$Y, ctx.bannerType === "editor", ctx.bannerType === "viewer"));
1157
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(8, _c0$_, ctx.bannerType === "editor", ctx.bannerType === "viewer"));
1158
1158
  i0.ɵɵadvance(2);
1159
1159
  i0.ɵɵpropertyInterpolate("alt", i0.ɵɵpipeBind1(3, 4, ctx.description));
1160
1160
  i0.ɵɵpropertyInterpolate("src", ctx.imageLink, i0.ɵɵsanitizeUrl);
@@ -7046,6 +7046,118 @@ class FormErrorService {
7046
7046
  type: Injectable
7047
7047
  }], null, null); })();
7048
7048
 
7049
+ class MultipageComponentStateService {
7050
+ //is journey at start will help keep track of the progress through the journey.
7051
+ isJourneyAtStart = false;
7052
+ //journey collection references an upto date list of all the journey components currently rendered!!!!
7053
+ journeyCollection = new Array();
7054
+ //the instigator references the case-edit-page component that will invoke the next and previous methods
7055
+ instigator = null;
7056
+ //each journey will store its state here. this could include form data if needed
7057
+ journeyState = new Map();
7058
+ //setJourneyComponent will be called by the app component to update the journey collection
7059
+ setJourneyCollection(journeyCollection) {
7060
+ this.journeyCollection = journeyCollection;
7061
+ }
7062
+ //getJourneyCollection will be called by the app component to get the journey collection
7063
+ getJourneyCollection() {
7064
+ return this.journeyCollection;
7065
+ }
7066
+ //addToJourneyCollection will be called from the journey
7067
+ addTojourneyCollection(journey) {
7068
+ this.journeyCollection.push(journey);
7069
+ }
7070
+ //resetJourneyCollection will be called
7071
+ resetJourneyCollection() {
7072
+ this.journeyCollection = [];
7073
+ }
7074
+ //setInstigator will be called by the app component to update the instigator
7075
+ setInstigator(instigator) {
7076
+ this.instigator = instigator;
7077
+ }
7078
+ //getInstigator will be called by the app component to get the instigator
7079
+ getInstigator() {
7080
+ return this.instigator;
7081
+ }
7082
+ //setJourneyState will be called by the journey component to update the journey state
7083
+ setJourneyState(journey) {
7084
+ this.journeyState.set(journey.journeyId, journey);
7085
+ }
7086
+ //getJourneyState will be called by the journey component to get the journey state
7087
+ getJourneyState(journey) {
7088
+ return this.journeyState.get(journey.journeyId) || null;
7089
+ }
7090
+ //resetJourneyState will be called by the journey component to reset the journey state
7091
+ resetJourneyState() {
7092
+ this.journeyState.clear();
7093
+ }
7094
+ //reset will be called to ensure that the entire state is reset
7095
+ reset() {
7096
+ this.isJourneyAtStart = false;
7097
+ this.journeyState.clear();
7098
+ this.instigator = null;
7099
+ this.journeyCollection = [];
7100
+ }
7101
+ //next will be called by the instigator that will invoke the next method of the journey component that will invoke the next method of the childpage component
7102
+ next() {
7103
+ if (this.journeyCollection.length <= 0) {
7104
+ this.instigator?.onFinalNext();
7105
+ return;
7106
+ }
7107
+ const isAnyObjectNotFinished = this.journeyCollection.some((journey) => !journey.isFinished());
7108
+ if (!isAnyObjectNotFinished) {
7109
+ this.instigator?.onFinalNext();
7110
+ return;
7111
+ }
7112
+ for (const journey of this.journeyCollection) {
7113
+ if (!journey) {
7114
+ continue;
7115
+ }
7116
+ if (!journey?.isFinished()) {
7117
+ journey?.next();
7118
+ break;
7119
+ }
7120
+ }
7121
+ }
7122
+ //previous will be called by the instigator that will invoke the previous method of the journey component that will invoke the previous method of the childpage component
7123
+ previous() {
7124
+ if (this.journeyCollection.length <= 0) {
7125
+ this.instigator?.onFinalPrevious();
7126
+ return;
7127
+ }
7128
+ const isAnyObjectNotAtStart = this.journeyCollection.some((journey) => !journey.isStart());
7129
+ if (!isAnyObjectNotAtStart) {
7130
+ this.instigator?.onFinalPrevious();
7131
+ return;
7132
+ }
7133
+ for (const journey of this.journeyCollection.slice().reverse()) {
7134
+ if (!journey) {
7135
+ continue;
7136
+ }
7137
+ if (!journey?.isStart()) {
7138
+ journey?.previous();
7139
+ break;
7140
+ }
7141
+ }
7142
+ }
7143
+ //isAtStart can be used to inform the instigator if we're at the start.
7144
+ get isAtStart() {
7145
+ return this.isJourneyAtStart;
7146
+ }
7147
+ //isAtStart can be used to update the value from a journey object, so the instigator knows.
7148
+ set isAtStart(isAtStart) {
7149
+ this.isJourneyAtStart = isAtStart;
7150
+ }
7151
+ static ɵfac = function MultipageComponentStateService_Factory(t) { return new (t || MultipageComponentStateService)(); };
7152
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: MultipageComponentStateService, factory: MultipageComponentStateService.ɵfac, providedIn: 'root' });
7153
+ }
7154
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MultipageComponentStateService, [{
7155
+ type: Injectable,
7156
+ args: [{
7157
+ providedIn: 'root'
7158
+ }]
7159
+ }], null, null); })();
7160
+
7049
7161
  class JurisdictionService {
7050
7162
  httpService;
7051
7163
  // We retain the Subject observable because subscribing code couldn't happen a null value
@@ -8948,7 +9060,7 @@ class WorkAllocationService {
8948
9060
  isWAEnabled(jurisdiction, caseType) {
8949
9061
  this.features = this.appConfig.getWAServiceConfig();
8950
9062
  const ftstr = JSON.stringify(this.features);
8951
- console.log(`isWAEnabled: ${ftstr}`);
9063
+ this.appConfig.logMessage(`isWAEnabled: wa-service-config returning ${ftstr.length > 0}`);
8952
9064
  let enabled = false;
8953
9065
  if (!jurisdiction || !caseType) {
8954
9066
  const caseInfo = JSON.parse(this.sessionStorageService.getItem('caseInfo'));
@@ -8956,7 +9068,7 @@ class WorkAllocationService {
8956
9068
  caseType = caseInfo.caseType;
8957
9069
  }
8958
9070
  if (!this.features || !this.features.configurations) {
8959
- console.log('isWAEnabled: no features');
9071
+ this.appConfig.logMessage('isWAEnabled: no features');
8960
9072
  return false;
8961
9073
  }
8962
9074
  this.features.configurations.forEach(serviceConfig => {
@@ -8964,7 +9076,7 @@ class WorkAllocationService {
8964
9076
  enabled = true;
8965
9077
  }
8966
9078
  });
8967
- console.log(`isWAEnabled: returning ${enabled}`);
9079
+ this.appConfig.logMessage(`isWAEnabled: returning ${enabled}`);
8968
9080
  return enabled;
8969
9081
  }
8970
9082
  /**
@@ -8992,7 +9104,7 @@ class WorkAllocationService {
8992
9104
  if (!this.isWAEnabled()) {
8993
9105
  return of(null);
8994
9106
  }
8995
- console.log(`completeTask: completing ${taskId}`);
9107
+ this.appConfig.logMessage(`completeTask: completing ${taskId}`);
8996
9108
  const url = `${this.appConfig.getWorkAllocationApiUrl()}/task/${taskId}/complete`;
8997
9109
  return this.http
8998
9110
  .post(url, { actionByEvent: true, eventName: eventName })
@@ -9013,6 +9125,7 @@ class WorkAllocationService {
9013
9125
  if (!this.isWAEnabled()) {
9014
9126
  return of(null);
9015
9127
  }
9128
+ this.appConfig.logMessage(`assignAndCompleteTask: completing ${taskId}`);
9016
9129
  const url = `${this.appConfig.getWorkAllocationApiUrl()}/task/${taskId}/complete`;
9017
9130
  return this.http
9018
9131
  .post(url, {
@@ -9100,6 +9213,7 @@ class WorkAllocationService {
9100
9213
  tasks: []
9101
9214
  };
9102
9215
  if (!this.isWAEnabled()) {
9216
+ this.appConfig.logMessage(`isWAEnabled false for ${caseId} in event ${eventId}`);
9103
9217
  return of(defaultPayload);
9104
9218
  }
9105
9219
  return this.http.get(`${this.appConfig.getWorkAllocationApiUrl()}/case/tasks/${caseId}/event/${eventId}/caseType/${caseType}/jurisdiction/${jurisdiction}`);
@@ -9111,6 +9225,7 @@ class WorkAllocationService {
9111
9225
  if (!this.isWAEnabled()) {
9112
9226
  return of({ task: null });
9113
9227
  }
9228
+ this.appConfig.logMessage(`getTask: ${taskId}`);
9114
9229
  return this.http.get(`${this.appConfig.getWorkAllocationApiUrl()}/task/${taskId}`);
9115
9230
  }
9116
9231
  static ɵfac = function WorkAllocationService_Factory(t) { return new (t || WorkAllocationService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(HttpErrorService), i0.ɵɵinject(AlertService), i0.ɵɵinject(SessionStorageService)); };
@@ -9173,6 +9288,7 @@ class CaseEditComponent {
9173
9288
  validPageListCaseFieldsService;
9174
9289
  workAllocationService;
9175
9290
  alertService;
9291
+ abstractConfig;
9176
9292
  static ORIGIN_QUERY_PARAM = 'origin';
9177
9293
  static ALERT_MESSAGE = 'Page is being refreshed so you will be redirected to the first page of this event.';
9178
9294
  eventTrigger;
@@ -9198,7 +9314,7 @@ class CaseEditComponent {
9198
9314
  error;
9199
9315
  callbackErrorsSubject = new Subject();
9200
9316
  validPageList = [];
9201
- constructor(fb, caseNotifier, router, route, fieldsUtils, fieldsPurger, registrarService, wizardFactory, sessionStorageService, windowsService, formValueService, formErrorService, loadingService, validPageListCaseFieldsService, workAllocationService, alertService) {
9317
+ constructor(fb, caseNotifier, router, route, fieldsUtils, fieldsPurger, registrarService, wizardFactory, sessionStorageService, windowsService, formValueService, formErrorService, loadingService, validPageListCaseFieldsService, workAllocationService, alertService, abstractConfig) {
9202
9318
  this.fb = fb;
9203
9319
  this.caseNotifier = caseNotifier;
9204
9320
  this.router = router;
@@ -9215,6 +9331,7 @@ class CaseEditComponent {
9215
9331
  this.validPageListCaseFieldsService = validPageListCaseFieldsService;
9216
9332
  this.workAllocationService = workAllocationService;
9217
9333
  this.alertService = alertService;
9334
+ this.abstractConfig = abstractConfig;
9218
9335
  }
9219
9336
  ngOnInit() {
9220
9337
  this.wizard = this.wizardFactory.create(this.eventTrigger);
@@ -9338,6 +9455,7 @@ class CaseEditComponent {
9338
9455
  const eventId = this.getEventId(form);
9339
9456
  const caseId = this.getCaseId(caseDetails);
9340
9457
  if (this.taskExistsForThisEventAndCase(taskInSessionStorage, taskEventInSessionStorage, eventId, caseId)) {
9458
+ this.abstractConfig.logMessage(`task exist for this event for caseId and eventId as ${caseId} ${eventId}`);
9341
9459
  // Show event completion component to perform event completion checks
9342
9460
  this.eventCompletionParams = ({
9343
9461
  caseId,
@@ -9545,10 +9663,12 @@ class CaseEditComponent {
9545
9663
  const assignNeeded = this.sessionStorageService.getItem('assignNeeded') === 'true';
9546
9664
  if (taskStr && assignNeeded) {
9547
9665
  const task = JSON.parse(taskStr);
9666
+ this.abstractConfig.logMessage(`postCompleteTaskIfRequired with assignNeeded: taskId ${task.id} and event name ${this.eventTrigger.name}`);
9548
9667
  return this.workAllocationService.assignAndCompleteTask(task.id, this.eventTrigger.name);
9549
9668
  }
9550
9669
  else if (taskStr) {
9551
9670
  const task = JSON.parse(taskStr);
9671
+ this.abstractConfig.logMessage(`postCompleteTaskIfRequired: taskId ${task.id} and event name ${this.eventTrigger.name}`);
9552
9672
  return this.workAllocationService.completeTask(task.id, this.eventTrigger.name);
9553
9673
  }
9554
9674
  return of(true);
@@ -9608,7 +9728,7 @@ class CaseEditComponent {
9608
9728
  hasCallbackFailed(response) {
9609
9729
  return response['callback_response_status'] !== 'CALLBACK_COMPLETED';
9610
9730
  }
9611
- static ɵfac = function CaseEditComponent_Factory(t) { return new (t || CaseEditComponent)(i0.ɵɵdirectiveInject(i4.FormBuilder), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(FieldsUtils), i0.ɵɵdirectiveInject(FieldsPurger), i0.ɵɵdirectiveInject(ConditionalShowRegistrarService), i0.ɵɵdirectiveInject(WizardFactoryService), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(WindowService), i0.ɵɵdirectiveInject(FormValueService), i0.ɵɵdirectiveInject(FormErrorService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(ValidPageListCaseFieldsService), i0.ɵɵdirectiveInject(WorkAllocationService), i0.ɵɵdirectiveInject(AlertService)); };
9731
+ static ɵfac = function CaseEditComponent_Factory(t) { return new (t || CaseEditComponent)(i0.ɵɵdirectiveInject(i4.FormBuilder), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(FieldsUtils), i0.ɵɵdirectiveInject(FieldsPurger), i0.ɵɵdirectiveInject(ConditionalShowRegistrarService), i0.ɵɵdirectiveInject(WizardFactoryService), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(WindowService), i0.ɵɵdirectiveInject(FormValueService), i0.ɵɵdirectiveInject(FormErrorService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(ValidPageListCaseFieldsService), i0.ɵɵdirectiveInject(WorkAllocationService), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(AbstractAppConfig)); };
9612
9732
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditComponent, selectors: [["ccd-case-edit"]], inputs: { eventTrigger: "eventTrigger", submit: "submit", validate: "validate", saveDraft: "saveDraft", caseDetails: "caseDetails" }, outputs: { cancelled: "cancelled", submitted: "submitted" }, features: [i0.ɵɵProvidersFeature([GreyBarService])], decls: 1, vars: 0, template: function CaseEditComponent_Template(rf, ctx) { if (rf & 1) {
9613
9733
  i0.ɵɵelement(0, "router-outlet");
9614
9734
  } }, dependencies: [i1$1.RouterOutlet], styles: ["#fieldset-case-data[_ngcontent-%COMP%]{margin-bottom:30px}#fieldset-case-data[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{width:1%;white-space:nowrap;vertical-align:top}.compound-field[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:0}#confirmation-header[_ngcontent-%COMP%]{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body[_ngcontent-%COMP%]{width:630px;background-color:#fff}.valign-top[_ngcontent-%COMP%]{vertical-align:top}.summary-fields[_ngcontent-%COMP%]{margin-bottom:30px}.summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:0px}a.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:default}.case-field-label[_ngcontent-%COMP%]{width:45%}.case-field-content[_ngcontent-%COMP%]{width:50%}.no-bottom-border[_ngcontent-%COMP%]{border-bottom:none}.case-field-change[_ngcontent-%COMP%]{width:5%}"] });
@@ -9616,7 +9736,7 @@ class CaseEditComponent {
9616
9736
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditComponent, [{
9617
9737
  type: Component,
9618
9738
  args: [{ selector: 'ccd-case-edit', providers: [GreyBarService], template: "<router-outlet></router-outlet>\n", styles: ["#fieldset-case-data{margin-bottom:30px}#fieldset-case-data th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}#confirmation-header{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body{width:630px;background-color:#fff}.valign-top{vertical-align:top}.summary-fields{margin-bottom:30px}.summary-fields tbody tr th,.summary-fields tbody tr td{border-bottom:0px}a.disabled{pointer-events:none;cursor:default}.case-field-label{width:45%}.case-field-content{width:50%}.no-bottom-border{border-bottom:none}.case-field-change{width:5%}\n"] }]
9619
- }], () => [{ type: i4.FormBuilder }, { type: CaseNotifier }, { type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: FieldsUtils }, { type: FieldsPurger }, { type: ConditionalShowRegistrarService }, { type: WizardFactoryService }, { type: SessionStorageService }, { type: WindowService }, { type: FormValueService }, { type: FormErrorService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }, { type: WorkAllocationService }, { type: AlertService }], { eventTrigger: [{
9739
+ }], () => [{ type: i4.FormBuilder }, { type: CaseNotifier }, { type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: FieldsUtils }, { type: FieldsPurger }, { type: ConditionalShowRegistrarService }, { type: WizardFactoryService }, { type: SessionStorageService }, { type: WindowService }, { type: FormValueService }, { type: FormErrorService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }, { type: WorkAllocationService }, { type: AlertService }, { type: AbstractAppConfig }], { eventTrigger: [{
9620
9740
  type: Input
9621
9741
  }], submit: [{
9622
9742
  type: Input
@@ -9631,7 +9751,7 @@ class CaseEditComponent {
9631
9751
  }], submitted: [{
9632
9752
  type: Output
9633
9753
  }] }); })();
9634
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditComponent, { className: "CaseEditComponent", filePath: "lib/shared/components/case-editor/case-edit/case-edit.component.ts", lineNumber: 33 }); })();
9754
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditComponent, { className: "CaseEditComponent", filePath: "lib/shared/components/case-editor/case-edit/case-edit.component.ts", lineNumber: 34 }); })();
9635
9755
 
9636
9756
  function CaseEditConfirmComponent_div_3_Template(rf, ctx) { if (rf & 1) {
9637
9757
  i0.ɵɵelement(0, "div");
@@ -10023,6 +10143,149 @@ function initDialog() {
10023
10143
  return dialogConfig;
10024
10144
  }
10025
10145
 
10146
+ class LinkedCasesService {
10147
+ jurisdictionService;
10148
+ searchService;
10149
+ static CASE_NAME_MISSING_TEXT = 'Case name missing';
10150
+ caseFieldValue = [];
10151
+ isLinkedCasesEventTrigger = false;
10152
+ caseDetails;
10153
+ caseId;
10154
+ caseName;
10155
+ linkCaseReasons = [];
10156
+ linkedCases = [];
10157
+ initialCaseLinks = [];
10158
+ editMode = false;
10159
+ jurisdictionsResponse = [];
10160
+ serverJurisdictionError;
10161
+ serverError = null;
10162
+ serverLinkedApiError = null;
10163
+ isServerReasonCodeError = false;
10164
+ caseJurisdictionID = null;
10165
+ storedCaseNumber = '';
10166
+ cameFromFinalStep = false;
10167
+ hasNavigatedInJourney = false;
10168
+ constructor(jurisdictionService, searchService) {
10169
+ this.jurisdictionService = jurisdictionService;
10170
+ this.searchService = searchService;
10171
+ this.jurisdictionService.getJurisdictions().subscribe((jurisdictions) => {
10172
+ this.jurisdictionsResponse = jurisdictions;
10173
+ }, (error) => {
10174
+ this.serverJurisdictionError = true;
10175
+ });
10176
+ }
10177
+ groupLinkedCasesByCaseType = (arrObj, key) => {
10178
+ return arrObj.reduce((rv, x) => {
10179
+ (rv[x.value[key]] = rv[x.value[key]] || []).push(x.value['CaseReference']);
10180
+ return rv;
10181
+ }, {});
10182
+ };
10183
+ constructElasticSearchQuery(caseIds, size) {
10184
+ return {
10185
+ query: {
10186
+ terms: {
10187
+ reference: caseIds,
10188
+ },
10189
+ },
10190
+ size,
10191
+ };
10192
+ }
10193
+ resetLinkedCaseData() {
10194
+ this.caseFieldValue = [];
10195
+ this.linkedCases = [];
10196
+ this.storedCaseNumber = '';
10197
+ this.cameFromFinalStep = false;
10198
+ this.hasNavigatedInJourney = false;
10199
+ }
10200
+ mapResponse(esSearchCasesResponse) {
10201
+ const caseInfo = this.caseFieldValue.find(item => item.value && item.value.CaseReference === esSearchCasesResponse.case_id);
10202
+ return caseInfo && {
10203
+ caseReference: esSearchCasesResponse.case_id,
10204
+ caseName: esSearchCasesResponse.case_fields.caseNameHmctsInternal || LinkedCasesService.CASE_NAME_MISSING_TEXT,
10205
+ caseType: this.mapLookupIDToValueFromJurisdictions('CASE_TYPE', esSearchCasesResponse.case_fields['[CASE_TYPE]']),
10206
+ service: this.mapLookupIDToValueFromJurisdictions('JURISDICTION', esSearchCasesResponse.case_fields['[JURISDICTION]']),
10207
+ state: this.mapLookupIDToValueFromJurisdictions('STATE', esSearchCasesResponse.case_fields['[STATE]']),
10208
+ reasons: caseInfo?.value?.ReasonForLink
10209
+ };
10210
+ }
10211
+ searchCasesByCaseIds(searchCasesResponse) {
10212
+ return forkJoin(searchCasesResponse);
10213
+ }
10214
+ getAllLinkedCaseInformation() {
10215
+ const searchCasesResponse = [];
10216
+ const linkedCaseIds = this.groupLinkedCasesByCaseType(this.caseFieldValue, 'CaseType');
10217
+ Object.keys(linkedCaseIds).forEach(key => {
10218
+ const esQuery = this.constructElasticSearchQuery(linkedCaseIds[key], 100);
10219
+ const query = this.searchService.searchCasesByIds(key, esQuery, SearchService.VIEW_WORKBASKET);
10220
+ searchCasesResponse.push(query);
10221
+ });
10222
+ if (searchCasesResponse.length) {
10223
+ this.searchCasesByCaseIds(searchCasesResponse).subscribe((searchCases) => {
10224
+ const casesResponse = [];
10225
+ searchCases.forEach(response => {
10226
+ response.results.forEach((result) => {
10227
+ casesResponse.push(this.mapResponse(result));
10228
+ });
10229
+ });
10230
+ this.linkedCases = casesResponse.map(item => {
10231
+ return {
10232
+ caseReference: item.caseReference,
10233
+ caseName: item.caseName,
10234
+ caseService: item.service,
10235
+ caseType: item.caseType,
10236
+ unlink: false,
10237
+ reasons: item.reasons && item.reasons.map(reason => {
10238
+ return {
10239
+ Reason: reason
10240
+ };
10241
+ }),
10242
+ };
10243
+ });
10244
+ this.serverLinkedApiError = null;
10245
+ }, err => {
10246
+ this.serverLinkedApiError = {
10247
+ id: 'backendError', message: 'Some case information is not available at the moment'
10248
+ };
10249
+ });
10250
+ }
10251
+ }
10252
+ mapLookupIDToValueFromJurisdictions(fieldName, fieldValue) {
10253
+ const selectedJurisdiction = this.jurisdictionsResponse &&
10254
+ this.jurisdictionsResponse.find(item => item.id === this.caseDetails.case_type.jurisdiction.id);
10255
+ const selectedCaseType = selectedJurisdiction && selectedJurisdiction.caseTypes.find(item => item.id === this.caseDetails.case_type.id);
10256
+ const state = selectedCaseType && selectedCaseType.states.find(item => item.id === fieldValue);
10257
+ switch (fieldName) {
10258
+ case 'JURISDICTION':
10259
+ return selectedJurisdiction && selectedJurisdiction.description;
10260
+ case 'CASE_TYPE':
10261
+ return selectedCaseType && selectedCaseType.name;
10262
+ case 'CASE_TYPE_DESCRIPTION':
10263
+ return selectedCaseType && selectedCaseType.description;
10264
+ case 'STATE':
10265
+ return state && state.name || fieldValue;
10266
+ case 'STATE_DESCRIPTION':
10267
+ return state && state.description || fieldValue;
10268
+ default:
10269
+ break;
10270
+ }
10271
+ }
10272
+ getCaseName(searchCasesResponse) {
10273
+ let caseName = LinkedCasesService.CASE_NAME_MISSING_TEXT;
10274
+ const tabs = searchCasesResponse.tabs.filter(tab => {
10275
+ const caseNameHmctsInternalField = tab.fields.find(field => field.id === 'caseNameHmctsInternal');
10276
+ if (caseNameHmctsInternalField) {
10277
+ caseName = caseNameHmctsInternalField.value;
10278
+ }
10279
+ });
10280
+ return caseName;
10281
+ }
10282
+ static ɵfac = function LinkedCasesService_Factory(t) { return new (t || LinkedCasesService)(i0.ɵɵinject(JurisdictionService), i0.ɵɵinject(SearchService)); };
10283
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: LinkedCasesService, factory: LinkedCasesService.ɵfac });
10284
+ }
10285
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LinkedCasesService, [{
10286
+ type: Injectable
10287
+ }], () => [{ type: JurisdictionService }, { type: SearchService }], null); })();
10288
+
10026
10289
  function CaseEditPageComponent_ng_container_0_h1_1_Template(rf, ctx) { if (rf & 1) {
10027
10290
  i0.ɵɵelementStart(0, "h1", 11);
10028
10291
  i0.ɵɵtext(1);
@@ -10139,28 +10402,37 @@ function CaseEditPageComponent_form_10_div_4_Template(rf, ctx) { if (rf & 1) {
10139
10402
  i0.ɵɵadvance(2);
10140
10403
  i0.ɵɵproperty("fields", ctx_r1.currentPage.getCol2Fields())("formGroup", ctx_r1.editForm.controls["data"])("caseFields", ctx_r1.caseFields);
10141
10404
  } }
10405
+ function CaseEditPageComponent_form_10_button_6_Template(rf, ctx) { if (rf & 1) {
10406
+ const _r7 = i0.ɵɵgetCurrentView();
10407
+ i0.ɵɵelementStart(0, "button", 38);
10408
+ i0.ɵɵlistener("click", function CaseEditPageComponent_form_10_button_6_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r7); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.toPreviousPage()); });
10409
+ i0.ɵɵtext(1);
10410
+ i0.ɵɵpipe(2, "rpxTranslate");
10411
+ i0.ɵɵelementEnd();
10412
+ } if (rf & 2) {
10413
+ const ctx_r1 = i0.ɵɵnextContext(2);
10414
+ i0.ɵɵproperty("disabled", ctx_r1.isAtStart());
10415
+ i0.ɵɵadvance();
10416
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 2, "Previous"), " ");
10417
+ } }
10142
10418
  function CaseEditPageComponent_form_10_Template(rf, ctx) { if (rf & 1) {
10143
10419
  const _r5 = i0.ɵɵgetCurrentView();
10144
10420
  i0.ɵɵelementStart(0, "form", 22);
10145
- i0.ɵɵlistener("submit", function CaseEditPageComponent_form_10_Template_form_submit_0_listener() { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.submit()); });
10421
+ i0.ɵɵlistener("submit", function CaseEditPageComponent_form_10_Template_form_submit_0_listener() { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.nextStep()); });
10146
10422
  i0.ɵɵelementStart(1, "fieldset", 23);
10147
10423
  i0.ɵɵelement(2, "legend", 24);
10148
10424
  i0.ɵɵtemplate(3, CaseEditPageComponent_form_10_ccd_case_edit_form_3_Template, 1, 4, "ccd-case-edit-form", 25)(4, CaseEditPageComponent_form_10_div_4_Template, 5, 6, "div", 26);
10149
10425
  i0.ɵɵelementEnd();
10150
- i0.ɵɵelementStart(5, "div", 27)(6, "button", 28);
10151
- i0.ɵɵpipe(7, "async");
10152
- i0.ɵɵlistener("click", function CaseEditPageComponent_form_10_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.toPreviousPage()); });
10426
+ i0.ɵɵelementStart(5, "div", 27);
10427
+ i0.ɵɵtemplate(6, CaseEditPageComponent_form_10_button_6_Template, 3, 4, "button", 28);
10428
+ i0.ɵɵelementStart(7, "button", 29);
10153
10429
  i0.ɵɵtext(8);
10154
10430
  i0.ɵɵpipe(9, "rpxTranslate");
10155
- i0.ɵɵelementEnd();
10156
- i0.ɵɵelementStart(10, "button", 29);
10157
- i0.ɵɵtext(11);
10158
- i0.ɵɵpipe(12, "rpxTranslate");
10159
10431
  i0.ɵɵelementEnd()();
10160
- i0.ɵɵelementStart(13, "p", 30)(14, "a", 31);
10161
- i0.ɵɵlistener("click", function CaseEditPageComponent_form_10_Template_a_click_14_listener() { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.cancel()); });
10162
- i0.ɵɵtext(15);
10163
- i0.ɵɵpipe(16, "rpxTranslate");
10432
+ i0.ɵɵelementStart(10, "p", 30)(11, "a", 31);
10433
+ i0.ɵɵlistener("click", function CaseEditPageComponent_form_10_Template_a_click_11_listener() { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.cancel()); });
10434
+ i0.ɵɵtext(12);
10435
+ i0.ɵɵpipe(13, "rpxTranslate");
10164
10436
  i0.ɵɵelementEnd()()();
10165
10437
  } if (rf & 2) {
10166
10438
  const ctx_r1 = i0.ɵɵnextContext();
@@ -10170,20 +10442,18 @@ function CaseEditPageComponent_form_10_Template(rf, ctx) { if (rf & 1) {
10170
10442
  i0.ɵɵadvance();
10171
10443
  i0.ɵɵproperty("ngIf", ctx_r1.currentPage.isMultiColumn());
10172
10444
  i0.ɵɵadvance(2);
10173
- i0.ɵɵproperty("disabled", !i0.ɵɵpipeBind1(7, 8, ctx_r1.hasPreviousPage$));
10174
- i0.ɵɵadvance(2);
10175
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(9, 10, "Previous"), " ");
10176
- i0.ɵɵadvance(2);
10445
+ i0.ɵɵproperty("ngIf", !ctx_r1.isAtStart());
10446
+ i0.ɵɵadvance();
10177
10447
  i0.ɵɵproperty("disabled", ctx_r1.submitting());
10178
10448
  i0.ɵɵadvance();
10179
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(12, 12, ctx_r1.triggerText));
10449
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(9, 7, ctx_r1.triggerText));
10180
10450
  i0.ɵɵadvance(4);
10181
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(16, 14, ctx_r1.getCancelText()));
10451
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(13, 9, ctx_r1.getCancelText()));
10182
10452
  } }
10183
10453
  function CaseEditPageComponent_ccd_case_event_completion_11_Template(rf, ctx) { if (rf & 1) {
10184
- const _r7 = i0.ɵɵgetCurrentView();
10185
- i0.ɵɵelementStart(0, "ccd-case-event-completion", 38);
10186
- i0.ɵɵlistener("eventCanBeCompleted", function CaseEditPageComponent_ccd_case_event_completion_11_Template_ccd_case_event_completion_eventCanBeCompleted_0_listener($event) { i0.ɵɵrestoreView(_r7); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onEventCanBeCompleted($event)); });
10454
+ const _r8 = i0.ɵɵgetCurrentView();
10455
+ i0.ɵɵelementStart(0, "ccd-case-event-completion", 39);
10456
+ i0.ɵɵlistener("eventCanBeCompleted", function CaseEditPageComponent_ccd_case_event_completion_11_Template_ccd_case_event_completion_eventCanBeCompleted_0_listener($event) { i0.ɵɵrestoreView(_r8); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onEventCanBeCompleted($event)); });
10187
10457
  i0.ɵɵelementEnd();
10188
10458
  } if (rf & 2) {
10189
10459
  const ctx_r1 = i0.ɵɵnextContext();
@@ -10201,7 +10471,9 @@ class CaseEditPageComponent {
10201
10471
  caseEditDataService;
10202
10472
  loadingService;
10203
10473
  validPageListCaseFieldsService;
10474
+ multipageComponentStateService;
10204
10475
  addressService;
10476
+ linkedCasesService;
10205
10477
  static RESUMED_FORM_DISCARD = 'RESUMED_FORM_DISCARD';
10206
10478
  static NEW_FORM_DISCARD = 'NEW_FORM_DISCARD';
10207
10479
  static NEW_FORM_SAVE = 'NEW_FORM_CHANGED_SAVE';
@@ -10242,7 +10514,7 @@ class CaseEditPageComponent {
10242
10514
  topContainer.focus();
10243
10515
  }
10244
10516
  }
10245
- constructor(caseEdit, route, formValueService, formErrorService, cdRef, pageValidationService, dialog, caseFieldService, caseEditDataService, loadingService, validPageListCaseFieldsService, addressService) {
10517
+ constructor(caseEdit, route, formValueService, formErrorService, cdRef, pageValidationService, dialog, caseFieldService, caseEditDataService, loadingService, validPageListCaseFieldsService, multipageComponentStateService, addressService, linkedCasesService) {
10246
10518
  this.caseEdit = caseEdit;
10247
10519
  this.route = route;
10248
10520
  this.formValueService = formValueService;
@@ -10254,7 +10526,27 @@ class CaseEditPageComponent {
10254
10526
  this.caseEditDataService = caseEditDataService;
10255
10527
  this.loadingService = loadingService;
10256
10528
  this.validPageListCaseFieldsService = validPageListCaseFieldsService;
10529
+ this.multipageComponentStateService = multipageComponentStateService;
10257
10530
  this.addressService = addressService;
10531
+ this.linkedCasesService = linkedCasesService;
10532
+ this.multipageComponentStateService.setInstigator(this);
10533
+ }
10534
+ onFinalNext() {
10535
+ this.submit();
10536
+ }
10537
+ onFinalPrevious() {
10538
+ this.cancel();
10539
+ }
10540
+ isAtStart() {
10541
+ return this.multipageComponentStateService.getJourneyCollection()[0]?.journeyPageNumber === this.multipageComponentStateService.getJourneyCollection()[0]?.journeyStartPageNumber;
10542
+ }
10543
+ // This method will be triggered by the next button in the app component
10544
+ nextStep() {
10545
+ this.multipageComponentStateService.next();
10546
+ }
10547
+ // This method will be triggered by the previous button in the app component
10548
+ previousStep() {
10549
+ this.multipageComponentStateService.previous();
10258
10550
  }
10259
10551
  ngOnInit() {
10260
10552
  initDialog();
@@ -10313,6 +10605,7 @@ class CaseEditPageComponent {
10313
10605
  this.dialogRefAfterClosedSub?.unsubscribe();
10314
10606
  this.saveDraftSub?.unsubscribe();
10315
10607
  this.caseFormValidationErrorsSub?.unsubscribe();
10608
+ this.multipageComponentStateService.reset();
10316
10609
  }
10317
10610
  applyValuesChanged(valuesChanged) {
10318
10611
  this.formValuesChanged = valuesChanged;
@@ -10339,6 +10632,7 @@ class CaseEditPageComponent {
10339
10632
  caseEventData.data = caseEventData.event_data;
10340
10633
  this.updateFormData(caseEventData);
10341
10634
  this.previous();
10635
+ this.previousStep();
10342
10636
  CaseEditPageComponent.setFocusToTop();
10343
10637
  }
10344
10638
  // Adding validation message to show it as Error Summary
@@ -10589,6 +10883,9 @@ class CaseEditPageComponent {
10589
10883
  return this.caseEdit.hasPrevious(this.currentPage.id);
10590
10884
  }
10591
10885
  cancel() {
10886
+ if (this.isLinkedCasesJourney()) {
10887
+ this.linkedCasesService.resetLinkedCaseData();
10888
+ }
10592
10889
  if (this.eventTrigger.can_save_draft) {
10593
10890
  if (this.formValuesChanged) {
10594
10891
  const dialogRef = this.dialog.open(SaveOrDiscardDialogComponent, this.dialogConfig);
@@ -10615,6 +10912,7 @@ class CaseEditPageComponent {
10615
10912
  this.caseEdit.cancelled.emit();
10616
10913
  }
10617
10914
  this.caseEditDataService.clearFormValidationErrors();
10915
+ this.multipageComponentStateService.reset();
10618
10916
  }
10619
10917
  submitting() {
10620
10918
  return this.caseEdit.isSubmitting;
@@ -10767,8 +11065,8 @@ class CaseEditPageComponent {
10767
11065
  }
10768
11066
  });
10769
11067
  }
10770
- static ɵfac = function CaseEditPageComponent_Factory(t) { return new (t || CaseEditPageComponent)(i0.ɵɵdirectiveInject(CaseEditComponent), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(FormValueService), i0.ɵɵdirectiveInject(FormErrorService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(PageValidationService), i0.ɵɵdirectiveInject(i1$3.MatLegacyDialog), i0.ɵɵdirectiveInject(CaseFieldService), i0.ɵɵdirectiveInject(CaseEditDataService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(ValidPageListCaseFieldsService), i0.ɵɵdirectiveInject(AddressesService)); };
10771
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditPageComponent, selectors: [["ccd-case-edit-page"]], decls: 12, vars: 11, consts: [["titleBlock", ""], ["idBlock", ""], [4, "ngIf"], [4, "ngIf", "ngIfThen", "ngIfElse"], ["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], [3, "error"], [3, "callbackErrorsContext", "triggerTextContinue", "triggerTextIgnore", "callbackErrorsSubject"], [1, "width-50"], ["class", "form", 3, "formGroup", "submit", 4, "ngIf"], [3, "eventCompletionParams", "eventCanBeCompleted", 4, "ngIf"], ["class", "govuk-heading-l", 4, "ngIf"], [1, "govuk-heading-l"], [1, "govuk-caption-l"], [3, "content"], ["class", "heading-h2", 4, "ngIf"], [1, "heading-h2"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], ["class", "govuk-error-summary__body", 4, "ngFor", "ngForOf"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [1, "validation-error", 3, "click"], [1, "form", 3, "submit", "formGroup"], ["id", "fieldset-case-data"], [2, "display", "none"], ["id", "caseEditForm", 3, "fields", "formGroup", "caseFields", "pageChangeSubject", "valuesChanged", 4, "ngIf"], ["class", "grid-row", 4, "ngIf"], [1, "form-group", "form-group-related"], ["type", "button", 1, "button", "button-secondary", 3, "click", "disabled"], ["type", "submit", 1, "button", 3, "disabled"], [1, "cancel"], ["href", "javascript:void(0)", 3, "click"], ["id", "caseEditForm", 3, "valuesChanged", "fields", "formGroup", "caseFields", "pageChangeSubject"], [1, "grid-row"], [1, "column-two-thirds", "rightBorderSeparator"], ["id", "caseEditForm1", 3, "fields", "formGroup", "caseFields"], [1, "column-one-third"], ["id", "caseEditForm2", 3, "fields", "formGroup", "caseFields"], [3, "eventCanBeCompleted", "eventCompletionParams"]], template: function CaseEditPageComponent_Template(rf, ctx) { if (rf & 1) {
11068
+ static ɵfac = function CaseEditPageComponent_Factory(t) { return new (t || CaseEditPageComponent)(i0.ɵɵdirectiveInject(CaseEditComponent), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(FormValueService), i0.ɵɵdirectiveInject(FormErrorService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(PageValidationService), i0.ɵɵdirectiveInject(i1$3.MatLegacyDialog), i0.ɵɵdirectiveInject(CaseFieldService), i0.ɵɵdirectiveInject(CaseEditDataService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(ValidPageListCaseFieldsService), i0.ɵɵdirectiveInject(MultipageComponentStateService), i0.ɵɵdirectiveInject(AddressesService), i0.ɵɵdirectiveInject(LinkedCasesService)); };
11069
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditPageComponent, selectors: [["ccd-case-edit-page"]], decls: 12, vars: 11, consts: [["titleBlock", ""], ["idBlock", ""], [4, "ngIf"], [4, "ngIf", "ngIfThen", "ngIfElse"], ["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], [3, "error"], [3, "callbackErrorsContext", "triggerTextContinue", "triggerTextIgnore", "callbackErrorsSubject"], [1, "width-50"], ["class", "form", 3, "formGroup", "submit", 4, "ngIf"], [3, "eventCompletionParams", "eventCanBeCompleted", 4, "ngIf"], ["class", "govuk-heading-l", 4, "ngIf"], [1, "govuk-heading-l"], [1, "govuk-caption-l"], [3, "content"], ["class", "heading-h2", 4, "ngIf"], [1, "heading-h2"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], ["class", "govuk-error-summary__body", 4, "ngFor", "ngForOf"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [1, "validation-error", 3, "click"], [1, "form", 3, "submit", "formGroup"], ["id", "fieldset-case-data"], [2, "display", "none"], ["id", "caseEditForm", 3, "fields", "formGroup", "caseFields", "pageChangeSubject", "valuesChanged", 4, "ngIf"], ["class", "grid-row", 4, "ngIf"], [1, "form-group", "form-group-related"], ["class", "button button-secondary", "type", "button", 3, "disabled", "click", 4, "ngIf"], ["type", "submit", 1, "button", 3, "disabled"], [1, "cancel"], ["href", "javascript:void(0)", 3, "click"], ["id", "caseEditForm", 3, "valuesChanged", "fields", "formGroup", "caseFields", "pageChangeSubject"], [1, "grid-row"], [1, "column-two-thirds", "rightBorderSeparator"], ["id", "caseEditForm1", 3, "fields", "formGroup", "caseFields"], [1, "column-one-third"], ["id", "caseEditForm2", 3, "fields", "formGroup", "caseFields"], ["type", "button", 1, "button", "button-secondary", 3, "click", "disabled"], [3, "eventCanBeCompleted", "eventCompletionParams"]], template: function CaseEditPageComponent_Template(rf, ctx) { if (rf & 1) {
10772
11070
  const _r1 = i0.ɵɵgetCurrentView();
10773
11071
  i0.ɵɵtemplate(0, CaseEditPageComponent_ng_container_0_Template, 3, 2, "ng-container", 2)(1, CaseEditPageComponent_div_1_Template, 1, 0, "div", 3)(2, CaseEditPageComponent_ng_template_2_Template, 2, 5, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor)(4, CaseEditPageComponent_ng_template_4_Template, 1, 1, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor)(6, CaseEditPageComponent_div_6_Template, 5, 4, "div", 4);
10774
11072
  i0.ɵɵelement(7, "ccd-case-edit-generic-errors", 5);
@@ -10776,15 +11074,15 @@ class CaseEditPageComponent {
10776
11074
  i0.ɵɵlistener("callbackErrorsContext", function CaseEditPageComponent_Template_ccd_callback_errors_callbackErrorsContext_8_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.callbackErrorsNotify($event)); });
10777
11075
  i0.ɵɵelementEnd();
10778
11076
  i0.ɵɵelementStart(9, "div", 7);
10779
- i0.ɵɵtemplate(10, CaseEditPageComponent_form_10_Template, 17, 16, "form", 8);
11077
+ i0.ɵɵtemplate(10, CaseEditPageComponent_form_10_Template, 14, 11, "form", 8);
10780
11078
  i0.ɵɵelementEnd();
10781
11079
  i0.ɵɵtemplate(11, CaseEditPageComponent_ccd_case_event_completion_11_Template, 1, 1, "ccd-case-event-completion", 9);
10782
11080
  } if (rf & 2) {
10783
- const titleBlock_r8 = i0.ɵɵreference(3);
10784
- const idBlock_r9 = i0.ɵɵreference(5);
11081
+ const titleBlock_r9 = i0.ɵɵreference(3);
11082
+ const idBlock_r10 = i0.ɵɵreference(5);
10785
11083
  i0.ɵɵproperty("ngIf", ctx.currentPage);
10786
11084
  i0.ɵɵadvance();
10787
- i0.ɵɵproperty("ngIf", ctx.getCaseTitle())("ngIfThen", titleBlock_r8)("ngIfElse", idBlock_r9);
11085
+ i0.ɵɵproperty("ngIf", ctx.getCaseTitle())("ngIfThen", titleBlock_r9)("ngIfElse", idBlock_r10);
10788
11086
  i0.ɵɵadvance(5);
10789
11087
  i0.ɵɵproperty("ngIf", ctx.validationErrors.length > 0);
10790
11088
  i0.ɵɵadvance();
@@ -10799,9 +11097,9 @@ class CaseEditPageComponent {
10799
11097
  }
10800
11098
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditPageComponent, [{
10801
11099
  type: Component,
10802
- args: [{ selector: 'ccd-case-edit-page', template: "<ng-container *ngIf=\"currentPage\">\n <h1 *ngIf=\"!currentPage.label\" class=\"govuk-heading-l\">{{eventTrigger.name | rpxTranslate}}</h1>\n <ng-container *ngIf=\"currentPage.label\">\n <span class=\"govuk-caption-l\">{{ eventTrigger.name | rpxTranslate}}</span>\n <h1 class=\"govuk-heading-l\">{{currentPage.label | rpxTranslate}}</h1>\n </ng-container>\n</ng-container>\n\n<!--Case ID or Title -->\n<div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n<ng-template #titleBlock>\n <ccd-markdown [content]=\"getCaseTitle() | ccdCaseTitle: caseFields : editForm.controls['data']\"></ccd-markdown>\n</ng-template>\n<ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n</ng-template>\n\n<!-- Error message summary -->\n<div *ngIf=\"validationErrors.length > 0\" class=\"govuk-error-summary\" aria-labelledby=\"error-summary-title\" role=\"alert\" tabindex=\"-1\" data-module=\"govuk-error-summary\">\n <h2 class=\"govuk-error-summary__title\" id=\"error-summary-title\">\n {{'There is a problem' | rpxTranslate}}\n </h2>\n <div *ngFor=\"let validationError of validationErrors\" class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li>\n <a (click)=\"navigateToErrorElement(validationError.id)\" class=\"validation-error\">\n {{ validationError.message | rpxTranslate: getRpxTranslatePipeArgs(validationError.label | rpxTranslate): null }}\n </a>\n </li>\n </ul>\n </div>\n</div>\n\n<ccd-case-edit-generic-errors [error]=\"caseEdit.error\"></ccd-case-edit-generic-errors>\n\n<ccd-callback-errors\n [triggerTextContinue]=\"triggerTextStart\"\n [triggerTextIgnore]=\"triggerTextIgnoreWarnings\"\n [callbackErrorsSubject]=\"caseEdit.callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\">\n</ccd-callback-errors>\n<div class=\"width-50\">\n <form *ngIf=\"currentPage\" class=\"form\" [formGroup]=\"editForm\" (submit)=\"submit()\">\n <fieldset id=\"fieldset-case-data\">\n <legend style=\"display: none;\"></legend>\n <!-- single column -->\n <ccd-case-edit-form id='caseEditForm' *ngIf=\"!currentPage.isMultiColumn()\" [fields]=\"currentPage.getCol1Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"\n [pageChangeSubject]=\"pageChangeSubject\"\n (valuesChanged)=\"applyValuesChanged($event)\"></ccd-case-edit-form>\n <!-- two columns -->\n <div *ngIf=\"currentPage.isMultiColumn()\" class=\"grid-row\">\n <div class=\"column-two-thirds rightBorderSeparator\">\n <ccd-case-edit-form id='caseEditForm1' [fields]=\"currentPage.getCol1Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"></ccd-case-edit-form>\n </div>\n <div class=\"column-one-third\">\n <ccd-case-edit-form id='caseEditForm2' [fields]=\"currentPage.getCol2Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"></ccd-case-edit-form>\n </div>\n </div>\n </fieldset>\n\n <div class=\"form-group form-group-related\">\n <button class=\"button button-secondary\" type=\"button\" [disabled]=\"!(hasPreviousPage$ | async)\" (click)=\"toPreviousPage()\">\n {{'Previous' | rpxTranslate}}\n </button>\n <button class=\"button\" type=\"submit\" [disabled]=\"submitting()\">{{triggerText | rpxTranslate}}</button>\n </div>\n\n <p class=\"cancel\"><a (click)=\"cancel()\" href=\"javascript:void(0)\">{{getCancelText() | rpxTranslate}}</a></p>\n </form>\n</div>\n\n<ccd-case-event-completion *ngIf=\"caseEdit.isEventCompletionChecksRequired\"\n [eventCompletionParams]=\"caseEdit.eventCompletionParams\"\n (eventCanBeCompleted)=\"onEventCanBeCompleted($event)\">\n</ccd-case-event-completion>\n", styles: [".rightBorderSeparator{border-right-width:4px;border-right-color:#ffcc02;border-right-style:solid}.validation-error{cursor:pointer;text-decoration:underline;color:#d4351c}\n"] }]
10803
- }], () => [{ type: CaseEditComponent }, { type: i1$1.ActivatedRoute }, { type: FormValueService }, { type: FormErrorService }, { type: i0.ChangeDetectorRef }, { type: PageValidationService }, { type: i1$3.MatLegacyDialog }, { type: CaseFieldService }, { type: CaseEditDataService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }, { type: AddressesService }], null); })();
10804
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditPageComponent, { className: "CaseEditPageComponent", filePath: "lib/shared/components/case-editor/case-edit-page/case-edit-page.component.ts", lineNumber: 31 }); })();
11100
+ args: [{ selector: 'ccd-case-edit-page', template: "<ng-container *ngIf=\"currentPage\">\n <h1 *ngIf=\"!currentPage.label\" class=\"govuk-heading-l\">{{eventTrigger.name | rpxTranslate}}</h1>\n <ng-container *ngIf=\"currentPage.label\">\n <span class=\"govuk-caption-l\">{{ eventTrigger.name | rpxTranslate}}</span>\n <h1 class=\"govuk-heading-l\">{{currentPage.label | rpxTranslate}}</h1>\n </ng-container>\n</ng-container>\n\n<!--Case ID or Title -->\n<div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n<ng-template #titleBlock>\n <ccd-markdown [content]=\"getCaseTitle() | ccdCaseTitle: caseFields : editForm.controls['data']\"></ccd-markdown>\n</ng-template>\n<ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n</ng-template>\n\n<!-- Error message summary -->\n<div *ngIf=\"validationErrors.length > 0\" class=\"govuk-error-summary\" aria-labelledby=\"error-summary-title\" role=\"alert\" tabindex=\"-1\" data-module=\"govuk-error-summary\">\n <h2 class=\"govuk-error-summary__title\" id=\"error-summary-title\">\n {{'There is a problem' | rpxTranslate}}\n </h2>\n <div *ngFor=\"let validationError of validationErrors\" class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li>\n <a (click)=\"navigateToErrorElement(validationError.id)\" class=\"validation-error\">\n {{ validationError.message | rpxTranslate: getRpxTranslatePipeArgs(validationError.label | rpxTranslate): null }}\n </a>\n </li>\n </ul>\n </div>\n</div>\n\n<ccd-case-edit-generic-errors [error]=\"caseEdit.error\"></ccd-case-edit-generic-errors>\n\n<ccd-callback-errors\n [triggerTextContinue]=\"triggerTextStart\"\n [triggerTextIgnore]=\"triggerTextIgnoreWarnings\"\n [callbackErrorsSubject]=\"caseEdit.callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\">\n</ccd-callback-errors>\n<div class=\"width-50\">\n <form *ngIf=\"currentPage\" class=\"form\" [formGroup]=\"editForm\" (submit)=\"nextStep()\">\n <fieldset id=\"fieldset-case-data\">\n <legend style=\"display: none;\"></legend>\n <!-- single column -->\n <ccd-case-edit-form id='caseEditForm' *ngIf=\"!currentPage.isMultiColumn()\" [fields]=\"currentPage.getCol1Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"\n [pageChangeSubject]=\"pageChangeSubject\"\n (valuesChanged)=\"applyValuesChanged($event)\"></ccd-case-edit-form>\n <!-- two columns -->\n <div *ngIf=\"currentPage.isMultiColumn()\" class=\"grid-row\">\n <div class=\"column-two-thirds rightBorderSeparator\">\n <ccd-case-edit-form id='caseEditForm1' [fields]=\"currentPage.getCol1Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"></ccd-case-edit-form>\n </div>\n <div class=\"column-one-third\">\n <ccd-case-edit-form id='caseEditForm2' [fields]=\"currentPage.getCol2Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"></ccd-case-edit-form>\n </div>\n </div>\n </fieldset>\n\n <div class=\"form-group form-group-related\">\n <button class=\"button button-secondary\" type=\"button\" (click)=\"toPreviousPage()\" *ngIf=\"!isAtStart()\" [disabled]=\"isAtStart()\">\n {{'Previous' | rpxTranslate}}\n </button>\n <button class=\"button\" type=\"submit\" [disabled]=\"submitting()\">{{triggerText | rpxTranslate}}</button>\n </div>\n\n <p class=\"cancel\"><a (click)=\"cancel()\" href=\"javascript:void(0)\">{{getCancelText() | rpxTranslate}}</a></p>\n </form>\n</div>\n\n<ccd-case-event-completion *ngIf=\"caseEdit.isEventCompletionChecksRequired\"\n [eventCompletionParams]=\"caseEdit.eventCompletionParams\"\n (eventCanBeCompleted)=\"onEventCanBeCompleted($event)\">\n</ccd-case-event-completion>\n", styles: [".rightBorderSeparator{border-right-width:4px;border-right-color:#ffcc02;border-right-style:solid}.validation-error{cursor:pointer;text-decoration:underline;color:#d4351c}\n"] }]
11101
+ }], () => [{ type: CaseEditComponent }, { type: i1$1.ActivatedRoute }, { type: FormValueService }, { type: FormErrorService }, { type: i0.ChangeDetectorRef }, { type: PageValidationService }, { type: i1$3.MatLegacyDialog }, { type: CaseFieldService }, { type: CaseEditDataService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }, { type: MultipageComponentStateService }, { type: AddressesService }, { type: LinkedCasesService }], null); })();
11102
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditPageComponent, { className: "CaseEditPageComponent", filePath: "lib/shared/components/case-editor/case-edit-page/case-edit-page.component.ts", lineNumber: 33 }); })();
10805
11103
 
10806
11104
  class CallbackErrorsContext {
10807
11105
  triggerText;
@@ -10950,7 +11248,7 @@ class CallbackErrorsComponent {
10950
11248
  }] }); })();
10951
11249
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CallbackErrorsComponent, { className: "CallbackErrorsComponent", filePath: "lib/shared/components/error/callback-errors.component.ts", lineNumber: 10 }); })();
10952
11250
 
10953
- const _c0$X = a0 => ["/", "cases", "case-details", a0, "tasks"];
11251
+ const _c0$Z = a0 => ["/", "cases", "case-details", a0, "tasks"];
10954
11252
  class CaseEventCompletionTaskCancelledComponent {
10955
11253
  parentComponent;
10956
11254
  caseId;
@@ -11013,7 +11311,7 @@ class CaseEventCompletionTaskCancelledComponent {
11013
11311
  i0.ɵɵadvance(4);
11014
11312
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(27, 21, "Continue"), " ");
11015
11313
  i0.ɵɵadvance(2);
11016
- i0.ɵɵproperty("routerLink", i0.ɵɵpureFunction1(25, _c0$X, ctx.caseId));
11314
+ i0.ɵɵproperty("routerLink", i0.ɵɵpureFunction1(25, _c0$Z, ctx.caseId));
11017
11315
  i0.ɵɵadvance();
11018
11316
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(30, 23, "Cancel"), " ");
11019
11317
  } }, dependencies: [i1$1.RouterLink, i1.RpxTranslatePipe], encapsulation: 2 });
@@ -11027,7 +11325,7 @@ class CaseEventCompletionTaskCancelledComponent {
11027
11325
  }] }], null); })();
11028
11326
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEventCompletionTaskCancelledComponent, { className: "CaseEventCompletionTaskCancelledComponent", filePath: "lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-cancelled/case-event-completion-task-cancelled.component.ts", lineNumber: 8 }); })();
11029
11327
 
11030
- const _c0$W = a0 => ["/", "cases", "case-details", a0, "tasks"];
11328
+ const _c0$Y = a0 => ["/", "cases", "case-details", a0, "tasks"];
11031
11329
  function CaseEventCompletionTaskReassignedComponent_div_0_Template(rf, ctx) { if (rf & 1) {
11032
11330
  const _r1 = i0.ɵɵgetCurrentView();
11033
11331
  i0.ɵɵelementStart(0, "div", 1)(1, "div", 2)(2, "h2", 3);
@@ -11080,7 +11378,7 @@ function CaseEventCompletionTaskReassignedComponent_div_0_Template(rf, ctx) { if
11080
11378
  i0.ɵɵadvance(4);
11081
11379
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(27, 22, "Continue"), " ");
11082
11380
  i0.ɵɵadvance(2);
11083
- i0.ɵɵproperty("routerLink", i0.ɵɵpureFunction1(26, _c0$W, ctx_r1.caseId));
11381
+ i0.ɵɵproperty("routerLink", i0.ɵɵpureFunction1(26, _c0$Y, ctx_r1.caseId));
11084
11382
  i0.ɵɵadvance();
11085
11383
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(30, 24, "Cancel"), " ");
11086
11384
  } }
@@ -11552,7 +11850,7 @@ class WriteComplexFieldComponent extends AbstractFieldWriteComponent {
11552
11850
  }] }); })();
11553
11851
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(WriteComplexFieldComponent, { className: "WriteComplexFieldComponent", filePath: "lib/shared/components/palette/complex/write-complex-field.component.ts", lineNumber: 21 }); })();
11554
11852
 
11555
- const _c0$V = ["writeComplexFieldComponent"];
11853
+ const _c0$X = ["writeComplexFieldComponent"];
11556
11854
  const _c1$o = a0 => ({ "form-group-error": a0 });
11557
11855
  const _c2$3 = a0 => ({ "govuk-input--error": a0 });
11558
11856
  function WriteAddressFieldComponent_div_1_div_4_span_5_Template(rf, ctx) { if (rf & 1) {
@@ -11794,7 +12092,7 @@ class WriteAddressFieldComponent extends AbstractFieldWriteComponent {
11794
12092
  }
11795
12093
  static ɵfac = function WriteAddressFieldComponent_Factory(t) { return new (t || WriteAddressFieldComponent)(i0.ɵɵdirectiveInject(AddressesService), i0.ɵɵdirectiveInject(IsCompoundPipe)); };
11796
12094
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: WriteAddressFieldComponent, selectors: [["ccd-write-address-field"]], viewQuery: function WriteAddressFieldComponent_Query(rf, ctx) { if (rf & 1) {
11797
- i0.ɵɵviewQuery(_c0$V, 5);
12095
+ i0.ɵɵviewQuery(_c0$X, 5);
11798
12096
  i0.ɵɵviewQuery(FocusElementDirective, 5);
11799
12097
  } if (rf & 2) {
11800
12098
  let _t;
@@ -11857,6 +12155,171 @@ class AbstractFieldReadComponent extends AbstractFormFieldComponent {
11857
12155
  type: Input
11858
12156
  }] }); })();
11859
12157
 
12158
+ const _c0$W = ["journeyChild"];
12159
+ class AbstractFieldWriteJourneyComponent extends AbstractFieldWriteComponent {
12160
+ multipageComponentStateService;
12161
+ journeyStartPageNumber = 0;
12162
+ journeyEndPageNumber = 0;
12163
+ journeyPageNumber = 0;
12164
+ journeyPreviousPageNumber = 0;
12165
+ journeyId = 'journey';
12166
+ // todo...
12167
+ childJourney;
12168
+ constructor(multipageComponentStateService) {
12169
+ super();
12170
+ this.multipageComponentStateService = multipageComponentStateService;
12171
+ this.multipageComponentStateService.addTojourneyCollection(this);
12172
+ this.journeyPageNumber = this.journeyStartPageNumber;
12173
+ }
12174
+ next() {
12175
+ if (!this.hasNext()) {
12176
+ return;
12177
+ }
12178
+ this.childJourney.next();
12179
+ }
12180
+ previous() {
12181
+ if (!this.hasPrevious()) {
12182
+ return;
12183
+ }
12184
+ if (this.childJourney['cachedFlagType'] && this.childJourney['subJourneyIndex'] !== 0) {
12185
+ this.childJourney.previous();
12186
+ }
12187
+ else {
12188
+ this.previousPage();
12189
+ }
12190
+ }
12191
+ previousPage() {
12192
+ if (this.hasPrevious()) {
12193
+ this.journeyPageNumber--;
12194
+ this.onPageChange();
12195
+ }
12196
+ }
12197
+ nextPage() {
12198
+ if (this.hasNext()) {
12199
+ this.journeyPageNumber++;
12200
+ this.onPageChange();
12201
+ }
12202
+ }
12203
+ ngOnInit() {
12204
+ this.journeyPageNumber = this.journeyStartPageNumber;
12205
+ const state = this.multipageComponentStateService.getJourneyState(this);
12206
+ if (state) {
12207
+ const { journeyPageNumber, journeyStartPageNumber, journeyEndPageNumber } = state;
12208
+ this.journeyPageNumber = journeyPageNumber;
12209
+ this.journeyStartPageNumber = journeyStartPageNumber;
12210
+ this.journeyEndPageNumber = journeyEndPageNumber;
12211
+ }
12212
+ }
12213
+ ngOnDestroy() {
12214
+ this.multipageComponentStateService.setJourneyState(this);
12215
+ }
12216
+ hasNext() { return this.journeyPageNumber < this.journeyEndPageNumber; }
12217
+ ;
12218
+ hasPrevious() { return this.journeyPageNumber > this.journeyStartPageNumber; }
12219
+ ;
12220
+ isFinished() { return this.journeyPageNumber === this.journeyEndPageNumber; }
12221
+ ;
12222
+ isStart() { return this.journeyPageNumber === this.journeyStartPageNumber; }
12223
+ ;
12224
+ getId() { return this.journeyId; }
12225
+ ;
12226
+ onPageChange() { }
12227
+ ;
12228
+ static ɵfac = function AbstractFieldWriteJourneyComponent_Factory(t) { return new (t || AbstractFieldWriteJourneyComponent)(i0.ɵɵdirectiveInject(MultipageComponentStateService)); };
12229
+ static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: AbstractFieldWriteJourneyComponent, viewQuery: function AbstractFieldWriteJourneyComponent_Query(rf, ctx) { if (rf & 1) {
12230
+ i0.ɵɵviewQuery(_c0$W, 5);
12231
+ } if (rf & 2) {
12232
+ let _t;
12233
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.childJourney = _t.first);
12234
+ } }, inputs: { journeyId: "journeyId" }, features: [i0.ɵɵInheritDefinitionFeature] });
12235
+ }
12236
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AbstractFieldWriteJourneyComponent, [{
12237
+ type: Directive
12238
+ }], () => [{ type: MultipageComponentStateService }], { journeyId: [{
12239
+ type: Input
12240
+ }], childJourney: [{
12241
+ type: ViewChild,
12242
+ args: ['journeyChild']
12243
+ }] }); })();
12244
+
12245
+ const _c0$V = ["journeyChild"];
12246
+ class AbstractJourneyComponent {
12247
+ multipageComponentStateService;
12248
+ journeyStartPageNumber = 0;
12249
+ journeyEndPageNumber = 0;
12250
+ journeyPageNumber = 0;
12251
+ journeyPreviousPageNumber;
12252
+ journeyId = 'journey';
12253
+ // todo...
12254
+ childJourney;
12255
+ constructor(multipageComponentStateService) {
12256
+ this.multipageComponentStateService = multipageComponentStateService;
12257
+ this.multipageComponentStateService.addTojourneyCollection(this);
12258
+ this.journeyPageNumber = this.journeyStartPageNumber;
12259
+ }
12260
+ next() {
12261
+ if (!this.hasNext()) {
12262
+ return;
12263
+ }
12264
+ this.childJourney.next();
12265
+ }
12266
+ previous() {
12267
+ if (!this.hasPrevious()) {
12268
+ return;
12269
+ }
12270
+ this.previousPage();
12271
+ }
12272
+ previousPage() {
12273
+ if (this.hasPrevious()) {
12274
+ this.journeyPageNumber--;
12275
+ }
12276
+ }
12277
+ ngOnInit() {
12278
+ this.journeyPageNumber = this.journeyStartPageNumber;
12279
+ const state = this.multipageComponentStateService.getJourneyState(this);
12280
+ if (state) {
12281
+ const { journeyPageNumber, journeyStartPageNumber, journeyEndPageNumber } = state;
12282
+ this.journeyPageNumber = journeyPageNumber;
12283
+ this.journeyStartPageNumber = journeyStartPageNumber;
12284
+ this.journeyEndPageNumber = journeyEndPageNumber;
12285
+ }
12286
+ }
12287
+ ngOnDestroy() {
12288
+ this.multipageComponentStateService.setJourneyState(this);
12289
+ }
12290
+ hasNext() {
12291
+ return this.journeyPageNumber < this.journeyEndPageNumber;
12292
+ }
12293
+ hasPrevious() {
12294
+ return this.journeyPageNumber > this.journeyStartPageNumber;
12295
+ }
12296
+ isFinished() {
12297
+ return this.journeyPageNumber === this.journeyEndPageNumber;
12298
+ }
12299
+ isStart() {
12300
+ return this.journeyPageNumber === this.journeyStartPageNumber;
12301
+ }
12302
+ getId() {
12303
+ return this.journeyId;
12304
+ }
12305
+ onPageChange() { }
12306
+ static ɵfac = function AbstractJourneyComponent_Factory(t) { return new (t || AbstractJourneyComponent)(i0.ɵɵdirectiveInject(MultipageComponentStateService)); };
12307
+ static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: AbstractJourneyComponent, viewQuery: function AbstractJourneyComponent_Query(rf, ctx) { if (rf & 1) {
12308
+ i0.ɵɵviewQuery(_c0$V, 5);
12309
+ } if (rf & 2) {
12310
+ let _t;
12311
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.childJourney = _t.first);
12312
+ } }, inputs: { journeyId: "journeyId" } });
12313
+ }
12314
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AbstractJourneyComponent, [{
12315
+ type: Directive
12316
+ }], () => [{ type: MultipageComponentStateService }], { journeyId: [{
12317
+ type: Input
12318
+ }], childJourney: [{
12319
+ type: ViewChild,
12320
+ args: ['journeyChild']
12321
+ }] }); })();
12322
+
11860
12323
  var DisplayContextParameter;
11861
12324
  (function (DisplayContextParameter) {
11862
12325
  DisplayContextParameter["Read"] = "READ";
@@ -12059,10 +12522,12 @@ class CaseFlagStateService {
12059
12522
  formGroup = new FormGroup({});
12060
12523
  pageLocation;
12061
12524
  fieldStateToNavigate;
12525
+ lastPageFieldState;
12062
12526
  resetCache(pageLocation) {
12063
12527
  this.formGroup = new FormGroup({});
12064
12528
  this.fieldStateToNavigate = undefined;
12065
12529
  this.pageLocation = pageLocation;
12530
+ this.lastPageFieldState = 0;
12066
12531
  }
12067
12532
  static ɵfac = function CaseFlagStateService_Factory(t) { return new (t || CaseFlagStateService)(); };
12068
12533
  static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CaseFlagStateService, factory: CaseFlagStateService.ɵfac });
@@ -12316,7 +12781,7 @@ class ReadCaseFlagFieldComponent extends AbstractFieldReadComponent {
12316
12781
 
12317
12782
  function WriteCaseFlagFieldComponent_div_0_div_4_Template(rf, ctx) { if (rf & 1) {
12318
12783
  const _r1 = i0.ɵɵgetCurrentView();
12319
- i0.ɵɵelementStart(0, "div", 5)(1, "ul", 6)(2, "li")(3, "a", 7);
12784
+ i0.ɵɵelementStart(0, "div", 6)(1, "ul", 7)(2, "li")(3, "a", 8);
12320
12785
  i0.ɵɵlistener("click", function WriteCaseFlagFieldComponent_div_0_div_4_Template_a_click_3_listener() { const errorMessage_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.navigateToErrorElement(errorMessage_r2.fieldId)); });
12321
12786
  i0.ɵɵtext(4);
12322
12787
  i0.ɵɵpipe(5, "rpxTranslate");
@@ -12327,11 +12792,11 @@ function WriteCaseFlagFieldComponent_div_0_div_4_Template(rf, ctx) { if (rf & 1)
12327
12792
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(5, 1, errorMessage_r2.description));
12328
12793
  } }
12329
12794
  function WriteCaseFlagFieldComponent_div_0_Template(rf, ctx) { if (rf & 1) {
12330
- i0.ɵɵelementStart(0, "div", 2)(1, "h2", 3);
12795
+ i0.ɵɵelementStart(0, "div", 3)(1, "h2", 4);
12331
12796
  i0.ɵɵtext(2);
12332
12797
  i0.ɵɵpipe(3, "rpxTranslate");
12333
12798
  i0.ɵɵelementEnd();
12334
- i0.ɵɵtemplate(4, WriteCaseFlagFieldComponent_div_0_div_4_Template, 6, 3, "div", 4);
12799
+ i0.ɵɵtemplate(4, WriteCaseFlagFieldComponent_div_0_div_4_Template, 6, 3, "div", 5);
12335
12800
  i0.ɵɵelementEnd();
12336
12801
  } if (rf & 2) {
12337
12802
  const ctx_r2 = i0.ɵɵnextContext();
@@ -12343,7 +12808,7 @@ function WriteCaseFlagFieldComponent_div_0_Template(rf, ctx) { if (rf & 1) {
12343
12808
  function WriteCaseFlagFieldComponent_div_1_ng_container_2_Template(rf, ctx) { if (rf & 1) {
12344
12809
  const _r4 = i0.ɵɵgetCurrentView();
12345
12810
  i0.ɵɵelementContainerStart(0);
12346
- i0.ɵɵelementStart(1, "ccd-select-flag-location", 11);
12811
+ i0.ɵɵelementStart(1, "ccd-select-flag-location", 12, 0);
12347
12812
  i0.ɵɵlistener("caseFlagStateEmitter", function WriteCaseFlagFieldComponent_div_1_ng_container_2_Template_ccd_select_flag_location_caseFlagStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.onCaseFlagStateEmitted($event)); });
12348
12813
  i0.ɵɵelementEnd();
12349
12814
  i0.ɵɵelementContainerEnd();
@@ -12355,7 +12820,7 @@ function WriteCaseFlagFieldComponent_div_1_ng_container_2_Template(rf, ctx) { if
12355
12820
  function WriteCaseFlagFieldComponent_div_1_ng_container_3_Template(rf, ctx) { if (rf & 1) {
12356
12821
  const _r5 = i0.ɵɵgetCurrentView();
12357
12822
  i0.ɵɵelementContainerStart(0);
12358
- i0.ɵɵelementStart(1, "ccd-select-flag-type", 12);
12823
+ i0.ɵɵelementStart(1, "ccd-select-flag-type", 13, 0);
12359
12824
  i0.ɵɵlistener("caseFlagStateEmitter", function WriteCaseFlagFieldComponent_div_1_ng_container_3_Template_ccd_select_flag_type_caseFlagStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.onCaseFlagStateEmitted($event)); })("flagCommentsOptionalEmitter", function WriteCaseFlagFieldComponent_div_1_ng_container_3_Template_ccd_select_flag_type_flagCommentsOptionalEmitter_1_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.onFlagCommentsOptionalEmitted($event)); });
12360
12825
  i0.ɵɵelementEnd();
12361
12826
  i0.ɵɵelementContainerEnd();
@@ -12367,7 +12832,7 @@ function WriteCaseFlagFieldComponent_div_1_ng_container_3_Template(rf, ctx) { if
12367
12832
  function WriteCaseFlagFieldComponent_div_1_ng_container_4_Template(rf, ctx) { if (rf & 1) {
12368
12833
  const _r6 = i0.ɵɵgetCurrentView();
12369
12834
  i0.ɵɵelementContainerStart(0);
12370
- i0.ɵɵelementStart(1, "ccd-search-language-interpreter", 13);
12835
+ i0.ɵɵelementStart(1, "ccd-search-language-interpreter", 14, 0);
12371
12836
  i0.ɵɵlistener("caseFlagStateEmitter", function WriteCaseFlagFieldComponent_div_1_ng_container_4_Template_ccd_search_language_interpreter_caseFlagStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.onCaseFlagStateEmitted($event)); });
12372
12837
  i0.ɵɵelementEnd();
12373
12838
  i0.ɵɵelementContainerEnd();
@@ -12379,7 +12844,7 @@ function WriteCaseFlagFieldComponent_div_1_ng_container_4_Template(rf, ctx) { if
12379
12844
  function WriteCaseFlagFieldComponent_div_1_ng_container_5_Template(rf, ctx) { if (rf & 1) {
12380
12845
  const _r7 = i0.ɵɵgetCurrentView();
12381
12846
  i0.ɵɵelementContainerStart(0);
12382
- i0.ɵɵelementStart(1, "ccd-add-comments", 14);
12847
+ i0.ɵɵelementStart(1, "ccd-add-comments", 15, 0);
12383
12848
  i0.ɵɵlistener("caseFlagStateEmitter", function WriteCaseFlagFieldComponent_div_1_ng_container_5_Template_ccd_add_comments_caseFlagStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r7); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.onCaseFlagStateEmitted($event)); });
12384
12849
  i0.ɵɵelementEnd();
12385
12850
  i0.ɵɵelementContainerEnd();
@@ -12391,7 +12856,7 @@ function WriteCaseFlagFieldComponent_div_1_ng_container_5_Template(rf, ctx) { if
12391
12856
  function WriteCaseFlagFieldComponent_div_1_ng_container_6_Template(rf, ctx) { if (rf & 1) {
12392
12857
  const _r8 = i0.ɵɵgetCurrentView();
12393
12858
  i0.ɵɵelementContainerStart(0);
12394
- i0.ɵɵelementStart(1, "ccd-confirm-flag-status", 15);
12859
+ i0.ɵɵelementStart(1, "ccd-confirm-flag-status", 16, 0);
12395
12860
  i0.ɵɵlistener("caseFlagStateEmitter", function WriteCaseFlagFieldComponent_div_1_ng_container_6_Template_ccd_confirm_flag_status_caseFlagStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r8); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.onCaseFlagStateEmitted($event)); });
12396
12861
  i0.ɵɵelementEnd();
12397
12862
  i0.ɵɵelementContainerEnd();
@@ -12401,8 +12866,8 @@ function WriteCaseFlagFieldComponent_div_1_ng_container_6_Template(rf, ctx) { if
12401
12866
  i0.ɵɵproperty("formGroup", ctx_r2.caseFlagParentFormGroup)("defaultStatus", ctx_r2.flagType.defaultStatus);
12402
12867
  } }
12403
12868
  function WriteCaseFlagFieldComponent_div_1_Template(rf, ctx) { if (rf & 1) {
12404
- i0.ɵɵelementStart(0, "div", 8)(1, "div", 9);
12405
- i0.ɵɵtemplate(2, WriteCaseFlagFieldComponent_div_1_ng_container_2_Template, 2, 3, "ng-container", 10)(3, WriteCaseFlagFieldComponent_div_1_ng_container_3_Template, 2, 7, "ng-container", 10)(4, WriteCaseFlagFieldComponent_div_1_ng_container_4_Template, 2, 2, "ng-container", 10)(5, WriteCaseFlagFieldComponent_div_1_ng_container_5_Template, 2, 4, "ng-container", 10)(6, WriteCaseFlagFieldComponent_div_1_ng_container_6_Template, 2, 2, "ng-container", 10);
12869
+ i0.ɵɵelementStart(0, "div", 9)(1, "div", 10);
12870
+ i0.ɵɵtemplate(2, WriteCaseFlagFieldComponent_div_1_ng_container_2_Template, 3, 3, "ng-container", 11)(3, WriteCaseFlagFieldComponent_div_1_ng_container_3_Template, 3, 7, "ng-container", 11)(4, WriteCaseFlagFieldComponent_div_1_ng_container_4_Template, 3, 2, "ng-container", 11)(5, WriteCaseFlagFieldComponent_div_1_ng_container_5_Template, 3, 4, "ng-container", 11)(6, WriteCaseFlagFieldComponent_div_1_ng_container_6_Template, 3, 2, "ng-container", 11);
12406
12871
  i0.ɵɵelementEnd()();
12407
12872
  } if (rf & 2) {
12408
12873
  const ctx_r2 = i0.ɵɵnextContext();
@@ -12423,7 +12888,7 @@ function WriteCaseFlagFieldComponent_div_1_Template(rf, ctx) { if (rf & 1) {
12423
12888
  function WriteCaseFlagFieldComponent_div_2_ng_container_2_Template(rf, ctx) { if (rf & 1) {
12424
12889
  const _r9 = i0.ɵɵgetCurrentView();
12425
12890
  i0.ɵɵelementContainerStart(0);
12426
- i0.ɵɵelementStart(1, "ccd-manage-case-flags", 16);
12891
+ i0.ɵɵelementStart(1, "ccd-manage-case-flags", 17, 0);
12427
12892
  i0.ɵɵlistener("caseFlagStateEmitter", function WriteCaseFlagFieldComponent_div_2_ng_container_2_Template_ccd_manage_case_flags_caseFlagStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r9); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.onCaseFlagStateEmitted($event)); });
12428
12893
  i0.ɵɵelementEnd();
12429
12894
  i0.ɵɵelementContainerEnd();
@@ -12435,7 +12900,7 @@ function WriteCaseFlagFieldComponent_div_2_ng_container_2_Template(rf, ctx) { if
12435
12900
  function WriteCaseFlagFieldComponent_div_2_ng_container_3_Template(rf, ctx) { if (rf & 1) {
12436
12901
  const _r10 = i0.ɵɵgetCurrentView();
12437
12902
  i0.ɵɵelementContainerStart(0);
12438
- i0.ɵɵelementStart(1, "ccd-update-flag", 17);
12903
+ i0.ɵɵelementStart(1, "ccd-update-flag", 18, 0);
12439
12904
  i0.ɵɵlistener("caseFlagStateEmitter", function WriteCaseFlagFieldComponent_div_2_ng_container_3_Template_ccd_update_flag_caseFlagStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r10); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.onCaseFlagStateEmitted($event)); });
12440
12905
  i0.ɵɵelementEnd();
12441
12906
  i0.ɵɵelementContainerEnd();
@@ -12447,7 +12912,7 @@ function WriteCaseFlagFieldComponent_div_2_ng_container_3_Template(rf, ctx) { if
12447
12912
  function WriteCaseFlagFieldComponent_div_2_ng_container_4_Template(rf, ctx) { if (rf & 1) {
12448
12913
  const _r11 = i0.ɵɵgetCurrentView();
12449
12914
  i0.ɵɵelementContainerStart(0);
12450
- i0.ɵɵelementStart(1, "ccd-update-flag-add-translation-form", 18);
12915
+ i0.ɵɵelementStart(1, "ccd-update-flag-add-translation-form", 19, 0);
12451
12916
  i0.ɵɵlistener("caseFlagStateEmitter", function WriteCaseFlagFieldComponent_div_2_ng_container_4_Template_ccd_update_flag_add_translation_form_caseFlagStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r11); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.onCaseFlagStateEmitted($event)); });
12452
12917
  i0.ɵɵelementEnd();
12453
12918
  i0.ɵɵelementContainerEnd();
@@ -12457,8 +12922,8 @@ function WriteCaseFlagFieldComponent_div_2_ng_container_4_Template(rf, ctx) { if
12457
12922
  i0.ɵɵproperty("formGroup", ctx_r2.caseFlagParentFormGroup);
12458
12923
  } }
12459
12924
  function WriteCaseFlagFieldComponent_div_2_Template(rf, ctx) { if (rf & 1) {
12460
- i0.ɵɵelementStart(0, "div", 8)(1, "div", 9);
12461
- i0.ɵɵtemplate(2, WriteCaseFlagFieldComponent_div_2_ng_container_2_Template, 2, 4, "ng-container", 10)(3, WriteCaseFlagFieldComponent_div_2_ng_container_3_Template, 2, 2, "ng-container", 10)(4, WriteCaseFlagFieldComponent_div_2_ng_container_4_Template, 2, 1, "ng-container", 10);
12925
+ i0.ɵɵelementStart(0, "div", 9)(1, "div", 10);
12926
+ i0.ɵɵtemplate(2, WriteCaseFlagFieldComponent_div_2_ng_container_2_Template, 3, 4, "ng-container", 11)(3, WriteCaseFlagFieldComponent_div_2_ng_container_3_Template, 3, 2, "ng-container", 11)(4, WriteCaseFlagFieldComponent_div_2_ng_container_4_Template, 3, 1, "ng-container", 11);
12462
12927
  i0.ɵɵelementEnd()();
12463
12928
  } if (rf & 2) {
12464
12929
  const ctx_r2 = i0.ɵɵnextContext();
@@ -12472,11 +12937,12 @@ function WriteCaseFlagFieldComponent_div_2_Template(rf, ctx) { if (rf & 1) {
12472
12937
  i0.ɵɵadvance();
12473
12938
  i0.ɵɵproperty("ngSwitchCase", ctx_r2.caseFlagFieldState.FLAG_UPDATE_WELSH_TRANSLATION);
12474
12939
  } }
12475
- class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
12940
+ class WriteCaseFlagFieldComponent extends AbstractFieldWriteJourneyComponent {
12476
12941
  route;
12477
12942
  caseEditDataService;
12478
12943
  caseFlagStateService;
12479
12944
  rpxTranslationService;
12945
+ //public formGroup: FormGroup;
12480
12946
  fieldState;
12481
12947
  caseFlagFieldState = CaseFlagFieldState;
12482
12948
  errorMessages = [];
@@ -12495,6 +12961,7 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
12495
12961
  displayContextParameter;
12496
12962
  determinedLocation;
12497
12963
  allCaseFlagStagesCompleted = false;
12964
+ navigatedTo = false;
12498
12965
  // Code for "Other" flag type as defined in Reference Data
12499
12966
  otherFlagTypeCode = 'OT0001';
12500
12967
  selectedManageCaseLocation = 'selectedManageCaseLocation';
@@ -12510,8 +12977,8 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
12510
12977
  this.caseFlagParentFormGroup.value.selectedLocation = selectedLocation;
12511
12978
  }
12512
12979
  }
12513
- constructor(route, caseEditDataService, caseFlagStateService, rpxTranslationService) {
12514
- super();
12980
+ constructor(route, caseEditDataService, caseFlagStateService, rpxTranslationService, multipageComponentStateService) {
12981
+ super(multipageComponentStateService);
12515
12982
  this.route = route;
12516
12983
  this.caseEditDataService = caseEditDataService;
12517
12984
  this.caseFlagStateService = caseFlagStateService;
@@ -12521,13 +12988,14 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
12521
12988
  // If it is start of the journey or navigation from check your answers page then fieldStateToNavigate property
12522
12989
  // in case flag state service will contain the field state to navigate based on create or manage journey
12523
12990
  this.fieldState = this.caseFlagStateService.fieldStateToNavigate;
12524
- if (this.fieldState === undefined ||
12525
- this.fieldState === CaseFlagFieldState.FLAG_LOCATION ||
12526
- this.fieldState === CaseFlagFieldState.FLAG_MANAGE_CASE_FLAGS) {
12991
+ if (this.fieldState === undefined) {
12527
12992
  const params = this.route.snapshot.params;
12528
12993
  // Clear the form group, field state to navigate and set the page location
12529
12994
  this.caseFlagStateService.resetCache(`../${params['eid']}/${params['page']}`);
12530
12995
  }
12996
+ else {
12997
+ this.navigatedTo = true;
12998
+ }
12531
12999
  // Reassign the form group from the case flag state service
12532
13000
  this.caseFlagParentFormGroup = this.caseFlagStateService.formGroup;
12533
13001
  // Clear form validation errors as a new page will be rendered based on field state
@@ -12566,11 +13034,14 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
12566
13034
  this.hmctsServiceId = this.route.snapshot.data.eventTrigger.supplementary_data.HMCTSServiceId;
12567
13035
  }
12568
13036
  if (this.route.snapshot.data.eventTrigger.case_fields) {
12569
- this.flagsData = (this.route.snapshot.data.eventTrigger.case_fields)
13037
+ // there is an edge case in the navigation when going back, sometimes the case_fileds will lose values in the values which causes the flow to break before CYA
13038
+ // below funciton ensures all data is correctly set.
13039
+ const flagData = this.validateCaseFields(this.route.snapshot.data.eventTrigger.case_fields);
13040
+ this.flagsData = (flagData)
12570
13041
  .reduce((flags, caseField) => FieldsUtils.extractFlagsDataFromCaseField(flags, caseField, caseField.id, caseField), []);
12571
13042
  // Set displayContextParameter (to be passed as an input to ManageCaseFlagsComponent for setting correct title)
12572
13043
  this.displayContextParameter =
12573
- this.setDisplayContextParameter(this.route.snapshot.data.eventTrigger.case_fields);
13044
+ this.setDisplayContextParameter(flagData);
12574
13045
  // Set boolean indicating the display_context_parameter is "update"
12575
13046
  this.isDisplayContextParameterUpdate = this.setDisplayContextParameterUpdate(this.displayContextParameter);
12576
13047
  // Set boolean indicating the display_context_parameter is "external"
@@ -12589,6 +13060,57 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
12589
13060
  });
12590
13061
  }
12591
13062
  }
13063
+ // CSFD-16.
13064
+ // Setup the page number to initially be the same value as
13065
+ // the start page number. Provided that some state exists within
13066
+ // the page state service, use that instaead.
13067
+ //
13068
+ // If isDisplayContextParameterUpdate is true, then the starting page must be
13069
+ // the value of 4. Otherwise, it's 0. However, we're using an enum to simplify
13070
+ // this process.
13071
+ //
13072
+ // It might help to take a look at the template file.
13073
+ if (this.isDisplayContextParameterUpdate) {
13074
+ this.journeyStartPageNumber = CaseFlagFieldState.FLAG_MANAGE_CASE_FLAGS;
13075
+ this.journeyEndPageNumber = CaseFlagFieldState.FLAG_UPDATE_WELSH_TRANSLATION;
13076
+ }
13077
+ else {
13078
+ this.journeyStartPageNumber = CaseFlagFieldState.FLAG_LOCATION;
13079
+ this.journeyEndPageNumber = CaseFlagFieldState.FLAG_STATUS;
13080
+ }
13081
+ // Now that we've set the start page number, let's set the current page number.
13082
+ this.journeyPageNumber = this.journeyStartPageNumber;
13083
+ // If we've navigated to this page, then we know by default, we want to set the
13084
+ // journey page number to the field state.
13085
+ if (this.navigatedTo) {
13086
+ this.journeyPageNumber = this.fieldState;
13087
+ this.journeyPreviousPageNumber = this.journeyEndPageNumber++;
13088
+ }
13089
+ // Provided we have some stored state, i.e. when going backwards, we want
13090
+ // to get the last visited page, etc.
13091
+ const state = this.multipageComponentStateService.getJourneyState(this);
13092
+ if (state) {
13093
+ const { journeyPageNumber, journeyStartPageNumber, journeyEndPageNumber } = state;
13094
+ this.journeyPageNumber = journeyPageNumber;
13095
+ this.journeyStartPageNumber = journeyStartPageNumber;
13096
+ this.journeyEndPageNumber = journeyEndPageNumber;
13097
+ }
13098
+ this.multipageComponentStateService.isAtStart = this.journeyPageNumber === this.journeyStartPageNumber;
13099
+ }
13100
+ validateCaseFields(caseFields) {
13101
+ caseFields.forEach((field) => {
13102
+ if (field.formatted_value) {
13103
+ Object.keys(field.formatted_value).forEach((valueKey) => {
13104
+ if (field.formatted_value[valueKey] !== field.value[valueKey]) {
13105
+ field.value[valueKey] = field.formatted_value[valueKey];
13106
+ }
13107
+ });
13108
+ }
13109
+ });
13110
+ return caseFields;
13111
+ }
13112
+ onPageChange() {
13113
+ this.multipageComponentStateService.isAtStart = this.fieldState === this.caseFlagFieldState.FLAG_LOCATION;
12592
13114
  }
12593
13115
  setDisplayContextParameterUpdate(displayContextParameter) {
12594
13116
  return displayContextParameter === CaseFlagDisplayContextParameter.UPDATE ||
@@ -12644,6 +13166,7 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
12644
13166
  }
12645
13167
  proceedToNextState() {
12646
13168
  if (!this.isAtFinalState()) {
13169
+ this.journeyPreviousPageNumber = this.fieldState;
12647
13170
  // Skip the "language interpreter" state if current state is CaseFlagFieldState.FLAG_TYPE and the flag type doesn't
12648
13171
  // have a "list of values" - currently, this is present only for those flag types that require language interpreter
12649
13172
  // selection
@@ -12653,6 +13176,7 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
12653
13176
  else {
12654
13177
  this.fieldState++;
12655
13178
  }
13179
+ this.nextPage();
12656
13180
  }
12657
13181
  }
12658
13182
  setFlagsCaseFieldValue() {
@@ -12671,6 +13195,18 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
12671
13195
  break;
12672
13196
  }
12673
13197
  }
13198
+ previousPage() {
13199
+ // if we are navigating away from the page, we should set the error messages to empty so the message dissapears
13200
+ this.errorMessages = [];
13201
+ this.journeyPreviousPageNumber = this.fieldState;
13202
+ if (this.hasPrevious() && this.fieldState === CaseFlagFieldState.FLAG_COMMENTS && !this.flagType?.listOfValues) {
13203
+ this.fieldState = CaseFlagFieldState.FLAG_TYPE;
13204
+ }
13205
+ else if (this.hasPrevious()) {
13206
+ this.fieldState--;
13207
+ }
13208
+ super.previousPage();
13209
+ }
12674
13210
  addFlagToCollection() {
12675
13211
  // Ensure no more than one new flag is being added at a time, by iterating through each Flags case field and removing
12676
13212
  // any previous entry from the details array where that entry has no id (hence it is new - and there should be only
@@ -12955,6 +13491,7 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
12955
13491
  };
12956
13492
  }
12957
13493
  moveToFinalReviewStage() {
13494
+ this.caseFlagStateService.lastPageFieldState = this.fieldState;
12958
13495
  this.setFlagsCaseFieldValue();
12959
13496
  // Check that no errors have been set on caseFlagParentFormGroup (by determineLocationForFlag()); prevent moving to
12960
13497
  // final review stage if errors exist
@@ -12969,6 +13506,7 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
12969
13506
  }
12970
13507
  }
12971
13508
  ngOnDestroy() {
13509
+ this.multipageComponentStateService.setJourneyState(this);
12972
13510
  // Reset the fieldstateToNavigate as the write journey completes at this point
12973
13511
  this.caseFlagStateService.fieldStateToNavigate = undefined;
12974
13512
  this.caseTitleSubscription?.unsubscribe();
@@ -12980,9 +13518,9 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
12980
13518
  setDisplayContextParameter(caseFields) {
12981
13519
  return caseFields.find(caseField => FieldsUtils.isCaseFieldOfType(caseField, ['FlagLauncher']))?.display_context_parameter;
12982
13520
  }
12983
- static ɵfac = function WriteCaseFlagFieldComponent_Factory(t) { return new (t || WriteCaseFlagFieldComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(CaseEditDataService), i0.ɵɵdirectiveInject(CaseFlagStateService), i0.ɵɵdirectiveInject(i1.RpxTranslationService)); };
12984
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: WriteCaseFlagFieldComponent, selectors: [["ccd-write-case-flag-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 3, vars: 3, consts: [["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], ["class", "form-group", 3, "formGroup", 4, "ngIf"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], ["class", "govuk-error-summary__body", 4, "ngFor", "ngForOf"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [1, "validation-error", 3, "click"], [1, "form-group", 3, "formGroup"], [1, "govuk-form-group", 3, "ngSwitch"], [4, "ngSwitchCase"], [3, "caseFlagStateEmitter", "formGroup", "flagsData", "isDisplayContextParameterExternal"], [3, "caseFlagStateEmitter", "flagCommentsOptionalEmitter", "formGroup", "jurisdiction", "caseTypeId", "hmctsServiceId", "isDisplayContextParameterExternal", "isDisplayContextParameter2Point1Enabled", "selectedFlagsLocation"], [3, "caseFlagStateEmitter", "formGroup", "flagType"], [3, "caseFlagStateEmitter", "formGroup", "optional", "isDisplayContextParameterExternal", "isDisplayContextParameter2Point1Enabled"], [3, "caseFlagStateEmitter", "formGroup", "defaultStatus"], [3, "caseFlagStateEmitter", "formGroup", "flagsData", "caseTitle", "displayContextParameter"], [3, "caseFlagStateEmitter", "formGroup", "displayContextParameter"], [3, "caseFlagStateEmitter", "formGroup"]], template: function WriteCaseFlagFieldComponent_Template(rf, ctx) { if (rf & 1) {
12985
- i0.ɵɵtemplate(0, WriteCaseFlagFieldComponent_div_0_Template, 5, 4, "div", 0)(1, WriteCaseFlagFieldComponent_div_1_Template, 7, 7, "div", 1)(2, WriteCaseFlagFieldComponent_div_2_Template, 5, 5, "div", 1);
13521
+ static ɵfac = function WriteCaseFlagFieldComponent_Factory(t) { return new (t || WriteCaseFlagFieldComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(CaseEditDataService), i0.ɵɵdirectiveInject(CaseFlagStateService), i0.ɵɵdirectiveInject(i1.RpxTranslationService), i0.ɵɵdirectiveInject(MultipageComponentStateService)); };
13522
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: WriteCaseFlagFieldComponent, selectors: [["ccd-write-case-flag-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 3, vars: 3, consts: [["journeyChild", ""], ["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], ["class", "form-group", 3, "formGroup", 4, "ngIf"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], ["class", "govuk-error-summary__body", 4, "ngFor", "ngForOf"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [1, "validation-error", 3, "click"], [1, "form-group", 3, "formGroup"], [1, "govuk-form-group", 3, "ngSwitch"], [4, "ngSwitchCase"], [3, "caseFlagStateEmitter", "formGroup", "flagsData", "isDisplayContextParameterExternal"], [3, "caseFlagStateEmitter", "flagCommentsOptionalEmitter", "formGroup", "jurisdiction", "caseTypeId", "hmctsServiceId", "isDisplayContextParameterExternal", "isDisplayContextParameter2Point1Enabled", "selectedFlagsLocation"], [3, "caseFlagStateEmitter", "formGroup", "flagType"], [3, "caseFlagStateEmitter", "formGroup", "optional", "isDisplayContextParameterExternal", "isDisplayContextParameter2Point1Enabled"], [3, "caseFlagStateEmitter", "formGroup", "defaultStatus"], [3, "caseFlagStateEmitter", "formGroup", "flagsData", "caseTitle", "displayContextParameter"], [3, "caseFlagStateEmitter", "formGroup", "displayContextParameter"], [3, "caseFlagStateEmitter", "formGroup"]], template: function WriteCaseFlagFieldComponent_Template(rf, ctx) { if (rf & 1) {
13523
+ i0.ɵɵtemplate(0, WriteCaseFlagFieldComponent_div_0_Template, 5, 4, "div", 1)(1, WriteCaseFlagFieldComponent_div_1_Template, 7, 7, "div", 2)(2, WriteCaseFlagFieldComponent_div_2_Template, 5, 5, "div", 2);
12986
13524
  } if (rf & 2) {
12987
13525
  i0.ɵɵproperty("ngIf", ctx.errorMessages.length > 0);
12988
13526
  i0.ɵɵadvance();
@@ -12993,9 +13531,9 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
12993
13531
  }
12994
13532
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WriteCaseFlagFieldComponent, [{
12995
13533
  type: Component,
12996
- args: [{ selector: 'ccd-write-case-flag-field', template: "<!-- Error message summary -->\n<div *ngIf=\"errorMessages.length > 0\" class=\"govuk-error-summary\" aria-labelledby=\"error-summary-title\" role=\"alert\" tabindex=\"-1\" data-module=\"govuk-error-summary\">\n <h2 class=\"govuk-error-summary__title\" id=\"error-summary-title\">\n {{'There is a problem' | rpxTranslate}}\n </h2>\n <div *ngFor=\"let errorMessage of errorMessages\" class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li>\n <a (click)=\"navigateToErrorElement(errorMessage.fieldId)\" class=\"validation-error\">{{errorMessage.description | rpxTranslate}}</a>\n </li>\n </ul>\n </div>\n</div>\n<div *ngIf=\"!isDisplayContextParameterUpdate\" class=\"form-group\" [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngSwitch]=\"fieldState\">\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_LOCATION\">\n <ccd-select-flag-location\n [formGroup]=\"caseFlagParentFormGroup\" [flagsData]=\"flagsData\"\n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\"\n [isDisplayContextParameterExternal]=\"isDisplayContextParameterExternal\"\n ></ccd-select-flag-location>\n </ng-container>\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_TYPE\">\n <ccd-select-flag-type [formGroup]=\"caseFlagParentFormGroup\" [jurisdiction]=\"jurisdiction\" [caseTypeId]=\"caseTypeId\"\n [hmctsServiceId]=\"hmctsServiceId\" [isDisplayContextParameterExternal]=\"isDisplayContextParameterExternal\"\n [isDisplayContextParameter2Point1Enabled]=\"isDisplayContextParameter2Point1Enabled\"\n [selectedFlagsLocation]=\"selectedFlagsLocation\"\n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\"\n (flagCommentsOptionalEmitter)=\"onFlagCommentsOptionalEmitted($event)\"></ccd-select-flag-type>\n </ng-container>\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_LANGUAGE_INTERPRETER\">\n <ccd-search-language-interpreter [formGroup]=\"caseFlagParentFormGroup\"\n [flagType]=\"flagType\"\n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\">\n </ccd-search-language-interpreter>\n </ng-container>\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_COMMENTS\">\n <ccd-add-comments [formGroup]=\"caseFlagParentFormGroup\" [optional]=\"flagCommentsOptional\"\n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\"\n [isDisplayContextParameterExternal]=\"isDisplayContextParameterExternal\"\n [isDisplayContextParameter2Point1Enabled]=\"isDisplayContextParameter2Point1Enabled\">\n </ccd-add-comments>\n </ng-container>\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_STATUS\">\n <ccd-confirm-flag-status [formGroup]=\"caseFlagParentFormGroup\" [defaultStatus]=\"flagType.defaultStatus\"\n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\"></ccd-confirm-flag-status>\n </ng-container>\n </div>\n</div>\n<div *ngIf=\"isDisplayContextParameterUpdate\" class=\"form-group\" [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngSwitch]=\"fieldState\">\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_MANAGE_CASE_FLAGS\">\n <ccd-manage-case-flags [formGroup]=\"caseFlagParentFormGroup\" [flagsData]=\"flagsData\" [caseTitle]=\"caseTitle\"\n [displayContextParameter]=\"displayContextParameter\"\n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\"></ccd-manage-case-flags>\n </ng-container>\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_UPDATE\">\n <ccd-update-flag [formGroup]=\"caseFlagParentFormGroup\"\n [displayContextParameter]=\"displayContextParameter\"\n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\"></ccd-update-flag>\n </ng-container>\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_UPDATE_WELSH_TRANSLATION\">\n <ccd-update-flag-add-translation-form\n [formGroup]=\"caseFlagParentFormGroup\"\n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\"\n ></ccd-update-flag-add-translation-form>\n </ng-container>\n </div>\n</div>\n", styles: [".validation-error{cursor:pointer;text-decoration:underline;color:#d4351c}\n"] }]
12997
- }], () => [{ type: i1$1.ActivatedRoute }, { type: CaseEditDataService }, { type: CaseFlagStateService }, { type: i1.RpxTranslationService }], null); })();
12998
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(WriteCaseFlagFieldComponent, { className: "WriteCaseFlagFieldComponent", filePath: "lib/shared/components/palette/case-flag/write-case-flag-field.component.ts", lineNumber: 20 }); })();
13534
+ args: [{ selector: 'ccd-write-case-flag-field', template: "<!-- Error message summary -->\n<div *ngIf=\"errorMessages.length > 0\" class=\"govuk-error-summary\" aria-labelledby=\"error-summary-title\" role=\"alert\"\n tabindex=\"-1\" data-module=\"govuk-error-summary\">\n <h2 class=\"govuk-error-summary__title\" id=\"error-summary-title\">\n {{'There is a problem' | rpxTranslate}}\n </h2>\n <div *ngFor=\"let errorMessage of errorMessages\" class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li>\n <a (click)=\"navigateToErrorElement(errorMessage.fieldId)\" class=\"validation-error\">{{errorMessage.description |\n rpxTranslate}}</a>\n </li>\n </ul>\n </div>\n</div>\n<div *ngIf=\"!isDisplayContextParameterUpdate\" class=\"form-group\" [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngSwitch]=\"fieldState\">\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_LOCATION\">\n <ccd-select-flag-location \n #journeyChild \n [formGroup]=\"caseFlagParentFormGroup\" \n [flagsData]=\"flagsData\"\n [isDisplayContextParameterExternal]=\"isDisplayContextParameterExternal\"\n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\">\n </ccd-select-flag-location>\n </ng-container>\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_TYPE\">\n <ccd-select-flag-type \n #journeyChild \n [formGroup]=\"caseFlagParentFormGroup\" \n [jurisdiction]=\"jurisdiction\"\n [caseTypeId]=\"caseTypeId\" \n [hmctsServiceId]=\"hmctsServiceId\"\n [isDisplayContextParameterExternal]=\"isDisplayContextParameterExternal\"\n [isDisplayContextParameter2Point1Enabled]=\"isDisplayContextParameter2Point1Enabled\"\n [selectedFlagsLocation]=\"selectedFlagsLocation\" \n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\"\n (flagCommentsOptionalEmitter)=\"onFlagCommentsOptionalEmitted($event)\">\n </ccd-select-flag-type>\n </ng-container>\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_LANGUAGE_INTERPRETER\">\n <ccd-search-language-interpreter \n #journeyChild \n [formGroup]=\"caseFlagParentFormGroup\" \n [flagType]=\"flagType\" \n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\">\n </ccd-search-language-interpreter>\n </ng-container>\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_COMMENTS\">\n <ccd-add-comments \n #journeyChild \n [formGroup]=\"caseFlagParentFormGroup\" \n [optional]=\"flagCommentsOptional\"\n [isDisplayContextParameterExternal]=\"isDisplayContextParameterExternal\"\n [isDisplayContextParameter2Point1Enabled]=\"isDisplayContextParameter2Point1Enabled\"\n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\">\n </ccd-add-comments>\n </ng-container>\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_STATUS\">\n <ccd-confirm-flag-status \n #journeyChild \n [formGroup]=\"caseFlagParentFormGroup\"\n [defaultStatus]=\"flagType.defaultStatus\" \n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\">\n </ccd-confirm-flag-status>\n </ng-container>\n </div>\n</div>\n<div *ngIf=\"isDisplayContextParameterUpdate\" class=\"form-group\" [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngSwitch]=\"fieldState\">\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_MANAGE_CASE_FLAGS\">\n <ccd-manage-case-flags \n #journeyChild \n [formGroup]=\"caseFlagParentFormGroup\" \n [flagsData]=\"flagsData\"\n [caseTitle]=\"caseTitle\" \n [displayContextParameter]=\"displayContextParameter\"\n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\">\n </ccd-manage-case-flags>\n </ng-container>\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_UPDATE\">\n <ccd-update-flag \n #journeyChild \n [formGroup]=\"caseFlagParentFormGroup\"\n [displayContextParameter]=\"displayContextParameter\" \n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\">\n </ccd-update-flag>\n </ng-container>\n <ng-container *ngSwitchCase=\"caseFlagFieldState.FLAG_UPDATE_WELSH_TRANSLATION\">\n <ccd-update-flag-add-translation-form \n #journeyChild \n [formGroup]=\"caseFlagParentFormGroup\"\n (caseFlagStateEmitter)=\"onCaseFlagStateEmitted($event)\">\n </ccd-update-flag-add-translation-form>\n </ng-container>\n </div>\n</div>", styles: [".validation-error{cursor:pointer;text-decoration:underline;color:#d4351c}\n"] }]
13535
+ }], () => [{ type: i1$1.ActivatedRoute }, { type: CaseEditDataService }, { type: CaseFlagStateService }, { type: i1.RpxTranslationService }, { type: MultipageComponentStateService }], null); })();
13536
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(WriteCaseFlagFieldComponent, { className: "WriteCaseFlagFieldComponent", filePath: "lib/shared/components/palette/case-flag/write-case-flag-field.component.ts", lineNumber: 21 }); })();
12999
13537
 
13000
13538
  class CaseReferencePipe {
13001
13539
  transform(caseReference) {
@@ -15733,139 +16271,6 @@ var Patterns;
15733
16271
  Patterns["CASE_REF"] = "((([0-9]{4})(?: |-)?)){4}";
15734
16272
  })(Patterns || (Patterns = {}));
15735
16273
 
15736
- class LinkedCasesService {
15737
- jurisdictionService;
15738
- searchService;
15739
- static CASE_NAME_MISSING_TEXT = 'Case name missing';
15740
- caseFieldValue = [];
15741
- isLinkedCasesEventTrigger = false;
15742
- caseDetails;
15743
- caseId;
15744
- caseName;
15745
- linkCaseReasons = [];
15746
- linkedCases = [];
15747
- initialCaseLinks = [];
15748
- editMode = false;
15749
- jurisdictionsResponse = [];
15750
- serverJurisdictionError;
15751
- serverError = null;
15752
- serverLinkedApiError = null;
15753
- isServerReasonCodeError = false;
15754
- caseJurisdictionID = null;
15755
- constructor(jurisdictionService, searchService) {
15756
- this.jurisdictionService = jurisdictionService;
15757
- this.searchService = searchService;
15758
- this.jurisdictionService.getJurisdictions().subscribe((jurisdictions) => {
15759
- this.jurisdictionsResponse = jurisdictions;
15760
- }, (error) => {
15761
- this.serverJurisdictionError = true;
15762
- });
15763
- }
15764
- groupLinkedCasesByCaseType = (arrObj, key) => {
15765
- return arrObj.reduce((rv, x) => {
15766
- (rv[x.value[key]] = rv[x.value[key]] || []).push(x.value['CaseReference']);
15767
- return rv;
15768
- }, {});
15769
- };
15770
- constructElasticSearchQuery(caseIds, size) {
15771
- return {
15772
- query: {
15773
- terms: {
15774
- reference: caseIds,
15775
- },
15776
- },
15777
- size,
15778
- };
15779
- }
15780
- mapResponse(esSearchCasesResponse) {
15781
- const caseInfo = this.caseFieldValue.find(item => item.value && item.value.CaseReference === esSearchCasesResponse.case_id);
15782
- return caseInfo && {
15783
- caseReference: esSearchCasesResponse.case_id,
15784
- caseName: esSearchCasesResponse.case_fields.caseNameHmctsInternal || LinkedCasesService.CASE_NAME_MISSING_TEXT,
15785
- caseType: this.mapLookupIDToValueFromJurisdictions('CASE_TYPE', esSearchCasesResponse.case_fields['[CASE_TYPE]']),
15786
- service: this.mapLookupIDToValueFromJurisdictions('JURISDICTION', esSearchCasesResponse.case_fields['[JURISDICTION]']),
15787
- state: this.mapLookupIDToValueFromJurisdictions('STATE', esSearchCasesResponse.case_fields['[STATE]']),
15788
- reasons: caseInfo?.value?.ReasonForLink
15789
- };
15790
- }
15791
- searchCasesByCaseIds(searchCasesResponse) {
15792
- return forkJoin(searchCasesResponse);
15793
- }
15794
- getAllLinkedCaseInformation() {
15795
- const searchCasesResponse = [];
15796
- const linkedCaseIds = this.groupLinkedCasesByCaseType(this.caseFieldValue, 'CaseType');
15797
- Object.keys(linkedCaseIds).forEach(key => {
15798
- const esQuery = this.constructElasticSearchQuery(linkedCaseIds[key], 100);
15799
- const query = this.searchService.searchCasesByIds(key, esQuery, SearchService.VIEW_WORKBASKET);
15800
- searchCasesResponse.push(query);
15801
- });
15802
- if (searchCasesResponse.length) {
15803
- this.searchCasesByCaseIds(searchCasesResponse).subscribe((searchCases) => {
15804
- const casesResponse = [];
15805
- searchCases.forEach(response => {
15806
- response.results.forEach((result) => {
15807
- casesResponse.push(this.mapResponse(result));
15808
- });
15809
- });
15810
- this.linkedCases = casesResponse.map(item => {
15811
- return {
15812
- caseReference: item.caseReference,
15813
- caseName: item.caseName,
15814
- caseService: item.service,
15815
- caseType: item.caseType,
15816
- unlink: false,
15817
- reasons: item.reasons && item.reasons.map(reason => {
15818
- return {
15819
- Reason: reason
15820
- };
15821
- }),
15822
- };
15823
- });
15824
- this.serverLinkedApiError = null;
15825
- }, err => {
15826
- this.serverLinkedApiError = {
15827
- id: 'backendError', message: 'Some case information is not available at the moment'
15828
- };
15829
- });
15830
- }
15831
- }
15832
- mapLookupIDToValueFromJurisdictions(fieldName, fieldValue) {
15833
- const selectedJurisdiction = this.jurisdictionsResponse &&
15834
- this.jurisdictionsResponse.find(item => item.id === this.caseDetails.case_type.jurisdiction.id);
15835
- const selectedCaseType = selectedJurisdiction && selectedJurisdiction.caseTypes.find(item => item.id === this.caseDetails.case_type.id);
15836
- const state = selectedCaseType && selectedCaseType.states.find(item => item.id === fieldValue);
15837
- switch (fieldName) {
15838
- case 'JURISDICTION':
15839
- return selectedJurisdiction && selectedJurisdiction.description;
15840
- case 'CASE_TYPE':
15841
- return selectedCaseType && selectedCaseType.name;
15842
- case 'CASE_TYPE_DESCRIPTION':
15843
- return selectedCaseType && selectedCaseType.description;
15844
- case 'STATE':
15845
- return state && state.name || fieldValue;
15846
- case 'STATE_DESCRIPTION':
15847
- return state && state.description || fieldValue;
15848
- default:
15849
- break;
15850
- }
15851
- }
15852
- getCaseName(searchCasesResponse) {
15853
- let caseName = LinkedCasesService.CASE_NAME_MISSING_TEXT;
15854
- const tabs = searchCasesResponse.tabs.filter(tab => {
15855
- const caseNameHmctsInternalField = tab.fields.find(field => field.id === 'caseNameHmctsInternal');
15856
- if (caseNameHmctsInternalField) {
15857
- caseName = caseNameHmctsInternalField.value;
15858
- }
15859
- });
15860
- return caseName;
15861
- }
15862
- static ɵfac = function LinkedCasesService_Factory(t) { return new (t || LinkedCasesService)(i0.ɵɵinject(JurisdictionService), i0.ɵɵinject(SearchService)); };
15863
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: LinkedCasesService, factory: LinkedCasesService.ɵfac });
15864
- }
15865
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LinkedCasesService, [{
15866
- type: Injectable
15867
- }], () => [{ type: JurisdictionService }, { type: SearchService }], null); })();
15868
-
15869
16274
  function BeforeYouStartComponent_div_1_p_3_Template(rf, ctx) { if (rf & 1) {
15870
16275
  i0.ɵɵelementStart(0, "p", 5)(1, "span", 6);
15871
16276
  i0.ɵɵtext(2, "Error:");
@@ -15893,7 +16298,7 @@ function BeforeYouStartComponent_div_1_Template(rf, ctx) { if (rf & 1) {
15893
16298
  i0.ɵɵproperty("ngIf", ctx_r1.serverLinkedApiError);
15894
16299
  } }
15895
16300
  function BeforeYouStartComponent_div_2_div_3_Template(rf, ctx) { if (rf & 1) {
15896
- i0.ɵɵelementStart(0, "div", 11)(1, "p", 3);
16301
+ i0.ɵɵelementStart(0, "div", 9)(1, "p", 3);
15897
16302
  i0.ɵɵtext(2, "If a group of linked cases has a lead case, you must start from the lead case.");
15898
16303
  i0.ɵɵelementEnd();
15899
16304
  i0.ɵɵelementStart(3, "p", 3);
@@ -15901,20 +16306,16 @@ function BeforeYouStartComponent_div_2_div_3_Template(rf, ctx) { if (rf & 1) {
15901
16306
  i0.ɵɵelementEnd()();
15902
16307
  } }
15903
16308
  function BeforeYouStartComponent_div_2_div_4_Template(rf, ctx) { if (rf & 1) {
15904
- i0.ɵɵelementStart(0, "div", 12)(1, "p", 3);
16309
+ i0.ɵɵelementStart(0, "div", 10)(1, "p", 3);
15905
16310
  i0.ɵɵtext(2, "If there are linked hearings for the case you need to un-link then you must unlink the hearing first.");
15906
16311
  i0.ɵɵelementEnd()();
15907
16312
  } }
15908
16313
  function BeforeYouStartComponent_div_2_Template(rf, ctx) { if (rf & 1) {
15909
- const _r3 = i0.ɵɵgetCurrentView();
15910
16314
  i0.ɵɵelementStart(0, "div")(1, "h1", 1);
15911
16315
  i0.ɵɵtext(2, "Before you start");
15912
16316
  i0.ɵɵelementEnd();
15913
16317
  i0.ɵɵtemplate(3, BeforeYouStartComponent_div_2_div_3_Template, 5, 0, "div", 7)(4, BeforeYouStartComponent_div_2_div_4_Template, 3, 0, "div", 8);
15914
- i0.ɵɵelementStart(5, "div", 9)(6, "button", 10);
15915
- i0.ɵɵlistener("click", function BeforeYouStartComponent_div_2_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onNext()); });
15916
- i0.ɵɵtext(7, "Next");
15917
- i0.ɵɵelementEnd()()();
16318
+ i0.ɵɵelementEnd();
15918
16319
  } if (rf & 2) {
15919
16320
  const ctx_r1 = i0.ɵɵnextContext();
15920
16321
  i0.ɵɵadvance(3);
@@ -15922,14 +16323,15 @@ function BeforeYouStartComponent_div_2_Template(rf, ctx) { if (rf & 1) {
15922
16323
  i0.ɵɵadvance();
15923
16324
  i0.ɵɵproperty("ngIf", !ctx_r1.isLinkCasesJourney);
15924
16325
  } }
15925
- class BeforeYouStartComponent {
16326
+ class BeforeYouStartComponent extends AbstractJourneyComponent {
15926
16327
  router;
15927
16328
  linkedCasesService;
15928
16329
  linkedCasesStateEmitter = new EventEmitter();
15929
16330
  isLinkCasesJourney = false;
15930
16331
  errorMessages;
15931
16332
  serverLinkedApiError;
15932
- constructor(router, linkedCasesService) {
16333
+ constructor(router, linkedCasesService, multipageComponentStateService) {
16334
+ super(multipageComponentStateService);
15933
16335
  this.router = router;
15934
16336
  this.linkedCasesService = linkedCasesService;
15935
16337
  this.isLinkCasesJourney = this.linkedCasesService.isLinkedCasesEventTrigger;
@@ -15946,13 +16348,22 @@ class BeforeYouStartComponent {
15946
16348
  navigateToNextPage: true
15947
16349
  });
15948
16350
  }
16351
+ next() {
16352
+ this.onNext();
16353
+ const isAnArray = Array.isArray(this.errorMessages);
16354
+ const isNotAnArray = !isAnArray;
16355
+ const isValid = (isAnArray && this.errorMessages.length === 0) || isNotAnArray;
16356
+ if (isValid) {
16357
+ super.next();
16358
+ }
16359
+ }
15949
16360
  onBack() {
15950
16361
  this.router.navigate(['cases', 'case-details', this.linkedCasesService.caseId], { fragment: 'Linked cases' });
15951
16362
  }
15952
- static ɵfac = function BeforeYouStartComponent_Factory(t) { return new (t || BeforeYouStartComponent)(i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(LinkedCasesService)); };
15953
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: BeforeYouStartComponent, selectors: [["ccd-linked-cases-before-you-start"]], outputs: { linkedCasesStateEmitter: "linkedCasesStateEmitter" }, decls: 3, vars: 2, consts: [[4, "ngIf"], [1, "govuk-heading-xl"], ["id", "unlink-cases-error", "class", "govuk-error-message", 4, "ngIf"], [1, "govuk-body"], ["href", "javascript:void(0)", 1, "govuk-link", 3, "click"], ["id", "unlink-cases-error", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "link-cases-journey", 4, "ngIf"], ["id", "manage-link-cases-journey", 4, "ngIf"], [1, "govuk-button-group"], ["type", "button", "id", "next-button", 1, "button", "button-primary", 3, "click"], ["id", "link-cases-journey"], ["id", "manage-link-cases-journey"]], template: function BeforeYouStartComponent_Template(rf, ctx) { if (rf & 1) {
16363
+ static ɵfac = function BeforeYouStartComponent_Factory(t) { return new (t || BeforeYouStartComponent)(i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(LinkedCasesService), i0.ɵɵdirectiveInject(MultipageComponentStateService)); };
16364
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: BeforeYouStartComponent, selectors: [["ccd-linked-cases-before-you-start"]], outputs: { linkedCasesStateEmitter: "linkedCasesStateEmitter" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 3, vars: 2, consts: [[4, "ngIf"], [1, "govuk-heading-xl"], ["id", "unlink-cases-error", "class", "govuk-error-message", 4, "ngIf"], [1, "govuk-body"], ["href", "javascript:void(0)", 1, "govuk-link", 3, "click"], ["id", "unlink-cases-error", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "link-cases-journey", 4, "ngIf"], ["id", "manage-link-cases-journey", 4, "ngIf"], ["id", "link-cases-journey"], ["id", "manage-link-cases-journey"]], template: function BeforeYouStartComponent_Template(rf, ctx) { if (rf & 1) {
15954
16365
  i0.ɵɵelementStart(0, "div");
15955
- i0.ɵɵtemplate(1, BeforeYouStartComponent_div_1_Template, 7, 1, "div", 0)(2, BeforeYouStartComponent_div_2_Template, 8, 2, "div", 0);
16366
+ i0.ɵɵtemplate(1, BeforeYouStartComponent_div_1_Template, 7, 1, "div", 0)(2, BeforeYouStartComponent_div_2_Template, 5, 2, "div", 0);
15956
16367
  i0.ɵɵelementEnd();
15957
16368
  } if (rf & 2) {
15958
16369
  i0.ɵɵadvance();
@@ -15963,11 +16374,11 @@ class BeforeYouStartComponent {
15963
16374
  }
15964
16375
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BeforeYouStartComponent, [{
15965
16376
  type: Component,
15966
- args: [{ selector: 'ccd-linked-cases-before-you-start', template: "<div>\n <div *ngIf=\"serverLinkedApiError\">\n <h1 class=\"govuk-heading-xl\">There is a problem</h1>\n <p id=\"unlink-cases-error\" class=\"govuk-error-message\" *ngIf=\"serverLinkedApiError\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{serverLinkedApiError.message}}\n </p>\n <p class=\"govuk-body\">\n <a class=\"govuk-link\" href=\"javascript:void(0)\" (click)=\"onBack()\">Go back to the Linked cases tab</a>\n </p>\n </div>\n <div *ngIf=\"!serverLinkedApiError\">\n <h1 class=\"govuk-heading-xl\">Before you start</h1>\n <div id=\"link-cases-journey\" *ngIf=\"isLinkCasesJourney\">\n <p class=\"govuk-body\">If a group of linked cases has a lead case, you must start from the lead case.</p>\n <p class=\"govuk-body\">If the cases to be linked has no lead, you can start the linking journey from any of those\n cases.</p>\n </div>\n <div id=\"manage-link-cases-journey\" *ngIf=\"!isLinkCasesJourney\">\n <p class=\"govuk-body\">If there are linked hearings for the case you need to un-link then you must unlink the\n hearing first.</p>\n </div>\n <div class=\"govuk-button-group\">\n <button class=\"button button-primary\" type=\"button\" id=\"next-button\" (click)=\"onNext()\">Next</button>\n </div>\n </div>\n</div>\n" }]
15967
- }], () => [{ type: i1$1.Router }, { type: LinkedCasesService }], { linkedCasesStateEmitter: [{
16377
+ args: [{ selector: 'ccd-linked-cases-before-you-start', template: "<div>\n <div *ngIf=\"serverLinkedApiError\">\n <h1 class=\"govuk-heading-xl\">There is a problem</h1>\n <p id=\"unlink-cases-error\" class=\"govuk-error-message\" *ngIf=\"serverLinkedApiError\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{serverLinkedApiError.message}}\n </p>\n <p class=\"govuk-body\">\n <a class=\"govuk-link\" href=\"javascript:void(0)\" (click)=\"onBack()\">Go back to the Linked cases tab</a>\n </p>\n </div>\n <div *ngIf=\"!serverLinkedApiError\">\n <h1 class=\"govuk-heading-xl\">Before you start</h1>\n <div id=\"link-cases-journey\" *ngIf=\"isLinkCasesJourney\">\n <p class=\"govuk-body\">If a group of linked cases has a lead case, you must start from the lead case.</p>\n <p class=\"govuk-body\">If the cases to be linked has no lead, you can start the linking journey from any of those\n cases.</p>\n </div>\n <div id=\"manage-link-cases-journey\" *ngIf=\"!isLinkCasesJourney\">\n <p class=\"govuk-body\">If there are linked hearings for the case you need to un-link then you must unlink the\n hearing first.</p>\n </div>\n </div>\n</div>\n" }]
16378
+ }], () => [{ type: i1$1.Router }, { type: LinkedCasesService }, { type: MultipageComponentStateService }], { linkedCasesStateEmitter: [{
15968
16379
  type: Output
15969
16380
  }] }); })();
15970
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BeforeYouStartComponent, { className: "BeforeYouStartComponent", filePath: "lib/shared/components/palette/linked-cases/components/before-you-start/before-you-start.component.ts", lineNumber: 12 }); })();
16381
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BeforeYouStartComponent, { className: "BeforeYouStartComponent", filePath: "lib/shared/components/palette/linked-cases/components/before-you-start/before-you-start.component.ts", lineNumber: 14 }); })();
15971
16382
 
15972
16383
  function CheckYourAnswersComponent_table_4_tr_9_Template(rf, ctx) { if (rf & 1) {
15973
16384
  const _r1 = i0.ɵɵgetCurrentView();
@@ -16089,14 +16500,15 @@ function CheckYourAnswersComponent_tr_18_Template(rf, ctx) { if (rf & 1) {
16089
16500
  i0.ɵɵtext(2, " None ");
16090
16501
  i0.ɵɵelementEnd()();
16091
16502
  } }
16092
- class CheckYourAnswersComponent {
16503
+ class CheckYourAnswersComponent extends AbstractJourneyComponent {
16093
16504
  linkedCasesService;
16094
16505
  linkedCasesStateEmitter = new EventEmitter();
16095
16506
  linkedCases;
16096
16507
  casesToUnlink;
16097
16508
  isLinkCasesJourney;
16098
16509
  linkedCasesTableCaption;
16099
- constructor(linkedCasesService) {
16510
+ constructor(linkedCasesService, multipageComponentStateService) {
16511
+ super(multipageComponentStateService);
16100
16512
  this.linkedCasesService = linkedCasesService;
16101
16513
  }
16102
16514
  ngOnInit() {
@@ -16113,8 +16525,16 @@ class CheckYourAnswersComponent {
16113
16525
  navigateToNextPage: true
16114
16526
  });
16115
16527
  }
16116
- static ɵfac = function CheckYourAnswersComponent_Factory(t) { return new (t || CheckYourAnswersComponent)(i0.ɵɵdirectiveInject(LinkedCasesService)); };
16117
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CheckYourAnswersComponent, selectors: [["ccd-linked-cases-check-your-answers"]], outputs: { linkedCasesStateEmitter: "linkedCasesStateEmitter" }, decls: 19, vars: 5, consts: [[1, "govuk-grid-row"], [1, "govuk-grid-column-full"], [1, "govuk-heading-xl"], ["id", "cases-to-unlink-table", "class", "govuk-table", 4, "ngIf"], ["id", "linked-cases-table", 1, "govuk-table"], [1, "govuk-table__caption", "govuk-table__caption--m"], [1, "govuk-table__head"], [1, "govuk-table__row"], ["scope", "col", 1, "govuk-table__header"], ["scope", "col", "class", "govuk-table__header", 4, "ngIf"], [1, "govuk-table__body"], ["class", "govuk-table__row", 4, "ngFor", "ngForOf"], ["class", "govuk-table__row", 4, "ngIf"], ["id", "cases-to-unlink-table", 1, "govuk-table"], [1, "govuk-table__cell"], ["href", "javascript:void(0)", 1, "govuk-link", "govuk-link--no-visited-state", "float-right", 3, "click"], ["colspan", "2", 1, "govuk-table__cell"], [4, "ngFor", "ngForOf"], ["class", "govuk-table__cell", 4, "ngIf"], [4, "ngIf"], ["colspan", "4", 1, "govuk-table__cell"]], template: function CheckYourAnswersComponent_Template(rf, ctx) { if (rf & 1) {
16528
+ next() {
16529
+ this.linkedCasesStateEmitter.emit({
16530
+ currentLinkedCasesPage: LinkedCasesPages.CHECK_YOUR_ANSWERS,
16531
+ navigateToPreviousPage: false,
16532
+ navigateToNextPage: true
16533
+ });
16534
+ super.next();
16535
+ }
16536
+ static ɵfac = function CheckYourAnswersComponent_Factory(t) { return new (t || CheckYourAnswersComponent)(i0.ɵɵdirectiveInject(LinkedCasesService), i0.ɵɵdirectiveInject(MultipageComponentStateService)); };
16537
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CheckYourAnswersComponent, selectors: [["ccd-linked-cases-check-your-answers"]], outputs: { linkedCasesStateEmitter: "linkedCasesStateEmitter" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 19, vars: 5, consts: [[1, "govuk-grid-row"], [1, "govuk-grid-column-full"], [1, "govuk-heading-xl"], ["id", "cases-to-unlink-table", "class", "govuk-table", 4, "ngIf"], ["id", "linked-cases-table", 1, "govuk-table"], [1, "govuk-table__caption", "govuk-table__caption--m"], [1, "govuk-table__head"], [1, "govuk-table__row"], ["scope", "col", 1, "govuk-table__header"], ["scope", "col", "class", "govuk-table__header", 4, "ngIf"], [1, "govuk-table__body"], ["class", "govuk-table__row", 4, "ngFor", "ngForOf"], ["class", "govuk-table__row", 4, "ngIf"], ["id", "cases-to-unlink-table", 1, "govuk-table"], [1, "govuk-table__cell"], ["href", "javascript:void(0)", 1, "govuk-link", "govuk-link--no-visited-state", "float-right", 3, "click"], ["colspan", "2", 1, "govuk-table__cell"], [4, "ngFor", "ngForOf"], ["class", "govuk-table__cell", 4, "ngIf"], [4, "ngIf"], ["colspan", "4", 1, "govuk-table__cell"]], template: function CheckYourAnswersComponent_Template(rf, ctx) { if (rf & 1) {
16118
16538
  i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "h1", 2);
16119
16539
  i0.ɵɵtext(3, "Check your answers");
16120
16540
  i0.ɵɵelementEnd();
@@ -16150,10 +16570,10 @@ class CheckYourAnswersComponent {
16150
16570
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CheckYourAnswersComponent, [{
16151
16571
  type: Component,
16152
16572
  args: [{ selector: 'ccd-linked-cases-check-your-answers', template: "<div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-full\">\n <h1 class=\"govuk-heading-xl\">Check your answers</h1>\n <!-- Top table for manage link cases journey -->\n <table id=\"cases-to-unlink-table\" class=\"govuk-table\" *ngIf=\"!isLinkCasesJourney\">\n <caption class=\"govuk-table__caption govuk-table__caption--m\">Cases to unlink</caption>\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <th scope=\"col\" class=\"govuk-table__header\">Case name and number</th>\n <th scope=\"col\" class=\"govuk-table__header\"></th>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\" *ngFor=\"let case of casesToUnlink\">\n <td class=\"govuk-table__cell\">\n {{case.caseName}} <br> {{case.caseReference | ccdCaseReference}}\n </td>\n <td class=\"govuk-table__cell\">\n <a href=\"javascript:void(0)\" class=\"govuk-link govuk-link--no-visited-state float-right\" (click)=\"onChange()\">Change</a>\n </td>\n </tr>\n <tr class=\"govuk-table__row\" *ngIf=\"!casesToUnlink.length\">\n <td class=\"govuk-table__cell\" colspan=\"2\">\n None\n </td>\n </tr>\n </tbody>\n </table>\n <!-- Table for both link case and manage link case journeys -->\n <table id=\"linked-cases-table\" class=\"govuk-table\">\n <caption class=\"govuk-table__caption govuk-table__caption--m\">{{linkedCasesTableCaption}}</caption>\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <th scope=\"col\" class=\"govuk-table__header\">Case name and number</th>\n <th scope=\"col\" class=\"govuk-table__header\">Reasons for case link</th>\n <th scope=\"col\" class=\"govuk-table__header\"></th>\n <th scope=\"col\" class=\"govuk-table__header\" *ngIf=\"isLinkCasesJourney\"></th>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\" *ngFor=\"let case of linkedCases\">\n <td class=\"govuk-table__cell\">\n <span>{{case.caseName}} <br> {{case.caseReference | ccdCaseReference}} </span>\n </td>\n <td class=\"govuk-table__cell\">\n <span *ngFor=\"let reason of case.reasons; last as isLast\">\n <span *ngIf=\"isLinkCasesJourney\">\n {{reason | ccdLinkCasesReasonValue}}\n </span>\n <span *ngIf=\"!isLinkCasesJourney\">\n {{reason.Reason.value | ccdLinkCasesReasonValue}}\n </span>\n <br *ngIf=\"!isLast\">\n </span>\n </td>\n <td class=\"govuk-table__cell\"></td>\n <td class=\"govuk-table__cell\" *ngIf=\"isLinkCasesJourney\">\n <a href=\"javascript:void(0)\" class=\"govuk-link govuk-link--no-visited-state float-right\" (click)=\"onChange()\">Change</a>\n </td>\n </tr>\n <tr class=\"govuk-table__row\" *ngIf=\"!linkedCases.length\">\n <td class=\"govuk-table__cell\" colspan=\"4\">\n None\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n</div>\n", styles: [".float-right{float:right}\n"] }]
16153
- }], () => [{ type: LinkedCasesService }], { linkedCasesStateEmitter: [{
16573
+ }], () => [{ type: LinkedCasesService }, { type: MultipageComponentStateService }], { linkedCasesStateEmitter: [{
16154
16574
  type: Output
16155
16575
  }] }); })();
16156
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CheckYourAnswersComponent, { className: "CheckYourAnswersComponent", filePath: "lib/shared/components/palette/linked-cases/components/check-your-answers/check-your-answers.component.ts", lineNumber: 11 }); })();
16576
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CheckYourAnswersComponent, { className: "CheckYourAnswersComponent", filePath: "lib/shared/components/palette/linked-cases/components/check-your-answers/check-your-answers.component.ts", lineNumber: 14 }); })();
16157
16577
 
16158
16578
  class ValidatorsUtils {
16159
16579
  numberLengthValidator(inputLength) {
@@ -16183,7 +16603,7 @@ class ValidatorsUtils {
16183
16603
  const _c0$J = a0 => ({ "govuk-form-group--error": a0 });
16184
16604
  const _c1$g = a0 => ({ "table-group-error": a0 });
16185
16605
  function LinkCasesComponent_div_8_span_4_Template(rf, ctx) { if (rf & 1) {
16186
- i0.ɵɵelementStart(0, "span", 30)(1, "span", 31);
16606
+ i0.ɵɵelementStart(0, "span", 28)(1, "span", 29);
16187
16607
  i0.ɵɵtext(2, "Error:");
16188
16608
  i0.ɵɵelementEnd();
16189
16609
  i0.ɵɵtext(3);
@@ -16194,7 +16614,7 @@ function LinkCasesComponent_div_8_span_4_Template(rf, ctx) { if (rf & 1) {
16194
16614
  i0.ɵɵtextInterpolate1(" ", ctx_r1.caseNumberError, " ");
16195
16615
  } }
16196
16616
  function LinkCasesComponent_div_8_span_11_Template(rf, ctx) { if (rf & 1) {
16197
- i0.ɵɵelementStart(0, "span", 30)(1, "span", 31);
16617
+ i0.ɵɵelementStart(0, "span", 28)(1, "span", 29);
16198
16618
  i0.ɵɵtext(2, "Error:");
16199
16619
  i0.ɵɵelementEnd();
16200
16620
  i0.ɵɵtext(3);
@@ -16206,10 +16626,10 @@ function LinkCasesComponent_div_8_span_11_Template(rf, ctx) { if (rf & 1) {
16206
16626
  } }
16207
16627
  function LinkCasesComponent_div_8_div_13_Template(rf, ctx) { if (rf & 1) {
16208
16628
  const _r3 = i0.ɵɵgetCurrentView();
16209
- i0.ɵɵelementStart(0, "div", 32)(1, "input", 33);
16629
+ i0.ɵɵelementStart(0, "div", 30)(1, "input", 31);
16210
16630
  i0.ɵɵlistener("change", function LinkCasesComponent_div_8_div_13_Template_input_change_1_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.toggleLinkCaseReasonOtherComments($event)); });
16211
16631
  i0.ɵɵelementEnd();
16212
- i0.ɵɵelementStart(2, "label", 34);
16632
+ i0.ɵɵelementStart(2, "label", 32);
16213
16633
  i0.ɵɵtext(3);
16214
16634
  i0.ɵɵelementEnd()();
16215
16635
  } if (rf & 2) {
@@ -16225,7 +16645,7 @@ function LinkCasesComponent_div_8_div_13_Template(rf, ctx) { if (rf & 1) {
16225
16645
  i0.ɵɵtextInterpolate(reason_r4.value_en);
16226
16646
  } }
16227
16647
  function LinkCasesComponent_div_8_div_14_span_3_Template(rf, ctx) { if (rf & 1) {
16228
- i0.ɵɵelementStart(0, "span", 30)(1, "span", 31);
16648
+ i0.ɵɵelementStart(0, "span", 28)(1, "span", 29);
16229
16649
  i0.ɵɵtext(2, "Error:");
16230
16650
  i0.ɵɵelementEnd();
16231
16651
  i0.ɵɵtext(3);
@@ -16236,14 +16656,14 @@ function LinkCasesComponent_div_8_div_14_span_3_Template(rf, ctx) { if (rf & 1)
16236
16656
  i0.ɵɵtextInterpolate1(" ", ctx_r1.caseReasonCommentsError, " ");
16237
16657
  } }
16238
16658
  function LinkCasesComponent_div_8_div_14_Template(rf, ctx) { if (rf & 1) {
16239
- i0.ɵɵelementStart(0, "div", 35)(1, "h3", 22);
16659
+ i0.ɵɵelementStart(0, "div", 33)(1, "h3", 20);
16240
16660
  i0.ɵɵtext(2, "Comments");
16241
16661
  i0.ɵɵelementEnd();
16242
16662
  i0.ɵɵtemplate(3, LinkCasesComponent_div_8_div_14_span_3_Template, 4, 1, "span", 6);
16243
- i0.ɵɵelementStart(4, "textarea", 36);
16663
+ i0.ɵɵelementStart(4, "textarea", 34);
16244
16664
  i0.ɵɵtext(5, " ");
16245
16665
  i0.ɵɵelementEnd();
16246
- i0.ɵɵelementStart(6, "div", 37);
16666
+ i0.ɵɵelementStart(6, "div", 35);
16247
16667
  i0.ɵɵtext(7, " You can enter up to 100 characters ");
16248
16668
  i0.ɵɵelementEnd()();
16249
16669
  } if (rf & 2) {
@@ -16253,7 +16673,7 @@ function LinkCasesComponent_div_8_div_14_Template(rf, ctx) { if (rf & 1) {
16253
16673
  i0.ɵɵproperty("ngIf", ctx_r1.caseReasonCommentsError);
16254
16674
  } }
16255
16675
  function LinkCasesComponent_div_8_span_17_Template(rf, ctx) { if (rf & 1) {
16256
- i0.ɵɵelementStart(0, "span", 30)(1, "span", 31);
16676
+ i0.ɵɵelementStart(0, "span", 28)(1, "span", 29);
16257
16677
  i0.ɵɵtext(2, "Error:");
16258
16678
  i0.ɵɵelementEnd();
16259
16679
  i0.ɵɵtext(3);
@@ -16265,26 +16685,26 @@ function LinkCasesComponent_div_8_span_17_Template(rf, ctx) { if (rf & 1) {
16265
16685
  } }
16266
16686
  function LinkCasesComponent_div_8_Template(rf, ctx) { if (rf & 1) {
16267
16687
  const _r1 = i0.ɵɵgetCurrentView();
16268
- i0.ɵɵelementStart(0, "div", 21)(1, "div", 5)(2, "h3", 22);
16688
+ i0.ɵɵelementStart(0, "div", 19)(1, "div", 5)(2, "h3", 20);
16269
16689
  i0.ɵɵtext(3, "Enter case reference");
16270
16690
  i0.ɵɵelementEnd();
16271
16691
  i0.ɵɵtemplate(4, LinkCasesComponent_div_8_span_4_Template, 4, 1, "span", 6);
16272
- i0.ɵɵelement(5, "input", 23);
16692
+ i0.ɵɵelement(5, "input", 21);
16273
16693
  i0.ɵɵelementEnd();
16274
- i0.ɵɵelementStart(6, "div", 24)(7, "h3", 22);
16694
+ i0.ɵɵelementStart(6, "div", 22)(7, "h3", 20);
16275
16695
  i0.ɵɵtext(8, "Why should these cases be linked?");
16276
16696
  i0.ɵɵelementEnd();
16277
- i0.ɵɵelementStart(9, "div", 25);
16697
+ i0.ɵɵelementStart(9, "div", 23);
16278
16698
  i0.ɵɵtext(10, " Select all that apply. ");
16279
16699
  i0.ɵɵelementEnd();
16280
16700
  i0.ɵɵtemplate(11, LinkCasesComponent_div_8_span_11_Template, 4, 1, "span", 6);
16281
- i0.ɵɵelementStart(12, "div", 26);
16282
- i0.ɵɵtemplate(13, LinkCasesComponent_div_8_div_13_Template, 4, 5, "div", 27);
16701
+ i0.ɵɵelementStart(12, "div", 24);
16702
+ i0.ɵɵtemplate(13, LinkCasesComponent_div_8_div_13_Template, 4, 5, "div", 25);
16283
16703
  i0.ɵɵelementEnd()();
16284
- i0.ɵɵtemplate(14, LinkCasesComponent_div_8_div_14_Template, 8, 4, "div", 28);
16704
+ i0.ɵɵtemplate(14, LinkCasesComponent_div_8_div_14_Template, 8, 4, "div", 26);
16285
16705
  i0.ɵɵelement(15, "br")(16, "br");
16286
16706
  i0.ɵɵtemplate(17, LinkCasesComponent_div_8_span_17_Template, 4, 1, "span", 6);
16287
- i0.ɵɵelementStart(18, "button", 29);
16707
+ i0.ɵɵelementStart(18, "button", 27);
16288
16708
  i0.ɵɵlistener("click", function LinkCasesComponent_div_8_Template_button_click_18_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.submitCaseInfo()); });
16289
16709
  i0.ɵɵtext(19, "Propose case link");
16290
16710
  i0.ɵɵelementEnd()();
@@ -16307,7 +16727,7 @@ function LinkCasesComponent_div_8_Template(rf, ctx) { if (rf & 1) {
16307
16727
  i0.ɵɵproperty("ngIf", ctx_r1.caseSelectionError);
16308
16728
  } }
16309
16729
  function LinkCasesComponent_span_13_Template(rf, ctx) { if (rf & 1) {
16310
- i0.ɵɵelementStart(0, "span", 30)(1, "span", 31);
16730
+ i0.ɵɵelementStart(0, "span", 28)(1, "span", 29);
16311
16731
  i0.ɵɵtext(2, "Error:");
16312
16732
  i0.ɵɵelementEnd();
16313
16733
  i0.ɵɵtext(3);
@@ -16330,27 +16750,27 @@ function LinkCasesComponent_tr_31_span_15_Template(rf, ctx) { if (rf & 1) {
16330
16750
  } }
16331
16751
  function LinkCasesComponent_tr_31_Template(rf, ctx) { if (rf & 1) {
16332
16752
  const _r6 = i0.ɵɵgetCurrentView();
16333
- i0.ɵɵelementStart(0, "tr", 10)(1, "td", 38);
16334
- i0.ɵɵelement(2, "div", 39);
16753
+ i0.ɵɵelementStart(0, "tr", 10)(1, "td", 36);
16754
+ i0.ɵɵelement(2, "div", 37);
16335
16755
  i0.ɵɵelementStart(3, "span");
16336
16756
  i0.ɵɵtext(4);
16337
16757
  i0.ɵɵelement(5, "br");
16338
16758
  i0.ɵɵtext(6);
16339
16759
  i0.ɵɵpipe(7, "ccdCaseReference");
16340
16760
  i0.ɵɵelementEnd()();
16341
- i0.ɵɵelementStart(8, "td", 40);
16761
+ i0.ɵɵelementStart(8, "td", 38);
16342
16762
  i0.ɵɵtext(9);
16343
16763
  i0.ɵɵelementEnd();
16344
- i0.ɵɵelementStart(10, "td", 38);
16764
+ i0.ɵɵelementStart(10, "td", 36);
16345
16765
  i0.ɵɵtext(11);
16346
16766
  i0.ɵɵelementEnd();
16347
- i0.ɵɵelementStart(12, "td", 40);
16767
+ i0.ɵɵelementStart(12, "td", 38);
16348
16768
  i0.ɵɵtext(13);
16349
16769
  i0.ɵɵelementEnd();
16350
- i0.ɵɵelementStart(14, "td", 38);
16351
- i0.ɵɵtemplate(15, LinkCasesComponent_tr_31_span_15_Template, 4, 3, "span", 41);
16770
+ i0.ɵɵelementStart(14, "td", 36);
16771
+ i0.ɵɵtemplate(15, LinkCasesComponent_tr_31_span_15_Template, 4, 3, "span", 39);
16352
16772
  i0.ɵɵelementEnd();
16353
- i0.ɵɵelementStart(16, "td", 38)(17, "a", 42);
16773
+ i0.ɵɵelementStart(16, "td", 36)(17, "a", 40);
16354
16774
  i0.ɵɵlistener("click", function LinkCasesComponent_tr_31_Template_a_click_17_listener() { const ctx_r7 = i0.ɵɵrestoreView(_r6); const case_r9 = ctx_r7.$implicit; const pos_r10 = ctx_r7.index; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onSelectedLinkedCaseRemove(pos_r10, case_r9.caseReference)); });
16355
16775
  i0.ɵɵtext(18, "Remove");
16356
16776
  i0.ɵɵelementEnd()()();
@@ -16379,11 +16799,11 @@ function LinkCasesComponent_tr_31_Template(rf, ctx) { if (rf & 1) {
16379
16799
  i0.ɵɵattribute("id", case_r9.caseReference);
16380
16800
  } }
16381
16801
  function LinkCasesComponent_tr_32_Template(rf, ctx) { if (rf & 1) {
16382
- i0.ɵɵelementStart(0, "tr", 10)(1, "td", 43);
16802
+ i0.ɵɵelementStart(0, "tr", 10)(1, "td", 41);
16383
16803
  i0.ɵɵtext(2, " None ");
16384
16804
  i0.ɵɵelementEnd()();
16385
16805
  } }
16386
- class LinkCasesComponent {
16806
+ class LinkCasesComponent extends AbstractJourneyComponent {
16387
16807
  casesService;
16388
16808
  fb;
16389
16809
  validatorsUtils;
@@ -16402,7 +16822,8 @@ class LinkCasesComponent {
16402
16822
  linkCaseReasons;
16403
16823
  showComments = false;
16404
16824
  ISO_FORMAT = 'YYYY-MM-DDTHH:mm:ss.SSS';
16405
- constructor(casesService, fb, validatorsUtils, linkedCasesService) {
16825
+ constructor(casesService, fb, validatorsUtils, linkedCasesService, multipageComponentStateService) {
16826
+ super(multipageComponentStateService);
16406
16827
  this.casesService = casesService;
16407
16828
  this.fb = fb;
16408
16829
  this.validatorsUtils = validatorsUtils;
@@ -16413,7 +16834,11 @@ class LinkCasesComponent {
16413
16834
  this.caseName = this.linkedCasesService.caseName;
16414
16835
  this.linkCaseReasons = this.linkedCasesService.linkCaseReasons;
16415
16836
  this.initForm();
16416
- if (this.linkedCasesService.editMode) {
16837
+ if (!this.linkedCasesService.hasNavigatedInJourney) {
16838
+ this.linkedCasesService.linkedCases = [];
16839
+ this.linkedCasesService.caseFieldValue = [];
16840
+ }
16841
+ if (this.linkedCasesService.editMode || this.linkedCasesService.linkedCases.length) {
16417
16842
  // this may have includes the currently added one but yet to be submitted.
16418
16843
  this.selectedCases = this.linkedCasesService.linkedCases;
16419
16844
  }
@@ -16422,8 +16847,9 @@ class LinkCasesComponent {
16422
16847
  }
16423
16848
  }
16424
16849
  initForm() {
16850
+ const caseNumber = this.linkedCasesService.storedCaseNumber ?? '';
16425
16851
  this.linkCaseForm = this.fb.group({
16426
- caseNumber: ['', [Validators.minLength(16), this.validatorsUtils.regexPattern(Patterns.CASE_REF)]],
16852
+ caseNumber: [caseNumber, [Validators.minLength(16), this.validatorsUtils.regexPattern(Patterns.CASE_REF)]],
16427
16853
  reasonType: this.getReasonTypeFormArray,
16428
16854
  otherDescription: ['', [Validators.maxLength(100)]]
16429
16855
  });
@@ -16456,6 +16882,8 @@ class LinkCasesComponent {
16456
16882
  !this.isCaseSelected(this.linkedCasesService.linkedCases) &&
16457
16883
  !this.isCaseSelectedSameAsCurrentCase() &&
16458
16884
  !this.isOtherOptionSelectedButOtherDescriptionNotEntered()) {
16885
+ this.linkedCasesService.storedCaseNumber = '';
16886
+ this.linkedCasesService.hasNavigatedInJourney = true;
16459
16887
  this.getCaseInfo();
16460
16888
  }
16461
16889
  else {
@@ -16560,9 +16988,7 @@ class LinkCasesComponent {
16560
16988
  CreatedDateTime: moment(new Date()).format(this.ISO_FORMAT),
16561
16989
  ReasonForLink: this.getSelectedCCDTypeCaseReason()
16562
16990
  };
16563
- if (!this.linkedCasesService.caseFieldValue) {
16564
- this.linkedCasesService.caseFieldValue = [];
16565
- }
16991
+ this.linkedCasesService.caseFieldValue = [];
16566
16992
  this.linkedCasesService.caseFieldValue.push({ id: caseView.case_id.toString(), value: ccdApiCaseLinkData });
16567
16993
  this.selectedCases.push(caseLink);
16568
16994
  this.linkCaseReasons.forEach(reason => reason.selected = false);
@@ -16633,6 +17059,7 @@ class LinkCasesComponent {
16633
17059
  this.caseSelectionError = null;
16634
17060
  this.noSelectedCaseError = null;
16635
17061
  let navigateToNextPage = true;
17062
+ this.linkedCasesService.storedCaseNumber = this.linkCaseForm.value.caseNumber ?? '';
16636
17063
  if (this.selectedCases.length) {
16637
17064
  this.linkedCasesService.linkedCases = this.selectedCases;
16638
17065
  }
@@ -16647,8 +17074,14 @@ class LinkCasesComponent {
16647
17074
  }
16648
17075
  this.emitLinkedCasesState(navigateToNextPage);
16649
17076
  }
16650
- static ɵfac = function LinkCasesComponent_Factory(t) { return new (t || LinkCasesComponent)(i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(i4.FormBuilder), i0.ɵɵdirectiveInject(ValidatorsUtils), i0.ɵɵdirectiveInject(LinkedCasesService)); };
16651
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LinkCasesComponent, selectors: [["ccd-link-cases"]], outputs: { linkedCasesStateEmitter: "linkedCasesStateEmitter" }, decls: 36, vars: 11, consts: [[1, "govuk-grid-row"], [1, "govuk-grid-column-full"], [1, "govuk-caption-l"], [1, "govuk-heading-xl"], ["class", "form-group", 3, "formGroup", 4, "ngIf"], ["id", "caseNumber", 1, "govuk-form-group", 3, "ngClass"], ["class", "govuk-error-message", 4, "ngIf"], [1, "govuk-table"], [1, "govuk-table__caption", "govuk-table__caption--m"], [1, "govuk-table__head"], [1, "govuk-table__row"], ["scope", "col", "width", "300", 1, "govuk-table__header"], ["scope", "col", "width", "150", 1, "govuk-table__header"], ["scope", "col", "width", "200", 1, "govuk-table__header"], ["scope", "col", "width", "400", 1, "govuk-table__header"], ["scope", "col", "width", "50", 1, "govuk-table__header"], [1, "govuk-table__body"], ["class", "govuk-table__row", 4, "ngFor", "ngForOf"], ["class", "govuk-table__row", 4, "ngIf"], [1, "govuk-button-group"], ["type", "button", "id", "next-button", 1, "button", "button-primary", 3, "click"], [1, "form-group", 3, "formGroup"], [1, "govuk-heading-s"], ["formControlName", "caseNumber", "id", "width-20", "name", "width-20", "type", "text", 1, "govuk-input", "govuk-input--width-20"], [1, "govuk-!-margin-top-3", 3, "ngClass"], ["id", "waste-hint", 1, "govuk-hint"], ["data-module", "govuk-checkboxes", "formArrayName", "reasonType", "id", "caseReason", 1, "govuk-checkboxes"], ["class", "govuk-checkboxes__item", 3, "formGroupName", 4, "ngFor", "ngForOf"], ["id", "other-description-char-limit-error", "class", "govuk-!-margin-top-3", 3, "ngClass", 4, "ngIf"], ["id", "propose", "type", "button", "data-module", "govuk-button", 1, "govuk-button", "govuk-button--secondary", 3, "click"], [1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-checkboxes__item", 3, "formGroupName"], ["formControlName", "selected", "name", "pos", "type", "checkbox", 1, "govuk-checkboxes__input", 3, "change", "id", "value"], [1, "govuk-label", "govuk-checkboxes__label", 3, "for"], ["id", "other-description-char-limit-error", 1, "govuk-!-margin-top-3", 3, "ngClass"], ["id", "otherDescription", "name", "otherDescription", "formControlName", "otherDescription", "rows", "5", "aria-describedby", "other-description-hint other-description-char-limit-info other-description-char-limit-error", 1, "govuk-textarea", "govuk-input--width-30"], ["id", "other-description-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], [1, "govuk-table__cell"], [1, "govuk-form-group--error", 3, "ngClass"], [1, "govuk-table__cell", 3, "title"], [4, "ngFor", "ngForOf"], [1, "govuk-link", "no-visited-state", 3, "click"], ["colspan", "6", 1, "govuk-table__cell"]], template: function LinkCasesComponent_Template(rf, ctx) { if (rf & 1) {
17077
+ next() {
17078
+ this.onNext();
17079
+ if (this.errorMessages.length === 0) {
17080
+ super.next();
17081
+ }
17082
+ }
17083
+ static ɵfac = function LinkCasesComponent_Factory(t) { return new (t || LinkCasesComponent)(i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(i4.FormBuilder), i0.ɵɵdirectiveInject(ValidatorsUtils), i0.ɵɵdirectiveInject(LinkedCasesService), i0.ɵɵdirectiveInject(MultipageComponentStateService)); };
17084
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LinkCasesComponent, selectors: [["ccd-link-cases"]], outputs: { linkedCasesStateEmitter: "linkedCasesStateEmitter" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 33, vars: 11, consts: [[1, "govuk-grid-row"], [1, "govuk-grid-column-full"], [1, "govuk-caption-l"], [1, "govuk-heading-xl"], ["class", "form-group", 3, "formGroup", 4, "ngIf"], ["id", "caseNumber", 1, "govuk-form-group", 3, "ngClass"], ["class", "govuk-error-message", 4, "ngIf"], [1, "govuk-table"], [1, "govuk-table__caption", "govuk-table__caption--m"], [1, "govuk-table__head"], [1, "govuk-table__row"], ["scope", "col", "width", "300", 1, "govuk-table__header"], ["scope", "col", "width", "150", 1, "govuk-table__header"], ["scope", "col", "width", "200", 1, "govuk-table__header"], ["scope", "col", "width", "400", 1, "govuk-table__header"], ["scope", "col", "width", "50", 1, "govuk-table__header"], [1, "govuk-table__body"], ["class", "govuk-table__row", 4, "ngFor", "ngForOf"], ["class", "govuk-table__row", 4, "ngIf"], [1, "form-group", 3, "formGroup"], [1, "govuk-heading-s"], ["formControlName", "caseNumber", "id", "width-20", "name", "width-20", "type", "text", 1, "govuk-input", "govuk-input--width-20"], [1, "govuk-!-margin-top-3", 3, "ngClass"], ["id", "waste-hint", 1, "govuk-hint"], ["data-module", "govuk-checkboxes", "formArrayName", "reasonType", "id", "caseReason", 1, "govuk-checkboxes"], ["class", "govuk-checkboxes__item", 3, "formGroupName", 4, "ngFor", "ngForOf"], ["id", "other-description-char-limit-error", "class", "govuk-!-margin-top-3", 3, "ngClass", 4, "ngIf"], ["id", "propose", "type", "button", "data-module", "govuk-button", 1, "govuk-button", "govuk-button--secondary", 3, "click"], [1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-checkboxes__item", 3, "formGroupName"], ["formControlName", "selected", "name", "pos", "type", "checkbox", 1, "govuk-checkboxes__input", 3, "change", "id", "value"], [1, "govuk-label", "govuk-checkboxes__label", 3, "for"], ["id", "other-description-char-limit-error", 1, "govuk-!-margin-top-3", 3, "ngClass"], ["id", "otherDescription", "name", "otherDescription", "formControlName", "otherDescription", "rows", "5", "aria-describedby", "other-description-hint other-description-char-limit-info other-description-char-limit-error", 1, "govuk-textarea", "govuk-input--width-30"], ["id", "other-description-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], [1, "govuk-table__cell"], [1, "govuk-form-group--error", 3, "ngClass"], [1, "govuk-table__cell", 3, "title"], [4, "ngFor", "ngForOf"], [1, "govuk-link", "no-visited-state", 3, "click"], ["colspan", "6", 1, "govuk-table__cell"]], template: function LinkCasesComponent_Template(rf, ctx) { if (rf & 1) {
16652
17085
  i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div")(3, "span", 2);
16653
17086
  i0.ɵɵtext(4);
16654
17087
  i0.ɵɵpipe(5, "ccdCaseReference");
@@ -16682,11 +17115,7 @@ class LinkCasesComponent {
16682
17115
  i0.ɵɵelementEnd()();
16683
17116
  i0.ɵɵelementStart(30, "tbody", 16);
16684
17117
  i0.ɵɵtemplate(31, LinkCasesComponent_tr_31_Template, 19, 14, "tr", 17)(32, LinkCasesComponent_tr_32_Template, 3, 0, "tr", 18);
16685
- i0.ɵɵelementEnd()()();
16686
- i0.ɵɵelementStart(33, "div", 19)(34, "button", 20);
16687
- i0.ɵɵlistener("click", function LinkCasesComponent_Template_button_click_34_listener() { return ctx.onNext(); });
16688
- i0.ɵɵtext(35, "Next");
16689
- i0.ɵɵelementEnd()()()()();
17118
+ i0.ɵɵelementEnd()()()()()();
16690
17119
  } if (rf & 2) {
16691
17120
  i0.ɵɵadvance(4);
16692
17121
  i0.ɵɵtextInterpolate2("Link cases to ", ctx.caseName, " ", i0.ɵɵpipeBind1(5, 7, ctx.caseId), "");
@@ -16704,11 +17133,11 @@ class LinkCasesComponent {
16704
17133
  }
16705
17134
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LinkCasesComponent, [{
16706
17135
  type: Component,
16707
- args: [{ selector: 'ccd-link-cases', template: "<div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-full\">\n <div>\n <span class=\"govuk-caption-l\">Link cases to {{caseName}} {{caseId | ccdCaseReference}}</span>\n <h1 class=\"govuk-heading-xl\">Select a&nbsp;case you want to link to this case</h1>\n <div class=\"form-group\" [formGroup]=\"linkCaseForm\" *ngIf=\"linkCaseForm\">\n <div class=\"govuk-form-group\" id=\"caseNumber\" [ngClass]=\"{'govuk-form-group--error': !!caseNumberError}\">\n <h3 class=\"govuk-heading-s\">Enter case reference</h3>\n <span class=\"govuk-error-message\" *ngIf=\"caseNumberError\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{caseNumberError}}\n </span>\n <input class=\"govuk-input govuk-input--width-20\" formControlName=\"caseNumber\" id=\"width-20\" name=\"width-20\"\n type=\"text\">\n </div>\n <div [ngClass]=\"{'govuk-form-group--error': !!caseReasonError}\" class=\"govuk-!-margin-top-3\">\n <h3 class=\"govuk-heading-s\">Why should these cases be linked?</h3>\n <div id=\"waste-hint\" class=\"govuk-hint\">\n Select all that apply.\n </div>\n <span class=\"govuk-error-message\" *ngIf=\"caseReasonError\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{caseReasonError}}\n </span>\n <div class=\"govuk-checkboxes\" data-module=\"govuk-checkboxes\" formArrayName=\"reasonType\" id=\"caseReason\">\n <div class=\"govuk-checkboxes__item\" *ngFor=\"let reason of linkCaseReasons;index as pos\" [formGroupName]=\"pos\">\n <input class=\"govuk-checkboxes__input\" id=\"{{reason.key}}\" formControlName=\"selected\" name=\"pos\"\n type=\"checkbox\" [value]=\"reason.value_en\" (change)=\"toggleLinkCaseReasonOtherComments($event)\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"{{reason.key}}\">{{reason.value_en}}</label>\n </div>\n </div>\n </div>\n <div id=\"other-description-char-limit-error\" [ngClass]=\"{'govuk-form-group--error': !!caseReasonCommentsError}\" class=\"govuk-!-margin-top-3\" *ngIf=\"showComments\">\n <h3 class=\"govuk-heading-s\">Comments</h3>\n <span class=\"govuk-error-message\" *ngIf=\"caseReasonCommentsError\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{caseReasonCommentsError}}\n </span>\n <textarea class=\"govuk-textarea govuk-input--width-30\" id=\"otherDescription\"\n name=\"otherDescription\" formControlName=\"otherDescription\" rows=\"5\"\n aria-describedby=\"other-description-hint other-description-char-limit-info other-description-char-limit-error\">\n </textarea>\n <div id=\"other-description-char-limit-info\" aria-live=\"polite\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 100 characters\n </div>\n </div>\n <br><br>\n <span class=\"govuk-error-message\" *ngIf=\"caseSelectionError\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{caseSelectionError}}\n </span>\n <button id=\"propose\" type=\"button\" class=\"govuk-button govuk-button--secondary\" data-module=\"govuk-button\"\n (click)=\"submitCaseInfo()\">Propose case link</button>\n </div>\n <hr>\n <br><br>\n <div class=\"govuk-form-group\" id=\"caseNumber\" [ngClass]=\"{'govuk-form-group--error': !!noSelectedCaseError}\">\n <span class=\"govuk-error-message\" *ngIf=\"noSelectedCaseError\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{noSelectedCaseError}}\n </span>\n <table class=\"govuk-table\">\n <caption class=\"govuk-table__caption govuk-table__caption--m\">Proposed case links </caption>\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <th scope=\"col\" class=\"govuk-table__header\" width=\"300\">Case name and number</th>\n <th scope=\"col\" class=\"govuk-table__header\" width=\"150\">Case type </th>\n <th scope=\"col\" class=\"govuk-table__header\" width=\"200\">Service</th>\n <th scope=\"col\" class=\"govuk-table__header\" width=\"200\">State</th>\n <th scope=\"col\" class=\"govuk-table__header\" width=\"400\">Reasons for case link</th>\n <th scope=\"col\" class=\"govuk-table__header\" width=\"50\"></th>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\" *ngFor=\"let case of selectedCases; let pos = index\">\n <td class=\"govuk-table__cell\">\n <div class=\"govuk-form-group--error\"\n [ngClass]=\"{'table-group-error':caseSelectionError && case.caseReference === linkCaseForm.value.caseNumber}\">\n </div>\n <span>{{case.caseName}} <br> {{case.caseReference | ccdCaseReference}}</span>\n </td>\n <td class=\"govuk-table__cell\" [title]=\"case.caseTypeDescription\">{{case.caseType}}</td>\n <td class=\"govuk-table__cell\">{{case.caseService}}</td>\n <td class=\"govuk-table__cell\" [title]=\"case.caseStateDescription\">{{case.caseState}}</td>\n <td class=\"govuk-table__cell\"><span\n *ngFor=\"let reason of case.reasons\">{{reason | ccdLinkCasesReasonValue}}<br></span></td>\n <td class=\"govuk-table__cell\"><a [attr.id]=\"case.caseReference\" (click)=\"onSelectedLinkedCaseRemove(pos, case.caseReference);\"\n class=\"govuk-link no-visited-state\">Remove</a></td>\n </tr>\n <tr class=\"govuk-table__row\" *ngIf=\"!selectedCases.length\">\n <td class=\"govuk-table__cell\" colspan=\"6\">\n None\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <div class=\"govuk-button-group\">\n <button class=\"button button-primary\" type=\"button\" id=\"next-button\" (click)=\"onNext()\">Next</button>\n </div>\n </div>\n </div>\n</div>\n", styles: [".no-visited-state{color:#1d70b8;cursor:pointer}.no-visited-state:hover{color:#003078}.govuk-checkboxes{display:flex;flex-direction:column;flex-wrap:wrap;max-height:500px;width:100%;overflow-x:auto;overflow-y:hidden;padding-top:5px}.govuk-checkboxes .govuk-checkboxes__item{display:flex}::ng-deep .govuk-width-container .screen-990 .width-50{width:100%}.govuk-table__row{position:relative}.govuk-table__row .table-group-error{position:absolute;height:calc(100% - 20px);margin-left:-15px}\n"] }]
16708
- }], () => [{ type: CasesService }, { type: i4.FormBuilder }, { type: ValidatorsUtils }, { type: LinkedCasesService }], { linkedCasesStateEmitter: [{
17136
+ args: [{ selector: 'ccd-link-cases', template: "<div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-full\">\n <div>\n <span class=\"govuk-caption-l\">Link cases to {{caseName}} {{caseId | ccdCaseReference}}</span>\n <h1 class=\"govuk-heading-xl\">Select a&nbsp;case you want to link to this case</h1>\n <div class=\"form-group\" [formGroup]=\"linkCaseForm\" *ngIf=\"linkCaseForm\">\n <div class=\"govuk-form-group\" id=\"caseNumber\" [ngClass]=\"{'govuk-form-group--error': !!caseNumberError}\">\n <h3 class=\"govuk-heading-s\">Enter case reference</h3>\n <span class=\"govuk-error-message\" *ngIf=\"caseNumberError\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{caseNumberError}}\n </span>\n <input class=\"govuk-input govuk-input--width-20\" formControlName=\"caseNumber\" id=\"width-20\" name=\"width-20\"\n type=\"text\">\n </div>\n <div [ngClass]=\"{'govuk-form-group--error': !!caseReasonError}\" class=\"govuk-!-margin-top-3\">\n <h3 class=\"govuk-heading-s\">Why should these cases be linked?</h3>\n <div id=\"waste-hint\" class=\"govuk-hint\">\n Select all that apply.\n </div>\n <span class=\"govuk-error-message\" *ngIf=\"caseReasonError\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{caseReasonError}}\n </span>\n <div class=\"govuk-checkboxes\" data-module=\"govuk-checkboxes\" formArrayName=\"reasonType\" id=\"caseReason\">\n <div class=\"govuk-checkboxes__item\" *ngFor=\"let reason of linkCaseReasons;index as pos\" [formGroupName]=\"pos\">\n <input class=\"govuk-checkboxes__input\" id=\"{{reason.key}}\" formControlName=\"selected\" name=\"pos\"\n type=\"checkbox\" [value]=\"reason.value_en\" (change)=\"toggleLinkCaseReasonOtherComments($event)\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"{{reason.key}}\">{{reason.value_en}}</label>\n </div>\n </div>\n </div>\n <div id=\"other-description-char-limit-error\" [ngClass]=\"{'govuk-form-group--error': !!caseReasonCommentsError}\" class=\"govuk-!-margin-top-3\" *ngIf=\"showComments\">\n <h3 class=\"govuk-heading-s\">Comments</h3>\n <span class=\"govuk-error-message\" *ngIf=\"caseReasonCommentsError\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{caseReasonCommentsError}}\n </span>\n <textarea class=\"govuk-textarea govuk-input--width-30\" id=\"otherDescription\"\n name=\"otherDescription\" formControlName=\"otherDescription\" rows=\"5\"\n aria-describedby=\"other-description-hint other-description-char-limit-info other-description-char-limit-error\">\n </textarea>\n <div id=\"other-description-char-limit-info\" aria-live=\"polite\" class=\"govuk-hint govuk-character-count__message\">\n You can enter up to 100 characters\n </div>\n </div>\n <br><br>\n <span class=\"govuk-error-message\" *ngIf=\"caseSelectionError\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{caseSelectionError}}\n </span>\n <button id=\"propose\" type=\"button\" class=\"govuk-button govuk-button--secondary\" data-module=\"govuk-button\"\n (click)=\"submitCaseInfo()\">Propose case link</button>\n </div>\n <hr>\n <br><br>\n <div class=\"govuk-form-group\" id=\"caseNumber\" [ngClass]=\"{'govuk-form-group--error': !!noSelectedCaseError}\">\n <span class=\"govuk-error-message\" *ngIf=\"noSelectedCaseError\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{noSelectedCaseError}}\n </span>\n <table class=\"govuk-table\">\n <caption class=\"govuk-table__caption govuk-table__caption--m\">Proposed case links </caption>\n <thead class=\"govuk-table__head\">\n <tr class=\"govuk-table__row\">\n <th scope=\"col\" class=\"govuk-table__header\" width=\"300\">Case name and number</th>\n <th scope=\"col\" class=\"govuk-table__header\" width=\"150\">Case type </th>\n <th scope=\"col\" class=\"govuk-table__header\" width=\"200\">Service</th>\n <th scope=\"col\" class=\"govuk-table__header\" width=\"200\">State</th>\n <th scope=\"col\" class=\"govuk-table__header\" width=\"400\">Reasons for case link</th>\n <th scope=\"col\" class=\"govuk-table__header\" width=\"50\"></th>\n </tr>\n </thead>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\" *ngFor=\"let case of selectedCases; let pos = index\">\n <td class=\"govuk-table__cell\">\n <div class=\"govuk-form-group--error\"\n [ngClass]=\"{'table-group-error':caseSelectionError && case.caseReference === linkCaseForm.value.caseNumber}\">\n </div>\n <span>{{case.caseName}} <br> {{case.caseReference | ccdCaseReference}}</span>\n </td>\n <td class=\"govuk-table__cell\" [title]=\"case.caseTypeDescription\">{{case.caseType}}</td>\n <td class=\"govuk-table__cell\">{{case.caseService}}</td>\n <td class=\"govuk-table__cell\" [title]=\"case.caseStateDescription\">{{case.caseState}}</td>\n <td class=\"govuk-table__cell\"><span\n *ngFor=\"let reason of case.reasons\">{{reason | ccdLinkCasesReasonValue}}<br></span></td>\n <td class=\"govuk-table__cell\"><a [attr.id]=\"case.caseReference\" (click)=\"onSelectedLinkedCaseRemove(pos, case.caseReference);\"\n class=\"govuk-link no-visited-state\">Remove</a></td>\n </tr>\n <tr class=\"govuk-table__row\" *ngIf=\"!selectedCases.length\">\n <td class=\"govuk-table__cell\" colspan=\"6\">\n None\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n</div>\n", styles: [".no-visited-state{color:#1d70b8;cursor:pointer}.no-visited-state:hover{color:#003078}.govuk-checkboxes{display:flex;flex-direction:column;flex-wrap:wrap;max-height:500px;width:100%;overflow-x:auto;overflow-y:hidden;padding-top:5px}.govuk-checkboxes .govuk-checkboxes__item{display:flex}::ng-deep .govuk-width-container .screen-990 .width-50{width:100%}.govuk-table__row{position:relative}.govuk-table__row .table-group-error{position:absolute;height:calc(100% - 20px);margin-left:-15px}\n"] }]
17137
+ }], () => [{ type: CasesService }, { type: i4.FormBuilder }, { type: ValidatorsUtils }, { type: LinkedCasesService }, { type: MultipageComponentStateService }], { linkedCasesStateEmitter: [{
16709
17138
  type: Output
16710
17139
  }] }); })();
16711
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LinkCasesComponent, { className: "LinkCasesComponent", filePath: "lib/shared/components/palette/linked-cases/components/link-cases/link-cases.component.ts", lineNumber: 24 }); })();
17140
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LinkCasesComponent, { className: "LinkCasesComponent", filePath: "lib/shared/components/palette/linked-cases/components/link-cases/link-cases.component.ts", lineNumber: 26 }); })();
16712
17141
 
16713
17142
  function LinkedCasesFromTableComponent_a_0_Template(rf, ctx) { if (rf & 1) {
16714
17143
  const _r1 = i0.ɵɵgetCurrentView();
@@ -17244,11 +17673,12 @@ function NoLinkedCasesComponent_ng_template_4_Template(rf, ctx) { if (rf & 1) {
17244
17673
  i0.ɵɵtext(1, "There are no cases linked to this one.");
17245
17674
  i0.ɵɵelementEnd();
17246
17675
  } }
17247
- class NoLinkedCasesComponent {
17676
+ class NoLinkedCasesComponent extends AbstractJourneyComponent {
17248
17677
  router;
17249
17678
  linkedCasesService;
17250
17679
  serverLinkedApiError;
17251
- constructor(router, linkedCasesService) {
17680
+ constructor(router, linkedCasesService, multipageComponentStateService) {
17681
+ super(multipageComponentStateService);
17252
17682
  this.router = router;
17253
17683
  this.linkedCasesService = linkedCasesService;
17254
17684
  }
@@ -17258,8 +17688,8 @@ class NoLinkedCasesComponent {
17258
17688
  onBack() {
17259
17689
  this.router.navigate(['cases', 'case-details', this.linkedCasesService.caseId], { fragment: 'Linked cases' });
17260
17690
  }
17261
- static ɵfac = function NoLinkedCasesComponent_Factory(t) { return new (t || NoLinkedCasesComponent)(i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(LinkedCasesService)); };
17262
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: NoLinkedCasesComponent, selectors: [["ccd-no-linked-cases"]], decls: 12, vars: 3, consts: [["noLinkedCases", ""], [1, "govuk-grid-row"], [1, "govuk-grid-column-full"], ["class", "govuk-heading-xl", 4, "ngIf"], ["id", "unlink-cases-error", "class", "govuk-error-message", 4, "ngIf", "ngIfElse"], [1, "govuk-body"], ["href", "javascript:void(0)", 1, "govuk-link", 3, "click"], [1, "govuk-button-group"], ["type", "button", "id", "back-button", 1, "button", "button-primary", 3, "click"], [1, "govuk-heading-xl"], ["id", "unlink-cases-error", 1, "govuk-error-message"], [1, "govuk-visually-hidden"]], template: function NoLinkedCasesComponent_Template(rf, ctx) { if (rf & 1) {
17691
+ static ɵfac = function NoLinkedCasesComponent_Factory(t) { return new (t || NoLinkedCasesComponent)(i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(LinkedCasesService), i0.ɵɵdirectiveInject(MultipageComponentStateService)); };
17692
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: NoLinkedCasesComponent, selectors: [["ccd-no-linked-cases"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 12, vars: 3, consts: [["noLinkedCases", ""], [1, "govuk-grid-row"], [1, "govuk-grid-column-full"], ["class", "govuk-heading-xl", 4, "ngIf"], ["id", "unlink-cases-error", "class", "govuk-error-message", 4, "ngIf", "ngIfElse"], [1, "govuk-body"], ["href", "javascript:void(0)", 1, "govuk-link", 3, "click"], [1, "govuk-button-group"], ["type", "button", "id", "back-button", 1, "button", "button-primary", 3, "click"], [1, "govuk-heading-xl"], ["id", "unlink-cases-error", 1, "govuk-error-message"], [1, "govuk-visually-hidden"]], template: function NoLinkedCasesComponent_Template(rf, ctx) { if (rf & 1) {
17263
17693
  const _r1 = i0.ɵɵgetCurrentView();
17264
17694
  i0.ɵɵelementStart(0, "div", 1)(1, "div", 2);
17265
17695
  i0.ɵɵtemplate(2, NoLinkedCasesComponent_h1_2_Template, 2, 0, "h1", 3)(3, NoLinkedCasesComponent_p_3_Template, 4, 1, "p", 4)(4, NoLinkedCasesComponent_ng_template_4_Template, 2, 0, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
@@ -17282,70 +17712,66 @@ class NoLinkedCasesComponent {
17282
17712
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NoLinkedCasesComponent, [{
17283
17713
  type: Component,
17284
17714
  args: [{ selector: 'ccd-no-linked-cases', template: "<div class=\"govuk-grid-row\">\n <div class=\"govuk-grid-column-full\">\n <h1 class=\"govuk-heading-xl\" *ngIf=\"serverLinkedApiError\">There is a problem</h1>\n <p id=\"unlink-cases-error\" class=\"govuk-error-message\"\n *ngIf=\"serverLinkedApiError;else noLinkedCases;\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{serverLinkedApiError.message}}\n </p>\n <ng-template #noLinkedCases>\n <p class=\"govuk-body\">There are no cases linked to this one.</p>\n </ng-template>\n <p class=\"govuk-body\">\n <a class=\"govuk-link\" href=\"javascript:void(0)\" (click)=\"onBack()\">Go back to the Linked cases tab</a>\n </p>\n <div class=\"govuk-button-group\">\n <button class=\"button button-primary\" type=\"button\" id=\"back-button\" (click)=\"onBack()\">Back</button>\n </div>\n </div>\n</div>\n" }]
17285
- }], () => [{ type: i1$1.Router }, { type: LinkedCasesService }], null); })();
17286
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(NoLinkedCasesComponent, { className: "NoLinkedCasesComponent", filePath: "lib/shared/components/palette/linked-cases/components/no-linked-cases/no-linked-cases.component.ts", lineNumber: 9 }); })();
17715
+ }], () => [{ type: i1$1.Router }, { type: LinkedCasesService }, { type: MultipageComponentStateService }], null); })();
17716
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(NoLinkedCasesComponent, { className: "NoLinkedCasesComponent", filePath: "lib/shared/components/palette/linked-cases/components/no-linked-cases/no-linked-cases.component.ts", lineNumber: 12 }); })();
17287
17717
 
17288
17718
  const _c0$I = a0 => ({ "govuk-form-group--error": a0 });
17289
17719
  function UnLinkCasesComponent_div_0_div_4_p_1_Template(rf, ctx) { if (rf & 1) {
17290
- i0.ɵɵelementStart(0, "p", 11)(1, "span", 12);
17720
+ i0.ɵɵelementStart(0, "p", 9)(1, "span", 10);
17291
17721
  i0.ɵɵtext(2, "Error:");
17292
17722
  i0.ɵɵelementEnd();
17293
17723
  i0.ɵɵtext(3);
17294
17724
  i0.ɵɵelementEnd();
17295
17725
  } if (rf & 2) {
17296
- const ctx_r1 = i0.ɵɵnextContext(3);
17726
+ const ctx_r0 = i0.ɵɵnextContext(3);
17297
17727
  i0.ɵɵadvance(3);
17298
- i0.ɵɵtextInterpolate1(" ", ctx_r1.unlinkErrorMessage, " ");
17728
+ i0.ɵɵtextInterpolate1(" ", ctx_r0.unlinkErrorMessage, " ");
17299
17729
  } }
17300
17730
  function UnLinkCasesComponent_div_0_div_4_div_3_Template(rf, ctx) { if (rf & 1) {
17301
- const _r3 = i0.ɵɵgetCurrentView();
17302
- i0.ɵɵelementStart(0, "div", 13)(1, "input", 14);
17303
- i0.ɵɵlistener("change", function UnLinkCasesComponent_div_0_div_4_div_3_Template_input_change_1_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onChange($event.target)); });
17731
+ const _r2 = i0.ɵɵgetCurrentView();
17732
+ i0.ɵɵelementStart(0, "div", 11)(1, "input", 12);
17733
+ i0.ɵɵlistener("change", function UnLinkCasesComponent_div_0_div_4_div_3_Template_input_change_1_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.onChange($event.target)); });
17304
17734
  i0.ɵɵelementEnd();
17305
- i0.ɵɵelementStart(2, "label", 15);
17735
+ i0.ɵɵelementStart(2, "label", 13);
17306
17736
  i0.ɵɵtext(3);
17307
17737
  i0.ɵɵpipe(4, "ccdCaseReference");
17308
17738
  i0.ɵɵelementEnd()();
17309
17739
  } if (rf & 2) {
17310
- const case_r4 = ctx.$implicit;
17740
+ const case_r3 = ctx.$implicit;
17311
17741
  i0.ɵɵadvance();
17312
- i0.ɵɵpropertyInterpolate1("id", "case-reference-", case_r4.caseReference, "");
17313
- i0.ɵɵproperty("value", case_r4.caseReference)("checked", case_r4.unlink);
17742
+ i0.ɵɵpropertyInterpolate1("id", "case-reference-", case_r3.caseReference, "");
17743
+ i0.ɵɵproperty("value", case_r3.caseReference)("checked", case_r3.unlink);
17314
17744
  i0.ɵɵadvance();
17315
- i0.ɵɵpropertyInterpolate("for", case_r4.caseReference);
17745
+ i0.ɵɵpropertyInterpolate("for", case_r3.caseReference);
17316
17746
  i0.ɵɵadvance();
17317
- i0.ɵɵtextInterpolate2(" ", case_r4.caseName, " ", i0.ɵɵpipeBind1(4, 7, case_r4.caseReference), " ");
17747
+ i0.ɵɵtextInterpolate2(" ", case_r3.caseName, " ", i0.ɵɵpipeBind1(4, 7, case_r3.caseReference), " ");
17318
17748
  } }
17319
17749
  function UnLinkCasesComponent_div_0_div_4_Template(rf, ctx) { if (rf & 1) {
17320
- i0.ɵɵelementStart(0, "div", 7);
17321
- i0.ɵɵtemplate(1, UnLinkCasesComponent_div_0_div_4_p_1_Template, 4, 1, "p", 8);
17322
- i0.ɵɵelementStart(2, "div", 9);
17323
- i0.ɵɵtemplate(3, UnLinkCasesComponent_div_0_div_4_div_3_Template, 5, 9, "div", 10);
17750
+ i0.ɵɵelementStart(0, "div", 5);
17751
+ i0.ɵɵtemplate(1, UnLinkCasesComponent_div_0_div_4_p_1_Template, 4, 1, "p", 6);
17752
+ i0.ɵɵelementStart(2, "div", 7);
17753
+ i0.ɵɵtemplate(3, UnLinkCasesComponent_div_0_div_4_div_3_Template, 5, 9, "div", 8);
17324
17754
  i0.ɵɵelementEnd()();
17325
17755
  } if (rf & 2) {
17326
- const ctx_r1 = i0.ɵɵnextContext(2);
17327
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(4, _c0$I, ctx_r1.unlinkErrorMessage))("formGroup", ctx_r1.unlinkCaseForm);
17756
+ const ctx_r0 = i0.ɵɵnextContext(2);
17757
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(4, _c0$I, ctx_r0.unlinkErrorMessage))("formGroup", ctx_r0.unlinkCaseForm);
17328
17758
  i0.ɵɵadvance();
17329
- i0.ɵɵproperty("ngIf", ctx_r1.unlinkErrorMessage);
17759
+ i0.ɵɵproperty("ngIf", ctx_r0.unlinkErrorMessage);
17330
17760
  i0.ɵɵadvance(2);
17331
- i0.ɵɵproperty("ngForOf", ctx_r1.linkedCases);
17761
+ i0.ɵɵproperty("ngForOf", ctx_r0.linkedCases);
17332
17762
  } }
17333
17763
  function UnLinkCasesComponent_div_0_Template(rf, ctx) { if (rf & 1) {
17334
- const _r1 = i0.ɵɵgetCurrentView();
17335
17764
  i0.ɵɵelementStart(0, "div", 1)(1, "div", 2)(2, "h1", 3);
17336
17765
  i0.ɵɵtext(3, "Select the cases you want to unlink from this case");
17337
17766
  i0.ɵɵelementEnd();
17338
17767
  i0.ɵɵtemplate(4, UnLinkCasesComponent_div_0_div_4_Template, 4, 6, "div", 4);
17339
- i0.ɵɵelementStart(5, "div", 5)(6, "button", 6);
17340
- i0.ɵɵlistener("click", function UnLinkCasesComponent_div_0_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onNext()); });
17341
- i0.ɵɵtext(7, "Next");
17342
- i0.ɵɵelementEnd()()()();
17768
+ i0.ɵɵelementEnd()();
17343
17769
  } if (rf & 2) {
17344
- const ctx_r1 = i0.ɵɵnextContext();
17770
+ const ctx_r0 = i0.ɵɵnextContext();
17345
17771
  i0.ɵɵadvance(4);
17346
- i0.ɵɵproperty("ngIf", ctx_r1.unlinkCaseForm);
17772
+ i0.ɵɵproperty("ngIf", ctx_r0.unlinkCaseForm);
17347
17773
  } }
17348
- class UnLinkCasesComponent {
17774
+ class UnLinkCasesComponent extends AbstractFieldWriteJourneyComponent {
17349
17775
  fb;
17350
17776
  casesService;
17351
17777
  linkedCasesService;
@@ -17360,7 +17786,8 @@ class UnLinkCasesComponent {
17360
17786
  unlinkErrorMessage;
17361
17787
  isLoaded;
17362
17788
  isServerError = false;
17363
- constructor(fb, casesService, linkedCasesService) {
17789
+ constructor(fb, casesService, linkedCasesService, multipageComponentStateService) {
17790
+ super(multipageComponentStateService);
17364
17791
  this.fb = fb;
17365
17792
  this.casesService = casesService;
17366
17793
  this.linkedCasesService = linkedCasesService;
@@ -17453,6 +17880,12 @@ class UnLinkCasesComponent {
17453
17880
  // Return linked cases state and error messages to the parent
17454
17881
  this.emitLinkedCasesState(navigateToNextPage);
17455
17882
  }
17883
+ next() {
17884
+ this.onNext();
17885
+ if (this.errorMessages.length === 0) {
17886
+ super.next();
17887
+ }
17888
+ }
17456
17889
  // Return linked cases state and error messages to the parent
17457
17890
  emitLinkedCasesState(isNavigateToNextPage) {
17458
17891
  this.linkedCasesStateEmitter.emit({
@@ -17465,22 +17898,22 @@ class UnLinkCasesComponent {
17465
17898
  this.errorMessages = [];
17466
17899
  this.unlinkErrorMessage = null;
17467
17900
  }
17468
- static ɵfac = function UnLinkCasesComponent_Factory(t) { return new (t || UnLinkCasesComponent)(i0.ɵɵdirectiveInject(i4.FormBuilder), i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(LinkedCasesService)); };
17469
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UnLinkCasesComponent, selectors: [["ccd-unlink-cases"]], outputs: { linkedCasesStateEmitter: "linkedCasesStateEmitter", notifyAPIFailure: "notifyAPIFailure" }, decls: 1, vars: 1, consts: [["class", "govuk-grid-row", 4, "ngIf"], [1, "govuk-grid-row"], [1, "govuk-grid-column-full"], [1, "govuk-heading-xl"], ["class", "govuk-form-group form-group", 3, "ngClass", "formGroup", 4, "ngIf"], [1, "govuk-button-group"], ["type", "button", "id", "next-button", 1, "button", "button-primary", 3, "click"], [1, "govuk-form-group", "form-group", 3, "ngClass", "formGroup"], ["id", "unlink-cases-error", "class", "govuk-error-message", 4, "ngIf"], ["data-module", "govuk-checkboxes", 1, "govuk-checkboxes"], ["class", "govuk-checkboxes__item", 4, "ngFor", "ngForOf"], ["id", "unlink-cases-error", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-checkboxes__item"], ["formArrayName", "linkedCases", "name", "linkedCases", "type", "checkbox", 1, "govuk-checkboxes__input", 3, "change", "id", "value", "checked"], [1, "govuk-label", "govuk-checkboxes__label", 3, "for"]], template: function UnLinkCasesComponent_Template(rf, ctx) { if (rf & 1) {
17470
- i0.ɵɵtemplate(0, UnLinkCasesComponent_div_0_Template, 8, 1, "div", 0);
17901
+ static ɵfac = function UnLinkCasesComponent_Factory(t) { return new (t || UnLinkCasesComponent)(i0.ɵɵdirectiveInject(i4.FormBuilder), i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(LinkedCasesService), i0.ɵɵdirectiveInject(MultipageComponentStateService)); };
17902
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UnLinkCasesComponent, selectors: [["ccd-unlink-cases"]], outputs: { linkedCasesStateEmitter: "linkedCasesStateEmitter", notifyAPIFailure: "notifyAPIFailure" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["class", "govuk-grid-row", 4, "ngIf"], [1, "govuk-grid-row"], [1, "govuk-grid-column-full"], [1, "govuk-heading-xl"], ["class", "govuk-form-group form-group", 3, "ngClass", "formGroup", 4, "ngIf"], [1, "govuk-form-group", "form-group", 3, "ngClass", "formGroup"], ["id", "unlink-cases-error", "class", "govuk-error-message", 4, "ngIf"], ["data-module", "govuk-checkboxes", 1, "govuk-checkboxes"], ["class", "govuk-checkboxes__item", 4, "ngFor", "ngForOf"], ["id", "unlink-cases-error", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-checkboxes__item"], ["formArrayName", "linkedCases", "name", "linkedCases", "type", "checkbox", 1, "govuk-checkboxes__input", 3, "change", "id", "value", "checked"], [1, "govuk-label", "govuk-checkboxes__label", 3, "for"]], template: function UnLinkCasesComponent_Template(rf, ctx) { if (rf & 1) {
17903
+ i0.ɵɵtemplate(0, UnLinkCasesComponent_div_0_Template, 5, 1, "div", 0);
17471
17904
  } if (rf & 2) {
17472
17905
  i0.ɵɵproperty("ngIf", ctx.linkedCases.length > 0);
17473
17906
  } }, dependencies: [i5.NgClass, i5.NgForOf, i5.NgIf, i4.NgControlStatusGroup, i4.FormGroupDirective, i4.FormArrayName, CaseReferencePipe], encapsulation: 2 });
17474
17907
  }
17475
17908
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UnLinkCasesComponent, [{
17476
17909
  type: Component,
17477
- args: [{ selector: 'ccd-unlink-cases', template: "<div class=\"govuk-grid-row\" *ngIf=\"linkedCases.length > 0\">\n <div class=\"govuk-grid-column-full\">\n <h1 class=\"govuk-heading-xl\">Select the cases you want to unlink from this case</h1>\n <div class=\"govuk-form-group form-group\" [ngClass]=\"{'govuk-form-group--error': unlinkErrorMessage}\" [formGroup]=\"unlinkCaseForm\" *ngIf=\"unlinkCaseForm\">\n <p id=\"unlink-cases-error\" class=\"govuk-error-message\" *ngIf=\"unlinkErrorMessage\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{unlinkErrorMessage}}\n </p>\n <div class=\"govuk-checkboxes\" data-module=\"govuk-checkboxes\">\n <div class=\"govuk-checkboxes__item\" *ngFor=\"let case of linkedCases\">\n <input class=\"govuk-checkboxes__input\" id=\"case-reference-{{case.caseReference}}\" formArrayName=\"linkedCases\" name=\"linkedCases\"\n type=\"checkbox\" [value]=\"case.caseReference\" [checked]=\"case.unlink\" (change)=\"onChange($event.target)\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"{{case.caseReference}}\">\n {{case.caseName }} {{case.caseReference | ccdCaseReference}}\n </label>\n </div>\n </div>\n </div>\n <div class=\"govuk-button-group\">\n <button class=\"button button-primary\" type=\"button\" id=\"next-button\" (click)=\"onNext()\">Next</button>\n </div>\n </div>\n</div>\n" }]
17478
- }], () => [{ type: i4.FormBuilder }, { type: CasesService }, { type: LinkedCasesService }], { linkedCasesStateEmitter: [{
17910
+ args: [{ selector: 'ccd-unlink-cases', template: "<div class=\"govuk-grid-row\" *ngIf=\"linkedCases.length > 0\">\n <div class=\"govuk-grid-column-full\">\n <h1 class=\"govuk-heading-xl\">Select the cases you want to unlink from this case</h1>\n <div class=\"govuk-form-group form-group\" [ngClass]=\"{'govuk-form-group--error': unlinkErrorMessage}\" [formGroup]=\"unlinkCaseForm\" *ngIf=\"unlinkCaseForm\">\n <p id=\"unlink-cases-error\" class=\"govuk-error-message\" *ngIf=\"unlinkErrorMessage\">\n <span class=\"govuk-visually-hidden\">Error:</span> {{unlinkErrorMessage}}\n </p>\n <div class=\"govuk-checkboxes\" data-module=\"govuk-checkboxes\">\n <div class=\"govuk-checkboxes__item\" *ngFor=\"let case of linkedCases\">\n <input class=\"govuk-checkboxes__input\" id=\"case-reference-{{case.caseReference}}\" formArrayName=\"linkedCases\" name=\"linkedCases\"\n type=\"checkbox\" [value]=\"case.caseReference\" [checked]=\"case.unlink\" (change)=\"onChange($event.target)\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"{{case.caseReference}}\">\n {{case.caseName }} {{case.caseReference | ccdCaseReference}}\n </label>\n </div>\n </div>\n </div>\n </div>\n</div>\n" }]
17911
+ }], () => [{ type: i4.FormBuilder }, { type: CasesService }, { type: LinkedCasesService }, { type: MultipageComponentStateService }], { linkedCasesStateEmitter: [{
17479
17912
  type: Output
17480
17913
  }], notifyAPIFailure: [{
17481
17914
  type: Output
17482
17915
  }] }); })();
17483
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UnLinkCasesComponent, { className: "UnLinkCasesComponent", filePath: "lib/shared/components/palette/linked-cases/components/unlink-cases/unlink-cases.component.ts", lineNumber: 14 }); })();
17916
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UnLinkCasesComponent, { className: "UnLinkCasesComponent", filePath: "lib/shared/components/palette/linked-cases/components/unlink-cases/unlink-cases.component.ts", lineNumber: 16 }); })();
17484
17917
 
17485
17918
  // tslint:disable:variable-name
17486
17919
  class LinkCaseReason {
@@ -17734,7 +18167,7 @@ class ReadLinkedCasesFieldComponent {
17734
18167
  function WriteLinkedCasesFieldComponent_ng_container_2_Template(rf, ctx) { if (rf & 1) {
17735
18168
  const _r1 = i0.ɵɵgetCurrentView();
17736
18169
  i0.ɵɵelementContainerStart(0);
17737
- i0.ɵɵelementStart(1, "ccd-linked-cases-before-you-start", 3);
18170
+ i0.ɵɵelementStart(1, "ccd-linked-cases-before-you-start", 4, 0);
17738
18171
  i0.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_2_Template_ccd_linked_cases_before_you_start_linkedCasesStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onLinkedCasesStateEmitted($event)); });
17739
18172
  i0.ɵɵelementEnd();
17740
18173
  i0.ɵɵelementContainerEnd();
@@ -17742,7 +18175,7 @@ function WriteLinkedCasesFieldComponent_ng_container_2_Template(rf, ctx) { if (r
17742
18175
  function WriteLinkedCasesFieldComponent_ng_container_3_Template(rf, ctx) { if (rf & 1) {
17743
18176
  const _r3 = i0.ɵɵgetCurrentView();
17744
18177
  i0.ɵɵelementContainerStart(0);
17745
- i0.ɵɵelementStart(1, "ccd-no-linked-cases", 3);
18178
+ i0.ɵɵelementStart(1, "ccd-no-linked-cases", 4, 0);
17746
18179
  i0.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_3_Template_ccd_no_linked_cases_linkedCasesStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onLinkedCasesStateEmitted($event)); });
17747
18180
  i0.ɵɵelementEnd();
17748
18181
  i0.ɵɵelementContainerEnd();
@@ -17750,7 +18183,7 @@ function WriteLinkedCasesFieldComponent_ng_container_3_Template(rf, ctx) { if (r
17750
18183
  function WriteLinkedCasesFieldComponent_ng_container_4_Template(rf, ctx) { if (rf & 1) {
17751
18184
  const _r4 = i0.ɵɵgetCurrentView();
17752
18185
  i0.ɵɵelementContainerStart(0);
17753
- i0.ɵɵelementStart(1, "ccd-link-cases", 3);
18186
+ i0.ɵɵelementStart(1, "ccd-link-cases", 4, 0);
17754
18187
  i0.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_4_Template_ccd_link_cases_linkedCasesStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onLinkedCasesStateEmitted($event)); });
17755
18188
  i0.ɵɵelementEnd();
17756
18189
  i0.ɵɵelementContainerEnd();
@@ -17758,7 +18191,7 @@ function WriteLinkedCasesFieldComponent_ng_container_4_Template(rf, ctx) { if (r
17758
18191
  function WriteLinkedCasesFieldComponent_ng_container_5_Template(rf, ctx) { if (rf & 1) {
17759
18192
  const _r5 = i0.ɵɵgetCurrentView();
17760
18193
  i0.ɵɵelementContainerStart(0);
17761
- i0.ɵɵelementStart(1, "ccd-unlink-cases", 3);
18194
+ i0.ɵɵelementStart(1, "ccd-unlink-cases", 4, 0);
17762
18195
  i0.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_5_Template_ccd_unlink_cases_linkedCasesStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onLinkedCasesStateEmitted($event)); });
17763
18196
  i0.ɵɵelementEnd();
17764
18197
  i0.ɵɵelementContainerEnd();
@@ -17766,12 +18199,12 @@ function WriteLinkedCasesFieldComponent_ng_container_5_Template(rf, ctx) { if (r
17766
18199
  function WriteLinkedCasesFieldComponent_ng_container_6_Template(rf, ctx) { if (rf & 1) {
17767
18200
  const _r6 = i0.ɵɵgetCurrentView();
17768
18201
  i0.ɵɵelementContainerStart(0);
17769
- i0.ɵɵelementStart(1, "ccd-linked-cases-check-your-answers", 3);
18202
+ i0.ɵɵelementStart(1, "ccd-linked-cases-check-your-answers", 4, 0);
17770
18203
  i0.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesFieldComponent_ng_container_6_Template_ccd_linked_cases_check_your_answers_linkedCasesStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onLinkedCasesStateEmitted($event)); });
17771
18204
  i0.ɵɵelementEnd();
17772
18205
  i0.ɵɵelementContainerEnd();
17773
18206
  } }
17774
- class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
18207
+ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteJourneyComponent {
17775
18208
  appConfig;
17776
18209
  commonDataService;
17777
18210
  casesService;
@@ -17784,8 +18217,8 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
17784
18217
  linkedCasesEventTriggers = LinkedCasesEventTriggers;
17785
18218
  linkedCases = [];
17786
18219
  subscriptions = new Subscription();
17787
- constructor(appConfig, commonDataService, casesService, linkedCasesService, caseEditDataService) {
17788
- super();
18220
+ constructor(appConfig, commonDataService, casesService, linkedCasesService, caseEditDataService, multipageComponentStateService) {
18221
+ super(multipageComponentStateService);
17789
18222
  this.appConfig = appConfig;
17790
18223
  this.commonDataService = commonDataService;
17791
18224
  this.casesService = casesService;
@@ -17810,6 +18243,18 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
17810
18243
  this.subscriptions.add(this.caseEditDataService.caseEditForm$.subscribe({
17811
18244
  next: editForm => this.caseEditForm = editForm
17812
18245
  }));
18246
+ this.journeyPageNumber = this.journeyStartPageNumber = LinkedCasesPages.BEFORE_YOU_START;
18247
+ this.journeyEndPageNumber = LinkedCasesPages.CHECK_YOUR_ANSWERS;
18248
+ if (this.linkedCasesService.cameFromFinalStep) {
18249
+ this.linkedCasesPage = LinkedCasesPages.CHECK_YOUR_ANSWERS;
18250
+ this.journeyPageNumber = LinkedCasesPages.CHECK_YOUR_ANSWERS;
18251
+ this.caseEditDataService.setLinkedCasesJourneyAtFinalStep(true);
18252
+ }
18253
+ this.multipageComponentStateService.isAtStart = this.journeyPageNumber === this.journeyStartPageNumber;
18254
+ }
18255
+ onPageChange() {
18256
+ const isAtStart = this.journeyPageNumber === this.journeyStartPageNumber || this.linkedCasesPage === LinkedCasesPages.BEFORE_YOU_START;
18257
+ this.multipageComponentStateService.isAtStart = isAtStart;
17813
18258
  }
17814
18259
  initialiseCaseDetails(caseDetails) {
17815
18260
  if (caseDetails) {
@@ -17867,6 +18312,8 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
17867
18312
  }
17868
18313
  proceedToNextPage() {
17869
18314
  if (this.isAtFinalPage()) {
18315
+ // Set the journey page to the end page.
18316
+ this.journeyPageNumber = this.journeyEndPageNumber;
17870
18317
  // Continue button event must be allowed in final page
17871
18318
  this.caseEditDataService.setLinkedCasesJourneyAtFinalStep(true);
17872
18319
  // Trigger validation to clear the "notAtFinalPage" error if now at the final state
@@ -17878,6 +18325,7 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
17878
18325
  // Continue button event must not be allowed if not in final page
17879
18326
  this.caseEditDataService.setLinkedCasesJourneyAtFinalStep(false);
17880
18327
  }
18328
+ this.nextPage();
17881
18329
  }
17882
18330
  submitLinkedCases() {
17883
18331
  if (!this.linkedCasesService.isLinkedCasesEventTrigger) {
@@ -17908,24 +18356,53 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
17908
18356
  });
17909
18357
  if (caseViewFiltered) {
17910
18358
  const caseLinkFieldValue = caseViewFiltered.map(filtered => filtered.fields?.length > 0 && filtered.fields.filter(field => field.id === 'caseLinks')[0].value);
17911
- this.linkedCasesService.caseFieldValue = caseLinkFieldValue.length ? caseLinkFieldValue[0] : [];
17912
- this.linkedCasesService.getAllLinkedCaseInformation();
18359
+ if (!this.linkedCasesService.caseFieldValue.length) {
18360
+ this.linkedCasesService.caseFieldValue = caseLinkFieldValue.length ? caseLinkFieldValue[0] : [];
18361
+ this.linkedCasesService.getAllLinkedCaseInformation();
18362
+ }
17913
18363
  }
17914
18364
  // Initialise the first page to display
17915
- this.linkedCasesPage = this.linkedCasesService.isLinkedCasesEventTrigger ||
17916
- (this.linkedCasesService.caseFieldValue && this.linkedCasesService.caseFieldValue.length > 0
17917
- && !this.linkedCasesService.serverLinkedApiError)
17918
- ? LinkedCasesPages.BEFORE_YOU_START
17919
- : LinkedCasesPages.NO_LINKED_CASES;
18365
+ if (!this.linkedCasesService.cameFromFinalStep) {
18366
+ this.linkedCasesPage = this.linkedCasesService.isLinkedCasesEventTrigger ||
18367
+ (this.linkedCasesService.caseFieldValue && this.linkedCasesService.caseFieldValue.length > 0
18368
+ && !this.linkedCasesService.serverLinkedApiError)
18369
+ ? LinkedCasesPages.BEFORE_YOU_START
18370
+ : LinkedCasesPages.NO_LINKED_CASES;
18371
+ }
17920
18372
  });
17921
18373
  }
17922
18374
  ngOnDestroy() {
17923
18375
  this.subscriptions.unsubscribe();
17924
18376
  }
17925
- static ɵfac = function WriteLinkedCasesFieldComponent_Factory(t) { return new (t || WriteLinkedCasesFieldComponent)(i0.ɵɵdirectiveInject(AbstractAppConfig), i0.ɵɵdirectiveInject(CommonDataService), i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(LinkedCasesService), i0.ɵɵdirectiveInject(CaseEditDataService)); };
17926
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: WriteLinkedCasesFieldComponent, selectors: [["ccd-write-linked-cases-field"]], features: [i0.ɵɵ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) { if (rf & 1) {
17927
- i0.ɵɵelementStart(0, "div", 0)(1, "div", 1);
17928
- i0.ɵɵtemplate(2, WriteLinkedCasesFieldComponent_ng_container_2_Template, 2, 0, "ng-container", 2)(3, WriteLinkedCasesFieldComponent_ng_container_3_Template, 2, 0, "ng-container", 2)(4, WriteLinkedCasesFieldComponent_ng_container_4_Template, 2, 0, "ng-container", 2)(5, WriteLinkedCasesFieldComponent_ng_container_5_Template, 2, 0, "ng-container", 2)(6, WriteLinkedCasesFieldComponent_ng_container_6_Template, 2, 0, "ng-container", 2);
18377
+ previousPage() {
18378
+ if (this.linkedCasesService.isLinkedCasesEventTrigger) {
18379
+ if (this.linkedCasesPage === LinkedCasesPages.CHECK_YOUR_ANSWERS) {
18380
+ this.linkedCasesPage = LinkedCasesPages.LINK_CASE;
18381
+ }
18382
+ else if (this.linkedCasesPage === LinkedCasesPages.LINK_CASE) {
18383
+ this.linkedCasesPage = LinkedCasesPages.BEFORE_YOU_START;
18384
+ }
18385
+ else {
18386
+ this.linkedCasesPage--;
18387
+ }
18388
+ }
18389
+ else {
18390
+ if (this.linkedCasesPage === LinkedCasesPages.UNLINK_CASE) {
18391
+ this.linkedCasesPage = this.linkedCasesPages.BEFORE_YOU_START;
18392
+ }
18393
+ else if (this.linkedCasesPage === LinkedCasesPages.CHECK_YOUR_ANSWERS) {
18394
+ this.linkedCasesPage = this.linkedCasesPages.UNLINK_CASE;
18395
+ }
18396
+ else {
18397
+ this.linkedCasesPage--;
18398
+ }
18399
+ }
18400
+ super.previousPage();
18401
+ }
18402
+ static ɵfac = function WriteLinkedCasesFieldComponent_Factory(t) { return new (t || WriteLinkedCasesFieldComponent)(i0.ɵɵdirectiveInject(AbstractAppConfig), i0.ɵɵdirectiveInject(CommonDataService), i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(LinkedCasesService), i0.ɵɵdirectiveInject(CaseEditDataService), i0.ɵɵdirectiveInject(MultipageComponentStateService)); };
18403
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: WriteLinkedCasesFieldComponent, selectors: [["ccd-write-linked-cases-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 7, vars: 7, consts: [["journeyChild", ""], [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) { if (rf & 1) {
18404
+ i0.ɵɵelementStart(0, "div", 1)(1, "div", 2);
18405
+ i0.ɵɵtemplate(2, WriteLinkedCasesFieldComponent_ng_container_2_Template, 3, 0, "ng-container", 3)(3, WriteLinkedCasesFieldComponent_ng_container_3_Template, 3, 0, "ng-container", 3)(4, WriteLinkedCasesFieldComponent_ng_container_4_Template, 3, 0, "ng-container", 3)(5, WriteLinkedCasesFieldComponent_ng_container_5_Template, 3, 0, "ng-container", 3)(6, WriteLinkedCasesFieldComponent_ng_container_6_Template, 3, 0, "ng-container", 3);
17929
18406
  i0.ɵɵelementEnd()();
17930
18407
  } if (rf & 2) {
17931
18408
  i0.ɵɵproperty("formGroup", ctx.formGroup);
@@ -17945,8 +18422,8 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
17945
18422
  }
17946
18423
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WriteLinkedCasesFieldComponent, [{
17947
18424
  type: Component,
17948
- args: [{ selector: 'ccd-write-linked-cases-field', template: "<div class=\"form-group govuk-!-margin-bottom-2\" [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngSwitch]=\"linkedCasesPage\">\n <ng-container *ngSwitchCase=\"linkedCasesPages.BEFORE_YOU_START\">\n <ccd-linked-cases-before-you-start\n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\"></ccd-linked-cases-before-you-start>\n </ng-container>\n <ng-container *ngSwitchCase=\"linkedCasesPages.NO_LINKED_CASES\">\n <ccd-no-linked-cases\n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\"></ccd-no-linked-cases>\n </ng-container>\n <ng-container *ngSwitchCase=\"linkedCasesPages.LINK_CASE\">\n <ccd-link-cases\n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\"></ccd-link-cases>\n </ng-container>\n <ng-container *ngSwitchCase=\"linkedCasesPages.UNLINK_CASE\">\n <ccd-unlink-cases\n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\"></ccd-unlink-cases>\n </ng-container>\n <ng-container *ngSwitchCase=\"linkedCasesPages.CHECK_YOUR_ANSWERS\">\n <ccd-linked-cases-check-your-answers\n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\"></ccd-linked-cases-check-your-answers>\n </ng-container>\n </div>\n</div>\n" }]
17949
- }], () => [{ type: AbstractAppConfig }, { type: CommonDataService }, { type: CasesService }, { type: LinkedCasesService }, { type: CaseEditDataService }], null); })();
18425
+ args: [{ selector: 'ccd-write-linked-cases-field', template: "<div class=\"form-group govuk-!-margin-bottom-2\" [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngSwitch]=\"linkedCasesPage\">\n <ng-container *ngSwitchCase=\"linkedCasesPages.BEFORE_YOU_START\">\n <ccd-linked-cases-before-you-start\n #journeyChild \n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\">\n </ccd-linked-cases-before-you-start>\n </ng-container>\n <ng-container *ngSwitchCase=\"linkedCasesPages.NO_LINKED_CASES\">\n <ccd-no-linked-cases\n #journeyChild \n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\">\n </ccd-no-linked-cases>\n </ng-container>\n <ng-container *ngSwitchCase=\"linkedCasesPages.LINK_CASE\">\n <ccd-link-cases\n #journeyChild \n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\">\n </ccd-link-cases>\n </ng-container>\n <ng-container *ngSwitchCase=\"linkedCasesPages.UNLINK_CASE\">\n <ccd-unlink-cases\n #journeyChild \n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\">\n </ccd-unlink-cases>\n </ng-container>\n <ng-container *ngSwitchCase=\"linkedCasesPages.CHECK_YOUR_ANSWERS\">\n <ccd-linked-cases-check-your-answers\n #journeyChild \n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\">\n </ccd-linked-cases-check-your-answers>\n </ng-container>\n </div>\n</div>\n" }]
18426
+ }], () => [{ type: AbstractAppConfig }, { type: CommonDataService }, { type: CasesService }, { type: LinkedCasesService }, { type: CaseEditDataService }, { type: MultipageComponentStateService }], null); })();
17950
18427
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(WriteLinkedCasesFieldComponent, { className: "WriteLinkedCasesFieldComponent", filePath: "lib/shared/components/palette/linked-cases/write-linked-cases-field.component.ts", lineNumber: 19 }); })();
17951
18428
 
17952
18429
  function ReadMoneyGbpFieldComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
@@ -22709,10 +23186,10 @@ function AddCommentsComponent_span_7_Template(rf, ctx) { if (rf & 1) {
22709
23186
  i0.ɵɵtextInterpolate1(" (", i0.ɵɵpipeBind1(2, 1, "optional"), ")");
22710
23187
  } }
22711
23188
  function AddCommentsComponent_div_11_Template(rf, ctx) { if (rf & 1) {
22712
- i0.ɵɵelementStart(0, "div", 14)(1, "span", 15);
23189
+ i0.ɵɵelementStart(0, "div", 12)(1, "span", 13);
22713
23190
  i0.ɵɵtext(2, "!");
22714
23191
  i0.ɵɵelementEnd();
22715
- i0.ɵɵelementStart(3, "strong", 16)(4, "span", 17);
23192
+ i0.ɵɵelementStart(3, "strong", 14)(4, "span", 15);
22716
23193
  i0.ɵɵtext(5);
22717
23194
  i0.ɵɵpipe(6, "rpxTranslate");
22718
23195
  i0.ɵɵelementEnd();
@@ -22727,7 +23204,7 @@ function AddCommentsComponent_div_11_Template(rf, ctx) { if (rf & 1) {
22727
23204
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(8, 4, ctx_r0.addCommentsStepEnum.WARNING_TEXT), " ");
22728
23205
  } }
22729
23206
  function AddCommentsComponent_div_12_Template(rf, ctx) { if (rf & 1) {
22730
- i0.ɵɵelementStart(0, "div", 18)(1, "span", 19);
23207
+ i0.ɵɵelementStart(0, "div", 16)(1, "span", 17);
22731
23208
  i0.ɵɵtext(2);
22732
23209
  i0.ɵɵpipe(3, "rpxTranslate");
22733
23210
  i0.ɵɵelementEnd();
@@ -22742,7 +23219,7 @@ function AddCommentsComponent_div_12_Template(rf, ctx) { if (rf & 1) {
22742
23219
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.flagCommentsNotEnteredErrorMessage), " ");
22743
23220
  } }
22744
23221
  function AddCommentsComponent_div_13_Template(rf, ctx) { if (rf & 1) {
22745
- i0.ɵɵelementStart(0, "div", 20)(1, "span", 19);
23222
+ i0.ɵɵelementStart(0, "div", 18)(1, "span", 17);
22746
23223
  i0.ɵɵtext(2);
22747
23224
  i0.ɵɵpipe(3, "rpxTranslate");
22748
23225
  i0.ɵɵelementEnd();
@@ -22756,7 +23233,7 @@ function AddCommentsComponent_div_13_Template(rf, ctx) { if (rf & 1) {
22756
23233
  i0.ɵɵadvance(2);
22757
23234
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.flagCommentsCharLimitErrorMessage), " ");
22758
23235
  } }
22759
- class AddCommentsComponent {
23236
+ class AddCommentsComponent extends AbstractJourneyComponent {
22760
23237
  formGroup;
22761
23238
  optional = false;
22762
23239
  isDisplayContextParameterExternal = false;
@@ -22815,8 +23292,14 @@ class AddCommentsComponent {
22815
23292
  });
22816
23293
  }
22817
23294
  }
22818
- static ɵfac = function AddCommentsComponent_Factory(t) { return new (t || AddCommentsComponent)(); };
22819
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AddCommentsComponent, selectors: [["ccd-add-comments"]], inputs: { formGroup: "formGroup", optional: "optional", isDisplayContextParameterExternal: "isDisplayContextParameterExternal", isDisplayContextParameter2Point1Enabled: "isDisplayContextParameter2Point1Enabled" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, decls: 22, vars: 24, consts: [[3, "formGroup"], ["data-module", "govuk-character-count", "data-maxlength", "200", 1, "govuk-character-count"], [1, "govuk-form-group", 3, "ngClass"], [1, "govuk-label-wrapper"], [1, "govuk-label", "govuk-label--m", 3, "for"], [4, "ngIf"], ["id", "add-comments-hint", 1, "govuk-hint"], ["class", "govuk-warning-text", 4, "ngIf"], ["id", "flag-comments-not-entered-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "add-comments-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["rows", "5", "aria-describedby", "add-comments-hint add-comments-char-limit-info add-comments-char-limit-error", 1, "govuk-textarea", 3, "id", "name", "formControlName"], ["id", "add-comments-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], [1, "govuk-button-group"], ["type", "button", 1, "button", "button-primary", 3, "click"], [1, "govuk-warning-text"], ["aria-hidden", "true", 1, "govuk-warning-text__icon"], [1, "govuk-warning-text__text"], [1, "govuk-warning-text__assistive"], ["id", "flag-comments-not-entered-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "add-comments-char-limit-error", 1, "govuk-error-message"]], template: function AddCommentsComponent_Template(rf, ctx) { if (rf & 1) {
23295
+ next() {
23296
+ this.onNext();
23297
+ if (this.errorMessages.length === 0) {
23298
+ super.next();
23299
+ }
23300
+ }
23301
+ static ɵfac = /*@__PURE__*/ (() => { let ɵAddCommentsComponent_BaseFactory; return function AddCommentsComponent_Factory(t) { return (ɵAddCommentsComponent_BaseFactory || (ɵAddCommentsComponent_BaseFactory = i0.ɵɵgetInheritedFactory(AddCommentsComponent)))(t || AddCommentsComponent); }; })();
23302
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AddCommentsComponent, selectors: [["ccd-add-comments"]], inputs: { formGroup: "formGroup", optional: "optional", isDisplayContextParameterExternal: "isDisplayContextParameterExternal", isDisplayContextParameter2Point1Enabled: "isDisplayContextParameter2Point1Enabled" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 18, vars: 21, consts: [[3, "formGroup"], ["data-module", "govuk-character-count", "data-maxlength", "200", 1, "govuk-character-count"], [1, "govuk-form-group", 3, "ngClass"], [1, "govuk-label-wrapper"], [1, "govuk-label", "govuk-label--m", 3, "for"], [4, "ngIf"], ["id", "add-comments-hint", 1, "govuk-hint"], ["class", "govuk-warning-text", 4, "ngIf"], ["id", "flag-comments-not-entered-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "add-comments-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["rows", "5", "aria-describedby", "add-comments-hint add-comments-char-limit-info add-comments-char-limit-error", 1, "govuk-textarea", 3, "id", "name", "formControlName"], ["id", "add-comments-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], [1, "govuk-warning-text"], ["aria-hidden", "true", 1, "govuk-warning-text__icon"], [1, "govuk-warning-text__text"], [1, "govuk-warning-text__assistive"], ["id", "flag-comments-not-entered-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "add-comments-char-limit-error", 1, "govuk-error-message"]], template: function AddCommentsComponent_Template(rf, ctx) { if (rf & 1) {
22820
23303
  i0.ɵɵelementContainerStart(0, 0);
22821
23304
  i0.ɵɵelementStart(1, "div", 1)(2, "div", 2)(3, "h1", 3)(4, "label", 4);
22822
23305
  i0.ɵɵtext(5);
@@ -22834,23 +23317,18 @@ class AddCommentsComponent {
22834
23317
  i0.ɵɵpipe(17, "rpxTranslate");
22835
23318
  i0.ɵɵelementEnd()()();
22836
23319
  i0.ɵɵelementContainerEnd();
22837
- i0.ɵɵelementStart(18, "div", 12)(19, "button", 13);
22838
- i0.ɵɵlistener("click", function AddCommentsComponent_Template_button_click_19_listener() { return ctx.onNext(); });
22839
- i0.ɵɵtext(20);
22840
- i0.ɵɵpipe(21, "rpxTranslate");
22841
- i0.ɵɵelementEnd()();
22842
23320
  } if (rf & 2) {
22843
23321
  i0.ɵɵproperty("formGroup", ctx.formGroup);
22844
23322
  i0.ɵɵadvance(2);
22845
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(22, _c0$s, ctx.errorMessages.length > 0));
23323
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(19, _c0$s, ctx.errorMessages.length > 0));
22846
23324
  i0.ɵɵadvance(2);
22847
23325
  i0.ɵɵproperty("for", ctx.flagCommentsControlName);
22848
23326
  i0.ɵɵadvance();
22849
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 14, ctx.addCommentsTitle), "");
23327
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 13, ctx.addCommentsTitle), "");
22850
23328
  i0.ɵɵadvance(2);
22851
23329
  i0.ɵɵproperty("ngIf", ctx.optional);
22852
23330
  i0.ɵɵadvance(2);
22853
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(10, 16, ctx.addCommentsHint), " ");
23331
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(10, 15, ctx.addCommentsHint), " ");
22854
23332
  i0.ɵɵadvance(2);
22855
23333
  i0.ɵɵproperty("ngIf", !ctx.isDisplayContextParameterExternal && ctx.isDisplayContextParameter2Point1Enabled && !ctx.otherInternalFlagTypeSelected);
22856
23334
  i0.ɵɵadvance();
@@ -22860,14 +23338,12 @@ class AddCommentsComponent {
22860
23338
  i0.ɵɵadvance();
22861
23339
  i0.ɵɵproperty("id", ctx.flagCommentsControlName)("name", ctx.flagCommentsControlName)("formControlName", ctx.flagCommentsControlName);
22862
23340
  i0.ɵɵadvance(2);
22863
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(17, 18, ctx.addCommentsStepEnum.CHARACTER_LIMIT_INFO), " ");
22864
- i0.ɵɵadvance(4);
22865
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(21, 20, "Next"));
23341
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(17, 17, ctx.addCommentsStepEnum.CHARACTER_LIMIT_INFO), " ");
22866
23342
  } }, dependencies: [i5.NgClass, i5.NgIf, i4.DefaultValueAccessor, i4.NgControlStatus, i4.NgControlStatusGroup, i4.FormGroupDirective, i4.FormControlName, i1.RpxTranslatePipe], encapsulation: 2 });
22867
23343
  }
22868
23344
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AddCommentsComponent, [{
22869
23345
  type: Component,
22870
- args: [{ selector: 'ccd-add-comments', template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"200\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <h1 class=\"govuk-label-wrapper\"><label class=\"govuk-label govuk-label--m\" [for]=\"flagCommentsControlName\">\n {{addCommentsTitle | rpxTranslate}}<span *ngIf=\"optional\"> ({{'optional' | rpxTranslate}})</span>\n </label>\n </h1>\n <div id=\"add-comments-hint\" class=\"govuk-hint\">\n {{addCommentsHint | rpxTranslate}}\n </div>\n <div class=\"govuk-warning-text\"\n *ngIf=\"!isDisplayContextParameterExternal && isDisplayContextParameter2Point1Enabled && !otherInternalFlagTypeSelected\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-warning-text__assistive\">{{'Warning' | rpxTranslate}}</span>\n {{addCommentsStepEnum.WARNING_TEXT | rpxTranslate}}\n </strong>\n </div>\n <div id=\"flag-comments-not-entered-error-message\" class=\"govuk-error-message\"\n *ngIf=\"flagCommentsNotEnteredErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagCommentsNotEnteredErrorMessage | rpxTranslate}}\n </div>\n <div id=\"add-comments-char-limit-error\" class=\"govuk-error-message\"\n *ngIf=\"flagCommentsCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagCommentsCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea class=\"govuk-textarea\" [id]=\"flagCommentsControlName\"\n [name]=\"flagCommentsControlName\" [formControlName]=\"flagCommentsControlName\" rows=\"5\"\n aria-describedby=\"add-comments-hint add-comments-char-limit-info add-comments-char-limit-error\"></textarea>\n <div id=\"add-comments-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{addCommentsStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </div>\n </div>\n</ng-container>\n\n<div class=\"govuk-button-group\">\n <button class=\"button button-primary\" type=\"button\" (click)=\"onNext()\">{{'Next' | rpxTranslate}}</button>\n</div>\n" }]
23346
+ args: [{ selector: 'ccd-add-comments', template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"200\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <h1 class=\"govuk-label-wrapper\"><label class=\"govuk-label govuk-label--m\" [for]=\"flagCommentsControlName\">\n {{addCommentsTitle | rpxTranslate}}<span *ngIf=\"optional\"> ({{'optional' | rpxTranslate}})</span>\n </label>\n </h1>\n <div id=\"add-comments-hint\" class=\"govuk-hint\">\n {{addCommentsHint | rpxTranslate}}\n </div>\n <div class=\"govuk-warning-text\"\n *ngIf=\"!isDisplayContextParameterExternal && isDisplayContextParameter2Point1Enabled && !otherInternalFlagTypeSelected\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-warning-text__assistive\">{{'Warning' | rpxTranslate}}</span>\n {{addCommentsStepEnum.WARNING_TEXT | rpxTranslate}}\n </strong>\n </div>\n <div id=\"flag-comments-not-entered-error-message\" class=\"govuk-error-message\"\n *ngIf=\"flagCommentsNotEnteredErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagCommentsNotEnteredErrorMessage | rpxTranslate}}\n </div>\n <div id=\"add-comments-char-limit-error\" class=\"govuk-error-message\"\n *ngIf=\"flagCommentsCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagCommentsCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea class=\"govuk-textarea\" [id]=\"flagCommentsControlName\"\n [name]=\"flagCommentsControlName\" [formControlName]=\"flagCommentsControlName\" rows=\"5\"\n aria-describedby=\"add-comments-hint add-comments-char-limit-info add-comments-char-limit-error\"></textarea>\n <div id=\"add-comments-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{addCommentsStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </div>\n </div>\n</ng-container>" }]
22871
23347
  }], null, { formGroup: [{
22872
23348
  type: Input
22873
23349
  }], optional: [{
@@ -22879,7 +23355,7 @@ class AddCommentsComponent {
22879
23355
  }], caseFlagStateEmitter: [{
22880
23356
  type: Output
22881
23357
  }] }); })();
22882
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(AddCommentsComponent, { className: "AddCommentsComponent", filePath: "lib/shared/components/palette/case-flag/components/add-comments/add-comments.component.ts", lineNumber: 11 }); })();
23358
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(AddCommentsComponent, { className: "AddCommentsComponent", filePath: "lib/shared/components/palette/case-flag/components/add-comments/add-comments.component.ts", lineNumber: 12 }); })();
22883
23359
 
22884
23360
  function CaseFlagSummaryListComponent_dl_0_div_28_Template(rf, ctx) { if (rf & 1) {
22885
23361
  const _r3 = i0.ɵɵgetCurrentView();
@@ -23381,7 +23857,7 @@ class CaseFlagTableComponent {
23381
23857
 
23382
23858
  const _c0$r = a0 => ({ "form-group-error": a0 });
23383
23859
  function ManageCaseFlagsComponent_div_7_Template(rf, ctx) { if (rf & 1) {
23384
- i0.ɵɵelementStart(0, "div", 9)(1, "span", 10);
23860
+ i0.ɵɵelementStart(0, "div", 8)(1, "span", 9);
23385
23861
  i0.ɵɵtext(2);
23386
23862
  i0.ɵɵpipe(3, "rpxTranslate");
23387
23863
  i0.ɵɵelementEnd();
@@ -23396,8 +23872,8 @@ function ManageCaseFlagsComponent_div_7_Template(rf, ctx) { if (rf & 1) {
23396
23872
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.manageCaseFlagSelectedErrorMessage), " ");
23397
23873
  } }
23398
23874
  function ManageCaseFlagsComponent_div_9_Template(rf, ctx) { if (rf & 1) {
23399
- i0.ɵɵelementStart(0, "div", 11);
23400
- i0.ɵɵelement(1, "input", 12)(2, "label", 13);
23875
+ i0.ɵɵelementStart(0, "div", 10);
23876
+ i0.ɵɵelement(1, "input", 11)(2, "label", 12);
23401
23877
  i0.ɵɵpipe(3, "manageCaseFlagsLabelDisplay");
23402
23878
  i0.ɵɵelementEnd();
23403
23879
  } if (rf & 2) {
@@ -23411,18 +23887,7 @@ function ManageCaseFlagsComponent_div_9_Template(rf, ctx) { if (rf & 1) {
23411
23887
  i0.ɵɵpropertyInterpolate1("for", "flag-selection-", i_r3, "");
23412
23888
  i0.ɵɵproperty("innerHtml", i0.ɵɵpipeBind1(3, 8, flagDisplay_r2), i0.ɵɵsanitizeHtml);
23413
23889
  } }
23414
- function ManageCaseFlagsComponent_div_10_Template(rf, ctx) { if (rf & 1) {
23415
- const _r4 = i0.ɵɵgetCurrentView();
23416
- i0.ɵɵelementStart(0, "div", 14)(1, "button", 15);
23417
- i0.ɵɵlistener("click", function ManageCaseFlagsComponent_div_10_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r4); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onNext()); });
23418
- i0.ɵɵtext(2);
23419
- i0.ɵɵpipe(3, "rpxTranslate");
23420
- i0.ɵɵelementEnd()();
23421
- } if (rf & 2) {
23422
- i0.ɵɵadvance(2);
23423
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 1, "Next"));
23424
- } }
23425
- class ManageCaseFlagsComponent {
23890
+ class ManageCaseFlagsComponent extends AbstractJourneyComponent {
23426
23891
  formGroup;
23427
23892
  flagsData;
23428
23893
  caseTitle;
@@ -23438,6 +23903,12 @@ class ManageCaseFlagsComponent {
23438
23903
  excludedFlagStatuses = [CaseFlagStatus.INACTIVE, CaseFlagStatus.NOT_APPROVED];
23439
23904
  ngOnInit() {
23440
23905
  this.manageCaseFlagTitle = this.setManageCaseFlagTitle(this.displayContextParameter);
23906
+ let originalStatus;
23907
+ // if the user has progressed to CYA and then navigated away, the flag they selected will be set as inactive, we need to reset this
23908
+ if (this.formGroup.get('selectedManageCaseLocation')) {
23909
+ const locationControl = this.formGroup.get('selectedManageCaseLocation');
23910
+ originalStatus = locationControl.value?.originalStatus;
23911
+ }
23441
23912
  // Map flags instances to objects for display, filtering out any where the original status is either "Inactive" or
23442
23913
  // "Not approved"
23443
23914
  /* istanbul ignore else */
@@ -23447,7 +23918,7 @@ class ManageCaseFlagsComponent {
23447
23918
  if (flagsInstance.flags.details && flagsInstance.flags.details.length > 0) {
23448
23919
  displayData = [
23449
23920
  ...displayData,
23450
- ...flagsInstance.flags.details.map((detail) => this.mapFlagDetailForDisplay(detail, flagsInstance))
23921
+ ...flagsInstance.flags.details.map((detail) => this.mapFlagDetailForDisplay(detail, flagsInstance, originalStatus))
23451
23922
  ];
23452
23923
  }
23453
23924
  return displayData;
@@ -23463,7 +23934,7 @@ class ManageCaseFlagsComponent {
23463
23934
  this.onNoFlagsError();
23464
23935
  }
23465
23936
  }
23466
- mapFlagDetailForDisplay(flagDetail, flagsInstance) {
23937
+ mapFlagDetailForDisplay(flagDetail, flagsInstance, originalStatusFromFG) {
23467
23938
  // Reset the flag status with the original persisted status. This is needed because ngOnInit() needs to filter
23468
23939
  // out any "Inactive" or "Not approved" flags based on their status *before* modification. If the user changes a
23469
23940
  // flag's status then decides to return to the start of the flag update journey, the flag's status would no
@@ -23486,8 +23957,9 @@ class ManageCaseFlagsComponent {
23486
23957
  }
23487
23958
  if (formattedValue && FieldsUtils.isNonEmptyObject(formattedValue)) {
23488
23959
  const originalFlagDetail = formattedValue.details?.find((detail) => detail.id === flagDetail.id);
23960
+ const statusToUse = originalStatusFromFG ? (originalStatusFromFG === originalFlagDetail.value?.status ? originalFlagDetail.value?.status : originalStatusFromFG) : originalFlagDetail.value?.status;
23489
23961
  if (originalFlagDetail) {
23490
- originalStatus = originalFlagDetail.value?.status;
23962
+ originalStatus = statusToUse;
23491
23963
  flagDetail.flagComment = originalFlagDetail.value?.flagComment;
23492
23964
  flagDetail.flagComment_cy = originalFlagDetail.value?.flagComment_cy;
23493
23965
  flagDetail.otherDescription = originalFlagDetail.value?.otherDescription;
@@ -23556,8 +24028,14 @@ class ManageCaseFlagsComponent {
23556
24028
  errorMessages: this.errorMessages
23557
24029
  });
23558
24030
  }
23559
- static ɵfac = function ManageCaseFlagsComponent_Factory(t) { return new (t || ManageCaseFlagsComponent)(); };
23560
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ManageCaseFlagsComponent, selectors: [["ccd-manage-case-flags"]], inputs: { formGroup: "formGroup", flagsData: "flagsData", caseTitle: "caseTitle", displayContextParameter: "displayContextParameter" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, decls: 11, vars: 10, consts: [[3, "formGroup"], [1, "govuk-form-group", 3, "ngClass"], ["aria-describedby", "manage-case-flag-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--m"], ["id", "manage-case-flag-heading", 1, "govuk-fieldset__heading"], ["id", "manage-case-flag-not-selected-error-message", "class", "govuk-error-message", 4, "ngIf"], ["data-module", "govuk-radios", "id", "conditional-radios-list", 1, "govuk-radios", "govuk-radios--conditional"], ["class", "govuk-radios__item", 4, "ngFor", "ngForOf"], ["class", "govuk-button-group", 4, "ngIf"], ["id", "manage-case-flag-not-selected-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "id", "name", "value", "formControlName"], [1, "govuk-label", "govuk-radios__label", 3, "for", "innerHtml"], [1, "govuk-button-group"], ["type", "button", 1, "button", "button-primary", 3, "click"]], template: function ManageCaseFlagsComponent_Template(rf, ctx) { if (rf & 1) {
24031
+ next() {
24032
+ this.onNext();
24033
+ if (this.errorMessages.length === 0) {
24034
+ super.next();
24035
+ }
24036
+ }
24037
+ static ɵfac = /*@__PURE__*/ (() => { let ɵManageCaseFlagsComponent_BaseFactory; return function ManageCaseFlagsComponent_Factory(t) { return (ɵManageCaseFlagsComponent_BaseFactory || (ɵManageCaseFlagsComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ManageCaseFlagsComponent)))(t || ManageCaseFlagsComponent); }; })();
24038
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ManageCaseFlagsComponent, selectors: [["ccd-manage-case-flags"]], inputs: { formGroup: "formGroup", flagsData: "flagsData", caseTitle: "caseTitle", displayContextParameter: "displayContextParameter" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 10, vars: 9, consts: [[3, "formGroup"], [1, "govuk-form-group", 3, "ngClass"], ["aria-describedby", "manage-case-flag-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--m"], ["id", "manage-case-flag-heading", 1, "govuk-fieldset__heading"], ["id", "manage-case-flag-not-selected-error-message", "class", "govuk-error-message", 4, "ngIf"], ["data-module", "govuk-radios", "id", "conditional-radios-list", 1, "govuk-radios", "govuk-radios--conditional"], ["class", "govuk-radios__item", 4, "ngFor", "ngForOf"], ["id", "manage-case-flag-not-selected-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "id", "name", "value", "formControlName"], [1, "govuk-label", "govuk-radios__label", 3, "for", "innerHtml"]], template: function ManageCaseFlagsComponent_Template(rf, ctx) { if (rf & 1) {
23561
24039
  i0.ɵɵelementContainerStart(0, 0);
23562
24040
  i0.ɵɵelementStart(1, "div", 1)(2, "fieldset", 2)(3, "legend", 3)(4, "h1", 4);
23563
24041
  i0.ɵɵtext(5);
@@ -23568,24 +24046,21 @@ class ManageCaseFlagsComponent {
23568
24046
  i0.ɵɵtemplate(9, ManageCaseFlagsComponent_div_9_Template, 4, 10, "div", 7);
23569
24047
  i0.ɵɵelementEnd()()();
23570
24048
  i0.ɵɵelementContainerEnd();
23571
- i0.ɵɵtemplate(10, ManageCaseFlagsComponent_div_10_Template, 4, 3, "div", 8);
23572
24049
  } if (rf & 2) {
23573
24050
  i0.ɵɵproperty("formGroup", ctx.formGroup);
23574
24051
  i0.ɵɵadvance();
23575
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c0$r, ctx.errorMessages.length > 0));
24052
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(7, _c0$r, ctx.errorMessages.length > 0));
23576
24053
  i0.ɵɵadvance(4);
23577
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 6, ctx.manageCaseFlagTitle), " ");
24054
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 5, ctx.manageCaseFlagTitle), " ");
23578
24055
  i0.ɵɵadvance(2);
23579
24056
  i0.ɵɵproperty("ngIf", ctx.manageCaseFlagSelectedErrorMessage);
23580
24057
  i0.ɵɵadvance(2);
23581
24058
  i0.ɵɵproperty("ngForOf", ctx.flagsDisplayData);
23582
- i0.ɵɵadvance();
23583
- i0.ɵɵproperty("ngIf", !ctx.noFlagsError);
23584
24059
  } }, styles: [".flag-name-and-description{font-weight:700}\n"], encapsulation: 2 });
23585
24060
  }
23586
24061
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ManageCaseFlagsComponent, [{
23587
24062
  type: Component,
23588
- args: [{ selector: 'ccd-manage-case-flags', encapsulation: ViewEncapsulation.None, template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"manage-case-flag-heading\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n <h1 id=\"manage-case-flag-heading\" class=\"govuk-fieldset__heading\">\n {{manageCaseFlagTitle | rpxTranslate}}\n </h1>\n </legend>\n <div id=\"manage-case-flag-not-selected-error-message\" class=\"govuk-error-message\"\n *ngIf=\"manageCaseFlagSelectedErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{manageCaseFlagSelectedErrorMessage | rpxTranslate}}\n </div>\n <div class=\"govuk-radios govuk-radios--conditional\" data-module=\"govuk-radios\" id=\"conditional-radios-list\">\n <div class=\"govuk-radios__item\" *ngFor=\"let flagDisplay of flagsDisplayData; index as i\">\n <input class=\"govuk-radios__input\" id=\"flag-selection-{{i}}\" [name]=\"selectedControlName\"\n type=\"radio\" [value]=\"flagDisplay\" [formControlName]=\"selectedControlName\"/>\n <label class=\"govuk-label govuk-radios__label\" for=\"flag-selection-{{i}}\" [innerHtml]=\"flagDisplay | manageCaseFlagsLabelDisplay\"></label>\n </div>\n </div>\n </fieldset>\n </div>\n</ng-container>\n\n<div class=\"govuk-button-group\" *ngIf=\"!noFlagsError\">\n <button class=\"button button-primary\" type=\"button\" (click)=\"onNext()\">{{'Next' | rpxTranslate}}</button>\n</div>\n", styles: [".flag-name-and-description{font-weight:700}\n"] }]
24063
+ args: [{ selector: 'ccd-manage-case-flags', encapsulation: ViewEncapsulation.None, template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"manage-case-flag-heading\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n <h1 id=\"manage-case-flag-heading\" class=\"govuk-fieldset__heading\">\n {{manageCaseFlagTitle | rpxTranslate}}\n </h1>\n </legend>\n <div id=\"manage-case-flag-not-selected-error-message\" class=\"govuk-error-message\"\n *ngIf=\"manageCaseFlagSelectedErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{manageCaseFlagSelectedErrorMessage | rpxTranslate}}\n </div>\n <div class=\"govuk-radios govuk-radios--conditional\" data-module=\"govuk-radios\" id=\"conditional-radios-list\">\n <div class=\"govuk-radios__item\" *ngFor=\"let flagDisplay of flagsDisplayData; index as i\">\n <input class=\"govuk-radios__input\" id=\"flag-selection-{{i}}\" [name]=\"selectedControlName\"\n type=\"radio\" [value]=\"flagDisplay\" [formControlName]=\"selectedControlName\"/>\n <label class=\"govuk-label govuk-radios__label\" for=\"flag-selection-{{i}}\" [innerHtml]=\"flagDisplay | manageCaseFlagsLabelDisplay\"></label>\n </div>\n </div>\n </fieldset>\n </div>\n</ng-container>", styles: [".flag-name-and-description{font-weight:700}\n"] }]
23589
24064
  }], null, { formGroup: [{
23590
24065
  type: Input
23591
24066
  }], flagsData: [{
@@ -23597,7 +24072,7 @@ class ManageCaseFlagsComponent {
23597
24072
  }], caseFlagStateEmitter: [{
23598
24073
  type: Output
23599
24074
  }] }); })();
23600
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ManageCaseFlagsComponent, { className: "ManageCaseFlagsComponent", filePath: "lib/shared/components/palette/case-flag/components/manage-case-flags/manage-case-flags.component.ts", lineNumber: 14 }); })();
24075
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ManageCaseFlagsComponent, { className: "ManageCaseFlagsComponent", filePath: "lib/shared/components/palette/case-flag/components/manage-case-flags/manage-case-flags.component.ts", lineNumber: 15 }); })();
23601
24076
 
23602
24077
  // tslint:disable:variable-name
23603
24078
  /**
@@ -23662,7 +24137,7 @@ var SearchLanguageInterpreterControlNames;
23662
24137
 
23663
24138
  const _c0$q = a0 => ({ "form-group-error": a0 });
23664
24139
  function SearchLanguageInterpreterComponent_div_10_Template(rf, ctx) { if (rf & 1) {
23665
- i0.ɵɵelementStart(0, "div", 20)(1, "span", 21);
24140
+ i0.ɵɵelementStart(0, "div", 18)(1, "span", 19);
23666
24141
  i0.ɵɵtext(2);
23667
24142
  i0.ɵɵpipe(3, "rpxTranslate");
23668
24143
  i0.ɵɵelementEnd();
@@ -23677,7 +24152,7 @@ function SearchLanguageInterpreterComponent_div_10_Template(rf, ctx) { if (rf &
23677
24152
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r1.languageNotSelectedErrorMessage), " ");
23678
24153
  } }
23679
24154
  function SearchLanguageInterpreterComponent_div_11_Template(rf, ctx) { if (rf & 1) {
23680
- i0.ɵɵelementStart(0, "div", 22)(1, "span", 21);
24155
+ i0.ɵɵelementStart(0, "div", 20)(1, "span", 19);
23681
24156
  i0.ɵɵtext(2);
23682
24157
  i0.ɵɵpipe(3, "rpxTranslate");
23683
24158
  i0.ɵɵelementEnd();
@@ -23692,7 +24167,7 @@ function SearchLanguageInterpreterComponent_div_11_Template(rf, ctx) { if (rf &
23692
24167
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r1.languageEnteredInBothFieldsErrorMessage), " ");
23693
24168
  } }
23694
24169
  function SearchLanguageInterpreterComponent_mat_option_15_Template(rf, ctx) { if (rf & 1) {
23695
- i0.ɵɵelementStart(0, "mat-option", 23);
24170
+ i0.ɵɵelementStart(0, "mat-option", 21);
23696
24171
  i0.ɵɵtext(1);
23697
24172
  i0.ɵɵpipe(2, "languageInterpreterDisplay");
23698
24173
  i0.ɵɵelementEnd();
@@ -23703,7 +24178,7 @@ function SearchLanguageInterpreterComponent_mat_option_15_Template(rf, ctx) { if
23703
24178
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 2, language_r3), " ");
23704
24179
  } }
23705
24180
  function SearchLanguageInterpreterComponent_mat_option_17_Template(rf, ctx) { if (rf & 1) {
23706
- i0.ɵɵelementStart(0, "mat-option", 24);
24181
+ i0.ɵɵelementStart(0, "mat-option", 22);
23707
24182
  i0.ɵɵtext(1);
23708
24183
  i0.ɵɵpipe(2, "rpxTranslate");
23709
24184
  i0.ɵɵelementEnd();
@@ -23712,7 +24187,7 @@ function SearchLanguageInterpreterComponent_mat_option_17_Template(rf, ctx) { if
23712
24187
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, "No results found"));
23713
24188
  } }
23714
24189
  function SearchLanguageInterpreterComponent_div_24_div_5_Template(rf, ctx) { if (rf & 1) {
23715
- i0.ɵɵelementStart(0, "div", 30)(1, "span", 21);
24190
+ i0.ɵɵelementStart(0, "div", 28)(1, "span", 19);
23716
24191
  i0.ɵɵtext(2);
23717
24192
  i0.ɵɵpipe(3, "rpxTranslate");
23718
24193
  i0.ɵɵelementEnd();
@@ -23727,7 +24202,7 @@ function SearchLanguageInterpreterComponent_div_24_div_5_Template(rf, ctx) { if
23727
24202
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r1.languageNotEnteredErrorMessage), " ");
23728
24203
  } }
23729
24204
  function SearchLanguageInterpreterComponent_div_24_div_6_Template(rf, ctx) { if (rf & 1) {
23730
- i0.ɵɵelementStart(0, "div", 31)(1, "span", 21);
24205
+ i0.ɵɵelementStart(0, "div", 29)(1, "span", 19);
23731
24206
  i0.ɵɵtext(2);
23732
24207
  i0.ɵɵpipe(3, "rpxTranslate");
23733
24208
  i0.ɵɵelementEnd();
@@ -23742,12 +24217,12 @@ function SearchLanguageInterpreterComponent_div_24_div_6_Template(rf, ctx) { if
23742
24217
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r1.languageCharLimitErrorMessage), " ");
23743
24218
  } }
23744
24219
  function SearchLanguageInterpreterComponent_div_24_Template(rf, ctx) { if (rf & 1) {
23745
- i0.ɵɵelementStart(0, "div", 25)(1, "div", 2)(2, "label", 26);
24220
+ i0.ɵɵelementStart(0, "div", 23)(1, "div", 2)(2, "label", 24);
23746
24221
  i0.ɵɵtext(3);
23747
24222
  i0.ɵɵpipe(4, "rpxTranslate");
23748
24223
  i0.ɵɵelementEnd();
23749
- i0.ɵɵtemplate(5, SearchLanguageInterpreterComponent_div_24_div_5_Template, 6, 6, "div", 27)(6, SearchLanguageInterpreterComponent_div_24_div_6_Template, 6, 6, "div", 28);
23750
- i0.ɵɵelement(7, "input", 29);
24224
+ i0.ɵɵtemplate(5, SearchLanguageInterpreterComponent_div_24_div_5_Template, 6, 6, "div", 25)(6, SearchLanguageInterpreterComponent_div_24_div_6_Template, 6, 6, "div", 26);
24225
+ i0.ɵɵelement(7, "input", 27);
23751
24226
  i0.ɵɵelementEnd()();
23752
24227
  } if (rf & 2) {
23753
24228
  const ctx_r1 = i0.ɵɵnextContext();
@@ -23762,7 +24237,7 @@ function SearchLanguageInterpreterComponent_div_24_Template(rf, ctx) { if (rf &
23762
24237
  i0.ɵɵadvance();
23763
24238
  i0.ɵɵproperty("name", ctx_r1.SearchLanguageInterpreterControlNames.MANUAL_LANGUAGE_ENTRY)("formControlName", ctx_r1.SearchLanguageInterpreterControlNames.MANUAL_LANGUAGE_ENTRY);
23764
24239
  } }
23765
- class SearchLanguageInterpreterComponent {
24240
+ class SearchLanguageInterpreterComponent extends AbstractJourneyComponent {
23766
24241
  rpxTranslationService;
23767
24242
  get searchLanguageInterpreterStep() {
23768
24243
  return SearchLanguageInterpreterStep;
@@ -23784,7 +24259,8 @@ class SearchLanguageInterpreterComponent {
23784
24259
  noResults = false;
23785
24260
  languageMaxCharLimit = 80;
23786
24261
  signLanguageFlagCode = 'RA0042';
23787
- constructor(rpxTranslationService) {
24262
+ constructor(rpxTranslationService, multipageComponentStateService) {
24263
+ super(multipageComponentStateService);
23788
24264
  this.rpxTranslationService = rpxTranslationService;
23789
24265
  }
23790
24266
  ngOnInit() {
@@ -23884,8 +24360,14 @@ class SearchLanguageInterpreterComponent {
23884
24360
  !language.value && language.value_cy.toLowerCase().includes(searchTerm.toLowerCase(), 0))
23885
24361
  : [];
23886
24362
  }
23887
- static ɵfac = function SearchLanguageInterpreterComponent_Factory(t) { return new (t || SearchLanguageInterpreterComponent)(i0.ɵɵdirectiveInject(i1.RpxTranslationService)); };
23888
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SearchLanguageInterpreterComponent, selectors: [["ccd-search-language-interpreter"]], inputs: { formGroup: "formGroup", flagType: "flagType" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, decls: 29, vars: 28, consts: [["autoSearchLanguage", "matAutocomplete"], [3, "formGroup"], [1, "govuk-form-group", 3, "ngClass"], [1, "govuk-label-wrapper"], [1, "govuk-label", "govuk-label--m", 3, "for"], ["id", "language-search-box-hint", 1, "govuk-hint"], [1, "auto-complete-container"], ["id", "language-not-selected-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "language-entered-in-both-fields-error-message", "class", "govuk-error-message", 4, "ngIf"], ["aria-label", "Language search box", "matInput", "", "type", "text", 1, "govuk-input", "search-language__input", 3, "formControlName", "matAutocomplete"], ["autoActiveFirstOption", "", 1, "mat-autocomplete-panel-extend", 3, "displayWith"], [3, "value", 4, "ngFor", "ngForOf"], ["disabled", "", 4, "ngIf"], ["data-module", "govuk-checkboxes", 1, "govuk-checkboxes", "govuk-checkboxes--small", "govuk-checkboxes--conditional"], [1, "govuk-radios__item"], ["id", "enter-language-manually", "name", "enter-language-manually", "type", "checkbox", 1, "govuk-checkboxes__input", 3, "change"], ["for", "enter-language-manually", 1, "govuk-label", "govuk-checkboxes__label"], ["class", "govuk-radios__conditional", 4, "ngIf"], [1, "govuk-button-group"], ["type", "button", 1, "button", "button-primary", 3, "click"], ["id", "language-not-selected-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "language-entered-in-both-fields-error-message", 1, "govuk-error-message"], [3, "value"], ["disabled", ""], [1, "govuk-radios__conditional"], ["for", "manual-language-entry", 1, "govuk-label"], ["id", "language-not-entered-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "language-char-limit-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "manual-language-entry", "type", "text", 1, "govuk-input", "govuk-input--width-20", 3, "name", "formControlName"], ["id", "language-not-entered-error-message", 1, "govuk-error-message"], ["id", "language-char-limit-error-message", 1, "govuk-error-message"]], template: function SearchLanguageInterpreterComponent_Template(rf, ctx) { if (rf & 1) {
24363
+ next() {
24364
+ this.onNext();
24365
+ if (this.errorMessages.length === 0) {
24366
+ super.next();
24367
+ }
24368
+ }
24369
+ static ɵfac = function SearchLanguageInterpreterComponent_Factory(t) { return new (t || SearchLanguageInterpreterComponent)(i0.ɵɵdirectiveInject(i1.RpxTranslationService), i0.ɵɵdirectiveInject(MultipageComponentStateService)); };
24370
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SearchLanguageInterpreterComponent, selectors: [["ccd-search-language-interpreter"]], inputs: { formGroup: "formGroup", flagType: "flagType" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 25, vars: 25, consts: [["autoSearchLanguage", "matAutocomplete"], [3, "formGroup"], [1, "govuk-form-group", 3, "ngClass"], [1, "govuk-label-wrapper"], [1, "govuk-label", "govuk-label--m", 3, "for"], ["id", "language-search-box-hint", 1, "govuk-hint"], [1, "auto-complete-container"], ["id", "language-not-selected-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "language-entered-in-both-fields-error-message", "class", "govuk-error-message", 4, "ngIf"], ["aria-label", "Language search box", "matInput", "", "type", "text", 1, "govuk-input", "search-language__input", 3, "formControlName", "matAutocomplete"], ["autoActiveFirstOption", "", 1, "mat-autocomplete-panel-extend", 3, "displayWith"], [3, "value", 4, "ngFor", "ngForOf"], ["disabled", "", 4, "ngIf"], ["data-module", "govuk-checkboxes", 1, "govuk-checkboxes", "govuk-checkboxes--small", "govuk-checkboxes--conditional"], [1, "govuk-radios__item"], ["id", "enter-language-manually", "name", "enter-language-manually", "type", "checkbox", 1, "govuk-checkboxes__input", 3, "change"], ["for", "enter-language-manually", 1, "govuk-label", "govuk-checkboxes__label"], ["class", "govuk-radios__conditional", 4, "ngIf"], ["id", "language-not-selected-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "language-entered-in-both-fields-error-message", 1, "govuk-error-message"], [3, "value"], ["disabled", ""], [1, "govuk-radios__conditional"], ["for", "manual-language-entry", 1, "govuk-label"], ["id", "language-not-entered-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "language-char-limit-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "manual-language-entry", "type", "text", 1, "govuk-input", "govuk-input--width-20", 3, "name", "formControlName"], ["id", "language-not-entered-error-message", 1, "govuk-error-message"], ["id", "language-char-limit-error-message", 1, "govuk-error-message"]], template: function SearchLanguageInterpreterComponent_Template(rf, ctx) { if (rf & 1) {
23889
24371
  const _r1 = i0.ɵɵgetCurrentView();
23890
24372
  i0.ɵɵelementContainerStart(0, 1);
23891
24373
  i0.ɵɵelementStart(1, "div", 2)(2, "h1", 3)(3, "label", 4);
@@ -23914,22 +24396,17 @@ class SearchLanguageInterpreterComponent {
23914
24396
  i0.ɵɵtemplate(24, SearchLanguageInterpreterComponent_div_24_Template, 8, 10, "div", 17);
23915
24397
  i0.ɵɵelementEnd()();
23916
24398
  i0.ɵɵelementContainerEnd();
23917
- i0.ɵɵelementStart(25, "div", 18)(26, "button", 19);
23918
- i0.ɵɵlistener("click", function SearchLanguageInterpreterComponent_Template_button_click_26_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onNext()); });
23919
- i0.ɵɵtext(27);
23920
- i0.ɵɵpipe(28, "rpxTranslate");
23921
- i0.ɵɵelementEnd()();
23922
24399
  } if (rf & 2) {
23923
24400
  const autoSearchLanguage_r4 = i0.ɵɵreference(14);
23924
24401
  i0.ɵɵproperty("formGroup", ctx.formGroup);
23925
24402
  i0.ɵɵadvance();
23926
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(26, _c0$q, ctx.languageNotSelectedErrorMessage || ctx.languageEnteredInBothFieldsErrorMessage));
24403
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(23, _c0$q, ctx.languageNotSelectedErrorMessage || ctx.languageEnteredInBothFieldsErrorMessage));
23927
24404
  i0.ɵɵadvance(2);
23928
24405
  i0.ɵɵproperty("for", ctx.SearchLanguageInterpreterControlNames.LANGUAGE_SEARCH_TERM);
23929
24406
  i0.ɵɵadvance();
23930
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind2(5, 15, ctx.flagType, "name"), " ");
24407
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind2(5, 14, ctx.flagType, "name"), " ");
23931
24408
  i0.ɵɵadvance(3);
23932
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(8, 18, ctx.searchLanguageInterpreterHint), " ");
24409
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(8, 17, ctx.searchLanguageInterpreterHint), " ");
23933
24410
  i0.ɵɵadvance(3);
23934
24411
  i0.ɵɵproperty("ngIf", ctx.languageNotSelectedErrorMessage);
23935
24412
  i0.ɵɵadvance();
@@ -23939,32 +24416,30 @@ class SearchLanguageInterpreterComponent {
23939
24416
  i0.ɵɵadvance();
23940
24417
  i0.ɵɵproperty("displayWith", ctx.displayLanguage);
23941
24418
  i0.ɵɵadvance(2);
23942
- i0.ɵɵproperty("ngForOf", i0.ɵɵpipeBind1(16, 20, ctx.filteredLanguages$));
24419
+ i0.ɵɵproperty("ngForOf", i0.ɵɵpipeBind1(16, 19, ctx.filteredLanguages$));
23943
24420
  i0.ɵɵadvance(2);
23944
24421
  i0.ɵɵproperty("ngIf", ctx.noResults && ctx.searchTerm && ctx.searchTerm.length >= ctx.minSearchCharacters);
23945
24422
  i0.ɵɵadvance(5);
23946
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(23, 22, ctx.searchLanguageInterpreterStep.CHECKBOX_LABEL), " ");
24423
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(23, 21, ctx.searchLanguageInterpreterStep.CHECKBOX_LABEL), " ");
23947
24424
  i0.ɵɵadvance(2);
23948
24425
  i0.ɵɵproperty("ngIf", ctx.isCheckboxEnabled);
23949
- i0.ɵɵadvance(3);
23950
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(28, 24, "Next"));
23951
24426
  } }, styles: [".autocomplete__input--show-all-values[_ngcontent-%COMP%]{padding:5px 34px 5px 5px;cursor:pointer}.autocomplete__dropdown-arrow-down[_ngcontent-%COMP%]{z-index:-1;display:inline-block;position:absolute;right:8px;width:24px;height:24px;top:10px}.autocomplete__menu[_ngcontent-%COMP%]{background-color:#fff;border:2px solid #0b0c0c;border-top:0;color:#0b0c0c;margin:0;max-height:342px;overflow-x:hidden;padding:0;width:100%;width:calc(100% - 4px)}.autocomplete__menu--visible[_ngcontent-%COMP%]{display:block}.autocomplete__menu--hidden[_ngcontent-%COMP%]{display:none}.autocomplete__menu--overlay[_ngcontent-%COMP%]{box-shadow:#00000042 0 2px 6px;left:0;position:absolute;top:100%;z-index:100}.autocomplete__menu--inline[_ngcontent-%COMP%]{position:relative}.autocomplete__option[_ngcontent-%COMP%]{border-bottom:solid #b1b4b6;border-width:1px 0;cursor:pointer;display:block;position:relative}.autocomplete__option[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{pointer-events:none}.autocomplete__option[_ngcontent-%COMP%]:first-of-type{border-top-width:0}.autocomplete__option[_ngcontent-%COMP%]:last-of-type{border-bottom-width:0}.autocomplete__option--odd[_ngcontent-%COMP%]{background-color:#fafafa}.autocomplete__option--focused[_ngcontent-%COMP%], .autocomplete__option[_ngcontent-%COMP%]:hover{background-color:#1d70b8;border-color:#1d70b8;color:#fff;outline:0}.autocomplete__option--no-results[_ngcontent-%COMP%]{background-color:#fafafa;color:#646b6f;cursor:not-allowed}.autocomplete__hint[_ngcontent-%COMP%], .autocomplete__input[_ngcontent-%COMP%], .autocomplete__option[_ngcontent-%COMP%]{font-size:13px;line-height:1.25}.autocomplete__hint[_ngcontent-%COMP%], .autocomplete__option[_ngcontent-%COMP%]{padding:5px}@media (min-width: 641px){.autocomplete__hint[_ngcontent-%COMP%], .autocomplete__input[_ngcontent-%COMP%], .autocomplete__option[_ngcontent-%COMP%]{font-size:13px;line-height:1.31579}}.div-action[_ngcontent-%COMP%]{display:inline-block}.add-location[_ngcontent-%COMP%]{display:inline}.remove-location-button[_ngcontent-%COMP%]{margin:5px}.hide-autocomplete[_ngcontent-%COMP%]{display:none}.auto-complete-container[_ngcontent-%COMP%]{min-width:550px;display:inline-block;margin-right:4px}.autocomplete__input[_ngcontent-%COMP%]{line-height:24px;font-size:19px}.hidden[_ngcontent-%COMP%]{display:none}.search-language__input[_ngcontent-%COMP%]{position:relative;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36' width='40' height='40'%3E%3Cpath d='M25.7 24.8L21.9 21c.7-1 1.1-2.2 1.1-3.5 0-3.6-2.9-6.5-6.5-6.5S10 13.9 10 17.5s2.9 6.5 6.5 6.5c1.6 0 3-.6 4.1-1.5l3.7 3.7 1.4-1.4zM12 17.5c0-2.5 2-4.5 4.5-4.5s4.5 2 4.5 4.5-2 4.5-4.5 4.5-4.5-2-4.5-4.5z' fill='%23505a5f'%3E%3C/path%3E%3C/svg%3E\");background-repeat:no-repeat;background-position:center left -2px;background-size:40px 40px;padding-left:35px}"] });
23952
24427
  }
23953
24428
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SearchLanguageInterpreterComponent, [{
23954
24429
  type: Component,
23955
- args: [{ selector: 'ccd-search-language-interpreter', template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': languageNotSelectedErrorMessage || languageEnteredInBothFieldsErrorMessage}\">\n <h1 class=\"govuk-label-wrapper\">\n <label class=\"govuk-label govuk-label--m\" [for]=\"SearchLanguageInterpreterControlNames.LANGUAGE_SEARCH_TERM\">\n {{flagType | flagFieldDisplay:'name'}}\n </label>\n </h1>\n <div id=\"language-search-box-hint\" class=\"govuk-hint\">\n {{searchLanguageInterpreterHint | rpxTranslate}}\n </div>\n <div class=\"auto-complete-container\">\n <div id=\"language-not-selected-error-message\" class=\"govuk-error-message\"\n *ngIf=\"languageNotSelectedErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{languageNotSelectedErrorMessage | rpxTranslate}}\n </div>\n <div id=\"language-entered-in-both-fields-error-message\" class=\"govuk-error-message\"\n *ngIf=\"languageEnteredInBothFieldsErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{languageEnteredInBothFieldsErrorMessage | rpxTranslate}}\n </div>\n <input aria-label=\"Language search box\" matInput [formControlName]=\"SearchLanguageInterpreterControlNames.LANGUAGE_SEARCH_TERM\" [matAutocomplete]=\"autoSearchLanguage\"\n class=\"govuk-input search-language__input\" type=\"text\">\n <mat-autocomplete class=\"mat-autocomplete-panel-extend\" autoActiveFirstOption #autoSearchLanguage=\"matAutocomplete\"\n [displayWith]=\"displayLanguage\">\n <mat-option *ngFor=\"let language of filteredLanguages$ | async\" [value]=\"language\">\n {{language | languageInterpreterDisplay}}\n </mat-option>\n <mat-option *ngIf=\"noResults && searchTerm && searchTerm.length >= minSearchCharacters\" disabled>{{'No results found' | rpxTranslate}}</mat-option>\n </mat-autocomplete>\n </div>\n <div class=\"govuk-checkboxes govuk-checkboxes--small govuk-checkboxes--conditional\" data-module=\"govuk-checkboxes\">\n <div class=\"govuk-radios__item\">\n <input class=\"govuk-checkboxes__input\" id=\"enter-language-manually\" name=\"enter-language-manually\" type=\"checkbox\"\n (change)=\"onEnterLanguageManually($event)\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"enter-language-manually\">\n {{searchLanguageInterpreterStep.CHECKBOX_LABEL | rpxTranslate}}\n </label>\n </div>\n <div class=\"govuk-radios__conditional\" *ngIf=\"isCheckboxEnabled\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': languageNotEnteredErrorMessage || languageCharLimitErrorMessage }\">\n <label class=\"govuk-label\" for=\"manual-language-entry\">{{searchLanguageInterpreterStep.INPUT_LABEL | rpxTranslate}}</label>\n <div id=\"language-not-entered-error-message\" class=\"govuk-error-message\"\n *ngIf=\"languageNotEnteredErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{languageNotEnteredErrorMessage | rpxTranslate}}\n </div>\n <div id=\"language-char-limit-error-message\" class=\"govuk-error-message\"\n *ngIf=\"languageCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{languageCharLimitErrorMessage | rpxTranslate}}\n </div>\n <input class=\"govuk-input govuk-input--width-20\" id=\"manual-language-entry\" [name]=\"SearchLanguageInterpreterControlNames.MANUAL_LANGUAGE_ENTRY\" type=\"text\"\n [formControlName]=\"SearchLanguageInterpreterControlNames.MANUAL_LANGUAGE_ENTRY\">\n </div>\n </div>\n </div>\n </div>\n</ng-container>\n\n<div class=\"govuk-button-group\">\n <button class=\"button button-primary\" type=\"button\" (click)=\"onNext()\">{{'Next' | rpxTranslate}}</button>\n</div>\n", styles: [".autocomplete__input--show-all-values{padding:5px 34px 5px 5px;cursor:pointer}.autocomplete__dropdown-arrow-down{z-index:-1;display:inline-block;position:absolute;right:8px;width:24px;height:24px;top:10px}.autocomplete__menu{background-color:#fff;border:2px solid #0b0c0c;border-top:0;color:#0b0c0c;margin:0;max-height:342px;overflow-x:hidden;padding:0;width:100%;width:calc(100% - 4px)}.autocomplete__menu--visible{display:block}.autocomplete__menu--hidden{display:none}.autocomplete__menu--overlay{box-shadow:#00000042 0 2px 6px;left:0;position:absolute;top:100%;z-index:100}.autocomplete__menu--inline{position:relative}.autocomplete__option{border-bottom:solid #b1b4b6;border-width:1px 0;cursor:pointer;display:block;position:relative}.autocomplete__option>*{pointer-events:none}.autocomplete__option:first-of-type{border-top-width:0}.autocomplete__option:last-of-type{border-bottom-width:0}.autocomplete__option--odd{background-color:#fafafa}.autocomplete__option--focused,.autocomplete__option:hover{background-color:#1d70b8;border-color:#1d70b8;color:#fff;outline:0}.autocomplete__option--no-results{background-color:#fafafa;color:#646b6f;cursor:not-allowed}.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.25}.autocomplete__hint,.autocomplete__option{padding:5px}@media (min-width: 641px){.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.31579}}.div-action{display:inline-block}.add-location{display:inline}.remove-location-button{margin:5px}.hide-autocomplete{display:none}.auto-complete-container{min-width:550px;display:inline-block;margin-right:4px}.autocomplete__input{line-height:24px;font-size:19px}.hidden{display:none}.search-language__input{position:relative;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36' width='40' height='40'%3E%3Cpath d='M25.7 24.8L21.9 21c.7-1 1.1-2.2 1.1-3.5 0-3.6-2.9-6.5-6.5-6.5S10 13.9 10 17.5s2.9 6.5 6.5 6.5c1.6 0 3-.6 4.1-1.5l3.7 3.7 1.4-1.4zM12 17.5c0-2.5 2-4.5 4.5-4.5s4.5 2 4.5 4.5-2 4.5-4.5 4.5-4.5-2-4.5-4.5z' fill='%23505a5f'%3E%3C/path%3E%3C/svg%3E\");background-repeat:no-repeat;background-position:center left -2px;background-size:40px 40px;padding-left:35px}\n"] }]
23956
- }], () => [{ type: i1.RpxTranslationService }], { formGroup: [{
24430
+ args: [{ selector: 'ccd-search-language-interpreter', template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': languageNotSelectedErrorMessage || languageEnteredInBothFieldsErrorMessage}\">\n <h1 class=\"govuk-label-wrapper\">\n <label class=\"govuk-label govuk-label--m\" [for]=\"SearchLanguageInterpreterControlNames.LANGUAGE_SEARCH_TERM\">\n {{flagType | flagFieldDisplay:'name'}}\n </label>\n </h1>\n <div id=\"language-search-box-hint\" class=\"govuk-hint\">\n {{searchLanguageInterpreterHint | rpxTranslate}}\n </div>\n <div class=\"auto-complete-container\">\n <div id=\"language-not-selected-error-message\" class=\"govuk-error-message\"\n *ngIf=\"languageNotSelectedErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{languageNotSelectedErrorMessage | rpxTranslate}}\n </div>\n <div id=\"language-entered-in-both-fields-error-message\" class=\"govuk-error-message\"\n *ngIf=\"languageEnteredInBothFieldsErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{languageEnteredInBothFieldsErrorMessage | rpxTranslate}}\n </div>\n <input aria-label=\"Language search box\" matInput [formControlName]=\"SearchLanguageInterpreterControlNames.LANGUAGE_SEARCH_TERM\" [matAutocomplete]=\"autoSearchLanguage\"\n class=\"govuk-input search-language__input\" type=\"text\">\n <mat-autocomplete class=\"mat-autocomplete-panel-extend\" autoActiveFirstOption #autoSearchLanguage=\"matAutocomplete\"\n [displayWith]=\"displayLanguage\">\n <mat-option *ngFor=\"let language of filteredLanguages$ | async\" [value]=\"language\">\n {{language | languageInterpreterDisplay}}\n </mat-option>\n <mat-option *ngIf=\"noResults && searchTerm && searchTerm.length >= minSearchCharacters\" disabled>{{'No results found' | rpxTranslate}}</mat-option>\n </mat-autocomplete>\n </div>\n <div class=\"govuk-checkboxes govuk-checkboxes--small govuk-checkboxes--conditional\" data-module=\"govuk-checkboxes\">\n <div class=\"govuk-radios__item\">\n <input class=\"govuk-checkboxes__input\" id=\"enter-language-manually\" name=\"enter-language-manually\" type=\"checkbox\"\n (change)=\"onEnterLanguageManually($event)\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"enter-language-manually\">\n {{searchLanguageInterpreterStep.CHECKBOX_LABEL | rpxTranslate}}\n </label>\n </div>\n <div class=\"govuk-radios__conditional\" *ngIf=\"isCheckboxEnabled\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': languageNotEnteredErrorMessage || languageCharLimitErrorMessage }\">\n <label class=\"govuk-label\" for=\"manual-language-entry\">{{searchLanguageInterpreterStep.INPUT_LABEL | rpxTranslate}}</label>\n <div id=\"language-not-entered-error-message\" class=\"govuk-error-message\"\n *ngIf=\"languageNotEnteredErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{languageNotEnteredErrorMessage | rpxTranslate}}\n </div>\n <div id=\"language-char-limit-error-message\" class=\"govuk-error-message\"\n *ngIf=\"languageCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{languageCharLimitErrorMessage | rpxTranslate}}\n </div>\n <input class=\"govuk-input govuk-input--width-20\" id=\"manual-language-entry\" [name]=\"SearchLanguageInterpreterControlNames.MANUAL_LANGUAGE_ENTRY\" type=\"text\"\n [formControlName]=\"SearchLanguageInterpreterControlNames.MANUAL_LANGUAGE_ENTRY\">\n </div>\n </div>\n </div>\n </div>\n</ng-container>\n", styles: [".autocomplete__input--show-all-values{padding:5px 34px 5px 5px;cursor:pointer}.autocomplete__dropdown-arrow-down{z-index:-1;display:inline-block;position:absolute;right:8px;width:24px;height:24px;top:10px}.autocomplete__menu{background-color:#fff;border:2px solid #0b0c0c;border-top:0;color:#0b0c0c;margin:0;max-height:342px;overflow-x:hidden;padding:0;width:100%;width:calc(100% - 4px)}.autocomplete__menu--visible{display:block}.autocomplete__menu--hidden{display:none}.autocomplete__menu--overlay{box-shadow:#00000042 0 2px 6px;left:0;position:absolute;top:100%;z-index:100}.autocomplete__menu--inline{position:relative}.autocomplete__option{border-bottom:solid #b1b4b6;border-width:1px 0;cursor:pointer;display:block;position:relative}.autocomplete__option>*{pointer-events:none}.autocomplete__option:first-of-type{border-top-width:0}.autocomplete__option:last-of-type{border-bottom-width:0}.autocomplete__option--odd{background-color:#fafafa}.autocomplete__option--focused,.autocomplete__option:hover{background-color:#1d70b8;border-color:#1d70b8;color:#fff;outline:0}.autocomplete__option--no-results{background-color:#fafafa;color:#646b6f;cursor:not-allowed}.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.25}.autocomplete__hint,.autocomplete__option{padding:5px}@media (min-width: 641px){.autocomplete__hint,.autocomplete__input,.autocomplete__option{font-size:13px;line-height:1.31579}}.div-action{display:inline-block}.add-location{display:inline}.remove-location-button{margin:5px}.hide-autocomplete{display:none}.auto-complete-container{min-width:550px;display:inline-block;margin-right:4px}.autocomplete__input{line-height:24px;font-size:19px}.hidden{display:none}.search-language__input{position:relative;background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36' width='40' height='40'%3E%3Cpath d='M25.7 24.8L21.9 21c.7-1 1.1-2.2 1.1-3.5 0-3.6-2.9-6.5-6.5-6.5S10 13.9 10 17.5s2.9 6.5 6.5 6.5c1.6 0 3-.6 4.1-1.5l3.7 3.7 1.4-1.4zM12 17.5c0-2.5 2-4.5 4.5-4.5s4.5 2 4.5 4.5-2 4.5-4.5 4.5-4.5-2-4.5-4.5z' fill='%23505a5f'%3E%3C/path%3E%3C/svg%3E\");background-repeat:no-repeat;background-position:center left -2px;background-size:40px 40px;padding-left:35px}\n"] }]
24431
+ }], () => [{ type: i1.RpxTranslationService }, { type: MultipageComponentStateService }], { formGroup: [{
23957
24432
  type: Input
23958
24433
  }], flagType: [{
23959
24434
  type: Input
23960
24435
  }], caseFlagStateEmitter: [{
23961
24436
  type: Output
23962
24437
  }] }); })();
23963
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SearchLanguageInterpreterComponent, { className: "SearchLanguageInterpreterComponent", filePath: "lib/shared/components/palette/case-flag/components/search-language-interpreter/search-language-interpreter.component.ts", lineNumber: 17 }); })();
24438
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SearchLanguageInterpreterComponent, { className: "SearchLanguageInterpreterComponent", filePath: "lib/shared/components/palette/case-flag/components/search-language-interpreter/search-language-interpreter.component.ts", lineNumber: 20 }); })();
23964
24439
 
23965
24440
  const _c0$p = a0 => ({ "form-group-error": a0 });
23966
24441
  function SelectFlagLocationComponent_div_7_Template(rf, ctx) { if (rf & 1) {
23967
- i0.ɵɵelementStart(0, "div", 9)(1, "span", 10);
24442
+ i0.ɵɵelementStart(0, "div", 8)(1, "span", 9);
23968
24443
  i0.ɵɵtext(2);
23969
24444
  i0.ɵɵpipe(3, "rpxTranslate");
23970
24445
  i0.ɵɵelementEnd();
@@ -23991,7 +24466,7 @@ function SelectFlagLocationComponent_div_9_ng_container_3_ng_container_2_Templat
23991
24466
  function SelectFlagLocationComponent_div_9_ng_container_3_Template(rf, ctx) { if (rf & 1) {
23992
24467
  i0.ɵɵelementContainerStart(0);
23993
24468
  i0.ɵɵtext(1);
23994
- i0.ɵɵtemplate(2, SelectFlagLocationComponent_div_9_ng_container_3_ng_container_2_Template, 3, 3, "ng-container", 14);
24469
+ i0.ɵɵtemplate(2, SelectFlagLocationComponent_div_9_ng_container_3_ng_container_2_Template, 3, 3, "ng-container", 13);
23995
24470
  i0.ɵɵelementContainerEnd();
23996
24471
  } if (rf & 2) {
23997
24472
  const flagsInstance_r2 = i0.ɵɵnextContext().$implicit;
@@ -24011,10 +24486,10 @@ function SelectFlagLocationComponent_div_9_ng_container_4_Template(rf, ctx) { if
24011
24486
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 1, ctx_r0.caseLevelFlagLabel), " ");
24012
24487
  } }
24013
24488
  function SelectFlagLocationComponent_div_9_Template(rf, ctx) { if (rf & 1) {
24014
- i0.ɵɵelementStart(0, "div", 11);
24015
- i0.ɵɵelement(1, "input", 12);
24016
- i0.ɵɵelementStart(2, "label", 13);
24017
- i0.ɵɵtemplate(3, SelectFlagLocationComponent_div_9_ng_container_3_Template, 3, 2, "ng-container", 14)(4, SelectFlagLocationComponent_div_9_ng_container_4_Template, 3, 3, "ng-container", 14);
24489
+ i0.ɵɵelementStart(0, "div", 10);
24490
+ i0.ɵɵelement(1, "input", 11);
24491
+ i0.ɵɵelementStart(2, "label", 12);
24492
+ i0.ɵɵtemplate(3, SelectFlagLocationComponent_div_9_ng_container_3_Template, 3, 2, "ng-container", 13)(4, SelectFlagLocationComponent_div_9_ng_container_4_Template, 3, 3, "ng-container", 13);
24018
24493
  i0.ɵɵelementEnd()();
24019
24494
  } if (rf & 2) {
24020
24495
  const flagsInstance_r2 = ctx.$implicit;
@@ -24030,18 +24505,7 @@ function SelectFlagLocationComponent_div_9_Template(rf, ctx) { if (rf & 1) {
24030
24505
  i0.ɵɵadvance();
24031
24506
  i0.ɵɵproperty("ngIf", !flagsInstance_r2.flags.partyName);
24032
24507
  } }
24033
- function SelectFlagLocationComponent_div_10_Template(rf, ctx) { if (rf & 1) {
24034
- const _r4 = i0.ɵɵgetCurrentView();
24035
- i0.ɵɵelementStart(0, "div", 15)(1, "button", 16);
24036
- i0.ɵɵlistener("click", function SelectFlagLocationComponent_div_10_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r4); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onNext()); });
24037
- i0.ɵɵtext(2);
24038
- i0.ɵɵpipe(3, "rpxTranslate");
24039
- i0.ɵɵelementEnd()();
24040
- } if (rf & 2) {
24041
- i0.ɵɵadvance(2);
24042
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 1, "Next"));
24043
- } }
24044
- class SelectFlagLocationComponent {
24508
+ class SelectFlagLocationComponent extends AbstractJourneyComponent {
24045
24509
  formGroup;
24046
24510
  flagsData;
24047
24511
  isDisplayContextParameterExternal = false;
@@ -24116,8 +24580,14 @@ class SelectFlagLocationComponent {
24116
24580
  // Return case flag field state and error messages to the parent
24117
24581
  this.caseFlagStateEmitter.emit({ currentCaseFlagFieldState: CaseFlagFieldState.FLAG_TYPE, errorMessages: this.errorMessages });
24118
24582
  }
24119
- static ɵfac = function SelectFlagLocationComponent_Factory(t) { return new (t || SelectFlagLocationComponent)(); };
24120
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SelectFlagLocationComponent, selectors: [["ccd-select-flag-location"]], inputs: { formGroup: "formGroup", flagsData: "flagsData", isDisplayContextParameterExternal: "isDisplayContextParameterExternal" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, decls: 11, vars: 10, consts: [[3, "formGroup"], [1, "govuk-form-group", 3, "ngClass"], ["aria-describedby", "flag-location-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--m"], ["id", "flag-location-heading", 1, "govuk-fieldset__heading"], ["id", "flag-location-not-selected-error-message", "class", "govuk-error-message", 4, "ngIf"], ["data-module", "govuk-radios", "id", "conditional-radios-list", 1, "govuk-radios", "govuk-radios--conditional"], ["class", "govuk-radios__item", 4, "ngFor", "ngForOf"], ["class", "govuk-button-group", 4, "ngIf"], ["id", "flag-location-not-selected-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "id", "name", "value", "formControlName"], [1, "govuk-label", "govuk-radios__label", 3, "for"], [4, "ngIf"], [1, "govuk-button-group"], ["type", "button", 1, "button", "button-primary", 3, "click"]], template: function SelectFlagLocationComponent_Template(rf, ctx) { if (rf & 1) {
24583
+ next() {
24584
+ this.onNext();
24585
+ if (this.errorMessages.length === 0) {
24586
+ super.next();
24587
+ }
24588
+ }
24589
+ static ɵfac = /*@__PURE__*/ (() => { let ɵSelectFlagLocationComponent_BaseFactory; return function SelectFlagLocationComponent_Factory(t) { return (ɵSelectFlagLocationComponent_BaseFactory || (ɵSelectFlagLocationComponent_BaseFactory = i0.ɵɵgetInheritedFactory(SelectFlagLocationComponent)))(t || SelectFlagLocationComponent); }; })();
24590
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SelectFlagLocationComponent, selectors: [["ccd-select-flag-location"]], inputs: { formGroup: "formGroup", flagsData: "flagsData", isDisplayContextParameterExternal: "isDisplayContextParameterExternal" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 10, vars: 9, consts: [[3, "formGroup"], [1, "govuk-form-group", 3, "ngClass"], ["aria-describedby", "flag-location-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--m"], ["id", "flag-location-heading", 1, "govuk-fieldset__heading"], ["id", "flag-location-not-selected-error-message", "class", "govuk-error-message", 4, "ngIf"], ["data-module", "govuk-radios", "id", "conditional-radios-list", 1, "govuk-radios", "govuk-radios--conditional"], ["class", "govuk-radios__item", 4, "ngFor", "ngForOf"], ["id", "flag-location-not-selected-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "id", "name", "value", "formControlName"], [1, "govuk-label", "govuk-radios__label", 3, "for"], [4, "ngIf"]], template: function SelectFlagLocationComponent_Template(rf, ctx) { if (rf & 1) {
24121
24591
  i0.ɵɵelementContainerStart(0, 0);
24122
24592
  i0.ɵɵelementStart(1, "div", 1)(2, "fieldset", 2)(3, "legend", 3)(4, "h1", 4);
24123
24593
  i0.ɵɵtext(5);
@@ -24128,24 +24598,21 @@ class SelectFlagLocationComponent {
24128
24598
  i0.ɵɵtemplate(9, SelectFlagLocationComponent_div_9_Template, 5, 9, "div", 7);
24129
24599
  i0.ɵɵelementEnd()()();
24130
24600
  i0.ɵɵelementContainerEnd();
24131
- i0.ɵɵtemplate(10, SelectFlagLocationComponent_div_10_Template, 4, 3, "div", 8);
24132
24601
  } if (rf & 2) {
24133
24602
  i0.ɵɵproperty("formGroup", ctx.formGroup);
24134
24603
  i0.ɵɵadvance();
24135
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c0$p, ctx.errorMessages.length > 0));
24604
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(7, _c0$p, ctx.errorMessages.length > 0));
24136
24605
  i0.ɵɵadvance(4);
24137
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 6, ctx.flagLocationTitle), " ");
24606
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 5, ctx.flagLocationTitle), " ");
24138
24607
  i0.ɵɵadvance(2);
24139
24608
  i0.ɵɵproperty("ngIf", ctx.flagLocationNotSelectedErrorMessage);
24140
24609
  i0.ɵɵadvance(2);
24141
24610
  i0.ɵɵproperty("ngForOf", ctx.filteredFlagsData);
24142
- i0.ɵɵadvance();
24143
- i0.ɵɵproperty("ngIf", !ctx.caseFlagsConfigError);
24144
24611
  } }, dependencies: [i5.NgClass, i5.NgForOf, i5.NgIf, i4.DefaultValueAccessor, i4.RadioControlValueAccessor, i4.NgControlStatus, i4.NgControlStatusGroup, i4.FormGroupDirective, i4.FormControlName, i1.RpxTranslatePipe], encapsulation: 2 });
24145
24612
  }
24146
24613
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SelectFlagLocationComponent, [{
24147
24614
  type: Component,
24148
- args: [{ selector: 'ccd-select-flag-location', template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"flag-location-heading\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n <h1 id=\"flag-location-heading\" class=\"govuk-fieldset__heading\">\n {{flagLocationTitle | rpxTranslate}}\n </h1>\n </legend>\n <div id=\"flag-location-not-selected-error-message\" class=\"govuk-error-message\"\n *ngIf=\"flagLocationNotSelectedErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagLocationNotSelectedErrorMessage | rpxTranslate}}\n </div>\n <div class=\"govuk-radios govuk-radios--conditional\" data-module=\"govuk-radios\" id=\"conditional-radios-list\">\n <div class=\"govuk-radios__item\" *ngFor=\"let flagsInstance of filteredFlagsData; index as i\">\n <input class=\"govuk-radios__input\" id=\"flag-location-{{i}}\" [name]=\"selectedLocationControlName\"\n type=\"radio\" [value]=\"flagsInstance\" [formControlName]=\"selectedLocationControlName\"/>\n <label class=\"govuk-label govuk-radios__label\" for=\"flag-location-{{i}}\">\n <ng-container *ngIf=\"flagsInstance.flags.partyName\">\n {{flagsInstance.flags.partyName}}\n <ng-container *ngIf=\"flagsInstance.flags.roleOnCase\">\n ({{flagsInstance.flags.roleOnCase | rpxTranslate}})\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"!flagsInstance.flags.partyName\">\n {{caseLevelFlagLabel | rpxTranslate}}\n </ng-container>\n </label>\n </div>\n </div>\n </fieldset>\n </div>\n</ng-container>\n\n<div class=\"govuk-button-group\" *ngIf=\"!caseFlagsConfigError\">\n <button class=\"button button-primary\" type=\"button\" (click)=\"onNext()\">{{'Next' | rpxTranslate}}</button>\n</div>\n" }]
24615
+ args: [{ selector: 'ccd-select-flag-location', template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"flag-location-heading\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n <h1 id=\"flag-location-heading\" class=\"govuk-fieldset__heading\">\n {{flagLocationTitle | rpxTranslate}}\n </h1>\n </legend>\n <div id=\"flag-location-not-selected-error-message\" class=\"govuk-error-message\"\n *ngIf=\"flagLocationNotSelectedErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagLocationNotSelectedErrorMessage | rpxTranslate}}\n </div>\n <div class=\"govuk-radios govuk-radios--conditional\" data-module=\"govuk-radios\" id=\"conditional-radios-list\">\n <div class=\"govuk-radios__item\" *ngFor=\"let flagsInstance of filteredFlagsData; index as i\">\n <input class=\"govuk-radios__input\" id=\"flag-location-{{i}}\" [name]=\"selectedLocationControlName\"\n type=\"radio\" [value]=\"flagsInstance\" [formControlName]=\"selectedLocationControlName\"/>\n <label class=\"govuk-label govuk-radios__label\" for=\"flag-location-{{i}}\">\n <ng-container *ngIf=\"flagsInstance.flags.partyName\">\n {{flagsInstance.flags.partyName}}\n <ng-container *ngIf=\"flagsInstance.flags.roleOnCase\">\n ({{flagsInstance.flags.roleOnCase | rpxTranslate}})\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"!flagsInstance.flags.partyName\">\n {{caseLevelFlagLabel | rpxTranslate}}\n </ng-container>\n </label>\n </div>\n </div>\n </fieldset>\n </div>\n</ng-container>" }]
24149
24616
  }], null, { formGroup: [{
24150
24617
  type: Input
24151
24618
  }], flagsData: [{
@@ -24155,7 +24622,7 @@ class SelectFlagLocationComponent {
24155
24622
  }], caseFlagStateEmitter: [{
24156
24623
  type: Output
24157
24624
  }] }); })();
24158
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SelectFlagLocationComponent, { className: "SelectFlagLocationComponent", filePath: "lib/shared/components/palette/case-flag/components/select-flag-location/select-flag-location.component.ts", lineNumber: 11 }); })();
24625
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SelectFlagLocationComponent, { className: "SelectFlagLocationComponent", filePath: "lib/shared/components/palette/case-flag/components/select-flag-location/select-flag-location.component.ts", lineNumber: 12 }); })();
24159
24626
 
24160
24627
  const _c0$o = a0 => ({ "form-group-error": a0 });
24161
24628
  const _c1$8 = a0 => ({ "govuk-input--error": a0 });
@@ -24178,7 +24645,7 @@ function SelectFlagTypeComponent_ng_container_0_ng_template_6_Template(rf, ctx)
24178
24645
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind2(1, 1, ctx_r0.cachedFlagType, "name"), " ");
24179
24646
  } }
24180
24647
  function SelectFlagTypeComponent_ng_container_0_div_8_Template(rf, ctx) { if (rf & 1) {
24181
- i0.ɵɵelementStart(0, "div", 13)(1, "span", 14);
24648
+ i0.ɵɵelementStart(0, "div", 12)(1, "span", 13);
24182
24649
  i0.ɵɵtext(2);
24183
24650
  i0.ɵɵpipe(3, "rpxTranslate");
24184
24651
  i0.ɵɵelementEnd();
@@ -24193,9 +24660,9 @@ function SelectFlagTypeComponent_ng_container_0_div_8_Template(rf, ctx) { if (rf
24193
24660
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.flagTypeNotSelectedErrorMessage), " ");
24194
24661
  } }
24195
24662
  function SelectFlagTypeComponent_ng_container_0_div_10_Template(rf, ctx) { if (rf & 1) {
24196
- i0.ɵɵelementStart(0, "div", 15);
24197
- i0.ɵɵelement(1, "input", 16);
24198
- i0.ɵɵelementStart(2, "label", 17);
24663
+ i0.ɵɵelementStart(0, "div", 14);
24664
+ i0.ɵɵelement(1, "input", 15);
24665
+ i0.ɵɵelementStart(2, "label", 16);
24199
24666
  i0.ɵɵtext(3);
24200
24667
  i0.ɵɵpipe(4, "flagFieldDisplay");
24201
24668
  i0.ɵɵelementEnd()();
@@ -24212,7 +24679,7 @@ function SelectFlagTypeComponent_ng_container_0_div_10_Template(rf, ctx) { if (r
24212
24679
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind2(4, 8, flagType_r2, "name"), " ");
24213
24680
  } }
24214
24681
  function SelectFlagTypeComponent_ng_container_0_div_11_div_6_Template(rf, ctx) { if (rf & 1) {
24215
- i0.ɵɵelementStart(0, "div", 23)(1, "span", 14);
24682
+ i0.ɵɵelementStart(0, "div", 22)(1, "span", 13);
24216
24683
  i0.ɵɵtext(2);
24217
24684
  i0.ɵɵpipe(3, "rpxTranslate");
24218
24685
  i0.ɵɵelementEnd();
@@ -24227,9 +24694,9 @@ function SelectFlagTypeComponent_ng_container_0_div_11_div_6_Template(rf, ctx) {
24227
24694
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.flagTypeErrorMessage), " ");
24228
24695
  } }
24229
24696
  function SelectFlagTypeComponent_ng_container_0_div_11_div_8_Template(rf, ctx) { if (rf & 1) {
24230
- i0.ɵɵelementStart(0, "div", 24);
24231
- i0.ɵɵelement(1, "input", 25);
24232
- i0.ɵɵelementStart(2, "label", 26);
24697
+ i0.ɵɵelementStart(0, "div", 23);
24698
+ i0.ɵɵelement(1, "input", 24);
24699
+ i0.ɵɵelementStart(2, "label", 25);
24233
24700
  i0.ɵɵtext(3);
24234
24701
  i0.ɵɵpipe(4, "rpxTranslate");
24235
24702
  i0.ɵɵelementEnd()();
@@ -24241,14 +24708,14 @@ function SelectFlagTypeComponent_ng_container_0_div_11_div_8_Template(rf, ctx) {
24241
24708
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(4, 3, "This flag should only be visible to HMCTS Staff"), " ");
24242
24709
  } }
24243
24710
  function SelectFlagTypeComponent_ng_container_0_div_11_Template(rf, ctx) { if (rf & 1) {
24244
- i0.ɵɵelementStart(0, "div", 18)(1, "div", 4)(2, "label", 19);
24711
+ i0.ɵɵelementStart(0, "div", 17)(1, "div", 3)(2, "label", 18);
24245
24712
  i0.ɵɵtext(3);
24246
24713
  i0.ɵɵpipe(4, "rpxTranslate");
24247
24714
  i0.ɵɵpipe(5, "rpxTranslate");
24248
24715
  i0.ɵɵelementEnd();
24249
- i0.ɵɵtemplate(6, SelectFlagTypeComponent_ng_container_0_div_11_div_6_Template, 6, 6, "div", 20);
24250
- i0.ɵɵelement(7, "input", 21);
24251
- i0.ɵɵtemplate(8, SelectFlagTypeComponent_ng_container_0_div_11_div_8_Template, 5, 5, "div", 22);
24716
+ i0.ɵɵtemplate(6, SelectFlagTypeComponent_ng_container_0_div_11_div_6_Template, 6, 6, "div", 19);
24717
+ i0.ɵɵelement(7, "input", 20);
24718
+ i0.ɵɵtemplate(8, SelectFlagTypeComponent_ng_container_0_div_11_div_8_Template, 5, 5, "div", 21);
24252
24719
  i0.ɵɵelementEnd()();
24253
24720
  } if (rf & 2) {
24254
24721
  const ctx_r0 = i0.ɵɵnextContext(2);
@@ -24264,13 +24731,13 @@ function SelectFlagTypeComponent_ng_container_0_div_11_Template(rf, ctx) { if (r
24264
24731
  i0.ɵɵproperty("ngIf", !ctx_r0.isDisplayContextParameterExternal && !ctx_r0.isCaseLevelFlag && ctx_r0.isDisplayContextParameter2Point1Enabled);
24265
24732
  } }
24266
24733
  function SelectFlagTypeComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
24267
- i0.ɵɵelementContainerStart(0, 3);
24268
- i0.ɵɵelementStart(1, "div", 4)(2, "fieldset", 5)(3, "legend", 6)(4, "h1", 7);
24269
- i0.ɵɵtemplate(5, SelectFlagTypeComponent_ng_container_0_ng_container_5_Template, 4, 5, "ng-container", 8)(6, SelectFlagTypeComponent_ng_container_0_ng_template_6_Template, 2, 4, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
24734
+ i0.ɵɵelementContainerStart(0, 2);
24735
+ i0.ɵɵelementStart(1, "div", 3)(2, "fieldset", 4)(3, "legend", 5)(4, "h1", 6);
24736
+ i0.ɵɵtemplate(5, SelectFlagTypeComponent_ng_container_0_ng_container_5_Template, 4, 5, "ng-container", 7)(6, SelectFlagTypeComponent_ng_container_0_ng_template_6_Template, 2, 4, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
24270
24737
  i0.ɵɵelementEnd()();
24271
- i0.ɵɵtemplate(8, SelectFlagTypeComponent_ng_container_0_div_8_Template, 6, 6, "div", 9);
24272
- i0.ɵɵelementStart(9, "div", 10);
24273
- i0.ɵɵtemplate(10, SelectFlagTypeComponent_ng_container_0_div_10_Template, 5, 11, "div", 11)(11, SelectFlagTypeComponent_ng_container_0_div_11_Template, 9, 15, "div", 12);
24738
+ i0.ɵɵtemplate(8, SelectFlagTypeComponent_ng_container_0_div_8_Template, 6, 6, "div", 8);
24739
+ i0.ɵɵelementStart(9, "div", 9);
24740
+ i0.ɵɵtemplate(10, SelectFlagTypeComponent_ng_container_0_div_10_Template, 5, 11, "div", 10)(11, SelectFlagTypeComponent_ng_container_0_div_11_Template, 9, 15, "div", 11);
24274
24741
  i0.ɵɵelementEnd()()();
24275
24742
  i0.ɵɵelementContainerEnd();
24276
24743
  } if (rf & 2) {
@@ -24280,7 +24747,7 @@ function SelectFlagTypeComponent_ng_container_0_Template(rf, ctx) { if (rf & 1)
24280
24747
  i0.ɵɵadvance();
24281
24748
  i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c0$o, ctx_r0.flagTypeNotSelectedErrorMessage.length > 0));
24282
24749
  i0.ɵɵadvance(4);
24283
- i0.ɵɵproperty("ngIf", !ctx_r0.cachedFlagType)("ngIfElse", priorFlagTypeSelected_r4);
24750
+ i0.ɵɵproperty("ngIf", !ctx_r0.cachedFlagType || ctx_r0.subJourneyIndex == 0)("ngIfElse", priorFlagTypeSelected_r4);
24284
24751
  i0.ɵɵadvance(3);
24285
24752
  i0.ɵɵproperty("ngIf", ctx_r0.flagTypeNotSelectedErrorMessage.length > 0);
24286
24753
  i0.ɵɵadvance(2);
@@ -24288,18 +24755,7 @@ function SelectFlagTypeComponent_ng_container_0_Template(rf, ctx) { if (rf & 1)
24288
24755
  i0.ɵɵadvance();
24289
24756
  i0.ɵɵproperty("ngIf", ctx_r0.otherFlagTypeSelected);
24290
24757
  } }
24291
- function SelectFlagTypeComponent_div_1_Template(rf, ctx) { if (rf & 1) {
24292
- const _r5 = i0.ɵɵgetCurrentView();
24293
- i0.ɵɵelementStart(0, "div", 27)(1, "button", 28);
24294
- i0.ɵɵlistener("click", function SelectFlagTypeComponent_div_1_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r5); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onNext()); });
24295
- i0.ɵɵtext(2);
24296
- i0.ɵɵpipe(3, "rpxTranslate");
24297
- i0.ɵɵelementEnd()();
24298
- } if (rf & 2) {
24299
- i0.ɵɵadvance(2);
24300
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 1, "Next"));
24301
- } }
24302
- class SelectFlagTypeComponent {
24758
+ class SelectFlagTypeComponent extends AbstractJourneyComponent {
24303
24759
  caseFlagRefdataService;
24304
24760
  formGroup;
24305
24761
  jurisdiction;
@@ -24321,6 +24777,8 @@ class SelectFlagTypeComponent {
24321
24777
  flagTypeControlChangesSubscription;
24322
24778
  caseFlagFormField = CaseFlagFormFields;
24323
24779
  isCaseLevelFlag = false;
24780
+ cachedRDFlagTypes;
24781
+ subJourneyIndex = 0;
24324
24782
  maxCharactersForOtherFlagType = 80;
24325
24783
  // Code for "Other" flag type as defined in Reference Data
24326
24784
  otherFlagTypeCode = 'OT0001';
@@ -24328,15 +24786,16 @@ class SelectFlagTypeComponent {
24328
24786
  get caseFlagWizardStepTitle() {
24329
24787
  return CaseFlagWizardStepTitle;
24330
24788
  }
24789
+ constructor(caseFlagRefdataService, pageStateService) {
24790
+ super(pageStateService);
24791
+ this.caseFlagRefdataService = caseFlagRefdataService;
24792
+ }
24331
24793
  get selectedFlagType() {
24332
24794
  return this.formGroup.get(CaseFlagFormFields.FLAG_TYPE)?.value;
24333
24795
  }
24334
24796
  get otherFlagTypeSelected() {
24335
24797
  return this.formGroup.get(CaseFlagFormFields.FLAG_TYPE)?.value?.flagCode === this.otherFlagTypeCode;
24336
24798
  }
24337
- constructor(caseFlagRefdataService) {
24338
- this.caseFlagRefdataService = caseFlagRefdataService;
24339
- }
24340
24799
  ngOnInit() {
24341
24800
  this.isCaseLevelFlag = this.selectedFlagsLocation?.flags?.flagsCaseFieldId === this.caseLevelCaseFlagsFieldId;
24342
24801
  this.flagTypes = [];
@@ -24347,7 +24806,7 @@ class SelectFlagTypeComponent {
24347
24806
  this.formGroup.addControl(CaseFlagFormFields.IS_VISIBLE_INTERNALLY_ONLY, new FormControl(false));
24348
24807
  // Should clear descriptionControlName if flagTypeControlName is changed
24349
24808
  this.flagTypeControlChangesSubscription = this.formGroup.get(CaseFlagFormFields.FLAG_TYPE)?.valueChanges
24350
- .subscribe(_ => {
24809
+ .subscribe((_) => {
24351
24810
  this.formGroup.get(CaseFlagFormFields.OTHER_FLAG_DESCRIPTION)?.setValue('');
24352
24811
  this.cachedPath = [];
24353
24812
  // required to clear language interpreter
@@ -24361,8 +24820,8 @@ class SelectFlagTypeComponent {
24361
24820
  this.flagRefdata$ = this.caseFlagRefdataService
24362
24821
  .getCaseFlagsRefdata(this.hmctsServiceId, flagType, true, this.isDisplayContextParameterExternal)
24363
24822
  .subscribe({
24364
- next: flagTypes => this.processFlagTypes(flagTypes),
24365
- error: error => this.onRefdataError(error)
24823
+ next: (flagTypes) => this.processFlagTypes(flagTypes),
24824
+ error: (error) => this.onRefdataError(error)
24366
24825
  });
24367
24826
  }
24368
24827
  else {
@@ -24370,19 +24829,36 @@ class SelectFlagTypeComponent {
24370
24829
  this.flagRefdata$ = this.caseFlagRefdataService.getHmctsServiceDetailsByCaseType(this.caseTypeId)
24371
24830
  .pipe(
24372
24831
  // If an error occurs retrieving HMCTS service details by case type ID, try by service name instead
24373
- catchError(_ => this.caseFlagRefdataService.getHmctsServiceDetailsByServiceName(this.jurisdiction)),
24832
+ catchError((_) => this.caseFlagRefdataService.getHmctsServiceDetailsByServiceName(this.jurisdiction)),
24374
24833
  // Use switchMap to return an inner Observable of the flag types data, having received the service details
24375
24834
  // including service_code. This avoids having nested `subscribe`s, which is an anti-pattern!
24376
- switchMap(serviceDetails => this.caseFlagRefdataService.getCaseFlagsRefdata(serviceDetails[0].service_code, flagType, true, this.isDisplayContextParameterExternal)))
24835
+ switchMap((serviceDetails) => this.caseFlagRefdataService.getCaseFlagsRefdata(serviceDetails[0].service_code, flagType, true, this.isDisplayContextParameterExternal)))
24377
24836
  .subscribe({
24378
- next: flagTypes => this.processFlagTypes(flagTypes),
24379
- error: error => this.onRefdataError(error)
24837
+ next: (flagTypes) => this.processFlagTypes(flagTypes),
24838
+ error: (error) => this.onRefdataError(error)
24380
24839
  });
24381
24840
  }
24382
24841
  }
24383
24842
  ngOnDestroy() {
24384
24843
  this.flagRefdata$?.unsubscribe();
24385
24844
  this.flagTypeControlChangesSubscription?.unsubscribe();
24845
+ // check if the user has an existing path when navigating away from the page
24846
+ // if so we may need to ensure the values are set correctly.
24847
+ this.checkForExistingPath();
24848
+ }
24849
+ checkForExistingPath() {
24850
+ // Restore values from cachedPath
24851
+ if (this.subJourneyIndex <= 0) {
24852
+ // check if the user is navigating to the previous page in the jounrey.
24853
+ // in this situation we need to restore the full path for data retention across pages.
24854
+ if (this.cachedPath && this.cachedPath.length > 0) {
24855
+ this.cachedPath.forEach((flagType) => {
24856
+ if (flagType) {
24857
+ this.formGroup.get(CaseFlagFormFields.FLAG_TYPE)?.setValue(flagType, { emitEvent: false });
24858
+ }
24859
+ });
24860
+ }
24861
+ }
24386
24862
  }
24387
24863
  onNext() {
24388
24864
  // Validate form
@@ -24404,10 +24880,40 @@ class SelectFlagTypeComponent {
24404
24880
  // when displaying the next set of child flags
24405
24881
  this.cachedFlagType = this.selectedFlagType;
24406
24882
  this.flagTypes = this.selectedFlagType.childFlags;
24407
- this.cachedPath?.shift();
24408
- this.formGroup.get(CaseFlagFormFields.FLAG_TYPE)?.setValue(this.cachedPath?.length ? this.cachedPath[0] : null, { emitEvent: false });
24883
+ if (this.cachedPath.length !== 0 && this.cachedPath[this.subJourneyIndex] === this.selectedFlagType) {
24884
+ this.formGroup.get(CaseFlagFormFields.FLAG_TYPE)?.setValue(this.cachedPath[this.subJourneyIndex + 1], { emitEvent: false });
24885
+ }
24886
+ else {
24887
+ this.cachedPath?.shift();
24888
+ const value = this.cachedPath?.length ? this.cachedPath[0] : null;
24889
+ this.formGroup.get(CaseFlagFormFields.FLAG_TYPE)?.setValue(value, { emitEvent: false });
24890
+ }
24891
+ this.subJourneyIndex++;
24409
24892
  }
24410
24893
  }
24894
+ // Simplified version of the onPrevious method with optimized code
24895
+ onPrevious() {
24896
+ if (this.cachedFlagType) {
24897
+ if (this.cachedFlagType.Path.length === 1) {
24898
+ this.formGroup.get(CaseFlagFormFields.FLAG_TYPE)?.setValue(this.cachedFlagType, { emitEvent: false });
24899
+ this.flagTypes = this.cachedRDFlagTypes[0].childFlags;
24900
+ }
24901
+ else {
24902
+ let currentPath = this.cachedRDFlagTypes[0];
24903
+ const pathToSearch = this.cachedFlagType.Path.slice(1);
24904
+ for (const pathElement of pathToSearch) {
24905
+ const foundFlag = currentPath.childFlags.find((flag) => flag.name === pathElement);
24906
+ if (foundFlag) {
24907
+ currentPath = foundFlag;
24908
+ }
24909
+ }
24910
+ this.formGroup.get(CaseFlagFormFields.FLAG_TYPE)?.setValue(this.cachedFlagType, { emitEvent: false });
24911
+ this.flagTypes = currentPath.childFlags;
24912
+ this.cachedFlagType = currentPath;
24913
+ }
24914
+ }
24915
+ this.subJourneyIndex = Math.max(0, this.subJourneyIndex - 1);
24916
+ }
24411
24917
  // Identity function for trackBy use by *ngFor for flagTypes in HTML template
24412
24918
  identifyFlagType(_, flagType) {
24413
24919
  return `${flagType.flagCode}_${flagType.name}_${flagType.name_cy}`;
@@ -24445,18 +24951,33 @@ class SelectFlagTypeComponent {
24445
24951
  }
24446
24952
  }
24447
24953
  processFlagTypes(flagTypes) {
24448
- // First (and only) object in the returned array should be the top-level "Party" flag type
24449
- // The "Other" flag type should be removed from the top level if the user is external
24450
- this.flagTypes = flagTypes[0].childFlags.filter((flag) => this.isDisplayContextParameterExternal ? flag.flagCode !== this.otherFlagTypeCode : true);
24954
+ const prevJourneyPage = this.multipageComponentStateService.getJourneyCollection()[0];
24955
+ const { journeyPreviousPageNumber, journeyPageNumber } = prevJourneyPage;
24956
+ this.cachedRDFlagTypes = flagTypes;
24957
+ if (this.selectedFlagType && (journeyPreviousPageNumber > journeyPageNumber)) {
24958
+ const selectedFlagType = this.selectedFlagType;
24959
+ const pathToSearch = selectedFlagType.Path.slice(1);
24960
+ let currentPath = flagTypes[0];
24961
+ for (const pathElement of pathToSearch) {
24962
+ const foundFlag = currentPath.childFlags.find((flag) => flag.name === pathElement);
24963
+ if (foundFlag) {
24964
+ currentPath = foundFlag;
24965
+ }
24966
+ }
24967
+ this.flagTypes = currentPath.childFlags;
24968
+ this.cachedFlagType = currentPath;
24969
+ }
24970
+ else {
24971
+ this.flagTypes = flagTypes[0].childFlags.filter((flag) => this.isDisplayContextParameterExternal ? flag.flagCode !== this.otherFlagTypeCode : true);
24972
+ }
24451
24973
  const formControl = this.formGroup.get(CaseFlagFormFields.FLAG_TYPE);
24452
24974
  if (formControl?.value) {
24453
- // Cache Path based on existing flagCode -- needed for nested choices
24454
- const [foundFlagType, path] = FlagType.searchPathByFlagTypeObject(formControl.value, this.flagTypes);
24455
- this.cachedPath = [
24456
- ...path,
24457
- foundFlagType
24458
- ];
24459
- formControl.setValue(this.cachedPath[0], { emitEvent: false });
24975
+ const [foundFlagType, path] = FlagType.searchPathByFlagTypeObject(formControl.value, this.cachedRDFlagTypes[0].childFlags);
24976
+ this.cachedPath = [...path, foundFlagType];
24977
+ formControl.setValue((this.selectedFlagType && (journeyPreviousPageNumber > journeyPageNumber)) ? this.cachedPath[this.cachedPath.length - 1] : this.cachedPath[0], { emitEvent: false });
24978
+ if (this.cachedPath.length !== 0 && (journeyPreviousPageNumber > journeyPageNumber)) {
24979
+ this.subJourneyIndex = this.cachedPath.length - 1;
24980
+ }
24460
24981
  }
24461
24982
  }
24462
24983
  onRefdataError(error) {
@@ -24467,19 +24988,29 @@ class SelectFlagTypeComponent {
24467
24988
  // Return case flag field state and error messages to the parent
24468
24989
  this.caseFlagStateEmitter.emit({ currentCaseFlagFieldState: CaseFlagFieldState.FLAG_TYPE, errorMessages: this.errorMessages });
24469
24990
  }
24470
- static ɵfac = function SelectFlagTypeComponent_Factory(t) { return new (t || SelectFlagTypeComponent)(i0.ɵɵdirectiveInject(CaseFlagRefdataService)); };
24471
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SelectFlagTypeComponent, selectors: [["ccd-select-flag-type"]], inputs: { formGroup: "formGroup", jurisdiction: "jurisdiction", caseTypeId: "caseTypeId", hmctsServiceId: "hmctsServiceId", isDisplayContextParameterExternal: "isDisplayContextParameterExternal", isDisplayContextParameter2Point1Enabled: "isDisplayContextParameter2Point1Enabled", selectedFlagsLocation: "selectedFlagsLocation" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter", flagCommentsOptionalEmitter: "flagCommentsOptionalEmitter" }, decls: 2, vars: 2, consts: [["priorFlagTypeSelected", ""], [3, "formGroup", 4, "ngIf"], ["class", "govuk-button-group", 4, "ngIf"], [3, "formGroup"], [1, "govuk-form-group", 3, "ngClass"], ["aria-describedby", "flag-type-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--m"], ["id", "flag-type-heading", 1, "govuk-fieldset__heading", "govuk-!-margin-bottom-1"], [4, "ngIf", "ngIfElse"], ["id", "flag-type-not-selected-error-message", "class", "govuk-error-message", 4, "ngIf"], ["data-module", "govuk-radios", "id", "conditional-radios-list", 1, "govuk-radios", "govuk-radios--conditional"], ["class", "govuk-radios__item", 4, "ngFor", "ngForOf", "ngForTrackBy"], ["class", "govuk-radios__conditional", "id", "conditional-flagType", 4, "ngIf"], ["id", "flag-type-not-selected-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "id", "name", "value", "formControlName"], [1, "govuk-label", "govuk-radios__label", 3, "for"], ["id", "conditional-flagType", 1, "govuk-radios__conditional"], ["for", "other-flag-type-description", 1, "govuk-label"], ["id", "flag-type-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "other-flag-type-description", "type", "text", 1, "govuk-input", "govuk-!-width-one-half", 3, "ngClass", "name", "formControlName"], ["class", "govuk-checkboxes__item govuk-!-margin-top-4", 4, "ngIf"], ["id", "flag-type-error-message", 1, "govuk-error-message"], [1, "govuk-checkboxes__item", "govuk-!-margin-top-4"], ["id", "is-visible-externally", "type", "checkbox", 1, "govuk-checkboxes__input", 3, "name", "formControlName"], ["for", "is-visible-externally", 1, "govuk-label", "govuk-checkboxes__label"], [1, "govuk-button-group"], ["type", "button", 1, "button", "button-primary", 3, "click"]], template: function SelectFlagTypeComponent_Template(rf, ctx) { if (rf & 1) {
24472
- i0.ɵɵtemplate(0, SelectFlagTypeComponent_ng_container_0_Template, 12, 10, "ng-container", 1)(1, SelectFlagTypeComponent_div_1_Template, 4, 3, "div", 2);
24991
+ next() {
24992
+ this.onNext();
24993
+ if (this.errorMessages.length === 0) {
24994
+ super.next();
24995
+ }
24996
+ }
24997
+ previous() {
24998
+ this.onPrevious();
24999
+ if (this.subJourneyIndex <= 0) {
25000
+ super.previous();
25001
+ }
25002
+ }
25003
+ static ɵfac = function SelectFlagTypeComponent_Factory(t) { return new (t || SelectFlagTypeComponent)(i0.ɵɵdirectiveInject(CaseFlagRefdataService), i0.ɵɵdirectiveInject(MultipageComponentStateService)); };
25004
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SelectFlagTypeComponent, selectors: [["ccd-select-flag-type"]], inputs: { formGroup: "formGroup", jurisdiction: "jurisdiction", caseTypeId: "caseTypeId", hmctsServiceId: "hmctsServiceId", isDisplayContextParameterExternal: "isDisplayContextParameterExternal", isDisplayContextParameter2Point1Enabled: "isDisplayContextParameter2Point1Enabled", selectedFlagsLocation: "selectedFlagsLocation" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter", flagCommentsOptionalEmitter: "flagCommentsOptionalEmitter" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["priorFlagTypeSelected", ""], [3, "formGroup", 4, "ngIf"], [3, "formGroup"], [1, "govuk-form-group", 3, "ngClass"], ["aria-describedby", "flag-type-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--m"], ["id", "flag-type-heading", 1, "govuk-fieldset__heading", "govuk-!-margin-bottom-1"], [4, "ngIf", "ngIfElse"], ["id", "flag-type-not-selected-error-message", "class", "govuk-error-message", 4, "ngIf"], ["data-module", "govuk-radios", "id", "conditional-radios-list", 1, "govuk-radios", "govuk-radios--conditional"], ["class", "govuk-radios__item", 4, "ngFor", "ngForOf", "ngForTrackBy"], ["class", "govuk-radios__conditional", "id", "conditional-flagType", 4, "ngIf"], ["id", "flag-type-not-selected-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "id", "name", "value", "formControlName"], [1, "govuk-label", "govuk-radios__label", 3, "for"], ["id", "conditional-flagType", 1, "govuk-radios__conditional"], ["for", "other-flag-type-description", 1, "govuk-label"], ["id", "flag-type-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "other-flag-type-description", "type", "text", 1, "govuk-input", "govuk-!-width-one-half", 3, "ngClass", "name", "formControlName"], ["class", "govuk-checkboxes__item govuk-!-margin-top-4", 4, "ngIf"], ["id", "flag-type-error-message", 1, "govuk-error-message"], [1, "govuk-checkboxes__item", "govuk-!-margin-top-4"], ["id", "is-visible-externally", "type", "checkbox", 1, "govuk-checkboxes__input", 3, "name", "formControlName"], ["for", "is-visible-externally", 1, "govuk-label", "govuk-checkboxes__label"]], template: function SelectFlagTypeComponent_Template(rf, ctx) { if (rf & 1) {
25005
+ i0.ɵɵtemplate(0, SelectFlagTypeComponent_ng_container_0_Template, 12, 10, "ng-container", 1);
24473
25006
  } if (rf & 2) {
24474
25007
  i0.ɵɵproperty("ngIf", ctx.flagTypes == null ? null : ctx.flagTypes.length);
24475
- i0.ɵɵadvance();
24476
- i0.ɵɵproperty("ngIf", !ctx.refdataError);
24477
25008
  } }, styles: [".hidden[_ngcontent-%COMP%]{display:none}.validation-error[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:#d4351c}"] });
24478
25009
  }
24479
25010
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SelectFlagTypeComponent, [{
24480
25011
  type: Component,
24481
- args: [{ selector: 'ccd-select-flag-type', template: "<ng-container *ngIf=\"flagTypes?.length\" [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': flagTypeNotSelectedErrorMessage.length > 0}\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"flag-type-heading\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n <h1 id=\"flag-type-heading\" class=\"govuk-fieldset__heading govuk-!-margin-bottom-1\">\n <ng-container *ngIf=\"!cachedFlagType; else priorFlagTypeSelected\">\n {{\n isDisplayContextParameterExternal\n ? (caseFlagWizardStepTitle.SELECT_CASE_FLAG_EXTERNAL | rpxTranslate)\n : (caseFlagWizardStepTitle.SELECT_CASE_FLAG | rpxTranslate)\n }}\n </ng-container>\n <ng-template #priorFlagTypeSelected>\n {{cachedFlagType | flagFieldDisplay:'name'}}\n </ng-template>\n </h1>\n </legend>\n <div id=\"flag-type-not-selected-error-message\" class=\"govuk-error-message\"\n *ngIf=\"flagTypeNotSelectedErrorMessage.length > 0\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagTypeNotSelectedErrorMessage | rpxTranslate}}\n </div>\n <div class=\"govuk-radios govuk-radios--conditional\" data-module=\"govuk-radios\" id=\"conditional-radios-list\">\n <div class=\"govuk-radios__item\" *ngFor=\"let flagType of flagTypes; index as i; trackBy: identifyFlagType\">\n <input class=\"govuk-radios__input\" id=\"flag-type-{{i}}\" [name]=\"caseFlagFormField.FLAG_TYPE\"\n type=\"radio\" [value]=\"flagType\"\n [formControlName]=\"caseFlagFormField.FLAG_TYPE\"/>\n <label class=\"govuk-label govuk-radios__label\" for=\"flag-type-{{i}}\">\n {{flagType | flagFieldDisplay:'name'}}\n </label>\n </div>\n <div class=\"govuk-radios__conditional\" *ngIf=\"otherFlagTypeSelected\" id=\"conditional-flagType\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': flagTypeErrorMessage.length > 0}\">\n <label class=\"govuk-label\" for=\"other-flag-type-description\">\n {{\n isDisplayContextParameterExternal\n ? (caseFlagWizardStepTitle.OTHER_FLAG_TYPE_DESCRIPTION_EXTERNAL | rpxTranslate)\n : (caseFlagWizardStepTitle.OTHER_FLAG_TYPE_DESCRIPTION | rpxTranslate)\n }}\n </label>\n <div id=\"flag-type-error-message\" class=\"govuk-error-message\" *ngIf=\"flagTypeErrorMessage.length > 0\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagTypeErrorMessage | rpxTranslate}}\n </div>\n <input class=\"govuk-input govuk-!-width-one-half\"\n [ngClass]=\"{'govuk-input--error': flagTypeErrorMessage.length > 0}\"\n id=\"other-flag-type-description\" [name]=\"caseFlagFormField.OTHER_FLAG_DESCRIPTION\" type=\"text\"\n [formControlName]=\"caseFlagFormField.OTHER_FLAG_DESCRIPTION\"/>\n <div class=\"govuk-checkboxes__item govuk-!-margin-top-4\"\n *ngIf=\"!isDisplayContextParameterExternal && !isCaseLevelFlag && isDisplayContextParameter2Point1Enabled\">\n <input class=\"govuk-checkboxes__input\" id=\"is-visible-externally\" type=\"checkbox\"\n [name]=\"caseFlagFormField.IS_VISIBLE_INTERNALLY_ONLY\" [formControlName]=\"caseFlagFormField.IS_VISIBLE_INTERNALLY_ONLY\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"is-visible-externally\">\n {{'This flag should only be visible to HMCTS Staff' | rpxTranslate}}\n </label>\n </div>\n </div>\n </div>\n </div>\n </fieldset>\n </div>\n</ng-container>\n\n<div class=\"govuk-button-group\" *ngIf=\"!refdataError\">\n <button class=\"button button-primary\" type=\"button\" (click)=\"onNext()\">{{'Next' | rpxTranslate}}</button>\n</div>\n", styles: [".hidden{display:none}.validation-error{cursor:pointer;text-decoration:underline;color:#d4351c}\n"] }]
24482
- }], () => [{ type: CaseFlagRefdataService }], { formGroup: [{
25012
+ args: [{ selector: 'ccd-select-flag-type', template: "<ng-container *ngIf=\"flagTypes?.length\" [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': flagTypeNotSelectedErrorMessage.length > 0}\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"flag-type-heading\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n <h1 id=\"flag-type-heading\" class=\"govuk-fieldset__heading govuk-!-margin-bottom-1\">\n <ng-container *ngIf=\"!cachedFlagType || subJourneyIndex == 0; else priorFlagTypeSelected\">\n {{\n isDisplayContextParameterExternal\n ? (caseFlagWizardStepTitle.SELECT_CASE_FLAG_EXTERNAL | rpxTranslate)\n : (caseFlagWizardStepTitle.SELECT_CASE_FLAG | rpxTranslate)\n }}\n </ng-container>\n <ng-template #priorFlagTypeSelected>\n {{cachedFlagType | flagFieldDisplay:'name'}}\n </ng-template>\n </h1>\n </legend>\n <div id=\"flag-type-not-selected-error-message\" class=\"govuk-error-message\"\n *ngIf=\"flagTypeNotSelectedErrorMessage.length > 0\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagTypeNotSelectedErrorMessage |\n rpxTranslate}}\n </div>\n <div class=\"govuk-radios govuk-radios--conditional\" data-module=\"govuk-radios\" id=\"conditional-radios-list\">\n <div class=\"govuk-radios__item\" *ngFor=\"let flagType of flagTypes; index as i; trackBy: identifyFlagType\">\n <input class=\"govuk-radios__input\" id=\"flag-type-{{i}}\" [name]=\"caseFlagFormField.FLAG_TYPE\" type=\"radio\"\n [value]=\"flagType\" [formControlName]=\"caseFlagFormField.FLAG_TYPE\" />\n <label class=\"govuk-label govuk-radios__label\" for=\"flag-type-{{i}}\">\n {{flagType | flagFieldDisplay:'name'}}\n </label>\n </div>\n <div class=\"govuk-radios__conditional\" *ngIf=\"otherFlagTypeSelected\" id=\"conditional-flagType\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': flagTypeErrorMessage.length > 0}\">\n <label class=\"govuk-label\" for=\"other-flag-type-description\">\n {{\n isDisplayContextParameterExternal\n ? (caseFlagWizardStepTitle.OTHER_FLAG_TYPE_DESCRIPTION_EXTERNAL | rpxTranslate)\n : (caseFlagWizardStepTitle.OTHER_FLAG_TYPE_DESCRIPTION | rpxTranslate)\n }}\n </label>\n <div id=\"flag-type-error-message\" class=\"govuk-error-message\" *ngIf=\"flagTypeErrorMessage.length > 0\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagTypeErrorMessage |\n rpxTranslate}}\n </div>\n <input class=\"govuk-input govuk-!-width-one-half\"\n [ngClass]=\"{'govuk-input--error': flagTypeErrorMessage.length > 0}\" id=\"other-flag-type-description\"\n [name]=\"caseFlagFormField.OTHER_FLAG_DESCRIPTION\" type=\"text\"\n [formControlName]=\"caseFlagFormField.OTHER_FLAG_DESCRIPTION\" />\n <div class=\"govuk-checkboxes__item govuk-!-margin-top-4\"\n *ngIf=\"!isDisplayContextParameterExternal && !isCaseLevelFlag && isDisplayContextParameter2Point1Enabled\">\n <input class=\"govuk-checkboxes__input\" id=\"is-visible-externally\" type=\"checkbox\"\n [name]=\"caseFlagFormField.IS_VISIBLE_INTERNALLY_ONLY\"\n [formControlName]=\"caseFlagFormField.IS_VISIBLE_INTERNALLY_ONLY\">\n <label class=\"govuk-label govuk-checkboxes__label\" for=\"is-visible-externally\">\n {{'This flag should only be visible to HMCTS Staff' | rpxTranslate}}\n </label>\n </div>\n </div>\n </div>\n </div>\n </fieldset>\n </div>\n</ng-container>", styles: [".hidden{display:none}.validation-error{cursor:pointer;text-decoration:underline;color:#d4351c}\n"] }]
25013
+ }], () => [{ type: CaseFlagRefdataService }, { type: MultipageComponentStateService }], { formGroup: [{
24483
25014
  type: Input
24484
25015
  }], jurisdiction: [{
24485
25016
  type: Input
@@ -24498,35 +25029,35 @@ class SelectFlagTypeComponent {
24498
25029
  }], flagCommentsOptionalEmitter: [{
24499
25030
  type: Output
24500
25031
  }] }); })();
24501
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SelectFlagTypeComponent, { className: "SelectFlagTypeComponent", filePath: "lib/shared/components/palette/case-flag/components/select-flag-type/select-flag-type.component.ts", lineNumber: 18 }); })();
25032
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SelectFlagTypeComponent, { className: "SelectFlagTypeComponent", filePath: "lib/shared/components/palette/case-flag/components/select-flag-type/select-flag-type.component.ts", lineNumber: 19 }); })();
24502
25033
 
24503
25034
  const _c0$n = a0 => ({ "form-group-error": a0 });
24504
25035
  const _c1$7 = a0 => ({ "govuk-tag--grey": a0 });
24505
25036
  function UpdateFlagComponent_div_7_Template(rf, ctx) { if (rf & 1) {
24506
- i0.ɵɵelementStart(0, "div", 17);
25037
+ i0.ɵɵelementStart(0, "div", 15);
24507
25038
  i0.ɵɵtext(1);
24508
25039
  i0.ɵɵpipe(2, "updateFlagTitleDisplay");
24509
25040
  i0.ɵɵelementEnd();
24510
25041
  } if (rf & 2) {
24511
- const ctx_r1 = i0.ɵɵnextContext();
25042
+ const ctx_r0 = i0.ɵɵnextContext();
24512
25043
  i0.ɵɵadvance();
24513
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 1, ctx_r1.selectedFlag == null ? null : ctx_r1.selectedFlag.flagDetailDisplay == null ? null : ctx_r1.selectedFlag.flagDetailDisplay.flagDetail), " ");
25044
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 1, ctx_r0.selectedFlag == null ? null : ctx_r0.selectedFlag.flagDetailDisplay == null ? null : ctx_r0.selectedFlag.flagDetailDisplay.flagDetail), " ");
24514
25045
  } }
24515
25046
  function UpdateFlagComponent_div_14_Template(rf, ctx) { if (rf & 1) {
24516
- i0.ɵɵelementStart(0, "div", 18);
25047
+ i0.ɵɵelementStart(0, "div", 16);
24517
25048
  i0.ɵɵtext(1);
24518
25049
  i0.ɵɵpipe(2, "rpxTranslate");
24519
25050
  i0.ɵɵelementEnd();
24520
25051
  } if (rf & 2) {
24521
- const ctx_r1 = i0.ɵɵnextContext();
25052
+ const ctx_r0 = i0.ɵɵnextContext();
24522
25053
  i0.ɵɵadvance();
24523
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 1, ctx_r1.updateFlagStepEnum.COMMENT_HINT_TEXT_EXTERNAL), " ");
25054
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 1, ctx_r0.updateFlagStepEnum.COMMENT_HINT_TEXT_EXTERNAL), " ");
24524
25055
  } }
24525
25056
  function UpdateFlagComponent_ng_container_15_div_5_Template(rf, ctx) { if (rf & 1) {
24526
- i0.ɵɵelementStart(0, "div", 25)(1, "span", 26);
25057
+ i0.ɵɵelementStart(0, "div", 23)(1, "span", 24);
24527
25058
  i0.ɵɵtext(2, "!");
24528
25059
  i0.ɵɵelementEnd();
24529
- i0.ɵɵelementStart(3, "strong", 27)(4, "span", 28);
25060
+ i0.ɵɵelementStart(3, "strong", 25)(4, "span", 26);
24530
25061
  i0.ɵɵtext(5);
24531
25062
  i0.ɵɵpipe(6, "rpxTranslate");
24532
25063
  i0.ɵɵelementEnd();
@@ -24534,14 +25065,14 @@ function UpdateFlagComponent_ng_container_15_div_5_Template(rf, ctx) { if (rf &
24534
25065
  i0.ɵɵpipe(8, "rpxTranslate");
24535
25066
  i0.ɵɵelementEnd()();
24536
25067
  } if (rf & 2) {
24537
- const ctx_r1 = i0.ɵɵnextContext(2);
25068
+ const ctx_r0 = i0.ɵɵnextContext(2);
24538
25069
  i0.ɵɵadvance(5);
24539
25070
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(6, 2, "Warning"));
24540
25071
  i0.ɵɵadvance(2);
24541
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(8, 4, ctx_r1.updateFlagStepEnum.WARNING_TEXT), " ");
25072
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(8, 4, ctx_r0.updateFlagStepEnum.WARNING_TEXT), " ");
24542
25073
  } }
24543
25074
  function UpdateFlagComponent_ng_container_15_div_6_Template(rf, ctx) { if (rf & 1) {
24544
- i0.ɵɵelementStart(0, "div", 29)(1, "span", 30);
25075
+ i0.ɵɵelementStart(0, "div", 27)(1, "span", 28);
24545
25076
  i0.ɵɵtext(2);
24546
25077
  i0.ɵɵpipe(3, "rpxTranslate");
24547
25078
  i0.ɵɵelementEnd();
@@ -24549,14 +25080,14 @@ function UpdateFlagComponent_ng_container_15_div_6_Template(rf, ctx) { if (rf &
24549
25080
  i0.ɵɵpipe(5, "rpxTranslate");
24550
25081
  i0.ɵɵelementEnd();
24551
25082
  } if (rf & 2) {
24552
- const ctx_r1 = i0.ɵɵnextContext(2);
25083
+ const ctx_r0 = i0.ɵɵnextContext(2);
24553
25084
  i0.ɵɵadvance(2);
24554
25085
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 2, "Error:"));
24555
25086
  i0.ɵɵadvance(2);
24556
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r1.commentsNotEnteredErrorMessage), " ");
25087
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.commentsNotEnteredErrorMessage), " ");
24557
25088
  } }
24558
25089
  function UpdateFlagComponent_ng_container_15_div_7_Template(rf, ctx) { if (rf & 1) {
24559
- i0.ɵɵelementStart(0, "div", 31)(1, "span", 30);
25090
+ i0.ɵɵelementStart(0, "div", 29)(1, "span", 28);
24560
25091
  i0.ɵɵtext(2);
24561
25092
  i0.ɵɵpipe(3, "rpxTranslate");
24562
25093
  i0.ɵɵelementEnd();
@@ -24564,64 +25095,64 @@ function UpdateFlagComponent_ng_container_15_div_7_Template(rf, ctx) { if (rf &
24564
25095
  i0.ɵɵpipe(5, "rpxTranslate");
24565
25096
  i0.ɵɵelementEnd();
24566
25097
  } if (rf & 2) {
24567
- const ctx_r1 = i0.ɵɵnextContext(2);
25098
+ const ctx_r0 = i0.ɵɵnextContext(2);
24568
25099
  i0.ɵɵadvance(2);
24569
25100
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 2, "Error:"));
24570
25101
  i0.ɵɵadvance(2);
24571
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r1.commentsCharLimitErrorMessage), " ");
25102
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.commentsCharLimitErrorMessage), " ");
24572
25103
  } }
24573
25104
  function UpdateFlagComponent_ng_container_15_Template(rf, ctx) { if (rf & 1) {
24574
25105
  i0.ɵɵelementContainerStart(0);
24575
- i0.ɵɵelementStart(1, "div", 19);
25106
+ i0.ɵɵelementStart(1, "div", 17);
24576
25107
  i0.ɵɵtext(2);
24577
25108
  i0.ɵɵpipe(3, "rpxTranslate");
24578
25109
  i0.ɵɵpipe(4, "rpxTranslate");
24579
25110
  i0.ɵɵelementEnd();
24580
- i0.ɵɵtemplate(5, UpdateFlagComponent_ng_container_15_div_5_Template, 9, 6, "div", 20)(6, UpdateFlagComponent_ng_container_15_div_6_Template, 6, 6, "div", 21)(7, UpdateFlagComponent_ng_container_15_div_7_Template, 6, 6, "div", 22);
24581
- i0.ɵɵelementStart(8, "textarea", 23);
25111
+ i0.ɵɵtemplate(5, UpdateFlagComponent_ng_container_15_div_5_Template, 9, 6, "div", 18)(6, UpdateFlagComponent_ng_container_15_div_6_Template, 6, 6, "div", 19)(7, UpdateFlagComponent_ng_container_15_div_7_Template, 6, 6, "div", 20);
25112
+ i0.ɵɵelementStart(8, "textarea", 21);
24582
25113
  i0.ɵɵtext(9, " ");
24583
25114
  i0.ɵɵelementEnd();
24584
- i0.ɵɵelementStart(10, "div", 24);
25115
+ i0.ɵɵelementStart(10, "div", 22);
24585
25116
  i0.ɵɵtext(11);
24586
25117
  i0.ɵɵpipe(12, "rpxTranslate");
24587
25118
  i0.ɵɵelementEnd();
24588
25119
  i0.ɵɵelementContainerEnd();
24589
25120
  } if (rf & 2) {
24590
- const ctx_r1 = i0.ɵɵnextContext();
25121
+ const ctx_r0 = i0.ɵɵnextContext();
24591
25122
  i0.ɵɵadvance(2);
24592
- i0.ɵɵtextInterpolate1(" ", ctx_r1.internalUserUpdate ? i0.ɵɵpipeBind1(3, 8, ctx_r1.updateFlagStepEnum.COMMENT_HINT_TEXT_INTERNAL) : i0.ɵɵpipeBind1(4, 10, ctx_r1.updateFlagStepEnum.COMMENT_HINT_TEXT_INTERNAL_2_POINT_1), " ");
25123
+ i0.ɵɵtextInterpolate1(" ", ctx_r0.internalUserUpdate ? i0.ɵɵpipeBind1(3, 8, ctx_r0.updateFlagStepEnum.COMMENT_HINT_TEXT_INTERNAL) : i0.ɵɵpipeBind1(4, 10, ctx_r0.updateFlagStepEnum.COMMENT_HINT_TEXT_INTERNAL_2_POINT_1), " ");
24593
25124
  i0.ɵɵadvance(3);
24594
- i0.ɵɵproperty("ngIf", ctx_r1.internalUser2Point1EnabledUpdate && ctx_r1.externallyVisibleFlag);
25125
+ i0.ɵɵproperty("ngIf", ctx_r0.internalUser2Point1EnabledUpdate && ctx_r0.externallyVisibleFlag);
24595
25126
  i0.ɵɵadvance();
24596
- i0.ɵɵproperty("ngIf", ctx_r1.commentsNotEnteredErrorMessage);
25127
+ i0.ɵɵproperty("ngIf", ctx_r0.commentsNotEnteredErrorMessage);
24597
25128
  i0.ɵɵadvance();
24598
- i0.ɵɵproperty("ngIf", ctx_r1.commentsCharLimitErrorMessage);
25129
+ i0.ɵɵproperty("ngIf", ctx_r0.commentsCharLimitErrorMessage);
24599
25130
  i0.ɵɵadvance();
24600
- i0.ɵɵproperty("id", ctx_r1.caseFlagFormFields.COMMENTS)("name", ctx_r1.caseFlagFormFields.COMMENTS)("formControlName", ctx_r1.caseFlagFormFields.COMMENTS);
25131
+ i0.ɵɵproperty("id", ctx_r0.caseFlagFormFields.COMMENTS)("name", ctx_r0.caseFlagFormFields.COMMENTS)("formControlName", ctx_r0.caseFlagFormFields.COMMENTS);
24601
25132
  i0.ɵɵadvance(3);
24602
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(12, 12, ctx_r1.updateFlagStepEnum.CHARACTER_LIMIT_INFO), " ");
25133
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(12, 12, ctx_r0.updateFlagStepEnum.CHARACTER_LIMIT_INFO), " ");
24603
25134
  } }
24604
25135
  function UpdateFlagComponent_ng_template_16_ng_container_0_ng_container_1_Template(rf, ctx) { if (rf & 1) {
24605
25136
  i0.ɵɵelementContainer(0);
24606
25137
  } }
24607
25138
  function UpdateFlagComponent_ng_template_16_ng_container_0_Template(rf, ctx) { if (rf & 1) {
24608
25139
  i0.ɵɵelementContainerStart(0);
24609
- i0.ɵɵtemplate(1, UpdateFlagComponent_ng_template_16_ng_container_0_ng_container_1_Template, 1, 0, "ng-container", 33);
25140
+ i0.ɵɵtemplate(1, UpdateFlagComponent_ng_template_16_ng_container_0_ng_container_1_Template, 1, 0, "ng-container", 31);
24610
25141
  i0.ɵɵelementContainerEnd();
24611
25142
  } if (rf & 2) {
24612
25143
  i0.ɵɵnextContext(2);
24613
- const updateFlagStatusReason_r3 = i0.ɵɵreference(19);
25144
+ const updateFlagStatusReason_r2 = i0.ɵɵreference(19);
24614
25145
  i0.ɵɵadvance();
24615
- i0.ɵɵproperty("ngTemplateOutlet", updateFlagStatusReason_r3);
25146
+ i0.ɵɵproperty("ngTemplateOutlet", updateFlagStatusReason_r2);
24616
25147
  } }
24617
25148
  function UpdateFlagComponent_ng_template_16_Template(rf, ctx) { if (rf & 1) {
24618
- i0.ɵɵtemplate(0, UpdateFlagComponent_ng_template_16_ng_container_0_Template, 2, 1, "ng-container", 32);
25149
+ i0.ɵɵtemplate(0, UpdateFlagComponent_ng_template_16_ng_container_0_Template, 2, 1, "ng-container", 30);
24619
25150
  } if (rf & 2) {
24620
- const ctx_r1 = i0.ɵɵnextContext();
24621
- i0.ɵɵproperty("ngIf", ctx_r1.externalUserUpdate);
25151
+ const ctx_r0 = i0.ɵɵnextContext();
25152
+ i0.ɵɵproperty("ngIf", ctx_r0.externalUserUpdate);
24622
25153
  } }
24623
25154
  function UpdateFlagComponent_ng_template_18_div_0_Template(rf, ctx) { if (rf & 1) {
24624
- i0.ɵɵelementStart(0, "div", 38)(1, "span", 30);
25155
+ i0.ɵɵelementStart(0, "div", 36)(1, "span", 28);
24625
25156
  i0.ɵɵtext(2);
24626
25157
  i0.ɵɵpipe(3, "rpxTranslate");
24627
25158
  i0.ɵɵelementEnd();
@@ -24629,14 +25160,14 @@ function UpdateFlagComponent_ng_template_18_div_0_Template(rf, ctx) { if (rf & 1
24629
25160
  i0.ɵɵpipe(5, "rpxTranslate");
24630
25161
  i0.ɵɵelementEnd();
24631
25162
  } if (rf & 2) {
24632
- const ctx_r1 = i0.ɵɵnextContext(2);
25163
+ const ctx_r0 = i0.ɵɵnextContext(2);
24633
25164
  i0.ɵɵadvance(2);
24634
25165
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 2, "Error:"));
24635
25166
  i0.ɵɵadvance(2);
24636
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r1.statusReasonNotEnteredErrorMessage), " ");
25167
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.statusReasonNotEnteredErrorMessage), " ");
24637
25168
  } }
24638
25169
  function UpdateFlagComponent_ng_template_18_div_1_Template(rf, ctx) { if (rf & 1) {
24639
- i0.ɵɵelementStart(0, "div", 39)(1, "span", 30);
25170
+ i0.ɵɵelementStart(0, "div", 37)(1, "span", 28);
24640
25171
  i0.ɵɵtext(2);
24641
25172
  i0.ɵɵpipe(3, "rpxTranslate");
24642
25173
  i0.ɵɵelementEnd();
@@ -24644,100 +25175,100 @@ function UpdateFlagComponent_ng_template_18_div_1_Template(rf, ctx) { if (rf & 1
24644
25175
  i0.ɵɵpipe(5, "rpxTranslate");
24645
25176
  i0.ɵɵelementEnd();
24646
25177
  } if (rf & 2) {
24647
- const ctx_r1 = i0.ɵɵnextContext(2);
25178
+ const ctx_r0 = i0.ɵɵnextContext(2);
24648
25179
  i0.ɵɵadvance(2);
24649
25180
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 2, "Error:"));
24650
25181
  i0.ɵɵadvance(2);
24651
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r1.statusReasonCharLimitErrorMessage), " ");
25182
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.statusReasonCharLimitErrorMessage), " ");
24652
25183
  } }
24653
25184
  function UpdateFlagComponent_ng_template_18_Template(rf, ctx) { if (rf & 1) {
24654
- i0.ɵɵtemplate(0, UpdateFlagComponent_ng_template_18_div_0_Template, 6, 6, "div", 34)(1, UpdateFlagComponent_ng_template_18_div_1_Template, 6, 6, "div", 35);
24655
- i0.ɵɵelementStart(2, "textarea", 36);
25185
+ i0.ɵɵtemplate(0, UpdateFlagComponent_ng_template_18_div_0_Template, 6, 6, "div", 32)(1, UpdateFlagComponent_ng_template_18_div_1_Template, 6, 6, "div", 33);
25186
+ i0.ɵɵelementStart(2, "textarea", 34);
24656
25187
  i0.ɵɵtext(3, " ");
24657
25188
  i0.ɵɵelementEnd();
24658
- i0.ɵɵelementStart(4, "div", 37);
25189
+ i0.ɵɵelementStart(4, "div", 35);
24659
25190
  i0.ɵɵtext(5);
24660
25191
  i0.ɵɵpipe(6, "rpxTranslate");
24661
25192
  i0.ɵɵelementEnd();
24662
25193
  } if (rf & 2) {
24663
- const ctx_r1 = i0.ɵɵnextContext();
24664
- i0.ɵɵproperty("ngIf", ctx_r1.statusReasonNotEnteredErrorMessage);
25194
+ const ctx_r0 = i0.ɵɵnextContext();
25195
+ i0.ɵɵproperty("ngIf", ctx_r0.statusReasonNotEnteredErrorMessage);
24665
25196
  i0.ɵɵadvance();
24666
- i0.ɵɵproperty("ngIf", ctx_r1.statusReasonCharLimitErrorMessage);
25197
+ i0.ɵɵproperty("ngIf", ctx_r0.statusReasonCharLimitErrorMessage);
24667
25198
  i0.ɵɵadvance();
24668
- i0.ɵɵproperty("id", ctx_r1.caseFlagFormFields.STATUS_CHANGE_REASON)("name", ctx_r1.caseFlagFormFields.STATUS_CHANGE_REASON)("formControlName", ctx_r1.caseFlagFormFields.STATUS_CHANGE_REASON);
25199
+ i0.ɵɵproperty("id", ctx_r0.caseFlagFormFields.STATUS_CHANGE_REASON)("name", ctx_r0.caseFlagFormFields.STATUS_CHANGE_REASON)("formControlName", ctx_r0.caseFlagFormFields.STATUS_CHANGE_REASON);
24669
25200
  i0.ɵɵadvance(3);
24670
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 6, ctx_r1.updateFlagStepEnum.CHARACTER_LIMIT_INFO), " ");
25201
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 6, ctx_r0.updateFlagStepEnum.CHARACTER_LIMIT_INFO), " ");
24671
25202
  } }
24672
25203
  function UpdateFlagComponent_div_20_div_8_Template(rf, ctx) { if (rf & 1) {
24673
- i0.ɵɵelementStart(0, "div", 47);
24674
- i0.ɵɵelement(1, "input", 48);
24675
- i0.ɵɵelementStart(2, "label", 49);
25204
+ i0.ɵɵelementStart(0, "div", 45);
25205
+ i0.ɵɵelement(1, "input", 46);
25206
+ i0.ɵɵelementStart(2, "label", 47);
24676
25207
  i0.ɵɵtext(3);
24677
25208
  i0.ɵɵpipe(4, "rpxTranslate");
24678
25209
  i0.ɵɵelementEnd()();
24679
25210
  } if (rf & 2) {
24680
- const status_r4 = ctx.$implicit;
24681
- const ctx_r1 = i0.ɵɵnextContext(2);
25211
+ const status_r3 = ctx.$implicit;
25212
+ const ctx_r0 = i0.ɵɵnextContext(2);
24682
25213
  i0.ɵɵadvance();
24683
- i0.ɵɵproperty("id", ctx_r1.caseFlagFormFields.STATUS + "_" + status_r4)("name", ctx_r1.caseFlagFormFields.STATUS)("formControlName", ctx_r1.caseFlagFormFields.STATUS)("value", status_r4);
25214
+ i0.ɵɵproperty("id", ctx_r0.caseFlagFormFields.STATUS + "_" + status_r3)("name", ctx_r0.caseFlagFormFields.STATUS)("formControlName", ctx_r0.caseFlagFormFields.STATUS)("value", status_r3);
24684
25215
  i0.ɵɵadvance();
24685
- i0.ɵɵproperty("for", ctx_r1.caseFlagFormFields.STATUS + "_" + status_r4);
25216
+ i0.ɵɵproperty("for", ctx_r0.caseFlagFormFields.STATUS + "_" + status_r3);
24686
25217
  i0.ɵɵadvance();
24687
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(4, 6, ctx_r1.caseFlagStatusEnum[status_r4]), " ");
25218
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(4, 6, ctx_r0.caseFlagStatusEnum[status_r3]), " ");
24688
25219
  } }
24689
25220
  function UpdateFlagComponent_div_20_ng_container_12_Template(rf, ctx) { if (rf & 1) {
24690
25221
  i0.ɵɵelementContainer(0);
24691
25222
  } }
24692
25223
  function UpdateFlagComponent_div_20_Template(rf, ctx) { if (rf & 1) {
24693
- i0.ɵɵelementStart(0, "div", 40)(1, "fieldset", 41)(2, "legend", 42)(3, "h1", 43);
25224
+ i0.ɵɵelementStart(0, "div", 38)(1, "fieldset", 39)(2, "legend", 40)(3, "h1", 41);
24694
25225
  i0.ɵɵtext(4);
24695
25226
  i0.ɵɵpipe(5, "rpxTranslate");
24696
25227
  i0.ɵɵpipe(6, "rpxTranslate");
24697
25228
  i0.ɵɵelementEnd()();
24698
- i0.ɵɵelementStart(7, "div", 44);
24699
- i0.ɵɵtemplate(8, UpdateFlagComponent_div_20_div_8_Template, 5, 8, "div", 45);
25229
+ i0.ɵɵelementStart(7, "div", 42);
25230
+ i0.ɵɵtemplate(8, UpdateFlagComponent_div_20_div_8_Template, 5, 8, "div", 43);
24700
25231
  i0.ɵɵelementEnd()();
24701
- i0.ɵɵelementStart(9, "div", 46);
25232
+ i0.ɵɵelementStart(9, "div", 44);
24702
25233
  i0.ɵɵtext(10);
24703
25234
  i0.ɵɵpipe(11, "rpxTranslate");
24704
25235
  i0.ɵɵelementEnd();
24705
- i0.ɵɵtemplate(12, UpdateFlagComponent_div_20_ng_container_12_Template, 1, 0, "ng-container", 33);
25236
+ i0.ɵɵtemplate(12, UpdateFlagComponent_div_20_ng_container_12_Template, 1, 0, "ng-container", 31);
24706
25237
  i0.ɵɵelementEnd();
24707
25238
  } if (rf & 2) {
24708
- const ctx_r1 = i0.ɵɵnextContext();
24709
- const updateFlagStatusReason_r3 = i0.ɵɵreference(19);
25239
+ const ctx_r0 = i0.ɵɵnextContext();
25240
+ const updateFlagStatusReason_r2 = i0.ɵɵreference(19);
24710
25241
  i0.ɵɵadvance(4);
24711
- i0.ɵɵtextInterpolate2(" ", i0.ɵɵpipeBind1(5, 6, ctx_r1.updateFlagTitle), " ", i0.ɵɵpipeBind1(6, 8, "status"), " ");
25242
+ i0.ɵɵtextInterpolate2(" ", i0.ɵɵpipeBind1(5, 6, ctx_r0.updateFlagTitle), " ", i0.ɵɵpipeBind1(6, 8, "status"), " ");
24712
25243
  i0.ɵɵadvance(3);
24713
- i0.ɵɵproperty("id", ctx_r1.caseFlagFormFields.STATUS);
25244
+ i0.ɵɵproperty("id", ctx_r0.caseFlagFormFields.STATUS);
24714
25245
  i0.ɵɵadvance();
24715
- i0.ɵɵproperty("ngForOf", ctx_r1.validStatusProgressions);
25246
+ i0.ɵɵproperty("ngForOf", ctx_r0.validStatusProgressions);
24716
25247
  i0.ɵɵadvance(2);
24717
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(11, 10, ctx_r1.updateFlagStepEnum.STATUS_HINT_TEXT), " ");
25248
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(11, 10, ctx_r0.updateFlagStepEnum.STATUS_HINT_TEXT), " ");
24718
25249
  i0.ɵɵadvance(2);
24719
- i0.ɵɵproperty("ngTemplateOutlet", updateFlagStatusReason_r3);
25250
+ i0.ɵɵproperty("ngTemplateOutlet", updateFlagStatusReason_r2);
24720
25251
  } }
24721
25252
  function UpdateFlagComponent_div_21_Template(rf, ctx) { if (rf & 1) {
24722
- i0.ɵɵelementStart(0, "div", 50)(1, "div", 51)(2, "div", 52);
24723
- i0.ɵɵelement(3, "input", 53);
24724
- i0.ɵɵelementStart(4, "label", 54);
25253
+ i0.ɵɵelementStart(0, "div", 48)(1, "div", 49)(2, "div", 50);
25254
+ i0.ɵɵelement(3, "input", 51);
25255
+ i0.ɵɵelementStart(4, "label", 52);
24725
25256
  i0.ɵɵtext(5);
24726
25257
  i0.ɵɵpipe(6, "rpxTranslate");
24727
25258
  i0.ɵɵelementEnd()()()();
24728
25259
  } if (rf & 2) {
24729
- const ctx_r1 = i0.ɵɵnextContext();
25260
+ const ctx_r0 = i0.ɵɵnextContext();
24730
25261
  i0.ɵɵadvance(3);
24731
- i0.ɵɵproperty("formControlName", ctx_r1.caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED)("id", ctx_r1.caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED)("name", ctx_r1.caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED);
25262
+ i0.ɵɵproperty("formControlName", ctx_r0.caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED)("id", ctx_r0.caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED)("name", ctx_r0.caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED);
24732
25263
  i0.ɵɵadvance();
24733
- i0.ɵɵproperty("for", ctx_r1.caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED);
25264
+ i0.ɵɵproperty("for", ctx_r0.caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED);
24734
25265
  i0.ɵɵadvance();
24735
25266
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 5, "I need to add a translation"), " ");
24736
25267
  } }
24737
25268
  function UpdateFlagComponent_div_22_button_10_Template(rf, ctx) { if (rf & 1) {
24738
- const _r5 = i0.ɵɵgetCurrentView();
24739
- i0.ɵɵelementStart(0, "button", 59);
24740
- i0.ɵɵlistener("click", function UpdateFlagComponent_div_22_button_10_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.onMakeInactive()); });
25269
+ const _r4 = i0.ɵɵgetCurrentView();
25270
+ i0.ɵɵelementStart(0, "button", 57);
25271
+ i0.ɵɵlistener("click", function UpdateFlagComponent_div_22_button_10_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r4); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onMakeInactive()); });
24741
25272
  i0.ɵɵtext(1);
24742
25273
  i0.ɵɵpipe(2, "rpxTranslate");
24743
25274
  i0.ɵɵelementEnd();
@@ -24746,28 +25277,28 @@ function UpdateFlagComponent_div_22_button_10_Template(rf, ctx) { if (rf & 1) {
24746
25277
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 1, "Make inactive"), " ");
24747
25278
  } }
24748
25279
  function UpdateFlagComponent_div_22_Template(rf, ctx) { if (rf & 1) {
24749
- i0.ɵɵelementStart(0, "div", 55)(1, "div", 56)(2, "p");
25280
+ i0.ɵɵelementStart(0, "div", 53)(1, "div", 54)(2, "p");
24750
25281
  i0.ɵɵtext(3);
24751
25282
  i0.ɵɵpipe(4, "rpxTranslate");
24752
- i0.ɵɵelementStart(5, "span")(6, "strong", 57);
25283
+ i0.ɵɵelementStart(5, "span")(6, "strong", 55);
24753
25284
  i0.ɵɵtext(7);
24754
25285
  i0.ɵɵpipe(8, "rpxTranslate");
24755
25286
  i0.ɵɵelementEnd()()()();
24756
- i0.ɵɵelementStart(9, "div", 56);
24757
- i0.ɵɵtemplate(10, UpdateFlagComponent_div_22_button_10_Template, 3, 3, "button", 58);
25287
+ i0.ɵɵelementStart(9, "div", 54);
25288
+ i0.ɵɵtemplate(10, UpdateFlagComponent_div_22_button_10_Template, 3, 3, "button", 56);
24758
25289
  i0.ɵɵelementEnd()();
24759
25290
  } if (rf & 2) {
24760
- const ctx_r1 = i0.ɵɵnextContext();
25291
+ const ctx_r0 = i0.ɵɵnextContext();
24761
25292
  i0.ɵɵadvance(3);
24762
25293
  i0.ɵɵtextInterpolate1("", i0.ɵɵpipeBind1(4, 4, "Flag status:"), " ");
24763
25294
  i0.ɵɵadvance(3);
24764
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c1$7, ctx_r1.selectedFlag.flagDetailDisplay.flagDetail.status === "Inactive"));
25295
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c1$7, ctx_r0.selectedFlag.flagDetailDisplay.flagDetail.status === "Inactive"));
24765
25296
  i0.ɵɵadvance();
24766
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(8, 6, ctx_r1.selectedFlag == null ? null : ctx_r1.selectedFlag.flagDetailDisplay == null ? null : ctx_r1.selectedFlag.flagDetailDisplay.flagDetail == null ? null : ctx_r1.selectedFlag.flagDetailDisplay.flagDetail.status), " ");
25297
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(8, 6, ctx_r0.selectedFlag == null ? null : ctx_r0.selectedFlag.flagDetailDisplay == null ? null : ctx_r0.selectedFlag.flagDetailDisplay.flagDetail == null ? null : ctx_r0.selectedFlag.flagDetailDisplay.flagDetail.status), " ");
24767
25298
  i0.ɵɵadvance(3);
24768
- i0.ɵɵproperty("ngIf", ctx_r1.selectedFlag.flagDetailDisplay.flagDetail.status === "Active");
25299
+ i0.ɵɵproperty("ngIf", ctx_r0.selectedFlag.flagDetailDisplay.flagDetail.status === "Active");
24769
25300
  } }
24770
- class UpdateFlagComponent {
25301
+ class UpdateFlagComponent extends AbstractJourneyComponent {
24771
25302
  rpxTranslationService;
24772
25303
  formGroup;
24773
25304
  displayContextParameter;
@@ -24793,7 +25324,8 @@ class UpdateFlagComponent {
24793
25324
  get externallyVisibleFlag() {
24794
25325
  return this.selectedFlag.flagDetailDisplay.visibility?.toLowerCase() === 'external';
24795
25326
  }
24796
- constructor(rpxTranslationService) {
25327
+ constructor(rpxTranslationService, multipageComponentStateService) {
25328
+ super(multipageComponentStateService);
24797
25329
  this.rpxTranslationService = rpxTranslationService;
24798
25330
  }
24799
25331
  ngOnInit() {
@@ -24940,9 +25472,14 @@ class UpdateFlagComponent {
24940
25472
  });
24941
25473
  }
24942
25474
  }
24943
- static ɵfac = function UpdateFlagComponent_Factory(t) { return new (t || UpdateFlagComponent)(i0.ɵɵdirectiveInject(i1.RpxTranslationService)); };
24944
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UpdateFlagComponent, selectors: [["ccd-update-flag"]], inputs: { formGroup: "formGroup", displayContextParameter: "displayContextParameter" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, decls: 27, vars: 25, consts: [["externalUser", ""], ["updateFlagStatusReason", ""], [3, "formGroup"], ["data-module", "govuk-character-count", "data-maxlength", "200", 1, "govuk-character-count"], [1, "govuk-form-group", 3, "ngClass"], [1, "govuk-label-wrapper", "govuk-!-margin-bottom-4"], [1, "govuk-label", "govuk-label--m"], ["id", "update-flag-hint-external", "class", "govuk-hint", 4, "ngIf"], [1, "govuk-!-margin-bottom-4"], [1, "govuk-label", "govuk-label--s", 3, "for"], ["id", "update-flag-comments-hint-external", "class", "govuk-hint", 4, "ngIf"], [4, "ngIf", "ngIfElse"], ["id", "flag-status-container-v2_1", "class", "govuk-!-margin-bottom-4", 4, "ngIf"], ["id", "translation-checkbox-container", "class", "govuk-!-margin-bottom-6", 4, "ngIf"], ["id", "flag-status-container-v1", "class", "govuk-grid-row", 4, "ngIf"], [1, "govuk-button-group"], ["id", "updateFlagNextButton", "type", "button", 1, "govuk-button", 3, "click"], ["id", "update-flag-hint-external", 1, "govuk-hint"], ["id", "update-flag-comments-hint-external", 1, "govuk-hint"], ["id", "update-flag-comments-hint", 1, "govuk-hint"], ["class", "govuk-warning-text", 4, "ngIf"], ["id", "update-flag-comments-not-entered-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "update-flag-comments-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["rows", "5", "aria-describedby", "update-flag-comments-hint update-flag-comments-char-limit-info update-flag-comments-char-limit-error", 1, "govuk-textarea", 3, "id", "name", "formControlName"], ["id", "update-flag-comments-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], [1, "govuk-warning-text"], ["aria-hidden", "true", 1, "govuk-warning-text__icon"], [1, "govuk-warning-text__text"], [1, "govuk-warning-text__assistive"], ["id", "update-flag-comments-not-entered-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "update-flag-comments-char-limit-error", 1, "govuk-error-message"], [4, "ngIf"], [4, "ngTemplateOutlet"], ["id", "update-flag-status-reason-not-entered-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "update-flag-status-reason-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["rows", "5", "aria-describedby", "update-flag-comments-hint-external update-flag-status-hint update-flag-status-reason-char-limit-info\n update-flag-status-reason-char-limit-error", 1, "govuk-textarea", 3, "id", "name", "formControlName"], ["id", "update-flag-status-reason-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], ["id", "update-flag-status-reason-not-entered-error-message", 1, "govuk-error-message"], ["id", "update-flag-status-reason-char-limit-error", 1, "govuk-error-message"], ["id", "flag-status-container-v2_1", 1, "govuk-!-margin-bottom-4"], ["aria-describedby", "update-flag-status-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--s"], ["id", "update-flag-status-heading", 1, "govuk-fieldset__heading"], ["data-module", "govuk-radios", 1, "govuk-radios", "govuk-radios--conditional", "govuk-!-margin-bottom-4", 3, "id"], ["class", "govuk-radios__item", 4, "ngFor", "ngForOf"], ["id", "update-flag-status-hint", 1, "govuk-hint"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "id", "name", "formControlName", "value"], [1, "govuk-label", "govuk-radios__label", 3, "for"], ["id", "translation-checkbox-container", 1, "govuk-!-margin-bottom-6"], ["data-module", "govuk-checkboxes", 1, "govuk-checkboxes"], [1, "govuk-checkboxes__item"], ["type", "checkbox", 1, "govuk-checkboxes__input", 3, "formControlName", "id", "name"], [1, "govuk-label", "govuk-checkboxes__label", 3, "for"], ["id", "flag-status-container-v1", 1, "govuk-grid-row"], [1, "govuk-grid-column-one-half"], [1, "govuk-tag", 3, "ngClass"], ["class", "button button-secondary", "type", "button", 3, "click", 4, "ngIf"], ["type", "button", 1, "button", "button-secondary", 3, "click"]], template: function UpdateFlagComponent_Template(rf, ctx) { if (rf & 1) {
24945
- const _r1 = i0.ɵɵgetCurrentView();
25475
+ next() {
25476
+ this.onNext();
25477
+ if (this.errorMessages.length === 0) {
25478
+ super.next();
25479
+ }
25480
+ }
25481
+ static ɵfac = function UpdateFlagComponent_Factory(t) { return new (t || UpdateFlagComponent)(i0.ɵɵdirectiveInject(i1.RpxTranslationService), i0.ɵɵdirectiveInject(MultipageComponentStateService)); };
25482
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UpdateFlagComponent, selectors: [["ccd-update-flag"]], inputs: { formGroup: "formGroup", displayContextParameter: "displayContextParameter" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 23, vars: 22, consts: [["externalUser", ""], ["updateFlagStatusReason", ""], [3, "formGroup"], ["data-module", "govuk-character-count", "data-maxlength", "200", 1, "govuk-character-count"], [1, "govuk-form-group", 3, "ngClass"], [1, "govuk-label-wrapper", "govuk-!-margin-bottom-4"], [1, "govuk-label", "govuk-label--m"], ["id", "update-flag-hint-external", "class", "govuk-hint", 4, "ngIf"], [1, "govuk-!-margin-bottom-4"], [1, "govuk-label", "govuk-label--s", 3, "for"], ["id", "update-flag-comments-hint-external", "class", "govuk-hint", 4, "ngIf"], [4, "ngIf", "ngIfElse"], ["id", "flag-status-container-v2_1", "class", "govuk-!-margin-bottom-4", 4, "ngIf"], ["id", "translation-checkbox-container", "class", "govuk-!-margin-bottom-6", 4, "ngIf"], ["id", "flag-status-container-v1", "class", "govuk-grid-row", 4, "ngIf"], ["id", "update-flag-hint-external", 1, "govuk-hint"], ["id", "update-flag-comments-hint-external", 1, "govuk-hint"], ["id", "update-flag-comments-hint", 1, "govuk-hint"], ["class", "govuk-warning-text", 4, "ngIf"], ["id", "update-flag-comments-not-entered-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "update-flag-comments-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["rows", "5", "aria-describedby", "update-flag-comments-hint update-flag-comments-char-limit-info update-flag-comments-char-limit-error", 1, "govuk-textarea", 3, "id", "name", "formControlName"], ["id", "update-flag-comments-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], [1, "govuk-warning-text"], ["aria-hidden", "true", 1, "govuk-warning-text__icon"], [1, "govuk-warning-text__text"], [1, "govuk-warning-text__assistive"], ["id", "update-flag-comments-not-entered-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "update-flag-comments-char-limit-error", 1, "govuk-error-message"], [4, "ngIf"], [4, "ngTemplateOutlet"], ["id", "update-flag-status-reason-not-entered-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "update-flag-status-reason-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["rows", "5", "aria-describedby", "update-flag-comments-hint-external update-flag-status-hint update-flag-status-reason-char-limit-info\n update-flag-status-reason-char-limit-error", 1, "govuk-textarea", 3, "id", "name", "formControlName"], ["id", "update-flag-status-reason-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], ["id", "update-flag-status-reason-not-entered-error-message", 1, "govuk-error-message"], ["id", "update-flag-status-reason-char-limit-error", 1, "govuk-error-message"], ["id", "flag-status-container-v2_1", 1, "govuk-!-margin-bottom-4"], ["aria-describedby", "update-flag-status-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--s"], ["id", "update-flag-status-heading", 1, "govuk-fieldset__heading"], ["data-module", "govuk-radios", 1, "govuk-radios", "govuk-radios--conditional", "govuk-!-margin-bottom-4", 3, "id"], ["class", "govuk-radios__item", 4, "ngFor", "ngForOf"], ["id", "update-flag-status-hint", 1, "govuk-hint"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "id", "name", "formControlName", "value"], [1, "govuk-label", "govuk-radios__label", 3, "for"], ["id", "translation-checkbox-container", 1, "govuk-!-margin-bottom-6"], ["data-module", "govuk-checkboxes", 1, "govuk-checkboxes"], [1, "govuk-checkboxes__item"], ["type", "checkbox", 1, "govuk-checkboxes__input", 3, "formControlName", "id", "name"], [1, "govuk-label", "govuk-checkboxes__label", 3, "for"], ["id", "flag-status-container-v1", 1, "govuk-grid-row"], [1, "govuk-grid-column-one-half"], [1, "govuk-tag", 3, "ngClass"], ["class", "button button-secondary", "type", "button", 3, "click", 4, "ngIf"], ["type", "button", 1, "button", "button-secondary", 3, "click"]], template: function UpdateFlagComponent_Template(rf, ctx) { if (rf & 1) {
24946
25483
  i0.ɵɵelementContainerStart(0, 2);
24947
25484
  i0.ɵɵelementStart(1, "div", 3)(2, "div", 4)(3, "h1", 5)(4, "label", 6);
24948
25485
  i0.ɵɵtext(5);
@@ -24960,53 +25497,46 @@ class UpdateFlagComponent {
24960
25497
  i0.ɵɵtemplate(18, UpdateFlagComponent_ng_template_18_Template, 7, 8, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor)(20, UpdateFlagComponent_div_20_Template, 13, 12, "div", 12)(21, UpdateFlagComponent_div_21_Template, 7, 7, "div", 13)(22, UpdateFlagComponent_div_22_Template, 11, 10, "div", 14);
24961
25498
  i0.ɵɵelementEnd()();
24962
25499
  i0.ɵɵelementContainerEnd();
24963
- i0.ɵɵelementStart(23, "div", 15)(24, "button", 16);
24964
- i0.ɵɵlistener("click", function UpdateFlagComponent_Template_button_click_24_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onNext()); });
24965
- i0.ɵɵtext(25);
24966
- i0.ɵɵpipe(26, "rpxTranslate");
24967
- i0.ɵɵelementEnd()();
24968
25500
  } if (rf & 2) {
24969
- const externalUser_r6 = i0.ɵɵreference(17);
25501
+ const externalUser_r5 = i0.ɵɵreference(17);
24970
25502
  i0.ɵɵproperty("formGroup", ctx.formGroup);
24971
25503
  i0.ɵɵadvance(2);
24972
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(23, _c0$n, ctx.errorMessages.length > 0));
25504
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(20, _c0$n, ctx.errorMessages.length > 0));
24973
25505
  i0.ɵɵadvance(3);
24974
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 13, ctx.updateFlagTitle), " ");
25506
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 12, ctx.updateFlagTitle), " ");
24975
25507
  i0.ɵɵadvance(2);
24976
25508
  i0.ɵɵproperty("ngIf", ctx.externalUserUpdate);
24977
25509
  i0.ɵɵadvance(2);
24978
25510
  i0.ɵɵproperty("for", ctx.caseFlagFormFields.COMMENTS);
24979
25511
  i0.ɵɵadvance();
24980
- i0.ɵɵtextInterpolate1(" ", ctx.externalUserUpdate ? i0.ɵɵpipeBind1(11, 15, ctx.updateFlagStepEnum.COMMENT_FIELD_LABEL_EXTERNAL) : i0.ɵɵpipeBind1(12, 17, ctx.updateFlagTitle) + i0.ɵɵpipeBind1(13, 19, " comments"), " ");
25512
+ i0.ɵɵtextInterpolate1(" ", ctx.externalUserUpdate ? i0.ɵɵpipeBind1(11, 14, ctx.updateFlagStepEnum.COMMENT_FIELD_LABEL_EXTERNAL) : i0.ɵɵpipeBind1(12, 16, ctx.updateFlagTitle) + i0.ɵɵpipeBind1(13, 18, " comments"), " ");
24981
25513
  i0.ɵɵadvance(4);
24982
25514
  i0.ɵɵproperty("ngIf", ctx.externalUserUpdate);
24983
25515
  i0.ɵɵadvance();
24984
- i0.ɵɵproperty("ngIf", ctx.internalUserUpdate || ctx.internalUser2Point1EnabledUpdate || ctx.displayContextParameter === "")("ngIfElse", externalUser_r6);
25516
+ i0.ɵɵproperty("ngIf", ctx.internalUserUpdate || ctx.internalUser2Point1EnabledUpdate || ctx.displayContextParameter === "")("ngIfElse", externalUser_r5);
24985
25517
  i0.ɵɵadvance(5);
24986
25518
  i0.ɵɵproperty("ngIf", ctx.internalUser2Point1EnabledUpdate);
24987
25519
  i0.ɵɵadvance();
24988
25520
  i0.ɵɵproperty("ngIf", ctx.internalUser2Point1EnabledUpdate);
24989
25521
  i0.ɵɵadvance();
24990
25522
  i0.ɵɵproperty("ngIf", ctx.internalUserUpdate);
24991
- i0.ɵɵadvance(3);
24992
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(26, 21, "Next"), " ");
24993
25523
  } }, encapsulation: 2 });
24994
25524
  }
24995
25525
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UpdateFlagComponent, [{
24996
25526
  type: Component,
24997
- args: [{ selector: 'ccd-update-flag', template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"200\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <h1 class=\"govuk-label-wrapper govuk-!-margin-bottom-4\">\n <label class=\"govuk-label govuk-label--m\">\n {{updateFlagTitle | rpxTranslate}}\n </label>\n </h1>\n <div id=\"update-flag-hint-external\" class=\"govuk-hint\" *ngIf=\"externalUserUpdate\">\n {{selectedFlag?.flagDetailDisplay?.flagDetail | updateFlagTitleDisplay}}\n </div>\n\n <div class=\"govuk-!-margin-bottom-4\">\n <label class=\"govuk-label govuk-label--s\" [for]=\"caseFlagFormFields.COMMENTS\">\n {{\n externalUserUpdate\n ? (updateFlagStepEnum.COMMENT_FIELD_LABEL_EXTERNAL | rpxTranslate)\n : (updateFlagTitle | rpxTranslate) + (' comments' | rpxTranslate)\n }}\n </label>\n <div id=\"update-flag-comments-hint-external\" class=\"govuk-hint\" *ngIf=\"externalUserUpdate\">\n {{updateFlagStepEnum.COMMENT_HINT_TEXT_EXTERNAL | rpxTranslate}}\n </div>\n <ng-container *ngIf=\"internalUserUpdate || internalUser2Point1EnabledUpdate || displayContextParameter === '';\n else externalUser\">\n <div id=\"update-flag-comments-hint\" class=\"govuk-hint\">\n {{\n internalUserUpdate\n ? (updateFlagStepEnum.COMMENT_HINT_TEXT_INTERNAL | rpxTranslate)\n : (updateFlagStepEnum.COMMENT_HINT_TEXT_INTERNAL_2_POINT_1 | rpxTranslate)\n }}\n </div>\n <div class=\"govuk-warning-text\" *ngIf=\"internalUser2Point1EnabledUpdate && externallyVisibleFlag\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-warning-text__assistive\">{{'Warning' | rpxTranslate}}</span>\n {{updateFlagStepEnum.WARNING_TEXT | rpxTranslate}}\n </strong>\n </div>\n <div id=\"update-flag-comments-not-entered-error-message\" class=\"govuk-error-message\" *ngIf=\"commentsNotEnteredErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{commentsNotEnteredErrorMessage | rpxTranslate}}\n </div>\n <div id=\"update-flag-comments-char-limit-error\" class=\"govuk-error-message\" *ngIf=\"commentsCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{commentsCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea class=\"govuk-textarea\"\n [id]=\"caseFlagFormFields.COMMENTS\"\n [name]=\"caseFlagFormFields.COMMENTS\"\n [formControlName]=\"caseFlagFormFields.COMMENTS\"\n rows=\"5\"\n aria-describedby=\"update-flag-comments-hint update-flag-comments-char-limit-info update-flag-comments-char-limit-error\">\n </textarea>\n <div id=\"update-flag-comments-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{updateFlagStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </ng-container>\n <ng-template #externalUser>\n <ng-container *ngIf=\"externalUserUpdate\">\n <ng-container *ngTemplateOutlet=\"updateFlagStatusReason\"></ng-container>\n </ng-container>\n </ng-template>\n </div>\n\n <ng-template #updateFlagStatusReason>\n <div id=\"update-flag-status-reason-not-entered-error-message\" class=\"govuk-error-message\" *ngIf=\"statusReasonNotEnteredErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{statusReasonNotEnteredErrorMessage | rpxTranslate}}\n </div>\n <div id=\"update-flag-status-reason-char-limit-error\" class=\"govuk-error-message\" *ngIf=\"statusReasonCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{statusReasonCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea class=\"govuk-textarea\"\n [id]=\"caseFlagFormFields.STATUS_CHANGE_REASON\"\n [name]=\"caseFlagFormFields.STATUS_CHANGE_REASON\"\n [formControlName]=\"caseFlagFormFields.STATUS_CHANGE_REASON\"\n rows=\"5\"\n aria-describedby=\"update-flag-comments-hint-external update-flag-status-hint update-flag-status-reason-char-limit-info\n update-flag-status-reason-char-limit-error\">\n </textarea>\n <div id=\"update-flag-status-reason-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{updateFlagStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </ng-template>\n\n <div id=\"flag-status-container-v2_1\" class=\"govuk-!-margin-bottom-4\" *ngIf=\"internalUser2Point1EnabledUpdate\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"update-flag-status-heading\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--s\">\n <h1 id=\"update-flag-status-heading\" class=\"govuk-fieldset__heading\">\n {{updateFlagTitle | rpxTranslate}} {{'status' | rpxTranslate}}\n </h1>\n </legend>\n <div class=\"govuk-radios govuk-radios--conditional govuk-!-margin-bottom-4\" data-module=\"govuk-radios\" [id]=\"caseFlagFormFields.STATUS\">\n <div class=\"govuk-radios__item\" *ngFor=\"let status of validStatusProgressions\">\n <input class=\"govuk-radios__input\" type=\"radio\"\n [id]=\"caseFlagFormFields.STATUS + '_' + status\"\n [name]=\"caseFlagFormFields.STATUS\"\n [formControlName]=\"caseFlagFormFields.STATUS\"\n [value]=\"status\">\n <label class=\"govuk-label govuk-radios__label\" [for]=\"caseFlagFormFields.STATUS + '_' + status\">\n {{caseFlagStatusEnum[status] | rpxTranslate}}\n </label>\n </div>\n </div>\n </fieldset>\n\n <div id=\"update-flag-status-hint\" class=\"govuk-hint\">\n {{updateFlagStepEnum.STATUS_HINT_TEXT | rpxTranslate}}\n </div>\n <ng-container *ngTemplateOutlet=\"updateFlagStatusReason\"></ng-container>\n </div>\n\n <div id=\"translation-checkbox-container\" class=\"govuk-!-margin-bottom-6\" *ngIf=\"internalUser2Point1EnabledUpdate\">\n <div class=\"govuk-checkboxes\" data-module=\"govuk-checkboxes\">\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" type=\"checkbox\"\n [formControlName]=\"caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED\"\n [id]=\"caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED\"\n [name]=\"caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED\">\n <label class=\"govuk-label govuk-checkboxes__label\"\n [for]=\"caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED\">\n {{'I need to add a translation' | rpxTranslate}}\n </label>\n </div>\n </div>\n </div>\n\n <div id=\"flag-status-container-v1\" class=\"govuk-grid-row\" *ngIf=\"internalUserUpdate\">\n <div class=\"govuk-grid-column-one-half\">\n <p>{{'Flag status:' | rpxTranslate}}\n <span>\n <strong class=\"govuk-tag\" [ngClass]=\"{'govuk-tag--grey': selectedFlag.flagDetailDisplay.flagDetail.status === 'Inactive'}\">\n {{selectedFlag?.flagDetailDisplay?.flagDetail?.status | rpxTranslate}}\n </strong>\n </span>\n </p>\n </div>\n <div class=\"govuk-grid-column-one-half\">\n <button class=\"button button-secondary\" type=\"button\" (click)=\"onMakeInactive()\" *ngIf=\"selectedFlag.flagDetailDisplay.flagDetail.status === 'Active'\">\n {{'Make inactive' | rpxTranslate}}\n </button>\n </div>\n </div>\n </div>\n </div>\n</ng-container>\n\n<div class=\"govuk-button-group\">\n <button id=\"updateFlagNextButton\" class=\"govuk-button\" type=\"button\" (click)=\"onNext()\">\n {{'Next' | rpxTranslate}}\n </button>\n</div>\n" }]
24998
- }], () => [{ type: i1.RpxTranslationService }], { formGroup: [{
25527
+ args: [{ selector: 'ccd-update-flag', template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"200\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <h1 class=\"govuk-label-wrapper govuk-!-margin-bottom-4\">\n <label class=\"govuk-label govuk-label--m\">\n {{updateFlagTitle | rpxTranslate}}\n </label>\n </h1>\n <div id=\"update-flag-hint-external\" class=\"govuk-hint\" *ngIf=\"externalUserUpdate\">\n {{selectedFlag?.flagDetailDisplay?.flagDetail | updateFlagTitleDisplay}}\n </div>\n\n <div class=\"govuk-!-margin-bottom-4\">\n <label class=\"govuk-label govuk-label--s\" [for]=\"caseFlagFormFields.COMMENTS\">\n {{\n externalUserUpdate\n ? (updateFlagStepEnum.COMMENT_FIELD_LABEL_EXTERNAL | rpxTranslate)\n : (updateFlagTitle | rpxTranslate) + (' comments' | rpxTranslate)\n }}\n </label>\n <div id=\"update-flag-comments-hint-external\" class=\"govuk-hint\" *ngIf=\"externalUserUpdate\">\n {{updateFlagStepEnum.COMMENT_HINT_TEXT_EXTERNAL | rpxTranslate}}\n </div>\n <ng-container *ngIf=\"internalUserUpdate || internalUser2Point1EnabledUpdate || displayContextParameter === '';\n else externalUser\">\n <div id=\"update-flag-comments-hint\" class=\"govuk-hint\">\n {{\n internalUserUpdate\n ? (updateFlagStepEnum.COMMENT_HINT_TEXT_INTERNAL | rpxTranslate)\n : (updateFlagStepEnum.COMMENT_HINT_TEXT_INTERNAL_2_POINT_1 | rpxTranslate)\n }}\n </div>\n <div class=\"govuk-warning-text\" *ngIf=\"internalUser2Point1EnabledUpdate && externallyVisibleFlag\">\n <span class=\"govuk-warning-text__icon\" aria-hidden=\"true\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-warning-text__assistive\">{{'Warning' | rpxTranslate}}</span>\n {{updateFlagStepEnum.WARNING_TEXT | rpxTranslate}}\n </strong>\n </div>\n <div id=\"update-flag-comments-not-entered-error-message\" class=\"govuk-error-message\" *ngIf=\"commentsNotEnteredErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{commentsNotEnteredErrorMessage | rpxTranslate}}\n </div>\n <div id=\"update-flag-comments-char-limit-error\" class=\"govuk-error-message\" *ngIf=\"commentsCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{commentsCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea class=\"govuk-textarea\"\n [id]=\"caseFlagFormFields.COMMENTS\"\n [name]=\"caseFlagFormFields.COMMENTS\"\n [formControlName]=\"caseFlagFormFields.COMMENTS\"\n rows=\"5\"\n aria-describedby=\"update-flag-comments-hint update-flag-comments-char-limit-info update-flag-comments-char-limit-error\">\n </textarea>\n <div id=\"update-flag-comments-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{updateFlagStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </ng-container>\n <ng-template #externalUser>\n <ng-container *ngIf=\"externalUserUpdate\">\n <ng-container *ngTemplateOutlet=\"updateFlagStatusReason\"></ng-container>\n </ng-container>\n </ng-template>\n </div>\n\n <ng-template #updateFlagStatusReason>\n <div id=\"update-flag-status-reason-not-entered-error-message\" class=\"govuk-error-message\" *ngIf=\"statusReasonNotEnteredErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{statusReasonNotEnteredErrorMessage | rpxTranslate}}\n </div>\n <div id=\"update-flag-status-reason-char-limit-error\" class=\"govuk-error-message\" *ngIf=\"statusReasonCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{statusReasonCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea class=\"govuk-textarea\"\n [id]=\"caseFlagFormFields.STATUS_CHANGE_REASON\"\n [name]=\"caseFlagFormFields.STATUS_CHANGE_REASON\"\n [formControlName]=\"caseFlagFormFields.STATUS_CHANGE_REASON\"\n rows=\"5\"\n aria-describedby=\"update-flag-comments-hint-external update-flag-status-hint update-flag-status-reason-char-limit-info\n update-flag-status-reason-char-limit-error\">\n </textarea>\n <div id=\"update-flag-status-reason-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{updateFlagStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </ng-template>\n\n <div id=\"flag-status-container-v2_1\" class=\"govuk-!-margin-bottom-4\" *ngIf=\"internalUser2Point1EnabledUpdate\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"update-flag-status-heading\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--s\">\n <h1 id=\"update-flag-status-heading\" class=\"govuk-fieldset__heading\">\n {{updateFlagTitle | rpxTranslate}} {{'status' | rpxTranslate}}\n </h1>\n </legend>\n <div class=\"govuk-radios govuk-radios--conditional govuk-!-margin-bottom-4\" data-module=\"govuk-radios\" [id]=\"caseFlagFormFields.STATUS\">\n <div class=\"govuk-radios__item\" *ngFor=\"let status of validStatusProgressions\">\n <input class=\"govuk-radios__input\" type=\"radio\"\n [id]=\"caseFlagFormFields.STATUS + '_' + status\"\n [name]=\"caseFlagFormFields.STATUS\"\n [formControlName]=\"caseFlagFormFields.STATUS\"\n [value]=\"status\">\n <label class=\"govuk-label govuk-radios__label\" [for]=\"caseFlagFormFields.STATUS + '_' + status\">\n {{caseFlagStatusEnum[status] | rpxTranslate}}\n </label>\n </div>\n </div>\n </fieldset>\n\n <div id=\"update-flag-status-hint\" class=\"govuk-hint\">\n {{updateFlagStepEnum.STATUS_HINT_TEXT | rpxTranslate}}\n </div>\n <ng-container *ngTemplateOutlet=\"updateFlagStatusReason\"></ng-container>\n </div>\n\n <div id=\"translation-checkbox-container\" class=\"govuk-!-margin-bottom-6\" *ngIf=\"internalUser2Point1EnabledUpdate\">\n <div class=\"govuk-checkboxes\" data-module=\"govuk-checkboxes\">\n <div class=\"govuk-checkboxes__item\">\n <input class=\"govuk-checkboxes__input\" type=\"checkbox\"\n [formControlName]=\"caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED\"\n [id]=\"caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED\"\n [name]=\"caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED\">\n <label class=\"govuk-label govuk-checkboxes__label\"\n [for]=\"caseFlagFormFields.IS_WELSH_TRANSLATION_NEEDED\">\n {{'I need to add a translation' | rpxTranslate}}\n </label>\n </div>\n </div>\n </div>\n\n <div id=\"flag-status-container-v1\" class=\"govuk-grid-row\" *ngIf=\"internalUserUpdate\">\n <div class=\"govuk-grid-column-one-half\">\n <p>{{'Flag status:' | rpxTranslate}}\n <span>\n <strong class=\"govuk-tag\" [ngClass]=\"{'govuk-tag--grey': selectedFlag.flagDetailDisplay.flagDetail.status === 'Inactive'}\">\n {{selectedFlag?.flagDetailDisplay?.flagDetail?.status | rpxTranslate}}\n </strong>\n </span>\n </p>\n </div>\n <div class=\"govuk-grid-column-one-half\">\n <button class=\"button button-secondary\" type=\"button\" (click)=\"onMakeInactive()\" *ngIf=\"selectedFlag.flagDetailDisplay.flagDetail.status === 'Active'\">\n {{'Make inactive' | rpxTranslate}}\n </button>\n </div>\n </div>\n </div>\n </div>\n</ng-container>" }]
25528
+ }], () => [{ type: i1.RpxTranslationService }, { type: MultipageComponentStateService }], { formGroup: [{
24999
25529
  type: Input
25000
25530
  }], displayContextParameter: [{
25001
25531
  type: Input
25002
25532
  }], caseFlagStateEmitter: [{
25003
25533
  type: Output
25004
25534
  }] }); })();
25005
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UpdateFlagComponent, { className: "UpdateFlagComponent", filePath: "lib/shared/components/palette/case-flag/components/update-flag/update-flag.component.ts", lineNumber: 20 }); })();
25535
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UpdateFlagComponent, { className: "UpdateFlagComponent", filePath: "lib/shared/components/palette/case-flag/components/update-flag/update-flag.component.ts", lineNumber: 22 }); })();
25006
25536
 
25007
25537
  const _c0$m = a0 => ({ "form-group-error": a0 });
25008
25538
  function UpdateFlagAddTranslationFormComponent_div_14_Template(rf, ctx) { if (rf & 1) {
25009
- i0.ɵɵelementStart(0, "div", 19)(1, "span", 20);
25539
+ i0.ɵɵelementStart(0, "div", 17)(1, "span", 18);
25010
25540
  i0.ɵɵtext(2);
25011
25541
  i0.ɵɵpipe(3, "rpxTranslate");
25012
25542
  i0.ɵɵelementEnd();
@@ -25021,7 +25551,7 @@ function UpdateFlagAddTranslationFormComponent_div_14_Template(rf, ctx) { if (rf
25021
25551
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.otherFlagDescriptionCharLimitErrorMessage), " ");
25022
25552
  } }
25023
25553
  function UpdateFlagAddTranslationFormComponent_div_24_Template(rf, ctx) { if (rf & 1) {
25024
- i0.ɵɵelementStart(0, "div", 21)(1, "span", 20);
25554
+ i0.ɵɵelementStart(0, "div", 19)(1, "span", 18);
25025
25555
  i0.ɵɵtext(2);
25026
25556
  i0.ɵɵpipe(3, "rpxTranslate");
25027
25557
  i0.ɵɵelementEnd();
@@ -25036,7 +25566,7 @@ function UpdateFlagAddTranslationFormComponent_div_24_Template(rf, ctx) { if (rf
25036
25566
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.otherFlagDescriptionWelshCharLimitErrorMessage), " ");
25037
25567
  } }
25038
25568
  function UpdateFlagAddTranslationFormComponent_div_34_Template(rf, ctx) { if (rf & 1) {
25039
- i0.ɵɵelementStart(0, "div", 22)(1, "span", 20);
25569
+ i0.ɵɵelementStart(0, "div", 20)(1, "span", 18);
25040
25570
  i0.ɵɵtext(2);
25041
25571
  i0.ɵɵpipe(3, "rpxTranslate");
25042
25572
  i0.ɵɵelementEnd();
@@ -25051,7 +25581,7 @@ function UpdateFlagAddTranslationFormComponent_div_34_Template(rf, ctx) { if (rf
25051
25581
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.flagCommentsCharLimitErrorMessage), " ");
25052
25582
  } }
25053
25583
  function UpdateFlagAddTranslationFormComponent_div_44_Template(rf, ctx) { if (rf & 1) {
25054
- i0.ɵɵelementStart(0, "div", 23)(1, "span", 20);
25584
+ i0.ɵɵelementStart(0, "div", 21)(1, "span", 18);
25055
25585
  i0.ɵɵtext(2);
25056
25586
  i0.ɵɵpipe(3, "rpxTranslate");
25057
25587
  i0.ɵɵelementEnd();
@@ -25065,7 +25595,7 @@ function UpdateFlagAddTranslationFormComponent_div_44_Template(rf, ctx) { if (rf
25065
25595
  i0.ɵɵadvance(2);
25066
25596
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r0.flagCommentsWelshCharLimitErrorMessage), " ");
25067
25597
  } }
25068
- class UpdateFlagAddTranslationFormComponent {
25598
+ class UpdateFlagAddTranslationFormComponent extends AbstractJourneyComponent {
25069
25599
  formGroup;
25070
25600
  caseFlagStateEmitter = new EventEmitter();
25071
25601
  selectedFlag;
@@ -25139,8 +25669,14 @@ class UpdateFlagAddTranslationFormComponent {
25139
25669
  });
25140
25670
  }
25141
25671
  }
25142
- static ɵfac = function UpdateFlagAddTranslationFormComponent_Factory(t) { return new (t || UpdateFlagAddTranslationFormComponent)(); };
25143
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UpdateFlagAddTranslationFormComponent, selectors: [["ccd-update-flag-add-translation-form"]], inputs: { formGroup: "formGroup" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, decls: 54, vars: 57, consts: [[3, "formGroup"], ["data-module", "govuk-character-count", "data-maxlength", "200", 1, "govuk-character-count"], [1, "govuk-form-group", 3, "ngClass"], [1, "govuk-label-wrapper", "govuk-!-margin-bottom-6"], [1, "govuk-label", "govuk-label--m"], ["id", "add-translation-form-hint", 1, "govuk-hint"], [1, "govuk-!-margin-bottom-4"], [1, "govuk-label", "govuk-label--s", 3, "for"], ["id", "add-translation-other-flag-description-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["rows", "5", 1, "govuk-textarea", 3, "id", "name", "formControlName"], ["id", "add-translation-other-flag-description-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], ["id", "add-translation-other-flag-description-welsh-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "add-translation-other-flag-description-welsh-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], ["id", "add-translation-flag-comments-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "add-translation-flag-comments-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], ["id", "add-translation-flag-comments-welsh-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "add-translation-flag-comments-welsh-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], [1, "govuk-button-group"], ["id", "updateFlagNextButton", "type", "button", 1, "govuk-button", 3, "click"], ["id", "add-translation-other-flag-description-char-limit-error", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "add-translation-other-flag-description-welsh-char-limit-error", 1, "govuk-error-message"], ["id", "add-translation-flag-comments-char-limit-error", 1, "govuk-error-message"], ["id", "add-translation-flag-comments-welsh-char-limit-error", 1, "govuk-error-message"]], template: function UpdateFlagAddTranslationFormComponent_Template(rf, ctx) { if (rf & 1) {
25672
+ next() {
25673
+ this.onNext();
25674
+ if (this.errorMessages.length === 0) {
25675
+ super.next();
25676
+ }
25677
+ }
25678
+ static ɵfac = /*@__PURE__*/ (() => { let ɵUpdateFlagAddTranslationFormComponent_BaseFactory; return function UpdateFlagAddTranslationFormComponent_Factory(t) { return (ɵUpdateFlagAddTranslationFormComponent_BaseFactory || (ɵUpdateFlagAddTranslationFormComponent_BaseFactory = i0.ɵɵgetInheritedFactory(UpdateFlagAddTranslationFormComponent)))(t || UpdateFlagAddTranslationFormComponent); }; })();
25679
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UpdateFlagAddTranslationFormComponent, selectors: [["ccd-update-flag-add-translation-form"]], inputs: { formGroup: "formGroup" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 50, vars: 54, consts: [[3, "formGroup"], ["data-module", "govuk-character-count", "data-maxlength", "200", 1, "govuk-character-count"], [1, "govuk-form-group", 3, "ngClass"], [1, "govuk-label-wrapper", "govuk-!-margin-bottom-6"], [1, "govuk-label", "govuk-label--m"], ["id", "add-translation-form-hint", 1, "govuk-hint"], [1, "govuk-!-margin-bottom-4"], [1, "govuk-label", "govuk-label--s", 3, "for"], ["id", "add-translation-other-flag-description-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["rows", "5", 1, "govuk-textarea", 3, "id", "name", "formControlName"], ["id", "add-translation-other-flag-description-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], ["id", "add-translation-other-flag-description-welsh-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "add-translation-other-flag-description-welsh-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], ["id", "add-translation-flag-comments-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "add-translation-flag-comments-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], ["id", "add-translation-flag-comments-welsh-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "add-translation-flag-comments-welsh-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], ["id", "add-translation-other-flag-description-char-limit-error", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "add-translation-other-flag-description-welsh-char-limit-error", 1, "govuk-error-message"], ["id", "add-translation-flag-comments-char-limit-error", 1, "govuk-error-message"], ["id", "add-translation-flag-comments-welsh-char-limit-error", 1, "govuk-error-message"]], template: function UpdateFlagAddTranslationFormComponent_Template(rf, ctx) { if (rf & 1) {
25144
25680
  i0.ɵɵelementContainerStart(0, 0);
25145
25681
  i0.ɵɵelementStart(1, "div", 1)(2, "div", 2)(3, "h1", 3)(4, "label", 4);
25146
25682
  i0.ɵɵtext(5);
@@ -25199,78 +25735,71 @@ class UpdateFlagAddTranslationFormComponent {
25199
25735
  i0.ɵɵpipe(49, "rpxTranslate");
25200
25736
  i0.ɵɵelementEnd()()()();
25201
25737
  i0.ɵɵelementContainerEnd();
25202
- i0.ɵɵelementStart(50, "div", 17)(51, "button", 18);
25203
- i0.ɵɵlistener("click", function UpdateFlagAddTranslationFormComponent_Template_button_click_51_listener() { return ctx.onNext(); });
25204
- i0.ɵɵtext(52);
25205
- i0.ɵɵpipe(53, "rpxTranslate");
25206
- i0.ɵɵelementEnd()();
25207
25738
  } if (rf & 2) {
25208
25739
  i0.ɵɵproperty("formGroup", ctx.formGroup);
25209
25740
  i0.ɵɵadvance(2);
25210
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(55, _c0$m, ctx.errorMessages.length > 0));
25741
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(52, _c0$m, ctx.errorMessages.length > 0));
25211
25742
  i0.ɵɵadvance(3);
25212
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 33, ctx.updateFlagAddTranslationTitle), " ");
25743
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 32, ctx.updateFlagAddTranslationTitle), " ");
25213
25744
  i0.ɵɵadvance(3);
25214
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(9, 35, ctx.updateFlagAddTranslationStepEnum.HINT_TEXT), " ");
25745
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(9, 34, ctx.updateFlagAddTranslationStepEnum.HINT_TEXT), " ");
25215
25746
  i0.ɵɵadvance(3);
25216
25747
  i0.ɵɵproperty("for", ctx.caseFlagFormFields.OTHER_FLAG_DESCRIPTION);
25217
25748
  i0.ɵɵadvance();
25218
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(13, 37, "Other description"));
25749
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(13, 36, "Other description"));
25219
25750
  i0.ɵɵadvance(2);
25220
25751
  i0.ɵɵproperty("ngIf", ctx.otherFlagDescriptionCharLimitErrorMessage);
25221
25752
  i0.ɵɵadvance();
25222
25753
  i0.ɵɵproperty("id", ctx.caseFlagFormFields.OTHER_FLAG_DESCRIPTION)("name", ctx.caseFlagFormFields.OTHER_FLAG_DESCRIPTION)("formControlName", ctx.caseFlagFormFields.OTHER_FLAG_DESCRIPTION);
25223
25754
  i0.ɵɵadvance(3);
25224
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(19, 39, ctx.updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO), " ");
25755
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(19, 38, ctx.updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO), " ");
25225
25756
  i0.ɵɵadvance(3);
25226
25757
  i0.ɵɵproperty("for", ctx.caseFlagFormFields.OTHER_FLAG_DESCRIPTION_WELSH);
25227
25758
  i0.ɵɵadvance();
25228
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(23, 41, "Other description (Welsh)"));
25759
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(23, 40, "Other description (Welsh)"));
25229
25760
  i0.ɵɵadvance(2);
25230
25761
  i0.ɵɵproperty("ngIf", ctx.otherFlagDescriptionWelshCharLimitErrorMessage);
25231
25762
  i0.ɵɵadvance();
25232
25763
  i0.ɵɵproperty("id", ctx.caseFlagFormFields.OTHER_FLAG_DESCRIPTION_WELSH)("name", ctx.caseFlagFormFields.OTHER_FLAG_DESCRIPTION_WELSH)("formControlName", ctx.caseFlagFormFields.OTHER_FLAG_DESCRIPTION_WELSH);
25233
25764
  i0.ɵɵadvance(3);
25234
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(29, 43, ctx.updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO), " ");
25765
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(29, 42, ctx.updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO), " ");
25235
25766
  i0.ɵɵadvance(3);
25236
25767
  i0.ɵɵproperty("for", ctx.caseFlagFormFields.COMMENTS);
25237
25768
  i0.ɵɵadvance();
25238
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(33, 45, "Flag comments"));
25769
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(33, 44, "Flag comments"));
25239
25770
  i0.ɵɵadvance(2);
25240
25771
  i0.ɵɵproperty("ngIf", ctx.flagCommentsCharLimitErrorMessage);
25241
25772
  i0.ɵɵadvance();
25242
25773
  i0.ɵɵproperty("id", ctx.caseFlagFormFields.COMMENTS)("name", ctx.caseFlagFormFields.COMMENTS)("formControlName", ctx.caseFlagFormFields.COMMENTS);
25243
25774
  i0.ɵɵadvance(3);
25244
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(39, 47, ctx.updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO), " ");
25775
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(39, 46, ctx.updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO), " ");
25245
25776
  i0.ɵɵadvance(3);
25246
25777
  i0.ɵɵproperty("for", ctx.caseFlagFormFields.COMMENTS_WELSH);
25247
25778
  i0.ɵɵadvance();
25248
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(43, 49, "Flag comments (Welsh)"));
25779
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(43, 48, "Flag comments (Welsh)"));
25249
25780
  i0.ɵɵadvance(2);
25250
25781
  i0.ɵɵproperty("ngIf", ctx.flagCommentsWelshCharLimitErrorMessage);
25251
25782
  i0.ɵɵadvance();
25252
25783
  i0.ɵɵproperty("id", ctx.caseFlagFormFields.COMMENTS_WELSH)("name", ctx.caseFlagFormFields.COMMENTS_WELSH)("formControlName", ctx.caseFlagFormFields.COMMENTS_WELSH);
25253
25784
  i0.ɵɵadvance(3);
25254
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(49, 51, ctx.updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO), " ");
25255
- i0.ɵɵadvance(4);
25256
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(53, 53, "Next"), " ");
25785
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(49, 50, ctx.updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO), " ");
25257
25786
  } }, dependencies: [i5.NgClass, i5.NgIf, i4.DefaultValueAccessor, i4.NgControlStatus, i4.NgControlStatusGroup, i4.FormGroupDirective, i4.FormControlName, i1.RpxTranslatePipe], encapsulation: 2 });
25258
25787
  }
25259
25788
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UpdateFlagAddTranslationFormComponent, [{
25260
25789
  type: Component,
25261
- args: [{ selector: 'ccd-update-flag-add-translation-form', template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"200\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <h1 class=\"govuk-label-wrapper govuk-!-margin-bottom-6\">\n <label class=\"govuk-label govuk-label--m\">\n {{ updateFlagAddTranslationTitle | rpxTranslate}}\n </label>\n </h1>\n <div id=\"add-translation-form-hint\" class=\"govuk-hint\">\n {{ updateFlagAddTranslationStepEnum.HINT_TEXT | rpxTranslate}}\n </div>\n\n <div class=\"govuk-!-margin-bottom-4\">\n <label [for]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION\" class=\"govuk-label govuk-label--s\">{{'Other description' | rpxTranslate}}</label>\n <div id=\"add-translation-other-flag-description-char-limit-error\" class=\"govuk-error-message\"\n *ngIf=\"otherFlagDescriptionCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{otherFlagDescriptionCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea\n class=\"govuk-textarea\" rows=\"5\"\n [id]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION\"\n [name]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION\"\n [formControlName]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION\">\n </textarea>\n <div id=\"add-translation-other-flag-description-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </div>\n\n <div class=\"govuk-!-margin-bottom-4\">\n <label [for]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION_WELSH\" class=\"govuk-label govuk-label--s\">{{'Other description (Welsh)' | rpxTranslate}}</label>\n <div id=\"add-translation-other-flag-description-welsh-char-limit-error\" class=\"govuk-error-message\"\n *ngIf=\"otherFlagDescriptionWelshCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{otherFlagDescriptionWelshCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea\n class=\"govuk-textarea\" rows=\"5\"\n [id]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION_WELSH\"\n [name]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION_WELSH\"\n [formControlName]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION_WELSH\">\n </textarea>\n <div id=\"add-translation-other-flag-description-welsh-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </div>\n\n <div class=\"govuk-!-margin-bottom-4\">\n <label [for]=\"caseFlagFormFields.COMMENTS\" class=\"govuk-label govuk-label--s\">{{'Flag comments' | rpxTranslate}}</label>\n <div id=\"add-translation-flag-comments-char-limit-error\" class=\"govuk-error-message\"\n *ngIf=\"flagCommentsCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagCommentsCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea\n class=\"govuk-textarea\" rows=\"5\"\n [id]=\"caseFlagFormFields.COMMENTS\"\n [name]=\"caseFlagFormFields.COMMENTS\"\n [formControlName]=\"caseFlagFormFields.COMMENTS\">\n </textarea>\n <div id=\"add-translation-flag-comments-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </div>\n\n <div class=\"govuk-!-margin-bottom-4\">\n <label [for]=\"caseFlagFormFields.COMMENTS_WELSH\" class=\"govuk-label govuk-label--s\">{{'Flag comments (Welsh)' | rpxTranslate}}</label>\n <div id=\"add-translation-flag-comments-welsh-char-limit-error\" class=\"govuk-error-message\"\n *ngIf=\"flagCommentsWelshCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagCommentsWelshCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea\n class=\"govuk-textarea\" rows=\"5\"\n [id]=\"caseFlagFormFields.COMMENTS_WELSH\"\n [name]=\"caseFlagFormFields.COMMENTS_WELSH\"\n [formControlName]=\"caseFlagFormFields.COMMENTS_WELSH\">\n </textarea>\n <div id=\"add-translation-flag-comments-welsh-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </div>\n </div>\n </div>\n</ng-container>\n\n<div class=\"govuk-button-group\">\n <button id=\"updateFlagNextButton\" class=\"govuk-button\" type=\"button\" (click)=\"onNext()\">\n {{'Next' | rpxTranslate}}\n </button>\n</div>\n" }]
25790
+ args: [{ selector: 'ccd-update-flag-add-translation-form', template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"200\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <h1 class=\"govuk-label-wrapper govuk-!-margin-bottom-6\">\n <label class=\"govuk-label govuk-label--m\">\n {{ updateFlagAddTranslationTitle | rpxTranslate}}\n </label>\n </h1>\n <div id=\"add-translation-form-hint\" class=\"govuk-hint\">\n {{ updateFlagAddTranslationStepEnum.HINT_TEXT | rpxTranslate}}\n </div>\n\n <div class=\"govuk-!-margin-bottom-4\">\n <label [for]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION\" class=\"govuk-label govuk-label--s\">{{'Other description' | rpxTranslate}}</label>\n <div id=\"add-translation-other-flag-description-char-limit-error\" class=\"govuk-error-message\"\n *ngIf=\"otherFlagDescriptionCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{otherFlagDescriptionCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea\n class=\"govuk-textarea\" rows=\"5\"\n [id]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION\"\n [name]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION\"\n [formControlName]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION\">\n </textarea>\n <div id=\"add-translation-other-flag-description-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </div>\n\n <div class=\"govuk-!-margin-bottom-4\">\n <label [for]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION_WELSH\" class=\"govuk-label govuk-label--s\">{{'Other description (Welsh)' | rpxTranslate}}</label>\n <div id=\"add-translation-other-flag-description-welsh-char-limit-error\" class=\"govuk-error-message\"\n *ngIf=\"otherFlagDescriptionWelshCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{otherFlagDescriptionWelshCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea\n class=\"govuk-textarea\" rows=\"5\"\n [id]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION_WELSH\"\n [name]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION_WELSH\"\n [formControlName]=\"caseFlagFormFields.OTHER_FLAG_DESCRIPTION_WELSH\">\n </textarea>\n <div id=\"add-translation-other-flag-description-welsh-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </div>\n\n <div class=\"govuk-!-margin-bottom-4\">\n <label [for]=\"caseFlagFormFields.COMMENTS\" class=\"govuk-label govuk-label--s\">{{'Flag comments' | rpxTranslate}}</label>\n <div id=\"add-translation-flag-comments-char-limit-error\" class=\"govuk-error-message\"\n *ngIf=\"flagCommentsCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagCommentsCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea\n class=\"govuk-textarea\" rows=\"5\"\n [id]=\"caseFlagFormFields.COMMENTS\"\n [name]=\"caseFlagFormFields.COMMENTS\"\n [formControlName]=\"caseFlagFormFields.COMMENTS\">\n </textarea>\n <div id=\"add-translation-flag-comments-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </div>\n\n <div class=\"govuk-!-margin-bottom-4\">\n <label [for]=\"caseFlagFormFields.COMMENTS_WELSH\" class=\"govuk-label govuk-label--s\">{{'Flag comments (Welsh)' | rpxTranslate}}</label>\n <div id=\"add-translation-flag-comments-welsh-char-limit-error\" class=\"govuk-error-message\"\n *ngIf=\"flagCommentsWelshCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{flagCommentsWelshCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea\n class=\"govuk-textarea\" rows=\"5\"\n [id]=\"caseFlagFormFields.COMMENTS_WELSH\"\n [name]=\"caseFlagFormFields.COMMENTS_WELSH\"\n [formControlName]=\"caseFlagFormFields.COMMENTS_WELSH\">\n </textarea>\n <div id=\"add-translation-flag-comments-welsh-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{updateFlagAddTranslationStepEnum.CHARACTER_LIMIT_INFO | rpxTranslate}}\n </div>\n </div>\n </div>\n </div>\n</ng-container>" }]
25262
25791
  }], null, { formGroup: [{
25263
25792
  type: Input
25264
25793
  }], caseFlagStateEmitter: [{
25265
25794
  type: Output
25266
25795
  }] }); })();
25267
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UpdateFlagAddTranslationFormComponent, { className: "UpdateFlagAddTranslationFormComponent", filePath: "lib/shared/components/palette/case-flag/components/update-flag/update-flag-add-translation-form/update-flag-add-translation-form.component.ts", lineNumber: 17 }); })();
25796
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UpdateFlagAddTranslationFormComponent, { className: "UpdateFlagAddTranslationFormComponent", filePath: "lib/shared/components/palette/case-flag/components/update-flag/update-flag-add-translation-form/update-flag-add-translation-form.component.ts", lineNumber: 18 }); })();
25268
25797
 
25269
25798
  const _c0$l = a0 => ({ "form-group-error": a0 });
25270
25799
  function ConfirmFlagStatusComponent_div_9_Template(rf, ctx) { if (rf & 1) {
25271
- i0.ɵɵelementStart(0, "div", 15);
25272
- i0.ɵɵelement(1, "input", 16);
25273
- i0.ɵɵelementStart(2, "label", 17);
25800
+ i0.ɵɵelementStart(0, "div", 13);
25801
+ i0.ɵɵelement(1, "input", 14);
25802
+ i0.ɵɵelementStart(2, "label", 15);
25274
25803
  i0.ɵɵtext(3);
25275
25804
  i0.ɵɵpipe(4, "rpxTranslate");
25276
25805
  i0.ɵɵelementEnd()();
@@ -25287,7 +25816,7 @@ function ConfirmFlagStatusComponent_div_9_Template(rf, ctx) { if (rf & 1) {
25287
25816
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(4, 8, ctx_r2.caseFlagStatusEnum[status_r1]), " ");
25288
25817
  } }
25289
25818
  function ConfirmFlagStatusComponent_div_13_Template(rf, ctx) { if (rf & 1) {
25290
- i0.ɵɵelementStart(0, "div", 18)(1, "span", 19);
25819
+ i0.ɵɵelementStart(0, "div", 16)(1, "span", 17);
25291
25820
  i0.ɵɵtext(2);
25292
25821
  i0.ɵɵpipe(3, "rpxTranslate");
25293
25822
  i0.ɵɵelementEnd();
@@ -25302,7 +25831,7 @@ function ConfirmFlagStatusComponent_div_13_Template(rf, ctx) { if (rf & 1) {
25302
25831
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r2.statusReasonNotEnteredErrorMessage), " ");
25303
25832
  } }
25304
25833
  function ConfirmFlagStatusComponent_div_14_Template(rf, ctx) { if (rf & 1) {
25305
- i0.ɵɵelementStart(0, "div", 20)(1, "span", 19);
25834
+ i0.ɵɵelementStart(0, "div", 18)(1, "span", 17);
25306
25835
  i0.ɵɵtext(2);
25307
25836
  i0.ɵɵpipe(3, "rpxTranslate");
25308
25837
  i0.ɵɵelementEnd();
@@ -25316,7 +25845,7 @@ function ConfirmFlagStatusComponent_div_14_Template(rf, ctx) { if (rf & 1) {
25316
25845
  i0.ɵɵadvance(2);
25317
25846
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 4, ctx_r2.statusReasonCharLimitErrorMessage), " ");
25318
25847
  } }
25319
- class ConfirmFlagStatusComponent {
25848
+ class ConfirmFlagStatusComponent extends AbstractJourneyComponent {
25320
25849
  formGroup;
25321
25850
  defaultStatus;
25322
25851
  caseFlagStateEmitter = new EventEmitter();
@@ -25345,6 +25874,12 @@ class ConfirmFlagStatusComponent {
25345
25874
  // Return case flag field state and error messages to the parent
25346
25875
  this.caseFlagStateEmitter.emit({ currentCaseFlagFieldState: CaseFlagFieldState.FLAG_STATUS, errorMessages: this.errorMessages });
25347
25876
  }
25877
+ next() {
25878
+ this.onNext();
25879
+ if (this.errorMessages.length === 0) {
25880
+ super.next();
25881
+ }
25882
+ }
25348
25883
  validateTextEntry() {
25349
25884
  this.statusReasonNotEnteredErrorMessage = null;
25350
25885
  this.statusReasonCharLimitErrorMessage = null;
@@ -25368,8 +25903,8 @@ class ConfirmFlagStatusComponent {
25368
25903
  });
25369
25904
  }
25370
25905
  }
25371
- static ɵfac = function ConfirmFlagStatusComponent_Factory(t) { return new (t || ConfirmFlagStatusComponent)(); };
25372
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ConfirmFlagStatusComponent, selectors: [["ccd-confirm-flag-status"]], inputs: { formGroup: "formGroup", defaultStatus: "defaultStatus" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, decls: 23, vars: 22, consts: [[3, "formGroup"], ["data-module", "govuk-character-count", "data-maxlength", "200", 1, "govuk-character-count"], [1, "govuk-form-group", 3, "ngClass"], ["aria-describedby", "confirm-flag-status-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--m"], ["id", "confirm-flag-status-heading", 1, "govuk-fieldset__heading"], ["data-module", "govuk-radios", "id", "conditional-radios-list", 1, "govuk-radios", "govuk-radios--conditional", "govuk-!-margin-bottom-4"], ["class", "govuk-radios__item", 4, "ngFor", "ngForOf"], ["id", "status-reason-hint", 1, "govuk-hint"], ["id", "status-reason-not-entered-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "status-reason-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["rows", "5", "aria-describedby", "status-reason-hint status-reason-char-limit-info", 1, "govuk-textarea", 3, "id", "name", "formControlName"], ["id", "status-reason-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], [1, "govuk-button-group"], ["type", "button", 1, "button", "button-primary", 3, "click"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "id", "name", "value", "formControlName"], [1, "govuk-label", "govuk-radios__label", 3, "for"], ["id", "status-reason-not-entered-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "status-reason-char-limit-error", 1, "govuk-error-message"]], template: function ConfirmFlagStatusComponent_Template(rf, ctx) { if (rf & 1) {
25906
+ static ɵfac = /*@__PURE__*/ (() => { let ɵConfirmFlagStatusComponent_BaseFactory; return function ConfirmFlagStatusComponent_Factory(t) { return (ɵConfirmFlagStatusComponent_BaseFactory || (ɵConfirmFlagStatusComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ConfirmFlagStatusComponent)))(t || ConfirmFlagStatusComponent); }; })();
25907
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ConfirmFlagStatusComponent, selectors: [["ccd-confirm-flag-status"]], inputs: { formGroup: "formGroup", defaultStatus: "defaultStatus" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 19, vars: 19, consts: [[3, "formGroup"], ["data-module", "govuk-character-count", "data-maxlength", "200", 1, "govuk-character-count"], [1, "govuk-form-group", 3, "ngClass"], ["aria-describedby", "confirm-flag-status-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--m"], ["id", "confirm-flag-status-heading", 1, "govuk-fieldset__heading"], ["data-module", "govuk-radios", "id", "conditional-radios-list", 1, "govuk-radios", "govuk-radios--conditional", "govuk-!-margin-bottom-4"], ["class", "govuk-radios__item", 4, "ngFor", "ngForOf"], ["id", "status-reason-hint", 1, "govuk-hint"], ["id", "status-reason-not-entered-error-message", "class", "govuk-error-message", 4, "ngIf"], ["id", "status-reason-char-limit-error", "class", "govuk-error-message", 4, "ngIf"], ["rows", "5", "aria-describedby", "status-reason-hint status-reason-char-limit-info", 1, "govuk-textarea", 3, "id", "name", "formControlName"], ["id", "status-reason-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], [1, "govuk-radios__item"], ["type", "radio", 1, "govuk-radios__input", 3, "id", "name", "value", "formControlName"], [1, "govuk-label", "govuk-radios__label", 3, "for"], ["id", "status-reason-not-entered-error-message", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "status-reason-char-limit-error", 1, "govuk-error-message"]], template: function ConfirmFlagStatusComponent_Template(rf, ctx) { if (rf & 1) {
25373
25908
  i0.ɵɵelementContainerStart(0, 0);
25374
25909
  i0.ɵɵelementStart(1, "div", 1)(2, "div", 2)(3, "fieldset", 3)(4, "legend", 4)(5, "h1", 5);
25375
25910
  i0.ɵɵtext(6);
@@ -25389,21 +25924,16 @@ class ConfirmFlagStatusComponent {
25389
25924
  i0.ɵɵpipe(18, "rpxTranslate");
25390
25925
  i0.ɵɵelementEnd()()();
25391
25926
  i0.ɵɵelementContainerEnd();
25392
- i0.ɵɵelementStart(19, "div", 13)(20, "button", 14);
25393
- i0.ɵɵlistener("click", function ConfirmFlagStatusComponent_Template_button_click_20_listener() { return ctx.onNext(); });
25394
- i0.ɵɵtext(21);
25395
- i0.ɵɵpipe(22, "rpxTranslate");
25396
- i0.ɵɵelementEnd()();
25397
25927
  } if (rf & 2) {
25398
25928
  i0.ɵɵproperty("formGroup", ctx.formGroup);
25399
25929
  i0.ɵɵadvance(2);
25400
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(20, _c0$l, ctx.errorMessages.length > 0));
25930
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(17, _c0$l, ctx.errorMessages.length > 0));
25401
25931
  i0.ɵɵadvance(4);
25402
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(7, 12, ctx.confirmFlagStatusTitle), " ");
25932
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(7, 11, ctx.confirmFlagStatusTitle), " ");
25403
25933
  i0.ɵɵadvance(3);
25404
25934
  i0.ɵɵproperty("ngForOf", ctx.flagCreationStatuses);
25405
25935
  i0.ɵɵadvance(2);
25406
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(12, 14, ctx.statusReasonHint), " ");
25936
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(12, 13, ctx.statusReasonHint), " ");
25407
25937
  i0.ɵɵadvance(2);
25408
25938
  i0.ɵɵproperty("ngIf", ctx.statusReasonNotEnteredErrorMessage);
25409
25939
  i0.ɵɵadvance();
@@ -25411,14 +25941,12 @@ class ConfirmFlagStatusComponent {
25411
25941
  i0.ɵɵadvance();
25412
25942
  i0.ɵɵproperty("id", ctx.statusReasonControlName)("name", ctx.statusReasonControlName)("formControlName", ctx.statusReasonControlName);
25413
25943
  i0.ɵɵadvance(2);
25414
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(18, 16, ctx.statusReasonCharLimitInfo), " ");
25415
- i0.ɵɵadvance(4);
25416
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(22, 18, "Next"));
25944
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(18, 15, ctx.statusReasonCharLimitInfo), " ");
25417
25945
  } }, dependencies: [i5.NgClass, i5.NgForOf, i5.NgIf, i4.DefaultValueAccessor, i4.RadioControlValueAccessor, i4.NgControlStatus, i4.NgControlStatusGroup, i4.FormGroupDirective, i4.FormControlName, i1.RpxTranslatePipe], encapsulation: 2 });
25418
25946
  }
25419
25947
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ConfirmFlagStatusComponent, [{
25420
25948
  type: Component,
25421
- args: [{ selector: 'ccd-confirm-flag-status', template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"200\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"confirm-flag-status-heading\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n <h1 id=\"confirm-flag-status-heading\" class=\"govuk-fieldset__heading\">\n {{confirmFlagStatusTitle | rpxTranslate}}\n </h1>\n </legend>\n <div class=\"govuk-radios govuk-radios--conditional govuk-!-margin-bottom-4\" data-module=\"govuk-radios\" id=\"conditional-radios-list\">\n <div class=\"govuk-radios__item\" *ngFor=\"let status of flagCreationStatuses; index as i\">\n <input class=\"govuk-radios__input\" id=\"flag-status-{{i}}\" [name]=\"selectedStatusControlName\"\n type=\"radio\" [value]=\"status\" [formControlName]=\"selectedStatusControlName\"/>\n <label class=\"govuk-label govuk-radios__label\" for=\"flag-status-{{i}}\">\n {{caseFlagStatusEnum[status] | rpxTranslate}}\n </label>\n </div>\n </div>\n </fieldset>\n <div id=\"status-reason-hint\" class=\"govuk-hint\">\n {{statusReasonHint | rpxTranslate}}\n </div>\n <div id=\"status-reason-not-entered-error-message\" class=\"govuk-error-message\"\n *ngIf=\"statusReasonNotEnteredErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{statusReasonNotEnteredErrorMessage | rpxTranslate}}\n </div>\n <div id=\"status-reason-char-limit-error\" class=\"govuk-error-message\"\n *ngIf=\"statusReasonCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{statusReasonCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea class=\"govuk-textarea\" [id]=\"statusReasonControlName\"\n [name]=\"statusReasonControlName\" [formControlName]=\"statusReasonControlName\" rows=\"5\"\n aria-describedby=\"status-reason-hint status-reason-char-limit-info\"></textarea>\n <div id=\"status-reason-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{statusReasonCharLimitInfo | rpxTranslate}}\n </div>\n </div>\n </div>\n</ng-container>\n\n<div class=\"govuk-button-group\">\n <button class=\"button button-primary\" type=\"button\" (click)=\"onNext()\">{{'Next' | rpxTranslate}}</button>\n</div>\n" }]
25949
+ args: [{ selector: 'ccd-confirm-flag-status', template: "<ng-container [formGroup]=\"formGroup\">\n <div class=\"govuk-character-count\" data-module=\"govuk-character-count\" data-maxlength=\"200\">\n <div class=\"govuk-form-group\" [ngClass]=\"{'form-group-error': errorMessages.length > 0}\">\n <fieldset class=\"govuk-fieldset\" aria-describedby=\"confirm-flag-status-heading\">\n <legend class=\"govuk-fieldset__legend govuk-fieldset__legend--m\">\n <h1 id=\"confirm-flag-status-heading\" class=\"govuk-fieldset__heading\">\n {{confirmFlagStatusTitle | rpxTranslate}}\n </h1>\n </legend>\n <div class=\"govuk-radios govuk-radios--conditional govuk-!-margin-bottom-4\" data-module=\"govuk-radios\" id=\"conditional-radios-list\">\n <div class=\"govuk-radios__item\" *ngFor=\"let status of flagCreationStatuses; index as i\">\n <input class=\"govuk-radios__input\" id=\"flag-status-{{i}}\" [name]=\"selectedStatusControlName\"\n type=\"radio\" [value]=\"status\" [formControlName]=\"selectedStatusControlName\"/>\n <label class=\"govuk-label govuk-radios__label\" for=\"flag-status-{{i}}\">\n {{caseFlagStatusEnum[status] | rpxTranslate}}\n </label>\n </div>\n </div>\n </fieldset>\n <div id=\"status-reason-hint\" class=\"govuk-hint\">\n {{statusReasonHint | rpxTranslate}}\n </div>\n <div id=\"status-reason-not-entered-error-message\" class=\"govuk-error-message\"\n *ngIf=\"statusReasonNotEnteredErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{statusReasonNotEnteredErrorMessage | rpxTranslate}}\n </div>\n <div id=\"status-reason-char-limit-error\" class=\"govuk-error-message\"\n *ngIf=\"statusReasonCharLimitErrorMessage\">\n <span class=\"govuk-visually-hidden\">{{'Error:' | rpxTranslate}}</span> {{statusReasonCharLimitErrorMessage | rpxTranslate}}\n </div>\n <textarea class=\"govuk-textarea\" [id]=\"statusReasonControlName\"\n [name]=\"statusReasonControlName\" [formControlName]=\"statusReasonControlName\" rows=\"5\"\n aria-describedby=\"status-reason-hint status-reason-char-limit-info\"></textarea>\n <div id=\"status-reason-char-limit-info\" class=\"govuk-hint govuk-character-count__message\" aria-live=\"polite\">\n {{statusReasonCharLimitInfo | rpxTranslate}}\n </div>\n </div>\n </div>\n</ng-container>" }]
25422
25950
  }], null, { formGroup: [{
25423
25951
  type: Input
25424
25952
  }], defaultStatus: [{
@@ -25426,7 +25954,7 @@ class ConfirmFlagStatusComponent {
25426
25954
  }], caseFlagStateEmitter: [{
25427
25955
  type: Output
25428
25956
  }] }); })();
25429
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ConfirmFlagStatusComponent, { className: "ConfirmFlagStatusComponent", filePath: "lib/shared/components/palette/case-flag/components/confirm-flag-status/confirm-flag-status.component.ts", lineNumber: 17 }); })();
25957
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ConfirmFlagStatusComponent, { className: "ConfirmFlagStatusComponent", filePath: "lib/shared/components/palette/case-flag/components/confirm-flag-status/confirm-flag-status.component.ts", lineNumber: 18 }); })();
25430
25958
 
25431
25959
  class FlagFieldDisplayPipe extends AsyncPipe {
25432
25960
  translationService;
@@ -27242,7 +27770,7 @@ class CcdPageFieldsPipe {
27242
27770
  const control = dataFormGroup.controls['data'].get(key);
27243
27771
  return control['caseField'];
27244
27772
  }).filter(field => {
27245
- return !!page.case_fields.find(pcf => pcf.id === field.id);
27773
+ return field && !!page.case_fields.find(pcf => pcf.id === field.id);
27246
27774
  }).sort((a, b) => a.order - b.order);
27247
27775
  const rawValue = dataFormGroup.value;
27248
27776
  const value = page.case_fields.reduce((acc, field) => {
@@ -28774,19 +29302,6 @@ function CaseEditSubmitComponent_ccd_case_event_completion_13_Template(rf, ctx)
28774
29302
  const ctx_r1 = i0.ɵɵnextContext();
28775
29303
  i0.ɵɵproperty("eventCompletionParams", ctx_r1.caseEdit.eventCompletionParams);
28776
29304
  } }
28777
- function CaseEditSubmitComponent_button_15_Template(rf, ctx) { if (rf & 1) {
28778
- const _r8 = i0.ɵɵgetCurrentView();
28779
- i0.ɵɵelementStart(0, "button", 50);
28780
- i0.ɵɵlistener("click", function CaseEditSubmitComponent_button_15_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r8); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.previous()); });
28781
- i0.ɵɵtext(1);
28782
- i0.ɵɵpipe(2, "rpxTranslate");
28783
- i0.ɵɵelementEnd();
28784
- } if (rf & 2) {
28785
- const ctx_r1 = i0.ɵɵnextContext();
28786
- i0.ɵɵproperty("disabled", !ctx_r1.hasPrevious() || ctx_r1.caseEdit.isSubmitting);
28787
- i0.ɵɵadvance();
28788
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 2, "Previous"), " ");
28789
- } }
28790
29305
  // @dynamic
28791
29306
  class CaseEditSubmitComponent {
28792
29307
  caseEdit;
@@ -28795,7 +29310,10 @@ class CaseEditSubmitComponent {
28795
29310
  route;
28796
29311
  orderService;
28797
29312
  profileNotifier;
29313
+ multipageComponentStateService;
28798
29314
  formValidatorsService;
29315
+ caseFlagStateService;
29316
+ linkedCasesService;
28799
29317
  eventTrigger;
28800
29318
  editForm;
28801
29319
  triggerText;
@@ -28831,14 +29349,17 @@ class CaseEditSubmitComponent {
28831
29349
  // not been disabled.
28832
29350
  return this.caseEdit.isSubmitting || this.hasErrors;
28833
29351
  }
28834
- constructor(caseEdit, fieldsUtils, caseFieldService, route, orderService, profileNotifier, formValidatorsService) {
29352
+ constructor(caseEdit, fieldsUtils, caseFieldService, route, orderService, profileNotifier, multipageComponentStateService, formValidatorsService, caseFlagStateService, linkedCasesService) {
28835
29353
  this.caseEdit = caseEdit;
28836
29354
  this.fieldsUtils = fieldsUtils;
28837
29355
  this.caseFieldService = caseFieldService;
28838
29356
  this.route = route;
28839
29357
  this.orderService = orderService;
28840
29358
  this.profileNotifier = profileNotifier;
29359
+ this.multipageComponentStateService = multipageComponentStateService;
28841
29360
  this.formValidatorsService = formValidatorsService;
29361
+ this.caseFlagStateService = caseFlagStateService;
29362
+ this.linkedCasesService = linkedCasesService;
28842
29363
  }
28843
29364
  ngOnInit() {
28844
29365
  this.profileSubscription = this.profileNotifier.profile.subscribe((_) => this.profile = _);
@@ -28859,6 +29380,7 @@ class CaseEditSubmitComponent {
28859
29380
  this.caseEdit.isLinkedCasesSubmission =
28860
29381
  this.eventTrigger.case_fields.some(caseField => FieldsUtils.isCaseFieldOfType(caseField, ['ComponentLauncher']));
28861
29382
  this.pageTitle = this.getPageTitle();
29383
+ console.log(this.multipageComponentStateService.getInstigator());
28862
29384
  this.summary = this.formValidatorsService.addMarkDownValidators(this.editForm, 'event.summary');
28863
29385
  this.description = this.formValidatorsService.addMarkDownValidators(this.editForm, 'event.description');
28864
29386
  }
@@ -28919,6 +29441,9 @@ class CaseEditSubmitComponent {
28919
29441
  return cloneField;
28920
29442
  }
28921
29443
  cancel() {
29444
+ if (this.caseEdit.isLinkedCasesSubmission) {
29445
+ this.linkedCasesService.resetLinkedCaseData();
29446
+ }
28922
29447
  if (this.eventTrigger.can_save_draft) {
28923
29448
  if (this.route.snapshot.queryParamMap.get(CaseEditComponent.ORIGIN_QUERY_PARAM) === 'viewDraft') {
28924
29449
  this.caseEdit.cancelled.emit({ status: CaseEditPageComponent.RESUMED_FORM_DISCARD });
@@ -28983,6 +29508,13 @@ class CaseEditSubmitComponent {
28983
29508
  return lastPage;
28984
29509
  }
28985
29510
  previous() {
29511
+ if (this.caseEdit.isCaseFlagSubmission) {
29512
+ // if we are in the caseflag journey we need to store the last page index so that the previous button on CYA will take to correct page
29513
+ this.caseFlagStateService.fieldStateToNavigate = this.caseFlagStateService.lastPageFieldState;
29514
+ }
29515
+ if (this.caseEdit.isLinkedCasesSubmission) {
29516
+ this.linkedCasesService.cameFromFinalStep = true;
29517
+ }
28986
29518
  /* istanbul ignore else */
28987
29519
  if (this.hasPrevious()) {
28988
29520
  this.navigateToPage(this.getLastPageShown().id);
@@ -29023,8 +29555,8 @@ class CaseEditSubmitComponent {
29023
29555
  }
29024
29556
  return 'Cancel';
29025
29557
  }
29026
- static ɵfac = function CaseEditSubmitComponent_Factory(t) { return new (t || CaseEditSubmitComponent)(i0.ɵɵdirectiveInject(CaseEditComponent), i0.ɵɵdirectiveInject(FieldsUtils), i0.ɵɵdirectiveInject(CaseFieldService), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(ProfileNotifier), i0.ɵɵdirectiveInject(FormValidatorsService)); };
29027
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditSubmitComponent, selectors: [["ccd-case-edit-submit"]], decls: 23, vars: 21, consts: [["titleBlock", ""], ["idBlock", ""], [1, "govuk-heading-l"], [4, "ngIf", "ngIfThen", "ngIfElse"], [3, "error"], [3, "callbackErrorsContext", "callbackErrorsSubject"], [1, "check-your-answers", 3, "submit", "formGroup"], [4, "ngIf"], [3, "eventCompletionParams", "eventCanBeCompleted", 4, "ngIf"], [1, "form-group", "form-group-related"], ["class", "button button-secondary", "type", "button", 3, "disabled", "click", 4, "ngIf"], ["type", "submit", 1, "button", 3, "disabled"], [1, "cancel"], ["href", "javascript:void(0)", 3, "click"], [3, "content"], ["class", "heading-h2", 4, "ngIf"], [1, "heading-h2"], ["class", "text-16", 4, "ngIf"], ["aria-describedby", "check your answers table", 1, "form-table"], [4, "ngFor", "ngForOf"], [1, "text-16"], ["ccdLabelSubstitutor", "", 3, "caseField", "hidden", "formGroup", "contextFields"], ["class", "valign-top case-field-label", 4, "ngIf"], [1, "form-cell", "case-field-content"], [3, "formGroup", "topLevelFormGroup", "caseField", "context", "caseFields"], [1, "valign-top", "case-field-label"], [1, "valign-top", "check-your-answers__change", "case-field-change"], ["href", "javascript:void(0)", 3, "click", 4, "ngIf"], ["aria-describedby", "summary fields table", 1, "summary-fields"], [3, "ngSwitch"], ["ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields", 4, "ngSwitchCase"], ["class", "compound-field", "ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields", 4, "ngSwitchCase"], ["ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields"], ["id", "summary-field-label"], [1, "form-cell"], [3, "formGroup", "caseField"], ["ccdLabelSubstitutor", "", 1, "compound-field", 3, "caseField", "formGroup", "contextFields"], ["colspan", "2"], [3, "formGroup", "caseField", "caseFields"], ["id", "fieldset-event", "formGroupName", "event"], [2, "display", "none"], [1, "form-group", 3, "ngClass"], ["for", "field-trigger-summary", 1, "form-label"], [1, "form-hint"], ["class", "error-message", 4, "ngIf"], ["type", "text", "id", "field-trigger-summary", "formControlName", "summary", "maxlength", "1024", 1, "form-control", "bottom-30", "width-50", 3, "ngClass"], ["for", "field-trigger-description", 1, "form-label"], ["id", "field-trigger-description", "formControlName", "description", "maxlength", "65536", 1, "form-control", "bottom-30", "width-50", 3, "ngClass"], [1, "error-message"], [3, "eventCanBeCompleted", "eventCompletionParams"], ["type", "button", 1, "button", "button-secondary", 3, "click", "disabled"]], template: function CaseEditSubmitComponent_Template(rf, ctx) { if (rf & 1) {
29558
+ static ɵfac = function CaseEditSubmitComponent_Factory(t) { return new (t || CaseEditSubmitComponent)(i0.ɵɵdirectiveInject(CaseEditComponent), i0.ɵɵdirectiveInject(FieldsUtils), i0.ɵɵdirectiveInject(CaseFieldService), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(ProfileNotifier), i0.ɵɵdirectiveInject(MultipageComponentStateService), i0.ɵɵdirectiveInject(FormValidatorsService), i0.ɵɵdirectiveInject(CaseFlagStateService), i0.ɵɵdirectiveInject(LinkedCasesService)); };
29559
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditSubmitComponent, selectors: [["ccd-case-edit-submit"]], decls: 25, vars: 24, consts: [["titleBlock", ""], ["idBlock", ""], [1, "govuk-heading-l"], [4, "ngIf", "ngIfThen", "ngIfElse"], [3, "error"], [3, "callbackErrorsContext", "callbackErrorsSubject"], [1, "check-your-answers", 3, "submit", "formGroup"], [4, "ngIf"], [3, "eventCompletionParams", "eventCanBeCompleted", 4, "ngIf"], [1, "form-group", "form-group-related"], ["type", "button", 1, "button", "button-secondary", 3, "click", "disabled"], ["type", "submit", 1, "button", 3, "disabled"], [1, "cancel"], ["href", "javascript:void(0)", 3, "click"], [3, "content"], ["class", "heading-h2", 4, "ngIf"], [1, "heading-h2"], ["class", "text-16", 4, "ngIf"], ["aria-describedby", "check your answers table", 1, "form-table"], [4, "ngFor", "ngForOf"], [1, "text-16"], ["ccdLabelSubstitutor", "", 3, "caseField", "hidden", "formGroup", "contextFields"], ["class", "valign-top case-field-label", 4, "ngIf"], [1, "form-cell", "case-field-content"], [3, "formGroup", "topLevelFormGroup", "caseField", "context", "caseFields"], [1, "valign-top", "case-field-label"], [1, "valign-top", "check-your-answers__change", "case-field-change"], ["href", "javascript:void(0)", 3, "click", 4, "ngIf"], ["aria-describedby", "summary fields table", 1, "summary-fields"], [3, "ngSwitch"], ["ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields", 4, "ngSwitchCase"], ["class", "compound-field", "ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields", 4, "ngSwitchCase"], ["ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields"], ["id", "summary-field-label"], [1, "form-cell"], [3, "formGroup", "caseField"], ["ccdLabelSubstitutor", "", 1, "compound-field", 3, "caseField", "formGroup", "contextFields"], ["colspan", "2"], [3, "formGroup", "caseField", "caseFields"], ["id", "fieldset-event", "formGroupName", "event"], [2, "display", "none"], [1, "form-group", 3, "ngClass"], ["for", "field-trigger-summary", 1, "form-label"], [1, "form-hint"], ["class", "error-message", 4, "ngIf"], ["type", "text", "id", "field-trigger-summary", "formControlName", "summary", "maxlength", "1024", 1, "form-control", "bottom-30", "width-50", 3, "ngClass"], ["for", "field-trigger-description", 1, "form-label"], ["id", "field-trigger-description", "formControlName", "description", "maxlength", "65536", 1, "form-control", "bottom-30", "width-50", 3, "ngClass"], [1, "error-message"], [3, "eventCanBeCompleted", "eventCompletionParams"]], template: function CaseEditSubmitComponent_Template(rf, ctx) { if (rf & 1) {
29028
29560
  const _r1 = i0.ɵɵgetCurrentView();
29029
29561
  i0.ɵɵelementStart(0, "div")(1, "h1", 2);
29030
29562
  i0.ɵɵtext(2);
@@ -29038,24 +29570,27 @@ class CaseEditSubmitComponent {
29038
29570
  i0.ɵɵelementStart(11, "form", 6);
29039
29571
  i0.ɵɵlistener("submit", function CaseEditSubmitComponent_Template_form_submit_11_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.submit()); });
29040
29572
  i0.ɵɵtemplate(12, CaseEditSubmitComponent_div_12_Template, 4, 3, "div", 7)(13, CaseEditSubmitComponent_ccd_case_event_completion_13_Template, 1, 1, "ccd-case-event-completion", 8);
29041
- i0.ɵɵelementStart(14, "div", 9);
29042
- i0.ɵɵtemplate(15, CaseEditSubmitComponent_button_15_Template, 3, 4, "button", 10);
29043
- i0.ɵɵelementStart(16, "button", 11);
29044
- i0.ɵɵtext(17);
29045
- i0.ɵɵpipe(18, "rpxTranslate");
29573
+ i0.ɵɵelementStart(14, "div", 9)(15, "button", 10);
29574
+ i0.ɵɵlistener("click", function CaseEditSubmitComponent_Template_button_click_15_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.previous()); });
29575
+ i0.ɵɵtext(16);
29576
+ i0.ɵɵpipe(17, "rpxTranslate");
29577
+ i0.ɵɵelementEnd();
29578
+ i0.ɵɵelementStart(18, "button", 11);
29579
+ i0.ɵɵtext(19);
29580
+ i0.ɵɵpipe(20, "rpxTranslate");
29046
29581
  i0.ɵɵelementEnd()();
29047
- i0.ɵɵelementStart(19, "p", 12)(20, "a", 13);
29048
- i0.ɵɵlistener("click", function CaseEditSubmitComponent_Template_a_click_20_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.cancel()); });
29049
- i0.ɵɵtext(21);
29050
- i0.ɵɵpipe(22, "rpxTranslate");
29582
+ i0.ɵɵelementStart(21, "p", 12)(22, "a", 13);
29583
+ i0.ɵɵlistener("click", function CaseEditSubmitComponent_Template_a_click_22_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.cancel()); });
29584
+ i0.ɵɵtext(23);
29585
+ i0.ɵɵpipe(24, "rpxTranslate");
29051
29586
  i0.ɵɵelementEnd()()()();
29052
29587
  } if (rf & 2) {
29053
- const titleBlock_r9 = i0.ɵɵreference(6);
29054
- const idBlock_r10 = i0.ɵɵreference(8);
29588
+ const titleBlock_r8 = i0.ɵɵreference(6);
29589
+ const idBlock_r9 = i0.ɵɵreference(8);
29055
29590
  i0.ɵɵadvance(2);
29056
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 15, ctx.eventTrigger.name));
29591
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 16, ctx.eventTrigger.name));
29057
29592
  i0.ɵɵadvance(2);
29058
- i0.ɵɵproperty("ngIf", ctx.getCaseTitle())("ngIfThen", titleBlock_r9)("ngIfElse", idBlock_r10);
29593
+ i0.ɵɵproperty("ngIf", ctx.getCaseTitle())("ngIfThen", titleBlock_r8)("ngIfElse", idBlock_r9);
29059
29594
  i0.ɵɵadvance(5);
29060
29595
  i0.ɵɵproperty("error", ctx.caseEdit.error);
29061
29596
  i0.ɵɵadvance();
@@ -29067,22 +29602,24 @@ class CaseEditSubmitComponent {
29067
29602
  i0.ɵɵadvance();
29068
29603
  i0.ɵɵproperty("ngIf", ctx.caseEdit.isEventCompletionChecksRequired);
29069
29604
  i0.ɵɵadvance(2);
29070
- i0.ɵɵproperty("ngIf", !ctx.caseEdit.isCaseFlagSubmission);
29605
+ i0.ɵɵproperty("disabled", !ctx.hasPrevious() || ctx.caseEdit.isSubmitting);
29071
29606
  i0.ɵɵadvance();
29607
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(17, 18, "Previous"), " ");
29608
+ i0.ɵɵadvance(2);
29072
29609
  i0.ɵɵproperty("disabled", ctx.isDisabled);
29073
29610
  i0.ɵɵadvance();
29074
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(18, 17, ctx.triggerText), " ");
29611
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(20, 20, ctx.triggerText), " ");
29075
29612
  i0.ɵɵadvance(3);
29076
29613
  i0.ɵɵclassProp("disabled", ctx.caseEdit.isSubmitting);
29077
29614
  i0.ɵɵadvance();
29078
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(22, 19, ctx.getCancelText()));
29615
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(24, 22, ctx.getCancelText()));
29079
29616
  } }, styles: ["#fieldset-case-data[_ngcontent-%COMP%]{margin-bottom:30px}#fieldset-case-data[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{width:1%;white-space:nowrap;vertical-align:top}.compound-field[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:0}#confirmation-header[_ngcontent-%COMP%]{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body[_ngcontent-%COMP%]{width:630px;background-color:#fff}.valign-top[_ngcontent-%COMP%]{vertical-align:top}.summary-fields[_ngcontent-%COMP%]{margin-bottom:30px}.summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:0px}a.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:default}.case-field-label[_ngcontent-%COMP%]{width:45%}.case-field-content[_ngcontent-%COMP%]{width:50%}.no-bottom-border[_ngcontent-%COMP%]{border-bottom:none}.case-field-change[_ngcontent-%COMP%]{width:5%}"] });
29080
29617
  }
29081
29618
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditSubmitComponent, [{
29082
29619
  type: Component,
29083
- args: [{ selector: 'ccd-case-edit-submit', template: "<div>\n <!-- Event trigger name -->\n <h1 class=\"govuk-heading-l\">{{eventTrigger.name | rpxTranslate}}</h1>\n\n <!--Case ID or Title -->\n <div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n <ng-template #titleBlock>\n <ccd-markdown [content]=\"getCaseTitle() | ccdCaseTitle: contextFields : editForm.controls['data']\"></ccd-markdown>\n </ng-template>\n <ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n </ng-template>\n\n <ccd-case-edit-generic-errors [error]=\"caseEdit.error\"></ccd-case-edit-generic-errors>\n\n <ccd-callback-errors [callbackErrorsSubject]=\"caseEdit.callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\"></ccd-callback-errors>\n\n <form class=\"check-your-answers\" [formGroup]=\"editForm\" (submit)=\"submit()\">\n <div *ngIf=\"!caseEdit.isEventCompletionChecksRequired\">\n <ng-container *ngIf=\"checkYourAnswerFieldsToDisplayExists()\">\n <h2 class=\"heading-h2\">{{pageTitle | rpxTranslate }}</h2>\n <span class=\"text-16\" *ngIf=\"!caseEdit.isCaseFlagSubmission\">{{'Check the information below carefully.' | rpxTranslate}}</span>\n\n <table class=\"form-table\" aria-describedby=\"check your answers table\">\n <tbody>\n <ng-container *ngFor=\"let page of wizard.pages\">\n <ng-container *ngIf=\"isShown(page)\">\n <ng-container *ngFor=\"let field of page\n | ccdPageFields: editForm\n | ccdReadFieldsFilter: false :undefined :true :allFieldsValues\n | ccdCYAPageLabelFilter\">\n <ng-container *ngIf=\"canShowFieldInCYA(field)\">\n <tr ccdLabelSubstitutor [caseField]=\"field\" [hidden]=\"field.hidden\"\n [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <th *ngIf=\"!isLabel(field) && !caseEdit.isCaseFlagSubmission\" class=\"valign-top case-field-label\">\n <span class=\"text-16\">{{field.label | rpxTranslate}}</span>\n </th>\n <td class=\"form-cell case-field-content\" [attr.colspan]=\"isLabel(field) ? '2' : '1'\">\n <ccd-field-read\n [formGroup]=\"editForm.controls['data']\" [topLevelFormGroup]=\"editForm.controls['data']\"\n [caseField]=\"summaryCaseField(field)\" [context]=\"paletteContext\" [caseFields]=\"contextFields\"></ccd-field-read>\n </td>\n <ng-container *ngIf=\"!caseEdit.isCaseFlagSubmission\">\n <td class=\"valign-top check-your-answers__change case-field-change\">\n <a *ngIf=\"isChangeAllowed(field)\" (click)=\"navigateToPage(page.id)\"\n href=\"javascript:void(0)\">\n <span class=\"text-16\" attr.aria-label=\"{{'Change' | rpxTranslate}} {{ field.label | rpxTranslate }}\">\n {{'Change' | rpxTranslate}}\n </span>\n </a>\n </td>\n </ng-container>\n </tr>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n </tbody>\n </table>\n </ng-container>\n <ng-container *ngIf=\"readOnlySummaryFieldsToDisplayExists()\">\n\n <table class=\"summary-fields\" aria-describedby=\"summary fields table\">\n <tbody>\n <ng-container *ngFor=\"let field of showSummaryFields\">\n <ng-container [ngSwitch]=\"!(field | ccdIsCompound)\">\n <tr *ngSwitchCase=\"true\" ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <th id=\"summary-field-label\">{{field.label}}</th>\n <td class=\"form-cell\">\n <ccd-field-read [formGroup]=\"editForm.controls['data']\" [caseField]=\"summaryCaseField(field)\"></ccd-field-read>\n </td>\n </tr>\n <tr *ngSwitchCase=\"false\" class=\"compound-field\" ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <td colspan=\"2\">\n <ccd-field-read [formGroup]=\"editForm.controls['data']\" [caseField]=\"summaryCaseField(field)\" [caseFields]=\"contextFields\"></ccd-field-read>\n </td>\n </tr>\n </ng-container>\n </ng-container>\n </tbody>\n </table>\n </ng-container>\n <ng-container *ngIf=\"showEventNotes()\">\n <fieldset id=\"fieldset-event\" formGroupName=\"event\">\n <legend style=\"display: none;\"></legend>\n <div class=\"form-group\" [ngClass]=\"{'form-group-error': !!summary && !summary.valid && (summary.dirty || summary.touched)}\">\n <label for=\"field-trigger-summary\" class=\"form-label\">\n Event summary (optional)\n <span class=\"form-hint\">A few words describing the purpose of the event.</span>\n </label>\n <span class=\"error-message\" *ngIf=\"summary?.errors && (summary.dirty || summary.touched)\">\n {{summary.errors | ccdFirstError: eventSummaryLabel | rpxTranslate}}\n </span>\n <input type=\"text\" id=\"field-trigger-summary\" class=\"form-control bottom-30 width-50\"\n [ngClass]=\"{'govuk-input--error': summary?.errors && (summary.dirty || summary.touched)}\" formControlName=\"summary\" maxlength=\"1024\">\n </div>\n <div class=\"form-group\" [ngClass]=\"{'form-group-error': !!description && !description.valid && (description.dirty || description.touched)}\">\n <label for=\"field-trigger-description\" class=\"form-label\">Event description (optional)</label>\n <span class=\"error-message\" *ngIf=\"description?.errors && (description.dirty || description.touched)\">\n {{description.errors | ccdFirstError: eventDescriptionLabel | rpxTranslate}}\n </span>\n <textarea id=\"field-trigger-description\" class=\"form-control bottom-30 width-50\" formControlName=\"description\"\n [ngClass]=\"{'govuk-input--error': description?.errors && (description.dirty || description.touched)}\" maxlength=\"65536\"></textarea>\n </div>\n </fieldset>\n </ng-container>\n </div>\n <ccd-case-event-completion *ngIf=\"caseEdit.isEventCompletionChecksRequired\"\n [eventCompletionParams]=\"caseEdit.eventCompletionParams\"\n (eventCanBeCompleted)=\"onEventCanBeCompleted($event)\">\n </ccd-case-event-completion>\n <div class=\"form-group form-group-related\">\n <button *ngIf=\"!caseEdit.isCaseFlagSubmission\" class=\"button button-secondary\" type=\"button\" [disabled]=\"!hasPrevious() || caseEdit.isSubmitting\" (click)=\"previous()\">\n {{'Previous' | rpxTranslate}}\n </button>\n <button type=\"submit\" [disabled]=\"isDisabled\" class=\"button\">\n {{triggerText | rpxTranslate}}\n </button>\n </div>\n <p class=\"cancel\">\n <a (click)=\"cancel()\" href=\"javascript:void(0)\" [class.disabled]=\"caseEdit.isSubmitting\">{{getCancelText() | rpxTranslate}}</a>\n </p>\n </form>\n</div>\n\n", styles: ["#fieldset-case-data{margin-bottom:30px}#fieldset-case-data th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}#confirmation-header{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body{width:630px;background-color:#fff}.valign-top{vertical-align:top}.summary-fields{margin-bottom:30px}.summary-fields tbody tr th,.summary-fields tbody tr td{border-bottom:0px}a.disabled{pointer-events:none;cursor:default}.case-field-label{width:45%}.case-field-content{width:50%}.no-bottom-border{border-bottom:none}.case-field-change{width:5%}\n"] }]
29084
- }], () => [{ type: CaseEditComponent }, { type: FieldsUtils }, { type: CaseFieldService }, { type: i1$1.ActivatedRoute }, { type: OrderService }, { type: ProfileNotifier }, { type: FormValidatorsService }], null); })();
29085
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditSubmitComponent, { className: "CaseEditSubmitComponent", filePath: "lib/shared/components/case-editor/case-edit-submit/case-edit-submit.component.ts", lineNumber: 27 }); })();
29620
+ args: [{ selector: 'ccd-case-edit-submit', template: "<div>\n <!-- Event trigger name -->\n <h1 class=\"govuk-heading-l\">{{eventTrigger.name | rpxTranslate}}</h1>\n\n <!--Case ID or Title -->\n <div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n <ng-template #titleBlock>\n <ccd-markdown [content]=\"getCaseTitle() | ccdCaseTitle: contextFields : editForm.controls['data']\"></ccd-markdown>\n </ng-template>\n <ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n </ng-template>\n\n <ccd-case-edit-generic-errors [error]=\"caseEdit.error\"></ccd-case-edit-generic-errors>\n\n <ccd-callback-errors [callbackErrorsSubject]=\"caseEdit.callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\"></ccd-callback-errors>\n\n <form class=\"check-your-answers\" [formGroup]=\"editForm\" (submit)=\"submit()\">\n <div *ngIf=\"!caseEdit.isEventCompletionChecksRequired\">\n <ng-container *ngIf=\"checkYourAnswerFieldsToDisplayExists()\">\n <h2 class=\"heading-h2\">{{pageTitle | rpxTranslate }}</h2>\n <span class=\"text-16\" *ngIf=\"!caseEdit.isCaseFlagSubmission\">{{'Check the information below carefully.' | rpxTranslate}}</span>\n\n <table class=\"form-table\" aria-describedby=\"check your answers table\">\n <tbody>\n <ng-container *ngFor=\"let page of wizard.pages\">\n <ng-container *ngIf=\"isShown(page)\">\n <ng-container *ngFor=\"let field of page\n | ccdPageFields: editForm\n | ccdReadFieldsFilter: false :undefined :true :allFieldsValues\n | ccdCYAPageLabelFilter\">\n <ng-container *ngIf=\"canShowFieldInCYA(field)\">\n <tr ccdLabelSubstitutor [caseField]=\"field\" [hidden]=\"field.hidden\"\n [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <th *ngIf=\"!isLabel(field) && !caseEdit.isCaseFlagSubmission\" class=\"valign-top case-field-label\">\n <span class=\"text-16\">{{field.label | rpxTranslate}}</span>\n </th>\n <td class=\"form-cell case-field-content\" [attr.colspan]=\"isLabel(field) ? '2' : '1'\">\n <ccd-field-read\n [formGroup]=\"editForm.controls['data']\" [topLevelFormGroup]=\"editForm.controls['data']\"\n [caseField]=\"summaryCaseField(field)\" [context]=\"paletteContext\" [caseFields]=\"contextFields\"></ccd-field-read>\n </td>\n <ng-container *ngIf=\"!caseEdit.isCaseFlagSubmission\">\n <td class=\"valign-top check-your-answers__change case-field-change\">\n <a *ngIf=\"isChangeAllowed(field)\" (click)=\"navigateToPage(page.id)\"\n href=\"javascript:void(0)\">\n <span class=\"text-16\" attr.aria-label=\"{{'Change' | rpxTranslate}} {{ field.label | rpxTranslate }}\">\n {{'Change' | rpxTranslate}}\n </span>\n </a>\n </td>\n </ng-container>\n </tr>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n </tbody>\n </table>\n </ng-container>\n <ng-container *ngIf=\"readOnlySummaryFieldsToDisplayExists()\">\n\n <table class=\"summary-fields\" aria-describedby=\"summary fields table\">\n <tbody>\n <ng-container *ngFor=\"let field of showSummaryFields\">\n <ng-container [ngSwitch]=\"!(field | ccdIsCompound)\">\n <tr *ngSwitchCase=\"true\" ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <th id=\"summary-field-label\">{{field.label}}</th>\n <td class=\"form-cell\">\n <ccd-field-read [formGroup]=\"editForm.controls['data']\" [caseField]=\"summaryCaseField(field)\"></ccd-field-read>\n </td>\n </tr>\n <tr *ngSwitchCase=\"false\" class=\"compound-field\" ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <td colspan=\"2\">\n <ccd-field-read [formGroup]=\"editForm.controls['data']\" [caseField]=\"summaryCaseField(field)\" [caseFields]=\"contextFields\"></ccd-field-read>\n </td>\n </tr>\n </ng-container>\n </ng-container>\n </tbody>\n </table>\n </ng-container>\n <ng-container *ngIf=\"showEventNotes()\">\n <fieldset id=\"fieldset-event\" formGroupName=\"event\">\n <legend style=\"display: none;\"></legend>\n <div class=\"form-group\" [ngClass]=\"{'form-group-error': !!summary && !summary.valid && (summary.dirty || summary.touched)}\">\n <label for=\"field-trigger-summary\" class=\"form-label\">\n Event summary (optional)\n <span class=\"form-hint\">A few words describing the purpose of the event.</span>\n </label>\n <span class=\"error-message\" *ngIf=\"summary?.errors && (summary.dirty || summary.touched)\">\n {{summary.errors | ccdFirstError: eventSummaryLabel | rpxTranslate}}\n </span>\n <input type=\"text\" id=\"field-trigger-summary\" class=\"form-control bottom-30 width-50\"\n [ngClass]=\"{'govuk-input--error': summary?.errors && (summary.dirty || summary.touched)}\" formControlName=\"summary\" maxlength=\"1024\">\n </div>\n <div class=\"form-group\" [ngClass]=\"{'form-group-error': !!description && !description.valid && (description.dirty || description.touched)}\">\n <label for=\"field-trigger-description\" class=\"form-label\">Event description (optional)</label>\n <span class=\"error-message\" *ngIf=\"description?.errors && (description.dirty || description.touched)\">\n {{description.errors | ccdFirstError: eventDescriptionLabel | rpxTranslate}}\n </span>\n <textarea id=\"field-trigger-description\" class=\"form-control bottom-30 width-50\" formControlName=\"description\"\n [ngClass]=\"{'govuk-input--error': description?.errors && (description.dirty || description.touched)}\" maxlength=\"65536\"></textarea>\n </div>\n </fieldset>\n </ng-container>\n </div>\n <ccd-case-event-completion *ngIf=\"caseEdit.isEventCompletionChecksRequired\"\n [eventCompletionParams]=\"caseEdit.eventCompletionParams\"\n (eventCanBeCompleted)=\"onEventCanBeCompleted($event)\">\n </ccd-case-event-completion>\n <div class=\"form-group form-group-related\">\n <button class=\"button button-secondary\" type=\"button\" [disabled]=\"!hasPrevious() || caseEdit.isSubmitting\" (click)=\"previous()\">\n {{'Previous' | rpxTranslate}}\n </button>\n <button type=\"submit\" [disabled]=\"isDisabled\" class=\"button\">\n {{triggerText | rpxTranslate}}\n </button>\n </div>\n <p class=\"cancel\">\n <a (click)=\"cancel()\" href=\"javascript:void(0)\" [class.disabled]=\"caseEdit.isSubmitting\">{{getCancelText() | rpxTranslate}}</a>\n </p>\n </form>\n</div>\n\n", styles: ["#fieldset-case-data{margin-bottom:30px}#fieldset-case-data th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}#confirmation-header{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body{width:630px;background-color:#fff}.valign-top{vertical-align:top}.summary-fields{margin-bottom:30px}.summary-fields tbody tr th,.summary-fields tbody tr td{border-bottom:0px}a.disabled{pointer-events:none;cursor:default}.case-field-label{width:45%}.case-field-content{width:50%}.no-bottom-border{border-bottom:none}.case-field-change{width:5%}\n"] }]
29621
+ }], () => [{ type: CaseEditComponent }, { type: FieldsUtils }, { type: CaseFieldService }, { type: i1$1.ActivatedRoute }, { type: OrderService }, { type: ProfileNotifier }, { type: MultipageComponentStateService }, { type: FormValidatorsService }, { type: CaseFlagStateService }, { type: LinkedCasesService }], null); })();
29622
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditSubmitComponent, { className: "CaseEditSubmitComponent", filePath: "lib/shared/components/case-editor/case-edit-submit/case-edit-submit.component.ts", lineNumber: 30 }); })();
29086
29623
 
29087
29624
  function CaseProgressComponent_div_0_Template(rf, ctx) { if (rf & 1) {
29088
29625
  const _r1 = i0.ɵɵgetCurrentView();
@@ -29330,7 +29867,8 @@ class CaseEditorModule {
29330
29867
  SessionStorageService,
29331
29868
  EventCompletionStateMachineService,
29332
29869
  CaseFlagStateService,
29333
- ValidPageListCaseFieldsService
29870
+ ValidPageListCaseFieldsService,
29871
+ MultipageComponentStateService
29334
29872
  ], imports: [CommonModule,
29335
29873
  RouterModule,
29336
29874
  FormsModule,
@@ -29412,7 +29950,8 @@ class CaseEditorModule {
29412
29950
  SessionStorageService,
29413
29951
  EventCompletionStateMachineService,
29414
29952
  CaseFlagStateService,
29415
- ValidPageListCaseFieldsService
29953
+ ValidPageListCaseFieldsService,
29954
+ MultipageComponentStateService
29416
29955
  ]
29417
29956
  }]
29418
29957
  }], null, null); })();
@@ -29444,7 +29983,7 @@ class CaseEditorModule {
29444
29983
  CallbackErrorsComponent] }); })();
29445
29984
  i0.ɵɵsetComponentScope(CaseEditConfirmComponent, function () { return [i5.NgIf, i4.ɵNgNoValidate, i4.NgControlStatusGroup, i4.FormGroupDirective, MarkdownComponent]; }, function () { return [CaseReferencePipe, CcdCaseTitlePipe, i1.RpxTranslatePipe]; });
29446
29985
  i0.ɵɵsetComponentScope(CaseEditPageComponent, function () { return [i5.NgForOf, i5.NgIf, i4.ɵNgNoValidate, i4.NgControlStatusGroup, i4.FormGroupDirective, CallbackErrorsComponent, MarkdownComponent, CaseEventCompletionComponent, CaseEditFormComponent,
29447
- CaseEditGenericErrorsComponent]; }, function () { return [i5.AsyncPipe, CaseReferencePipe, CcdCaseTitlePipe, i1.RpxTranslatePipe]; });
29986
+ CaseEditGenericErrorsComponent]; }, function () { return [CaseReferencePipe, CcdCaseTitlePipe, i1.RpxTranslatePipe]; });
29448
29987
  i0.ɵɵsetComponentScope(CaseEditFormComponent, function () { return [i5.NgForOf, i5.NgIf, i5.NgSwitch, i5.NgSwitchCase, i4.NgControlStatusGroup, i4.FormGroupDirective, LabelSubstitutorDirective, ConditionalShowFormDirective, FieldReadComponent, FieldWriteComponent]; }, function () { return [IsCompoundPipe, IsReadOnlyAndNotCollectionPipe]; });
29449
29988
  i0.ɵɵsetComponentScope(CaseEditSubmitComponent, function () { return [i5.NgClass, i5.NgForOf, i5.NgIf, i5.NgSwitch, i5.NgSwitchCase, i4.ɵNgNoValidate, i4.DefaultValueAccessor, i4.NgControlStatus, i4.NgControlStatusGroup, i4.MaxLengthValidator, i4.FormGroupDirective, i4.FormControlName, i4.FormGroupName, LabelSubstitutorDirective, CallbackErrorsComponent, MarkdownComponent, FieldReadComponent, CaseEventCompletionComponent, CaseEditGenericErrorsComponent]; }, function () { return [FirstErrorPipe, IsCompoundPipe, CaseReferencePipe, CcdCaseTitlePipe, CcdCYAPageLabelFilterPipe, ReadFieldsFilterPipe, CcdPageFieldsPipe, i1.RpxTranslatePipe]; });
29450
29989
  i0.ɵɵsetComponentScope(CaseCreateComponent, function () { return [i5.NgIf, CaseEditComponent]; }, []);
@@ -31582,6 +32121,7 @@ class CaseEventTriggerComponent {
31582
32121
  activitySubscription;
31583
32122
  caseSubscription;
31584
32123
  parentUrl;
32124
+ routerCurrentNavigation;
31585
32125
  constructor(ngZone, casesService, caseNotifier, router, alertService, route, caseReferencePipe, activityPollingService, sessionStorageService) {
31586
32126
  this.ngZone = ngZone;
31587
32127
  this.casesService = casesService;
@@ -31592,6 +32132,7 @@ class CaseEventTriggerComponent {
31592
32132
  this.caseReferencePipe = caseReferencePipe;
31593
32133
  this.activityPollingService = activityPollingService;
31594
32134
  this.sessionStorageService = sessionStorageService;
32135
+ this.routerCurrentNavigation = this.router.getCurrentNavigation();
31595
32136
  }
31596
32137
  ngOnInit() {
31597
32138
  if (this.route.snapshot.data.case) {
@@ -31670,8 +32211,16 @@ class CaseEventTriggerComponent {
31670
32211
  });
31671
32212
  }
31672
32213
  cancel() {
31673
- if (this.router.url && this.router.url.includes('linkCases')) {
31674
- this.router.navigate(['cases', 'case-details', this.caseDetails.case_id], { fragment: 'Linked cases' });
32214
+ const previousUrl = this.routerCurrentNavigation?.previousNavigation?.finalUrl?.toString();
32215
+ if (previousUrl) {
32216
+ if (previousUrl.indexOf('#') > -1) {
32217
+ const url = previousUrl.split('#')[0];
32218
+ const fragment = previousUrl.split('#')[1].replace('%20', ' ');
32219
+ return this.router.navigate([url], { fragment: fragment });
32220
+ }
32221
+ else {
32222
+ return this.router.navigate([previousUrl]);
32223
+ }
31675
32224
  }
31676
32225
  else {
31677
32226
  return this.router.navigate([this.parentUrl]);
@@ -37193,5 +37742,5 @@ class TestRouteSnapshotBuilder {
37193
37742
  * Generated bundle index. Do not edit.
37194
37743
  */
37195
37744
 
37196
- export { AbstractAppConfig, AbstractFieldReadComponent, AbstractFieldWriteComponent, Activity, ActivityBannerComponent, ActivityComponent, ActivityIconComponent, ActivityInfo, ActivityModule, ActivityPollingService, ActivityService, AddCommentsComponent, AddCommentsErrorMessage, AddCommentsStep, AddressModel, AddressOption, AddressesService, Alert, AlertComponent, AlertIconClassPipe, AlertMessageType, AlertModule, AlertService, AuthService, Banner, BannersService, BeforeYouStartComponent, BodyComponent, BrowserService, CCDCaseLinkType, COMPONENT_PORTAL_INJECTION_TOKEN, CallbackErrorsComponent, CallbackErrorsContext, CaseAccessUtils, CaseBasicAccessViewComponent, CaseChallengedAccessRequestComponent, CaseChallengedAccessSuccessComponent, CaseCreateComponent, CaseDetails, CaseEditComponent, CaseEditConfirmComponent, CaseEditDataModule, CaseEditDataService, CaseEditFormComponent, CaseEditPageComponent, CaseEditSubmitComponent, CaseEditWizardGuard, CaseEditorConfig, CaseEditorModule, CaseEvent, CaseEventCompletionComponent, CaseEventCompletionTaskCancelledComponent, CaseEventCompletionTaskReassignedComponent, CaseEventData, CaseEventTrigger, CaseEventTriggerComponent, CaseField, CaseFieldService, CaseFileViewFieldComponent, CaseFileViewFolderComponent, CaseFileViewFolderDocumentActionsComponent, CaseFileViewFolderSelectorComponent, CaseFileViewFolderSortComponent, CaseFileViewOverlayMenuComponent, CaseFileViewService, CaseFlagCheckYourAnswersPageStep, CaseFlagDisplayContextParameter, CaseFlagErrorMessage, CaseFlagFieldState, CaseFlagFormFields, CaseFlagRefdataService, CaseFlagStatus, CaseFlagSummaryListComponent, CaseFlagSummaryListDisplayMode, CaseFlagTableComponent, CaseFlagWizardStepTitle, CaseFullAccessViewComponent, CaseHeaderComponent, CaseHeaderModule, CaseHistoryViewerFieldComponent, CaseLink, CaseLinkResponse, CaseListComponent, CaseListFiltersComponent, CaseListFiltersModule, CaseListModule, CaseNotifier, CasePaymentHistoryViewerFieldComponent, CasePrintDocument, CasePrinterComponent, CaseProgressComponent, CaseReferencePipe, CaseResolver, CaseSpecificAccessRequestComponent, CaseSpecificAccessSuccessComponent, CaseState, CaseTab, CaseTimelineComponent, CaseTimelineDisplayMode, CaseTimelineModule, CaseType, CaseTypeLite, CaseView, CaseViewComponent, CaseViewEvent, CaseViewTrigger, CaseViewerComponent, CaseViewerModule, CasesService, CaseworkerService, CcdCYAPageLabelFilterPipe, CcdCaseTitlePipe, CcdCollectionTableCaseFieldsFilterPipe, CcdPageFieldsPipe, CcdTabFieldsPipe, CheckYourAnswersComponent, ConditionalShowFormDirective, ConditionalShowModule, ConditionalShowRegistrarService, ConfirmFlagStatusComponent, ConfirmStatusErrorMessage, ConfirmStatusStep, Confirmation, ConvertHrefToRouterService, CreateCaseFiltersComponent, CreateCaseFiltersModule, CreateCaseFiltersSelection, DRAFT_PREFIX, DRAFT_QUERY_PARAM, DashPipe, DateInputComponent, DatePipe, DateTimeFormatUtils, DatetimePickerComponent, DefinitionsModule, DefinitionsService, DeleteOrCancelDialogComponent, DialogsModule, DisplayMode, Document, DocumentData, DocumentDialogComponent, DocumentLinks, DocumentManagementService, DocumentUrlPipe, Draft, DraftService, DynamicListPipe, DynamicRadioListPipe, ESQueryType, Embedded, EnumDisplayDescriptionPipe, ErrorMessageComponent, ErrorNotifierService, EventCaseField, EventCompletionReturnStates, EventCompletionStateMachineService, EventCompletionStates, EventLogComponent, EventLogDetailsComponent, EventLogTableComponent, EventMessageModule, EventStartComponent, EventStartModule, EventStartStateMachineService, EventStatusService, EventTriggerResolver, EventTriggerService, Fee, FeeValue, Field, FieldLabelPipe, FieldReadComponent, FieldReadLabelComponent, FieldType, FieldTypeSanitiser, FieldWriteComponent, FieldsFilterPipe, FieldsPurger, FieldsUtils, FirstErrorPipe, FixedListItem, FixedListPipe, FixedRadioListPipe, FlagFieldDisplayPipe, FocusElementDirective, FocusElementModule, FooterComponent, FormDocument, FormErrorService, FormValidatorsService, FormValueService, FormatTranslatorService, GreyBarService, HRef, HeaderBarComponent, HeadersModule, HttpError, HttpErrorService, HttpService, IsCompoundPipe, IsMandatoryPipe, IsReadOnlyAndNotCollectionPipe, IsReadOnlyPipe, JudicialworkerService, Jurisdiction, JurisdictionService, LabelFieldComponent, LabelSubstitutorDirective, LabelSubstitutorModule, LanguageInterpreterDisplayPipe, LinkCaseReason, LinkCasesComponent, LinkCasesFromReasonValuePipe, LinkCasesReasonValuePipe, LinkDetails, LinkFromReason, LinkReason, LinkedCasesErrorMessages, LinkedCasesEventTriggers, LinkedCasesFromTableComponent, LinkedCasesPages, LinkedCasesResponse, LinkedCasesToTableComponent, LoadingModule, LoadingService, LoadingSpinnerComponent, LoadingSpinnerModule, MEDIA_VIEWER_LOCALSTORAGE_KEY, MULTIPLE_TASKS_FOUND, ManageCaseFlagsComponent, ManageCaseFlagsLabelDisplayPipe, MarkdownComponent, MarkdownComponentModule, MoneyGbpInputComponent, MultipleTasksExistComponent, NavigationComponent, NavigationItemComponent, NavigationNotifierService, NavigationOrigin, NoLinkedCasesComponent, NoTasksAvailableComponent, NotificationBannerComponent, NotificationBannerHeaderClass, NotificationBannerType, OrderService, OrderSummary, OrganisationConverter, OrganisationService, PageValidationService, PaginationComponent, PaginationMetadata, PaginationModule, PaletteContext, PaletteModule, PaletteService, PaletteUtilsModule, Patterns, PaymentField, PhaseComponent, PipesModule, PlaceholderService, PrintUrlPipe, Profile, ProfileNotifier, ProfileService, QualifyingQuestionDetailComponent, QualifyingQuestionOptionsComponent, QualifyingQuestionsErrorMessage, QueryAttachmentsReadComponent, QueryCaseDetailsHeaderComponent, QueryCheckYourAnswersComponent, QueryCreateContext, QueryDetailsComponent, QueryEventCompletionComponent, QueryItemResponseStatus, QueryListComponent, QueryListData, QueryListItem, QueryWriteAddDocumentsComponent, QueryWriteDateInputComponent, QueryWriteRaiseQueryComponent, QueryWriteRespondToQueryComponent, RaiseQueryErrorMessage, ReadCaseFlagFieldComponent, ReadCaseLinkFieldComponent, ReadCollectionFieldComponent, ReadComplexFieldCollectionTableComponent, ReadComplexFieldComponent, ReadComplexFieldRawComponent, ReadComplexFieldTableComponent, ReadDateFieldComponent, ReadDocumentFieldComponent, ReadDynamicListFieldComponent, ReadDynamicMultiSelectListFieldComponent, ReadDynamicRadioListFieldComponent, ReadEmailFieldComponent, ReadFieldsFilterPipe, ReadFixedListFieldComponent, ReadFixedRadioListFieldComponent, ReadJudicialUserFieldComponent, ReadLinkedCasesFieldComponent, ReadMoneyGbpFieldComponent, ReadMultiSelectListFieldComponent, ReadNumberFieldComponent, ReadOrderSummaryFieldComponent, ReadOrderSummaryRowComponent, ReadOrganisationFieldComponent, ReadOrganisationFieldRawComponent, ReadOrganisationFieldTableComponent, ReadPhoneUKFieldComponent, ReadQueryManagementFieldComponent, ReadTextAreaFieldComponent, ReadTextFieldComponent, ReadYesNoFieldComponent, RefdataCaseFlagType, RemoveDialogComponent, RequestOptionsBuilder, RespondToQueryErrorMessages, RetryUtil, RouterHelperService, RouterLinkComponent, SaveOrDiscardDialogComponent, SearchFiltersComponent, SearchFiltersModule, SearchFiltersWrapperComponent, SearchInput, SearchLanguageInterpreterComponent, SearchLanguageInterpreterErrorMessage, SearchLanguageInterpreterStep, SearchResultComponent, SearchResultModule, SearchResultView, SearchResultViewColumn, SearchResultViewItem, SearchResultViewItemComparatorFactory, SearchService, SelectFlagErrorMessage, SelectFlagLocationComponent, SelectFlagLocationErrorMessage, SelectFlagTypeComponent, SelectFlagTypeErrorMessage, SessionStorageService, ShowCondition, SortOrder$1 as SortOrder, SortParameters, SortSearchResultPipe, TabComponent, TableColumnConfig, TableConfig, TabsComponent, TabsModule, TaskAssignedComponent, TaskCancelledComponent, TaskConflictComponent, TaskUnassignedComponent, Terms, TestRouteSnapshotBuilder, UnLinkCasesComponent, UnsupportedFieldComponent, UpdateFlagAddTranslationErrorMessage, UpdateFlagAddTranslationFormComponent, UpdateFlagAddTranslationStep, UpdateFlagComponent, UpdateFlagErrorMessage, UpdateFlagStep, UpdateFlagTitleDisplayPipe, WaysToPayFieldComponent, WindowService, Wizard, WizardFactoryService, WizardPage, WizardPageField, WorkAllocationService, WorkbasketFiltersComponent, WorkbasketFiltersModule, WorkbasketInput, WorkbasketInputFilterService, WorkbasketInputModel, WriteAddressFieldComponent, WriteCaseFlagFieldComponent, WriteCaseLinkFieldComponent, WriteCollectionFieldComponent, WriteComplexFieldComponent, WriteDateContainerFieldComponent, WriteDateFieldComponent, WriteDocumentFieldComponent, WriteDynamicListFieldComponent, WriteDynamicMultiSelectListFieldComponent, WriteDynamicRadioListFieldComponent, WriteEmailFieldComponent, WriteFixedListFieldComponent, WriteFixedRadioListFieldComponent, WriteJudicialUserFieldComponent, WriteLinkedCasesFieldComponent, WriteMoneyGbpFieldComponent, WriteMultiSelectListFieldComponent, WriteNumberFieldComponent, WriteOrderSummaryFieldComponent, WriteOrganisationComplexFieldComponent, WriteOrganisationFieldComponent, WritePhoneUKFieldComponent, WriteTextAreaFieldComponent, WriteTextFieldComponent, WriteYesNoFieldComponent, YesNoService, aCaseField, caseMessagesMockData, createACL, createCaseEventTrigger, createCaseField, createComplexFieldOverride, createFieldType, createFixedListFieldType, createHiddenComplexFieldOverride, createMultiSelectListFieldType, createWizardPage, createWizardPageField, editorRouting, initDialog, newCaseField, textFieldType, viewerRouting };
37745
+ export { AbstractAppConfig, AbstractFieldReadComponent, AbstractFieldWriteComponent, AbstractFieldWriteJourneyComponent, AbstractJourneyComponent, Activity, ActivityBannerComponent, ActivityComponent, ActivityIconComponent, ActivityInfo, ActivityModule, ActivityPollingService, ActivityService, AddCommentsComponent, AddCommentsErrorMessage, AddCommentsStep, AddressModel, AddressOption, AddressesService, Alert, AlertComponent, AlertIconClassPipe, AlertMessageType, AlertModule, AlertService, AuthService, Banner, BannersService, BeforeYouStartComponent, BodyComponent, BrowserService, CCDCaseLinkType, COMPONENT_PORTAL_INJECTION_TOKEN, CallbackErrorsComponent, CallbackErrorsContext, CaseAccessUtils, CaseBasicAccessViewComponent, CaseChallengedAccessRequestComponent, CaseChallengedAccessSuccessComponent, CaseCreateComponent, CaseDetails, CaseEditComponent, CaseEditConfirmComponent, CaseEditDataModule, CaseEditDataService, CaseEditFormComponent, CaseEditPageComponent, CaseEditSubmitComponent, CaseEditWizardGuard, CaseEditorConfig, CaseEditorModule, CaseEvent, CaseEventCompletionComponent, CaseEventCompletionTaskCancelledComponent, CaseEventCompletionTaskReassignedComponent, CaseEventData, CaseEventTrigger, CaseEventTriggerComponent, CaseField, CaseFieldService, CaseFileViewFieldComponent, CaseFileViewFolderComponent, CaseFileViewFolderDocumentActionsComponent, CaseFileViewFolderSelectorComponent, CaseFileViewFolderSortComponent, CaseFileViewOverlayMenuComponent, CaseFileViewService, CaseFlagCheckYourAnswersPageStep, CaseFlagDisplayContextParameter, CaseFlagErrorMessage, CaseFlagFieldState, CaseFlagFormFields, CaseFlagRefdataService, CaseFlagStatus, CaseFlagSummaryListComponent, CaseFlagSummaryListDisplayMode, CaseFlagTableComponent, CaseFlagWizardStepTitle, CaseFullAccessViewComponent, CaseHeaderComponent, CaseHeaderModule, CaseHistoryViewerFieldComponent, CaseLink, CaseLinkResponse, CaseListComponent, CaseListFiltersComponent, CaseListFiltersModule, CaseListModule, CaseNotifier, CasePaymentHistoryViewerFieldComponent, CasePrintDocument, CasePrinterComponent, CaseProgressComponent, CaseReferencePipe, CaseResolver, CaseSpecificAccessRequestComponent, CaseSpecificAccessSuccessComponent, CaseState, CaseTab, CaseTimelineComponent, CaseTimelineDisplayMode, CaseTimelineModule, CaseType, CaseTypeLite, CaseView, CaseViewComponent, CaseViewEvent, CaseViewTrigger, CaseViewerComponent, CaseViewerModule, CasesService, CaseworkerService, CcdCYAPageLabelFilterPipe, CcdCaseTitlePipe, CcdCollectionTableCaseFieldsFilterPipe, CcdPageFieldsPipe, CcdTabFieldsPipe, CheckYourAnswersComponent, ConditionalShowFormDirective, ConditionalShowModule, ConditionalShowRegistrarService, ConfirmFlagStatusComponent, ConfirmStatusErrorMessage, ConfirmStatusStep, Confirmation, ConvertHrefToRouterService, CreateCaseFiltersComponent, CreateCaseFiltersModule, CreateCaseFiltersSelection, DRAFT_PREFIX, DRAFT_QUERY_PARAM, DashPipe, DateInputComponent, DatePipe, DateTimeFormatUtils, DatetimePickerComponent, DefinitionsModule, DefinitionsService, DeleteOrCancelDialogComponent, DialogsModule, DisplayMode, Document, DocumentData, DocumentDialogComponent, DocumentLinks, DocumentManagementService, DocumentUrlPipe, Draft, DraftService, DynamicListPipe, DynamicRadioListPipe, ESQueryType, Embedded, EnumDisplayDescriptionPipe, ErrorMessageComponent, ErrorNotifierService, EventCaseField, EventCompletionReturnStates, EventCompletionStateMachineService, EventCompletionStates, EventLogComponent, EventLogDetailsComponent, EventLogTableComponent, EventMessageModule, EventStartComponent, EventStartModule, EventStartStateMachineService, EventStatusService, EventTriggerResolver, EventTriggerService, Fee, FeeValue, Field, FieldLabelPipe, FieldReadComponent, FieldReadLabelComponent, FieldType, FieldTypeSanitiser, FieldWriteComponent, FieldsFilterPipe, FieldsPurger, FieldsUtils, FirstErrorPipe, FixedListItem, FixedListPipe, FixedRadioListPipe, FlagFieldDisplayPipe, FocusElementDirective, FocusElementModule, FooterComponent, FormDocument, FormErrorService, FormValidatorsService, FormValueService, FormatTranslatorService, GreyBarService, HRef, HeaderBarComponent, HeadersModule, HttpError, HttpErrorService, HttpService, IsCompoundPipe, IsMandatoryPipe, IsReadOnlyAndNotCollectionPipe, IsReadOnlyPipe, JudicialworkerService, Jurisdiction, JurisdictionService, LabelFieldComponent, LabelSubstitutorDirective, LabelSubstitutorModule, LanguageInterpreterDisplayPipe, LinkCaseReason, LinkCasesComponent, LinkCasesFromReasonValuePipe, LinkCasesReasonValuePipe, LinkDetails, LinkFromReason, LinkReason, LinkedCasesErrorMessages, LinkedCasesEventTriggers, LinkedCasesFromTableComponent, LinkedCasesPages, LinkedCasesResponse, LinkedCasesToTableComponent, LoadingModule, LoadingService, LoadingSpinnerComponent, LoadingSpinnerModule, MEDIA_VIEWER_LOCALSTORAGE_KEY, MULTIPLE_TASKS_FOUND, ManageCaseFlagsComponent, ManageCaseFlagsLabelDisplayPipe, MarkdownComponent, MarkdownComponentModule, MoneyGbpInputComponent, MultipageComponentStateService, MultipleTasksExistComponent, NavigationComponent, NavigationItemComponent, NavigationNotifierService, NavigationOrigin, NoLinkedCasesComponent, NoTasksAvailableComponent, NotificationBannerComponent, NotificationBannerHeaderClass, NotificationBannerType, OrderService, OrderSummary, OrganisationConverter, OrganisationService, PageValidationService, PaginationComponent, PaginationMetadata, PaginationModule, PaletteContext, PaletteModule, PaletteService, PaletteUtilsModule, Patterns, PaymentField, PhaseComponent, PipesModule, PlaceholderService, PrintUrlPipe, Profile, ProfileNotifier, ProfileService, QualifyingQuestionDetailComponent, QualifyingQuestionOptionsComponent, QualifyingQuestionsErrorMessage, QueryAttachmentsReadComponent, QueryCaseDetailsHeaderComponent, QueryCheckYourAnswersComponent, QueryCreateContext, QueryDetailsComponent, QueryEventCompletionComponent, QueryItemResponseStatus, QueryListComponent, QueryListData, QueryListItem, QueryWriteAddDocumentsComponent, QueryWriteDateInputComponent, QueryWriteRaiseQueryComponent, QueryWriteRespondToQueryComponent, RaiseQueryErrorMessage, ReadCaseFlagFieldComponent, ReadCaseLinkFieldComponent, ReadCollectionFieldComponent, ReadComplexFieldCollectionTableComponent, ReadComplexFieldComponent, ReadComplexFieldRawComponent, ReadComplexFieldTableComponent, ReadDateFieldComponent, ReadDocumentFieldComponent, ReadDynamicListFieldComponent, ReadDynamicMultiSelectListFieldComponent, ReadDynamicRadioListFieldComponent, ReadEmailFieldComponent, ReadFieldsFilterPipe, ReadFixedListFieldComponent, ReadFixedRadioListFieldComponent, ReadJudicialUserFieldComponent, ReadLinkedCasesFieldComponent, ReadMoneyGbpFieldComponent, ReadMultiSelectListFieldComponent, ReadNumberFieldComponent, ReadOrderSummaryFieldComponent, ReadOrderSummaryRowComponent, ReadOrganisationFieldComponent, ReadOrganisationFieldRawComponent, ReadOrganisationFieldTableComponent, ReadPhoneUKFieldComponent, ReadQueryManagementFieldComponent, ReadTextAreaFieldComponent, ReadTextFieldComponent, ReadYesNoFieldComponent, RefdataCaseFlagType, RemoveDialogComponent, RequestOptionsBuilder, RespondToQueryErrorMessages, RetryUtil, RouterHelperService, RouterLinkComponent, SaveOrDiscardDialogComponent, SearchFiltersComponent, SearchFiltersModule, SearchFiltersWrapperComponent, SearchInput, SearchLanguageInterpreterComponent, SearchLanguageInterpreterErrorMessage, SearchLanguageInterpreterStep, SearchResultComponent, SearchResultModule, SearchResultView, SearchResultViewColumn, SearchResultViewItem, SearchResultViewItemComparatorFactory, SearchService, SelectFlagErrorMessage, SelectFlagLocationComponent, SelectFlagLocationErrorMessage, SelectFlagTypeComponent, SelectFlagTypeErrorMessage, SessionStorageService, ShowCondition, SortOrder$1 as SortOrder, SortParameters, SortSearchResultPipe, TabComponent, TableColumnConfig, TableConfig, TabsComponent, TabsModule, TaskAssignedComponent, TaskCancelledComponent, TaskConflictComponent, TaskUnassignedComponent, Terms, TestRouteSnapshotBuilder, UnLinkCasesComponent, UnsupportedFieldComponent, UpdateFlagAddTranslationErrorMessage, UpdateFlagAddTranslationFormComponent, UpdateFlagAddTranslationStep, UpdateFlagComponent, UpdateFlagErrorMessage, UpdateFlagStep, UpdateFlagTitleDisplayPipe, WaysToPayFieldComponent, WindowService, Wizard, WizardFactoryService, WizardPage, WizardPageField, WorkAllocationService, WorkbasketFiltersComponent, WorkbasketFiltersModule, WorkbasketInput, WorkbasketInputFilterService, WorkbasketInputModel, WriteAddressFieldComponent, WriteCaseFlagFieldComponent, WriteCaseLinkFieldComponent, WriteCollectionFieldComponent, WriteComplexFieldComponent, WriteDateContainerFieldComponent, WriteDateFieldComponent, WriteDocumentFieldComponent, WriteDynamicListFieldComponent, WriteDynamicMultiSelectListFieldComponent, WriteDynamicRadioListFieldComponent, WriteEmailFieldComponent, WriteFixedListFieldComponent, WriteFixedRadioListFieldComponent, WriteJudicialUserFieldComponent, WriteLinkedCasesFieldComponent, WriteMoneyGbpFieldComponent, WriteMultiSelectListFieldComponent, WriteNumberFieldComponent, WriteOrderSummaryFieldComponent, WriteOrganisationComplexFieldComponent, WriteOrganisationFieldComponent, WritePhoneUKFieldComponent, WriteTextAreaFieldComponent, WriteTextFieldComponent, WriteYesNoFieldComponent, YesNoService, aCaseField, caseMessagesMockData, createACL, createCaseEventTrigger, createCaseField, createComplexFieldOverride, createFieldType, createFixedListFieldType, createHiddenComplexFieldOverride, createMultiSelectListFieldType, createWizardPage, createWizardPageField, editorRouting, initDialog, newCaseField, textFieldType, viewerRouting };
37197
37746
  //# sourceMappingURL=hmcts-ccd-case-ui-toolkit.mjs.map