@hmcts/ccd-case-ui-toolkit 5.0.32-angular11-upgrade → 5.0.33-angular11-upgrade

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 (148) hide show
  1. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js +3365 -640
  2. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js.map +1 -1
  3. package/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js +1 -1
  4. package/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js.map +1 -1
  5. package/esm2015/lib/app.config.js +1 -1
  6. package/esm2015/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.js +15 -11
  7. package/esm2015/lib/shared/components/case-editor/services/cases.service.js +28 -1
  8. package/esm2015/lib/shared/components/case-editor/services/page-validation.service.js +10 -2
  9. package/esm2015/lib/shared/components/case-viewer/case-event-trigger/case-event-trigger.component.js +9 -2
  10. package/esm2015/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.js +15 -10
  11. package/esm2015/lib/shared/components/palette/base-field/abstract-form-field.component.js +4 -2
  12. package/esm2015/lib/shared/components/palette/base-field/field-write.component.js +8 -14
  13. package/esm2015/lib/shared/components/palette/case-flag/components/manage-case-flags/manage-case-flags.component.js +71 -41
  14. package/esm2015/lib/shared/components/palette/case-flag/domain/case-flag.model.js +1 -1
  15. package/esm2015/lib/shared/components/palette/case-flag/read-case-flag-field.component.js +2 -3
  16. package/esm2015/lib/shared/components/palette/case-flag/write-case-flag-field.component.js +13 -9
  17. package/esm2015/lib/shared/components/palette/case-link/components/before-you-start/before-you-start.component.js +125 -0
  18. package/esm2015/lib/shared/components/palette/case-link/components/check-your-answers/check-your-answers.component.js +198 -0
  19. package/esm2015/lib/shared/components/palette/case-link/components/index.js +10 -0
  20. package/esm2015/lib/shared/components/palette/case-link/components/link-cases/link-cases.component.js +493 -0
  21. package/esm2015/lib/shared/components/palette/case-link/components/linked-cases-table/linked-cases-from-table.component.js +221 -0
  22. package/esm2015/lib/shared/components/palette/case-link/components/linked-cases-table/linked-cases-to-table.component.js +286 -0
  23. package/esm2015/lib/shared/components/palette/case-link/components/no-linked-cases/no-linked-cases.component.js +76 -0
  24. package/esm2015/lib/shared/components/palette/case-link/components/read-linked-cases.component.js +178 -0
  25. package/esm2015/lib/shared/components/palette/case-link/components/unlink-cases/unlink-cases.component.js +216 -0
  26. package/esm2015/lib/shared/components/palette/case-link/components/write-linked-cases.component.js +260 -0
  27. package/esm2015/lib/shared/components/palette/case-link/domain/index.js +3 -0
  28. package/esm2015/lib/shared/components/palette/case-link/domain/linked-cases-state.model.js +2 -0
  29. package/esm2015/lib/shared/components/palette/case-link/domain/linked-cases.model.js +19 -0
  30. package/esm2015/lib/shared/components/palette/case-link/enums/index.js +2 -0
  31. package/esm2015/lib/shared/components/palette/case-link/enums/write-linked-cases-field.enum.js +33 -0
  32. package/esm2015/lib/shared/components/palette/case-link/index.js +4 -1
  33. package/esm2015/lib/shared/components/palette/case-link/read-case-link-field.component.js +28 -8
  34. package/esm2015/lib/shared/components/palette/case-link/services/index.js +2 -0
  35. package/esm2015/lib/shared/components/palette/case-link/services/jurisdiction.service.js +22 -0
  36. package/esm2015/lib/shared/components/palette/case-link/services/linked-cases.service.js +136 -0
  37. package/esm2015/lib/shared/components/palette/case-link/utils/validators.utils.js +27 -0
  38. package/esm2015/lib/shared/components/palette/case-link/write-case-link-field.component.js +79 -65
  39. package/esm2015/lib/shared/components/palette/index.js +6 -2
  40. package/esm2015/lib/shared/components/palette/palette.module.js +70 -18
  41. package/esm2015/lib/shared/components/palette/palette.service.js +10 -4
  42. package/esm2015/lib/shared/components/search-result/search-result.component.js +1 -1
  43. package/esm2015/lib/shared/domain/definition/field-type-enum.model.js +1 -1
  44. package/esm2015/lib/shared/pipes/complex/ccd-read-fields-filter.pipe.js +5 -1
  45. package/esm2015/lib/shared/pipes/index.js +2 -1
  46. package/esm2015/lib/shared/pipes/link-cases-reason-code/ccd-link-cases-reason-code.pipe.js +23 -0
  47. package/esm2015/lib/shared/pipes/link-cases-reason-code/index.js +2 -0
  48. package/esm2015/lib/shared/pipes/pipes.module.js +9 -5
  49. package/esm2015/lib/shared/services/common-data-service/common-data-service.js +22 -0
  50. package/esm2015/lib/shared/services/fields/fields.purger.js +128 -112
  51. package/esm2015/lib/shared/services/fields/fields.utils.js +11 -2
  52. package/esm2015/lib/shared/services/form/form-value.service.js +9 -7
  53. package/esm2015/lib/shared/services/jurisdiction/jurisdiction.service.js +1 -1
  54. package/esm2015/lib/shared/services/search/search.service.js +8 -1
  55. package/fesm2015/hmcts-ccd-case-ui-toolkit.js +2842 -415
  56. package/fesm2015/hmcts-ccd-case-ui-toolkit.js.map +1 -1
  57. package/lib/app.config.d.ts +4 -0
  58. package/lib/app.config.d.ts.map +1 -1
  59. package/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.d.ts +2 -0
  60. package/lib/shared/components/case-editor/case-edit-page/case-edit-page.component.d.ts.map +1 -1
  61. package/lib/shared/components/case-editor/services/cases.service.d.ts +7 -0
  62. package/lib/shared/components/case-editor/services/cases.service.d.ts.map +1 -1
  63. package/lib/shared/components/case-editor/services/page-validation.service.d.ts +1 -0
  64. package/lib/shared/components/case-editor/services/page-validation.service.d.ts.map +1 -1
  65. package/lib/shared/components/case-viewer/case-event-trigger/case-event-trigger.component.d.ts.map +1 -1
  66. package/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.d.ts +2 -2
  67. package/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.d.ts.map +1 -1
  68. package/lib/shared/components/palette/base-field/abstract-form-field.component.d.ts.map +1 -1
  69. package/lib/shared/components/palette/base-field/field-write.component.d.ts +2 -2
  70. package/lib/shared/components/palette/base-field/field-write.component.d.ts.map +1 -1
  71. package/lib/shared/components/palette/case-flag/components/manage-case-flags/manage-case-flags.component.d.ts +11 -5
  72. package/lib/shared/components/palette/case-flag/components/manage-case-flags/manage-case-flags.component.d.ts.map +1 -1
  73. package/lib/shared/components/palette/case-flag/domain/case-flag.model.d.ts +2 -0
  74. package/lib/shared/components/palette/case-flag/domain/case-flag.model.d.ts.map +1 -1
  75. package/lib/shared/components/palette/case-flag/read-case-flag-field.component.d.ts +0 -1
  76. package/lib/shared/components/palette/case-flag/read-case-flag-field.component.d.ts.map +1 -1
  77. package/lib/shared/components/palette/case-flag/write-case-flag-field.component.d.ts.map +1 -1
  78. package/lib/shared/components/palette/case-link/components/before-you-start/before-you-start.component.d.ts +19 -0
  79. package/lib/shared/components/palette/case-link/components/before-you-start/before-you-start.component.d.ts.map +1 -0
  80. package/lib/shared/components/palette/case-link/components/check-your-answers/check-your-answers.component.d.ts +18 -0
  81. package/lib/shared/components/palette/case-link/components/check-your-answers/check-your-answers.component.d.ts.map +1 -0
  82. package/lib/shared/components/palette/case-link/components/index.d.ts +10 -0
  83. package/lib/shared/components/palette/case-link/components/index.d.ts.map +1 -0
  84. package/lib/shared/components/palette/case-link/components/link-cases/link-cases.component.d.ts +41 -0
  85. package/lib/shared/components/palette/case-link/components/link-cases/link-cases.component.d.ts.map +1 -0
  86. package/lib/shared/components/palette/case-link/components/linked-cases-table/linked-cases-from-table.component.d.ts +42 -0
  87. package/lib/shared/components/palette/case-link/components/linked-cases-table/linked-cases-from-table.component.d.ts.map +1 -0
  88. package/lib/shared/components/palette/case-link/components/linked-cases-table/linked-cases-to-table.component.d.ts +45 -0
  89. package/lib/shared/components/palette/case-link/components/linked-cases-table/linked-cases-to-table.component.d.ts.map +1 -0
  90. package/lib/shared/components/palette/case-link/components/no-linked-cases/no-linked-cases.component.d.ts +12 -0
  91. package/lib/shared/components/palette/case-link/components/no-linked-cases/no-linked-cases.component.d.ts.map +1 -0
  92. package/lib/shared/components/palette/case-link/components/read-linked-cases.component.d.ts +37 -0
  93. package/lib/shared/components/palette/case-link/components/read-linked-cases.component.d.ts.map +1 -0
  94. package/lib/shared/components/palette/case-link/components/unlink-cases/unlink-cases.component.d.ts +38 -0
  95. package/lib/shared/components/palette/case-link/components/unlink-cases/unlink-cases.component.d.ts.map +1 -0
  96. package/lib/shared/components/palette/case-link/components/write-linked-cases.component.d.ts +45 -0
  97. package/lib/shared/components/palette/case-link/components/write-linked-cases.component.d.ts.map +1 -0
  98. package/lib/shared/components/palette/case-link/domain/index.d.ts +3 -0
  99. package/lib/shared/components/palette/case-link/domain/index.d.ts.map +1 -0
  100. package/lib/shared/components/palette/case-link/domain/linked-cases-state.model.d.ts +12 -0
  101. package/lib/shared/components/palette/case-link/domain/linked-cases-state.model.d.ts.map +1 -0
  102. package/lib/shared/components/palette/case-link/domain/linked-cases.model.d.ts +65 -0
  103. package/lib/shared/components/palette/case-link/domain/linked-cases.model.d.ts.map +1 -0
  104. package/lib/shared/components/palette/case-link/enums/index.d.ts +2 -0
  105. package/lib/shared/components/palette/case-link/enums/index.d.ts.map +1 -0
  106. package/lib/shared/components/palette/case-link/enums/write-linked-cases-field.enum.d.ts +29 -0
  107. package/lib/shared/components/palette/case-link/enums/write-linked-cases-field.enum.d.ts.map +1 -0
  108. package/lib/shared/components/palette/case-link/index.d.ts +3 -0
  109. package/lib/shared/components/palette/case-link/index.d.ts.map +1 -1
  110. package/lib/shared/components/palette/case-link/read-case-link-field.component.d.ts +3 -0
  111. package/lib/shared/components/palette/case-link/read-case-link-field.component.d.ts.map +1 -1
  112. package/lib/shared/components/palette/case-link/services/index.d.ts +2 -0
  113. package/lib/shared/components/palette/case-link/services/index.d.ts.map +1 -0
  114. package/lib/shared/components/palette/case-link/services/jurisdiction.service.d.ts +12 -0
  115. package/lib/shared/components/palette/case-link/services/jurisdiction.service.d.ts.map +1 -0
  116. package/lib/shared/components/palette/case-link/services/linked-cases.service.d.ts +51 -0
  117. package/lib/shared/components/palette/case-link/services/linked-cases.service.d.ts.map +1 -0
  118. package/lib/shared/components/palette/case-link/utils/validators.utils.d.ts +10 -0
  119. package/lib/shared/components/palette/case-link/utils/validators.utils.d.ts.map +1 -0
  120. package/lib/shared/components/palette/case-link/write-case-link-field.component.d.ts +14 -3
  121. package/lib/shared/components/palette/case-link/write-case-link-field.component.d.ts.map +1 -1
  122. package/lib/shared/components/palette/index.d.ts +5 -1
  123. package/lib/shared/components/palette/index.d.ts.map +1 -1
  124. package/lib/shared/components/palette/palette.module.d.ts +54 -45
  125. package/lib/shared/components/palette/palette.module.d.ts.map +1 -1
  126. package/lib/shared/components/palette/palette.service.d.ts.map +1 -1
  127. package/lib/shared/domain/definition/field-type-enum.model.d.ts +1 -1
  128. package/lib/shared/domain/definition/field-type-enum.model.d.ts.map +1 -1
  129. package/lib/shared/pipes/complex/ccd-read-fields-filter.pipe.d.ts.map +1 -1
  130. package/lib/shared/pipes/index.d.ts +1 -0
  131. package/lib/shared/pipes/index.d.ts.map +1 -1
  132. package/lib/shared/pipes/link-cases-reason-code/ccd-link-cases-reason-code.pipe.d.ts +11 -0
  133. package/lib/shared/pipes/link-cases-reason-code/ccd-link-cases-reason-code.pipe.d.ts.map +1 -0
  134. package/lib/shared/pipes/link-cases-reason-code/index.d.ts +2 -0
  135. package/lib/shared/pipes/link-cases-reason-code/index.d.ts.map +1 -0
  136. package/lib/shared/pipes/pipes.module.d.ts +3 -2
  137. package/lib/shared/pipes/pipes.module.d.ts.map +1 -1
  138. package/lib/shared/services/common-data-service/common-data-service.d.ts +29 -0
  139. package/lib/shared/services/common-data-service/common-data-service.d.ts.map +1 -0
  140. package/lib/shared/services/fields/fields.purger.d.ts +19 -12
  141. package/lib/shared/services/fields/fields.purger.d.ts.map +1 -1
  142. package/lib/shared/services/fields/fields.utils.d.ts +1 -0
  143. package/lib/shared/services/fields/fields.utils.d.ts.map +1 -1
  144. package/lib/shared/services/form/form-value.service.d.ts.map +1 -1
  145. package/lib/shared/services/jurisdiction/jurisdiction.service.d.ts.map +1 -1
  146. package/lib/shared/services/search/search.service.d.ts +4 -0
  147. package/lib/shared/services/search/search.service.d.ts.map +1 -1
  148. package/package.json +1 -1
@@ -7,7 +7,7 @@ import { RouterModule, NavigationStart, NavigationEnd } from '@angular/router';
7
7
  import * as i2 from '@angular/forms';
8
8
  import { NG_VALUE_ACCESSOR, NG_VALIDATORS, FormArray, FormGroup, FormControl, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
9
9
  import polling from 'rx-polling';
10
- import { throwError, Subject, EMPTY, Observable, of, BehaviorSubject, timer } from 'rxjs';
10
+ import { throwError, Subject, EMPTY, Observable, of, BehaviorSubject, timer, forkJoin } from 'rxjs';
11
11
  import * as i1$2 from '@angular/common/http';
12
12
  import { HttpErrorResponse, HttpHeaders, HttpParams } from '@angular/common/http';
13
13
  import { catchError, map, publish, refCount, debounceTime, delay, distinctUntilChanged, finalize, publishReplay, take, tap, first, filter, switchMap } from 'rxjs/operators';
@@ -109,13 +109,13 @@ function FooterComponent_div_3_Template(rf, ctx) { if (rf & 1) {
109
109
  i0.ɵɵadvance(3);
110
110
  i0.ɵɵtextInterpolate(ctx_r1.workhours);
111
111
  } }
112
- const _c0$W = [[["", "footerSolsNavLinks", ""]], [["", "footerCaseWorkerNavLinks", ""]]];
112
+ const _c0$Y = [[["", "footerSolsNavLinks", ""]], [["", "footerCaseWorkerNavLinks", ""]]];
113
113
  const _c1$p = ["[footerSolsNavLinks]", "[footerCaseWorkerNavLinks]"];
114
114
  class FooterComponent {
115
115
  }
116
116
  FooterComponent.ɵfac = function FooterComponent_Factory(t) { return new (t || FooterComponent)(); };
117
117
  FooterComponent.ɵcmp = i0.ɵɵdefineComponent({ type: FooterComponent, selectors: [["cut-footer-bar"]], inputs: { email: "email", isSolicitor: "isSolicitor", phone: "phone", workhours: "workhours" }, ngContentSelectors: _c1$p, 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) {
118
- i0.ɵɵprojectionDef(_c0$W);
118
+ i0.ɵɵprojectionDef(_c0$Y);
119
119
  i0.ɵɵelementStart(0, "footer", 0);
120
120
  i0.ɵɵelementStart(1, "div", 1);
121
121
  i0.ɵɵtemplate(2, FooterComponent_div_2_Template, 15, 0, "div", 2);
@@ -182,7 +182,7 @@ function HeaderBarComponent_div_9_Template(rf, ctx) { if (rf & 1) {
182
182
  i0.ɵɵadvance(3);
183
183
  i0.ɵɵtextInterpolate(ctx_r2.title);
184
184
  } }
185
- const _c0$V = [[["", "headerNavigation", ""]]];
185
+ const _c0$X = [[["", "headerNavigation", ""]]];
186
186
  const _c1$o = ["[headerNavigation]"];
187
187
  class HeaderBarComponent {
188
188
  constructor() {
@@ -194,7 +194,7 @@ class HeaderBarComponent {
194
194
  }
195
195
  HeaderBarComponent.ɵfac = function HeaderBarComponent_Factory(t) { return new (t || HeaderBarComponent)(); };
196
196
  HeaderBarComponent.ɵcmp = i0.ɵɵdefineComponent({ type: HeaderBarComponent, selectors: [["cut-header-bar"]], inputs: { title: "title", isSolicitor: "isSolicitor", username: "username" }, outputs: { signOutRequest: "signOutRequest" }, ngContentSelectors: _c1$o, decls: 15, vars: 8, 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) {
197
- i0.ɵɵprojectionDef(_c0$V);
197
+ i0.ɵɵprojectionDef(_c0$X);
198
198
  i0.ɵɵelementStart(0, "header", 0);
199
199
  i0.ɵɵelementStart(1, "div", 1);
200
200
  i0.ɵɵelementStart(2, "div", 2);
@@ -251,13 +251,13 @@ HeaderBarComponent.ɵcmp = i0.ɵɵdefineComponent({ type: HeaderBarComponent, se
251
251
  type: Output
252
252
  }] }); })();
253
253
 
254
- const _c0$U = [[["", "leftNavLinks", ""]], [["", "rightNavLinks", ""]]];
254
+ const _c0$W = [[["", "leftNavLinks", ""]], [["", "rightNavLinks", ""]]];
255
255
  const _c1$n = ["[leftNavLinks]", "[rightNavLinks]"];
256
256
  class NavigationComponent {
257
257
  }
258
258
  NavigationComponent.ɵfac = function NavigationComponent_Factory(t) { return new (t || NavigationComponent)(); };
259
259
  NavigationComponent.ɵcmp = i0.ɵɵdefineComponent({ type: NavigationComponent, selectors: [["cut-nav-bar"]], inputs: { isSolicitor: "isSolicitor" }, ngContentSelectors: _c1$n, decls: 4, vars: 2, consts: [[1, "cut-nav-bar"]], template: function NavigationComponent_Template(rf, ctx) { if (rf & 1) {
260
- i0.ɵɵprojectionDef(_c0$U);
260
+ i0.ɵɵprojectionDef(_c0$W);
261
261
  i0.ɵɵelementStart(0, "div");
262
262
  i0.ɵɵelementStart(1, "nav", 0);
263
263
  i0.ɵɵprojection(2);
@@ -374,13 +374,13 @@ HeadersModule.ɵinj = i0.ɵɵdefineInjector({ imports: [[CommonModule, RouterMod
374
374
  }]
375
375
  }], null, null); })();
376
376
 
377
- const _c0$T = [[["", "topBody", ""]], [["", "leftBody", ""]], [["", "rightBody", ""]]];
377
+ const _c0$V = [[["", "topBody", ""]], [["", "leftBody", ""]], [["", "rightBody", ""]]];
378
378
  const _c1$m = ["[topBody]", "[leftBody]", "[rightBody]"];
379
379
  class BodyComponent {
380
380
  }
381
381
  BodyComponent.ɵfac = function BodyComponent_Factory(t) { return new (t || BodyComponent)(); };
382
382
  BodyComponent.ɵcmp = i0.ɵɵdefineComponent({ type: BodyComponent, selectors: [["cut-body"]], ngContentSelectors: _c1$m, decls: 4, vars: 0, consts: [[1, "global-display"]], template: function BodyComponent_Template(rf, ctx) { if (rf & 1) {
383
- i0.ɵɵprojectionDef(_c0$T);
383
+ i0.ɵɵprojectionDef(_c0$V);
384
384
  i0.ɵɵelementStart(0, "div", 0);
385
385
  i0.ɵɵprojection(1);
386
386
  i0.ɵɵprojection(2, 1);
@@ -397,7 +397,7 @@ BodyComponent.ɵcmp = i0.ɵɵdefineComponent({ type: BodyComponent, selectors: [
397
397
  }]
398
398
  }], null, null); })();
399
399
 
400
- const _c0$S = function (a0) { return { "govuk-input--error": a0 }; };
400
+ const _c0$U = function (a0) { return { "govuk-input--error": a0 }; };
401
401
  function DateInputComponent_div_16_Template(rf, ctx) { if (rf & 1) {
402
402
  const _r8 = i0.ɵɵgetCurrentView();
403
403
  i0.ɵɵelementStart(0, "div", 12);
@@ -413,7 +413,7 @@ function DateInputComponent_div_16_Template(rf, ctx) { if (rf & 1) {
413
413
  i0.ɵɵadvance(1);
414
414
  i0.ɵɵproperty("for", ctx_r3.hourId());
415
415
  i0.ɵɵadvance(2);
416
- i0.ɵɵproperty("id", ctx_r3.hourId())("name", ctx_r3.hourId())("value", ctx_r3.displayHour)("ngClass", i0.ɵɵpureFunction1(5, _c0$S, ctx_r3.isInvalid));
416
+ i0.ɵɵproperty("id", ctx_r3.hourId())("name", ctx_r3.hourId())("value", ctx_r3.displayHour)("ngClass", i0.ɵɵpureFunction1(5, _c0$U, ctx_r3.isInvalid));
417
417
  } }
418
418
  function DateInputComponent_div_17_Template(rf, ctx) { if (rf & 1) {
419
419
  const _r13 = i0.ɵɵgetCurrentView();
@@ -430,7 +430,7 @@ function DateInputComponent_div_17_Template(rf, ctx) { if (rf & 1) {
430
430
  i0.ɵɵadvance(1);
431
431
  i0.ɵɵproperty("for", ctx_r4.minuteId());
432
432
  i0.ɵɵadvance(2);
433
- i0.ɵɵproperty("id", ctx_r4.minuteId())("name", ctx_r4.minuteId())("value", ctx_r4.displayMinute)("ngClass", i0.ɵɵpureFunction1(5, _c0$S, ctx_r4.isInvalid));
433
+ i0.ɵɵproperty("id", ctx_r4.minuteId())("name", ctx_r4.minuteId())("value", ctx_r4.displayMinute)("ngClass", i0.ɵɵpureFunction1(5, _c0$U, ctx_r4.isInvalid));
434
434
  } }
435
435
  function DateInputComponent_div_18_Template(rf, ctx) { if (rf & 1) {
436
436
  const _r18 = i0.ɵɵgetCurrentView();
@@ -447,7 +447,7 @@ function DateInputComponent_div_18_Template(rf, ctx) { if (rf & 1) {
447
447
  i0.ɵɵadvance(1);
448
448
  i0.ɵɵproperty("for", ctx_r5.secondId());
449
449
  i0.ɵɵadvance(2);
450
- i0.ɵɵproperty("id", ctx_r5.secondId())("name", ctx_r5.secondId())("value", ctx_r5.displaySecond)("ngClass", i0.ɵɵpureFunction1(5, _c0$S, ctx_r5.isInvalid));
450
+ i0.ɵɵproperty("id", ctx_r5.secondId())("name", ctx_r5.secondId())("value", ctx_r5.displaySecond)("ngClass", i0.ɵɵpureFunction1(5, _c0$U, ctx_r5.isInvalid));
451
451
  } }
452
452
  class DateInputComponent {
453
453
  constructor() {
@@ -676,15 +676,15 @@ DateInputComponent.ɵcmp = i0.ɵɵdefineComponent({ type: DateInputComponent, se
676
676
  i0.ɵɵadvance(2);
677
677
  i0.ɵɵproperty("for", ctx.dayId());
678
678
  i0.ɵɵadvance(2);
679
- i0.ɵɵproperty("id", ctx.dayId())("name", ctx.dayId())("value", ctx.displayDay)("ngClass", i0.ɵɵpureFunction1(18, _c0$S, ctx.isInvalid));
679
+ i0.ɵɵproperty("id", ctx.dayId())("name", ctx.dayId())("value", ctx.displayDay)("ngClass", i0.ɵɵpureFunction1(18, _c0$U, ctx.isInvalid));
680
680
  i0.ɵɵadvance(3);
681
681
  i0.ɵɵproperty("for", ctx.monthId());
682
682
  i0.ɵɵadvance(2);
683
- i0.ɵɵproperty("id", ctx.monthId())("name", ctx.monthId())("value", ctx.displayMonth)("ngClass", i0.ɵɵpureFunction1(20, _c0$S, ctx.isInvalid));
683
+ i0.ɵɵproperty("id", ctx.monthId())("name", ctx.monthId())("value", ctx.displayMonth)("ngClass", i0.ɵɵpureFunction1(20, _c0$U, ctx.isInvalid));
684
684
  i0.ɵɵadvance(3);
685
685
  i0.ɵɵproperty("for", ctx.yearId());
686
686
  i0.ɵɵadvance(2);
687
- i0.ɵɵproperty("id", ctx.yearId())("name", ctx.yearId())("value", ctx.displayYear)("ngClass", i0.ɵɵpureFunction1(22, _c0$S, ctx.isInvalid));
687
+ i0.ɵɵproperty("id", ctx.yearId())("name", ctx.yearId())("value", ctx.displayYear)("ngClass", i0.ɵɵpureFunction1(22, _c0$U, ctx.isInvalid));
688
688
  i0.ɵɵadvance(2);
689
689
  i0.ɵɵproperty("ngIf", ctx.isDateTime);
690
690
  i0.ɵɵadvance(1);
@@ -754,7 +754,7 @@ function AlertComponent_ng_container_5_Template(rf, ctx) { if (rf & 1) {
754
754
  i0.ɵɵelementEnd();
755
755
  i0.ɵɵelementContainerEnd();
756
756
  } }
757
- const _c0$R = ["*"];
757
+ const _c0$T = ["*"];
758
758
  var AlertMessageType;
759
759
  (function (AlertMessageType) {
760
760
  AlertMessageType["WARNING"] = "warning";
@@ -774,7 +774,7 @@ AlertComponent.TYPE_SUCCESS = 'success';
774
774
  AlertComponent.TYPE_ERROR = 'error';
775
775
  AlertComponent.TYPE_INFORMATION = 'information';
776
776
  AlertComponent.ɵfac = function AlertComponent_Factory(t) { return new (t || AlertComponent)(); };
777
- AlertComponent.ɵcmp = i0.ɵɵdefineComponent({ type: AlertComponent, selectors: [["cut-alert"]], inputs: { type: "type", showIcon: "showIcon" }, ngContentSelectors: _c0$R, decls: 10, vars: 10, 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) {
777
+ AlertComponent.ɵcmp = i0.ɵɵdefineComponent({ type: AlertComponent, selectors: [["cut-alert"]], inputs: { type: "type", showIcon: "showIcon" }, ngContentSelectors: _c0$T, decls: 10, vars: 10, 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) {
778
778
  i0.ɵɵprojectionDef();
779
779
  i0.ɵɵelementStart(0, "div", 0);
780
780
  i0.ɵɵelementContainerStart(1, 1);
@@ -1005,7 +1005,7 @@ NotificationBannerComponent.ɵcmp = i0.ɵɵdefineComponent({ type: NotificationB
1005
1005
  type: Output
1006
1006
  }] }); })();
1007
1007
 
1008
- const _c0$Q = function (a0) { return { "js-hidden": a0 }; };
1008
+ const _c0$S = function (a0) { return { "js-hidden": a0 }; };
1009
1009
  const _c1$l = ["*"];
1010
1010
  class TabComponent {
1011
1011
  }
@@ -1016,7 +1016,7 @@ TabComponent.ɵcmp = i0.ɵɵdefineComponent({ type: TabComponent, selectors: [["
1016
1016
  i0.ɵɵprojection(1);
1017
1017
  i0.ɵɵelementEnd();
1018
1018
  } if (rf & 2) {
1019
- i0.ɵɵproperty("id", ctx.id)("ngClass", i0.ɵɵpureFunction1(3, _c0$Q, !ctx.selected));
1019
+ i0.ɵɵproperty("id", ctx.id)("ngClass", i0.ɵɵpureFunction1(3, _c0$S, !ctx.selected));
1020
1020
  i0.ɵɵattribute("aria-hidden", !ctx.selected);
1021
1021
  } }, directives: [i1.NgClass], styles: [".tabs-toggle[_ngcontent-%COMP%]{display:block;padding:10px 15px 3px;margin-bottom:8px}.tabs-toggle[aria-selected=true][_ngcontent-%COMP%]{color:#0b0c0c;text-decoration:none;border-bottom:none}.tabs-toggle[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#005ea5}@media (max-width:640px){.tabs-list[_ngcontent-%COMP%]{border-bottom:1px solid #bfc1c3;margin-left:-15px;margin-right:-15px}.tabs-toggle[_ngcontent-%COMP%]{border-top:1px solid #bfc1c3}.tabs-toggle[_ngcontent-%COMP%]:focus{color:#0b0c0c;outline:none}}@media (min-width:641px){.tabs-panel[_ngcontent-%COMP%]{border-top:1px solid #bfc1c3;clear:both;overflow:hidden}.tabs-list[_ngcontent-%COMP%]{float:left}.tabs-list-item[_ngcontent-%COMP%]{float:left;position:relative;bottom:-1px;padding-top:10px}.tabs-toggle[_ngcontent-%COMP%]{background-color:#dee0e2;border:1px solid transparent;float:left;margin:0 6px 0 0;text-decoration:none}.tabs-toggle[_ngcontent-%COMP%]:visited{color:#005ea5}.tabs-toggle-selected[_ngcontent-%COMP%], .tabs-toggle[aria-selected=true][_ngcontent-%COMP%]{background-color:#fff;border-bottom:0;border-color:#bfc1c3;padding-bottom:11px;margin-bottom:0;color:#0b0c0c}}"] });
1022
1022
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TabComponent, [{
@@ -1036,7 +1036,7 @@ TabComponent.ɵcmp = i0.ɵɵdefineComponent({ type: TabComponent, selectors: [["
1036
1036
  type: Input
1037
1037
  }] }); })();
1038
1038
 
1039
- const _c0$P = ["tab"];
1039
+ const _c0$R = ["tab"];
1040
1040
  const _c1$k = function () { return ["."]; };
1041
1041
  const _c2$3 = function (a0) { return { "tabs-toggle-selected": a0 }; };
1042
1042
  function TabsComponent_li_2_Template(rf, ctx) { if (rf & 1) {
@@ -1081,7 +1081,7 @@ TabsComponent.ɵcmp = i0.ɵɵdefineComponent({ type: TabsComponent, selectors: [
1081
1081
  let _t;
1082
1082
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.panels = _t);
1083
1083
  } }, viewQuery: function TabsComponent_Query(rf, ctx) { if (rf & 1) {
1084
- i0.ɵɵviewQuery(_c0$P, 1);
1084
+ i0.ɵɵviewQuery(_c0$R, 1);
1085
1085
  } if (rf & 2) {
1086
1086
  let _t;
1087
1087
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.tabs = _t);
@@ -1146,7 +1146,7 @@ TabsModule.ɵinj = i0.ɵɵdefineInjector({ imports: [[
1146
1146
  }]
1147
1147
  }], null, null); })();
1148
1148
 
1149
- const _c0$O = function (a0, a1) { return { caseLocked: a0, someoneViewing: a1 }; };
1149
+ const _c0$Q = function (a0, a1) { return { caseLocked: a0, someoneViewing: a1 }; };
1150
1150
  class ActivityBannerComponent {
1151
1151
  constructor() { }
1152
1152
  ngOnInit() {
@@ -1163,7 +1163,7 @@ ActivityBannerComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ActivityBannerCom
1163
1163
  i0.ɵɵelementEnd();
1164
1164
  i0.ɵɵelementEnd();
1165
1165
  } if (rf & 2) {
1166
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(4, _c0$O, ctx.bannerType === "editor", ctx.bannerType === "viewer"));
1166
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(4, _c0$Q, ctx.bannerType === "editor", ctx.bannerType === "viewer"));
1167
1167
  i0.ɵɵadvance(2);
1168
1168
  i0.ɵɵpropertyInterpolate("alt", ctx.description);
1169
1169
  i0.ɵɵpropertyInterpolate("src", ctx.imageLink, i0.ɵɵsanitizeUrl);
@@ -3283,6 +3283,12 @@ class FieldsUtils {
3283
3283
  static isCollectionWithValue(pageFormFields) {
3284
3284
  return pageFormFields[0]['value'] !== undefined;
3285
3285
  }
3286
+ static isLinkedCasesCaseField(caseField) {
3287
+ if (!caseField) {
3288
+ return false;
3289
+ }
3290
+ return caseField.field_type.collection_field_type.id === 'CaseLink';
3291
+ }
3286
3292
  static cloneObject(obj) {
3287
3293
  return Object.assign({}, obj);
3288
3294
  }
@@ -3481,7 +3487,7 @@ class FieldsUtils {
3481
3487
  // If the Flags CaseField has a value, it is a root-level Complex field; if it does not, it is a Flags
3482
3488
  // CaseField that is a sub-field within another Complex field, so use the currentValue value (if any)
3483
3489
  // instead. The exception to this is the "caseFlags" Flags CaseField, which will have an empty object value
3484
- // initially, because no party name is required
3490
+ // initially or could be null or undefined, because no party name is required
3485
3491
  if (caseField.value && FieldsUtils.isNonEmptyObject(caseField.value) ||
3486
3492
  caseField.id === this.caseLevelCaseFlagsFieldId) {
3487
3493
  flags.push(this.mapCaseFieldToFlagsWithFormGroupPathObject(caseField, pathToFlagsFormGroup));
@@ -3700,6 +3706,9 @@ FieldsUtils.DEFAULT_MERGE_FUNCTION = function mergeFunction(field, result) {
3700
3706
  }
3701
3707
  };
3702
3708
  FieldsUtils.LABEL_MERGE_FUNCTION = function mergeFunction(field, result) {
3709
+ if (!result) {
3710
+ result = {};
3711
+ }
3703
3712
  if (!result.hasOwnProperty(field.id)) {
3704
3713
  result[field.id] = field.value;
3705
3714
  }
@@ -4181,7 +4190,9 @@ class AbstractFormFieldComponent {
4181
4190
  }
4182
4191
  addControlToFormGroup(control, parent, replace) {
4183
4192
  if (replace) {
4184
- if (this.caseField.field_type && this.caseField.field_type.id === 'CaseLink' && this.caseField.field_type.type === 'Complex' && /^-?\d+$/.test(this.caseField.id)) {
4193
+ if (this.caseField.field_type && this.caseField.field_type.collection_field_type
4194
+ && this.caseField.field_type.collection_field_type.id === 'CaseLink'
4195
+ && this.caseField.field_type.type === 'Complex' && /^-?\d+$/.test(this.caseField.id)) {
4185
4196
  parent.setControl('CaseReference', control['controls']['CaseReference']);
4186
4197
  }
4187
4198
  else {
@@ -4434,117 +4445,6 @@ class FieldsPurger {
4434
4445
  constructor(fieldsUtils) {
4435
4446
  this.fieldsUtils = fieldsUtils;
4436
4447
  }
4437
- /**
4438
- * Deletes a field value by setting the value of the corresponding {@link FormControl} to null (or an empty array
4439
- * if the field type is `Collection`), except when the field type is `Complex` or `Document`. For `Complex` field
4440
- * types, this recursive method is called until simple or "base" field types are reached. For `Document` field
4441
- * types, its _sub-field_ `FormControl` values are set to null.
4442
- *
4443
- * @param formGroup The `FormGroup` instance containing the `FormControl` for the specified field
4444
- * @param field The `CaseField` whose value is to be deleted in the backend
4445
- * @param parentField Reference to the parent `CaseField`. Used for checking specifically where a Complex field and
4446
- * its sub-fields have `retain_hidden_value` set to `true`, but the field's parent has it set to `false` or undefined
4447
- */
4448
- deleteFieldValue(formGroup, field, parentField) {
4449
- const fieldType = field.field_type.type;
4450
- const fieldControl = formGroup.get(field.id);
4451
- if (fieldControl) {
4452
- switch (fieldType) {
4453
- case 'Complex':
4454
- /**
4455
- * If the field is a Complex type, loop over its sub-fields and call deleteFieldValue() for:
4456
- *
4457
- * * Any sub-fields where retain_hidden_value is false/undefined, if the parent field has
4458
- * retain_hidden_value = true;
4459
- * * ALL sub-fields if the parent field has retain_hidden_value = true BUT its _own_ parent has
4460
- * retain_hidden_value = false/undefined (thus overriding anything else);
4461
- * * ALL sub-fields if the parent field has retain_hidden_value = false/undefined;
4462
- * * Any Complex sub-fields *regardless of their retain_hidden_value* (in order to inspect the sub-fields
4463
- * of a Complex type within another Complex type)
4464
- */
4465
- if (field.field_type.complex_fields.length > 0) {
4466
- for (const complexSubField of field.field_type.complex_fields) {
4467
- if ((complexSubField.field_type.type === 'Complex' && complexSubField.field_type.complex_fields.length > 0) ||
4468
- (complexSubField.field_type.type !== 'Complex' &&
4469
- (field.retain_hidden_value
4470
- ? !complexSubField.retain_hidden_value || (parentField && !parentField.retain_hidden_value)
4471
- : true))) {
4472
- // The fieldControl is cast to a FormGroup because a Complex field type uses this as its underlying
4473
- // implementation
4474
- this.deleteFieldValue(fieldControl, complexSubField, field);
4475
- }
4476
- }
4477
- }
4478
- break;
4479
- case 'Collection':
4480
- // If it is a collection of Complex types, loop through each one; else fall through to be handled as a
4481
- // collection of simple types (in the same way as MultiSelectList), unless it's a collection of Document
4482
- // types, which requires different handling
4483
- const collectionFieldType = field.field_type.collection_field_type;
4484
- if (collectionFieldType.type === 'Complex' && collectionFieldType.complex_fields.length > 0) {
4485
- // Get the array of Complex field values
4486
- const complexFieldValues = fieldControl.value;
4487
- // For each Complex field value, get the ID of each sub-field within it and use as a key to find the
4488
- // corresponding sub-CaseField (which contains the field type information)
4489
- if (complexFieldValues) {
4490
- complexFieldValues.forEach((fieldValue, index) => Object.keys(fieldValue.value).forEach(subFieldId => {
4491
- // Find the sub-CaseField corresponding to the sub-field ID
4492
- let subCaseField;
4493
- for (const caseField of collectionFieldType.complex_fields) {
4494
- if (caseField.id === subFieldId) {
4495
- subCaseField = caseField;
4496
- break;
4497
- }
4498
- }
4499
- // Recursively delete the sub-field value, passing in the parent FormGroup
4500
- const parentFormGroup = fieldControl.at(index).get('value');
4501
- this.deleteFieldValue(parentFormGroup, subCaseField);
4502
- }));
4503
- }
4504
- break;
4505
- }
4506
- else if (collectionFieldType.type === 'Document') {
4507
- // Get the array of Document field values
4508
- const documentFieldValues = fieldControl.value;
4509
- // For each Document field value, set all its property values to null (this is not accepted by the
4510
- // back-end but will be handled by sanitiseObject() in FormValueService before sending - see below for
4511
- // the single Document case)
4512
- if (documentFieldValues) {
4513
- documentFieldValues.forEach((fieldValue, index) => Object.keys(fieldValue.value).forEach(subFieldId => {
4514
- // Get the FormGroup containing the FormControl for the sub-field and set its value to null
4515
- fieldControl.at(index).get(`value.${subFieldId}`).setValue(null);
4516
- }));
4517
- }
4518
- break;
4519
- }
4520
- // Omitted "break" is intentional because a collection should be handled as per MultiSelectList if it is
4521
- // not a collection of Complex types
4522
- // tslint:disable-next-line: no-switch-case-fall-through
4523
- case 'MultiSelectList':
4524
- // Field control should be a FormArray, so map each of its values to null
4525
- // NOTE: The FormArray cannot just be set to an empty array because Angular checks that all existing values
4526
- // of a FormArray are present; setting the control's value to an empty array causes a runtime error
4527
- fieldControl.setValue(fieldControl.value.map(() => null));
4528
- break;
4529
- case 'Document':
4530
- // NOTE: The field control (a FormGroup in this case) cannot just be set to null because Angular checks that
4531
- // all existing values of a FormGroup are present; setting the control's value to null causes a runtime error
4532
- const documentFieldValue = fieldControl.value;
4533
- for (const key in documentFieldValue) {
4534
- if (fieldControl.get(key)) {
4535
- // The back-end doesn't accept null as a valid value for any of the Document field type properties but
4536
- // this is handled by sanitiseObject() in FormValueService, returning a null object for the entire
4537
- // Document field, if any of its properties is null - which is accepted by the back-end
4538
- fieldControl.get(key).setValue(null);
4539
- }
4540
- }
4541
- break;
4542
- // Note: the default case applies to DynamicList fields, too
4543
- default:
4544
- fieldControl.setValue(null);
4545
- }
4546
- }
4547
- }
4548
4448
  clearHiddenFields(form, wizard, eventTrigger, currentPageId) {
4549
4449
  this.clearHiddenFieldForFieldShowCondition(currentPageId, form, wizard, eventTrigger);
4550
4450
  this.clearHiddenFieldForPageShowCondition(form, wizard, eventTrigger);
@@ -4694,6 +4594,133 @@ class FieldsPurger {
4694
4594
  isReadonly(case_field) {
4695
4595
  return case_field.display_context.toUpperCase() === 'READONLY';
4696
4596
  }
4597
+ /**
4598
+ * Deletes a field value by setting the value of the corresponding {@link FormControl} to null (or an empty array
4599
+ * if the field type is `Collection`), except when the field type is `Complex` or `Document`. For `Complex` field
4600
+ * types, this recursive method is called until simple or "base" field types are reached. For `Document` field
4601
+ * types, its _sub-field_ `FormControl` values are set to null.
4602
+ *
4603
+ * @param formGroup The `FormGroup` instance containing the `FormControl` for the specified field
4604
+ * @param field The `CaseField` whose value is to be deleted in the backend
4605
+ * @param parentField Reference to the parent `CaseField`. Used for checking specifically where a Complex field and
4606
+ * its sub-fields have `retain_hidden_value` set to `true`, but the field's parent has it set to `false` or undefined
4607
+ */
4608
+ deleteFieldValue(formGroup, field, parentField) {
4609
+ const fieldType = field.field_type.type;
4610
+ const fieldControl = formGroup.get(field.id);
4611
+ if (fieldControl) {
4612
+ switch (fieldType) {
4613
+ case 'Complex':
4614
+ /**
4615
+ * If the field is a Complex type, loop over its sub-fields and call deleteFieldValue() for:
4616
+ *
4617
+ * * Any sub-fields where retain_hidden_value is false/undefined, if the parent field has
4618
+ * retain_hidden_value = true;
4619
+ * * ALL sub-fields if the parent field has retain_hidden_value = true BUT its _own_ parent has
4620
+ * retain_hidden_value = false/undefined (thus overriding anything else);
4621
+ * * ALL sub-fields if the parent field has retain_hidden_value = false/undefined;
4622
+ * * Any Complex sub-fields *regardless of their retain_hidden_value* (in order to inspect the sub-fields
4623
+ * of a Complex type within another Complex type)
4624
+ */
4625
+ if (field.field_type.complex_fields.length > 0) {
4626
+ for (const complexSubField of field.field_type.complex_fields) {
4627
+ if ((complexSubField.field_type.type === 'Complex' && complexSubField.field_type.complex_fields.length > 0) ||
4628
+ (complexSubField.field_type.type !== 'Complex' &&
4629
+ (field.retain_hidden_value
4630
+ ? !complexSubField.retain_hidden_value || (parentField && !parentField.retain_hidden_value)
4631
+ : true))) {
4632
+ // The fieldControl is cast to a FormGroup because a Complex field type uses this as its underlying
4633
+ // implementation
4634
+ this.deleteFieldValue(fieldControl, complexSubField, field);
4635
+ }
4636
+ }
4637
+ }
4638
+ break;
4639
+ case 'Collection':
4640
+ // If it is a collection of Complex types, loop through each one; else fall through to be handled as a
4641
+ // collection of simple types (in the same way as MultiSelectList), unless it's a collection of Document
4642
+ // types, which requires different handling
4643
+ const collectionFieldType = field.field_type.collection_field_type;
4644
+ if (collectionFieldType.type === 'Complex' && collectionFieldType.complex_fields.length > 0) {
4645
+ // Get the array of Complex field values
4646
+ const complexFieldValues = fieldControl.value;
4647
+ // For each Complex field value, get the ID of each sub-field within it and use as a key to find the
4648
+ // corresponding sub-CaseField (which contains the field type information)
4649
+ if (complexFieldValues) {
4650
+ complexFieldValues.forEach((fieldValue, index) => Object.keys(fieldValue.value).forEach(subFieldId => {
4651
+ // Find the sub-CaseField corresponding to the sub-field ID
4652
+ let subCaseField;
4653
+ for (const caseField of collectionFieldType.complex_fields) {
4654
+ if (caseField.id === subFieldId) {
4655
+ subCaseField = caseField;
4656
+ break;
4657
+ }
4658
+ }
4659
+ // Recursively delete the sub-field value, passing in the parent FormGroup
4660
+ const parentFormGroup = fieldControl.at(index).get('value');
4661
+ this.deleteFieldValue(parentFormGroup, subCaseField);
4662
+ }));
4663
+ }
4664
+ break;
4665
+ }
4666
+ else if (collectionFieldType.type === 'Document') {
4667
+ // Get the array of Document field values
4668
+ const documentFieldValues = fieldControl.value;
4669
+ // For each Document field value, set all its property values to null (this is not accepted by the
4670
+ // back-end but will be handled by sanitiseObject() in FormValueService before sending - see below for
4671
+ // the single Document case)
4672
+ if (documentFieldValues) {
4673
+ documentFieldValues.forEach((fieldValue, index) => Object.keys(fieldValue.value).forEach(subFieldId => {
4674
+ // Get the FormGroup containing the FormControl for the sub-field and set its value to null
4675
+ fieldControl.at(index).get(`value.${subFieldId}`).setValue(null);
4676
+ }));
4677
+ }
4678
+ break;
4679
+ }
4680
+ // Omitted "break" is intentional because a collection should be handled as per MultiSelectList if it is
4681
+ // not a collection of Complex types
4682
+ // tslint:disable-next-line: no-switch-case-fall-through
4683
+ case 'MultiSelectList':
4684
+ // Field control should be a FormArray, so map each of its values to null
4685
+ // NOTE: The FormArray cannot just be set to an empty array because Angular checks that all existing values
4686
+ // of a FormArray are present; setting the control's value to an empty array causes a runtime error
4687
+ if (fieldControl.value) {
4688
+ // Need to allow for field values that are objects, not just primitives
4689
+ fieldControl.setValue(this.mapArrayValuesToNull(fieldControl.value));
4690
+ }
4691
+ break;
4692
+ case 'Document':
4693
+ // NOTE: The field control (a FormGroup in this case) cannot just be set to null because Angular checks that
4694
+ // all existing values of a FormGroup are present; setting the control's value to null causes a runtime error
4695
+ const documentFieldValue = fieldControl.value;
4696
+ for (const key in documentFieldValue) {
4697
+ if (fieldControl.get(key)) {
4698
+ // The back-end doesn't accept null as a valid value for any of the Document field type properties but
4699
+ // this is handled by sanitiseObject() in FormValueService, returning a null object for the entire
4700
+ // Document field, if any of its properties is null - which is accepted by the back-end
4701
+ fieldControl.get(key).setValue(null);
4702
+ }
4703
+ }
4704
+ break;
4705
+ // Note: the default case applies to DynamicList fields, too
4706
+ default:
4707
+ fieldControl.setValue(null);
4708
+ }
4709
+ }
4710
+ }
4711
+ /**
4712
+ * Maps all values of an array to `null`, retaining keys for any values that are objects. For example,
4713
+ * `[{ id: '0', value: 'Test' }, 'Test']` would become `[{ id: null, value: null }, null]`.
4714
+ * @param array The array of values to map
4715
+ * @returns A new array with the mapped values
4716
+ */
4717
+ mapArrayValuesToNull(array) {
4718
+ return array.map(element => {
4719
+ return typeof element === 'object'
4720
+ ? Object.assign({}, ...Object.keys(element).map(k => ({ [k]: null })))
4721
+ : null;
4722
+ });
4723
+ }
4697
4724
  }
4698
4725
  FieldsPurger.ɵfac = function FieldsPurger_Factory(t) { return new (t || FieldsPurger)(i0.ɵɵinject(FieldsUtils)); };
4699
4726
  FieldsPurger.ɵprov = i0.ɵɵdefineInjectable({ token: FieldsPurger, factory: FieldsPurger.ɵfac });
@@ -5271,14 +5298,16 @@ class FormValueService {
5271
5298
  // (or sub-fields of Complex fields in a collection)
5272
5299
  caseFields.filter(caseField => !FieldsUtils.isFlagLauncherCaseField(caseField))
5273
5300
  .forEach(caseField => {
5274
- if (data[caseField.id]) {
5301
+ // Ensure that the data object is populated for all case field IDs it contains, even if there is currently
5302
+ // nothing for a given case field ID (hence the use of hasOwnProperty())
5303
+ if (data.hasOwnProperty(caseField.id) && caseField.value) {
5304
+ // Create new object for the case field ID within the data object, if necessary
5305
+ if (!data[caseField.id]) {
5306
+ data[caseField.id] = {};
5307
+ }
5275
5308
  // Copy all values from the corresponding CaseField; this ensures all nested flag data (for example, a
5276
5309
  // Flags field within a Complex field or a collection of Complex fields) is copied across
5277
- Object.keys(data[caseField.id]).forEach(key => {
5278
- if (caseField.value.hasOwnProperty(key)) {
5279
- data[caseField.id][key] = caseField.value[key];
5280
- }
5281
- });
5310
+ Object.keys(caseField.value).forEach(key => data[caseField.id][key] = caseField.value[key]);
5282
5311
  }
5283
5312
  });
5284
5313
  }
@@ -6018,7 +6047,7 @@ FormErrorService.ɵprov = i0.ɵɵdefineInjectable({ token: FormErrorService, fac
6018
6047
  type: Injectable
6019
6048
  }], null, null); })();
6020
6049
 
6021
- class JurisdictionService {
6050
+ class JurisdictionService$1 {
6022
6051
  constructor(httpService) {
6023
6052
  this.httpService = httpService;
6024
6053
  this.selectedJurisdictionSource = new Subject();
@@ -6034,9 +6063,9 @@ class JurisdictionService {
6034
6063
  return this.httpService.post('api/prd/judicial/searchJudicialUserByPersonalCodes', { personal_code: personalCodes });
6035
6064
  }
6036
6065
  }
6037
- JurisdictionService.ɵfac = function JurisdictionService_Factory(t) { return new (t || JurisdictionService)(i0.ɵɵinject(HttpService)); };
6038
- JurisdictionService.ɵprov = i0.ɵɵdefineInjectable({ token: JurisdictionService, factory: JurisdictionService.ɵfac });
6039
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(JurisdictionService, [{
6066
+ JurisdictionService$1.ɵfac = function JurisdictionService_Factory(t) { return new (t || JurisdictionService$1)(i0.ɵɵinject(HttpService)); };
6067
+ JurisdictionService$1.ɵprov = i0.ɵɵdefineInjectable({ token: JurisdictionService$1, factory: JurisdictionService$1.ɵfac });
6068
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(JurisdictionService$1, [{
6040
6069
  type: Injectable
6041
6070
  }], function () { return [{ type: HttpService }]; }, null); })();
6042
6071
 
@@ -6269,6 +6298,13 @@ class SearchService {
6269
6298
  .get(url, options)
6270
6299
  .pipe(map(response => response), finalize(() => this.loadingService.unregister(loadingToken)));
6271
6300
  }
6301
+ searchCasesByIds(caseTypeId, filter, view, sort) {
6302
+ const url = this.appConfig.getCaseDataUrl() +
6303
+ `/internal/searchCases?ctid=${caseTypeId}&use_case=${view}`;
6304
+ const body = Object.assign(Object.assign({ sort }, filter), { size: this.appConfig.getPaginationPageSize() });
6305
+ const loadingToken = this.loadingService.register();
6306
+ return this.httpService.post(url, body).pipe(map((response) => response), finalize(() => this.loadingService.unregister(loadingToken)));
6307
+ }
6272
6308
  searchCases(caseTypeId, metaCriteria, caseCriteria, view, sort) {
6273
6309
  const url = this.appConfig.getCaseDataUrl() + `/internal/searchCases?ctid=${caseTypeId}&use_case=${view}`;
6274
6310
  const options = this.requestOptionsBuilder.buildOptions(metaCriteria, caseCriteria, view);
@@ -7086,19 +7122,46 @@ class CasesService {
7086
7122
  return throwError(error);
7087
7123
  }), finalize(() => this.loadingService.unregister(loadingToken)));
7088
7124
  }
7089
- getEventTrigger(caseTypeId, eventTriggerId, caseId, ignoreWarning) {
7090
- ignoreWarning = undefined !== ignoreWarning ? ignoreWarning : 'false';
7091
- const url = this.buildEventTriggerUrl(caseTypeId, eventTriggerId, caseId, ignoreWarning);
7092
- let headers = new HttpHeaders();
7093
- headers = headers.set('experimental', 'true');
7094
- headers = headers.set('Content-Type', 'application/json');
7095
- if (Draft.isDraft(caseId)) {
7096
- headers = headers.set('Accept', CasesService.V2_MEDIATYPE_START_DRAFT_TRIGGER);
7097
- }
7098
- else if (caseId !== undefined && caseId !== null) {
7099
- headers = headers.set('Accept', CasesService.V2_MEDIATYPE_START_EVENT_TRIGGER);
7100
- }
7101
- else {
7125
+ /**
7126
+ * TODO: Gets case link responses
7127
+ * @returns case link responses
7128
+ */
7129
+ getCaseLinkResponses() {
7130
+ const headers = new HttpHeaders()
7131
+ .set('experimental', 'true')
7132
+ .set('Accept', CasesService.V2_MEDIATYPE_CASE_VIEW)
7133
+ .set('Content-Type', 'application/json');
7134
+ const loadingToken = this.loadingService.register();
7135
+ return this.http
7136
+ .get('assets/getCaseReasons.json', { headers, observe: 'body' })
7137
+ .pipe(map((reasons) => {
7138
+ return reasons.sort((reasonA, reasonB) => reasonA.value_en > reasonB.value_en ? 1 : -1);
7139
+ }), catchError(error => {
7140
+ this.errorService.setError(error);
7141
+ return throwError(error);
7142
+ }), finalize(() => this.loadingService.unregister(loadingToken)));
7143
+ }
7144
+ getLinkedCases(caseId) {
7145
+ const url = `${this.appConfig.getCaseDataStoreApiUrl()}/${caseId}`;
7146
+ return this.http
7147
+ .get(url)
7148
+ .pipe(catchError(error => {
7149
+ return throwError(error);
7150
+ }));
7151
+ }
7152
+ getEventTrigger(caseTypeId, eventTriggerId, caseId, ignoreWarning) {
7153
+ ignoreWarning = undefined !== ignoreWarning ? ignoreWarning : 'false';
7154
+ const url = this.buildEventTriggerUrl(caseTypeId, eventTriggerId, caseId, ignoreWarning);
7155
+ let headers = new HttpHeaders();
7156
+ headers = headers.set('experimental', 'true');
7157
+ headers = headers.set('Content-Type', 'application/json');
7158
+ if (Draft.isDraft(caseId)) {
7159
+ headers = headers.set('Accept', CasesService.V2_MEDIATYPE_START_DRAFT_TRIGGER);
7160
+ }
7161
+ else if (caseId !== undefined && caseId !== null) {
7162
+ headers = headers.set('Accept', CasesService.V2_MEDIATYPE_START_EVENT_TRIGGER);
7163
+ }
7164
+ else {
7102
7165
  headers = headers.set('Accept', CasesService.V2_MEDIATYPE_START_CASE_TRIGGER);
7103
7166
  }
7104
7167
  return this.http
@@ -7853,7 +7916,8 @@ class PageValidationService {
7853
7916
  .filter(caseField => !this.isHidden(caseField, editForm))
7854
7917
  .every(caseField => {
7855
7918
  const theControl = editForm.controls['data'].get(caseField.id);
7856
- return this.checkDocumentField(caseField, theControl) && this.checkOptionalField(caseField, theControl);
7919
+ return this.checkDocumentField(caseField, theControl) && this.checkOptionalField(caseField, theControl) &&
7920
+ this.checkCaseLinksCollectionField(caseField, theControl);
7857
7921
  });
7858
7922
  }
7859
7923
  isHidden(caseField, editForm, path) {
@@ -7881,6 +7945,13 @@ class PageValidationService {
7881
7945
  checkMandatoryField(caseField, theControl) {
7882
7946
  return this.caseFieldService.isMandatory(caseField) && theControl === null;
7883
7947
  }
7948
+ checkCaseLinksCollectionField(caseField, theControl) {
7949
+ if (caseField && caseField.id === 'caseLinks') {
7950
+ return theControl && theControl.value && Array.isArray(theControl.value) &&
7951
+ theControl.value.length ? true : false;
7952
+ }
7953
+ return true;
7954
+ }
7884
7955
  }
7885
7956
  PageValidationService.ɵfac = function PageValidationService_Factory(t) { return new (t || PageValidationService)(i0.ɵɵinject(CaseFieldService)); };
7886
7957
  PageValidationService.ɵprov = i0.ɵɵdefineInjectable({ token: PageValidationService, factory: PageValidationService.ɵfac });
@@ -8658,20 +8729,24 @@ class CaseEditPageComponent {
8658
8729
  this.validationErrors.push({ id, message: `${label} exceeds the maximum length` });
8659
8730
  fieldElement.markAsDirty();
8660
8731
  }
8732
+ else if (this.caseLinkError && FieldsUtils.isLinkedCasesCaseField(casefield)) {
8733
+ this.validationErrors.push({ id: this.caseLinkError.componentId, message: this.caseLinkError.errorMessage });
8734
+ }
8661
8735
  else if (fieldElement.invalid) {
8662
8736
  if (casefield.isComplex()) {
8663
8737
  this.generateErrorMessage(casefield.field_type.complex_fields, fieldElement, id);
8664
8738
  }
8665
8739
  else if (casefield.isCollection() && casefield.field_type.collection_field_type.type === 'Complex') {
8666
- const fieldArray = fieldElement;
8667
- if (fieldArray['component'] && fieldArray['component']['collItems'] && fieldArray['component']['collItems'].length > 0) {
8668
- fieldArray['component']['collItems'].forEach(element => {
8669
- id = `${element.prefix}`;
8670
- fieldArray.controls.forEach((control, index) => {
8671
- if (id.charAt(id.indexOf(index.toString())) === index.toString()) {
8672
- this.generateErrorMessage(casefield.field_type.collection_field_type.complex_fields, control.get('value'), id);
8673
- }
8674
- });
8740
+ if (this.caseLinkError && FieldsUtils.isLinkedCasesCaseField(casefield)) {
8741
+ this.validationErrors.push({ id: this.caseLinkError.componentId, message: this.caseLinkError.errorMessage });
8742
+ }
8743
+ else {
8744
+ const fieldArray = fieldElement;
8745
+ if (fieldArray['component'] && fieldArray['component']['collItems'] && fieldArray['component']['collItems'].length > 0) {
8746
+ id = `${fieldArray['component']['collItems'][0].prefix}`;
8747
+ }
8748
+ fieldArray.controls.forEach((c) => {
8749
+ this.generateErrorMessage(casefield.field_type.collection_field_type.complex_fields, c.get('value'), id);
8675
8750
  });
8676
8751
  }
8677
8752
  }
@@ -9361,6 +9436,10 @@ class ReadFieldsFilterPipe {
9361
9436
  && ReadFieldsFilterPipe.NESTED_TYPES[field.field_type.type](field, value);
9362
9437
  }
9363
9438
  static keepField(field, value, ignoreLabels = false) {
9439
+ // We should always render the caselinks tables from and to regardless whether it has valid value or not
9440
+ if (field.id === 'caseLinks') {
9441
+ return true;
9442
+ }
9364
9443
  // We shouldn't ditch labels.
9365
9444
  if (!ignoreLabels && field.field_type.type === 'Label' && (field.label || '').length > 0) {
9366
9445
  return true;
@@ -9625,6 +9704,172 @@ FieldsFilterPipe.ɵpipe = i0.ɵɵdefinePipe({ name: "ccdFieldsFilter", type: Fie
9625
9704
  }]
9626
9705
  }], null, null); })();
9627
9706
 
9707
+ class JurisdictionService {
9708
+ constructor(http) {
9709
+ this.http = http;
9710
+ }
9711
+ getJurisdictions() {
9712
+ const headers = new HttpHeaders({
9713
+ 'Content-Type': 'application/json',
9714
+ Accept: 'application/json'
9715
+ });
9716
+ return this.http.get('/aggregated/caseworkers/:uid/jurisdictions?access=read', { headers });
9717
+ }
9718
+ }
9719
+ JurisdictionService.ɵfac = function JurisdictionService_Factory(t) { return new (t || JurisdictionService)(i0.ɵɵinject(i1$2.HttpClient)); };
9720
+ JurisdictionService.ɵprov = i0.ɵɵdefineInjectable({ token: JurisdictionService, factory: JurisdictionService.ɵfac });
9721
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(JurisdictionService, [{
9722
+ type: Injectable
9723
+ }], function () { return [{ type: i1$2.HttpClient }]; }, null); })();
9724
+
9725
+ class LinkedCasesService {
9726
+ constructor(jurisdictionService, searchService) {
9727
+ this.jurisdictionService = jurisdictionService;
9728
+ this.searchService = searchService;
9729
+ this.caseFieldValue = [];
9730
+ this.isLinkedCasesEventTrigger = false;
9731
+ this.linkCaseReasons = [];
9732
+ this.linkedCases = [];
9733
+ this.initialCaseLinks = [];
9734
+ this.editMode = false;
9735
+ this.jurisdictionsResponse = [];
9736
+ this.serverError = null;
9737
+ this.serverLinkedApiError = null;
9738
+ this.isServerReasonCodeError = false;
9739
+ this.caseJurisdictionID = null;
9740
+ this.groupLinkedCasesByCaseType = (arrObj, key) => {
9741
+ return arrObj.reduce((rv, x) => {
9742
+ (rv[x.value[key]] = rv[x.value[key]] || []).push(x.value['CaseReference']);
9743
+ return rv;
9744
+ }, {});
9745
+ };
9746
+ this.jurisdictionService.getJurisdictions().subscribe((jurisdictions) => {
9747
+ this.jurisdictionsResponse = jurisdictions;
9748
+ }, (error) => {
9749
+ this.serverJurisdictionError = true;
9750
+ });
9751
+ }
9752
+ constructElasticSearchQuery(caseIds, size) {
9753
+ return {
9754
+ query: {
9755
+ terms: {
9756
+ reference: caseIds,
9757
+ },
9758
+ },
9759
+ size,
9760
+ };
9761
+ }
9762
+ mapResponse(esSearchCasesResponse) {
9763
+ const caseInfo = this.caseFieldValue.find(item => item.value && item.value.CaseReference === esSearchCasesResponse.case_id);
9764
+ return caseInfo && {
9765
+ caseReference: esSearchCasesResponse.case_id,
9766
+ caseName: esSearchCasesResponse.case_fields.caseNameHmctsInternal || LinkedCasesService.CASE_NAME_MISSING_TEXT,
9767
+ caseType: this.mapLookupIDToValueFromJurisdictions('CASE_TYPE', esSearchCasesResponse.case_fields['[CASE_TYPE]']),
9768
+ service: this.mapLookupIDToValueFromJurisdictions('JURISDICTION', esSearchCasesResponse.case_fields['[JURISDICTION]']),
9769
+ state: this.mapLookupIDToValueFromJurisdictions('STATE', esSearchCasesResponse.case_fields['[STATE]']),
9770
+ reasons: caseInfo.value && caseInfo.value.ReasonForLink &&
9771
+ caseInfo.value.ReasonForLink.map(reason => reason.value && reason.value.Reason),
9772
+ };
9773
+ }
9774
+ searchCasesByCaseIds(searchCasesResponse) {
9775
+ return forkJoin(searchCasesResponse);
9776
+ }
9777
+ getAllLinkedCaseInformation() {
9778
+ const searchCasesResponse = [];
9779
+ const linkedCaseIds = this.groupLinkedCasesByCaseType(this.caseFieldValue, 'CaseType');
9780
+ Object.keys(linkedCaseIds).forEach(key => {
9781
+ const esQuery = this.constructElasticSearchQuery(linkedCaseIds[key], 100);
9782
+ const query = this.searchService.searchCasesByIds(key, esQuery, SearchService.VIEW_WORKBASKET);
9783
+ searchCasesResponse.push(query);
9784
+ });
9785
+ if (searchCasesResponse.length) {
9786
+ this.searchCasesByCaseIds(searchCasesResponse).subscribe((searchCases) => {
9787
+ const casesResponse = [];
9788
+ searchCases.forEach(response => {
9789
+ response.results.forEach((result) => {
9790
+ casesResponse.push(this.mapResponse(result));
9791
+ });
9792
+ });
9793
+ const caseLinks = casesResponse.map(item => {
9794
+ return {
9795
+ caseReference: item.caseReference,
9796
+ caseName: item.caseName,
9797
+ caseService: item.service,
9798
+ caseType: item.caseType,
9799
+ unlink: false,
9800
+ reasons: item.reasons && item.reasons.map(reason => {
9801
+ return {
9802
+ reasonCode: reason
9803
+ };
9804
+ }),
9805
+ };
9806
+ });
9807
+ this.linkedCases = caseLinks;
9808
+ this.serverLinkedApiError = null;
9809
+ }, err => {
9810
+ this.serverLinkedApiError = {
9811
+ id: 'backendError', message: 'Some case information is not available at the moment'
9812
+ };
9813
+ });
9814
+ }
9815
+ }
9816
+ mapLookupIDToValueFromJurisdictions(fieldName, fieldValue) {
9817
+ const selectedJurisdiction = this.jurisdictionsResponse &&
9818
+ this.jurisdictionsResponse.find(item => item.id === this.caseDetails.case_type.jurisdiction.id);
9819
+ const selectedCaseType = selectedJurisdiction && selectedJurisdiction.caseTypes.find(item => item.id === this.caseDetails.case_type.id);
9820
+ const state = selectedCaseType && selectedCaseType.states.find(item => item.id === fieldValue);
9821
+ switch (fieldName) {
9822
+ case 'JURISDICTION':
9823
+ return selectedJurisdiction && selectedJurisdiction.description;
9824
+ case 'CASE_TYPE':
9825
+ return selectedCaseType && selectedCaseType.name;
9826
+ case 'CASE_TYPE_DESCRIPTION':
9827
+ return selectedCaseType && selectedCaseType.description;
9828
+ case 'STATE':
9829
+ return state && state.name || fieldValue;
9830
+ case 'STATE_DESCRIPTION':
9831
+ return state && state.description || fieldValue;
9832
+ default:
9833
+ break;
9834
+ }
9835
+ }
9836
+ getCaseName(searchCasesResponse) {
9837
+ let caseName = LinkedCasesService.CASE_NAME_MISSING_TEXT;
9838
+ const tabs = searchCasesResponse.tabs.filter(tab => {
9839
+ const caseNameHmctsInternalField = tab.fields.find(field => field.id === 'caseNameHmctsInternal');
9840
+ if (caseNameHmctsInternalField) {
9841
+ caseName = caseNameHmctsInternalField.value;
9842
+ }
9843
+ });
9844
+ return caseName;
9845
+ }
9846
+ }
9847
+ LinkedCasesService.CASE_NAME_MISSING_TEXT = 'Case name missing';
9848
+ LinkedCasesService.ɵfac = function LinkedCasesService_Factory(t) { return new (t || LinkedCasesService)(i0.ɵɵinject(JurisdictionService), i0.ɵɵinject(SearchService)); };
9849
+ LinkedCasesService.ɵprov = i0.ɵɵdefineInjectable({ token: LinkedCasesService, factory: LinkedCasesService.ɵfac });
9850
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LinkedCasesService, [{
9851
+ type: Injectable
9852
+ }], function () { return [{ type: JurisdictionService }, { type: SearchService }]; }, null); })();
9853
+
9854
+ class LinkCasesReasonValuePipe {
9855
+ constructor(linkedCasesService) {
9856
+ this.linkedCasesService = linkedCasesService;
9857
+ }
9858
+ transform(reasonCode) {
9859
+ const reasonCodeMapping = this.linkedCasesService.linkCaseReasons &&
9860
+ this.linkedCasesService.linkCaseReasons.find(reason => reason.key === reasonCode);
9861
+ return reasonCodeMapping && reasonCodeMapping.value_en;
9862
+ }
9863
+ }
9864
+ LinkCasesReasonValuePipe.ɵfac = function LinkCasesReasonValuePipe_Factory(t) { return new (t || LinkCasesReasonValuePipe)(i0.ɵɵdirectiveInject(LinkedCasesService)); };
9865
+ LinkCasesReasonValuePipe.ɵpipe = i0.ɵɵdefinePipe({ name: "ccdLinkCasesReasonValue", type: LinkCasesReasonValuePipe, pure: true });
9866
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LinkCasesReasonValuePipe, [{
9867
+ type: Pipe,
9868
+ args: [{
9869
+ name: 'ccdLinkCasesReasonValue'
9870
+ }]
9871
+ }], function () { return [{ type: LinkedCasesService }]; }, null); })();
9872
+
9628
9873
  var SortOrder;
9629
9874
  (function (SortOrder) {
9630
9875
  SortOrder[SortOrder["ASCENDING"] = 0] = "ASCENDING";
@@ -9660,7 +9905,8 @@ const pipeDeclarations = [
9660
9905
  CcdCYAPageLabelFilterPipe,
9661
9906
  ReadFieldsFilterPipe,
9662
9907
  CcdTabFieldsPipe,
9663
- CcdPageFieldsPipe
9908
+ CcdPageFieldsPipe,
9909
+ LinkCasesReasonValuePipe
9664
9910
  ];
9665
9911
  class PipesModule {
9666
9912
  }
@@ -9676,14 +9922,16 @@ PipesModule.ɵinj = i0.ɵɵdefineInjector({ imports: [[
9676
9922
  CcdCYAPageLabelFilterPipe,
9677
9923
  ReadFieldsFilterPipe,
9678
9924
  CcdTabFieldsPipe,
9679
- CcdPageFieldsPipe], imports: [CommonModule], exports: [CaseReferencePipe,
9925
+ CcdPageFieldsPipe,
9926
+ LinkCasesReasonValuePipe], imports: [CommonModule], exports: [CaseReferencePipe,
9680
9927
  SortSearchResultPipe,
9681
9928
  CcdCaseTitlePipe,
9682
9929
  CcdCollectionTableCaseFieldsFilterPipe,
9683
9930
  CcdCYAPageLabelFilterPipe,
9684
9931
  ReadFieldsFilterPipe,
9685
9932
  CcdTabFieldsPipe,
9686
- CcdPageFieldsPipe] }); })();
9933
+ CcdPageFieldsPipe,
9934
+ LinkCasesReasonValuePipe] }); })();
9687
9935
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PipesModule, [{
9688
9936
  type: NgModule,
9689
9937
  args: [{
@@ -9922,7 +10170,7 @@ class AddressOption {
9922
10170
  }
9923
10171
  }
9924
10172
 
9925
- const _c0$N = ["writeComplexFieldComponent"];
10173
+ const _c0$P = ["writeComplexFieldComponent"];
9926
10174
  function WriteAddressFieldComponent_div_1_div_4_span_4_Template(rf, ctx) { if (rf & 1) {
9927
10175
  i0.ɵɵelementStart(0, "span", 14);
9928
10176
  i0.ɵɵtext(1, "Enter the Postcode");
@@ -10115,7 +10363,7 @@ class WriteAddressFieldComponent extends AbstractFieldWriteComponent {
10115
10363
  }
10116
10364
  WriteAddressFieldComponent.ɵfac = function WriteAddressFieldComponent_Factory(t) { return new (t || WriteAddressFieldComponent)(i0.ɵɵdirectiveInject(AddressesService), i0.ɵɵdirectiveInject(IsCompoundPipe)); };
10117
10365
  WriteAddressFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteAddressFieldComponent, selectors: [["ccd-write-address-field"]], viewQuery: function WriteAddressFieldComponent_Query(rf, ctx) { if (rf & 1) {
10118
- i0.ɵɵviewQuery(_c0$N, 1);
10366
+ i0.ɵɵviewQuery(_c0$P, 1);
10119
10367
  i0.ɵɵviewQuery(FocusElementDirective, 1);
10120
10368
  } if (rf & 2) {
10121
10369
  let _t;
@@ -10271,7 +10519,7 @@ function ReadCaseFlagFieldComponent_ng_container_2_div_4_Template(rf, ctx) { if
10271
10519
  } if (rf & 2) {
10272
10520
  const ctx_r3 = i0.ɵɵnextContext(2);
10273
10521
  i0.ɵɵadvance(1);
10274
- i0.ɵɵproperty("tableCaption", "Case level flags")("flagData", ctx_r3.caseLevelCaseFlagData)("firstColumnHeader", ctx_r3.caseLevelFirstColumnHeader);
10522
+ i0.ɵɵproperty("tableCaption", "Case level flags")("flagData", ctx_r3.caseLevelCaseFlagData)("firstColumnHeader", "Case flags");
10275
10523
  } }
10276
10524
  function ReadCaseFlagFieldComponent_ng_container_2_Template(rf, ctx) { if (rf & 1) {
10277
10525
  i0.ɵɵelementContainerStart(0);
@@ -10343,7 +10591,6 @@ class ReadCaseFlagFieldComponent extends AbstractFieldReadComponent {
10343
10591
  }
10344
10592
  }
10345
10593
  }
10346
- this.caseLevelFirstColumnHeader = this.caseNameMissing;
10347
10594
  }
10348
10595
  extractNewFlagToFlagDetailDisplayObject(selectedFlagsLocation) {
10349
10596
  // Use the pathToFlagsFormGroup property from the selected flag location to drill down to the correct part of the
@@ -10461,7 +10708,7 @@ function WriteCaseFlagFieldComponent_div_1_ng_container_7_Template(rf, ctx) { if
10461
10708
  i0.ɵɵadvance(1);
10462
10709
  i0.ɵɵproperty("formGroup", ctx_r10.caseFlagParentFormGroup)("optional", ctx_r10.flagCommentsOptional);
10463
10710
  } }
10464
- const _c0$M = function (a0) { return { "form-group-error": a0 }; };
10711
+ const _c0$O = function (a0) { return { "form-group-error": a0 }; };
10465
10712
  function WriteCaseFlagFieldComponent_div_1_Template(rf, ctx) { if (rf & 1) {
10466
10713
  i0.ɵɵelementStart(0, "div", 8);
10467
10714
  i0.ɵɵelementStart(1, "div", 9);
@@ -10480,7 +10727,7 @@ function WriteCaseFlagFieldComponent_div_1_Template(rf, ctx) { if (rf & 1) {
10480
10727
  i0.ɵɵadvance(1);
10481
10728
  i0.ɵɵproperty("ngSwitch", ctx_r1.fieldState);
10482
10729
  i0.ɵɵadvance(1);
10483
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c0$M, ctx_r1.errorMessages.length > 0));
10730
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c0$O, ctx_r1.errorMessages.length > 0));
10484
10731
  i0.ɵɵadvance(1);
10485
10732
  i0.ɵɵtextInterpolate1(" ", ctx_r1.createFlagCaption, " ");
10486
10733
  i0.ɵɵadvance(1);
@@ -10687,15 +10934,19 @@ class WriteCaseFlagFieldComponent extends AbstractFieldWriteComponent {
10687
10934
  if (path.indexOf('.') > -1) {
10688
10935
  path.slice(path.indexOf('.') + 1).split('.').forEach(part => flagsCaseFieldValue = flagsCaseFieldValue[part]);
10689
10936
  }
10690
- if (flagsCaseFieldValue) {
10691
- // Create a details array if one does not exist
10692
- if (!flagsCaseFieldValue.hasOwnProperty('details')) {
10693
- flagsCaseFieldValue.details = [];
10694
- }
10695
- // Populate new FlagDetail instance and add to the Flags data within the CaseField instance of the selected flag
10696
- // location
10697
- flagsCaseFieldValue.details.push({ value: this.populateNewFlagDetailInstance() });
10937
+ // If the CaseField for the selected flags location has no value, set it to an empty object so it can be populated
10938
+ // with flag details
10939
+ if (!flagsCaseFieldValue) {
10940
+ this.selectedFlagsLocation.caseField.value = {};
10941
+ flagsCaseFieldValue = this.selectedFlagsLocation.caseField.value;
10698
10942
  }
10943
+ // Create a details array if one does not exist
10944
+ if (!flagsCaseFieldValue.hasOwnProperty('details')) {
10945
+ flagsCaseFieldValue.details = [];
10946
+ }
10947
+ // Populate new FlagDetail instance and add to the Flags data within the CaseField instance of the selected flag
10948
+ // location
10949
+ flagsCaseFieldValue.details.push({ value: this.populateNewFlagDetailInstance() });
10699
10950
  }
10700
10951
  updateFlagInCollection() {
10701
10952
  // Ensure no more than one flag is being updated at a time, by iterating through each Flags case field and resetting
@@ -10832,8 +11083,8 @@ WriteCaseFlagFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteCaseFlag
10832
11083
  }], function () { return [{ type: i1$1.ActivatedRoute }]; }, null); })();
10833
11084
 
10834
11085
  function ReadCaseLinkFieldComponent_a_0_Template(rf, ctx) { if (rf & 1) {
10835
- i0.ɵɵelementStart(0, "a", 1);
10836
- i0.ɵɵelementStart(1, "span", 2);
11086
+ i0.ɵɵelementStart(0, "a", 2);
11087
+ i0.ɵɵelementStart(1, "span", 3);
10837
11088
  i0.ɵɵtext(2);
10838
11089
  i0.ɵɵpipe(3, "ccdCaseReference");
10839
11090
  i0.ɵɵelementEnd();
@@ -10844,71 +11095,112 @@ function ReadCaseLinkFieldComponent_a_0_Template(rf, ctx) { if (rf & 1) {
10844
11095
  i0.ɵɵadvance(2);
10845
11096
  i0.ɵɵtextInterpolate(ctx_r0.caseField.value.CaseReference ? i0.ɵɵpipeBind1(3, 2, ctx_r0.caseField.value.CaseReference) : "");
10846
11097
  } }
11098
+ function ReadCaseLinkFieldComponent_ng_container_1_Template(rf, ctx) { if (rf & 1) {
11099
+ i0.ɵɵelementContainerStart(0);
11100
+ i0.ɵɵelement(1, "ccd-read-linked-cases", 4);
11101
+ i0.ɵɵelementContainerEnd();
11102
+ } if (rf & 2) {
11103
+ const ctx_r1 = i0.ɵɵnextContext();
11104
+ i0.ɵɵadvance(1);
11105
+ i0.ɵɵproperty("caseField", ctx_r1.caseField);
11106
+ } }
10847
11107
  class ReadCaseLinkFieldComponent extends AbstractFieldReadComponent {
11108
+ constructor() {
11109
+ super(...arguments);
11110
+ this.paletteContext = PaletteContext;
11111
+ }
10848
11112
  hasReference() {
10849
11113
  return this.caseField.value && this.caseField.value.CaseReference;
10850
11114
  }
11115
+ hasCaseLinkCollection() {
11116
+ return (this.caseField.field_type &&
11117
+ this.caseField.field_type.type === 'Collection' &&
11118
+ this.caseField.field_type.collection_field_type.id === 'CaseLink');
11119
+ }
10851
11120
  }
10852
11121
  ReadCaseLinkFieldComponent.ɵfac = function ReadCaseLinkFieldComponent_Factory(t) { return ɵReadCaseLinkFieldComponent_BaseFactory(t || ReadCaseLinkFieldComponent); };
10853
- ReadCaseLinkFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ReadCaseLinkFieldComponent, selectors: [["ccd-read-case-link-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["target", "_blank", 3, "href", 4, "ngIf"], ["target", "_blank", 3, "href"], [1, "text-16"]], template: function ReadCaseLinkFieldComponent_Template(rf, ctx) { if (rf & 1) {
11122
+ ReadCaseLinkFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ReadCaseLinkFieldComponent, selectors: [["ccd-read-case-link-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 2, vars: 2, consts: [["target", "_blank", 3, "href", 4, "ngIf"], [4, "ngIf"], ["target", "_blank", 3, "href"], [1, "text-16"], [3, "caseField"]], template: function ReadCaseLinkFieldComponent_Template(rf, ctx) { if (rf & 1) {
10854
11123
  i0.ɵɵtemplate(0, ReadCaseLinkFieldComponent_a_0_Template, 4, 4, "a", 0);
11124
+ i0.ɵɵtemplate(1, ReadCaseLinkFieldComponent_ng_container_1_Template, 2, 1, "ng-container", 1);
10855
11125
  } if (rf & 2) {
10856
11126
  i0.ɵɵproperty("ngIf", ctx.hasReference());
10857
- } }, directives: [i1.NgIf], pipes: [CaseReferencePipe], encapsulation: 2 });
11127
+ i0.ɵɵadvance(1);
11128
+ i0.ɵɵproperty("ngIf", ctx.hasCaseLinkCollection());
11129
+ } }, encapsulation: 2 });
10858
11130
  const ɵReadCaseLinkFieldComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(ReadCaseLinkFieldComponent);
10859
11131
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ReadCaseLinkFieldComponent, [{
10860
11132
  type: Component,
10861
11133
  args: [{
10862
11134
  selector: 'ccd-read-case-link-field',
10863
- templateUrl: 'read-case-link-field.html'
11135
+ templateUrl: 'read-case-link-field.html',
10864
11136
  }]
10865
11137
  }], null, null); })();
10866
11138
 
10867
- const _c0$L = ["writeComplexFieldComponent"];
10868
- function WriteCaseLinkFieldComponent_span_2_Template(rf, ctx) { if (rf & 1) {
11139
+ const _c0$N = ["writeComplexFieldComponent"];
11140
+ function WriteCaseLinkFieldComponent_div_1_span_2_Template(rf, ctx) { if (rf & 1) {
10869
11141
  i0.ɵɵelementStart(0, "span", 6);
10870
11142
  i0.ɵɵtext(1);
10871
11143
  i0.ɵɵpipe(2, "ccdFieldLabel");
10872
11144
  i0.ɵɵelementEnd();
10873
11145
  } if (rf & 2) {
10874
- const ctx_r0 = i0.ɵɵnextContext();
11146
+ const ctx_r2 = i0.ɵɵnextContext(2);
10875
11147
  i0.ɵɵadvance(1);
10876
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, ctx_r0.caseField));
11148
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, ctx_r2.caseField));
10877
11149
  } }
10878
- function WriteCaseLinkFieldComponent_span_3_Template(rf, ctx) { if (rf & 1) {
11150
+ function WriteCaseLinkFieldComponent_div_1_span_3_Template(rf, ctx) { if (rf & 1) {
10879
11151
  i0.ɵɵelementStart(0, "span", 7);
10880
11152
  i0.ɵɵtext(1);
10881
11153
  i0.ɵɵelementEnd();
10882
11154
  } if (rf & 2) {
10883
- const ctx_r1 = i0.ɵɵnextContext();
11155
+ const ctx_r3 = i0.ɵɵnextContext(2);
10884
11156
  i0.ɵɵadvance(1);
10885
- i0.ɵɵtextInterpolate(ctx_r1.caseField.hint_text);
11157
+ i0.ɵɵtextInterpolate(ctx_r3.caseField.hint_text);
10886
11158
  } }
10887
- function WriteCaseLinkFieldComponent_span_4_Template(rf, ctx) { if (rf & 1) {
10888
- i0.ɵɵelementStart(0, "span", 8);
10889
- i0.ɵɵtext(1);
10890
- i0.ɵɵpipe(2, "ccdFirstError");
11159
+ function WriteCaseLinkFieldComponent_div_1_Template(rf, ctx) { if (rf & 1) {
11160
+ i0.ɵɵelementStart(0, "div", 1);
11161
+ i0.ɵɵelementStart(1, "label", 2);
11162
+ i0.ɵɵtemplate(2, WriteCaseLinkFieldComponent_div_1_span_2_Template, 3, 3, "span", 3);
11163
+ i0.ɵɵelementEnd();
11164
+ i0.ɵɵtemplate(3, WriteCaseLinkFieldComponent_div_1_span_3_Template, 2, 1, "span", 4);
11165
+ i0.ɵɵelement(4, "input", 5);
10891
11166
  i0.ɵɵelementEnd();
10892
11167
  } if (rf & 2) {
10893
- const ctx_r2 = i0.ɵɵnextContext();
11168
+ const ctx_r0 = i0.ɵɵnextContext();
11169
+ i0.ɵɵadvance(1);
11170
+ i0.ɵɵproperty("for", ctx_r0.id());
11171
+ i0.ɵɵadvance(1);
11172
+ i0.ɵɵproperty("ngIf", ctx_r0.caseField.label);
11173
+ i0.ɵɵadvance(1);
11174
+ i0.ɵɵproperty("ngIf", ctx_r0.caseField.hint_text);
11175
+ i0.ɵɵadvance(1);
11176
+ i0.ɵɵproperty("id", ctx_r0.id())("formControl", ctx_r0.caseReferenceControl);
11177
+ } }
11178
+ function WriteCaseLinkFieldComponent_div_2_Template(rf, ctx) { if (rf & 1) {
11179
+ const _r5 = i0.ɵɵgetCurrentView();
11180
+ i0.ɵɵelementStart(0, "div", 1);
11181
+ i0.ɵɵelementStart(1, "ccd-write-linked-cases", 8);
11182
+ i0.ɵɵlistener("onLinkedCasesSelected", function WriteCaseLinkFieldComponent_div_2_Template_ccd_write_linked_cases_onLinkedCasesSelected_1_listener() { i0.ɵɵrestoreView(_r5); const ctx_r4 = i0.ɵɵnextContext(); return ctx_r4.submitLinkedCases(); });
11183
+ i0.ɵɵelementEnd();
11184
+ i0.ɵɵelementEnd();
11185
+ } if (rf & 2) {
11186
+ const ctx_r1 = i0.ɵɵnextContext();
10894
11187
  i0.ɵɵadvance(1);
10895
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(2, 1, ctx_r2.caseReferenceControl.errors, ctx_r2.caseField.label));
11188
+ i0.ɵɵproperty("caseFields", ctx_r1.caseFields)("caseField", ctx_r1.caseField)("formGroup", ctx_r1.formGroup)("caseEditPageComponent", ctx_r1.caseEditPageComponent)("isLinkedCasesJourney", ctx_r1.linkedCasesService.isLinkedCasesEventTrigger);
10896
11189
  } }
10897
- const _c1$i = function (a0) { return { "form-group-error": a0 }; };
10898
11190
  class WriteCaseLinkFieldComponent extends AbstractFieldWriteComponent {
11191
+ constructor(linkedCasesService) {
11192
+ super();
11193
+ this.linkedCasesService = linkedCasesService;
11194
+ this.caseFields = [];
11195
+ }
10899
11196
  ngOnInit() {
10900
- if (this.caseField.value) {
11197
+ this.formArray = this.registerControl(new FormArray([]), true);
11198
+ this.formArray['caseField'] = this.caseField;
11199
+ if (!this.hasCaseLinkCollection()) {
10901
11200
  this.caseLinkGroup = this.registerControl(new FormGroup({
10902
11201
  CaseReference: new FormControl(this.caseField.value.CaseReference, Validators.required),
10903
11202
  }), true);
10904
11203
  }
10905
- else {
10906
- this.caseLinkGroup = this.registerControl(new FormGroup({
10907
- CaseReference: new FormControl(null, Validators.required),
10908
- }), true);
10909
- }
10910
- this.caseReferenceControl = this.caseLinkGroup.controls['CaseReference'];
10911
- this.caseReferenceControl.setValidators(this.caseReferenceValidator());
10912
11204
  // Ensure that all sub-fields inherit the same value for retain_hidden_value as this parent; although a CaseLink
10913
11205
  // field uses the Complex type, it is meant to be treated as one field
10914
11206
  if (this.caseField && this.caseField.field_type.type === 'Complex') {
@@ -10916,6 +11208,18 @@ class WriteCaseLinkFieldComponent extends AbstractFieldWriteComponent {
10916
11208
  caseLinkSubField.retain_hidden_value = this.caseField.retain_hidden_value;
10917
11209
  }
10918
11210
  }
11211
+ this.containsCaseLinkCollection = this.hasCaseLinkCollection();
11212
+ }
11213
+ submitLinkedCases() {
11214
+ const formGroup = this.formGroup;
11215
+ if (!this.linkedCasesService.isLinkedCasesEventTrigger) {
11216
+ const unlinkedCaseRefereneIds = this.linkedCasesService.linkedCases.filter(item => item.unlink).map(item => item.caseReference);
11217
+ this.formGroup.value.caseLinks = this.linkedCasesService.caseFieldValue
11218
+ .filter(item => unlinkedCaseRefereneIds.indexOf(item.id) === -1);
11219
+ }
11220
+ else if (formGroup.value && formGroup.value.caseLinks && this.linkedCasesService.linkedCases) {
11221
+ this.formGroup.value.caseLinks = this.linkedCasesService.caseFieldValue;
11222
+ }
10919
11223
  }
10920
11224
  validCaseReference(valueString) {
10921
11225
  if (!valueString) {
@@ -10923,64 +11227,47 @@ class WriteCaseLinkFieldComponent extends AbstractFieldWriteComponent {
10923
11227
  }
10924
11228
  return new RegExp('^\\b\\d{4}[ -]?\\d{4}[ -]?\\d{4}[ -]?\\d{4}\\b$').test(valueString.trim());
10925
11229
  }
10926
- caseReferenceValidator() {
10927
- return (control) => {
10928
- if (control.value) {
10929
- if (this.validCaseReference(control.value)) {
10930
- return null;
10931
- }
10932
- return { error: 'Please use a valid 16 Digit Case Reference' };
10933
- }
10934
- else {
10935
- if (control.touched) {
10936
- return { error: 'Please use a valid 16 Digit Case Reference' };
10937
- }
10938
- }
10939
- return null;
10940
- };
11230
+ hasCaseLinkCollection() {
11231
+ return (this.caseField.field_type &&
11232
+ this.caseField.field_type.type === 'Collection' &&
11233
+ this.caseField.field_type.collection_field_type.id === 'CaseLink');
10941
11234
  }
10942
11235
  }
10943
- WriteCaseLinkFieldComponent.ɵfac = function WriteCaseLinkFieldComponent_Factory(t) { return ɵWriteCaseLinkFieldComponent_BaseFactory(t || WriteCaseLinkFieldComponent); };
11236
+ WriteCaseLinkFieldComponent.ɵfac = function WriteCaseLinkFieldComponent_Factory(t) { return new (t || WriteCaseLinkFieldComponent)(i0.ɵɵdirectiveInject(LinkedCasesService)); };
10944
11237
  WriteCaseLinkFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteCaseLinkFieldComponent, selectors: [["ccd-write-case-link-field"]], viewQuery: function WriteCaseLinkFieldComponent_Query(rf, ctx) { if (rf & 1) {
10945
- i0.ɵɵviewQuery(_c0$L, 1);
11238
+ i0.ɵɵviewQuery(_c0$N, 1);
10946
11239
  } if (rf & 2) {
10947
11240
  let _t;
10948
11241
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.writeComplexFieldComponent = _t.first);
10949
- } }, features: [i0.ɵɵInheritDefinitionFeature], decls: 6, vars: 9, consts: [[1, "form-group", 3, "ngClass"], [3, "for"], ["class", "form-label", 4, "ngIf"], ["class", "form-hint", 4, "ngIf"], ["class", "error-message", 4, "ngIf"], ["type", "text", 1, "form-control", "bottom-30", 3, "id", "formControl"], [1, "form-label"], [1, "form-hint"], [1, "error-message"]], template: function WriteCaseLinkFieldComponent_Template(rf, ctx) { if (rf & 1) {
10950
- i0.ɵɵelementStart(0, "div", 0);
10951
- i0.ɵɵelementStart(1, "label", 1);
10952
- i0.ɵɵtemplate(2, WriteCaseLinkFieldComponent_span_2_Template, 3, 3, "span", 2);
10953
- i0.ɵɵelementEnd();
10954
- i0.ɵɵtemplate(3, WriteCaseLinkFieldComponent_span_3_Template, 2, 1, "span", 3);
10955
- i0.ɵɵtemplate(4, WriteCaseLinkFieldComponent_span_4_Template, 3, 4, "span", 4);
10956
- i0.ɵɵelement(5, "input", 5);
10957
- i0.ɵɵelementEnd();
11242
+ } }, inputs: { caseFields: "caseFields", formGroup: "formGroup", caseEditPageComponent: "caseEditPageComponent" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 3, vars: 2, consts: [["class", "form-group", 4, "ngIf"], [1, "form-group"], [3, "for"], ["class", "form-label", 4, "ngIf"], ["class", "form-hint", 4, "ngIf"], ["type", "text", 1, "form-control", "bottom-30", 3, "id", "formControl"], [1, "form-label"], [1, "form-hint"], [3, "caseFields", "caseField", "formGroup", "caseEditPageComponent", "isLinkedCasesJourney", "onLinkedCasesSelected"]], template: function WriteCaseLinkFieldComponent_Template(rf, ctx) { if (rf & 1) {
11243
+ i0.ɵɵelementContainerStart(0);
11244
+ i0.ɵɵtemplate(1, WriteCaseLinkFieldComponent_div_1_Template, 5, 5, "div", 0);
11245
+ i0.ɵɵtemplate(2, WriteCaseLinkFieldComponent_div_2_Template, 2, 5, "div", 0);
11246
+ i0.ɵɵelementContainerEnd();
10958
11247
  } if (rf & 2) {
10959
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(7, _c1$i, !ctx.caseReferenceControl.valid && (ctx.caseReferenceControl.dirty || ctx.caseReferenceControl.touched)));
10960
- i0.ɵɵadvance(1);
10961
- i0.ɵɵproperty("for", ctx.id());
10962
- i0.ɵɵadvance(1);
10963
- i0.ɵɵproperty("ngIf", ctx.caseField.label);
10964
11248
  i0.ɵɵadvance(1);
10965
- i0.ɵɵproperty("ngIf", ctx.caseField.hint_text);
10966
- i0.ɵɵadvance(1);
10967
- i0.ɵɵproperty("ngIf", ctx.caseReferenceControl.errors && (ctx.caseReferenceControl.dirty || ctx.caseReferenceControl.touched));
11249
+ i0.ɵɵproperty("ngIf", !ctx.containsCaseLinkCollection);
10968
11250
  i0.ɵɵadvance(1);
10969
- i0.ɵɵproperty("id", ctx.id())("formControl", ctx.caseReferenceControl);
10970
- } }, directives: [i1.NgClass, i1.NgIf, i2.DefaultValueAccessor, i2.NgControlStatus, i2.FormControlDirective], pipes: [FieldLabelPipe, FirstErrorPipe], encapsulation: 2 });
10971
- const ɵWriteCaseLinkFieldComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(WriteCaseLinkFieldComponent);
11251
+ i0.ɵɵproperty("ngIf", ctx.containsCaseLinkCollection);
11252
+ } }, encapsulation: 2 });
10972
11253
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WriteCaseLinkFieldComponent, [{
10973
11254
  type: Component,
10974
11255
  args: [{
10975
11256
  selector: 'ccd-write-case-link-field',
10976
11257
  templateUrl: 'write-case-link-field.html'
10977
11258
  }]
10978
- }], null, { writeComplexFieldComponent: [{
11259
+ }], function () { return [{ type: LinkedCasesService }]; }, { caseFields: [{
11260
+ type: Input
11261
+ }], formGroup: [{
11262
+ type: Input
11263
+ }], caseEditPageComponent: [{
11264
+ type: Input
11265
+ }], writeComplexFieldComponent: [{
10979
11266
  type: ViewChild,
10980
11267
  args: ['writeComplexFieldComponent', /* TODO: add static flag */ {}]
10981
11268
  }] }); })();
10982
11269
 
10983
- const _c0$K = function (a0, a1, a2, a3, a4, a5) { return { id: a0, label: a1, field_type: a2, display_context_parameter: a3, value: a4, hidden: a5 }; };
11270
+ const _c0$M = function (a0, a1, a2, a3, a4, a5) { return { id: a0, label: a1, field_type: a2, display_context_parameter: a3, value: a4, hidden: a5 }; };
10984
11271
  function ReadCollectionFieldComponent_table_0_tbody_2_Template(rf, ctx) { if (rf & 1) {
10985
11272
  i0.ɵɵelementStart(0, "tbody");
10986
11273
  i0.ɵɵelementStart(1, "tr");
@@ -10993,9 +11280,9 @@ function ReadCollectionFieldComponent_table_0_tbody_2_Template(rf, ctx) { if (rf
10993
11280
  } if (rf & 2) {
10994
11281
  const ctx_r1 = i0.ɵɵnextContext(2);
10995
11282
  i0.ɵɵadvance(4);
10996
- i0.ɵɵproperty("caseField", i0.ɵɵpureFunction6(3, _c0$K, ctx_r1.caseField.label, ctx_r1.caseField.label, ctx_r1.caseField.field_type.collection_field_type, ctx_r1.caseField.display_context_parameter, ctx_r1.caseField.value, ctx_r1.caseField.hidden))("context", ctx_r1.context)("topLevelFormGroup", ctx_r1.topLevelFormGroup);
11283
+ i0.ɵɵproperty("caseField", i0.ɵɵpureFunction6(3, _c0$M, ctx_r1.caseField.label, ctx_r1.caseField.label, ctx_r1.caseField.field_type.collection_field_type, ctx_r1.caseField.display_context_parameter, ctx_r1.caseField.value, ctx_r1.caseField.hidden))("context", ctx_r1.context)("topLevelFormGroup", ctx_r1.topLevelFormGroup);
10997
11284
  } }
10998
- const _c1$h = function (a0, a1, a2, a3, a4) { return { id: a0, label: a1, field_type: a2, value: a3, hidden: a4 }; };
11285
+ const _c1$i = function (a0, a1, a2, a3, a4) { return { id: a0, label: a1, field_type: a2, value: a3, hidden: a4 }; };
10999
11286
  function ReadCollectionFieldComponent_table_0_tbody_3_tr_1_Template(rf, ctx) { if (rf & 1) {
11000
11287
  i0.ɵɵelementStart(0, "tr");
11001
11288
  i0.ɵɵelementStart(1, "td");
@@ -11007,7 +11294,7 @@ function ReadCollectionFieldComponent_table_0_tbody_3_tr_1_Template(rf, ctx) { i
11007
11294
  const i_r5 = ctx.index;
11008
11295
  const ctx_r3 = i0.ɵɵnextContext(3);
11009
11296
  i0.ɵɵadvance(2);
11010
- i0.ɵɵproperty("caseField", i0.ɵɵpureFunction5(4, _c1$h, i_r5, ctx_r3.caseField.label + " " + (i_r5 + 1), ctx_r3.caseField.field_type.collection_field_type, item_r4.value, ctx_r3.caseField.hidden))("context", ctx_r3.context)("topLevelFormGroup", ctx_r3.topLevelFormGroup)("idPrefix", ctx_r3.buildIdPrefix(i_r5));
11297
+ i0.ɵɵproperty("caseField", i0.ɵɵpureFunction5(4, _c1$i, i_r5, ctx_r3.caseField.label + " " + (i_r5 + 1), ctx_r3.caseField.field_type.collection_field_type, item_r4.value, ctx_r3.caseField.hidden))("context", ctx_r3.context)("topLevelFormGroup", ctx_r3.topLevelFormGroup)("idPrefix", ctx_r3.buildIdPrefix(i_r5));
11011
11298
  } }
11012
11299
  function ReadCollectionFieldComponent_table_0_tbody_3_Template(rf, ctx) { if (rf & 1) {
11013
11300
  i0.ɵɵelementStart(0, "tbody");
@@ -11121,7 +11408,7 @@ RemoveDialogComponent.ɵcmp = i0.ɵɵdefineComponent({ type: RemoveDialogCompone
11121
11408
  }]
11122
11409
  }], function () { return [{ type: i1$3.MatDialogRef }]; }, null); })();
11123
11410
 
11124
- const _c0$J = ["collectionItem"];
11411
+ const _c0$L = ["collectionItem"];
11125
11412
  function WriteCollectionFieldComponent_h2_7_span_1_Template(rf, ctx) { if (rf & 1) {
11126
11413
  i0.ɵɵelementStart(0, "span", 9);
11127
11414
  i0.ɵɵtext(1);
@@ -11495,7 +11782,7 @@ class WriteCollectionFieldComponent extends AbstractFieldWriteComponent {
11495
11782
  }
11496
11783
  WriteCollectionFieldComponent.ɵfac = function WriteCollectionFieldComponent_Factory(t) { return new (t || WriteCollectionFieldComponent)(i0.ɵɵdirectiveInject(i1$3.MatDialog), i0.ɵɵdirectiveInject(i2$1.ScrollToService), i0.ɵɵdirectiveInject(ProfileNotifier)); };
11497
11784
  WriteCollectionFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteCollectionFieldComponent, selectors: [["ccd-write-collection-field"]], viewQuery: function WriteCollectionFieldComponent_Query(rf, ctx) { if (rf & 1) {
11498
- i0.ɵɵviewQuery(_c0$J, 1);
11785
+ i0.ɵɵviewQuery(_c0$L, 1);
11499
11786
  } if (rf & 2) {
11500
11787
  let _t;
11501
11788
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.items = _t);
@@ -11815,7 +12102,7 @@ FileUploadStateService.ɵprov = i0.ɵɵdefineInjectable({ token: FileUploadState
11815
12102
  type: Injectable
11816
12103
  }], null, null); })();
11817
12104
 
11818
- const _c0$I = ["fileInput"];
12105
+ const _c0$K = ["fileInput"];
11819
12106
  function WriteDocumentFieldComponent_span_6_Template(rf, ctx) { if (rf & 1) {
11820
12107
  i0.ɵɵelementStart(0, "span", 12);
11821
12108
  i0.ɵɵtext(1);
@@ -11840,7 +12127,7 @@ function WriteDocumentFieldComponent_ccd_read_document_field_9_Template(rf, ctx)
11840
12127
  const ctx_r2 = i0.ɵɵnextContext();
11841
12128
  i0.ɵɵproperty("caseField", ctx_r2.caseField);
11842
12129
  } }
11843
- const _c1$g = function (a0) { return { "form-group-error bottom-30": a0 }; };
12130
+ const _c1$h = function (a0) { return { "form-group-error bottom-30": a0 }; };
11844
12131
  class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
11845
12132
  constructor(appConfig, caseNotifier, documentManagement, dialog, fileUploadStateService) {
11846
12133
  super();
@@ -12093,7 +12380,7 @@ WriteDocumentFieldComponent.UPLOAD_ERROR_NOT_AVAILABLE = 'Document upload facili
12093
12380
  WriteDocumentFieldComponent.UPLOAD_WAITING_FILE_STATUS = 'Uploading...';
12094
12381
  WriteDocumentFieldComponent.ɵfac = function WriteDocumentFieldComponent_Factory(t) { return new (t || WriteDocumentFieldComponent)(i0.ɵɵdirectiveInject(AbstractAppConfig), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(DocumentManagementService), i0.ɵɵdirectiveInject(i1$3.MatDialog), i0.ɵɵdirectiveInject(FileUploadStateService)); };
12095
12382
  WriteDocumentFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteDocumentFieldComponent, selectors: [["ccd-write-document-field"]], viewQuery: function WriteDocumentFieldComponent_Query(rf, ctx) { if (rf & 1) {
12096
- i0.ɵɵviewQuery(_c0$I, 1);
12383
+ i0.ɵɵviewQuery(_c0$K, 1);
12097
12384
  } if (rf & 2) {
12098
12385
  let _t;
12099
12386
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.fileInput = _t.first);
@@ -12129,7 +12416,7 @@ WriteDocumentFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteDocument
12129
12416
  i0.ɵɵelementEnd();
12130
12417
  i0.ɵɵelementEnd();
12131
12418
  } if (rf & 2) {
12132
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(15, _c1$g, !ctx.valid));
12419
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(15, _c1$h, !ctx.valid));
12133
12420
  i0.ɵɵadvance(1);
12134
12421
  i0.ɵɵproperty("for", ctx.id());
12135
12422
  i0.ɵɵadvance(1);
@@ -12255,7 +12542,7 @@ function WriteDynamicListFieldComponent_option_9_Template(rf, ctx) { if (rf & 1)
12255
12542
  i0.ɵɵadvance(1);
12256
12543
  i0.ɵɵtextInterpolate(type_r5.label);
12257
12544
  } }
12258
- const _c0$H = function (a0) { return { "form-group-error": a0 }; };
12545
+ const _c0$J = function (a0) { return { "form-group-error": a0 }; };
12259
12546
  class WriteDynamicListFieldComponent extends AbstractFieldWriteComponent {
12260
12547
  ngOnInit() {
12261
12548
  /**
@@ -12297,7 +12584,7 @@ WriteDynamicListFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteDynam
12297
12584
  i0.ɵɵelementEnd();
12298
12585
  i0.ɵɵelementEnd();
12299
12586
  } if (rf & 2) {
12300
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(10, _c0$H, !ctx.dynamicListFormControl.valid && (ctx.dynamicListFormControl.dirty || ctx.dynamicListFormControl.touched)));
12587
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(10, _c0$J, !ctx.dynamicListFormControl.valid && (ctx.dynamicListFormControl.dirty || ctx.dynamicListFormControl.touched)));
12301
12588
  i0.ɵɵadvance(1);
12302
12589
  i0.ɵɵproperty("for", ctx.id());
12303
12590
  i0.ɵɵadvance(1);
@@ -12418,7 +12705,7 @@ function WriteDynamicRadioListFieldComponent_span_7_Template(rf, ctx) { if (rf &
12418
12705
  i0.ɵɵadvance(1);
12419
12706
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, ctx_r3.dynamicRadioListControl.errors));
12420
12707
  } }
12421
- const _c0$G = function (a0) { return { selected: a0 }; };
12708
+ const _c0$I = function (a0) { return { selected: a0 }; };
12422
12709
  function WriteDynamicRadioListFieldComponent_div_9_Template(rf, ctx) { if (rf & 1) {
12423
12710
  i0.ɵɵelementStart(0, "div", 10);
12424
12711
  i0.ɵɵelement(1, "input", 11);
@@ -12429,7 +12716,7 @@ function WriteDynamicRadioListFieldComponent_div_9_Template(rf, ctx) { if (rf &
12429
12716
  } if (rf & 2) {
12430
12717
  const radioButton_r5 = ctx.$implicit;
12431
12718
  const ctx_r4 = i0.ɵɵnextContext();
12432
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(7, _c0$G, ctx_r4.dynamicRadioListControl.value === radioButton_r5.code));
12719
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(7, _c0$I, ctx_r4.dynamicRadioListControl.value === radioButton_r5.code));
12433
12720
  i0.ɵɵadvance(1);
12434
12721
  i0.ɵɵpropertyInterpolate("name", ctx_r4.id());
12435
12722
  i0.ɵɵproperty("id", ctx_r4.buildElementId(radioButton_r5.code))("formControl", ctx_r4.dynamicRadioListControl)("value", radioButton_r5.code);
@@ -12438,7 +12725,7 @@ function WriteDynamicRadioListFieldComponent_div_9_Template(rf, ctx) { if (rf &
12438
12725
  i0.ɵɵadvance(1);
12439
12726
  i0.ɵɵtextInterpolate(radioButton_r5.label);
12440
12727
  } }
12441
- const _c1$f = function (a0) { return { "form-group-error": a0 }; };
12728
+ const _c1$g = function (a0) { return { "form-group-error": a0 }; };
12442
12729
  class WriteDynamicRadioListFieldComponent extends AbstractFieldWriteComponent {
12443
12730
  ngOnInit() {
12444
12731
  /**
@@ -12479,7 +12766,7 @@ WriteDynamicRadioListFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: Write
12479
12766
  i0.ɵɵelementEnd();
12480
12767
  i0.ɵɵelementEnd();
12481
12768
  } if (rf & 2) {
12482
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c1$f, !ctx.dynamicRadioListControl.valid && ctx.dynamicRadioListControl.dirty))("id", ctx.id());
12769
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c1$g, !ctx.dynamicRadioListControl.valid && ctx.dynamicRadioListControl.dirty))("id", ctx.id());
12483
12770
  i0.ɵɵadvance(3);
12484
12771
  i0.ɵɵproperty("for", ctx.id());
12485
12772
  i0.ɵɵadvance(1);
@@ -12563,8 +12850,8 @@ function WriteEmailFieldComponent_span_4_Template(rf, ctx) { if (rf & 1) {
12563
12850
  i0.ɵɵadvance(1);
12564
12851
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(2, 1, ctx_r2.emailControl.errors, ctx_r2.caseField.label));
12565
12852
  } }
12566
- const _c0$F = function (a0) { return { "form-group-error": a0 }; };
12567
- const _c1$e = function (a0) { return { "govuk-input--error": a0 }; };
12853
+ const _c0$H = function (a0) { return { "form-group-error": a0 }; };
12854
+ const _c1$f = function (a0) { return { "govuk-input--error": a0 }; };
12568
12855
  class WriteEmailFieldComponent extends AbstractFieldWriteComponent {
12569
12856
  ngOnInit() {
12570
12857
  this.emailControl = this.registerControl(new FormControl(this.caseField.value));
@@ -12581,7 +12868,7 @@ WriteEmailFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteEmailFieldC
12581
12868
  i0.ɵɵelement(5, "input", 5);
12582
12869
  i0.ɵɵelementEnd();
12583
12870
  } if (rf & 2) {
12584
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c0$F, !ctx.emailControl.valid && (ctx.emailControl.dirty || ctx.emailControl.touched)));
12871
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c0$H, !ctx.emailControl.valid && (ctx.emailControl.dirty || ctx.emailControl.touched)));
12585
12872
  i0.ɵɵadvance(1);
12586
12873
  i0.ɵɵproperty("for", ctx.id());
12587
12874
  i0.ɵɵadvance(1);
@@ -12591,7 +12878,7 @@ WriteEmailFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteEmailFieldC
12591
12878
  i0.ɵɵadvance(1);
12592
12879
  i0.ɵɵproperty("ngIf", ctx.emailControl.errors && (ctx.emailControl.dirty || ctx.emailControl.touched));
12593
12880
  i0.ɵɵadvance(1);
12594
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(10, _c1$e, ctx.emailControl.errors && (ctx.emailControl.dirty || ctx.emailControl.touched)))("id", ctx.id())("formControl", ctx.emailControl);
12881
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(10, _c1$f, ctx.emailControl.errors && (ctx.emailControl.dirty || ctx.emailControl.touched)))("id", ctx.id())("formControl", ctx.emailControl);
12595
12882
  } }, directives: [i1.NgClass, i1.NgIf, i2.DefaultValueAccessor, i2.NgControlStatus, i2.FormControlDirective], pipes: [FieldLabelPipe, FirstErrorPipe], encapsulation: 2 });
12596
12883
  const ɵWriteEmailFieldComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(WriteEmailFieldComponent);
12597
12884
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WriteEmailFieldComponent, [{
@@ -12683,7 +12970,7 @@ function WriteFixedListFieldComponent_option_8_Template(rf, ctx) { if (rf & 1) {
12683
12970
  i0.ɵɵadvance(1);
12684
12971
  i0.ɵɵtextInterpolate(type_r4.label);
12685
12972
  } }
12686
- const _c0$E = function (a0) { return { "form-group-error": a0 }; };
12973
+ const _c0$G = function (a0) { return { "form-group-error": a0 }; };
12687
12974
  class WriteFixedListFieldComponent extends AbstractFieldWriteComponent {
12688
12975
  get listItems() {
12689
12976
  if (this.caseField) {
@@ -12721,7 +13008,7 @@ WriteFixedListFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteFixedLi
12721
13008
  i0.ɵɵelementEnd();
12722
13009
  i0.ɵɵelementEnd();
12723
13010
  } if (rf & 2) {
12724
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(9, _c0$E, !ctx.fixedListFormControl.valid && (ctx.fixedListFormControl.dirty || ctx.fixedListFormControl.touched)));
13011
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(9, _c0$G, !ctx.fixedListFormControl.valid && (ctx.fixedListFormControl.dirty || ctx.fixedListFormControl.touched)));
12725
13012
  i0.ɵɵadvance(1);
12726
13013
  i0.ɵɵproperty("for", ctx.id());
12727
13014
  i0.ɵɵadvance(1);
@@ -12812,7 +13099,7 @@ function WriteFixedRadioListFieldComponent_span_6_Template(rf, ctx) { if (rf & 1
12812
13099
  i0.ɵɵadvance(1);
12813
13100
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(2, 1, ctx_r2.fixedRadioListControl.errors, ctx_r2.caseField.label));
12814
13101
  } }
12815
- const _c0$D = function (a0) { return { selected: a0 }; };
13102
+ const _c0$F = function (a0) { return { selected: a0 }; };
12816
13103
  function WriteFixedRadioListFieldComponent_div_8_Template(rf, ctx) { if (rf & 1) {
12817
13104
  i0.ɵɵelementStart(0, "div", 9);
12818
13105
  i0.ɵɵelement(1, "input", 10);
@@ -12823,7 +13110,7 @@ function WriteFixedRadioListFieldComponent_div_8_Template(rf, ctx) { if (rf & 1)
12823
13110
  } if (rf & 2) {
12824
13111
  const radioButton_r4 = ctx.$implicit;
12825
13112
  const ctx_r3 = i0.ɵɵnextContext();
12826
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(7, _c0$D, ctx_r3.fixedRadioListControl.value === radioButton_r4.code));
13113
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(7, _c0$F, ctx_r3.fixedRadioListControl.value === radioButton_r4.code));
12827
13114
  i0.ɵɵadvance(1);
12828
13115
  i0.ɵɵproperty("id", ctx_r3.id() + "-" + radioButton_r4.code)("name", ctx_r3.id())("formControl", ctx_r3.fixedRadioListControl)("value", radioButton_r4.code);
12829
13116
  i0.ɵɵadvance(1);
@@ -12831,7 +13118,7 @@ function WriteFixedRadioListFieldComponent_div_8_Template(rf, ctx) { if (rf & 1)
12831
13118
  i0.ɵɵadvance(1);
12832
13119
  i0.ɵɵtextInterpolate(radioButton_r4.label);
12833
13120
  } }
12834
- const _c1$d = function (a0) { return { "form-group-error": a0 }; };
13121
+ const _c1$e = function (a0) { return { "form-group-error": a0 }; };
12835
13122
  class WriteFixedRadioListFieldComponent extends AbstractFieldWriteComponent {
12836
13123
  ngOnInit() {
12837
13124
  const notEmpty = this.caseField.value !== null && this.caseField.value !== undefined;
@@ -12855,7 +13142,7 @@ WriteFixedRadioListFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteFi
12855
13142
  i0.ɵɵelementEnd();
12856
13143
  i0.ɵɵelementEnd();
12857
13144
  } if (rf & 2) {
12858
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(7, _c1$d, !ctx.fixedRadioListControl.valid && (ctx.fixedRadioListControl.dirty || ctx.fixedRadioListControl.touched)))("id", ctx.id());
13145
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(7, _c1$e, !ctx.fixedRadioListControl.valid && (ctx.fixedRadioListControl.dirty || ctx.fixedRadioListControl.touched)))("id", ctx.id());
12859
13146
  i0.ɵɵadvance(3);
12860
13147
  i0.ɵɵproperty("for", ctx.id());
12861
13148
  i0.ɵɵadvance(1);
@@ -12921,7 +13208,7 @@ class ReadJudicialUserFieldComponent extends AbstractFieldReadComponent {
12921
13208
  }
12922
13209
  }
12923
13210
  }
12924
- ReadJudicialUserFieldComponent.ɵfac = function ReadJudicialUserFieldComponent_Factory(t) { return new (t || ReadJudicialUserFieldComponent)(i0.ɵɵdirectiveInject(JurisdictionService)); };
13211
+ ReadJudicialUserFieldComponent.ɵfac = function ReadJudicialUserFieldComponent_Factory(t) { return new (t || ReadJudicialUserFieldComponent)(i0.ɵɵdirectiveInject(JurisdictionService$1)); };
12925
13212
  ReadJudicialUserFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ReadJudicialUserFieldComponent, selectors: [["ccd-read-judicial-user-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["class", "text-16", 4, "ngIf"], [1, "text-16"]], template: function ReadJudicialUserFieldComponent_Template(rf, ctx) { if (rf & 1) {
12926
13213
  i0.ɵɵtemplate(0, ReadJudicialUserFieldComponent_span_0_Template, 2, 2, "span", 0);
12927
13214
  } if (rf & 2) {
@@ -12933,7 +13220,7 @@ ReadJudicialUserFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ReadJudici
12933
13220
  selector: 'ccd-read-judicial-user-field',
12934
13221
  templateUrl: './read-judicial-user-field.component.html'
12935
13222
  }]
12936
- }], function () { return [{ type: JurisdictionService }]; }, null); })();
13223
+ }], function () { return [{ type: JurisdictionService$1 }]; }, null); })();
12937
13224
 
12938
13225
  function WriteJudicialUserFieldComponent_span_2_Template(rf, ctx) { if (rf & 1) {
12939
13226
  i0.ɵɵelementStart(0, "span", 9);
@@ -12954,7 +13241,7 @@ function WriteJudicialUserFieldComponent_span_3_Template(rf, ctx) { if (rf & 1)
12954
13241
  i0.ɵɵadvance(1);
12955
13242
  i0.ɵɵtextInterpolate1(" ", ctx_r1.caseField.hint_text, " ");
12956
13243
  } }
12957
- const _c0$C = function (a0) { return { "hide-autocomplete": a0 }; };
13244
+ const _c0$E = function (a0) { return { "hide-autocomplete": a0 }; };
12958
13245
  function WriteJudicialUserFieldComponent_mat_option_7_Template(rf, ctx) { if (rf & 1) {
12959
13246
  const _r7 = i0.ɵɵgetCurrentView();
12960
13247
  i0.ɵɵelementStart(0, "mat-option", 11);
@@ -12964,7 +13251,7 @@ function WriteJudicialUserFieldComponent_mat_option_7_Template(rf, ctx) { if (rf
12964
13251
  } if (rf & 2) {
12965
13252
  const judicialUser_r5 = ctx.$implicit;
12966
13253
  const ctx_r3 = i0.ɵɵnextContext();
12967
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(4, _c0$C, !ctx_r3.showAutocomplete))("value", judicialUser_r5.idamId);
13254
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(4, _c0$E, !ctx_r3.showAutocomplete))("value", judicialUser_r5.idamId);
12968
13255
  i0.ɵɵadvance(1);
12969
13256
  i0.ɵɵtextInterpolate2(" ", judicialUser_r5.fullName, " (", judicialUser_r5.emailId, ") ");
12970
13257
  } }
@@ -13010,7 +13297,7 @@ class WriteJudicialUserFieldComponent extends AbstractFieldWriteComponent {
13010
13297
  }
13011
13298
  }
13012
13299
  }
13013
- WriteJudicialUserFieldComponent.ɵfac = function WriteJudicialUserFieldComponent_Factory(t) { return new (t || WriteJudicialUserFieldComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(JurisdictionService)); };
13300
+ WriteJudicialUserFieldComponent.ɵfac = function WriteJudicialUserFieldComponent_Factory(t) { return new (t || WriteJudicialUserFieldComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(JurisdictionService$1)); };
13014
13301
  WriteJudicialUserFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteJudicialUserFieldComponent, selectors: [["ccd-write-judicial-user-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 9, vars: 9, consts: [[1, "form-group", 3, "formGroup"], [3, "for"], ["class", "form-label", 4, "ngIf"], ["class", "form-hint", 4, "ngIf"], [1, "form-control", "bottom-30", 3, "id", "formControl", "matAutocomplete"], ["autoActiveFirstOption", ""], ["autoComplete", "matAutocomplete"], ["class", "select-option", 3, "ngClass", "value", "onSelectionChange", 4, "ngFor", "ngForOf"], ["class", "select-option", 4, "ngIf"], [1, "form-label"], [1, "form-hint"], [1, "select-option", 3, "ngClass", "value", "onSelectionChange"], [1, "select-option"]], template: function WriteJudicialUserFieldComponent_Template(rf, ctx) { if (rf & 1) {
13015
13302
  i0.ɵɵelementStart(0, "div", 0);
13016
13303
  i0.ɵɵelementStart(1, "label", 1);
@@ -13046,7 +13333,7 @@ WriteJudicialUserFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteJudi
13046
13333
  styleUrls: ['./write-judicial-user-field.component.scss'],
13047
13334
  templateUrl: './write-judicial-user-field.component.html'
13048
13335
  }]
13049
- }], function () { return [{ type: i1$1.ActivatedRoute }, { type: i0.ChangeDetectorRef }, { type: JurisdictionService }]; }, null); })();
13336
+ }], function () { return [{ type: i1$1.ActivatedRoute }, { type: i0.ChangeDetectorRef }, { type: JurisdictionService$1 }]; }, null); })();
13050
13337
 
13051
13338
  class LabelFieldComponent {
13052
13339
  constructor() {
@@ -13272,7 +13559,7 @@ function WriteMoneyGbpFieldComponent_span_4_Template(rf, ctx) { if (rf & 1) {
13272
13559
  i0.ɵɵadvance(1);
13273
13560
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(2, 1, ctx_r2.moneyGbpControl.errors, ctx_r2.caseField.label));
13274
13561
  } }
13275
- const _c0$B = function (a0) { return { "form-group-error": a0 }; };
13562
+ const _c0$D = function (a0) { return { "form-group-error": a0 }; };
13276
13563
  class WriteMoneyGbpFieldComponent extends AbstractFieldWriteComponent {
13277
13564
  ngOnInit() {
13278
13565
  this.moneyGbpControl = this.registerControl(new FormControl(this.caseField.value));
@@ -13295,7 +13582,7 @@ WriteMoneyGbpFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteMoneyGbp
13295
13582
  i0.ɵɵelementEnd();
13296
13583
  i0.ɵɵelementEnd();
13297
13584
  } if (rf & 2) {
13298
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(11, _c0$B, !ctx.moneyGbpControl.valid && (ctx.moneyGbpControl.dirty || ctx.moneyGbpControl.touched)));
13585
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(11, _c0$D, !ctx.moneyGbpControl.valid && (ctx.moneyGbpControl.dirty || ctx.moneyGbpControl.touched)));
13299
13586
  i0.ɵɵadvance(1);
13300
13587
  i0.ɵɵproperty("for", ctx.id());
13301
13588
  i0.ɵɵadvance(1);
@@ -13412,7 +13699,7 @@ function WriteMultiSelectListFieldComponent_ng_container_6_Template(rf, ctx) { i
13412
13699
  i0.ɵɵadvance(1);
13413
13700
  i0.ɵɵtextInterpolate(checkbox_r4.label);
13414
13701
  } }
13415
- const _c0$A = function (a0) { return { "error": a0 }; };
13702
+ const _c0$C = function (a0) { return { "error": a0 }; };
13416
13703
  class WriteMultiSelectListFieldComponent extends AbstractFieldWriteComponent {
13417
13704
  ngOnInit() {
13418
13705
  this.checkboxes = new FormArray([]);
@@ -13467,7 +13754,7 @@ WriteMultiSelectListFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteM
13467
13754
  i0.ɵɵelementEnd();
13468
13755
  i0.ɵɵelementEnd();
13469
13756
  } if (rf & 2) {
13470
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(6, _c0$A, !ctx.checkboxes.valid && (ctx.checkboxes.dirty || ctx.checkboxes.touched)))("id", ctx.id());
13757
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(6, _c0$C, !ctx.checkboxes.valid && (ctx.checkboxes.dirty || ctx.checkboxes.touched)))("id", ctx.id());
13471
13758
  i0.ɵɵadvance(3);
13472
13759
  i0.ɵɵproperty("ngIf", ctx.caseField.label);
13473
13760
  i0.ɵɵadvance(1);
@@ -13536,8 +13823,8 @@ function WriteNumberFieldComponent_span_4_Template(rf, ctx) { if (rf & 1) {
13536
13823
  i0.ɵɵadvance(1);
13537
13824
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(2, 1, ctx_r2.numberControl.errors, ctx_r2.caseField.label));
13538
13825
  } }
13539
- const _c0$z = function (a0) { return { "form-group-error": a0 }; };
13540
- const _c1$c = function (a0) { return { "govuk-input--error": a0 }; };
13826
+ const _c0$B = function (a0) { return { "form-group-error": a0 }; };
13827
+ const _c1$d = function (a0) { return { "govuk-input--error": a0 }; };
13541
13828
  class WriteNumberFieldComponent extends AbstractFieldWriteComponent {
13542
13829
  ngOnInit() {
13543
13830
  this.numberControl = this.registerControl(new FormControl(this.caseField.value));
@@ -13554,7 +13841,7 @@ WriteNumberFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteNumberFiel
13554
13841
  i0.ɵɵelement(5, "input", 5);
13555
13842
  i0.ɵɵelementEnd();
13556
13843
  } if (rf & 2) {
13557
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c0$z, !ctx.numberControl.valid && ctx.numberControl.dirty));
13844
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c0$B, !ctx.numberControl.valid && ctx.numberControl.dirty));
13558
13845
  i0.ɵɵadvance(1);
13559
13846
  i0.ɵɵproperty("for", ctx.id());
13560
13847
  i0.ɵɵadvance(1);
@@ -13564,7 +13851,7 @@ WriteNumberFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteNumberFiel
13564
13851
  i0.ɵɵadvance(1);
13565
13852
  i0.ɵɵproperty("ngIf", ctx.numberControl.errors && ctx.numberControl.dirty);
13566
13853
  i0.ɵɵadvance(1);
13567
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(10, _c1$c, ctx.numberControl.errors && ctx.numberControl.dirty))("id", ctx.id())("formControl", ctx.numberControl);
13854
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(10, _c1$d, ctx.numberControl.errors && ctx.numberControl.dirty))("id", ctx.id())("formControl", ctx.numberControl);
13568
13855
  } }, directives: [i1.NgClass, i1.NgIf, i2.NumberValueAccessor, i2.DefaultValueAccessor, i2.NgControlStatus, i2.FormControlDirective], pipes: [FieldLabelPipe, FirstErrorPipe], encapsulation: 2 });
13569
13856
  const ɵWriteNumberFieldComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(WriteNumberFieldComponent);
13570
13857
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WriteNumberFieldComponent, [{
@@ -13804,7 +14091,7 @@ function WriteOrganisationFieldComponent_fieldset_3_div_14_div_4_Template(rf, ct
13804
14091
  i0.ɵɵelementEnd();
13805
14092
  i0.ɵɵelementEnd();
13806
14093
  } }
13807
- const _c0$y = function (a0) { return { "scroll-container ": a0 }; };
14094
+ const _c0$A = function (a0) { return { "scroll-container ": a0 }; };
13808
14095
  function WriteOrganisationFieldComponent_fieldset_3_div_14_Template(rf, ctx) { if (rf & 1) {
13809
14096
  i0.ɵɵelementStart(0, "div", 26);
13810
14097
  i0.ɵɵpipe(1, "async");
@@ -13818,7 +14105,7 @@ function WriteOrganisationFieldComponent_fieldset_3_div_14_Template(rf, ctx) { i
13818
14105
  const ctx_r2 = i0.ɵɵnextContext(2);
13819
14106
  let tmp_0_0 = null;
13820
14107
  let tmp_2_0 = null;
13821
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(11, _c0$y, ((tmp_0_0 = i0.ɵɵpipeBind1(1, 3, ctx_r2.simpleOrganisations$)) == null ? null : tmp_0_0.length) > 10));
14108
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(11, _c0$A, ((tmp_0_0 = i0.ɵɵpipeBind1(1, 3, ctx_r2.simpleOrganisations$)) == null ? null : tmp_0_0.length) > 10));
13822
14109
  i0.ɵɵadvance(2);
13823
14110
  i0.ɵɵproperty("ngForOf", i0.ɵɵpipeBind1(3, 5, ctx_r2.simpleOrganisations$));
13824
14111
  i0.ɵɵadvance(2);
@@ -14217,8 +14504,8 @@ function WritePhoneUKFieldComponent_span_4_Template(rf, ctx) { if (rf & 1) {
14217
14504
  i0.ɵɵadvance(1);
14218
14505
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(2, 1, ctx_r2.phoneUkControl.errors, ctx_r2.caseField.label));
14219
14506
  } }
14220
- const _c0$x = function (a0) { return { "form-group-error": a0 }; };
14221
- const _c1$b = function (a0) { return { "govuk-input--error": a0 }; };
14507
+ const _c0$z = function (a0) { return { "form-group-error": a0 }; };
14508
+ const _c1$c = function (a0) { return { "govuk-input--error": a0 }; };
14222
14509
  class WritePhoneUKFieldComponent extends AbstractFieldWriteComponent {
14223
14510
  ngOnInit() {
14224
14511
  this.phoneUkControl = this.registerControl(new FormControl(this.caseField.value));
@@ -14235,7 +14522,7 @@ WritePhoneUKFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WritePhoneUKFi
14235
14522
  i0.ɵɵelement(5, "input", 5);
14236
14523
  i0.ɵɵelementEnd();
14237
14524
  } if (rf & 2) {
14238
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c0$x, !ctx.phoneUkControl.valid && (ctx.phoneUkControl.dirty || ctx.phoneUkControl.touched)));
14525
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c0$z, !ctx.phoneUkControl.valid && (ctx.phoneUkControl.dirty || ctx.phoneUkControl.touched)));
14239
14526
  i0.ɵɵadvance(1);
14240
14527
  i0.ɵɵproperty("for", ctx.id());
14241
14528
  i0.ɵɵadvance(1);
@@ -14245,7 +14532,7 @@ WritePhoneUKFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WritePhoneUKFi
14245
14532
  i0.ɵɵadvance(1);
14246
14533
  i0.ɵɵproperty("ngIf", ctx.phoneUkControl.errors && (ctx.phoneUkControl.dirty || ctx.phoneUkControl.touched));
14247
14534
  i0.ɵɵadvance(1);
14248
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(10, _c1$b, ctx.phoneUkControl.errors && ctx.phoneUkControl.dirty))("id", ctx.id())("formControl", ctx.phoneUkControl);
14535
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(10, _c1$c, ctx.phoneUkControl.errors && ctx.phoneUkControl.dirty))("id", ctx.id())("formControl", ctx.phoneUkControl);
14249
14536
  } }, directives: [i1.NgClass, i1.NgIf, i2.DefaultValueAccessor, i2.NgControlStatus, i2.FormControlDirective], pipes: [FieldLabelPipe, FirstErrorPipe], encapsulation: 2 });
14250
14537
  const ɵWritePhoneUKFieldComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(WritePhoneUKFieldComponent);
14251
14538
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WritePhoneUKFieldComponent, [{
@@ -14305,8 +14592,8 @@ function WriteTextAreaFieldComponent_span_4_Template(rf, ctx) { if (rf & 1) {
14305
14592
  i0.ɵɵadvance(1);
14306
14593
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(2, 1, ctx_r2.textareaControl.errors, ctx_r2.caseField.label));
14307
14594
  } }
14308
- const _c0$w = function (a0) { return { "form-group-error": a0 }; };
14309
- const _c1$a = function (a0) { return { "govuk-textarea--error": a0 }; };
14595
+ const _c0$y = function (a0) { return { "form-group-error": a0 }; };
14596
+ const _c1$b = function (a0) { return { "govuk-textarea--error": a0 }; };
14310
14597
  class WriteTextAreaFieldComponent extends AbstractFieldWriteComponent {
14311
14598
  constructor(browserService) {
14312
14599
  super();
@@ -14336,7 +14623,7 @@ WriteTextAreaFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteTextArea
14336
14623
  i0.ɵɵelementEnd();
14337
14624
  i0.ɵɵelementEnd();
14338
14625
  } if (rf & 2) {
14339
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c0$w, !ctx.textareaControl.valid && ctx.textareaControl.dirty));
14626
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c0$y, !ctx.textareaControl.valid && ctx.textareaControl.dirty));
14340
14627
  i0.ɵɵadvance(1);
14341
14628
  i0.ɵɵproperty("for", ctx.id());
14342
14629
  i0.ɵɵadvance(1);
@@ -14346,7 +14633,7 @@ WriteTextAreaFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteTextArea
14346
14633
  i0.ɵɵadvance(1);
14347
14634
  i0.ɵɵproperty("ngIf", ctx.textareaControl.errors && (ctx.textareaControl.dirty || ctx.textareaControl.touched));
14348
14635
  i0.ɵɵadvance(1);
14349
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(10, _c1$a, ctx.textareaControl.errors && (ctx.textareaControl.dirty || ctx.textareaControl.touched)))("id", ctx.id())("formControl", ctx.textareaControl);
14636
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(10, _c1$b, ctx.textareaControl.errors && (ctx.textareaControl.dirty || ctx.textareaControl.touched)))("id", ctx.id())("formControl", ctx.textareaControl);
14350
14637
  } }, directives: [i1.NgClass, i1.NgIf, i2.DefaultValueAccessor, i2.NgControlStatus, i2.FormControlDirective], pipes: [FieldLabelPipe, FirstErrorPipe], encapsulation: 2 });
14351
14638
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WriteTextAreaFieldComponent, [{
14352
14639
  type: Component,
@@ -14406,8 +14693,8 @@ function WriteTextFieldComponent_span_4_Template(rf, ctx) { if (rf & 1) {
14406
14693
  i0.ɵɵadvance(1);
14407
14694
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(2, 1, ctx_r2.textControl.errors, ctx_r2.caseField.label));
14408
14695
  } }
14409
- const _c0$v = function (a0) { return { "form-group-error": a0 }; };
14410
- const _c1$9 = function (a0) { return { "govuk-input--error": a0 }; };
14696
+ const _c0$x = function (a0) { return { "form-group-error": a0 }; };
14697
+ const _c1$a = function (a0) { return { "govuk-input--error": a0 }; };
14411
14698
  class WriteTextFieldComponent extends AbstractFieldWriteComponent {
14412
14699
  ngOnInit() {
14413
14700
  this.textControl = this.registerControl(new FormControl(this.caseField.value));
@@ -14429,7 +14716,7 @@ WriteTextFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteTextFieldCom
14429
14716
  i0.ɵɵelementEnd();
14430
14717
  i0.ɵɵelementEnd();
14431
14718
  } if (rf & 2) {
14432
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c0$v, !!ctx.textControl && !ctx.textControl.valid && (ctx.textControl.dirty || ctx.textControl.touched)));
14719
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c0$x, !!ctx.textControl && !ctx.textControl.valid && (ctx.textControl.dirty || ctx.textControl.touched)));
14433
14720
  i0.ɵɵadvance(1);
14434
14721
  i0.ɵɵproperty("for", ctx.id());
14435
14722
  i0.ɵɵadvance(1);
@@ -14439,7 +14726,7 @@ WriteTextFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteTextFieldCom
14439
14726
  i0.ɵɵadvance(1);
14440
14727
  i0.ɵɵproperty("ngIf", (ctx.textControl == null ? null : ctx.textControl.errors) && (ctx.textControl.dirty || ctx.textControl.touched));
14441
14728
  i0.ɵɵadvance(1);
14442
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(10, _c1$9, (ctx.textControl == null ? null : ctx.textControl.errors) && (ctx.textControl.dirty || ctx.textControl.touched)))("id", ctx.id())("formControl", ctx.textControl);
14729
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(10, _c1$a, (ctx.textControl == null ? null : ctx.textControl.errors) && (ctx.textControl.dirty || ctx.textControl.touched)))("id", ctx.id())("formControl", ctx.textControl);
14443
14730
  } }, directives: [i1.NgClass, i1.NgIf, i2.DefaultValueAccessor, i2.NgControlStatus, i2.FormControlDirective], pipes: [FieldLabelPipe, FirstErrorPipe], encapsulation: 2 });
14444
14731
  const ɵWriteTextFieldComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(WriteTextFieldComponent);
14445
14732
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WriteTextFieldComponent, [{
@@ -14595,7 +14882,7 @@ function WriteYesNoFieldComponent_span_5_Template(rf, ctx) { if (rf & 1) {
14595
14882
  i0.ɵɵadvance(1);
14596
14883
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(2, 1, ctx_r2.yesNoControl.errors, ctx_r2.caseField.label));
14597
14884
  } }
14598
- const _c0$u = function (a0) { return { selected: a0 }; };
14885
+ const _c0$w = function (a0) { return { selected: a0 }; };
14599
14886
  function WriteYesNoFieldComponent_div_7_Template(rf, ctx) { if (rf & 1) {
14600
14887
  i0.ɵɵelementStart(0, "div", 10);
14601
14888
  i0.ɵɵelement(1, "input", 11);
@@ -14606,7 +14893,7 @@ function WriteYesNoFieldComponent_div_7_Template(rf, ctx) { if (rf & 1) {
14606
14893
  } if (rf & 2) {
14607
14894
  const value_r4 = ctx.$implicit;
14608
14895
  const ctx_r3 = i0.ɵɵnextContext();
14609
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c0$u, ctx_r3.yesNoControl.value === value_r4));
14896
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(8, _c0$w, ctx_r3.yesNoControl.value === value_r4));
14610
14897
  i0.ɵɵadvance(1);
14611
14898
  i0.ɵɵproperty("id", ctx_r3.createElementId(value_r4))("name", ctx_r3.id())("formControl", ctx_r3.yesNoControl)("value", value_r4);
14612
14899
  i0.ɵɵattribute("name", ctx_r3.id());
@@ -14615,7 +14902,7 @@ function WriteYesNoFieldComponent_div_7_Template(rf, ctx) { if (rf & 1) {
14615
14902
  i0.ɵɵadvance(1);
14616
14903
  i0.ɵɵtextInterpolate(value_r4);
14617
14904
  } }
14618
- const _c1$8 = function (a0) { return { "form-group-error": a0 }; };
14905
+ const _c1$9 = function (a0) { return { "form-group-error": a0 }; };
14619
14906
  class WriteYesNoFieldComponent extends AbstractFieldWriteComponent {
14620
14907
  constructor(yesNoService) {
14621
14908
  super();
@@ -14641,7 +14928,7 @@ WriteYesNoFieldComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteYesNoFieldC
14641
14928
  i0.ɵɵelementEnd();
14642
14929
  i0.ɵɵelementEnd();
14643
14930
  } if (rf & 2) {
14644
- i0.ɵɵproperty("id", ctx.id())("ngClass", i0.ɵɵpureFunction1(7, _c1$8, !ctx.yesNoControl.valid && (ctx.yesNoControl.dirty || ctx.yesNoControl.touched)));
14931
+ i0.ɵɵproperty("id", ctx.id())("ngClass", i0.ɵɵpureFunction1(7, _c1$9, !ctx.yesNoControl.valid && (ctx.yesNoControl.dirty || ctx.yesNoControl.touched)));
14645
14932
  i0.ɵɵadvance(3);
14646
14933
  i0.ɵɵproperty("ngIf", ctx.caseField.label);
14647
14934
  i0.ɵɵadvance(1);
@@ -14697,8 +14984,6 @@ class PaletteService {
14697
14984
  return write ? WriteAddressFieldComponent : ReadComplexFieldComponent;
14698
14985
  case 'OrderSummary':
14699
14986
  return write ? WriteOrderSummaryFieldComponent : ReadOrderSummaryFieldComponent;
14700
- case 'CaseLink':
14701
- return write ? WriteCaseLinkFieldComponent : ReadCaseLinkFieldComponent;
14702
14987
  case 'Organisation':
14703
14988
  return write ? WriteOrganisationFieldComponent : ReadOrganisationFieldComponent;
14704
14989
  case 'JudicialUser':
@@ -14707,7 +14992,15 @@ class PaletteService {
14707
14992
  return write ? WriteComplexFieldComponent : ReadComplexFieldComponent;
14708
14993
  }
14709
14994
  case 'Collection':
14710
- return write ? WriteCollectionFieldComponent : ReadCollectionFieldComponent;
14995
+ switch (caseField.field_type.collection_field_type.id) {
14996
+ case 'CaseLink':
14997
+ if (caseField.id === 'caseLinks') {
14998
+ return write ? WriteCaseLinkFieldComponent : ReadCaseLinkFieldComponent;
14999
+ }
15000
+ return write ? WriteCollectionFieldComponent : ReadCollectionFieldComponent;
15001
+ default:
15002
+ return write ? WriteCollectionFieldComponent : ReadCollectionFieldComponent;
15003
+ }
14711
15004
  case 'MultiSelectList':
14712
15005
  return write ? WriteMultiSelectListFieldComponent : ReadMultiSelectListFieldComponent;
14713
15006
  case 'Document':
@@ -14733,7 +15026,7 @@ PaletteService.ɵprov = i0.ɵɵdefineInjectable({ token: PaletteService, factory
14733
15026
  type: Injectable
14734
15027
  }], null, null); })();
14735
15028
 
14736
- const _c0$t = ["fieldContainer"];
15029
+ const _c0$v = ["fieldContainer"];
14737
15030
  const FIX_CASEFIELD_FOR$1 = ['FixedList', 'DynamicList'];
14738
15031
  class FieldReadComponent extends AbstractFieldReadComponent {
14739
15032
  constructor(resolver, paletteService) {
@@ -14777,7 +15070,7 @@ class FieldReadComponent extends AbstractFieldReadComponent {
14777
15070
  }
14778
15071
  FieldReadComponent.ɵfac = function FieldReadComponent_Factory(t) { return new (t || FieldReadComponent)(i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver), i0.ɵɵdirectiveInject(PaletteService)); };
14779
15072
  FieldReadComponent.ɵcmp = i0.ɵɵdefineComponent({ type: FieldReadComponent, selectors: [["ccd-field-read"]], viewQuery: function FieldReadComponent_Query(rf, ctx) { if (rf & 1) {
14780
- i0.ɵɵviewQuery(_c0$t, 1, ViewContainerRef);
15073
+ i0.ɵɵviewQuery(_c0$v, 1, ViewContainerRef);
14781
15074
  } if (rf & 2) {
14782
15075
  let _t;
14783
15076
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.fieldContainer = _t.first);
@@ -14811,7 +15104,7 @@ FieldReadComponent.ɵcmp = i0.ɵɵdefineComponent({ type: FieldReadComponent, se
14811
15104
  args: ['fieldContainer', { static: false, read: ViewContainerRef }]
14812
15105
  }] }); })();
14813
15106
 
14814
- const _c0$s = ["fieldContainer"];
15107
+ const _c0$u = ["fieldContainer"];
14815
15108
  const FIX_CASEFIELD_FOR = ['FixedList', 'DynamicList'];
14816
15109
  class FieldWriteComponent extends AbstractFieldWriteComponent {
14817
15110
  constructor(resolver, paletteService) {
@@ -14822,16 +15115,13 @@ class FieldWriteComponent extends AbstractFieldWriteComponent {
14822
15115
  this.canHaveGreyBar = false;
14823
15116
  this.caseFields = [];
14824
15117
  }
15118
+ addValidators(caseField, control) {
15119
+ FormValidatorsService.addValidators(caseField, control);
15120
+ }
14825
15121
  ngOnInit() {
14826
- var _a;
14827
15122
  const componentClass = this.paletteService.getFieldComponentClass(this.caseField, true);
14828
- const injectorOptions = {
14829
- providers: [],
14830
- parent: (_a = this.fieldContainer) === null || _a === void 0 ? void 0 : _a.injector
14831
- };
14832
- const injector = Injector.create(injectorOptions);
14833
- const factory = this.resolver.resolveComponentFactory(componentClass);
14834
- const component = this.fieldContainer.createComponent(factory, 0, injector);
15123
+ const injector = Injector.create([], this.fieldContainer.parentInjector);
15124
+ const component = this.resolver.resolveComponentFactory(componentClass).create(injector);
14835
15125
  // Only Fixed list use plainToClassFromExist
14836
15126
  // Better performance
14837
15127
  // TODO AW 30/12/20 figure out why FixedLists need plainToClassFromExist
@@ -14855,13 +15145,10 @@ class FieldWriteComponent extends AbstractFieldWriteComponent {
14855
15145
  // Set up the flag for whether this can have a grey bar.
14856
15146
  this.canHaveGreyBar = this.caseField.show_condition && this.caseField.field_type.type !== 'Collection';
14857
15147
  }
14858
- addValidators(caseField, control) {
14859
- FormValidatorsService.addValidators(caseField, control);
14860
- }
14861
15148
  }
14862
15149
  FieldWriteComponent.ɵfac = function FieldWriteComponent_Factory(t) { return new (t || FieldWriteComponent)(i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver), i0.ɵɵdirectiveInject(PaletteService)); };
14863
15150
  FieldWriteComponent.ɵcmp = i0.ɵɵdefineComponent({ type: FieldWriteComponent, selectors: [["ccd-field-write"]], viewQuery: function FieldWriteComponent_Query(rf, ctx) { if (rf & 1) {
14864
- i0.ɵɵviewQuery(_c0$s, 3, ViewContainerRef);
15151
+ i0.ɵɵviewQuery(_c0$u, 3, ViewContainerRef);
14865
15152
  } if (rf & 2) {
14866
15153
  let _t;
14867
15154
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.fieldContainer = _t.first);
@@ -14910,7 +15197,7 @@ function FieldReadLabelComponent_dl_1_Template(rf, ctx) { if (rf & 1) {
14910
15197
  function FieldReadLabelComponent_ng_template_2_Template(rf, ctx) { if (rf & 1) {
14911
15198
  i0.ɵɵprojection(0);
14912
15199
  } }
14913
- const _c0$r = ["*"];
15200
+ const _c0$t = ["*"];
14914
15201
  class FieldReadLabelComponent extends AbstractFieldReadComponent {
14915
15202
  constructor() {
14916
15203
  super(...arguments);
@@ -14945,7 +15232,7 @@ class FieldReadLabelComponent extends AbstractFieldReadComponent {
14945
15232
  }
14946
15233
  }
14947
15234
  FieldReadLabelComponent.ɵfac = function FieldReadLabelComponent_Factory(t) { return ɵFieldReadLabelComponent_BaseFactory(t || FieldReadLabelComponent); };
14948
- FieldReadLabelComponent.ɵcmp = i0.ɵɵdefineComponent({ type: FieldReadLabelComponent, selectors: [["ccd-field-read-label"]], inputs: { withLabel: "withLabel", markdownUseHrefAsRouterLink: "markdownUseHrefAsRouterLink" }, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0$r, decls: 4, vars: 5, consts: [[3, "hidden"], ["class", "case-field", 4, "ngIf", "ngIfElse"], ["caseFieldValue", ""], [1, "case-field"], [1, "case-field__label"], [1, "case-field__value"], [4, "ngTemplateOutlet"]], template: function FieldReadLabelComponent_Template(rf, ctx) { if (rf & 1) {
15235
+ FieldReadLabelComponent.ɵcmp = i0.ɵɵdefineComponent({ type: FieldReadLabelComponent, selectors: [["ccd-field-read-label"]], inputs: { withLabel: "withLabel", markdownUseHrefAsRouterLink: "markdownUseHrefAsRouterLink" }, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c0$t, decls: 4, vars: 5, consts: [[3, "hidden"], ["class", "case-field", 4, "ngIf", "ngIfElse"], ["caseFieldValue", ""], [1, "case-field"], [1, "case-field__label"], [1, "case-field__value"], [4, "ngTemplateOutlet"]], template: function FieldReadLabelComponent_Template(rf, ctx) { if (rf & 1) {
14949
15236
  i0.ɵɵprojectionDef();
14950
15237
  i0.ɵɵelementStart(0, "div", 0);
14951
15238
  i0.ɵɵtemplate(1, FieldReadLabelComponent_dl_1_Template, 5, 2, "dl", 1);
@@ -14974,6 +15261,23 @@ const ɵFieldReadLabelComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedF
14974
15261
  type: Input
14975
15262
  }] }); })();
14976
15263
 
15264
+ class CommonDataService {
15265
+ constructor(http) {
15266
+ this.http = http;
15267
+ }
15268
+ getRefData(url) {
15269
+ if (url) {
15270
+ return this.http.get(url, { observe: 'body' });
15271
+ }
15272
+ return of(null);
15273
+ }
15274
+ }
15275
+ CommonDataService.ɵfac = function CommonDataService_Factory(t) { return new (t || CommonDataService)(i0.ɵɵinject(i1$2.HttpClient)); };
15276
+ CommonDataService.ɵprov = i0.ɵɵdefineInjectable({ token: CommonDataService, factory: CommonDataService.ɵfac });
15277
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CommonDataService, [{
15278
+ type: Injectable
15279
+ }], function () { return [{ type: i1$2.HttpClient }]; }, null); })();
15280
+
14977
15281
  function CaseFlagTableComponent_table_0_tr_16_Template(rf, ctx) { if (rf & 1) {
14978
15282
  i0.ɵɵelementStart(0, "tr");
14979
15283
  i0.ɵɵelementStart(1, "td", 13);
@@ -15164,8 +15468,8 @@ function SelectFlagTypeComponent_div_9_div_4_Template(rf, ctx) { if (rf & 1) {
15164
15468
  i0.ɵɵadvance(3);
15165
15469
  i0.ɵɵtextInterpolate1(" ", ctx_r8.flagTypeErrorMessage, " ");
15166
15470
  } }
15167
- const _c0$q = function (a0) { return { "form-group-error": a0 }; };
15168
- const _c1$7 = function (a0) { return { "govuk-input--error": a0 }; };
15471
+ const _c0$s = function (a0) { return { "form-group-error": a0 }; };
15472
+ const _c1$8 = function (a0) { return { "govuk-input--error": a0 }; };
15169
15473
  function SelectFlagTypeComponent_div_9_Template(rf, ctx) { if (rf & 1) {
15170
15474
  i0.ɵɵelementStart(0, "div", 15);
15171
15475
  i0.ɵɵelementStart(1, "div", 1);
@@ -15179,11 +15483,11 @@ function SelectFlagTypeComponent_div_9_Template(rf, ctx) { if (rf & 1) {
15179
15483
  } if (rf & 2) {
15180
15484
  const ctx_r2 = i0.ɵɵnextContext();
15181
15485
  i0.ɵɵadvance(1);
15182
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(5, _c0$q, ctx_r2.flagTypeErrorMessage.length > 0));
15486
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(5, _c0$s, ctx_r2.flagTypeErrorMessage.length > 0));
15183
15487
  i0.ɵɵadvance(3);
15184
15488
  i0.ɵɵproperty("ngIf", ctx_r2.flagTypeErrorMessage.length > 0);
15185
15489
  i0.ɵɵadvance(1);
15186
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(7, _c1$7, ctx_r2.flagTypeErrorMessage.length > 0))("name", ctx_r2.descriptionControlName)("formControlName", ctx_r2.descriptionControlName);
15490
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(7, _c1$8, ctx_r2.flagTypeErrorMessage.length > 0))("name", ctx_r2.descriptionControlName)("formControlName", ctx_r2.descriptionControlName);
15187
15491
  } }
15188
15492
  function SelectFlagTypeComponent_div_10_Template(rf, ctx) { if (rf & 1) {
15189
15493
  const _r10 = i0.ɵɵgetCurrentView();
@@ -15330,7 +15634,7 @@ SelectFlagTypeComponent.ɵcmp = i0.ɵɵdefineComponent({ type: SelectFlagTypeCom
15330
15634
  } if (rf & 2) {
15331
15635
  i0.ɵɵproperty("formGroup", ctx.formGroup);
15332
15636
  i0.ɵɵadvance(1);
15333
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(7, _c0$q, ctx.flagTypeNotSelectedErrorMessage.length > 0));
15637
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(7, _c0$s, ctx.flagTypeNotSelectedErrorMessage.length > 0));
15334
15638
  i0.ɵɵadvance(4);
15335
15639
  i0.ɵɵtextInterpolate1(" ", ctx.caseFlagWizardStepTitle.SELECT_CASE_FLAG, " ");
15336
15640
  i0.ɵɵadvance(1);
@@ -15422,7 +15726,7 @@ function SearchLanguageInterpreterComponent_div_21_div_5_Template(rf, ctx) { if
15422
15726
  i0.ɵɵadvance(3);
15423
15727
  i0.ɵɵtextInterpolate1(" ", ctx_r8.languageCharLimitErrorMessage, " ");
15424
15728
  } }
15425
- const _c0$p = function (a0) { return { "form-group-error": a0 }; };
15729
+ const _c0$r = function (a0) { return { "form-group-error": a0 }; };
15426
15730
  function SearchLanguageInterpreterComponent_div_21_Template(rf, ctx) { if (rf & 1) {
15427
15731
  i0.ɵɵelementStart(0, "div", 25);
15428
15732
  i0.ɵɵelementStart(1, "div", 1);
@@ -15437,7 +15741,7 @@ function SearchLanguageInterpreterComponent_div_21_Template(rf, ctx) { if (rf &
15437
15741
  } if (rf & 2) {
15438
15742
  const ctx_r5 = i0.ɵɵnextContext();
15439
15743
  i0.ɵɵadvance(1);
15440
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(6, _c0$p, ctx_r5.languageNotEnteredErrorMessage || ctx_r5.languageCharLimitErrorMessage));
15744
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(6, _c0$r, ctx_r5.languageNotEnteredErrorMessage || ctx_r5.languageCharLimitErrorMessage));
15441
15745
  i0.ɵɵadvance(2);
15442
15746
  i0.ɵɵtextInterpolate(ctx_r5.searchLanguageInterpreterStep.INPUT_LABEL);
15443
15747
  i0.ɵɵadvance(1);
@@ -15603,7 +15907,7 @@ SearchLanguageInterpreterComponent.ɵcmp = i0.ɵɵdefineComponent({ type: Search
15603
15907
  const _r2 = i0.ɵɵreference(12);
15604
15908
  i0.ɵɵproperty("formGroup", ctx.formGroup);
15605
15909
  i0.ɵɵadvance(1);
15606
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(16, _c0$p, ctx.languageNotSelectedErrorMessage || ctx.languageEnteredInBothFieldsErrorMessage));
15910
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(16, _c0$r, ctx.languageNotSelectedErrorMessage || ctx.languageEnteredInBothFieldsErrorMessage));
15607
15911
  i0.ɵɵadvance(2);
15608
15912
  i0.ɵɵproperty("for", ctx.languageSearchTermControlName);
15609
15913
  i0.ɵɵadvance(1);
@@ -15717,7 +16021,7 @@ function SelectFlagLocationComponent_div_9_Template(rf, ctx) { if (rf & 1) {
15717
16021
  i0.ɵɵelementEnd();
15718
16022
  i0.ɵɵelementEnd();
15719
16023
  } }
15720
- const _c0$o = function (a0) { return { "form-group-error": a0 }; };
16024
+ const _c0$q = function (a0) { return { "form-group-error": a0 }; };
15721
16025
  class SelectFlagLocationComponent {
15722
16026
  constructor() {
15723
16027
  this.caseFlagStateEmitter = new EventEmitter();
@@ -15802,7 +16106,7 @@ SelectFlagLocationComponent.ɵcmp = i0.ɵɵdefineComponent({ type: SelectFlagLoc
15802
16106
  } if (rf & 2) {
15803
16107
  i0.ɵɵproperty("formGroup", ctx.formGroup);
15804
16108
  i0.ɵɵadvance(1);
15805
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(6, _c0$o, ctx.errorMessages.length > 0));
16109
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(6, _c0$q, ctx.errorMessages.length > 0));
15806
16110
  i0.ɵɵadvance(4);
15807
16111
  i0.ɵɵtextInterpolate1(" ", ctx.flagLocationTitle, " ");
15808
16112
  i0.ɵɵadvance(1);
@@ -15855,7 +16159,7 @@ function AddCommentsComponent_div_10_Template(rf, ctx) { if (rf & 1) {
15855
16159
  i0.ɵɵadvance(3);
15856
16160
  i0.ɵɵtextInterpolate1(" ", ctx_r2.flagCommentsCharLimitErrorMessage, " ");
15857
16161
  } }
15858
- const _c0$n = function (a0) { return { "form-group-error": a0 }; };
16162
+ const _c0$p = function (a0) { return { "form-group-error": a0 }; };
15859
16163
  class AddCommentsComponent {
15860
16164
  constructor() {
15861
16165
  this.optional = false;
@@ -15933,7 +16237,7 @@ AddCommentsComponent.ɵcmp = i0.ɵɵdefineComponent({ type: AddCommentsComponent
15933
16237
  } if (rf & 2) {
15934
16238
  i0.ɵɵproperty("formGroup", ctx.formGroup);
15935
16239
  i0.ɵɵadvance(2);
15936
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(12, _c0$n, ctx.errorMessages.length > 0));
16240
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(12, _c0$p, ctx.errorMessages.length > 0));
15937
16241
  i0.ɵɵadvance(2);
15938
16242
  i0.ɵɵproperty("for", ctx.flagCommentsControlName);
15939
16243
  i0.ɵɵadvance(1);
@@ -15980,9 +16284,7 @@ function ManageCaseFlagsComponent_div_6_Template(rf, ctx) { if (rf & 1) {
15980
16284
  function ManageCaseFlagsComponent_div_8_Template(rf, ctx) { if (rf & 1) {
15981
16285
  i0.ɵɵelementStart(0, "div", 11);
15982
16286
  i0.ɵɵelement(1, "input", 12);
15983
- i0.ɵɵelementStart(2, "label", 13);
15984
- i0.ɵɵtext(3);
15985
- i0.ɵɵelementEnd();
16287
+ i0.ɵɵelement(2, "label", 13);
15986
16288
  i0.ɵɵelementEnd();
15987
16289
  } if (rf & 2) {
15988
16290
  const flagDisplay_r3 = ctx.$implicit;
@@ -15993,8 +16295,7 @@ function ManageCaseFlagsComponent_div_8_Template(rf, ctx) { if (rf & 1) {
15993
16295
  i0.ɵɵproperty("name", ctx_r1.selectedControlName)("value", flagDisplay_r3)("formControlName", ctx_r1.selectedControlName);
15994
16296
  i0.ɵɵadvance(1);
15995
16297
  i0.ɵɵpropertyInterpolate1("for", "flag-selection-", i_r4, "");
15996
- i0.ɵɵadvance(1);
15997
- i0.ɵɵtextInterpolate(ctx_r1.processLabel(flagDisplay_r3));
16298
+ i0.ɵɵproperty("innerHtml", flagDisplay_r3.label, i0.ɵɵsanitizeHtml);
15998
16299
  } }
15999
16300
  function ManageCaseFlagsComponent_div_9_Template(rf, ctx) { if (rf & 1) {
16000
16301
  const _r6 = i0.ɵɵgetCurrentView();
@@ -16005,7 +16306,7 @@ function ManageCaseFlagsComponent_div_9_Template(rf, ctx) { if (rf & 1) {
16005
16306
  i0.ɵɵelementEnd();
16006
16307
  i0.ɵɵelementEnd();
16007
16308
  } }
16008
- const _c0$m = function (a0) { return { "form-group-error": a0 }; };
16309
+ const _c0$o = function (a0) { return { "form-group-error": a0 }; };
16009
16310
  class ManageCaseFlagsComponent {
16010
16311
  constructor() {
16011
16312
  this.caseFlagStateEmitter = new EventEmitter();
@@ -16013,7 +16314,6 @@ class ManageCaseFlagsComponent {
16013
16314
  this.manageCaseFlagSelectedErrorMessage = null;
16014
16315
  this.noFlagsError = false;
16015
16316
  this.selectedControlName = 'selectedManageCaseLocation';
16016
- this.caseLevelCaseFlagsFieldId = 'caseFlags';
16017
16317
  }
16018
16318
  ngOnInit() {
16019
16319
  this.manageCaseFlagTitle = CaseFlagWizardStepTitle.MANAGE_CASE_FLAGS;
@@ -16023,11 +16323,14 @@ class ManageCaseFlagsComponent {
16023
16323
  if (flagsInstance.flags.details && flagsInstance.flags.details.length > 0) {
16024
16324
  displayData = [
16025
16325
  ...displayData,
16026
- ...flagsInstance.flags.details.map(detail => this.mapFlagDetailForDisplay(detail, flagsInstance.flags.partyName, flagsInstance.pathToFlagsFormGroup, flagsInstance.caseField))
16326
+ ...flagsInstance.flags.details.map(detail => this.mapFlagDetailForDisplay(detail, flagsInstance))
16027
16327
  ];
16028
16328
  }
16029
16329
  return displayData;
16030
16330
  }, []);
16331
+ this.flagsDisplayData.forEach(flagDisplayData => {
16332
+ flagDisplayData.label = this.processLabel(flagDisplayData);
16333
+ });
16031
16334
  }
16032
16335
  // Add a FormControl for the selected case flag if there is at least one flags instance remaining after mapping
16033
16336
  if (this.flagsDisplayData && this.flagsDisplayData.length > 0) {
@@ -16039,42 +16342,70 @@ class ManageCaseFlagsComponent {
16039
16342
  this.onNoFlagsError();
16040
16343
  }
16041
16344
  }
16042
- mapFlagDetailForDisplay(flagDetail, partyName, pathToFlagsFormGroup, caseField) {
16345
+ mapFlagDetailForDisplay(flagDetail, flagsInstance) {
16043
16346
  return {
16044
16347
  flagDetailDisplay: {
16045
- partyName,
16348
+ partyName: flagsInstance.flags.partyName,
16046
16349
  flagDetail,
16047
- flagsCaseFieldId: caseField.id
16350
+ flagsCaseFieldId: flagsInstance.caseField.id
16048
16351
  },
16049
- pathToFlagsFormGroup,
16050
- caseField
16352
+ pathToFlagsFormGroup: flagsInstance.pathToFlagsFormGroup,
16353
+ caseField: flagsInstance.caseField,
16354
+ roleOnCase: flagsInstance.flags.roleOnCase
16051
16355
  };
16052
16356
  }
16053
16357
  processLabel(flagDisplay) {
16054
- const partyName = flagDisplay.pathToFlagsFormGroup && flagDisplay.pathToFlagsFormGroup === this.caseLevelCaseFlagsFieldId
16055
- ? `${this.caseTitle} - `
16056
- : flagDisplay.flagDetailDisplay.partyName
16057
- ? `${flagDisplay.flagDetailDisplay.partyName} - `
16058
- : '';
16059
16358
  const flagDetail = flagDisplay.flagDetailDisplay.flagDetail;
16060
- const flagPathOrName = flagDetail && flagDetail.path && flagDetail.path.length > 1
16061
- ? flagDetail.path[1].value
16062
- : flagDetail.subTypeKey && flagDetail.subTypeValue
16063
- ? flagDetail.subTypeValue
16064
- : flagDetail.name;
16065
- const flagOtherDescriptionOrName = flagDetail && flagDetail.name
16066
- ? flagDetail.name === 'Other'
16067
- ? flagDetail.otherDescription
16068
- : flagDetail.subTypeKey && flagDetail.subTypeValue
16069
- ? flagDetail.subTypeValue
16070
- : flagDetail.name
16071
- : '';
16072
- const comment = flagDetail.flagComment
16073
- ? ` (${flagDetail.flagComment})`
16074
- : '';
16075
- return flagPathOrName === flagOtherDescriptionOrName
16076
- ? `${partyName}${flagOtherDescriptionOrName}${comment}`
16077
- : `${partyName}${flagPathOrName}, ${flagOtherDescriptionOrName}${comment}`;
16359
+ const partyName = this.getPartyName(flagDisplay);
16360
+ const flagName = this.getFlagName(flagDetail);
16361
+ const flagDescription = this.getFlagDescription(flagDetail);
16362
+ const roleOnCase = this.getRoleOnCase(flagDisplay);
16363
+ const flagComment = this.getFlagComments(flagDetail);
16364
+ return flagName === flagDescription
16365
+ ? `${partyName}${roleOnCase} - <span class="flag-name-and-description">${flagDescription}</span>${flagComment}`
16366
+ : `${partyName}${roleOnCase} - <span class="flag-name-and-description">${flagName}, ${flagDescription}</span>${flagComment}`;
16367
+ }
16368
+ getPartyName(flagDisplay) {
16369
+ if (flagDisplay.pathToFlagsFormGroup && flagDisplay.pathToFlagsFormGroup === ManageCaseFlagsComponent.CASE_LEVEL_CASE_FLAGS_FIELD_ID) {
16370
+ return 'Case level';
16371
+ }
16372
+ if (flagDisplay.flagDetailDisplay.partyName) {
16373
+ return `${flagDisplay.flagDetailDisplay.partyName}`;
16374
+ }
16375
+ return '';
16376
+ }
16377
+ getFlagName(flagDetail) {
16378
+ if (flagDetail && flagDetail.path && flagDetail.path.length > 1) {
16379
+ return flagDetail.path[1].value;
16380
+ }
16381
+ if (flagDetail.subTypeKey && flagDetail.subTypeValue) {
16382
+ return flagDetail.subTypeValue;
16383
+ }
16384
+ return flagDetail.name;
16385
+ }
16386
+ getFlagDescription(flagDetail) {
16387
+ if (flagDetail && flagDetail.name) {
16388
+ if (flagDetail.name === 'Other' && flagDetail.otherDescription) {
16389
+ return flagDetail.otherDescription;
16390
+ }
16391
+ if (flagDetail.subTypeKey && flagDetail.subTypeValue) {
16392
+ return flagDetail.subTypeValue;
16393
+ }
16394
+ return flagDetail.name;
16395
+ }
16396
+ return '';
16397
+ }
16398
+ getRoleOnCase(flagDisplay) {
16399
+ if (flagDisplay && flagDisplay.roleOnCase) {
16400
+ return ` (${flagDisplay.roleOnCase})`;
16401
+ }
16402
+ return '';
16403
+ }
16404
+ getFlagComments(flagDetail) {
16405
+ if (flagDetail.flagComment) {
16406
+ return ` (${flagDetail.flagComment})`;
16407
+ }
16408
+ return '';
16078
16409
  }
16079
16410
  onNext() {
16080
16411
  // Validate flag selection
@@ -16112,8 +16443,9 @@ class ManageCaseFlagsComponent {
16112
16443
  });
16113
16444
  }
16114
16445
  }
16446
+ ManageCaseFlagsComponent.CASE_LEVEL_CASE_FLAGS_FIELD_ID = 'caseFlags';
16115
16447
  ManageCaseFlagsComponent.ɵfac = function ManageCaseFlagsComponent_Factory(t) { return new (t || ManageCaseFlagsComponent)(); };
16116
- ManageCaseFlagsComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ManageCaseFlagsComponent, selectors: [["ccd-manage-case-flags"]], inputs: { formGroup: "formGroup", flagsData: "flagsData", caseTitle: "caseTitle" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, decls: 10, vars: 8, consts: [[1, "form-group", 3, "formGroup"], [1, "govuk-form-group", 3, "ngClass"], ["aria-describedby", "manage-case-flag-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--l"], ["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"], [1, "govuk-button-group"], ["type", "button", 1, "button", "button-primary", 3, "click"]], template: function ManageCaseFlagsComponent_Template(rf, ctx) { if (rf & 1) {
16448
+ ManageCaseFlagsComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ManageCaseFlagsComponent, selectors: [["ccd-manage-case-flags"]], inputs: { formGroup: "formGroup", flagsData: "flagsData", caseTitle: "caseTitle" }, outputs: { caseFlagStateEmitter: "caseFlagStateEmitter" }, decls: 10, vars: 8, consts: [[1, "form-group", 3, "formGroup"], [1, "govuk-form-group", 3, "ngClass"], ["aria-describedby", "manage-case-flag-heading", 1, "govuk-fieldset"], [1, "govuk-fieldset__legend", "govuk-fieldset__legend--l"], ["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) {
16117
16449
  i0.ɵɵelementStart(0, "div", 0);
16118
16450
  i0.ɵɵelementStart(1, "div", 1);
16119
16451
  i0.ɵɵelementStart(2, "fieldset", 2);
@@ -16124,7 +16456,7 @@ ManageCaseFlagsComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ManageCaseFlagsC
16124
16456
  i0.ɵɵelementEnd();
16125
16457
  i0.ɵɵtemplate(6, ManageCaseFlagsComponent_div_6_Template, 4, 1, "div", 5);
16126
16458
  i0.ɵɵelementStart(7, "div", 6);
16127
- i0.ɵɵtemplate(8, ManageCaseFlagsComponent_div_8_Template, 4, 6, "div", 7);
16459
+ i0.ɵɵtemplate(8, ManageCaseFlagsComponent_div_8_Template, 3, 6, "div", 7);
16128
16460
  i0.ɵɵelementEnd();
16129
16461
  i0.ɵɵelementEnd();
16130
16462
  i0.ɵɵelementEnd();
@@ -16133,7 +16465,7 @@ ManageCaseFlagsComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ManageCaseFlagsC
16133
16465
  } if (rf & 2) {
16134
16466
  i0.ɵɵproperty("formGroup", ctx.formGroup);
16135
16467
  i0.ɵɵadvance(1);
16136
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(6, _c0$m, ctx.errorMessages.length > 0));
16468
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(6, _c0$o, ctx.errorMessages.length > 0));
16137
16469
  i0.ɵɵadvance(4);
16138
16470
  i0.ɵɵtextInterpolate1(" ", ctx.manageCaseFlagTitle, " ");
16139
16471
  i0.ɵɵadvance(1);
@@ -16142,12 +16474,14 @@ ManageCaseFlagsComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ManageCaseFlagsC
16142
16474
  i0.ɵɵproperty("ngForOf", ctx.flagsDisplayData);
16143
16475
  i0.ɵɵadvance(1);
16144
16476
  i0.ɵɵproperty("ngIf", !ctx.noFlagsError);
16145
- } }, directives: [i2.NgControlStatusGroup, i2.FormGroupDirective, i1.NgClass, i1.NgIf, i1.NgForOf, i2.RadioControlValueAccessor, i2.DefaultValueAccessor, i2.NgControlStatus, i2.FormControlName], encapsulation: 2 });
16477
+ } }, directives: [i2.NgControlStatusGroup, i2.FormGroupDirective, i1.NgClass, i1.NgIf, i1.NgForOf, i2.RadioControlValueAccessor, i2.DefaultValueAccessor, i2.NgControlStatus, i2.FormControlName], styles: [".flag-name-and-description{font-weight:700}"], encapsulation: 2 });
16146
16478
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ManageCaseFlagsComponent, [{
16147
16479
  type: Component,
16148
16480
  args: [{
16149
16481
  selector: 'ccd-manage-case-flags',
16150
- templateUrl: './manage-case-flags.component.html'
16482
+ templateUrl: './manage-case-flags.component.html',
16483
+ styleUrls: ['./manage-case-flags.component.scss'],
16484
+ encapsulation: ViewEncapsulation.None
16151
16485
  }]
16152
16486
  }], null, { formGroup: [{
16153
16487
  type: Input
@@ -16190,8 +16524,8 @@ function UpdateFlagComponent_button_22_Template(rf, ctx) { if (rf & 1) {
16190
16524
  i0.ɵɵtext(1, " Make inactive ");
16191
16525
  i0.ɵɵelementEnd();
16192
16526
  } }
16193
- const _c0$l = function (a0) { return { "form-group-error": a0 }; };
16194
- const _c1$6 = function (a0) { return { "govuk-tag--grey": a0 }; };
16527
+ const _c0$n = function (a0) { return { "form-group-error": a0 }; };
16528
+ const _c1$7 = function (a0) { return { "govuk-tag--grey": a0 }; };
16195
16529
  class UpdateFlagComponent {
16196
16530
  constructor() {
16197
16531
  this.caseFlagStateEmitter = new EventEmitter();
@@ -16309,7 +16643,7 @@ UpdateFlagComponent.ɵcmp = i0.ɵɵdefineComponent({ type: UpdateFlagComponent,
16309
16643
  } if (rf & 2) {
16310
16644
  i0.ɵɵproperty("formGroup", ctx.formGroup);
16311
16645
  i0.ɵɵadvance(2);
16312
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(14, _c0$l, ctx.errorMessages.length > 0));
16646
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(14, _c0$n, ctx.errorMessages.length > 0));
16313
16647
  i0.ɵɵadvance(2);
16314
16648
  i0.ɵɵproperty("for", ctx.updateFlagControlName);
16315
16649
  i0.ɵɵadvance(1);
@@ -16325,7 +16659,7 @@ UpdateFlagComponent.ɵcmp = i0.ɵɵdefineComponent({ type: UpdateFlagComponent,
16325
16659
  i0.ɵɵadvance(3);
16326
16660
  i0.ɵɵtextInterpolate1(" ", ctx.updateFlagCharLimitInfo, " ");
16327
16661
  i0.ɵɵadvance(6);
16328
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(16, _c1$6, ctx.selectedFlag.flagDetailDisplay.flagDetail.status === "Inactive"));
16662
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(16, _c1$7, ctx.selectedFlag.flagDetailDisplay.flagDetail.status === "Inactive"));
16329
16663
  i0.ɵɵadvance(1);
16330
16664
  i0.ɵɵtextInterpolate1(" ", ctx.selectedFlag.flagDetailDisplay.flagDetail.status, " ");
16331
16665
  i0.ɵɵadvance(2);
@@ -16438,10 +16772,2046 @@ CaseFlagSummaryListComponent.ɵcmp = i0.ɵɵdefineComponent({ type: CaseFlagSumm
16438
16772
  type: Input
16439
16773
  }] }); })();
16440
16774
 
16441
- class CollectionCreateCheckerService {
16442
- setDisplayContextForChildren(caseField, profile) {
16443
- const children = this.getCaseFieldChildren(caseField);
16444
- if (children && children.length > 0) {
16775
+ var LinkedCasesPages;
16776
+ (function (LinkedCasesPages) {
16777
+ LinkedCasesPages[LinkedCasesPages["BEFORE_YOU_START"] = 0] = "BEFORE_YOU_START";
16778
+ LinkedCasesPages[LinkedCasesPages["NO_LINKED_CASES"] = 1] = "NO_LINKED_CASES";
16779
+ LinkedCasesPages[LinkedCasesPages["LINK_CASE"] = 2] = "LINK_CASE";
16780
+ LinkedCasesPages[LinkedCasesPages["UNLINK_CASE"] = 3] = "UNLINK_CASE";
16781
+ LinkedCasesPages[LinkedCasesPages["CHECK_YOUR_ANSWERS"] = 4] = "CHECK_YOUR_ANSWERS";
16782
+ })(LinkedCasesPages || (LinkedCasesPages = {}));
16783
+ var LinkedCasesErrorMessages;
16784
+ (function (LinkedCasesErrorMessages) {
16785
+ LinkedCasesErrorMessages["ProposedCaseWithIn"] = "Case can not be linked to the same case";
16786
+ LinkedCasesErrorMessages["CaseNumberError"] = "Case numbers must have 16 digits";
16787
+ LinkedCasesErrorMessages["ReasonSelectionError"] = "Select a reason why these cases should be linked";
16788
+ LinkedCasesErrorMessages["SomethingWrong"] = "Something went wrong, please try again later";
16789
+ LinkedCasesErrorMessages["CaseCheckAgainError"] = "Check the case number and try again";
16790
+ LinkedCasesErrorMessages["CaseSelectionError"] = "You need to propose at least one case";
16791
+ LinkedCasesErrorMessages["CaseProposedError"] = "This case has already been proposed";
16792
+ LinkedCasesErrorMessages["CasesLinkedError"] = "These cases are already linked";
16793
+ LinkedCasesErrorMessages["UnlinkCaseSelectionError"] = "Select a case to unlink before continue";
16794
+ LinkedCasesErrorMessages["LinkCasesNavigationError"] = "Please select Next to link case(s)";
16795
+ LinkedCasesErrorMessages["UnlinkCasesNavigationError"] = "Please select Next to unlink case(s)";
16796
+ LinkedCasesErrorMessages["BackNavigationError"] = "Please select Back to go to the previous page";
16797
+ })(LinkedCasesErrorMessages || (LinkedCasesErrorMessages = {}));
16798
+ var LinkedCasesEventTriggers;
16799
+ (function (LinkedCasesEventTriggers) {
16800
+ LinkedCasesEventTriggers["LINK_CASES"] = "Link cases";
16801
+ LinkedCasesEventTriggers["MANAGE_CASE_LINKS"] = "Manage case links";
16802
+ })(LinkedCasesEventTriggers || (LinkedCasesEventTriggers = {}));
16803
+ var Patterns;
16804
+ (function (Patterns) {
16805
+ Patterns["CASE_REF"] = "((([0-9]{4})(?: |-)?)){4}";
16806
+ })(Patterns || (Patterns = {}));
16807
+
16808
+ function BeforeYouStartComponent_div_1_p_3_Template(rf, ctx) { if (rf & 1) {
16809
+ i0.ɵɵelementStart(0, "p", 5);
16810
+ i0.ɵɵelementStart(1, "span", 6);
16811
+ i0.ɵɵtext(2, "Error:");
16812
+ i0.ɵɵelementEnd();
16813
+ i0.ɵɵtext(3);
16814
+ i0.ɵɵelementEnd();
16815
+ } if (rf & 2) {
16816
+ const ctx_r2 = i0.ɵɵnextContext(2);
16817
+ i0.ɵɵadvance(3);
16818
+ i0.ɵɵtextInterpolate1(" ", ctx_r2.linkedCasesService.serverLinkedApiError.message, " ");
16819
+ } }
16820
+ function BeforeYouStartComponent_div_1_Template(rf, ctx) { if (rf & 1) {
16821
+ const _r4 = i0.ɵɵgetCurrentView();
16822
+ i0.ɵɵelementStart(0, "div");
16823
+ i0.ɵɵelementStart(1, "h1", 1);
16824
+ i0.ɵɵtext(2, "There is a problem");
16825
+ i0.ɵɵelementEnd();
16826
+ i0.ɵɵtemplate(3, BeforeYouStartComponent_div_1_p_3_Template, 4, 1, "p", 2);
16827
+ i0.ɵɵelementStart(4, "p", 3);
16828
+ i0.ɵɵelementStart(5, "a", 4);
16829
+ i0.ɵɵlistener("click", function BeforeYouStartComponent_div_1_Template_a_click_5_listener() { i0.ɵɵrestoreView(_r4); const ctx_r3 = i0.ɵɵnextContext(); return ctx_r3.onBack(); });
16830
+ i0.ɵɵtext(6, "Go back to the Linked cases tab");
16831
+ i0.ɵɵelementEnd();
16832
+ i0.ɵɵelementEnd();
16833
+ i0.ɵɵelementEnd();
16834
+ } if (rf & 2) {
16835
+ const ctx_r0 = i0.ɵɵnextContext();
16836
+ i0.ɵɵadvance(3);
16837
+ i0.ɵɵproperty("ngIf", ctx_r0.linkedCasesService.serverLinkedApiError);
16838
+ } }
16839
+ function BeforeYouStartComponent_div_2_div_3_Template(rf, ctx) { if (rf & 1) {
16840
+ i0.ɵɵelementStart(0, "div", 11);
16841
+ i0.ɵɵelementStart(1, "p", 3);
16842
+ i0.ɵɵtext(2, "If a group of linked cases has a lead case, you must start from the lead case.");
16843
+ i0.ɵɵelementEnd();
16844
+ i0.ɵɵelementStart(3, "p", 3);
16845
+ i0.ɵɵtext(4, "If the cases to be linked has no lead, you can start the linking journey from any of those cases.");
16846
+ i0.ɵɵelementEnd();
16847
+ i0.ɵɵelementEnd();
16848
+ } }
16849
+ function BeforeYouStartComponent_div_2_div_4_Template(rf, ctx) { if (rf & 1) {
16850
+ i0.ɵɵelementStart(0, "div", 12);
16851
+ i0.ɵɵelementStart(1, "p", 3);
16852
+ i0.ɵɵtext(2, "If there are linked hearings for the case you need to un-link then you must unlink the hearing first.");
16853
+ i0.ɵɵelementEnd();
16854
+ i0.ɵɵelementEnd();
16855
+ } }
16856
+ function BeforeYouStartComponent_div_2_Template(rf, ctx) { if (rf & 1) {
16857
+ const _r8 = i0.ɵɵgetCurrentView();
16858
+ i0.ɵɵelementStart(0, "div");
16859
+ i0.ɵɵelementStart(1, "h1", 1);
16860
+ i0.ɵɵtext(2, "Before you start");
16861
+ i0.ɵɵelementEnd();
16862
+ i0.ɵɵtemplate(3, BeforeYouStartComponent_div_2_div_3_Template, 5, 0, "div", 7);
16863
+ i0.ɵɵtemplate(4, BeforeYouStartComponent_div_2_div_4_Template, 3, 0, "div", 8);
16864
+ i0.ɵɵelementStart(5, "div", 9);
16865
+ i0.ɵɵelementStart(6, "button", 10);
16866
+ i0.ɵɵlistener("click", function BeforeYouStartComponent_div_2_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r8); const ctx_r7 = i0.ɵɵnextContext(); return ctx_r7.onNext(); });
16867
+ i0.ɵɵtext(7, "Next");
16868
+ i0.ɵɵelementEnd();
16869
+ i0.ɵɵelementEnd();
16870
+ i0.ɵɵelementEnd();
16871
+ } if (rf & 2) {
16872
+ const ctx_r1 = i0.ɵɵnextContext();
16873
+ i0.ɵɵadvance(3);
16874
+ i0.ɵɵproperty("ngIf", ctx_r1.isLinkCasesJourney);
16875
+ i0.ɵɵadvance(1);
16876
+ i0.ɵɵproperty("ngIf", !ctx_r1.isLinkCasesJourney);
16877
+ } }
16878
+ class BeforeYouStartComponent {
16879
+ constructor(router, linkedCasesService) {
16880
+ this.router = router;
16881
+ this.linkedCasesService = linkedCasesService;
16882
+ this.linkedCasesStateEmitter = new EventEmitter();
16883
+ this.isLinkCasesJourney = false;
16884
+ this.isLinkCasesJourney = this.linkedCasesService.isLinkedCasesEventTrigger;
16885
+ // re-initiate the state based on the casefield value
16886
+ const linkedCaseRefereneIds = this.linkedCasesService.caseFieldValue.filter(item => item).map(item => item.id);
16887
+ this.linkedCasesService.linkedCases = this.linkedCasesService.linkedCases.filter(item => linkedCaseRefereneIds.indexOf(item.caseReference) !== -1);
16888
+ this.linkedCasesService.initialCaseLinks = this.linkedCasesService.linkedCases;
16889
+ }
16890
+ onNext() {
16891
+ this.linkedCasesStateEmitter.emit({
16892
+ currentLinkedCasesPage: LinkedCasesPages.BEFORE_YOU_START,
16893
+ errorMessages: this.errorMessages,
16894
+ navigateToNextPage: true
16895
+ });
16896
+ }
16897
+ onBack() {
16898
+ this.router.navigate(['cases', 'case-details', this.linkedCasesService.caseId]).then(() => {
16899
+ window.location.hash = 'Linked cases';
16900
+ });
16901
+ }
16902
+ }
16903
+ BeforeYouStartComponent.ɵfac = function BeforeYouStartComponent_Factory(t) { return new (t || BeforeYouStartComponent)(i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(LinkedCasesService)); };
16904
+ BeforeYouStartComponent.ɵcmp = 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) {
16905
+ i0.ɵɵelementStart(0, "div");
16906
+ i0.ɵɵtemplate(1, BeforeYouStartComponent_div_1_Template, 7, 1, "div", 0);
16907
+ i0.ɵɵtemplate(2, BeforeYouStartComponent_div_2_Template, 8, 2, "div", 0);
16908
+ i0.ɵɵelementEnd();
16909
+ } if (rf & 2) {
16910
+ i0.ɵɵadvance(1);
16911
+ i0.ɵɵproperty("ngIf", ctx.linkedCasesService.serverLinkedApiError);
16912
+ i0.ɵɵadvance(1);
16913
+ i0.ɵɵproperty("ngIf", !ctx.linkedCasesService || !ctx.linkedCasesService.serverLinkedApiError);
16914
+ } }, directives: [i1.NgIf], encapsulation: 2 });
16915
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BeforeYouStartComponent, [{
16916
+ type: Component,
16917
+ args: [{
16918
+ selector: 'ccd-linked-cases-before-you-start',
16919
+ templateUrl: './before-you-start.component.html'
16920
+ }]
16921
+ }], function () { return [{ type: i1$1.Router }, { type: LinkedCasesService }]; }, { linkedCasesStateEmitter: [{
16922
+ type: Output
16923
+ }] }); })();
16924
+
16925
+ function CheckYourAnswersComponent_table_4_tr_9_Template(rf, ctx) { if (rf & 1) {
16926
+ const _r8 = i0.ɵɵgetCurrentView();
16927
+ i0.ɵɵelementStart(0, "tr", 7);
16928
+ i0.ɵɵelementStart(1, "td", 14);
16929
+ i0.ɵɵtext(2);
16930
+ i0.ɵɵelement(3, "br");
16931
+ i0.ɵɵtext(4);
16932
+ i0.ɵɵpipe(5, "ccdCaseReference");
16933
+ i0.ɵɵelementEnd();
16934
+ i0.ɵɵelementStart(6, "td", 14);
16935
+ i0.ɵɵelementStart(7, "a", 15);
16936
+ i0.ɵɵlistener("click", function CheckYourAnswersComponent_table_4_tr_9_Template_a_click_7_listener() { i0.ɵɵrestoreView(_r8); const ctx_r7 = i0.ɵɵnextContext(2); return ctx_r7.onChange(); });
16937
+ i0.ɵɵtext(8, "Change");
16938
+ i0.ɵɵelementEnd();
16939
+ i0.ɵɵelementEnd();
16940
+ i0.ɵɵelementEnd();
16941
+ } if (rf & 2) {
16942
+ const case_r6 = ctx.$implicit;
16943
+ i0.ɵɵadvance(2);
16944
+ i0.ɵɵtextInterpolate1(" ", case_r6.caseName, " ");
16945
+ i0.ɵɵadvance(2);
16946
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 2, case_r6.caseReference), " ");
16947
+ } }
16948
+ function CheckYourAnswersComponent_table_4_tr_10_Template(rf, ctx) { if (rf & 1) {
16949
+ i0.ɵɵelementStart(0, "tr", 7);
16950
+ i0.ɵɵelementStart(1, "td", 16);
16951
+ i0.ɵɵtext(2, " None ");
16952
+ i0.ɵɵelementEnd();
16953
+ i0.ɵɵelementEnd();
16954
+ } }
16955
+ function CheckYourAnswersComponent_table_4_Template(rf, ctx) { if (rf & 1) {
16956
+ i0.ɵɵelementStart(0, "table", 13);
16957
+ i0.ɵɵelementStart(1, "caption", 5);
16958
+ i0.ɵɵtext(2, "Cases to unlink");
16959
+ i0.ɵɵelementEnd();
16960
+ i0.ɵɵelementStart(3, "thead", 6);
16961
+ i0.ɵɵelementStart(4, "tr", 7);
16962
+ i0.ɵɵelementStart(5, "th", 8);
16963
+ i0.ɵɵtext(6, "Case name and number");
16964
+ i0.ɵɵelementEnd();
16965
+ i0.ɵɵelement(7, "th", 8);
16966
+ i0.ɵɵelementEnd();
16967
+ i0.ɵɵelementEnd();
16968
+ i0.ɵɵelementStart(8, "tbody", 10);
16969
+ i0.ɵɵtemplate(9, CheckYourAnswersComponent_table_4_tr_9_Template, 9, 4, "tr", 11);
16970
+ i0.ɵɵtemplate(10, CheckYourAnswersComponent_table_4_tr_10_Template, 3, 0, "tr", 12);
16971
+ i0.ɵɵelementEnd();
16972
+ i0.ɵɵelementEnd();
16973
+ } if (rf & 2) {
16974
+ const ctx_r0 = i0.ɵɵnextContext();
16975
+ i0.ɵɵadvance(9);
16976
+ i0.ɵɵproperty("ngForOf", ctx_r0.casesToUnlink);
16977
+ i0.ɵɵadvance(1);
16978
+ i0.ɵɵproperty("ngIf", !ctx_r0.casesToUnlink.length);
16979
+ } }
16980
+ function CheckYourAnswersComponent_th_15_Template(rf, ctx) { if (rf & 1) {
16981
+ i0.ɵɵelement(0, "th", 8);
16982
+ } }
16983
+ function CheckYourAnswersComponent_tr_17_span_8_br_3_Template(rf, ctx) { if (rf & 1) {
16984
+ i0.ɵɵelement(0, "br");
16985
+ } }
16986
+ function CheckYourAnswersComponent_tr_17_span_8_Template(rf, ctx) { if (rf & 1) {
16987
+ i0.ɵɵelementStart(0, "span");
16988
+ i0.ɵɵtext(1);
16989
+ i0.ɵɵpipe(2, "ccdLinkCasesReasonValue");
16990
+ i0.ɵɵtemplate(3, CheckYourAnswersComponent_tr_17_span_8_br_3_Template, 1, 0, "br", 19);
16991
+ i0.ɵɵelementEnd();
16992
+ } if (rf & 2) {
16993
+ const reason_r12 = ctx.$implicit;
16994
+ const isLast_r13 = ctx.last;
16995
+ i0.ɵɵadvance(1);
16996
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 2, reason_r12.reasonCode), "");
16997
+ i0.ɵɵadvance(2);
16998
+ i0.ɵɵproperty("ngIf", !isLast_r13);
16999
+ } }
17000
+ function CheckYourAnswersComponent_tr_17_td_10_Template(rf, ctx) { if (rf & 1) {
17001
+ const _r16 = i0.ɵɵgetCurrentView();
17002
+ i0.ɵɵelementStart(0, "td", 14);
17003
+ i0.ɵɵelementStart(1, "a", 15);
17004
+ i0.ɵɵlistener("click", function CheckYourAnswersComponent_tr_17_td_10_Template_a_click_1_listener() { i0.ɵɵrestoreView(_r16); const ctx_r15 = i0.ɵɵnextContext(2); return ctx_r15.onChange(); });
17005
+ i0.ɵɵtext(2, "Change");
17006
+ i0.ɵɵelementEnd();
17007
+ i0.ɵɵelementEnd();
17008
+ } }
17009
+ function CheckYourAnswersComponent_tr_17_Template(rf, ctx) { if (rf & 1) {
17010
+ i0.ɵɵelementStart(0, "tr", 7);
17011
+ i0.ɵɵelementStart(1, "td", 14);
17012
+ i0.ɵɵelementStart(2, "span");
17013
+ i0.ɵɵtext(3);
17014
+ i0.ɵɵelement(4, "br");
17015
+ i0.ɵɵtext(5);
17016
+ i0.ɵɵpipe(6, "ccdCaseReference");
17017
+ i0.ɵɵelementEnd();
17018
+ i0.ɵɵelementEnd();
17019
+ i0.ɵɵelementStart(7, "td", 14);
17020
+ i0.ɵɵtemplate(8, CheckYourAnswersComponent_tr_17_span_8_Template, 4, 4, "span", 17);
17021
+ i0.ɵɵelementEnd();
17022
+ i0.ɵɵelement(9, "td", 14);
17023
+ i0.ɵɵtemplate(10, CheckYourAnswersComponent_tr_17_td_10_Template, 3, 0, "td", 18);
17024
+ i0.ɵɵelementEnd();
17025
+ } if (rf & 2) {
17026
+ const case_r9 = ctx.$implicit;
17027
+ const ctx_r2 = i0.ɵɵnextContext();
17028
+ i0.ɵɵadvance(3);
17029
+ i0.ɵɵtextInterpolate1("", case_r9.caseName, " ");
17030
+ i0.ɵɵadvance(2);
17031
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 4, case_r9.caseReference), " ");
17032
+ i0.ɵɵadvance(3);
17033
+ i0.ɵɵproperty("ngForOf", case_r9.reasons);
17034
+ i0.ɵɵadvance(2);
17035
+ i0.ɵɵproperty("ngIf", ctx_r2.isLinkCasesJourney);
17036
+ } }
17037
+ function CheckYourAnswersComponent_tr_18_Template(rf, ctx) { if (rf & 1) {
17038
+ i0.ɵɵelementStart(0, "tr", 7);
17039
+ i0.ɵɵelementStart(1, "td", 20);
17040
+ i0.ɵɵtext(2, " None ");
17041
+ i0.ɵɵelementEnd();
17042
+ i0.ɵɵelementEnd();
17043
+ } }
17044
+ class CheckYourAnswersComponent {
17045
+ constructor(linkedCasesService) {
17046
+ this.linkedCasesService = linkedCasesService;
17047
+ this.linkedCasesStateEmitter = new EventEmitter();
17048
+ }
17049
+ ngOnInit() {
17050
+ this.isLinkCasesJourney = this.linkedCasesService.isLinkedCasesEventTrigger;
17051
+ this.linkedCasesTableCaption = this.linkedCasesService.isLinkedCasesEventTrigger ? 'Proposed case links' : 'Linked cases';
17052
+ this.linkedCases = this.linkedCasesService.linkedCases.filter(linkedCase => !linkedCase.unlink);
17053
+ this.casesToUnlink = this.linkedCasesService.linkedCases.filter(linkedCase => linkedCase.unlink && linkedCase.unlink === true);
17054
+ }
17055
+ onChange() {
17056
+ this.linkedCasesService.editMode = true;
17057
+ this.linkedCasesStateEmitter.emit({
17058
+ currentLinkedCasesPage: LinkedCasesPages.CHECK_YOUR_ANSWERS,
17059
+ navigateToPreviousPage: true,
17060
+ navigateToNextPage: true
17061
+ });
17062
+ }
17063
+ }
17064
+ CheckYourAnswersComponent.ɵfac = function CheckYourAnswersComponent_Factory(t) { return new (t || CheckYourAnswersComponent)(i0.ɵɵdirectiveInject(LinkedCasesService)); };
17065
+ CheckYourAnswersComponent.ɵcmp = 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) {
17066
+ i0.ɵɵelementStart(0, "div", 0);
17067
+ i0.ɵɵelementStart(1, "div", 1);
17068
+ i0.ɵɵelementStart(2, "h1", 2);
17069
+ i0.ɵɵtext(3, "Check your answers");
17070
+ i0.ɵɵelementEnd();
17071
+ i0.ɵɵtemplate(4, CheckYourAnswersComponent_table_4_Template, 11, 2, "table", 3);
17072
+ i0.ɵɵelementStart(5, "table", 4);
17073
+ i0.ɵɵelementStart(6, "caption", 5);
17074
+ i0.ɵɵtext(7);
17075
+ i0.ɵɵelementEnd();
17076
+ i0.ɵɵelementStart(8, "thead", 6);
17077
+ i0.ɵɵelementStart(9, "tr", 7);
17078
+ i0.ɵɵelementStart(10, "th", 8);
17079
+ i0.ɵɵtext(11, "Case name and number");
17080
+ i0.ɵɵelementEnd();
17081
+ i0.ɵɵelementStart(12, "th", 8);
17082
+ i0.ɵɵtext(13, "Reasons for case link");
17083
+ i0.ɵɵelementEnd();
17084
+ i0.ɵɵelement(14, "th", 8);
17085
+ i0.ɵɵtemplate(15, CheckYourAnswersComponent_th_15_Template, 1, 0, "th", 9);
17086
+ i0.ɵɵelementEnd();
17087
+ i0.ɵɵelementEnd();
17088
+ i0.ɵɵelementStart(16, "tbody", 10);
17089
+ i0.ɵɵtemplate(17, CheckYourAnswersComponent_tr_17_Template, 11, 6, "tr", 11);
17090
+ i0.ɵɵtemplate(18, CheckYourAnswersComponent_tr_18_Template, 3, 0, "tr", 12);
17091
+ i0.ɵɵelementEnd();
17092
+ i0.ɵɵelementEnd();
17093
+ i0.ɵɵelementEnd();
17094
+ i0.ɵɵelementEnd();
17095
+ } if (rf & 2) {
17096
+ i0.ɵɵadvance(4);
17097
+ i0.ɵɵproperty("ngIf", !ctx.isLinkCasesJourney);
17098
+ i0.ɵɵadvance(3);
17099
+ i0.ɵɵtextInterpolate(ctx.linkedCasesTableCaption);
17100
+ i0.ɵɵadvance(8);
17101
+ i0.ɵɵproperty("ngIf", ctx.isLinkCasesJourney);
17102
+ i0.ɵɵadvance(2);
17103
+ i0.ɵɵproperty("ngForOf", ctx.linkedCases);
17104
+ i0.ɵɵadvance(1);
17105
+ i0.ɵɵproperty("ngIf", !ctx.linkedCases.length);
17106
+ } }, styles: [".float-right[_ngcontent-%COMP%]{float:right}"] });
17107
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CheckYourAnswersComponent, [{
17108
+ type: Component,
17109
+ args: [{
17110
+ selector: 'ccd-linked-cases-check-your-answers',
17111
+ templateUrl: './check-your-answers.component.html',
17112
+ styleUrls: ['./check-your-answers.component.scss']
17113
+ }]
17114
+ }], function () { return [{ type: LinkedCasesService }]; }, { linkedCasesStateEmitter: [{
17115
+ type: Output
17116
+ }] }); })();
17117
+
17118
+ class ValidatorsUtils {
17119
+ numberLengthValidator(inputLength) {
17120
+ return (control) => {
17121
+ return control.value.length !== inputLength ? { isValid: false } : null;
17122
+ };
17123
+ }
17124
+ formArraySelectedValidator() {
17125
+ return (control) => {
17126
+ return control.value.every((option) => !option.selected) ? { isValid: false } : null;
17127
+ };
17128
+ }
17129
+ regexPattern(regexPattern) {
17130
+ return (control) => {
17131
+ const regex = new RegExp(regexPattern);
17132
+ return regex.test(control.value) ? null : { isValid: false };
17133
+ };
17134
+ }
17135
+ }
17136
+ ValidatorsUtils.ɵfac = function ValidatorsUtils_Factory(t) { return new (t || ValidatorsUtils)(); };
17137
+ ValidatorsUtils.ɵprov = i0.ɵɵdefineInjectable({ token: ValidatorsUtils, factory: ValidatorsUtils.ɵfac, providedIn: 'root' });
17138
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ValidatorsUtils, [{
17139
+ type: Injectable,
17140
+ args: [{ providedIn: 'root' }]
17141
+ }], null, null); })();
17142
+
17143
+ function LinkCasesComponent_div_8_span_4_Template(rf, ctx) { if (rf & 1) {
17144
+ i0.ɵɵelementStart(0, "span", 28);
17145
+ i0.ɵɵelementStart(1, "span", 29);
17146
+ i0.ɵɵtext(2, "Error:");
17147
+ i0.ɵɵelementEnd();
17148
+ i0.ɵɵtext(3);
17149
+ i0.ɵɵelementEnd();
17150
+ } if (rf & 2) {
17151
+ const ctx_r4 = i0.ɵɵnextContext(2);
17152
+ i0.ɵɵadvance(3);
17153
+ i0.ɵɵtextInterpolate1(" ", ctx_r4.caseNumberError, " ");
17154
+ } }
17155
+ function LinkCasesComponent_div_8_span_10_Template(rf, ctx) { if (rf & 1) {
17156
+ i0.ɵɵelementStart(0, "span", 28);
17157
+ i0.ɵɵelementStart(1, "span", 29);
17158
+ i0.ɵɵtext(2, "Error:");
17159
+ i0.ɵɵelementEnd();
17160
+ i0.ɵɵtext(3);
17161
+ i0.ɵɵelementEnd();
17162
+ } if (rf & 2) {
17163
+ const ctx_r5 = i0.ɵɵnextContext(2);
17164
+ i0.ɵɵadvance(3);
17165
+ i0.ɵɵtextInterpolate1(" ", ctx_r5.caseReasonError, " ");
17166
+ } }
17167
+ function LinkCasesComponent_div_8_div_12_Template(rf, ctx) { if (rf & 1) {
17168
+ i0.ɵɵelementStart(0, "div", 30);
17169
+ i0.ɵɵelement(1, "input", 31);
17170
+ i0.ɵɵelementStart(2, "label", 32);
17171
+ i0.ɵɵtext(3);
17172
+ i0.ɵɵelementEnd();
17173
+ i0.ɵɵelementEnd();
17174
+ } if (rf & 2) {
17175
+ const reason_r8 = ctx.$implicit;
17176
+ const pos_r9 = ctx.index;
17177
+ i0.ɵɵproperty("formGroupName", pos_r9);
17178
+ i0.ɵɵadvance(1);
17179
+ i0.ɵɵpropertyInterpolate("id", reason_r8.key);
17180
+ i0.ɵɵproperty("value", reason_r8.value_en);
17181
+ i0.ɵɵadvance(1);
17182
+ i0.ɵɵpropertyInterpolate("for", reason_r8.key);
17183
+ i0.ɵɵadvance(1);
17184
+ i0.ɵɵtextInterpolate(reason_r8.value_en);
17185
+ } }
17186
+ function LinkCasesComponent_div_8_span_15_Template(rf, ctx) { if (rf & 1) {
17187
+ i0.ɵɵelementStart(0, "span", 28);
17188
+ i0.ɵɵelementStart(1, "span", 29);
17189
+ i0.ɵɵtext(2, "Error:");
17190
+ i0.ɵɵelementEnd();
17191
+ i0.ɵɵtext(3);
17192
+ i0.ɵɵelementEnd();
17193
+ } if (rf & 2) {
17194
+ const ctx_r7 = i0.ɵɵnextContext(2);
17195
+ i0.ɵɵadvance(3);
17196
+ i0.ɵɵtextInterpolate1(" ", ctx_r7.caseSelectionError, " ");
17197
+ } }
17198
+ const _c0$m = function (a0) { return { "govuk-form-group--error": a0 }; };
17199
+ function LinkCasesComponent_div_8_Template(rf, ctx) { if (rf & 1) {
17200
+ const _r11 = i0.ɵɵgetCurrentView();
17201
+ i0.ɵɵelementStart(0, "div", 21);
17202
+ i0.ɵɵelementStart(1, "h3", 22);
17203
+ i0.ɵɵtext(2, "Enter case reference");
17204
+ i0.ɵɵelementEnd();
17205
+ i0.ɵɵelementStart(3, "div", 5);
17206
+ i0.ɵɵtemplate(4, LinkCasesComponent_div_8_span_4_Template, 4, 1, "span", 6);
17207
+ i0.ɵɵelement(5, "input", 23);
17208
+ i0.ɵɵelementEnd();
17209
+ i0.ɵɵelementStart(6, "h3", 22);
17210
+ i0.ɵɵtext(7, "Why should these cases be linked?");
17211
+ i0.ɵɵelementEnd();
17212
+ i0.ɵɵelementStart(8, "div", 24);
17213
+ i0.ɵɵtext(9, " Select all that apply. ");
17214
+ i0.ɵɵelementEnd();
17215
+ i0.ɵɵtemplate(10, LinkCasesComponent_div_8_span_10_Template, 4, 1, "span", 6);
17216
+ i0.ɵɵelementStart(11, "div", 25);
17217
+ i0.ɵɵtemplate(12, LinkCasesComponent_div_8_div_12_Template, 4, 5, "div", 26);
17218
+ i0.ɵɵelementEnd();
17219
+ i0.ɵɵelement(13, "br");
17220
+ i0.ɵɵelement(14, "br");
17221
+ i0.ɵɵtemplate(15, LinkCasesComponent_div_8_span_15_Template, 4, 1, "span", 6);
17222
+ i0.ɵɵelementStart(16, "button", 27);
17223
+ i0.ɵɵlistener("click", function LinkCasesComponent_div_8_Template_button_click_16_listener() { i0.ɵɵrestoreView(_r11); const ctx_r10 = i0.ɵɵnextContext(); return ctx_r10.submitCaseInfo(); });
17224
+ i0.ɵɵtext(17, "Propose case link");
17225
+ i0.ɵɵelementEnd();
17226
+ i0.ɵɵelementEnd();
17227
+ } if (rf & 2) {
17228
+ const ctx_r0 = i0.ɵɵnextContext();
17229
+ i0.ɵɵproperty("formGroup", ctx_r0.linkCaseForm);
17230
+ i0.ɵɵadvance(3);
17231
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(7, _c0$m, !!ctx_r0.caseNumberError));
17232
+ i0.ɵɵadvance(1);
17233
+ i0.ɵɵproperty("ngIf", ctx_r0.caseNumberError);
17234
+ i0.ɵɵadvance(6);
17235
+ i0.ɵɵproperty("ngIf", ctx_r0.caseReasonError);
17236
+ i0.ɵɵadvance(1);
17237
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(9, _c0$m, !!ctx_r0.caseReasonError));
17238
+ i0.ɵɵadvance(1);
17239
+ i0.ɵɵproperty("ngForOf", ctx_r0.linkedCasesService.linkCaseReasons);
17240
+ i0.ɵɵadvance(3);
17241
+ i0.ɵɵproperty("ngIf", ctx_r0.caseSelectionError);
17242
+ } }
17243
+ function LinkCasesComponent_span_13_Template(rf, ctx) { if (rf & 1) {
17244
+ i0.ɵɵelementStart(0, "span", 28);
17245
+ i0.ɵɵelementStart(1, "span", 29);
17246
+ i0.ɵɵtext(2, "Error:");
17247
+ i0.ɵɵelementEnd();
17248
+ i0.ɵɵtext(3);
17249
+ i0.ɵɵelementEnd();
17250
+ } if (rf & 2) {
17251
+ const ctx_r1 = i0.ɵɵnextContext();
17252
+ i0.ɵɵadvance(3);
17253
+ i0.ɵɵtextInterpolate1(" ", ctx_r1.noSelectedCaseError, " ");
17254
+ } }
17255
+ function LinkCasesComponent_tr_31_span_15_Template(rf, ctx) { if (rf & 1) {
17256
+ i0.ɵɵelementStart(0, "span");
17257
+ i0.ɵɵtext(1);
17258
+ i0.ɵɵpipe(2, "ccdLinkCasesReasonValue");
17259
+ i0.ɵɵelement(3, "br");
17260
+ i0.ɵɵelementEnd();
17261
+ } if (rf & 2) {
17262
+ const reason_r15 = ctx.$implicit;
17263
+ i0.ɵɵadvance(1);
17264
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, reason_r15.reasonCode));
17265
+ } }
17266
+ const _c1$6 = function (a0) { return { "table-group-error": a0 }; };
17267
+ function LinkCasesComponent_tr_31_Template(rf, ctx) { if (rf & 1) {
17268
+ const _r17 = i0.ɵɵgetCurrentView();
17269
+ i0.ɵɵelementStart(0, "tr", 10);
17270
+ i0.ɵɵelementStart(1, "td", 33);
17271
+ i0.ɵɵelement(2, "div", 34);
17272
+ i0.ɵɵelementStart(3, "span");
17273
+ i0.ɵɵtext(4);
17274
+ i0.ɵɵelement(5, "br");
17275
+ i0.ɵɵtext(6);
17276
+ i0.ɵɵpipe(7, "ccdCaseReference");
17277
+ i0.ɵɵelementEnd();
17278
+ i0.ɵɵelementEnd();
17279
+ i0.ɵɵelementStart(8, "td", 35);
17280
+ i0.ɵɵtext(9);
17281
+ i0.ɵɵelementEnd();
17282
+ i0.ɵɵelementStart(10, "td", 33);
17283
+ i0.ɵɵtext(11);
17284
+ i0.ɵɵelementEnd();
17285
+ i0.ɵɵelementStart(12, "td", 35);
17286
+ i0.ɵɵtext(13);
17287
+ i0.ɵɵelementEnd();
17288
+ i0.ɵɵelementStart(14, "td", 33);
17289
+ i0.ɵɵtemplate(15, LinkCasesComponent_tr_31_span_15_Template, 4, 3, "span", 36);
17290
+ i0.ɵɵelementEnd();
17291
+ i0.ɵɵelementStart(16, "td", 33);
17292
+ i0.ɵɵelementStart(17, "a", 37);
17293
+ i0.ɵɵlistener("click", function LinkCasesComponent_tr_31_Template_a_click_17_listener() { i0.ɵɵrestoreView(_r17); const pos_r13 = ctx.index; const case_r12 = ctx.$implicit; const ctx_r16 = i0.ɵɵnextContext(); return ctx_r16.onSelectedLinkedCaseRemove(pos_r13, case_r12.caseReference); });
17294
+ i0.ɵɵtext(18, "Remove");
17295
+ i0.ɵɵelementEnd();
17296
+ i0.ɵɵelementEnd();
17297
+ i0.ɵɵelementEnd();
17298
+ } if (rf & 2) {
17299
+ const case_r12 = ctx.$implicit;
17300
+ const ctx_r2 = i0.ɵɵnextContext();
17301
+ i0.ɵɵadvance(2);
17302
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(12, _c1$6, ctx_r2.caseSelectionError && case_r12.caseReference === ctx_r2.linkCaseForm.value.caseNumber));
17303
+ i0.ɵɵadvance(2);
17304
+ i0.ɵɵtextInterpolate1("", case_r12.caseName, " ");
17305
+ i0.ɵɵadvance(2);
17306
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(7, 10, case_r12.caseReference), "");
17307
+ i0.ɵɵadvance(2);
17308
+ i0.ɵɵproperty("title", case_r12.caseTypeDescription);
17309
+ i0.ɵɵadvance(1);
17310
+ i0.ɵɵtextInterpolate(case_r12.caseType);
17311
+ i0.ɵɵadvance(2);
17312
+ i0.ɵɵtextInterpolate(case_r12.caseService);
17313
+ i0.ɵɵadvance(1);
17314
+ i0.ɵɵproperty("title", case_r12.caseStateDescription);
17315
+ i0.ɵɵadvance(1);
17316
+ i0.ɵɵtextInterpolate(case_r12.caseState);
17317
+ i0.ɵɵadvance(2);
17318
+ i0.ɵɵproperty("ngForOf", case_r12.reasons);
17319
+ i0.ɵɵadvance(2);
17320
+ i0.ɵɵattribute("id", case_r12.caseReference);
17321
+ } }
17322
+ function LinkCasesComponent_tr_32_Template(rf, ctx) { if (rf & 1) {
17323
+ i0.ɵɵelementStart(0, "tr", 10);
17324
+ i0.ɵɵelementStart(1, "td", 38);
17325
+ i0.ɵɵtext(2, " None ");
17326
+ i0.ɵɵelementEnd();
17327
+ i0.ɵɵelementEnd();
17328
+ } }
17329
+ class LinkCasesComponent {
17330
+ constructor(casesService, fb, validatorsUtils, linkedCasesService) {
17331
+ this.casesService = casesService;
17332
+ this.fb = fb;
17333
+ this.validatorsUtils = validatorsUtils;
17334
+ this.linkedCasesService = linkedCasesService;
17335
+ this.linkedCasesStateEmitter = new EventEmitter();
17336
+ this.errorMessages = [];
17337
+ this.selectedCases = [];
17338
+ this.ISO_FORMAT = 'YYYY-MM-DDTHH:mm:ss.SSS';
17339
+ }
17340
+ ngOnInit() {
17341
+ this.initForm();
17342
+ if (this.linkedCasesService.editMode) {
17343
+ // this may have includes the currently added one but yet to be submitted.
17344
+ this.selectedCases = this.linkedCasesService.linkedCases;
17345
+ }
17346
+ else if (this.linkedCasesService.initialCaseLinks.length !== this.linkedCasesService.caseFieldValue.length) {
17347
+ this.linkedCasesService.linkedCases = this.linkedCasesService.initialCaseLinks;
17348
+ }
17349
+ }
17350
+ initForm() {
17351
+ this.linkCaseForm = this.fb.group({
17352
+ caseNumber: ['', [Validators.minLength(16), this.validatorsUtils.regexPattern(Patterns.CASE_REF)]],
17353
+ reasonType: this.getReasonTypeFormArray,
17354
+ });
17355
+ }
17356
+ get getReasonTypeFormArray() {
17357
+ return this.fb.array(this.linkedCasesService.linkCaseReasons.map((val) => this.fb.group({
17358
+ key: [val.key],
17359
+ value_en: [val.value_en],
17360
+ value_cy: [val.value_cy],
17361
+ hint_text_en: [val.hint_text_en],
17362
+ hint_text_cy: [val.hint_text_cy],
17363
+ lov_order: [val.lov_order],
17364
+ parent_key: [val.parent_key],
17365
+ selected: [!!val.selected],
17366
+ })), this.validatorsUtils.formArraySelectedValidator());
17367
+ }
17368
+ submitCaseInfo() {
17369
+ this.errorMessages = [];
17370
+ this.caseReasonError = null;
17371
+ this.caseNumberError = null;
17372
+ this.caseSelectionError = null;
17373
+ this.noSelectedCaseError = null;
17374
+ if (this.linkCaseForm.valid &&
17375
+ !this.isCaseSelected(this.selectedCases) &&
17376
+ !this.isCaseSelected(this.linkedCasesService.linkedCases) &&
17377
+ !this.isCaseSelectedSameAsCurrentCase()) {
17378
+ this.getCaseInfo();
17379
+ }
17380
+ else {
17381
+ this.showErrorInfo();
17382
+ }
17383
+ }
17384
+ isCaseSelected(linkedCases) {
17385
+ if (linkedCases.length === 0) {
17386
+ return false;
17387
+ }
17388
+ const caseNumber = this.linkCaseForm.value.caseNumber;
17389
+ return !!linkedCases.find((caseLink) => caseLink.caseReference.split('-').join('') === caseNumber.split('-').join(''));
17390
+ }
17391
+ isCaseSelectedSameAsCurrentCase() {
17392
+ return this.linkCaseForm.value.caseNumber.split('-').join('') === this.linkedCasesService.caseId.split('-').join('');
17393
+ }
17394
+ showErrorInfo() {
17395
+ if (this.linkCaseForm.controls.caseNumber.invalid) {
17396
+ this.caseNumberError = LinkedCasesErrorMessages.CaseNumberError;
17397
+ this.errorMessages.push({
17398
+ title: 'dummy-case-number',
17399
+ description: LinkedCasesErrorMessages.CaseNumberError,
17400
+ fieldId: 'caseNumber',
17401
+ });
17402
+ }
17403
+ if (this.linkCaseForm.controls.reasonType.invalid) {
17404
+ this.caseReasonError = LinkedCasesErrorMessages.ReasonSelectionError;
17405
+ this.errorMessages.push({
17406
+ title: 'dummy-case-reason',
17407
+ description: LinkedCasesErrorMessages.ReasonSelectionError,
17408
+ fieldId: 'caseReason',
17409
+ });
17410
+ }
17411
+ if (this.isCaseSelected(this.selectedCases)) {
17412
+ this.caseSelectionError = LinkedCasesErrorMessages.CaseProposedError;
17413
+ this.errorMessages.push({
17414
+ title: 'dummy-case-number',
17415
+ description: LinkedCasesErrorMessages.CaseProposedError,
17416
+ fieldId: 'caseNumber',
17417
+ });
17418
+ }
17419
+ if (this.isCaseSelected(this.linkedCasesService.linkedCases)) {
17420
+ this.caseSelectionError = LinkedCasesErrorMessages.CasesLinkedError;
17421
+ this.errorMessages.push({
17422
+ title: 'dummy-case-number',
17423
+ description: LinkedCasesErrorMessages.CasesLinkedError,
17424
+ fieldId: 'caseNumber',
17425
+ });
17426
+ }
17427
+ if (this.linkCaseForm.value.caseNumber.split('-').join('') === this.linkedCasesService.caseId.split('-').join('')) {
17428
+ this.errorMessages.push({
17429
+ title: 'dummy-case-number',
17430
+ description: LinkedCasesErrorMessages.ProposedCaseWithIn,
17431
+ fieldId: 'caseNumber',
17432
+ });
17433
+ }
17434
+ window.scrollTo(0, 0);
17435
+ this.emitLinkedCasesState(false);
17436
+ }
17437
+ getCaseInfo() {
17438
+ const caseNumberData = this.linkCaseForm.value.caseNumber.replace(/[- ]/g, '');
17439
+ this.casesService
17440
+ .getCaseViewV2(caseNumberData)
17441
+ .subscribe((caseView) => {
17442
+ this.linkedCasesService.caseDetails = caseView;
17443
+ const caseLink = {
17444
+ caseReference: caseView.case_id,
17445
+ reasons: this.getSelectedCaseReasons(),
17446
+ createdDateTime: moment(new Date()).format(this.ISO_FORMAT),
17447
+ caseType: caseView.case_type.name || '',
17448
+ caseTypeDescription: caseView.case_type.description || '',
17449
+ caseState: caseView.state.name || '',
17450
+ caseStateDescription: caseView.state.description || '',
17451
+ caseService: caseView.case_type && caseView.case_type.jurisdiction && caseView.case_type.jurisdiction.description || '',
17452
+ caseName: this.linkedCasesService.getCaseName(caseView),
17453
+ };
17454
+ const ccdApiCaseLinkData = {
17455
+ CaseReference: caseView.case_id,
17456
+ CaseType: caseView.case_type.id,
17457
+ CreatedDateTime: moment(new Date()).format(this.ISO_FORMAT),
17458
+ ReasonForLink: this.getSelectedCCDTypeCaseReason()
17459
+ };
17460
+ if (!this.linkedCasesService.caseFieldValue) {
17461
+ this.linkedCasesService.caseFieldValue = [];
17462
+ }
17463
+ this.linkedCasesService.caseFieldValue.push({ id: caseView.case_id.toString(), value: ccdApiCaseLinkData });
17464
+ this.selectedCases.push(caseLink);
17465
+ this.initForm();
17466
+ this.emitLinkedCasesState(false);
17467
+ }, (error) => {
17468
+ this.caseNumberError = LinkedCasesErrorMessages.CaseCheckAgainError;
17469
+ this.errorMessages.push({
17470
+ title: 'dummy-case-number',
17471
+ description: LinkedCasesErrorMessages.CaseCheckAgainError,
17472
+ fieldId: 'caseNumber',
17473
+ });
17474
+ this.emitLinkedCasesState(false);
17475
+ window.scrollTo(0, 0);
17476
+ return throwError(error);
17477
+ });
17478
+ }
17479
+ // Return linked cases state and error messages to the parent
17480
+ emitLinkedCasesState(isNavigateToNextPage) {
17481
+ this.linkedCasesStateEmitter.emit({
17482
+ currentLinkedCasesPage: LinkedCasesPages.LINK_CASE,
17483
+ errorMessages: this.errorMessages,
17484
+ navigateToNextPage: isNavigateToNextPage,
17485
+ });
17486
+ }
17487
+ getSelectedCaseReasons() {
17488
+ const selectedReasons = [];
17489
+ this.linkCaseForm.controls.reasonType.value.forEach((selectedReason) => {
17490
+ if (selectedReason.selected) {
17491
+ selectedReasons.push({
17492
+ reasonCode: selectedReason.key
17493
+ });
17494
+ }
17495
+ });
17496
+ return selectedReasons;
17497
+ }
17498
+ getSelectedCCDTypeCaseReason() {
17499
+ const selectedReasons = [];
17500
+ this.linkCaseForm.controls.reasonType.value.forEach((selectedReason) => {
17501
+ if (selectedReason.selected) {
17502
+ selectedReasons.push({
17503
+ value: {
17504
+ Reason: selectedReason.key,
17505
+ }
17506
+ });
17507
+ }
17508
+ });
17509
+ return selectedReasons;
17510
+ }
17511
+ onSelectedLinkedCaseRemove(pos, selectedCaseReference) {
17512
+ const caseFieldValue = this.linkedCasesService.caseFieldValue || [];
17513
+ const updatedItems = caseFieldValue.filter(item => item.value && item.value.CaseReference !== selectedCaseReference);
17514
+ if (updatedItems) {
17515
+ this.linkedCasesService.caseFieldValue = updatedItems;
17516
+ }
17517
+ this.selectedCases.splice(pos, 1);
17518
+ }
17519
+ onNext() {
17520
+ this.errorMessages = [];
17521
+ this.caseReasonError = null;
17522
+ this.caseNumberError = null;
17523
+ this.caseSelectionError = null;
17524
+ this.noSelectedCaseError = null;
17525
+ let navigateToNextPage = true;
17526
+ if (this.selectedCases.length) {
17527
+ this.linkedCasesService.linkedCases = this.selectedCases;
17528
+ }
17529
+ else {
17530
+ this.noSelectedCaseError = LinkedCasesErrorMessages.CaseSelectionError;
17531
+ this.errorMessages.push({
17532
+ title: 'dummy-case-selection',
17533
+ description: LinkedCasesErrorMessages.CaseSelectionError,
17534
+ fieldId: 'caseReason',
17535
+ });
17536
+ navigateToNextPage = false;
17537
+ }
17538
+ this.emitLinkedCasesState(navigateToNextPage);
17539
+ }
17540
+ }
17541
+ LinkCasesComponent.ɵfac = function LinkCasesComponent_Factory(t) { return new (t || LinkCasesComponent)(i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(i2.FormBuilder), i0.ɵɵdirectiveInject(ValidatorsUtils), i0.ɵɵdirectiveInject(LinkedCasesService)); };
17542
+ LinkCasesComponent.ɵcmp = 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"], ["id", "waste-hint", 1, "govuk-hint"], ["data-module", "govuk-checkboxes", "formArrayName", "reasonType", "id", "caseReason", 1, "govuk-checkboxes", 3, "ngClass"], ["class", "govuk-checkboxes__item", 3, "formGroupName", 4, "ngFor", "ngForOf"], ["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, "id", "value"], [1, "govuk-label", "govuk-checkboxes__label", 3, "for"], [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) {
17543
+ i0.ɵɵelementStart(0, "div", 0);
17544
+ i0.ɵɵelementStart(1, "div", 1);
17545
+ i0.ɵɵelementStart(2, "div");
17546
+ i0.ɵɵelementStart(3, "span", 2);
17547
+ i0.ɵɵtext(4);
17548
+ i0.ɵɵpipe(5, "ccdCaseReference");
17549
+ i0.ɵɵelementEnd();
17550
+ i0.ɵɵelementStart(6, "h1", 3);
17551
+ i0.ɵɵtext(7, "Select a\u00A0case you want to link to this case");
17552
+ i0.ɵɵelementEnd();
17553
+ i0.ɵɵtemplate(8, LinkCasesComponent_div_8_Template, 18, 11, "div", 4);
17554
+ i0.ɵɵelement(9, "hr");
17555
+ i0.ɵɵelement(10, "br");
17556
+ i0.ɵɵelement(11, "br");
17557
+ i0.ɵɵelementStart(12, "div", 5);
17558
+ i0.ɵɵtemplate(13, LinkCasesComponent_span_13_Template, 4, 1, "span", 6);
17559
+ i0.ɵɵelementStart(14, "table", 7);
17560
+ i0.ɵɵelementStart(15, "caption", 8);
17561
+ i0.ɵɵtext(16, "Proposed case links ");
17562
+ i0.ɵɵelementEnd();
17563
+ i0.ɵɵelementStart(17, "thead", 9);
17564
+ i0.ɵɵelementStart(18, "tr", 10);
17565
+ i0.ɵɵelementStart(19, "th", 11);
17566
+ i0.ɵɵtext(20, "Case name and number");
17567
+ i0.ɵɵelementEnd();
17568
+ i0.ɵɵelementStart(21, "th", 12);
17569
+ i0.ɵɵtext(22, "Case type ");
17570
+ i0.ɵɵelementEnd();
17571
+ i0.ɵɵelementStart(23, "th", 13);
17572
+ i0.ɵɵtext(24, "Service");
17573
+ i0.ɵɵelementEnd();
17574
+ i0.ɵɵelementStart(25, "th", 13);
17575
+ i0.ɵɵtext(26, "State");
17576
+ i0.ɵɵelementEnd();
17577
+ i0.ɵɵelementStart(27, "th", 14);
17578
+ i0.ɵɵtext(28, "Reasons for case link");
17579
+ i0.ɵɵelementEnd();
17580
+ i0.ɵɵelement(29, "th", 15);
17581
+ i0.ɵɵelementEnd();
17582
+ i0.ɵɵelementEnd();
17583
+ i0.ɵɵelementStart(30, "tbody", 16);
17584
+ i0.ɵɵtemplate(31, LinkCasesComponent_tr_31_Template, 19, 14, "tr", 17);
17585
+ i0.ɵɵtemplate(32, LinkCasesComponent_tr_32_Template, 3, 0, "tr", 18);
17586
+ i0.ɵɵelementEnd();
17587
+ i0.ɵɵelementEnd();
17588
+ i0.ɵɵelementEnd();
17589
+ i0.ɵɵelementStart(33, "div", 19);
17590
+ i0.ɵɵelementStart(34, "button", 20);
17591
+ i0.ɵɵlistener("click", function LinkCasesComponent_Template_button_click_34_listener() { return ctx.onNext(); });
17592
+ i0.ɵɵtext(35, "Next");
17593
+ i0.ɵɵelementEnd();
17594
+ i0.ɵɵelementEnd();
17595
+ i0.ɵɵelementEnd();
17596
+ i0.ɵɵelementEnd();
17597
+ i0.ɵɵelementEnd();
17598
+ } if (rf & 2) {
17599
+ i0.ɵɵadvance(4);
17600
+ i0.ɵɵtextInterpolate2("Link cases to ", ctx.linkedCasesService.caseName, " ", i0.ɵɵpipeBind1(5, 7, ctx.linkedCasesService.caseId), "");
17601
+ i0.ɵɵadvance(4);
17602
+ i0.ɵɵproperty("ngIf", ctx.linkCaseForm);
17603
+ i0.ɵɵadvance(4);
17604
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(9, _c0$m, !!ctx.noSelectedCaseError));
17605
+ i0.ɵɵadvance(1);
17606
+ i0.ɵɵproperty("ngIf", ctx.noSelectedCaseError);
17607
+ i0.ɵɵadvance(18);
17608
+ i0.ɵɵproperty("ngForOf", ctx.selectedCases);
17609
+ i0.ɵɵadvance(1);
17610
+ i0.ɵɵproperty("ngIf", !ctx.selectedCases.length);
17611
+ } }, styles: [".no-visited-state[_ngcontent-%COMP%]{color:#1d70b8;cursor:pointer}.no-visited-state[_ngcontent-%COMP%]:hover{color:#003078}.govuk-checkboxes[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex-wrap:wrap;max-height:500px;width:100%;overflow-x:auto;overflow-y:hidden;padding-top:5px}.govuk-checkboxes[_ngcontent-%COMP%] .govuk-checkboxes__item[_ngcontent-%COMP%]{display:flex} .govuk-width-container .screen-990 .width-50{width:100%}.govuk-table__row[_ngcontent-%COMP%]{position:relative}.govuk-table__row[_ngcontent-%COMP%] .table-group-error[_ngcontent-%COMP%]{position:absolute;height:calc(100% - 20px);margin-left:-15px}"] });
17612
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LinkCasesComponent, [{
17613
+ type: Component,
17614
+ args: [{
17615
+ selector: 'ccd-link-cases',
17616
+ styleUrls: ['./link-cases.component.scss'],
17617
+ templateUrl: './link-cases.component.html',
17618
+ }]
17619
+ }], function () { return [{ type: CasesService }, { type: i2.FormBuilder }, { type: ValidatorsUtils }, { type: LinkedCasesService }]; }, { linkedCasesStateEmitter: [{
17620
+ type: Output
17621
+ }] }); })();
17622
+
17623
+ function LinkedCasesFromTableComponent_a_0_Template(rf, ctx) { if (rf & 1) {
17624
+ const _r3 = i0.ɵɵgetCurrentView();
17625
+ i0.ɵɵelementStart(0, "a", 2);
17626
+ i0.ɵɵlistener("click", function LinkedCasesFromTableComponent_a_0_Template_a_click_0_listener() { i0.ɵɵrestoreView(_r3); const ctx_r2 = i0.ɵɵnextContext(); return ctx_r2.onClick(); });
17627
+ i0.ɵɵtext(1);
17628
+ i0.ɵɵelementEnd();
17629
+ } if (rf & 2) {
17630
+ const ctx_r0 = i0.ɵɵnextContext();
17631
+ i0.ɵɵadvance(1);
17632
+ i0.ɵɵtextInterpolate(ctx_r0.showHideLinkText);
17633
+ } }
17634
+ function LinkedCasesFromTableComponent_table_1_tbody_13_tr_1_td_18_span_1_Template(rf, ctx) { if (rf & 1) {
17635
+ i0.ɵɵelementStart(0, "span");
17636
+ i0.ɵɵtext(1);
17637
+ i0.ɵɵpipe(2, "ccdLinkCasesReasonValue");
17638
+ i0.ɵɵelement(3, "br");
17639
+ i0.ɵɵelementEnd();
17640
+ } if (rf & 2) {
17641
+ const reason_r11 = ctx.$implicit;
17642
+ i0.ɵɵadvance(1);
17643
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 1, reason_r11.reasonCode), " ");
17644
+ } }
17645
+ function LinkedCasesFromTableComponent_table_1_tbody_13_tr_1_td_18_Template(rf, ctx) { if (rf & 1) {
17646
+ i0.ɵɵelementStart(0, "td", 14);
17647
+ i0.ɵɵtemplate(1, LinkedCasesFromTableComponent_table_1_tbody_13_tr_1_td_18_span_1_Template, 4, 3, "span", 17);
17648
+ i0.ɵɵelementEnd();
17649
+ } if (rf & 2) {
17650
+ const details_r9 = ctx.$implicit;
17651
+ i0.ɵɵadvance(1);
17652
+ i0.ɵɵproperty("ngForOf", details_r9.reasons);
17653
+ } }
17654
+ function LinkedCasesFromTableComponent_table_1_tbody_13_tr_1_Template(rf, ctx) { if (rf & 1) {
17655
+ i0.ɵɵelementStart(0, "tr", 5);
17656
+ i0.ɵɵelementStart(1, "td", 11);
17657
+ i0.ɵɵelementStart(2, "p", 12);
17658
+ i0.ɵɵelementStart(3, "a", 13);
17659
+ i0.ɵɵelementStart(4, "span");
17660
+ i0.ɵɵtext(5);
17661
+ i0.ɵɵelement(6, "br");
17662
+ i0.ɵɵtext(7);
17663
+ i0.ɵɵpipe(8, "ccdCaseReference");
17664
+ i0.ɵɵelementEnd();
17665
+ i0.ɵɵelementEnd();
17666
+ i0.ɵɵelementEnd();
17667
+ i0.ɵɵelementEnd();
17668
+ i0.ɵɵelementStart(9, "td", 14);
17669
+ i0.ɵɵelementStart(10, "span", 15);
17670
+ i0.ɵɵtext(11);
17671
+ i0.ɵɵelementEnd();
17672
+ i0.ɵɵelementEnd();
17673
+ i0.ɵɵelementStart(12, "td", 14);
17674
+ i0.ɵɵelementStart(13, "span");
17675
+ i0.ɵɵtext(14);
17676
+ i0.ɵɵelementEnd();
17677
+ i0.ɵɵelementEnd();
17678
+ i0.ɵɵelementStart(15, "td", 14);
17679
+ i0.ɵɵelementStart(16, "span", 15);
17680
+ i0.ɵɵtext(17);
17681
+ i0.ɵɵelementEnd();
17682
+ i0.ɵɵelementEnd();
17683
+ i0.ɵɵtemplate(18, LinkedCasesFromTableComponent_table_1_tbody_13_tr_1_td_18_Template, 2, 1, "td", 16);
17684
+ i0.ɵɵelementEnd();
17685
+ } if (rf & 2) {
17686
+ const case_r7 = ctx.$implicit;
17687
+ i0.ɵɵadvance(3);
17688
+ i0.ɵɵpropertyInterpolate1("href", "cases/case-details/", case_r7.caseReference, "", i0.ɵɵsanitizeUrl);
17689
+ i0.ɵɵadvance(2);
17690
+ i0.ɵɵtextInterpolate1("", case_r7.caseNameHmctsInternal, " ");
17691
+ i0.ɵɵadvance(2);
17692
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(8, 9, case_r7.caseReference), "");
17693
+ i0.ɵɵadvance(3);
17694
+ i0.ɵɵproperty("title", case_r7.ccdCaseTypeDescription);
17695
+ i0.ɵɵadvance(1);
17696
+ i0.ɵɵtextInterpolate(case_r7.ccdCaseType);
17697
+ i0.ɵɵadvance(3);
17698
+ i0.ɵɵtextInterpolate(case_r7.ccdJurisdiction);
17699
+ i0.ɵɵadvance(2);
17700
+ i0.ɵɵproperty("title", case_r7.stateDescription);
17701
+ i0.ɵɵadvance(1);
17702
+ i0.ɵɵtextInterpolate(case_r7.state);
17703
+ i0.ɵɵadvance(1);
17704
+ i0.ɵɵproperty("ngForOf", case_r7.linkDetails);
17705
+ } }
17706
+ function LinkedCasesFromTableComponent_table_1_tbody_13_tr_2_Template(rf, ctx) { if (rf & 1) {
17707
+ i0.ɵɵelementStart(0, "tr", 5);
17708
+ i0.ɵɵelementStart(1, "td", 18);
17709
+ i0.ɵɵtext(2, " None ");
17710
+ i0.ɵɵelementEnd();
17711
+ i0.ɵɵelementEnd();
17712
+ } }
17713
+ function LinkedCasesFromTableComponent_table_1_tbody_13_Template(rf, ctx) { if (rf & 1) {
17714
+ i0.ɵɵelementStart(0, "tbody", 8);
17715
+ i0.ɵɵtemplate(1, LinkedCasesFromTableComponent_table_1_tbody_13_tr_1_Template, 19, 11, "tr", 9);
17716
+ i0.ɵɵtemplate(2, LinkedCasesFromTableComponent_table_1_tbody_13_tr_2_Template, 3, 0, "tr", 10);
17717
+ i0.ɵɵelementEnd();
17718
+ } if (rf & 2) {
17719
+ const ctx_r4 = i0.ɵɵnextContext(2);
17720
+ i0.ɵɵadvance(1);
17721
+ i0.ɵɵproperty("ngForOf", ctx_r4.getLinkedCasesResponse);
17722
+ i0.ɵɵadvance(1);
17723
+ i0.ɵɵproperty("ngIf", ctx_r4.noLinkedCases);
17724
+ } }
17725
+ function LinkedCasesFromTableComponent_table_1_Template(rf, ctx) { if (rf & 1) {
17726
+ i0.ɵɵelementStart(0, "table", 3);
17727
+ i0.ɵɵelementStart(1, "thead", 4);
17728
+ i0.ɵɵelementStart(2, "tr", 5);
17729
+ i0.ɵɵelementStart(3, "th", 6);
17730
+ i0.ɵɵtext(4, "Case name and number");
17731
+ i0.ɵɵelementEnd();
17732
+ i0.ɵɵelementStart(5, "th", 6);
17733
+ i0.ɵɵtext(6, "Case type ");
17734
+ i0.ɵɵelementEnd();
17735
+ i0.ɵɵelementStart(7, "th", 6);
17736
+ i0.ɵɵtext(8, "Service");
17737
+ i0.ɵɵelementEnd();
17738
+ i0.ɵɵelementStart(9, "th", 6);
17739
+ i0.ɵɵtext(10, "State");
17740
+ i0.ɵɵelementEnd();
17741
+ i0.ɵɵelementStart(11, "th", 6);
17742
+ i0.ɵɵtext(12, "Reasons for case link");
17743
+ i0.ɵɵelementEnd();
17744
+ i0.ɵɵelementEnd();
17745
+ i0.ɵɵelementEnd();
17746
+ i0.ɵɵtemplate(13, LinkedCasesFromTableComponent_table_1_tbody_13_Template, 3, 2, "tbody", 7);
17747
+ i0.ɵɵelementEnd();
17748
+ } if (rf & 2) {
17749
+ const ctx_r1 = i0.ɵɵnextContext();
17750
+ i0.ɵɵadvance(13);
17751
+ i0.ɵɵproperty("ngIf", ctx_r1.getLinkedCasesResponse && (!ctx_r1.isServerError && !ctx_r1.linkedCasesService.isServerReasonCodeError));
17752
+ } }
17753
+ var PageType;
17754
+ (function (PageType) {
17755
+ PageType["LINKEDCASESTABLBEVIEW"] = "linkedCasesTableView";
17756
+ PageType["PROPOSEDCASELINK"] = "proposedCaseLink";
17757
+ })(PageType || (PageType = {}));
17758
+ class LinkedCasesFromTableComponent {
17759
+ constructor(route, casesService, linkedCasesService) {
17760
+ this.route = route;
17761
+ this.casesService = casesService;
17762
+ this.linkedCasesService = linkedCasesService;
17763
+ this.notifyAPIFailure = new EventEmitter(false);
17764
+ this.pageType = PageType;
17765
+ this.getLinkedCasesResponse = [];
17766
+ this.showHideLinkText = 'Show';
17767
+ this.noLinkedCases = true;
17768
+ this.isServerError = false;
17769
+ }
17770
+ ngAfterViewInit() {
17771
+ const labelField = document.getElementsByClassName('case-viewer-label');
17772
+ if (labelField && labelField.length) {
17773
+ labelField[0].replaceWith('');
17774
+ }
17775
+ }
17776
+ ngOnInit() {
17777
+ this.fetchPageData();
17778
+ if (this.route.snapshot.data.case) {
17779
+ this.linkedCasesService.caseDetails = this.route.snapshot.data.case;
17780
+ }
17781
+ }
17782
+ fetchPageData() {
17783
+ this.caseId = this.route.snapshot.data.case.case_id;
17784
+ this.getLinkedCases().subscribe(response => {
17785
+ this.isServerError = false;
17786
+ this.getLinkedCasesResponse = response.linkedCases && response.linkedCases.map(item => {
17787
+ const mappedCasetype = this.mapLookupIDToValueFromJurisdictions('CASE_TYPE', item.ccdCaseType);
17788
+ const mappedCasetypeDescription = this.mapLookupIDToValueFromJurisdictions('CASE_TYPE_DESCRIPTION', item.ccdCaseType);
17789
+ const mappedCaseState = this.mapLookupIDToValueFromJurisdictions('STATE', item.state);
17790
+ const mappedCaseStateDescription = this.mapLookupIDToValueFromJurisdictions('STATE_DESCRIPTION', item.state);
17791
+ const mappedCaseService = this.mapLookupIDToValueFromJurisdictions('JURISDICTION', item.ccdJurisdiction);
17792
+ return Object.assign(Object.assign({}, item), { ccdCaseType: mappedCasetype, ccdCaseTypeDescription: mappedCasetypeDescription, ccdJurisdiction: mappedCaseService, state: mappedCaseState, stateDescription: mappedCaseStateDescription, caseNameHmctsInternal: item.caseNameHmctsInternal || LinkedCasesFromTableComponent.CASE_NAME_MISSING_TEXT });
17793
+ });
17794
+ this.noLinkedCases = !response.linkedCases || !response.linkedCases.length;
17795
+ }, err => {
17796
+ this.isServerError = true;
17797
+ this.notifyAPIFailure.emit(true);
17798
+ });
17799
+ }
17800
+ getLinkedCases() {
17801
+ return this.casesService.getLinkedCases(this.caseId);
17802
+ }
17803
+ mapLookupIDToValueFromJurisdictions(fieldName, fieldValue) {
17804
+ return this.linkedCasesService.mapLookupIDToValueFromJurisdictions(fieldName, fieldValue);
17805
+ }
17806
+ onClick() {
17807
+ this.showHideLinkText = this.showHideLinkText === 'Show'
17808
+ ? 'Hide'
17809
+ : 'Show';
17810
+ }
17811
+ }
17812
+ LinkedCasesFromTableComponent.CASE_NAME_MISSING_TEXT = 'Case name missing';
17813
+ LinkedCasesFromTableComponent.ɵfac = function LinkedCasesFromTableComponent_Factory(t) { return new (t || LinkedCasesFromTableComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(LinkedCasesService)); };
17814
+ LinkedCasesFromTableComponent.ɵcmp = i0.ɵɵdefineComponent({ type: LinkedCasesFromTableComponent, selectors: [["ccd-linked-cases-from-table"]], inputs: { caseField: "caseField" }, outputs: { notifyAPIFailure: "notifyAPIFailure" }, decls: 2, vars: 2, consts: [["id", "show-hide-link", "class", "govuk-link", "href", "javascript:void(0)", 3, "click", 4, "ngIf"], ["aria-describedby", "table to display cases linked from", 4, "ngIf"], ["id", "show-hide-link", "href", "javascript:void(0)", 1, "govuk-link", 3, "click"], ["aria-describedby", "table to display cases linked from"], [1, "govuk-table__head"], [1, "govuk-table__row"], ["scope", "col", "width", "20%", 1, "govuk-table__header", "case-table-column"], ["class", "govuk-table__body", 4, "ngIf"], [1, "govuk-table__body"], ["class", "govuk-table__row", 4, "ngFor", "ngForOf"], ["class", "govuk-table__row", 4, "ngIf"], [1, "govuk-table__header", "case-table-column", "width-20"], [1, "govuk-body"], ["target", "_blank", "rel", "noopener", 1, "govuk-link", 3, "href"], [1, "case-table-column"], [3, "title"], ["class", "case-table-column", 4, "ngFor", "ngForOf"], [4, "ngFor", "ngForOf"], ["colspan", "5", 1, "govuk-table__cell"]], template: function LinkedCasesFromTableComponent_Template(rf, ctx) { if (rf & 1) {
17815
+ i0.ɵɵtemplate(0, LinkedCasesFromTableComponent_a_0_Template, 2, 1, "a", 0);
17816
+ i0.ɵɵtemplate(1, LinkedCasesFromTableComponent_table_1_Template, 14, 1, "table", 1);
17817
+ } if (rf & 2) {
17818
+ i0.ɵɵproperty("ngIf", !ctx.noLinkedCases && !ctx.isServerError);
17819
+ i0.ɵɵadvance(1);
17820
+ i0.ɵɵproperty("ngIf", ctx.getLinkedCasesResponse && ctx.showHideLinkText === "Hide" || ctx.noLinkedCases);
17821
+ } }, styles: [".case-table-column[_ngcontent-%COMP%]{min-width:20%;max-width:20%}.heading-h2[_ngcontent-%COMP%]{margin-bottom:0}"] });
17822
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LinkedCasesFromTableComponent, [{
17823
+ type: Component,
17824
+ args: [{
17825
+ selector: 'ccd-linked-cases-from-table',
17826
+ templateUrl: './linked-cases-from-table.component.html',
17827
+ styleUrls: ['./linked-cases-from-table.component.scss']
17828
+ }]
17829
+ }], function () { return [{ type: i1$1.ActivatedRoute }, { type: CasesService }, { type: LinkedCasesService }]; }, { caseField: [{
17830
+ type: Input
17831
+ }], notifyAPIFailure: [{
17832
+ type: Output
17833
+ }] }); })();
17834
+
17835
+ function LinkedCasesToTableComponent_table_2_tr_14_td_18_span_1_a_4_Template(rf, ctx) { if (rf & 1) {
17836
+ i0.ɵɵelementStart(0, "a", 16);
17837
+ i0.ɵɵtext(1);
17838
+ i0.ɵɵelementEnd();
17839
+ } if (rf & 2) {
17840
+ const case_r3 = i0.ɵɵnextContext(3).$implicit;
17841
+ const ctx_r9 = i0.ɵɵnextContext(2);
17842
+ i0.ɵɵpropertyInterpolate1("href", "cases/case-details/", case_r3.caseReference, "", i0.ɵɵsanitizeUrl);
17843
+ i0.ɵɵadvance(1);
17844
+ i0.ɵɵtextInterpolate(ctx_r9.getCaseRefereneLink(case_r3.caseReference));
17845
+ } }
17846
+ function LinkedCasesToTableComponent_table_2_tr_14_td_18_span_1_br_5_Template(rf, ctx) { if (rf & 1) {
17847
+ i0.ɵɵelement(0, "br");
17848
+ } }
17849
+ function LinkedCasesToTableComponent_table_2_tr_14_td_18_span_1_Template(rf, ctx) { if (rf & 1) {
17850
+ i0.ɵɵelementStart(0, "span");
17851
+ i0.ɵɵtext(1);
17852
+ i0.ɵɵpipe(2, "ccdLinkCasesReasonValue");
17853
+ i0.ɵɵelementStart(3, "span");
17854
+ i0.ɵɵtemplate(4, LinkedCasesToTableComponent_table_2_tr_14_td_18_span_1_a_4_Template, 2, 2, "a", 15);
17855
+ i0.ɵɵelementEnd();
17856
+ i0.ɵɵtemplate(5, LinkedCasesToTableComponent_table_2_tr_14_td_18_span_1_br_5_Template, 1, 0, "br", 13);
17857
+ i0.ɵɵelementEnd();
17858
+ } if (rf & 2) {
17859
+ const reason_r6 = ctx.$implicit;
17860
+ const isLast_r8 = ctx.last;
17861
+ const ctx_r5 = i0.ɵɵnextContext(4);
17862
+ i0.ɵɵadvance(1);
17863
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 3, reason_r6), "");
17864
+ i0.ɵɵadvance(3);
17865
+ i0.ɵɵproperty("ngIf", ctx_r5.hasLeadCaseOrConsolidated(reason_r6));
17866
+ i0.ɵɵadvance(1);
17867
+ i0.ɵɵproperty("ngIf", !isLast_r8);
17868
+ } }
17869
+ function LinkedCasesToTableComponent_table_2_tr_14_td_18_Template(rf, ctx) { if (rf & 1) {
17870
+ i0.ɵɵelementStart(0, "td");
17871
+ i0.ɵɵtemplate(1, LinkedCasesToTableComponent_table_2_tr_14_td_18_span_1_Template, 6, 5, "span", 14);
17872
+ i0.ɵɵelementEnd();
17873
+ } if (rf & 2) {
17874
+ const case_r3 = i0.ɵɵnextContext().$implicit;
17875
+ i0.ɵɵadvance(1);
17876
+ i0.ɵɵproperty("ngForOf", case_r3.reasons);
17877
+ } }
17878
+ function LinkedCasesToTableComponent_table_2_tr_14_Template(rf, ctx) { if (rf & 1) {
17879
+ i0.ɵɵelementStart(0, "tr", 4);
17880
+ i0.ɵɵelementStart(1, "td");
17881
+ i0.ɵɵelementStart(2, "p", 9);
17882
+ i0.ɵɵelementStart(3, "a", 10);
17883
+ i0.ɵɵelementStart(4, "span", 11);
17884
+ i0.ɵɵtext(5);
17885
+ i0.ɵɵelement(6, "br");
17886
+ i0.ɵɵtext(7);
17887
+ i0.ɵɵpipe(8, "ccdCaseReference");
17888
+ i0.ɵɵelementEnd();
17889
+ i0.ɵɵelementEnd();
17890
+ i0.ɵɵelementEnd();
17891
+ i0.ɵɵelementEnd();
17892
+ i0.ɵɵelementStart(9, "td");
17893
+ i0.ɵɵelementStart(10, "span", 12);
17894
+ i0.ɵɵtext(11);
17895
+ i0.ɵɵelementEnd();
17896
+ i0.ɵɵelementEnd();
17897
+ i0.ɵɵelementStart(12, "td");
17898
+ i0.ɵɵelementStart(13, "span");
17899
+ i0.ɵɵtext(14);
17900
+ i0.ɵɵelementEnd();
17901
+ i0.ɵɵelementEnd();
17902
+ i0.ɵɵelementStart(15, "td");
17903
+ i0.ɵɵelementStart(16, "span", 12);
17904
+ i0.ɵɵtext(17);
17905
+ i0.ɵɵelementEnd();
17906
+ i0.ɵɵelementEnd();
17907
+ i0.ɵɵtemplate(18, LinkedCasesToTableComponent_table_2_tr_14_td_18_Template, 2, 1, "td", 13);
17908
+ i0.ɵɵelementEnd();
17909
+ } if (rf & 2) {
17910
+ const case_r3 = ctx.$implicit;
17911
+ i0.ɵɵadvance(3);
17912
+ i0.ɵɵpropertyInterpolate1("href", "cases/case-details/", case_r3.caseReference, "", i0.ɵɵsanitizeUrl);
17913
+ i0.ɵɵadvance(2);
17914
+ i0.ɵɵtextInterpolate1("", case_r3.caseName, " ");
17915
+ i0.ɵɵadvance(2);
17916
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(8, 9, case_r3.caseReference), "");
17917
+ i0.ɵɵadvance(3);
17918
+ i0.ɵɵproperty("title", case_r3.caseTypeDescription);
17919
+ i0.ɵɵadvance(1);
17920
+ i0.ɵɵtextInterpolate(case_r3.caseType);
17921
+ i0.ɵɵadvance(3);
17922
+ i0.ɵɵtextInterpolate(case_r3.service);
17923
+ i0.ɵɵadvance(2);
17924
+ i0.ɵɵproperty("title", case_r3.stateDescription);
17925
+ i0.ɵɵadvance(1);
17926
+ i0.ɵɵtextInterpolate(case_r3.state);
17927
+ i0.ɵɵadvance(1);
17928
+ i0.ɵɵproperty("ngIf", case_r3 && case_r3.reasons);
17929
+ } }
17930
+ function LinkedCasesToTableComponent_table_2_tr_15_Template(rf, ctx) { if (rf & 1) {
17931
+ i0.ɵɵelementStart(0, "tr", 4);
17932
+ i0.ɵɵelementStart(1, "td", 17);
17933
+ i0.ɵɵtext(2, " None ");
17934
+ i0.ɵɵelementEnd();
17935
+ i0.ɵɵelementEnd();
17936
+ } }
17937
+ function LinkedCasesToTableComponent_table_2_Template(rf, ctx) { if (rf & 1) {
17938
+ i0.ɵɵelementStart(0, "table", 3);
17939
+ i0.ɵɵelementStart(1, "thead");
17940
+ i0.ɵɵelementStart(2, "tr", 4);
17941
+ i0.ɵɵelementStart(3, "th", 5);
17942
+ i0.ɵɵtext(4, "Case name and number");
17943
+ i0.ɵɵelementEnd();
17944
+ i0.ɵɵelementStart(5, "th", 5);
17945
+ i0.ɵɵtext(6, "Case type ");
17946
+ i0.ɵɵelementEnd();
17947
+ i0.ɵɵelementStart(7, "th", 5);
17948
+ i0.ɵɵtext(8, "Service");
17949
+ i0.ɵɵelementEnd();
17950
+ i0.ɵɵelementStart(9, "th", 5);
17951
+ i0.ɵɵtext(10, "State");
17952
+ i0.ɵɵelementEnd();
17953
+ i0.ɵɵelementStart(11, "th", 5);
17954
+ i0.ɵɵtext(12, "Reasons for case link");
17955
+ i0.ɵɵelementEnd();
17956
+ i0.ɵɵelementEnd();
17957
+ i0.ɵɵelementEnd();
17958
+ i0.ɵɵelementStart(13, "tbody", 6);
17959
+ i0.ɵɵtemplate(14, LinkedCasesToTableComponent_table_2_tr_14_Template, 19, 11, "tr", 7);
17960
+ i0.ɵɵtemplate(15, LinkedCasesToTableComponent_table_2_tr_15_Template, 3, 0, "tr", 8);
17961
+ i0.ɵɵelementEnd();
17962
+ i0.ɵɵelementEnd();
17963
+ } if (rf & 2) {
17964
+ const ctx_r0 = i0.ɵɵnextContext();
17965
+ i0.ɵɵadvance(14);
17966
+ i0.ɵɵproperty("ngForOf", ctx_r0.linkedCasesFromResponse);
17967
+ i0.ɵɵadvance(1);
17968
+ i0.ɵɵproperty("ngIf", ctx_r0.linkedCasesFromResponse && ctx_r0.linkedCasesFromResponse.length === 0 && (!ctx_r0.isServerError && !ctx_r0.linkedCasesService.isServerReasonCodeError));
17969
+ } }
17970
+ class LinkedCasesToTableComponent {
17971
+ constructor(route, linkedCasesService, casesService) {
17972
+ this.route = route;
17973
+ this.linkedCasesService = linkedCasesService;
17974
+ this.casesService = casesService;
17975
+ this.notifyAPIFailure = new EventEmitter(false);
17976
+ this.linkedCasesFromResponse = [];
17977
+ this.isServerError = false;
17978
+ this.jurisdictionsResponse = [];
17979
+ }
17980
+ ngAfterViewInit() {
17981
+ let labelField = document.getElementsByClassName('govuk-heading-l');
17982
+ if (labelField && labelField.length) {
17983
+ labelField[0].replaceWith('');
17984
+ }
17985
+ labelField = document.getElementsByClassName('heading-h2');
17986
+ if (labelField && labelField.length) {
17987
+ labelField[0].replaceWith('');
17988
+ }
17989
+ }
17990
+ ngOnInit() {
17991
+ this.caseId = this.route.snapshot && this.route.snapshot.data && this.route.snapshot.data.case.case_id;
17992
+ this.getAllLinkedCaseInformation();
17993
+ if (this.route.snapshot.data.case) {
17994
+ this.linkedCasesService.caseDetails = this.route.snapshot.data.case;
17995
+ }
17996
+ }
17997
+ getCaseRefereneLink(caseRef) {
17998
+ return caseRef.slice(this.caseId.length - 4);
17999
+ }
18000
+ sortLinkedCasesByReasonCode(searchCasesResponse) {
18001
+ const topLevelresultArray = [];
18002
+ let secondLevelresultArray = [];
18003
+ searchCasesResponse.forEach((item) => {
18004
+ const reasons = item && item.reasons || [];
18005
+ const consolidatedStateReason = reasons.map(x => x).find(reason => reason === LinkedCasesToTableComponent.CASE_CONSOLIDATED_REASON_CODE);
18006
+ const progressedStateReason = reasons.map(x => x).find(reason => reason === LinkedCasesToTableComponent.CASE_PROGRESS_REASON_CODE);
18007
+ let arrayItem;
18008
+ if (progressedStateReason) {
18009
+ arrayItem = Object.assign({}, item);
18010
+ topLevelresultArray.push(arrayItem);
18011
+ }
18012
+ else if (consolidatedStateReason) {
18013
+ arrayItem = Object.assign({}, item);
18014
+ secondLevelresultArray = [Object.assign({}, item), ...secondLevelresultArray];
18015
+ }
18016
+ else {
18017
+ arrayItem = Object.assign({}, item);
18018
+ secondLevelresultArray.push(Object.assign({}, item));
18019
+ }
18020
+ });
18021
+ return topLevelresultArray.concat(secondLevelresultArray);
18022
+ }
18023
+ getAllLinkedCaseInformation() {
18024
+ const searchCasesResponse = [];
18025
+ const caseFieldValue = this.caseField ? this.caseField.value : [];
18026
+ // Generate the list of observables
18027
+ caseFieldValue.forEach(fieldValue => {
18028
+ if (fieldValue && fieldValue.id) {
18029
+ searchCasesResponse.push(this.casesService.getCaseViewV2(fieldValue.id));
18030
+ }
18031
+ });
18032
+ if (searchCasesResponse.length) {
18033
+ this.searchCasesByCaseIds(searchCasesResponse).subscribe((searchCases) => {
18034
+ const casesResponse = [];
18035
+ searchCases.forEach(response => {
18036
+ casesResponse.push(this.mapResponse(response));
18037
+ });
18038
+ this.linkedCasesFromResponse = this.sortLinkedCasesByReasonCode(casesResponse);
18039
+ this.isLoaded = true;
18040
+ const caseLinks = this.linkedCasesFromResponse.map(item => {
18041
+ return {
18042
+ caseReference: item.caseReference,
18043
+ caseName: item.caseName,
18044
+ caseService: item.service,
18045
+ caseType: item.caseType,
18046
+ unlink: false,
18047
+ reasons: item.reasons && item.reasons.map(reason => {
18048
+ return {
18049
+ reasonCode: reason
18050
+ };
18051
+ }),
18052
+ };
18053
+ });
18054
+ this.linkedCasesService.initialCaseLinks = caseLinks;
18055
+ this.linkedCasesService.linkedCases = caseLinks;
18056
+ this.isServerError = false;
18057
+ }, err => {
18058
+ this.isServerError = true;
18059
+ this.notifyAPIFailure.emit(true);
18060
+ });
18061
+ }
18062
+ }
18063
+ searchCasesByCaseIds(searchCasesResponse) {
18064
+ return forkJoin(searchCasesResponse);
18065
+ }
18066
+ hasLeadCaseOrConsolidated(reasonCode) {
18067
+ return reasonCode === LinkedCasesToTableComponent.CASE_PROGRESS_REASON_CODE ||
18068
+ reasonCode === LinkedCasesToTableComponent.CASE_CONSOLIDATED_REASON_CODE;
18069
+ }
18070
+ mapResponse(esSearchCasesResponse) {
18071
+ const caseInfo = this.caseField.value.find(item => item.value && item.value.CaseReference === esSearchCasesResponse.case_id);
18072
+ return caseInfo && {
18073
+ caseReference: esSearchCasesResponse.case_id,
18074
+ caseName: this.linkedCasesService.getCaseName(esSearchCasesResponse),
18075
+ caseType: esSearchCasesResponse.case_type.name || '',
18076
+ caseTypeDescription: esSearchCasesResponse.case_type.description || '',
18077
+ service: esSearchCasesResponse.case_type && esSearchCasesResponse.case_type.jurisdiction.description || '',
18078
+ state: esSearchCasesResponse.state.name || '',
18079
+ stateDescription: esSearchCasesResponse.state.description || '',
18080
+ reasons: caseInfo.value && caseInfo.value.ReasonForLink &&
18081
+ caseInfo.value.ReasonForLink.map(reason => reason.value && reason.value.Reason),
18082
+ };
18083
+ }
18084
+ }
18085
+ LinkedCasesToTableComponent.CASE_CONSOLIDATED_REASON_CODE = 'CLRC015';
18086
+ LinkedCasesToTableComponent.CASE_PROGRESS_REASON_CODE = 'CLRC016';
18087
+ LinkedCasesToTableComponent.ɵfac = function LinkedCasesToTableComponent_Factory(t) { return new (t || LinkedCasesToTableComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(LinkedCasesService), i0.ɵɵdirectiveInject(CasesService)); };
18088
+ LinkedCasesToTableComponent.ɵcmp = i0.ɵɵdefineComponent({ type: LinkedCasesToTableComponent, selectors: [["ccd-linked-cases-to-table"]], inputs: { caseField: "caseField" }, outputs: { notifyAPIFailure: "notifyAPIFailure" }, decls: 3, vars: 1, consts: [[1, "govuk-grid-row", "govuk-!-margin-bottom-2"], [1, "govuk-grid-column-full"], ["aria-describedby", "table to display cases linked TO", 4, "ngIf"], ["aria-describedby", "table to display cases linked TO"], [1, "govuk-table__row"], ["scope", "col", "width", "20%", 1, "govuk-table__header", "case-table-column"], [1, "govuk-table__body"], ["class", "govuk-table__row", 4, "ngFor", "ngForOf"], ["class", "govuk-table__row", 4, "ngIf"], [1, "govuk-body"], ["target", "_blank", "rel", "noopener", 3, "href"], [1, "govuk-link"], [3, "title"], [4, "ngIf"], [4, "ngFor", "ngForOf"], ["class", "govuk-!-padding-left-1", 3, "href", 4, "ngIf"], [1, "govuk-!-padding-left-1", 3, "href"], ["colspan", "5", 1, "govuk-table__cell"]], template: function LinkedCasesToTableComponent_Template(rf, ctx) { if (rf & 1) {
18089
+ i0.ɵɵelementStart(0, "div", 0);
18090
+ i0.ɵɵelementStart(1, "div", 1);
18091
+ i0.ɵɵtemplate(2, LinkedCasesToTableComponent_table_2_Template, 16, 2, "table", 2);
18092
+ i0.ɵɵelementEnd();
18093
+ i0.ɵɵelementEnd();
18094
+ } if (rf & 2) {
18095
+ i0.ɵɵadvance(2);
18096
+ i0.ɵɵproperty("ngIf", ctx.linkedCasesFromResponse);
18097
+ } }, styles: [".case-table-column[_ngcontent-%COMP%]{min-width:20%;max-width:20%}"] });
18098
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LinkedCasesToTableComponent, [{
18099
+ type: Component,
18100
+ args: [{
18101
+ selector: 'ccd-linked-cases-to-table',
18102
+ templateUrl: './linked-cases-to-table.component.html',
18103
+ styleUrls: ['./linked-cases-to-table.component.scss']
18104
+ }]
18105
+ }], function () { return [{ type: i1$1.ActivatedRoute }, { type: LinkedCasesService }, { type: CasesService }]; }, { caseField: [{
18106
+ type: Input
18107
+ }], notifyAPIFailure: [{
18108
+ type: Output
18109
+ }] }); })();
18110
+
18111
+ function NoLinkedCasesComponent_h1_2_Template(rf, ctx) { if (rf & 1) {
18112
+ i0.ɵɵelementStart(0, "h1", 9);
18113
+ i0.ɵɵtext(1, "There is a problem");
18114
+ i0.ɵɵelementEnd();
18115
+ } }
18116
+ function NoLinkedCasesComponent_p_3_Template(rf, ctx) { if (rf & 1) {
18117
+ i0.ɵɵelementStart(0, "p", 10);
18118
+ i0.ɵɵelementStart(1, "span", 11);
18119
+ i0.ɵɵtext(2, "Error:");
18120
+ i0.ɵɵelementEnd();
18121
+ i0.ɵɵtext(3);
18122
+ i0.ɵɵelementEnd();
18123
+ } if (rf & 2) {
18124
+ const ctx_r1 = i0.ɵɵnextContext();
18125
+ i0.ɵɵadvance(3);
18126
+ i0.ɵɵtextInterpolate1(" ", ctx_r1.linkedCasesService.serverLinkedApiError.message, " ");
18127
+ } }
18128
+ function NoLinkedCasesComponent_ng_template_4_Template(rf, ctx) { if (rf & 1) {
18129
+ i0.ɵɵelementStart(0, "p", 5);
18130
+ i0.ɵɵtext(1, "There are no cases linked to this one.");
18131
+ i0.ɵɵelementEnd();
18132
+ } }
18133
+ class NoLinkedCasesComponent {
18134
+ constructor(router, linkedCasesService) {
18135
+ this.router = router;
18136
+ this.linkedCasesService = linkedCasesService;
18137
+ }
18138
+ onBack() {
18139
+ this.router.navigate(['cases', 'case-details', this.linkedCasesService.caseId]).then(() => {
18140
+ window.location.hash = 'Linked cases';
18141
+ });
18142
+ }
18143
+ }
18144
+ NoLinkedCasesComponent.ɵfac = function NoLinkedCasesComponent_Factory(t) { return new (t || NoLinkedCasesComponent)(i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(LinkedCasesService)); };
18145
+ NoLinkedCasesComponent.ɵcmp = i0.ɵɵdefineComponent({ type: NoLinkedCasesComponent, selectors: [["ccd-no-linked-cases"]], decls: 12, vars: 3, consts: [[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"], ["noLinkedCases", ""], [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) {
18146
+ i0.ɵɵelementStart(0, "div", 0);
18147
+ i0.ɵɵelementStart(1, "div", 1);
18148
+ i0.ɵɵtemplate(2, NoLinkedCasesComponent_h1_2_Template, 2, 0, "h1", 2);
18149
+ i0.ɵɵtemplate(3, NoLinkedCasesComponent_p_3_Template, 4, 1, "p", 3);
18150
+ i0.ɵɵtemplate(4, NoLinkedCasesComponent_ng_template_4_Template, 2, 0, "ng-template", null, 4, i0.ɵɵtemplateRefExtractor);
18151
+ i0.ɵɵelementStart(6, "p", 5);
18152
+ i0.ɵɵelementStart(7, "a", 6);
18153
+ i0.ɵɵlistener("click", function NoLinkedCasesComponent_Template_a_click_7_listener() { return ctx.onBack(); });
18154
+ i0.ɵɵtext(8, "Go back to the Linked cases tab");
18155
+ i0.ɵɵelementEnd();
18156
+ i0.ɵɵelementEnd();
18157
+ i0.ɵɵelementStart(9, "div", 7);
18158
+ i0.ɵɵelementStart(10, "button", 8);
18159
+ i0.ɵɵlistener("click", function NoLinkedCasesComponent_Template_button_click_10_listener() { return ctx.onBack(); });
18160
+ i0.ɵɵtext(11, "Back");
18161
+ i0.ɵɵelementEnd();
18162
+ i0.ɵɵelementEnd();
18163
+ i0.ɵɵelementEnd();
18164
+ i0.ɵɵelementEnd();
18165
+ } if (rf & 2) {
18166
+ const _r2 = i0.ɵɵreference(5);
18167
+ i0.ɵɵadvance(2);
18168
+ i0.ɵɵproperty("ngIf", ctx.linkedCasesService.serverLinkedApiError);
18169
+ i0.ɵɵadvance(1);
18170
+ i0.ɵɵproperty("ngIf", ctx.linkedCasesService.serverLinkedApiError)("ngIfElse", _r2);
18171
+ } }, directives: [i1.NgIf], encapsulation: 2 });
18172
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NoLinkedCasesComponent, [{
18173
+ type: Component,
18174
+ args: [{
18175
+ selector: 'ccd-no-linked-cases',
18176
+ templateUrl: './no-linked-cases.component.html'
18177
+ }]
18178
+ }], function () { return [{ type: i1$1.Router }, { type: LinkedCasesService }]; }, null); })();
18179
+
18180
+ function UnLinkCasesComponent_div_0_div_4_p_1_Template(rf, ctx) { if (rf & 1) {
18181
+ i0.ɵɵelementStart(0, "p", 11);
18182
+ i0.ɵɵelementStart(1, "span", 12);
18183
+ i0.ɵɵtext(2, "Error:");
18184
+ i0.ɵɵelementEnd();
18185
+ i0.ɵɵtext(3);
18186
+ i0.ɵɵelementEnd();
18187
+ } if (rf & 2) {
18188
+ const ctx_r2 = i0.ɵɵnextContext(3);
18189
+ i0.ɵɵadvance(3);
18190
+ i0.ɵɵtextInterpolate1(" ", ctx_r2.unlinkErrorMessage, " ");
18191
+ } }
18192
+ function UnLinkCasesComponent_div_0_div_4_div_3_Template(rf, ctx) { if (rf & 1) {
18193
+ const _r6 = i0.ɵɵgetCurrentView();
18194
+ i0.ɵɵelementStart(0, "div", 13);
18195
+ i0.ɵɵelementStart(1, "input", 14);
18196
+ i0.ɵɵlistener("change", function UnLinkCasesComponent_div_0_div_4_div_3_Template_input_change_1_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r5 = i0.ɵɵnextContext(3); return ctx_r5.onChange($event.target); });
18197
+ i0.ɵɵelementEnd();
18198
+ i0.ɵɵelementStart(2, "label", 15);
18199
+ i0.ɵɵtext(3);
18200
+ i0.ɵɵpipe(4, "ccdCaseReference");
18201
+ i0.ɵɵelementEnd();
18202
+ i0.ɵɵelementEnd();
18203
+ } if (rf & 2) {
18204
+ const case_r4 = ctx.$implicit;
18205
+ i0.ɵɵadvance(1);
18206
+ i0.ɵɵpropertyInterpolate1("id", "case-reference-", case_r4.caseReference, "");
18207
+ i0.ɵɵproperty("value", case_r4.caseReference)("checked", case_r4.unlink);
18208
+ i0.ɵɵadvance(1);
18209
+ i0.ɵɵpropertyInterpolate("for", case_r4.caseReference);
18210
+ i0.ɵɵadvance(1);
18211
+ i0.ɵɵtextInterpolate2(" ", case_r4.caseName, " ", i0.ɵɵpipeBind1(4, 6, case_r4.caseReference), " ");
18212
+ } }
18213
+ const _c0$l = function (a0) { return { "govuk-form-group--error": a0 }; };
18214
+ function UnLinkCasesComponent_div_0_div_4_Template(rf, ctx) { if (rf & 1) {
18215
+ i0.ɵɵelementStart(0, "div", 7);
18216
+ i0.ɵɵtemplate(1, UnLinkCasesComponent_div_0_div_4_p_1_Template, 4, 1, "p", 8);
18217
+ i0.ɵɵelementStart(2, "div", 9);
18218
+ i0.ɵɵtemplate(3, UnLinkCasesComponent_div_0_div_4_div_3_Template, 5, 8, "div", 10);
18219
+ i0.ɵɵelementEnd();
18220
+ i0.ɵɵelementEnd();
18221
+ } if (rf & 2) {
18222
+ const ctx_r1 = i0.ɵɵnextContext(2);
18223
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(4, _c0$l, ctx_r1.unlinkErrorMessage))("formGroup", ctx_r1.unlinkCaseForm);
18224
+ i0.ɵɵadvance(1);
18225
+ i0.ɵɵproperty("ngIf", ctx_r1.unlinkErrorMessage);
18226
+ i0.ɵɵadvance(2);
18227
+ i0.ɵɵproperty("ngForOf", ctx_r1.linkedCases);
18228
+ } }
18229
+ function UnLinkCasesComponent_div_0_Template(rf, ctx) { if (rf & 1) {
18230
+ const _r8 = i0.ɵɵgetCurrentView();
18231
+ i0.ɵɵelementStart(0, "div", 1);
18232
+ i0.ɵɵelementStart(1, "div", 2);
18233
+ i0.ɵɵelementStart(2, "h1", 3);
18234
+ i0.ɵɵtext(3, "Select the cases you want to unlink from this case");
18235
+ i0.ɵɵelementEnd();
18236
+ i0.ɵɵtemplate(4, UnLinkCasesComponent_div_0_div_4_Template, 4, 6, "div", 4);
18237
+ i0.ɵɵelementStart(5, "div", 5);
18238
+ i0.ɵɵelementStart(6, "button", 6);
18239
+ i0.ɵɵlistener("click", function UnLinkCasesComponent_div_0_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r8); const ctx_r7 = i0.ɵɵnextContext(); return ctx_r7.onNext(); });
18240
+ i0.ɵɵtext(7, "Next");
18241
+ i0.ɵɵelementEnd();
18242
+ i0.ɵɵelementEnd();
18243
+ i0.ɵɵelementEnd();
18244
+ i0.ɵɵelementEnd();
18245
+ } if (rf & 2) {
18246
+ const ctx_r0 = i0.ɵɵnextContext();
18247
+ i0.ɵɵadvance(4);
18248
+ i0.ɵɵproperty("ngIf", ctx_r0.unlinkCaseForm);
18249
+ } }
18250
+ class UnLinkCasesComponent {
18251
+ constructor(caseEdit, fb, casesService, linkedCasesService) {
18252
+ this.caseEdit = caseEdit;
18253
+ this.fb = fb;
18254
+ this.casesService = casesService;
18255
+ this.linkedCasesService = linkedCasesService;
18256
+ this.linkedCasesStateEmitter = new EventEmitter();
18257
+ this.notifyAPIFailure = new EventEmitter(false);
18258
+ this.linkedCases = [];
18259
+ this.errorMessages = [];
18260
+ this.isServerError = false;
18261
+ }
18262
+ ngOnInit() {
18263
+ this.getLinkedCases();
18264
+ }
18265
+ getLinkedCases() {
18266
+ this.caseId = this.linkedCasesService.caseId;
18267
+ if (this.linkedCasesService.linkedCases.length > 0) {
18268
+ this.linkedCases = this.linkedCasesService.linkedCases;
18269
+ this.getAllLinkedCaseInformation();
18270
+ }
18271
+ else {
18272
+ this.casesService.getCaseViewV2(this.caseId).subscribe((caseView) => {
18273
+ const linkedCasesTab = caseView.tabs.find(tab => tab.id === UnLinkCasesComponent.LINKED_CASES_TAB_ID);
18274
+ if (linkedCasesTab) {
18275
+ const linkedCases = linkedCasesTab.fields[0].value;
18276
+ this.linkedCases = linkedCases;
18277
+ this.linkedCasesService.linkedCases = linkedCases;
18278
+ this.getAllLinkedCaseInformation();
18279
+ }
18280
+ });
18281
+ }
18282
+ }
18283
+ getAllLinkedCaseInformation() {
18284
+ const searchCasesResponse = [];
18285
+ this.linkedCases.forEach(linkedCase => {
18286
+ searchCasesResponse.push(this.casesService.getCaseViewV2(linkedCase.caseReference));
18287
+ });
18288
+ if (searchCasesResponse.length) {
18289
+ this.searchCasesByCaseIds(searchCasesResponse).subscribe((searchCases) => {
18290
+ searchCases.forEach((response) => {
18291
+ const linkedCaseFromList = this.linkedCases.find(linkedCase => linkedCase.caseReference === response.case_id);
18292
+ if (linkedCaseFromList) {
18293
+ const caseName = this.linkedCasesService.getCaseName(response);
18294
+ this.linkedCases.find(linkedCase => linkedCase.caseReference === response.case_id).caseName = caseName;
18295
+ }
18296
+ });
18297
+ this.initForm();
18298
+ this.linkedCasesService.linkedCases = this.linkedCases;
18299
+ this.isServerError = false;
18300
+ }, err => {
18301
+ this.isServerError = true;
18302
+ this.notifyAPIFailure.emit(true);
18303
+ });
18304
+ }
18305
+ }
18306
+ searchCasesByCaseIds(searchCasesResponse) {
18307
+ return forkJoin(searchCasesResponse);
18308
+ }
18309
+ initForm() {
18310
+ this.unlinkCaseForm = this.fb.group({
18311
+ linkedCases: this.getLinkedCasesFormArray
18312
+ });
18313
+ }
18314
+ get getLinkedCasesFormArray() {
18315
+ const formFieldArray = this.linkedCases.map(val => this.fb.group({
18316
+ caseReference: val.caseReference,
18317
+ reasons: val.reasons,
18318
+ createdDateTime: val.createdDateTime,
18319
+ caseType: val.caseType,
18320
+ caseState: val.caseState,
18321
+ caseService: val.caseService,
18322
+ caseName: val.caseName || UnLinkCasesComponent.CASE_NAME_MISSING_TEXT,
18323
+ unlink: val.unlink
18324
+ }));
18325
+ return this.fb.array(formFieldArray);
18326
+ }
18327
+ onChange(caseSelected) {
18328
+ this.resetErrorMessages();
18329
+ const selectedCase = this.linkedCases.find(linkedCase => linkedCase.caseReference === caseSelected.value);
18330
+ if (selectedCase) {
18331
+ selectedCase.unlink = caseSelected.checked ? true : false;
18332
+ }
18333
+ }
18334
+ onNext() {
18335
+ this.resetErrorMessages();
18336
+ let navigateToNextPage = true;
18337
+ const casesMarkedToUnlink = this.linkedCases.find(linkedCase => linkedCase.unlink && linkedCase.unlink === true);
18338
+ if (!casesMarkedToUnlink) {
18339
+ this.errorMessages.push({
18340
+ title: 'case-selection',
18341
+ description: LinkedCasesErrorMessages.UnlinkCaseSelectionError,
18342
+ fieldId: `case-reference-${this.linkedCases[0].caseReference}`
18343
+ });
18344
+ this.unlinkErrorMessage = LinkedCasesErrorMessages.UnlinkCaseSelectionError;
18345
+ navigateToNextPage = false;
18346
+ }
18347
+ const unlinkedCaseRefereneIds = this.linkedCasesService.linkedCases.filter(item => item.unlink).map(item => item.caseReference);
18348
+ const updatedLinkedCases = this.linkedCasesService.caseFieldValue.filter(item => unlinkedCaseRefereneIds.indexOf(item.value.CaseReference) === -1);
18349
+ this.caseEdit.form.controls['data'] = new FormGroup({ caseLinks: new FormControl(updatedLinkedCases || []) });
18350
+ // Return linked cases state and error messages to the parent
18351
+ this.linkedCasesStateEmitter.emit({
18352
+ currentLinkedCasesPage: LinkedCasesPages.UNLINK_CASE,
18353
+ errorMessages: this.errorMessages,
18354
+ navigateToNextPage
18355
+ });
18356
+ }
18357
+ resetErrorMessages() {
18358
+ this.errorMessages = [];
18359
+ this.unlinkErrorMessage = null;
18360
+ }
18361
+ }
18362
+ UnLinkCasesComponent.LINKED_CASES_TAB_ID = 'linked_cases_sscs';
18363
+ UnLinkCasesComponent.CASE_NAME_MISSING_TEXT = 'Case name missing';
18364
+ UnLinkCasesComponent.ɵfac = function UnLinkCasesComponent_Factory(t) { return new (t || UnLinkCasesComponent)(i0.ɵɵdirectiveInject(CaseEditComponent), i0.ɵɵdirectiveInject(i2.FormBuilder), i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(LinkedCasesService)); };
18365
+ UnLinkCasesComponent.ɵcmp = 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, "id", "value", "checked", "change"], [1, "govuk-label", "govuk-checkboxes__label", 3, "for"]], template: function UnLinkCasesComponent_Template(rf, ctx) { if (rf & 1) {
18366
+ i0.ɵɵtemplate(0, UnLinkCasesComponent_div_0_Template, 8, 1, "div", 0);
18367
+ } if (rf & 2) {
18368
+ i0.ɵɵproperty("ngIf", ctx.linkedCases.length > 0);
18369
+ } }, directives: [i1.NgIf, i1.NgClass, i2.NgControlStatusGroup, i2.FormGroupDirective, i1.NgForOf, i2.FormArrayName], pipes: [CaseReferencePipe], encapsulation: 2 });
18370
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UnLinkCasesComponent, [{
18371
+ type: Component,
18372
+ args: [{
18373
+ selector: 'ccd-unlink-cases',
18374
+ templateUrl: './unlink-cases.component.html'
18375
+ }]
18376
+ }], function () { return [{ type: CaseEditComponent }, { type: i2.FormBuilder }, { type: CasesService }, { type: LinkedCasesService }]; }, { linkedCasesStateEmitter: [{
18377
+ type: Output
18378
+ }], notifyAPIFailure: [{
18379
+ type: Output
18380
+ }] }); })();
18381
+
18382
+ function WriteLinkedCasesComponent_div_0_div_3_Template(rf, ctx) { if (rf & 1) {
18383
+ const _r9 = i0.ɵɵgetCurrentView();
18384
+ i0.ɵɵelementStart(0, "div", 7);
18385
+ i0.ɵɵelementStart(1, "ul", 8);
18386
+ i0.ɵɵelementStart(2, "li");
18387
+ i0.ɵɵelementStart(3, "a", 9);
18388
+ i0.ɵɵlistener("click", function WriteLinkedCasesComponent_div_0_div_3_Template_a_click_3_listener() { i0.ɵɵrestoreView(_r9); const errorMessage_r7 = ctx.$implicit; const ctx_r8 = i0.ɵɵnextContext(2); return ctx_r8.navigateToErrorElement(errorMessage_r7.fieldId); });
18389
+ i0.ɵɵtext(4);
18390
+ i0.ɵɵelementEnd();
18391
+ i0.ɵɵelementEnd();
18392
+ i0.ɵɵelementEnd();
18393
+ i0.ɵɵelementEnd();
18394
+ } if (rf & 2) {
18395
+ const errorMessage_r7 = ctx.$implicit;
18396
+ i0.ɵɵadvance(4);
18397
+ i0.ɵɵtextInterpolate(errorMessage_r7.description);
18398
+ } }
18399
+ function WriteLinkedCasesComponent_div_0_Template(rf, ctx) { if (rf & 1) {
18400
+ i0.ɵɵelementStart(0, "div", 4);
18401
+ i0.ɵɵelementStart(1, "h2", 5);
18402
+ i0.ɵɵtext(2, " There is a problem ");
18403
+ i0.ɵɵelementEnd();
18404
+ i0.ɵɵtemplate(3, WriteLinkedCasesComponent_div_0_div_3_Template, 5, 1, "div", 6);
18405
+ i0.ɵɵelementEnd();
18406
+ } if (rf & 2) {
18407
+ const ctx_r0 = i0.ɵɵnextContext();
18408
+ i0.ɵɵadvance(3);
18409
+ i0.ɵɵproperty("ngForOf", ctx_r0.errorMessages);
18410
+ } }
18411
+ function WriteLinkedCasesComponent_ng_container_3_Template(rf, ctx) { if (rf & 1) {
18412
+ const _r11 = i0.ɵɵgetCurrentView();
18413
+ i0.ɵɵelementContainerStart(0);
18414
+ i0.ɵɵelementStart(1, "ccd-linked-cases-before-you-start", 10);
18415
+ i0.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesComponent_ng_container_3_Template_ccd_linked_cases_before_you_start_linkedCasesStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r11); const ctx_r10 = i0.ɵɵnextContext(); return ctx_r10.onLinkedCasesStateEmitted($event); });
18416
+ i0.ɵɵelementEnd();
18417
+ i0.ɵɵelementContainerEnd();
18418
+ } }
18419
+ function WriteLinkedCasesComponent_ng_container_4_Template(rf, ctx) { if (rf & 1) {
18420
+ const _r13 = i0.ɵɵgetCurrentView();
18421
+ i0.ɵɵelementContainerStart(0);
18422
+ i0.ɵɵelementStart(1, "ccd-no-linked-cases", 10);
18423
+ i0.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesComponent_ng_container_4_Template_ccd_no_linked_cases_linkedCasesStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r13); const ctx_r12 = i0.ɵɵnextContext(); return ctx_r12.onLinkedCasesStateEmitted($event); });
18424
+ i0.ɵɵelementEnd();
18425
+ i0.ɵɵelementContainerEnd();
18426
+ } }
18427
+ function WriteLinkedCasesComponent_ng_container_5_Template(rf, ctx) { if (rf & 1) {
18428
+ const _r15 = i0.ɵɵgetCurrentView();
18429
+ i0.ɵɵelementContainerStart(0);
18430
+ i0.ɵɵelementStart(1, "ccd-link-cases", 10);
18431
+ i0.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesComponent_ng_container_5_Template_ccd_link_cases_linkedCasesStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r15); const ctx_r14 = i0.ɵɵnextContext(); return ctx_r14.onLinkedCasesStateEmitted($event); });
18432
+ i0.ɵɵelementEnd();
18433
+ i0.ɵɵelementContainerEnd();
18434
+ } }
18435
+ function WriteLinkedCasesComponent_ng_container_6_Template(rf, ctx) { if (rf & 1) {
18436
+ const _r17 = i0.ɵɵgetCurrentView();
18437
+ i0.ɵɵelementContainerStart(0);
18438
+ i0.ɵɵelementStart(1, "ccd-unlink-cases", 10);
18439
+ i0.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesComponent_ng_container_6_Template_ccd_unlink_cases_linkedCasesStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r17); const ctx_r16 = i0.ɵɵnextContext(); return ctx_r16.onLinkedCasesStateEmitted($event); });
18440
+ i0.ɵɵelementEnd();
18441
+ i0.ɵɵelementContainerEnd();
18442
+ } }
18443
+ function WriteLinkedCasesComponent_ng_container_7_Template(rf, ctx) { if (rf & 1) {
18444
+ const _r19 = i0.ɵɵgetCurrentView();
18445
+ i0.ɵɵelementContainerStart(0);
18446
+ i0.ɵɵelementStart(1, "ccd-linked-cases-check-your-answers", 10);
18447
+ i0.ɵɵlistener("linkedCasesStateEmitter", function WriteLinkedCasesComponent_ng_container_7_Template_ccd_linked_cases_check_your_answers_linkedCasesStateEmitter_1_listener($event) { i0.ɵɵrestoreView(_r19); const ctx_r18 = i0.ɵɵnextContext(); return ctx_r18.onLinkedCasesStateEmitted($event); });
18448
+ i0.ɵɵelementEnd();
18449
+ i0.ɵɵelementContainerEnd();
18450
+ } }
18451
+ class WriteLinkedCasesComponent extends AbstractFieldWriteComponent {
18452
+ constructor(caseEdit, appConfig, commonDataService, casesService, linkedCasesService) {
18453
+ super();
18454
+ this.caseEdit = caseEdit;
18455
+ this.appConfig = appConfig;
18456
+ this.commonDataService = commonDataService;
18457
+ this.casesService = casesService;
18458
+ this.linkedCasesService = linkedCasesService;
18459
+ this.onLinkedCasesSelected = new EventEmitter();
18460
+ this.isLinkedCasesJourney = false;
18461
+ this.linkedCasesPages = LinkedCasesPages;
18462
+ this.linkedCasesEventTriggers = LinkedCasesEventTriggers;
18463
+ this.linkedCases = [];
18464
+ this.errorMessages = [];
18465
+ }
18466
+ ngOnInit() {
18467
+ this.linkedCasesService.caseId = this.caseEdit.caseDetails.case_id;
18468
+ this.linkedCasesService.caseName = this.linkedCasesService.getCaseName(this.caseEdit.caseDetails);
18469
+ this.linkedCasesService.caseDetails = this.caseEdit.caseDetails;
18470
+ this.linkedCasesService.editMode = false;
18471
+ const reasonCodeAPIurl = this.appConfig.getRDCommonDataApiUrl() + '/lov/categories/CaseLinkingReasonCode';
18472
+ this.commonDataService.getRefData(reasonCodeAPIurl).subscribe({
18473
+ next: reasons => {
18474
+ this.linkedCasesService.linkCaseReasons = reasons.list_of_values.sort((a, b) => (a.value_en > b.value_en) ? 1 : -1);
18475
+ }
18476
+ });
18477
+ this.getLinkedCases();
18478
+ this.linkedCasesService.isLinkedCasesEventTrigger =
18479
+ this.caseEditPageComponent.eventTrigger.name === LinkedCasesEventTriggers.LINK_CASES;
18480
+ }
18481
+ ngAfterViewInit() {
18482
+ let labelField = document.getElementsByClassName('govuk-heading-l');
18483
+ if (labelField && labelField.length) {
18484
+ labelField[0].replaceWith('');
18485
+ }
18486
+ labelField = document.getElementsByClassName('heading-h2');
18487
+ if (labelField && labelField.length) {
18488
+ labelField[0].replaceWith('');
18489
+ }
18490
+ }
18491
+ onLinkedCasesStateEmitted(linkedCasesState) {
18492
+ this.errorMessages = [];
18493
+ this.caseEditPageComponent.validationErrors = [];
18494
+ if (linkedCasesState.navigateToNextPage) {
18495
+ this.linkedCasesPage = this.getNextPage(linkedCasesState);
18496
+ this.setContinueButtonValidationErrorMessage();
18497
+ this.proceedToNextPage();
18498
+ }
18499
+ else {
18500
+ if (linkedCasesState.errorMessages && linkedCasesState.errorMessages.length) {
18501
+ linkedCasesState.errorMessages.forEach((errorMessage, index) => {
18502
+ this.caseEditPageComponent.validationErrors.push({ id: errorMessage.fieldId, message: errorMessage.description });
18503
+ });
18504
+ }
18505
+ }
18506
+ }
18507
+ isAtFinalState() {
18508
+ return this.linkedCasesPage === this.linkedCasesPages.CHECK_YOUR_ANSWERS;
18509
+ }
18510
+ setContinueButtonValidationErrorMessage() {
18511
+ const errorMessage = this.linkedCasesService.isLinkedCasesEventTrigger
18512
+ ? LinkedCasesErrorMessages.LinkCasesNavigationError
18513
+ : LinkedCasesErrorMessages.UnlinkCasesNavigationError;
18514
+ const buttonId = this.linkedCasesService.linkedCases.length === 0
18515
+ ? 'back-button'
18516
+ : 'next-button';
18517
+ this.caseEditPageComponent.caseLinkError = {
18518
+ componentId: buttonId,
18519
+ errorMessage
18520
+ };
18521
+ }
18522
+ proceedToNextPage() {
18523
+ if (this.isAtFinalPage()) {
18524
+ // Continue button event must be allowed in final page
18525
+ this.caseEditPageComponent.caseLinkError = null;
18526
+ // Trigger validation to clear the "notAtFinalPage" error if now at the final state
18527
+ this.formGroup.updateValueAndValidity();
18528
+ // update form value
18529
+ this.onLinkedCasesSelected.emit();
18530
+ this.caseEdit.form.controls['data'] = new FormGroup({ caseLinks: new FormControl(this.linkedCasesService.caseFieldValue) });
18531
+ }
18532
+ }
18533
+ isAtFinalPage() {
18534
+ return this.linkedCasesPage === this.linkedCasesPages.CHECK_YOUR_ANSWERS;
18535
+ }
18536
+ getNextPage(linkedCasesState) {
18537
+ if ((this.linkedCasesPage === LinkedCasesPages.BEFORE_YOU_START) ||
18538
+ (linkedCasesState.currentLinkedCasesPage === LinkedCasesPages.CHECK_YOUR_ANSWERS && linkedCasesState.navigateToPreviousPage)) {
18539
+ return this.isLinkedCasesJourney
18540
+ ? LinkedCasesPages.LINK_CASE
18541
+ : LinkedCasesPages.UNLINK_CASE;
18542
+ }
18543
+ return LinkedCasesPages.CHECK_YOUR_ANSWERS;
18544
+ }
18545
+ getLinkedCases() {
18546
+ this.casesService.getCaseViewV2(this.linkedCasesService.caseId).subscribe((caseView) => {
18547
+ const caseViewFiltered = caseView.tabs.filter(tab => {
18548
+ const linkField = tab.fields.some(({ field_type }) => field_type && field_type.collection_field_type && field_type.collection_field_type.id === 'CaseLink');
18549
+ return linkField;
18550
+ });
18551
+ if (caseViewFiltered) {
18552
+ const caseLinkFieldValue = caseViewFiltered.map(filtered => filtered.fields.length && filtered.fields[0].value);
18553
+ this.linkedCasesService.caseFieldValue = caseLinkFieldValue.length ? caseLinkFieldValue[0] : [];
18554
+ this.linkedCasesService.getAllLinkedCaseInformation();
18555
+ }
18556
+ // Initialise the first page to display
18557
+ this.linkedCasesPage = this.linkedCasesService.isLinkedCasesEventTrigger ||
18558
+ (this.linkedCasesService.caseFieldValue && this.linkedCasesService.caseFieldValue.length > 0
18559
+ && !this.linkedCasesService.serverLinkedApiError)
18560
+ ? LinkedCasesPages.BEFORE_YOU_START
18561
+ : LinkedCasesPages.NO_LINKED_CASES;
18562
+ // Initialise the error to be displayed when clicked on Continue button
18563
+ this.setContinueButtonValidationErrorMessage();
18564
+ });
18565
+ }
18566
+ navigateToErrorElement(elementId) {
18567
+ if (elementId) {
18568
+ const htmlElement = document.getElementById(elementId);
18569
+ if (htmlElement) {
18570
+ htmlElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
18571
+ htmlElement.focus();
18572
+ }
18573
+ }
18574
+ }
18575
+ }
18576
+ WriteLinkedCasesComponent.ɵfac = function WriteLinkedCasesComponent_Factory(t) { return new (t || WriteLinkedCasesComponent)(i0.ɵɵdirectiveInject(CaseEditComponent), i0.ɵɵdirectiveInject(AbstractAppConfig), i0.ɵɵdirectiveInject(CommonDataService), i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(LinkedCasesService)); };
18577
+ WriteLinkedCasesComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WriteLinkedCasesComponent, selectors: [["ccd-write-linked-cases"]], inputs: { caseFields: "caseFields", caseField: "caseField", caseEditPageComponent: "caseEditPageComponent", isLinkedCasesJourney: "isLinkedCasesJourney", formGroup: "formGroup" }, outputs: { onLinkedCasesSelected: "onLinkedCasesSelected" }, features: [i0.ɵɵInheritDefinitionFeature], decls: 8, vars: 8, consts: [["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], [1, "form-group", "govuk-!-margin-bottom-2", 3, "formGroup"], [1, "govuk-form-group", 3, "ngSwitch"], [4, "ngSwitchCase"], ["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"], [3, "linkedCasesStateEmitter"]], template: function WriteLinkedCasesComponent_Template(rf, ctx) { if (rf & 1) {
18578
+ i0.ɵɵtemplate(0, WriteLinkedCasesComponent_div_0_Template, 4, 1, "div", 0);
18579
+ i0.ɵɵelementStart(1, "div", 1);
18580
+ i0.ɵɵelementStart(2, "div", 2);
18581
+ i0.ɵɵtemplate(3, WriteLinkedCasesComponent_ng_container_3_Template, 2, 0, "ng-container", 3);
18582
+ i0.ɵɵtemplate(4, WriteLinkedCasesComponent_ng_container_4_Template, 2, 0, "ng-container", 3);
18583
+ i0.ɵɵtemplate(5, WriteLinkedCasesComponent_ng_container_5_Template, 2, 0, "ng-container", 3);
18584
+ i0.ɵɵtemplate(6, WriteLinkedCasesComponent_ng_container_6_Template, 2, 0, "ng-container", 3);
18585
+ i0.ɵɵtemplate(7, WriteLinkedCasesComponent_ng_container_7_Template, 2, 0, "ng-container", 3);
18586
+ i0.ɵɵelementEnd();
18587
+ i0.ɵɵelementEnd();
18588
+ } if (rf & 2) {
18589
+ i0.ɵɵproperty("ngIf", ctx.errorMessages.length > 0);
18590
+ i0.ɵɵadvance(1);
18591
+ i0.ɵɵproperty("formGroup", ctx.formGroup);
18592
+ i0.ɵɵadvance(1);
18593
+ i0.ɵɵproperty("ngSwitch", ctx.linkedCasesPage);
18594
+ i0.ɵɵadvance(1);
18595
+ i0.ɵɵproperty("ngSwitchCase", ctx.linkedCasesPages.BEFORE_YOU_START);
18596
+ i0.ɵɵadvance(1);
18597
+ i0.ɵɵproperty("ngSwitchCase", ctx.linkedCasesPages.NO_LINKED_CASES);
18598
+ i0.ɵɵadvance(1);
18599
+ i0.ɵɵproperty("ngSwitchCase", ctx.linkedCasesPages.LINK_CASE);
18600
+ i0.ɵɵadvance(1);
18601
+ i0.ɵɵproperty("ngSwitchCase", ctx.linkedCasesPages.UNLINK_CASE);
18602
+ i0.ɵɵadvance(1);
18603
+ i0.ɵɵproperty("ngSwitchCase", ctx.linkedCasesPages.CHECK_YOUR_ANSWERS);
18604
+ } }, encapsulation: 2 });
18605
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WriteLinkedCasesComponent, [{
18606
+ type: Component,
18607
+ args: [{
18608
+ selector: 'ccd-write-linked-cases',
18609
+ templateUrl: './write-linked-cases.component.html'
18610
+ }]
18611
+ }], function () { return [{ type: CaseEditComponent }, { type: AbstractAppConfig }, { type: CommonDataService }, { type: CasesService }, { type: LinkedCasesService }]; }, { caseFields: [{
18612
+ type: Input
18613
+ }], caseField: [{
18614
+ type: Input
18615
+ }], caseEditPageComponent: [{
18616
+ type: Input
18617
+ }], onLinkedCasesSelected: [{
18618
+ type: Output
18619
+ }], isLinkedCasesJourney: [{
18620
+ type: Input
18621
+ }], formGroup: [{
18622
+ type: Input
18623
+ }] }); })();
18624
+
18625
+ function ReadLinkedCasesComponent_ng_container_7_Template(rf, ctx) { if (rf & 1) {
18626
+ i0.ɵɵelementContainer(0);
18627
+ } }
18628
+ function ReadLinkedCasesComponent_ng_container_8_Template(rf, ctx) { if (rf & 1) {
18629
+ i0.ɵɵelementContainer(0);
18630
+ } }
18631
+ function ReadLinkedCasesComponent_ng_container_14_Template(rf, ctx) { if (rf & 1) {
18632
+ i0.ɵɵelementContainer(0);
18633
+ } }
18634
+ function ReadLinkedCasesComponent_ng_container_15_Template(rf, ctx) { if (rf & 1) {
18635
+ i0.ɵɵelementContainer(0);
18636
+ } }
18637
+ function ReadLinkedCasesComponent_ng_template_16_Template(rf, ctx) { if (rf & 1) {
18638
+ const _r9 = i0.ɵɵgetCurrentView();
18639
+ i0.ɵɵelementStart(0, "div", 8);
18640
+ i0.ɵɵelementStart(1, "p", 9);
18641
+ i0.ɵɵtext(2);
18642
+ i0.ɵɵelementEnd();
18643
+ i0.ɵɵelementStart(3, "span", 10);
18644
+ i0.ɵɵelementStart(4, "a", 11);
18645
+ i0.ɵɵlistener("click", function ReadLinkedCasesComponent_ng_template_16_Template_a_click_4_listener() { i0.ɵɵrestoreView(_r9); const ctx_r8 = i0.ɵɵnextContext(); return ctx_r8.reloadCurrentRoute(); });
18646
+ i0.ɵɵtext(5, "Reload the Linked cases tab");
18647
+ i0.ɵɵelementEnd();
18648
+ i0.ɵɵelementEnd();
18649
+ i0.ɵɵelementEnd();
18650
+ } if (rf & 2) {
18651
+ const ctx_r5 = i0.ɵɵnextContext();
18652
+ i0.ɵɵadvance(2);
18653
+ i0.ɵɵtextInterpolate(ctx_r5.serverLinkedApiError.message);
18654
+ } }
18655
+ function ReadLinkedCasesComponent_ng_template_18_Template(rf, ctx) { if (rf & 1) {
18656
+ const _r11 = i0.ɵɵgetCurrentView();
18657
+ i0.ɵɵelementStart(0, "div", 8);
18658
+ i0.ɵɵelementStart(1, "p", 9);
18659
+ i0.ɵɵtext(2);
18660
+ i0.ɵɵelementEnd();
18661
+ i0.ɵɵelementStart(3, "span", 10);
18662
+ i0.ɵɵelementStart(4, "a", 11);
18663
+ i0.ɵɵlistener("click", function ReadLinkedCasesComponent_ng_template_18_Template_a_click_4_listener() { i0.ɵɵrestoreView(_r11); const ctx_r10 = i0.ɵɵnextContext(); return ctx_r10.reloadCurrentRoute(); });
18664
+ i0.ɵɵtext(5, "Reload the Linked cases tab");
18665
+ i0.ɵɵelementEnd();
18666
+ i0.ɵɵelementEnd();
18667
+ i0.ɵɵelementEnd();
18668
+ } if (rf & 2) {
18669
+ const ctx_r7 = i0.ɵɵnextContext();
18670
+ i0.ɵɵadvance(2);
18671
+ i0.ɵɵtextInterpolate(ctx_r7.serverError.message);
18672
+ } }
18673
+ class ReadLinkedCasesComponent {
18674
+ constructor(router, linkedCasesService, appConfig, commonDataService) {
18675
+ this.router = router;
18676
+ this.linkedCasesService = linkedCasesService;
18677
+ this.appConfig = appConfig;
18678
+ this.commonDataService = commonDataService;
18679
+ this.reasonListLoaded = false;
18680
+ this.reload = false;
18681
+ this.serverError = null;
18682
+ this.serverLinkedApiError = null;
18683
+ this.isServerReasonCodeError = false;
18684
+ this.isServerJurisdictionError = false;
18685
+ this.isServerLinkedFromError = false;
18686
+ this.isServerLinkedToError = false;
18687
+ }
18688
+ ngOnInit() {
18689
+ this.isServerJurisdictionError = this.linkedCasesService.serverJurisdictionError || false;
18690
+ const reasonCodeAPIurl = this.appConfig.getRDCommonDataApiUrl() + '/lov/categories/CaseLinkingReasonCode';
18691
+ this.commonDataService.getRefData(reasonCodeAPIurl).subscribe({
18692
+ next: reasons => {
18693
+ this.reasonListLoaded = true;
18694
+ this.linkedCasesService.linkCaseReasons = reasons.list_of_values.sort((a, b) => (a.value_en > b.value_en) ? 1 : -1);
18695
+ },
18696
+ error: error => {
18697
+ this.isServerReasonCodeError = true;
18698
+ this.linkedCasesService.isServerReasonCodeError = true;
18699
+ }
18700
+ });
18701
+ this.serverLinkedApiError = {
18702
+ id: 'backendError', message: 'Some case information is not available at the moment'
18703
+ };
18704
+ this.serverError = {
18705
+ id: 'backendError', message: 'There has been a system error and your request could not be processed.'
18706
+ };
18707
+ }
18708
+ ngAfterViewInit() {
18709
+ this.linkedCasesService.caseFieldValue = this.caseField.value || [];
18710
+ let labelField = document.getElementsByClassName('govuk-heading-l');
18711
+ if (labelField && labelField.length) {
18712
+ labelField[0].replaceWith('');
18713
+ }
18714
+ labelField = document.getElementsByClassName('heading-h2');
18715
+ if (labelField && labelField.length) {
18716
+ labelField[0].replaceWith('');
18717
+ }
18718
+ labelField = document.getElementsByClassName('case-viewer-label');
18719
+ if (labelField && labelField.length) {
18720
+ labelField[0].replaceWith('');
18721
+ }
18722
+ }
18723
+ reloadCurrentRoute() {
18724
+ this.router.navigate(['cases', 'case-details', this.linkedCasesService.caseDetails.case_id]).then(() => {
18725
+ window.location.hash = 'Linked cases';
18726
+ });
18727
+ }
18728
+ getFailureLinkedToNotification(evt) {
18729
+ this.isServerLinkedToError = true;
18730
+ }
18731
+ getFailureLinkedFromNotification(evt) {
18732
+ this.isServerLinkedFromError = true;
18733
+ }
18734
+ }
18735
+ ReadLinkedCasesComponent.ɵfac = function ReadLinkedCasesComponent_Factory(t) { return new (t || ReadLinkedCasesComponent)(i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(LinkedCasesService), i0.ɵɵdirectiveInject(AbstractAppConfig), i0.ɵɵdirectiveInject(CommonDataService)); };
18736
+ ReadLinkedCasesComponent.ɵcmp = i0.ɵɵdefineComponent({ type: ReadLinkedCasesComponent, selectors: [["ccd-read-linked-cases"]], inputs: { caseField: "caseField" }, decls: 20, vars: 10, consts: [[1, "govuk-!-margin-bottom-2"], [1, "heading-h1"], [1, "table-sub-heading"], ["reloadPage", "reload", 3, "caseField", "notifyAPIFailure"], [4, "ngIf", "ngIfThen"], [1, "govuk-!-margin-top-8"], ["singleApiError", ""], ["multiApisError", ""], [1, "govuk-main-wrapper"], [1, "govuk-body"], [1, "govuk-body", "align-left"], ["href", "javascript:void(0)", "id", "reload-linked-cases-tab", 1, "govuk-link", 3, "click"]], template: function ReadLinkedCasesComponent_Template(rf, ctx) { if (rf & 1) {
18737
+ i0.ɵɵelementStart(0, "div");
18738
+ i0.ɵɵelementStart(1, "div", 0);
18739
+ i0.ɵɵelementStart(2, "h1", 1);
18740
+ i0.ɵɵtext(3, "Linked cases");
18741
+ i0.ɵɵelementEnd();
18742
+ i0.ɵɵelementStart(4, "label", 2);
18743
+ i0.ɵɵtext(5, "This case is linked to");
18744
+ i0.ɵɵelementEnd();
18745
+ i0.ɵɵelementStart(6, "ccd-linked-cases-to-table", 3);
18746
+ i0.ɵɵlistener("notifyAPIFailure", function ReadLinkedCasesComponent_Template_ccd_linked_cases_to_table_notifyAPIFailure_6_listener($event) { return ctx.getFailureLinkedToNotification($event); });
18747
+ i0.ɵɵelementEnd();
18748
+ i0.ɵɵtemplate(7, ReadLinkedCasesComponent_ng_container_7_Template, 1, 0, "ng-container", 4);
18749
+ i0.ɵɵtemplate(8, ReadLinkedCasesComponent_ng_container_8_Template, 1, 0, "ng-container", 4);
18750
+ i0.ɵɵelementEnd();
18751
+ i0.ɵɵelementStart(9, "div", 5);
18752
+ i0.ɵɵelementStart(10, "label", 2);
18753
+ i0.ɵɵtext(11, "This case is linked from");
18754
+ i0.ɵɵelementEnd();
18755
+ i0.ɵɵelement(12, "br");
18756
+ i0.ɵɵelementStart(13, "ccd-linked-cases-from-table", 3);
18757
+ i0.ɵɵlistener("notifyAPIFailure", function ReadLinkedCasesComponent_Template_ccd_linked_cases_from_table_notifyAPIFailure_13_listener($event) { return ctx.getFailureLinkedFromNotification($event); });
18758
+ i0.ɵɵelementEnd();
18759
+ i0.ɵɵtemplate(14, ReadLinkedCasesComponent_ng_container_14_Template, 1, 0, "ng-container", 4);
18760
+ i0.ɵɵtemplate(15, ReadLinkedCasesComponent_ng_container_15_Template, 1, 0, "ng-container", 4);
18761
+ i0.ɵɵelementEnd();
18762
+ i0.ɵɵelementEnd();
18763
+ i0.ɵɵtemplate(16, ReadLinkedCasesComponent_ng_template_16_Template, 6, 1, "ng-template", null, 6, i0.ɵɵtemplateRefExtractor);
18764
+ i0.ɵɵtemplate(18, ReadLinkedCasesComponent_ng_template_18_Template, 6, 1, "ng-template", null, 7, i0.ɵɵtemplateRefExtractor);
18765
+ } if (rf & 2) {
18766
+ const _r4 = i0.ɵɵreference(17);
18767
+ const _r6 = i0.ɵɵreference(19);
18768
+ i0.ɵɵadvance(6);
18769
+ i0.ɵɵproperty("caseField", ctx.caseField);
18770
+ i0.ɵɵadvance(1);
18771
+ i0.ɵɵproperty("ngIf", ctx.isServerLinkedToError && ctx.isServerJurisdictionError && ctx.isServerReasonCodeError)("ngIfThen", _r6);
18772
+ i0.ɵɵadvance(1);
18773
+ i0.ɵɵproperty("ngIf", !(ctx.isServerLinkedToError && ctx.isServerJurisdictionError && ctx.isServerReasonCodeError) && (ctx.isServerLinkedToError || ctx.isServerJurisdictionError || ctx.isServerReasonCodeError))("ngIfThen", _r4);
18774
+ i0.ɵɵadvance(5);
18775
+ i0.ɵɵproperty("caseField", ctx.caseField);
18776
+ i0.ɵɵadvance(1);
18777
+ i0.ɵɵproperty("ngIf", ctx.isServerLinkedFromError && ctx.isServerJurisdictionError && ctx.isServerReasonCodeError)("ngIfThen", _r6);
18778
+ i0.ɵɵadvance(1);
18779
+ i0.ɵɵproperty("ngIf", !(ctx.isServerLinkedFromError && ctx.isServerJurisdictionError && ctx.isServerReasonCodeError) && (ctx.isServerLinkedFromError || ctx.isServerJurisdictionError || ctx.isServerReasonCodeError))("ngIfThen", _r4);
18780
+ } }, styles: [".table-sub-heading[_ngcontent-%COMP%]{font-size:24px;font-weight:700}"] });
18781
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ReadLinkedCasesComponent, [{
18782
+ type: Component,
18783
+ args: [{
18784
+ selector: 'ccd-read-linked-cases',
18785
+ templateUrl: './read-linked-cases.component.html',
18786
+ styleUrls: ['./read-linked-cases.component.scss']
18787
+ }]
18788
+ }], function () { return [{ type: i1$1.Router }, { type: LinkedCasesService }, { type: AbstractAppConfig }, { type: CommonDataService }]; }, { caseField: [{
18789
+ type: Input
18790
+ }] }); })();
18791
+
18792
+ class LinkCaseReason {
18793
+ }
18794
+ class CCDCaseLinkType {
18795
+ }
18796
+ class CaseLink {
18797
+ }
18798
+ class LinkReason {
18799
+ }
18800
+ class LinkedCasesResponse {
18801
+ }
18802
+ class CaseLinkResponse {
18803
+ }
18804
+ class LinkDetails {
18805
+ }
18806
+ class Terms {
18807
+ }
18808
+ class ESQueryType {
18809
+ }
18810
+
18811
+ class CollectionCreateCheckerService {
18812
+ setDisplayContextForChildren(caseField, profile) {
18813
+ const children = this.getCaseFieldChildren(caseField);
18814
+ if (children && children.length > 0) {
16445
18815
  children.forEach(child => {
16446
18816
  if (!!profile.user.idam.roles.find(role => this.hasCreateAccess(child, role))) {
16447
18817
  child.display_context = caseField.display_context;
@@ -18206,6 +20576,7 @@ const PALETTE_COMPONENTS = [
18206
20576
  ReadComplexFieldTableComponent,
18207
20577
  ReadComplexFieldCollectionTableComponent,
18208
20578
  ReadCaseFlagFieldComponent,
20579
+ ReadLinkedCasesComponent,
18209
20580
  // Write
18210
20581
  WriteJudicialUserFieldComponent,
18211
20582
  WriteAddressFieldComponent,
@@ -18233,7 +20604,15 @@ const PALETTE_COMPONENTS = [
18233
20604
  WriteFixedListFieldComponent,
18234
20605
  WriteFixedRadioListFieldComponent,
18235
20606
  WriteCaseLinkFieldComponent,
18236
- WriteCollectionFieldComponent
20607
+ WriteCollectionFieldComponent,
20608
+ LinkedCasesToTableComponent,
20609
+ LinkedCasesFromTableComponent,
20610
+ BeforeYouStartComponent,
20611
+ LinkCasesComponent,
20612
+ CheckYourAnswersComponent,
20613
+ WriteLinkedCasesComponent,
20614
+ UnLinkCasesComponent,
20615
+ NoLinkedCasesComponent
18237
20616
  ];
18238
20617
  class PaletteModule {
18239
20618
  }
@@ -18249,6 +20628,9 @@ PaletteModule.ɵinj = i0.ɵɵdefineInjector({ providers: [
18249
20628
  FileUploadStateService,
18250
20629
  FileUploadProgressGuard,
18251
20630
  WindowService,
20631
+ LinkedCasesService,
20632
+ CommonDataService,
20633
+ JurisdictionService$1,
18252
20634
  { provide: MAT_DATE_LOCALE, useValue: 'en-GB' }
18253
20635
  ], imports: [[
18254
20636
  CommonModule,
@@ -18335,6 +20717,7 @@ PaletteModule.ɵinj = i0.ɵɵdefineInjector({ providers: [
18335
20717
  ReadComplexFieldTableComponent,
18336
20718
  ReadComplexFieldCollectionTableComponent,
18337
20719
  ReadCaseFlagFieldComponent,
20720
+ ReadLinkedCasesComponent,
18338
20721
  // Write
18339
20722
  WriteJudicialUserFieldComponent,
18340
20723
  WriteAddressFieldComponent,
@@ -18362,7 +20745,15 @@ PaletteModule.ɵinj = i0.ɵɵdefineInjector({ providers: [
18362
20745
  WriteFixedListFieldComponent,
18363
20746
  WriteFixedRadioListFieldComponent,
18364
20747
  WriteCaseLinkFieldComponent,
18365
- WriteCollectionFieldComponent], imports: [CommonModule,
20748
+ WriteCollectionFieldComponent,
20749
+ LinkedCasesToTableComponent,
20750
+ LinkedCasesFromTableComponent,
20751
+ BeforeYouStartComponent,
20752
+ LinkCasesComponent,
20753
+ CheckYourAnswersComponent,
20754
+ WriteLinkedCasesComponent,
20755
+ UnLinkCasesComponent,
20756
+ NoLinkedCasesComponent], imports: [CommonModule,
18366
20757
  RouterModule,
18367
20758
  FormsModule,
18368
20759
  ReactiveFormsModule,
@@ -18431,6 +20822,7 @@ PaletteModule.ɵinj = i0.ɵɵdefineInjector({ providers: [
18431
20822
  ReadComplexFieldTableComponent,
18432
20823
  ReadComplexFieldCollectionTableComponent,
18433
20824
  ReadCaseFlagFieldComponent,
20825
+ ReadLinkedCasesComponent,
18434
20826
  // Write
18435
20827
  WriteJudicialUserFieldComponent,
18436
20828
  WriteAddressFieldComponent,
@@ -18458,7 +20850,15 @@ PaletteModule.ɵinj = i0.ɵɵdefineInjector({ providers: [
18458
20850
  WriteFixedListFieldComponent,
18459
20851
  WriteFixedRadioListFieldComponent,
18460
20852
  WriteCaseLinkFieldComponent,
18461
- WriteCollectionFieldComponent] }); })();
20853
+ WriteCollectionFieldComponent,
20854
+ LinkedCasesToTableComponent,
20855
+ LinkedCasesFromTableComponent,
20856
+ BeforeYouStartComponent,
20857
+ LinkCasesComponent,
20858
+ CheckYourAnswersComponent,
20859
+ WriteLinkedCasesComponent,
20860
+ UnLinkCasesComponent,
20861
+ NoLinkedCasesComponent] }); })();
18462
20862
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PaletteModule, [{
18463
20863
  type: NgModule,
18464
20864
  args: [{
@@ -18522,6 +20922,9 @@ PaletteModule.ɵinj = i0.ɵɵdefineInjector({ providers: [
18522
20922
  FileUploadStateService,
18523
20923
  FileUploadProgressGuard,
18524
20924
  WindowService,
20925
+ LinkedCasesService,
20926
+ CommonDataService,
20927
+ JurisdictionService$1,
18525
20928
  { provide: MAT_DATE_LOCALE, useValue: 'en-GB' }
18526
20929
  ]
18527
20930
  }]
@@ -18536,6 +20939,7 @@ i0.ɵɵsetComponentScope(ReadOrganisationFieldComponent, [i1.NgSwitch, i1.NgSwit
18536
20939
  i0.ɵɵsetComponentScope(ReadOrderSummaryFieldComponent, [i1.NgForOf, ReadOrderSummaryRowComponent,
18537
20940
  ReadMoneyGbpFieldComponent], []);
18538
20941
  i0.ɵɵsetComponentScope(ReadOrderSummaryRowComponent, [ReadMoneyGbpFieldComponent], []);
20942
+ i0.ɵɵsetComponentScope(ReadCaseLinkFieldComponent, [i1.NgIf, ReadLinkedCasesComponent], [CaseReferencePipe]);
18539
20943
  i0.ɵɵsetComponentScope(ReadComplexFieldComponent, [i1.NgSwitch, i1.NgSwitchCase, ReadComplexFieldRawComponent,
18540
20944
  ReadComplexFieldCollectionTableComponent, i1.NgSwitchDefault, ReadComplexFieldTableComponent], []);
18541
20945
  i0.ɵɵsetComponentScope(ReadComplexFieldRawComponent, [i1.NgForOf, FieldReadComponent], [ReadFieldsFilterPipe]);
@@ -18543,6 +20947,7 @@ i0.ɵɵsetComponentScope(ReadComplexFieldTableComponent, [i1.NgForOf, i1.NgIf, F
18543
20947
  i0.ɵɵsetComponentScope(ReadComplexFieldCollectionTableComponent, [i1.NgForOf, i1.NgIf, FieldReadComponent,
18544
20948
  ReadCaseLinkFieldComponent], [ReadFieldsFilterPipe, CcdCollectionTableCaseFieldsFilterPipe, i1.KeyValuePipe, IsCompoundPipe]);
18545
20949
  i0.ɵɵsetComponentScope(ReadCaseFlagFieldComponent, [i1.NgSwitch, i1.NgSwitchCase, CaseFlagSummaryListComponent, i1.NgSwitchDefault, i1.NgForOf, i1.NgIf, CaseFlagTableComponent], []);
20950
+ i0.ɵɵsetComponentScope(ReadLinkedCasesComponent, [LinkedCasesToTableComponent, i1.NgIf, LinkedCasesFromTableComponent], []);
18546
20951
  i0.ɵɵsetComponentScope(WriteAddressFieldComponent, [i1.NgIf, i1.NgClass, i2.DefaultValueAccessor, i2.NgControlStatus, i2.FormControlDirective, i2.SelectControlValueAccessor, i1.NgForOf, i2.NgSelectOption, i2.ɵangular_packages_forms_forms_z, WriteComplexFieldComponent, i2.NgControlStatusGroup, i2.FormGroupDirective], [FieldLabelPipe]);
18547
20952
  i0.ɵɵsetComponentScope(WriteComplexFieldComponent, [i1.NgIf, i1.NgForOf, i1.NgSwitch, i1.NgSwitchCase, FieldReadComponent, LabelSubstitutorDirective, i2.NgControlStatusGroup, i2.FormGroupDirective, FieldWriteComponent], [FieldLabelPipe, IsReadOnlyPipe]);
18548
20953
  i0.ɵɵsetComponentScope(WriteDocumentFieldComponent, [i1.NgClass, i1.NgIf, ReadDocumentFieldComponent], [FieldLabelPipe]);
@@ -18557,7 +20962,17 @@ i0.ɵɵsetComponentScope(WriteOrganisationFieldComponent, [i2.NgControlStatusGro
18557
20962
  WriteOrganisationComplexFieldComponent], [i1.AsyncPipe]);
18558
20963
  i0.ɵɵsetComponentScope(WriteOrderSummaryFieldComponent, [ReadOrderSummaryFieldComponent], []);
18559
20964
  i0.ɵɵsetComponentScope(WriteDateContainerFieldComponent, [i1.NgIf, DatetimePickerComponent, i2.NgControlStatusGroup, i2.FormGroupDirective, WriteDateFieldComponent], []);
20965
+ i0.ɵɵsetComponentScope(WriteCaseLinkFieldComponent, [i1.NgIf, i2.DefaultValueAccessor, i2.NgControlStatus, i2.FormControlDirective, WriteLinkedCasesComponent, i2.NgControlStatusGroup, i2.FormGroupDirective], [FieldLabelPipe]);
18560
20966
  i0.ɵɵsetComponentScope(WriteCollectionFieldComponent, [i1.NgIf, i1.NgForOf, FieldWriteComponent, i2.NgControlStatusGroup, i2.FormGroupDirective], [FieldLabelPipe, FirstErrorPipe]);
20967
+ i0.ɵɵsetComponentScope(LinkedCasesToTableComponent, [i1.NgIf, i1.NgForOf], [CaseReferencePipe, LinkCasesReasonValuePipe]);
20968
+ i0.ɵɵsetComponentScope(LinkedCasesFromTableComponent, [i1.NgIf, i1.NgForOf], [CaseReferencePipe, LinkCasesReasonValuePipe]);
20969
+ i0.ɵɵsetComponentScope(LinkCasesComponent, [i1.NgIf, i2.NgControlStatusGroup, i2.FormGroupDirective, i1.NgClass, i2.DefaultValueAccessor, i2.NgControlStatus, i2.FormControlName, i2.FormArrayName, i1.NgForOf, i2.FormGroupName, i2.CheckboxControlValueAccessor], [CaseReferencePipe, LinkCasesReasonValuePipe]);
20970
+ i0.ɵɵsetComponentScope(CheckYourAnswersComponent, [i1.NgIf, i1.NgForOf], [CaseReferencePipe, LinkCasesReasonValuePipe]);
20971
+ i0.ɵɵsetComponentScope(WriteLinkedCasesComponent, [i1.NgIf, i1.NgForOf, i2.NgControlStatusGroup, i2.FormGroupDirective, i1.NgSwitch, i1.NgSwitchCase, BeforeYouStartComponent,
20972
+ NoLinkedCasesComponent,
20973
+ LinkCasesComponent,
20974
+ UnLinkCasesComponent,
20975
+ CheckYourAnswersComponent], []);
18561
20976
 
18562
20977
  class Confirmation {
18563
20978
  constructor(caseId, status, header, body) {
@@ -21038,7 +23453,7 @@ class WorkbasketFiltersComponent {
21038
23453
  WorkbasketFiltersComponent.PARAM_JURISDICTION = 'jurisdiction';
21039
23454
  WorkbasketFiltersComponent.PARAM_CASE_TYPE = 'case-type';
21040
23455
  WorkbasketFiltersComponent.PARAM_CASE_STATE = 'case-state';
21041
- WorkbasketFiltersComponent.ɵfac = function WorkbasketFiltersComponent_Factory(t) { return new (t || WorkbasketFiltersComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(WorkbasketInputFilterService), i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(JurisdictionService), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(WindowService)); };
23456
+ WorkbasketFiltersComponent.ɵfac = function WorkbasketFiltersComponent_Factory(t) { return new (t || WorkbasketFiltersComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(WorkbasketInputFilterService), i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(JurisdictionService$1), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(WindowService)); };
21042
23457
  WorkbasketFiltersComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WorkbasketFiltersComponent, selectors: [["ccd-workbasket-filters"]], inputs: { jurisdictions: "jurisdictions", defaults: "defaults" }, outputs: { onApply: "onApply", onReset: "onReset" }, decls: 28, vars: 13, consts: [["aria-label", "Filters", 1, "heading-h2"], [1, "global-display"], [1, "form-group"], ["for", "wb-jurisdiction", 1, "form-label"], ["id", "wb-jurisdiction", "name", "jurisdiction", "aria-controls", "search-result", 1, "form-control", "form-control-3-4", "ccd-dropdown", 3, "ngModel", "ngModelChange", "change"], [3, "ngValue", 4, "ngIf"], [3, "ngValue", 4, "ngFor", "ngForOf"], ["for", "wb-case-type", 1, "form-label"], ["id", "wb-case-type", "name", "case-type", "aria-controls", "search-result", 1, "form-control", "form-control-3-4", "ccd-dropdown", 3, "ngModel", "disabled", "ngModelChange", "change"], ["for", "wb-case-state", 1, "form-label"], ["id", "wb-case-state", "name", "state", "aria-controls", "search-result", 1, "form-control", "form-control-3-4", "ccd-dropdown", 3, "ngModel", "disabled", "ngModelChange"], [3, "ngValue"], ["ccdConditionalShowForm", "", 3, "formGroup", "contextFields", 4, "ngIf"], ["type", "button", "title", "Apply filter", "aria-label", "Apply filter", 1, "button", "workbasket-filters-apply", 3, "disabled", "click"], ["type", "button", "title", "Reset filter", "aria-label", "Reset filter", 1, "button", "button-secondary", 3, "click"], ["ccdConditionalShowForm", "", 3, "formGroup", "contextFields"], ["id", "dynamicFilters"], ["class", "form-group", 4, "ngFor", "ngForOf"], [3, "caseField", "formGroup", "isExpanded", "isInSearchBlock", "keyup.enter"]], template: function WorkbasketFiltersComponent_Template(rf, ctx) { if (rf & 1) {
21043
23458
  i0.ɵɵelementStart(0, "h2", 0);
21044
23459
  i0.ɵɵtext(1, "Filters");
@@ -21118,7 +23533,7 @@ WorkbasketFiltersComponent.ɵcmp = i0.ɵɵdefineComponent({ type: WorkbasketFilt
21118
23533
  templateUrl: './workbasket-filters.component.html',
21119
23534
  styleUrls: ['./workbasket-filters.component.scss']
21120
23535
  }]
21121
- }], function () { return [{ type: i1$1.ActivatedRoute }, { type: WorkbasketInputFilterService }, { type: OrderService }, { type: JurisdictionService }, { type: AlertService }, { type: WindowService }]; }, { jurisdictions: [{
23536
+ }], function () { return [{ type: i1$1.ActivatedRoute }, { type: WorkbasketInputFilterService }, { type: OrderService }, { type: JurisdictionService$1 }, { type: AlertService }, { type: WindowService }]; }, { jurisdictions: [{
21122
23537
  type: Input
21123
23538
  }], defaults: [{
21124
23539
  type: Input
@@ -21135,7 +23550,7 @@ WorkbasketFiltersModule.ɵmod = i0.ɵɵdefineNgModule({ type: WorkbasketFiltersM
21135
23550
  WorkbasketFiltersModule.ɵinj = i0.ɵɵdefineInjector({ providers: [
21136
23551
  WorkbasketInputFilterService,
21137
23552
  OrderService,
21138
- JurisdictionService,
23553
+ JurisdictionService$1,
21139
23554
  AlertService,
21140
23555
  WindowService,
21141
23556
  ], imports: [[
@@ -21169,7 +23584,7 @@ WorkbasketFiltersModule.ɵinj = i0.ɵɵdefineInjector({ providers: [
21169
23584
  providers: [
21170
23585
  WorkbasketInputFilterService,
21171
23586
  OrderService,
21172
- JurisdictionService,
23587
+ JurisdictionService$1,
21173
23588
  AlertService,
21174
23589
  WindowService,
21175
23590
  ]
@@ -21238,7 +23653,7 @@ CaseListFiltersModule.ɵmod = i0.ɵɵdefineNgModule({ type: CaseListFiltersModul
21238
23653
  CaseListFiltersModule.ɵinj = i0.ɵɵdefineInjector({ providers: [
21239
23654
  WorkbasketInputFilterService,
21240
23655
  OrderService,
21241
- JurisdictionService,
23656
+ JurisdictionService$1,
21242
23657
  AlertService,
21243
23658
  WindowService
21244
23659
  ], imports: [[
@@ -21275,7 +23690,7 @@ CaseListFiltersModule.ɵinj = i0.ɵɵdefineInjector({ providers: [
21275
23690
  providers: [
21276
23691
  WorkbasketInputFilterService,
21277
23692
  OrderService,
21278
- JurisdictionService,
23693
+ JurisdictionService$1,
21279
23694
  AlertService,
21280
23695
  WindowService
21281
23696
  ]
@@ -22017,7 +24432,14 @@ class CaseEventTriggerComponent {
22017
24432
  });
22018
24433
  }
22019
24434
  cancel() {
22020
- return this.router.navigate([this.parentUrl]);
24435
+ if (this.router.url && this.router.url.includes('linkCases')) {
24436
+ this.router.navigate(['cases', 'case-details', this.caseDetails.case_id]).then(() => {
24437
+ window.location.hash = 'Linked cases';
24438
+ });
24439
+ }
24440
+ else {
24441
+ return this.router.navigate([this.parentUrl]);
24442
+ }
22021
24443
  }
22022
24444
  isDataLoaded() {
22023
24445
  return !!(this.eventTrigger && this.caseDetails);
@@ -22641,7 +25063,7 @@ function CaseFullAccessViewComponent_ng_container_12_Template(rf, ctx) { if (rf
22641
25063
  i0.ɵɵproperty("ngIf", ctx_r5.prependedTabs && ctx_r5.prependedTabs.length || ctx_r5.appendedTabs && ctx_r5.appendedTabs.length);
22642
25064
  } }
22643
25065
  class CaseFullAccessViewComponent {
22644
- constructor(ngZone, route, router, navigationNotifierService, orderService, activityPollingService, dialog, alertService, draftService, errorNotifierService, convertHrefToRouterService, location, sessionStorageService, crf) {
25066
+ constructor(ngZone, route, router, navigationNotifierService, orderService, activityPollingService, dialog, alertService, draftService, errorNotifierService, convertHrefToRouterService, location, crf, sessionStorageService) {
22645
25067
  this.ngZone = ngZone;
22646
25068
  this.route = route;
22647
25069
  this.router = router;
@@ -22654,8 +25076,8 @@ class CaseFullAccessViewComponent {
22654
25076
  this.errorNotifierService = errorNotifierService;
22655
25077
  this.convertHrefToRouterService = convertHrefToRouterService;
22656
25078
  this.location = location;
22657
- this.sessionStorageService = sessionStorageService;
22658
25079
  this.crf = crf;
25080
+ this.sessionStorageService = sessionStorageService;
22659
25081
  this.hasPrint = true;
22660
25082
  this.hasEventSelector = true;
22661
25083
  this.prependedTabs = [];
@@ -22794,7 +25216,7 @@ class CaseFullAccessViewComponent {
22794
25216
  let matTab;
22795
25217
  const url = this.location.path(true);
22796
25218
  let hashValue = url.substring(url.indexOf('#') + 1);
22797
- if (!url.includes('#') && !url.includes('roles-and-access') && !url.includes('tasks')) {
25219
+ if (!url.includes('#') && !url.includes('roles-and-access') && !url.includes('tasks') && !url.includes('hearings')) {
22798
25220
  const paths = url.split('/');
22799
25221
  // lastPath can be /caseId, or the tabs /tasks, /hearings etc.
22800
25222
  const lastPath = decodeURIComponent(paths[paths.length - 1]);
@@ -22828,8 +25250,13 @@ class CaseFullAccessViewComponent {
22828
25250
  else {
22829
25251
  const regExp = new RegExp(CaseFullAccessViewComponent.UNICODE_SPACE, 'g');
22830
25252
  hashValue = hashValue.replace(regExp, CaseFullAccessViewComponent.EMPTY_SPACE);
22831
- if (hashValue.includes('roles-and-access') || hashValue.includes('tasks')) {
22832
- hashValue = hashValue.includes('roles-and-access') ? 'roles and access' : 'tasks';
25253
+ if (hashValue.includes('hearings')) {
25254
+ hashValue = 'hearings';
25255
+ }
25256
+ else {
25257
+ if (hashValue.includes('roles-and-access') || hashValue.includes('tasks')) {
25258
+ hashValue = hashValue.includes('roles-and-access') ? 'roles and access' : 'tasks';
25259
+ }
22833
25260
  }
22834
25261
  matTab = this.tabGroup._tabs.find((x) => x.textLabel.replace(CaseFullAccessViewComponent.EMPTY_SPACE, '').toLowerCase() ===
22835
25262
  hashValue.replace(CaseFullAccessViewComponent.EMPTY_SPACE, '').toLowerCase());
@@ -22845,8 +25272,8 @@ class CaseFullAccessViewComponent {
22845
25272
  const id = tab.element.nativeElement.id;
22846
25273
  // due to some edge case like hidden tab we can't calculate the last index of existing tabs,
22847
25274
  // so have to hard code the hearings id here
22848
- if ((tabChangeEvent.index <= 1 && this.prependedTabs.length) ||
22849
- (this.appendedTabs.length && id === 'hearings')) {
25275
+ if ((tabChangeEvent.index <= 1 && this.prependedTabs && this.prependedTabs.length) ||
25276
+ (this.appendedTabs && this.appendedTabs.length && id === 'hearings')) {
22850
25277
  this.router.navigate([id], { relativeTo: this.route });
22851
25278
  }
22852
25279
  else {
@@ -22953,7 +25380,7 @@ CaseFullAccessViewComponent.TRIGGER_TEXT_START = 'Go';
22953
25380
  CaseFullAccessViewComponent.TRIGGER_TEXT_CONTINUE = 'Ignore Warning and Go';
22954
25381
  CaseFullAccessViewComponent.UNICODE_SPACE = '%20';
22955
25382
  CaseFullAccessViewComponent.EMPTY_SPACE = ' ';
22956
- CaseFullAccessViewComponent.ɵfac = function CaseFullAccessViewComponent_Factory(t) { return new (t || CaseFullAccessViewComponent)(i0.ɵɵdirectiveInject(i0.NgZone), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(NavigationNotifierService), i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(ActivityPollingService), i0.ɵɵdirectiveInject(i1$3.MatDialog), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(DraftService), i0.ɵɵdirectiveInject(ErrorNotifierService), i0.ɵɵdirectiveInject(ConvertHrefToRouterService), i0.ɵɵdirectiveInject(i1.Location), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
25383
+ CaseFullAccessViewComponent.ɵfac = function CaseFullAccessViewComponent_Factory(t) { return new (t || CaseFullAccessViewComponent)(i0.ɵɵdirectiveInject(i0.NgZone), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(NavigationNotifierService), i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(ActivityPollingService), i0.ɵɵdirectiveInject(i1$3.MatDialog), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(DraftService), i0.ɵɵdirectiveInject(ErrorNotifierService), i0.ɵɵdirectiveInject(ConvertHrefToRouterService), i0.ɵɵdirectiveInject(i1.Location), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(SessionStorageService)); };
22957
25384
  CaseFullAccessViewComponent.ɵcmp = i0.ɵɵdefineComponent({ type: CaseFullAccessViewComponent, selectors: [["ccd-case-full-access-view"]], viewQuery: function CaseFullAccessViewComponent_Query(rf, ctx) { if (rf & 1) {
22958
25385
  i0.ɵɵviewQuery(_c0$b, 1);
22959
25386
  } if (rf & 2) {
@@ -23005,7 +25432,7 @@ CaseFullAccessViewComponent.ɵcmp = i0.ɵɵdefineComponent({ type: CaseFullAcces
23005
25432
  templateUrl: './case-full-access-view.component.html',
23006
25433
  styleUrls: ['./case-full-access-view.component.scss']
23007
25434
  }]
23008
- }], function () { return [{ type: i0.NgZone }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: NavigationNotifierService }, { type: OrderService }, { type: ActivityPollingService }, { type: i1$3.MatDialog }, { type: AlertService }, { type: DraftService }, { type: ErrorNotifierService }, { type: ConvertHrefToRouterService }, { type: i1.Location }, { type: SessionStorageService }, { type: i0.ChangeDetectorRef }]; }, { hasPrint: [{
25435
+ }], function () { return [{ type: i0.NgZone }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: NavigationNotifierService }, { type: OrderService }, { type: ActivityPollingService }, { type: i1$3.MatDialog }, { type: AlertService }, { type: DraftService }, { type: ErrorNotifierService }, { type: ConvertHrefToRouterService }, { type: i1.Location }, { type: i0.ChangeDetectorRef }, { type: SessionStorageService }]; }, { hasPrint: [{
23009
25436
  type: Input
23010
25437
  }], hasEventSelector: [{
23011
25438
  type: Input
@@ -25925,7 +28352,7 @@ class SearchFiltersComponent {
25925
28352
  }
25926
28353
  }
25927
28354
  }
25928
- SearchFiltersComponent.ɵfac = function SearchFiltersComponent_Factory(t) { return new (t || SearchFiltersComponent)(i0.ɵɵdirectiveInject(SearchService), i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(JurisdictionService), i0.ɵɵdirectiveInject(WindowService)); };
28355
+ SearchFiltersComponent.ɵfac = function SearchFiltersComponent_Factory(t) { return new (t || SearchFiltersComponent)(i0.ɵɵdirectiveInject(SearchService), i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(JurisdictionService$1), i0.ɵɵdirectiveInject(WindowService)); };
25929
28356
  SearchFiltersComponent.ɵcmp = i0.ɵɵdefineComponent({ type: SearchFiltersComponent, selectors: [["ccd-search-filters"]], inputs: { jurisdictions: "jurisdictions", autoApply: "autoApply" }, outputs: { onApply: "onApply", onReset: "onReset", onJurisdiction: "onJurisdiction" }, decls: 19, vars: 7, consts: [["aria-label", "Filters", 1, "heading-h2"], [1, "global-display"], [1, "form-group", 2, "margin-top", "13px"], ["for", "s-jurisdiction", 1, "form-label"], ["id", "s-jurisdiction", "name", "jurisdiction", "aria-controls", "search-result", 1, "form-control", "form-control-3-4", "ccd-dropdown", 3, "ngModel", "ngModelChange", "change"], [3, "ngValue", 4, "ngFor", "ngForOf"], [1, "form-group"], ["for", "s-case-type", 1, "form-label"], ["id", "s-case-type", "name", "case-type", "aria-controls", "search-result", 1, "form-control", "form-control-3-4", "ccd-dropdown", 3, "disabled", "ngModel", "ngModelChange", "change"], ["ccdConditionalShowForm", "", 3, "formGroup", "contextFields", 4, "ngIf"], ["type", "button", "title", "Apply filter", "aria-label", "Apply filter", 1, "button", 3, "disabled", "click", "keyup.enter"], ["id", "reset", "type", "button", "title", "Reset filter", "aria-label", "Reset filter", 1, "button", "button-secondary", 3, "click"], [3, "ngValue"], ["ccdConditionalShowForm", "", 3, "formGroup", "contextFields"], ["id", "dynamicFilters"], ["class", "form-group", 4, "ngFor", "ngForOf"], [3, "caseField", "formGroup", "isExpanded", "keyup.enter"]], template: function SearchFiltersComponent_Template(rf, ctx) { if (rf & 1) {
25930
28357
  i0.ɵɵelementStart(0, "h2", 0);
25931
28358
  i0.ɵɵtext(1, "Filters");
@@ -25980,7 +28407,7 @@ SearchFiltersComponent.ɵcmp = i0.ɵɵdefineComponent({ type: SearchFiltersCompo
25980
28407
  selector: 'ccd-search-filters',
25981
28408
  templateUrl: './search-filters.component.html',
25982
28409
  }]
25983
- }], function () { return [{ type: SearchService }, { type: OrderService }, { type: JurisdictionService }, { type: WindowService }]; }, { jurisdictions: [{
28410
+ }], function () { return [{ type: SearchService }, { type: OrderService }, { type: JurisdictionService$1 }, { type: WindowService }]; }, { jurisdictions: [{
25984
28411
  type: Input
25985
28412
  }], autoApply: [{
25986
28413
  type: Input
@@ -26055,7 +28482,7 @@ SearchFiltersModule.ɵmod = i0.ɵɵdefineNgModule({ type: SearchFiltersModule })
26055
28482
  SearchFiltersModule.ɵinj = i0.ɵɵdefineInjector({ providers: [
26056
28483
  SearchService,
26057
28484
  OrderService,
26058
- JurisdictionService,
28485
+ JurisdictionService$1,
26059
28486
  DefinitionsService,
26060
28487
  WindowService
26061
28488
  ], imports: [[
@@ -26091,7 +28518,7 @@ SearchFiltersModule.ɵinj = i0.ɵɵdefineInjector({ providers: [
26091
28518
  providers: [
26092
28519
  SearchService,
26093
28520
  OrderService,
26094
- JurisdictionService,
28521
+ JurisdictionService$1,
26095
28522
  DefinitionsService,
26096
28523
  WindowService
26097
28524
  ]
@@ -27198,5 +29625,5 @@ class TestRouteSnapshotBuilder {
27198
29625
  * Generated bundle index. Do not edit.
27199
29626
  */
27200
29627
 
27201
- 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, BodyComponent, BrowserService, CallbackErrorsComponent, CallbackErrorsContext, CaseAccessUtils, CaseBasicAccessViewComponent, CaseChallengedAccessRequestComponent, CaseChallengedAccessSuccessComponent, CaseCreateComponent, CaseDetails, CaseEditComponent, CaseEditConfirmComponent, CaseEditFormComponent, CaseEditPageComponent, CaseEditSubmitComponent, CaseEditWizardGuard, CaseEditorConfig, CaseEditorModule, CaseEvent, CaseEventData, CaseEventTrigger, CaseEventTriggerComponent, CaseField, CaseFieldService, CaseFlagFieldState, CaseFlagRefdataService, CaseFlagStatus, CaseFlagSummaryListComponent, CaseFlagSummaryListDisplayMode, CaseFlagTableComponent, CaseFlagText, CaseFlagWizardStepTitle, CaseFullAccessViewComponent, CaseHeaderComponent, CaseHeaderModule, CaseHistoryViewerFieldComponent, 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, ConditionalShowFormDirective, ConditionalShowModule, ConditionalShowRegistrarService, 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, Embedded, 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, FocusElementDirective, FocusElementModule, FooterComponent, FormDocument, FormErrorService, FormValidatorsService, FormValueService, FormatTranslatorService, GreyBarService, HRef, HasLoadingState, HeaderBarComponent, HeadersModule, HttpError, HttpErrorService, HttpService, IsCompoundPipe, IsMandatoryPipe, IsReadOnlyAndNotCollectionPipe, IsReadOnlyPipe, JudicialworkerService, Jurisdiction, JurisdictionService, LabelFieldComponent, LabelSubstitutorDirective, LabelSubstitutorModule, LoadingModule, LoadingService, LoadingSpinnerComponent, LoadingSpinnerModule, MULTIPLE_TASKS_FOUND, ManageCaseFlagsComponent, MarkdownComponent, MoneyGbpInputComponent, MultipleTasksExistComponent, NavigationComponent, NavigationItemComponent, NavigationNotifierService, NavigationOrigin, NoTasksAvailableComponent, NotificationBannerComponent, NotificationBannerHeaderClass, NotificationBannerType, OrderService, OrderSummary, OrganisationConverter, OrganisationService, PageValidationService, PaginationComponent, PaginationMetadata, PaginationModule, PaletteContext, PaletteModule, PaletteService, PaletteUtilsModule, PaymentField, PhaseComponent, PipesModule, PlaceholderService, PrintUrlPipe, Profile, ProfileNotifier, ProfileService, ReadCaseFlagFieldComponent, ReadCaseLinkFieldComponent, ReadCollectionFieldComponent, ReadComplexFieldCollectionTableComponent, ReadComplexFieldComponent, ReadComplexFieldRawComponent, ReadComplexFieldTableComponent, ReadDateFieldComponent, ReadDocumentFieldComponent, ReadDynamicListFieldComponent, ReadDynamicRadioListFieldComponent, ReadEmailFieldComponent, ReadFieldsFilterPipe, ReadFixedListFieldComponent, ReadFixedRadioListFieldComponent, ReadJudicialUserFieldComponent, ReadMoneyGbpFieldComponent, ReadMultiSelectListFieldComponent, ReadNumberFieldComponent, ReadOrderSummaryFieldComponent, ReadOrderSummaryRowComponent, ReadOrganisationFieldComponent, ReadOrganisationFieldRawComponent, ReadOrganisationFieldTableComponent, ReadPhoneUKFieldComponent, ReadTextAreaFieldComponent, ReadTextFieldComponent, ReadYesNoFieldComponent, RefdataCaseFlagType, RemoveDialogComponent, RequestOptionsBuilder, RouterHelperService, 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, TestRouteSnapshotBuilder, UnsupportedFieldComponent, UpdateFlagComponent, UpdateFlagErrorMessage, UpdateFlagStep, WaysToPayFieldComponent, WindowService, Wizard, WizardFactoryService, WizardPage, WizardPageField, WorkAllocationService, WorkbasketFiltersComponent, WorkbasketFiltersModule, WorkbasketInput, WorkbasketInputFilterService, WorkbasketInputModel, WriteAddressFieldComponent, WriteCaseFlagFieldComponent, WriteCaseLinkFieldComponent, WriteCollectionFieldComponent, WriteComplexFieldComponent, WriteDateContainerFieldComponent, WriteDateFieldComponent, WriteDocumentFieldComponent, WriteDynamicListFieldComponent, WriteDynamicRadioListFieldComponent, WriteEmailFieldComponent, WriteFixedListFieldComponent, WriteFixedRadioListFieldComponent, WriteJudicialUserFieldComponent, WriteMoneyGbpFieldComponent, WriteMultiSelectListFieldComponent, WriteNumberFieldComponent, WriteOrderSummaryFieldComponent, WriteOrganisationComplexFieldComponent, WriteOrganisationFieldComponent, WritePhoneUKFieldComponent, WriteTextAreaFieldComponent, WriteTextFieldComponent, WriteYesNoFieldComponent, YesNoService, aCaseField, createACL, createCaseEventTrigger, createCaseField, createComplexFieldOverride, createFieldType, createFixedListFieldType, createHiddenComplexFieldOverride, createMultiSelectListFieldType, createWizardPage, createWizardPageField, editorRouting, initDialog, newCaseField, textFieldType, viewerRouting };
29628
+ 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, CallbackErrorsComponent, CallbackErrorsContext, CaseAccessUtils, CaseBasicAccessViewComponent, CaseChallengedAccessRequestComponent, CaseChallengedAccessSuccessComponent, CaseCreateComponent, CaseDetails, CaseEditComponent, CaseEditConfirmComponent, CaseEditFormComponent, CaseEditPageComponent, CaseEditSubmitComponent, CaseEditWizardGuard, CaseEditorConfig, CaseEditorModule, CaseEvent, CaseEventData, CaseEventTrigger, CaseEventTriggerComponent, CaseField, CaseFieldService, CaseFlagFieldState, CaseFlagRefdataService, CaseFlagStatus, CaseFlagSummaryListComponent, CaseFlagSummaryListDisplayMode, CaseFlagTableComponent, CaseFlagText, 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, 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, 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, FocusElementDirective, FocusElementModule, FooterComponent, FormDocument, FormErrorService, FormValidatorsService, FormValueService, FormatTranslatorService, GreyBarService, HRef, HasLoadingState, HeaderBarComponent, HeadersModule, HttpError, HttpErrorService, HttpService, IsCompoundPipe, IsMandatoryPipe, IsReadOnlyAndNotCollectionPipe, IsReadOnlyPipe, JudicialworkerService, Jurisdiction, JurisdictionService$1 as JurisdictionService, LabelFieldComponent, LabelSubstitutorDirective, LabelSubstitutorModule, LinkCaseReason, LinkCasesComponent, LinkCasesReasonValuePipe, LinkDetails, LinkReason, LinkedCasesErrorMessages, LinkedCasesEventTriggers, LinkedCasesFromTableComponent, LinkedCasesPages, LinkedCasesResponse, LinkedCasesToTableComponent, LoadingModule, LoadingService, LoadingSpinnerComponent, LoadingSpinnerModule, MULTIPLE_TASKS_FOUND, ManageCaseFlagsComponent, MarkdownComponent, MoneyGbpInputComponent, MultipleTasksExistComponent, NavigationComponent, NavigationItemComponent, NavigationNotifierService, NavigationOrigin, NoLinkedCasesComponent, NoTasksAvailableComponent, NotificationBannerComponent, NotificationBannerHeaderClass, NotificationBannerType, OrderService, OrderSummary, OrganisationConverter, OrganisationService, PageType, PageValidationService, PaginationComponent, PaginationMetadata, PaginationModule, PaletteContext, PaletteModule, PaletteService, PaletteUtilsModule, Patterns, PaymentField, PhaseComponent, PipesModule, PlaceholderService, PrintUrlPipe, Profile, ProfileNotifier, ProfileService, ReadCaseFlagFieldComponent, ReadCaseLinkFieldComponent, ReadCollectionFieldComponent, ReadComplexFieldCollectionTableComponent, ReadComplexFieldComponent, ReadComplexFieldRawComponent, ReadComplexFieldTableComponent, ReadDateFieldComponent, ReadDocumentFieldComponent, ReadDynamicListFieldComponent, ReadDynamicRadioListFieldComponent, ReadEmailFieldComponent, ReadFieldsFilterPipe, ReadFixedListFieldComponent, ReadFixedRadioListFieldComponent, ReadJudicialUserFieldComponent, ReadLinkedCasesComponent, ReadMoneyGbpFieldComponent, ReadMultiSelectListFieldComponent, ReadNumberFieldComponent, ReadOrderSummaryFieldComponent, ReadOrderSummaryRowComponent, ReadOrganisationFieldComponent, ReadOrganisationFieldRawComponent, ReadOrganisationFieldTableComponent, ReadPhoneUKFieldComponent, ReadTextAreaFieldComponent, ReadTextFieldComponent, ReadYesNoFieldComponent, RefdataCaseFlagType, RemoveDialogComponent, RequestOptionsBuilder, RouterHelperService, 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, UpdateFlagComponent, UpdateFlagErrorMessage, UpdateFlagStep, WaysToPayFieldComponent, WindowService, Wizard, WizardFactoryService, WizardPage, WizardPageField, WorkAllocationService, WorkbasketFiltersComponent, WorkbasketFiltersModule, WorkbasketInput, WorkbasketInputFilterService, WorkbasketInputModel, WriteAddressFieldComponent, WriteCaseFlagFieldComponent, WriteCaseLinkFieldComponent, WriteCollectionFieldComponent, WriteComplexFieldComponent, WriteDateContainerFieldComponent, WriteDateFieldComponent, WriteDocumentFieldComponent, WriteDynamicListFieldComponent, WriteDynamicRadioListFieldComponent, WriteEmailFieldComponent, WriteFixedListFieldComponent, WriteFixedRadioListFieldComponent, WriteJudicialUserFieldComponent, WriteLinkedCasesComponent, WriteMoneyGbpFieldComponent, WriteMultiSelectListFieldComponent, WriteNumberFieldComponent, WriteOrderSummaryFieldComponent, WriteOrganisationComplexFieldComponent, WriteOrganisationFieldComponent, WritePhoneUKFieldComponent, WriteTextAreaFieldComponent, WriteTextFieldComponent, WriteYesNoFieldComponent, YesNoService, aCaseField, createACL, createCaseEventTrigger, createCaseField, createComplexFieldOverride, createFieldType, createFixedListFieldType, createHiddenComplexFieldOverride, createMultiSelectListFieldType, createWizardPage, createWizardPageField, editorRouting, initDialog, newCaseField, textFieldType, viewerRouting };
27202
29629
  //# sourceMappingURL=hmcts-ccd-case-ui-toolkit.js.map