@hmcts/ccd-case-ui-toolkit 6.10.10-linked-cases-other-description → 6.11.0-case-file-view-move-document

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 (46) hide show
  1. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js +194 -317
  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/shared/components/palette/case-file-view/case-file-view-field-read.component.js +31 -18
  6. package/esm2015/lib/shared/components/palette/case-file-view/case-file-view-field.component.js +42 -21
  7. package/esm2015/lib/shared/components/palette/linked-cases/components/check-your-answers/check-your-answers.component.js +9 -31
  8. package/esm2015/lib/shared/components/palette/linked-cases/components/link-cases/link-cases.component.js +77 -152
  9. package/esm2015/lib/shared/components/palette/linked-cases/components/linked-cases-table/linked-cases-from-table.component.js +18 -20
  10. package/esm2015/lib/shared/components/palette/linked-cases/components/linked-cases-table/linked-cases-to-table.component.js +7 -7
  11. package/esm2015/lib/shared/components/palette/linked-cases/domain/linked-cases.model.js +1 -3
  12. package/esm2015/lib/shared/components/palette/linked-cases/enums/write-linked-cases-field.enum.js +1 -3
  13. package/esm2015/lib/shared/components/palette/linked-cases/services/linked-cases.service.js +4 -4
  14. package/esm2015/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.js +2 -6
  15. package/esm2015/lib/shared/components/palette/palette.module.js +2 -3
  16. package/esm2015/lib/shared/pipes/index.js +1 -2
  17. package/esm2015/lib/shared/pipes/link-cases-reason-code/ccd-link-cases-reason-code.pipe.js +5 -10
  18. package/esm2015/lib/shared/pipes/pipes.module.js +4 -8
  19. package/fesm2015/hmcts-ccd-case-ui-toolkit.js +191 -296
  20. package/fesm2015/hmcts-ccd-case-ui-toolkit.js.map +1 -1
  21. package/lib/shared/components/palette/case-file-view/case-file-view-field.component.d.ts +1 -0
  22. package/lib/shared/components/palette/case-file-view/case-file-view-field.component.d.ts.map +1 -1
  23. package/lib/shared/components/palette/linked-cases/components/link-cases/link-cases.component.d.ts +0 -4
  24. package/lib/shared/components/palette/linked-cases/components/link-cases/link-cases.component.d.ts.map +1 -1
  25. package/lib/shared/components/palette/linked-cases/components/linked-cases-table/linked-cases-from-table.component.d.ts.map +1 -1
  26. package/lib/shared/components/palette/linked-cases/components/linked-cases-table/linked-cases-to-table.component.d.ts.map +1 -1
  27. package/lib/shared/components/palette/linked-cases/domain/linked-cases.model.d.ts +3 -6
  28. package/lib/shared/components/palette/linked-cases/domain/linked-cases.model.d.ts.map +1 -1
  29. package/lib/shared/components/palette/linked-cases/enums/write-linked-cases-field.enum.d.ts +1 -3
  30. package/lib/shared/components/palette/linked-cases/enums/write-linked-cases-field.enum.d.ts.map +1 -1
  31. package/lib/shared/components/palette/linked-cases/services/linked-cases.service.d.ts.map +1 -1
  32. package/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.d.ts.map +1 -1
  33. package/lib/shared/components/palette/palette.module.d.ts.map +1 -1
  34. package/lib/shared/pipes/index.d.ts +0 -1
  35. package/lib/shared/pipes/index.d.ts.map +1 -1
  36. package/lib/shared/pipes/link-cases-reason-code/ccd-link-cases-reason-code.pipe.d.ts +1 -2
  37. package/lib/shared/pipes/link-cases-reason-code/ccd-link-cases-reason-code.pipe.d.ts.map +1 -1
  38. package/lib/shared/pipes/pipes.module.d.ts +2 -3
  39. package/lib/shared/pipes/pipes.module.d.ts.map +1 -1
  40. package/package.json +1 -1
  41. package/esm2015/lib/shared/pipes/link-cases-from-reason-code/ccd-link-cases-from-reason-code.pipe.js +0 -28
  42. package/esm2015/lib/shared/pipes/link-cases-from-reason-code/index.js +0 -2
  43. package/lib/shared/pipes/link-cases-from-reason-code/ccd-link-cases-from-reason-code.pipe.d.ts +0 -12
  44. package/lib/shared/pipes/link-cases-from-reason-code/ccd-link-cases-from-reason-code.pipe.d.ts.map +0 -1
  45. package/lib/shared/pipes/link-cases-from-reason-code/index.d.ts +0 -2
  46. package/lib/shared/pipes/link-cases-from-reason-code/index.d.ts.map +0 -1
@@ -11144,41 +11144,56 @@
11144
11144
  i0__namespace.ɵɵelementEnd();
11145
11145
  }
11146
11146
  }
11147
- function CaseFileViewFieldComponent_div_1_ng_container_8_Template(rf, ctx) {
11147
+ function CaseFileViewFieldComponent_div_1_div_3_Template(rf, ctx) {
11148
+ if (rf & 1) {
11149
+ i0__namespace.ɵɵelementStart(0, "div");
11150
+ i0__namespace.ɵɵelementStart(1, "h3", 13);
11151
+ i0__namespace.ɵɵtext(2, "Sorry, there is a problem with the service");
11152
+ i0__namespace.ɵɵelementEnd();
11153
+ i0__namespace.ɵɵelementStart(3, "p", 4);
11154
+ i0__namespace.ɵɵtext(4, "Try again later.");
11155
+ i0__namespace.ɵɵelementEnd();
11156
+ i0__namespace.ɵɵelementEnd();
11157
+ }
11158
+ }
11159
+ function CaseFileViewFieldComponent_div_1_ng_container_9_Template(rf, ctx) {
11148
11160
  if (rf & 1) {
11149
11161
  i0__namespace.ɵɵelementContainerStart(0);
11150
- i0__namespace.ɵɵelement(1, "mv-media-viewer", 11);
11162
+ i0__namespace.ɵɵelement(1, "mv-media-viewer", 14);
11151
11163
  i0__namespace.ɵɵelementContainerEnd();
11152
11164
  }
11153
11165
  if (rf & 2) {
11154
- var ctx_r2 = i0__namespace.ɵɵnextContext(2);
11166
+ var ctx_r3 = i0__namespace.ɵɵnextContext(2);
11155
11167
  i0__namespace.ɵɵadvance(1);
11156
- i0__namespace.ɵɵproperty("url", ctx_r2.currentDocument.document_binary_url)("downloadFileName", ctx_r2.currentDocument.document_filename)("showToolbar", true)("contentType", ctx_r2.currentDocument.content_type)("enableAnnotations", true)("enableRedactions", true)("height", "94.5vh");
11168
+ i0__namespace.ɵɵproperty("url", ctx_r3.currentDocument.document_binary_url)("downloadFileName", ctx_r3.currentDocument.document_filename)("showToolbar", true)("contentType", ctx_r3.currentDocument.content_type)("enableAnnotations", true)("enableRedactions", true)("height", "94.5vh");
11157
11169
  }
11158
11170
  }
11159
11171
  function CaseFileViewFieldComponent_div_1_Template(rf, ctx) {
11160
11172
  if (rf & 1) {
11161
- var _r4_1 = i0__namespace.ɵɵgetCurrentView();
11162
- i0__namespace.ɵɵelementStart(0, "div");
11163
- i0__namespace.ɵɵelementStart(1, "h2", 5);
11173
+ var _r5_1 = i0__namespace.ɵɵgetCurrentView();
11174
+ i0__namespace.ɵɵelementStart(0, "div", 5);
11175
+ i0__namespace.ɵɵelementStart(1, "h2", 6);
11164
11176
  i0__namespace.ɵɵtext(2, "Case file");
11165
11177
  i0__namespace.ɵɵelementEnd();
11166
- i0__namespace.ɵɵelementStart(3, "div", 6);
11167
- i0__namespace.ɵɵelementStart(4, "div", 7);
11168
- i0__namespace.ɵɵelementStart(5, "ccd-case-file-view-folder", 8);
11169
- i0__namespace.ɵɵlistener("clickedDocument", function CaseFileViewFieldComponent_div_1_Template_ccd_case_file_view_folder_clickedDocument_5_listener($event) { i0__namespace.ɵɵrestoreView(_r4_1); var ctx_r3 = i0__namespace.ɵɵnextContext(); return ctx_r3.setMediaViewerFile($event); })("moveDocument", function CaseFileViewFieldComponent_div_1_Template_ccd_case_file_view_folder_moveDocument_5_listener($event) { i0__namespace.ɵɵrestoreView(_r4_1); var ctx_r5 = i0__namespace.ɵɵnextContext(); return ctx_r5.moveDocument($event); });
11178
+ i0__namespace.ɵɵtemplate(3, CaseFileViewFieldComponent_div_1_div_3_Template, 5, 0, "div", 7);
11179
+ i0__namespace.ɵɵelementStart(4, "div", 8);
11180
+ i0__namespace.ɵɵelementStart(5, "div", 9);
11181
+ i0__namespace.ɵɵelementStart(6, "ccd-case-file-view-folder", 10);
11182
+ i0__namespace.ɵɵlistener("clickedDocument", function CaseFileViewFieldComponent_div_1_Template_ccd_case_file_view_folder_clickedDocument_6_listener($event) { i0__namespace.ɵɵrestoreView(_r5_1); var ctx_r4 = i0__namespace.ɵɵnextContext(); return ctx_r4.setMediaViewerFile($event); })("moveDocument", function CaseFileViewFieldComponent_div_1_Template_ccd_case_file_view_folder_moveDocument_6_listener($event) { i0__namespace.ɵɵrestoreView(_r5_1); var ctx_r6 = i0__namespace.ɵɵnextContext(); return ctx_r6.moveDocument($event); });
11170
11183
  i0__namespace.ɵɵelementEnd();
11171
11184
  i0__namespace.ɵɵelementEnd();
11172
- i0__namespace.ɵɵelement(6, "div", 9);
11173
- i0__namespace.ɵɵelementStart(7, "div", 10);
11174
- i0__namespace.ɵɵtemplate(8, CaseFileViewFieldComponent_div_1_ng_container_8_Template, 2, 7, "ng-container", 1);
11185
+ i0__namespace.ɵɵelement(7, "div", 11);
11186
+ i0__namespace.ɵɵelementStart(8, "div", 12);
11187
+ i0__namespace.ɵɵtemplate(9, CaseFileViewFieldComponent_div_1_ng_container_9_Template, 2, 7, "ng-container", 7);
11175
11188
  i0__namespace.ɵɵelementEnd();
11176
11189
  i0__namespace.ɵɵelementEnd();
11177
11190
  i0__namespace.ɵɵelementEnd();
11178
11191
  }
11179
11192
  if (rf & 2) {
11180
11193
  var ctx_r1 = i0__namespace.ɵɵnextContext();
11181
- i0__namespace.ɵɵadvance(5);
11194
+ i0__namespace.ɵɵadvance(3);
11195
+ i0__namespace.ɵɵproperty("ngIf", ctx_r1.updateDocumentCategoryError);
11196
+ i0__namespace.ɵɵadvance(3);
11182
11197
  i0__namespace.ɵɵproperty("categoriesAndDocuments", ctx_r1.categoriesAndDocuments$)("allowMoving", ctx_r1.allowMoving);
11183
11198
  i0__namespace.ɵɵadvance(3);
11184
11199
  i0__namespace.ɵɵproperty("ngIf", ctx_r1.currentDocument);
@@ -11193,6 +11208,7 @@
11193
11208
  this.loadingService = loadingService;
11194
11209
  this.allowMoving = true;
11195
11210
  this.getCategoriesAndDocumentsError = false;
11211
+ this.updateDocumentCategoryError = false;
11196
11212
  }
11197
11213
  CaseFileViewFieldComponent.prototype.ngOnInit = function () {
11198
11214
  var _this = this;
@@ -11236,11 +11252,18 @@
11236
11252
  };
11237
11253
  CaseFileViewFieldComponent.prototype.moveDocument = function (data) {
11238
11254
  var _this = this;
11255
+ this.updateDocumentCategoryError = false;
11239
11256
  var cid = this.route.snapshot.paramMap.get(CaseFileViewFieldComponent.PARAM_CASE_ID);
11240
11257
  var loadingToken = this.loadingService.register();
11241
- this.caseFileViewService.updateDocumentCategory(cid, this.caseVersion, data.document.attribute_path, data.newCategory).subscribe(function (_) {
11242
- location.reload();
11243
- _this.loadingService.unregister(loadingToken);
11258
+ this.caseFileViewService.updateDocumentCategory(cid, this.caseVersion, data.document.attribute_path, data.newCategory).subscribe({
11259
+ next: function () {
11260
+ location.reload();
11261
+ _this.loadingService.unregister(loadingToken);
11262
+ },
11263
+ error: function (_) {
11264
+ _this.updateDocumentCategoryError = true;
11265
+ _this.loadingService.unregister(loadingToken);
11266
+ }
11244
11267
  });
11245
11268
  };
11246
11269
  CaseFileViewFieldComponent.prototype.ngOnDestroy = function () {
@@ -11252,10 +11275,10 @@
11252
11275
  }());
11253
11276
  CaseFileViewFieldComponent.PARAM_CASE_ID = 'cid';
11254
11277
  CaseFileViewFieldComponent.ɵfac = function CaseFileViewFieldComponent_Factory(t) { return new (t || CaseFileViewFieldComponent)(i0__namespace.ɵɵdirectiveInject(i0__namespace.ElementRef), i0__namespace.ɵɵdirectiveInject(i1__namespace$1.ActivatedRoute), i0__namespace.ɵɵdirectiveInject(CaseFileViewService), i0__namespace.ɵɵdirectiveInject(DocumentManagementService), i0__namespace.ɵɵdirectiveInject(LoadingService)); };
11255
- CaseFileViewFieldComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: CaseFileViewFieldComponent, selectors: [["ccd-case-file-view-field"]], decls: 2, vars: 2, consts: [["class", "govuk-grid-column-two-thirds", 4, "ngIf"], [4, "ngIf"], [1, "govuk-grid-column-two-thirds"], [1, "govuk-heading-xl"], [1, "govuk-body"], [1, "govuk-heading-l"], ["id", "case-file-view", 1, "govuk-form-group"], [1, "document-tree-container"], [1, "document-tree-container__tree", 3, "categoriesAndDocuments", "allowMoving", "clickedDocument", "moveDocument"], [1, "slider"], [1, "media-viewer-container"], [3, "url", "downloadFileName", "showToolbar", "contentType", "enableAnnotations", "enableRedactions", "height"]], template: function CaseFileViewFieldComponent_Template(rf, ctx) {
11278
+ CaseFileViewFieldComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: CaseFileViewFieldComponent, selectors: [["ccd-case-file-view-field"]], decls: 2, vars: 2, consts: [["class", "govuk-grid-column-two-thirds", 4, "ngIf"], ["class", "govuk-!-margin-top-2", 4, "ngIf"], [1, "govuk-grid-column-two-thirds"], [1, "govuk-heading-xl"], [1, "govuk-body"], [1, "govuk-!-margin-top-2"], [1, "govuk-heading-l"], [4, "ngIf"], ["id", "case-file-view", 1, "govuk-form-group"], [1, "document-tree-container"], [1, "document-tree-container__tree", 3, "categoriesAndDocuments", "allowMoving", "clickedDocument", "moveDocument"], [1, "slider"], [1, "media-viewer-container"], [1, "govuk-heading-m"], [3, "url", "downloadFileName", "showToolbar", "contentType", "enableAnnotations", "enableRedactions", "height"]], template: function CaseFileViewFieldComponent_Template(rf, ctx) {
11256
11279
  if (rf & 1) {
11257
11280
  i0__namespace.ɵɵtemplate(0, CaseFileViewFieldComponent_div_0_Template, 5, 0, "div", 0);
11258
- i0__namespace.ɵɵtemplate(1, CaseFileViewFieldComponent_div_1_Template, 9, 3, "div", 1);
11281
+ i0__namespace.ɵɵtemplate(1, CaseFileViewFieldComponent_div_1_Template, 10, 4, "div", 1);
11259
11282
  }
11260
11283
  if (rf & 2) {
11261
11284
  i0__namespace.ɵɵproperty("ngIf", ctx.getCategoriesAndDocumentsError);
@@ -11286,41 +11309,56 @@
11286
11309
  i0__namespace.ɵɵelementEnd();
11287
11310
  }
11288
11311
  }
11289
- function CaseFileViewFieldReadComponent_div_1_ng_container_8_Template(rf, ctx) {
11312
+ function CaseFileViewFieldReadComponent_div_1_div_3_Template(rf, ctx) {
11313
+ if (rf & 1) {
11314
+ i0__namespace.ɵɵelementStart(0, "div");
11315
+ i0__namespace.ɵɵelementStart(1, "h3", 13);
11316
+ i0__namespace.ɵɵtext(2, "Sorry, there is a problem with the service");
11317
+ i0__namespace.ɵɵelementEnd();
11318
+ i0__namespace.ɵɵelementStart(3, "p", 4);
11319
+ i0__namespace.ɵɵtext(4, "Try again later.");
11320
+ i0__namespace.ɵɵelementEnd();
11321
+ i0__namespace.ɵɵelementEnd();
11322
+ }
11323
+ }
11324
+ function CaseFileViewFieldReadComponent_div_1_ng_container_9_Template(rf, ctx) {
11290
11325
  if (rf & 1) {
11291
11326
  i0__namespace.ɵɵelementContainerStart(0);
11292
- i0__namespace.ɵɵelement(1, "mv-media-viewer", 11);
11327
+ i0__namespace.ɵɵelement(1, "mv-media-viewer", 14);
11293
11328
  i0__namespace.ɵɵelementContainerEnd();
11294
11329
  }
11295
11330
  if (rf & 2) {
11296
- var ctx_r2 = i0__namespace.ɵɵnextContext(2);
11331
+ var ctx_r3 = i0__namespace.ɵɵnextContext(2);
11297
11332
  i0__namespace.ɵɵadvance(1);
11298
- i0__namespace.ɵɵproperty("url", ctx_r2.currentDocument.document_binary_url)("downloadFileName", ctx_r2.currentDocument.document_filename)("showToolbar", true)("contentType", ctx_r2.currentDocument.content_type)("enableAnnotations", true)("enableRedactions", true)("height", "94.5vh");
11333
+ i0__namespace.ɵɵproperty("url", ctx_r3.currentDocument.document_binary_url)("downloadFileName", ctx_r3.currentDocument.document_filename)("showToolbar", true)("contentType", ctx_r3.currentDocument.content_type)("enableAnnotations", true)("enableRedactions", true)("height", "94.5vh");
11299
11334
  }
11300
11335
  }
11301
11336
  function CaseFileViewFieldReadComponent_div_1_Template(rf, ctx) {
11302
11337
  if (rf & 1) {
11303
- var _r4_1 = i0__namespace.ɵɵgetCurrentView();
11304
- i0__namespace.ɵɵelementStart(0, "div");
11305
- i0__namespace.ɵɵelementStart(1, "h2", 5);
11338
+ var _r5_1 = i0__namespace.ɵɵgetCurrentView();
11339
+ i0__namespace.ɵɵelementStart(0, "div", 5);
11340
+ i0__namespace.ɵɵelementStart(1, "h2", 6);
11306
11341
  i0__namespace.ɵɵtext(2, "Case file");
11307
11342
  i0__namespace.ɵɵelementEnd();
11308
- i0__namespace.ɵɵelementStart(3, "div", 6);
11309
- i0__namespace.ɵɵelementStart(4, "div", 7);
11310
- i0__namespace.ɵɵelementStart(5, "ccd-case-file-view-folder", 8);
11311
- i0__namespace.ɵɵlistener("clickedDocument", function CaseFileViewFieldReadComponent_div_1_Template_ccd_case_file_view_folder_clickedDocument_5_listener($event) { i0__namespace.ɵɵrestoreView(_r4_1); var ctx_r3 = i0__namespace.ɵɵnextContext(); return ctx_r3.setMediaViewerFile($event); })("moveDocument", function CaseFileViewFieldReadComponent_div_1_Template_ccd_case_file_view_folder_moveDocument_5_listener($event) { i0__namespace.ɵɵrestoreView(_r4_1); var ctx_r5 = i0__namespace.ɵɵnextContext(); return ctx_r5.moveDocument($event); });
11343
+ i0__namespace.ɵɵtemplate(3, CaseFileViewFieldReadComponent_div_1_div_3_Template, 5, 0, "div", 7);
11344
+ i0__namespace.ɵɵelementStart(4, "div", 8);
11345
+ i0__namespace.ɵɵelementStart(5, "div", 9);
11346
+ i0__namespace.ɵɵelementStart(6, "ccd-case-file-view-folder", 10);
11347
+ i0__namespace.ɵɵlistener("clickedDocument", function CaseFileViewFieldReadComponent_div_1_Template_ccd_case_file_view_folder_clickedDocument_6_listener($event) { i0__namespace.ɵɵrestoreView(_r5_1); var ctx_r4 = i0__namespace.ɵɵnextContext(); return ctx_r4.setMediaViewerFile($event); })("moveDocument", function CaseFileViewFieldReadComponent_div_1_Template_ccd_case_file_view_folder_moveDocument_6_listener($event) { i0__namespace.ɵɵrestoreView(_r5_1); var ctx_r6 = i0__namespace.ɵɵnextContext(); return ctx_r6.moveDocument($event); });
11312
11348
  i0__namespace.ɵɵelementEnd();
11313
11349
  i0__namespace.ɵɵelementEnd();
11314
- i0__namespace.ɵɵelement(6, "div", 9);
11315
- i0__namespace.ɵɵelementStart(7, "div", 10);
11316
- i0__namespace.ɵɵtemplate(8, CaseFileViewFieldReadComponent_div_1_ng_container_8_Template, 2, 7, "ng-container", 1);
11350
+ i0__namespace.ɵɵelement(7, "div", 11);
11351
+ i0__namespace.ɵɵelementStart(8, "div", 12);
11352
+ i0__namespace.ɵɵtemplate(9, CaseFileViewFieldReadComponent_div_1_ng_container_9_Template, 2, 7, "ng-container", 7);
11317
11353
  i0__namespace.ɵɵelementEnd();
11318
11354
  i0__namespace.ɵɵelementEnd();
11319
11355
  i0__namespace.ɵɵelementEnd();
11320
11356
  }
11321
11357
  if (rf & 2) {
11322
11358
  var ctx_r1 = i0__namespace.ɵɵnextContext();
11323
- i0__namespace.ɵɵadvance(5);
11359
+ i0__namespace.ɵɵadvance(3);
11360
+ i0__namespace.ɵɵproperty("ngIf", ctx_r1.updateDocumentCategoryError);
11361
+ i0__namespace.ɵɵadvance(3);
11324
11362
  i0__namespace.ɵɵproperty("categoriesAndDocuments", ctx_r1.categoriesAndDocuments$)("allowMoving", ctx_r1.allowMoving);
11325
11363
  i0__namespace.ɵɵadvance(3);
11326
11364
  i0__namespace.ɵɵproperty("ngIf", ctx_r1.currentDocument);
@@ -11336,10 +11374,10 @@
11336
11374
  return CaseFileViewFieldReadComponent;
11337
11375
  }(CaseFileViewFieldComponent));
11338
11376
  CaseFileViewFieldReadComponent.ɵfac = function CaseFileViewFieldReadComponent_Factory(t) { return ɵCaseFileViewFieldReadComponent_BaseFactory(t || CaseFileViewFieldReadComponent); };
11339
- CaseFileViewFieldReadComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: CaseFileViewFieldReadComponent, selectors: [["ccd-case-file-view-field"]], features: [i0__namespace.ɵɵInheritDefinitionFeature], decls: 2, vars: 2, consts: [["class", "govuk-grid-column-two-thirds", 4, "ngIf"], [4, "ngIf"], [1, "govuk-grid-column-two-thirds"], [1, "govuk-heading-xl"], [1, "govuk-body"], [1, "govuk-heading-l"], ["id", "case-file-view", 1, "govuk-form-group"], [1, "document-tree-container"], [1, "document-tree-container__tree", 3, "categoriesAndDocuments", "allowMoving", "clickedDocument", "moveDocument"], [1, "slider"], [1, "media-viewer-container"], [3, "url", "downloadFileName", "showToolbar", "contentType", "enableAnnotations", "enableRedactions", "height"]], template: function CaseFileViewFieldReadComponent_Template(rf, ctx) {
11377
+ CaseFileViewFieldReadComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: CaseFileViewFieldReadComponent, selectors: [["ccd-case-file-view-field"]], features: [i0__namespace.ɵɵInheritDefinitionFeature], decls: 2, vars: 2, consts: [["class", "govuk-grid-column-two-thirds", 4, "ngIf"], ["class", "govuk-!-margin-top-2", 4, "ngIf"], [1, "govuk-grid-column-two-thirds"], [1, "govuk-heading-xl"], [1, "govuk-body"], [1, "govuk-!-margin-top-2"], [1, "govuk-heading-l"], [4, "ngIf"], ["id", "case-file-view", 1, "govuk-form-group"], [1, "document-tree-container"], [1, "document-tree-container__tree", 3, "categoriesAndDocuments", "allowMoving", "clickedDocument", "moveDocument"], [1, "slider"], [1, "media-viewer-container"], [1, "govuk-heading-m"], [3, "url", "downloadFileName", "showToolbar", "contentType", "enableAnnotations", "enableRedactions", "height"]], template: function CaseFileViewFieldReadComponent_Template(rf, ctx) {
11340
11378
  if (rf & 1) {
11341
11379
  i0__namespace.ɵɵtemplate(0, CaseFileViewFieldReadComponent_div_0_Template, 5, 0, "div", 0);
11342
- i0__namespace.ɵɵtemplate(1, CaseFileViewFieldReadComponent_div_1_Template, 9, 3, "div", 1);
11380
+ i0__namespace.ɵɵtemplate(1, CaseFileViewFieldReadComponent_div_1_Template, 10, 4, "div", 1);
11343
11381
  }
11344
11382
  if (rf & 2) {
11345
11383
  i0__namespace.ɵɵproperty("ngIf", ctx.getCategoriesAndDocumentsError);
@@ -15166,8 +15204,6 @@
15166
15204
  LinkedCasesErrorMessages["LinkCasesNavigationError"] = "Please select Next to link case(s)";
15167
15205
  LinkedCasesErrorMessages["UnlinkCasesNavigationError"] = "Please select Next to unlink case(s)";
15168
15206
  LinkedCasesErrorMessages["BackNavigationError"] = "Please select Back to go to the previous page";
15169
- LinkedCasesErrorMessages["otherDescriptionError"] = "Provide a description of the reason";
15170
- LinkedCasesErrorMessages["otherDescriptionMaxLengthError"] = "Description provided must be 100 characters or fewer";
15171
15207
  })(exports.LinkedCasesErrorMessages || (exports.LinkedCasesErrorMessages = {}));
15172
15208
  exports.LinkedCasesEventTriggers = void 0;
15173
15209
  (function (LinkedCasesEventTriggers) {
@@ -15218,7 +15254,6 @@
15218
15254
  };
15219
15255
  };
15220
15256
  LinkedCasesService.prototype.mapResponse = function (esSearchCasesResponse) {
15221
- var _a;
15222
15257
  var caseInfo = this.caseFieldValue.find(function (item) { return item.value && item.value.CaseReference === esSearchCasesResponse.case_id; });
15223
15258
  return caseInfo && {
15224
15259
  caseReference: esSearchCasesResponse.case_id,
@@ -15226,7 +15261,8 @@
15226
15261
  caseType: this.mapLookupIDToValueFromJurisdictions('CASE_TYPE', esSearchCasesResponse.case_fields['[CASE_TYPE]']),
15227
15262
  service: this.mapLookupIDToValueFromJurisdictions('JURISDICTION', esSearchCasesResponse.case_fields['[JURISDICTION]']),
15228
15263
  state: this.mapLookupIDToValueFromJurisdictions('STATE', esSearchCasesResponse.case_fields['[STATE]']),
15229
- reasons: (_a = caseInfo === null || caseInfo === void 0 ? void 0 : caseInfo.value) === null || _a === void 0 ? void 0 : _a.ReasonForLink
15264
+ reasons: caseInfo.value && caseInfo.value.ReasonForLink &&
15265
+ caseInfo.value.ReasonForLink.map(function (reason) { return reason.value && reason.value.Reason; }),
15230
15266
  };
15231
15267
  };
15232
15268
  LinkedCasesService.prototype.searchCasesByCaseIds = function (searchCasesResponse) {
@@ -15258,7 +15294,7 @@
15258
15294
  unlink: false,
15259
15295
  reasons: item.reasons && item.reasons.map(function (reason) {
15260
15296
  return {
15261
- Reason: reason
15297
+ reasonCode: reason
15262
15298
  };
15263
15299
  }),
15264
15300
  };
@@ -15519,32 +15555,6 @@
15519
15555
  i0__namespace.ɵɵelement(0, "th", 8);
15520
15556
  }
15521
15557
  }
15522
- function CheckYourAnswersComponent_tr_17_span_8_span_1_Template(rf, ctx) {
15523
- if (rf & 1) {
15524
- i0__namespace.ɵɵelementStart(0, "span");
15525
- i0__namespace.ɵɵtext(1);
15526
- i0__namespace.ɵɵpipe(2, "ccdLinkCasesReasonValue");
15527
- i0__namespace.ɵɵelementEnd();
15528
- }
15529
- if (rf & 2) {
15530
- var reason_r12 = i0__namespace.ɵɵnextContext().$implicit;
15531
- i0__namespace.ɵɵadvance(1);
15532
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(2, 1, reason_r12), " ");
15533
- }
15534
- }
15535
- function CheckYourAnswersComponent_tr_17_span_8_span_2_Template(rf, ctx) {
15536
- if (rf & 1) {
15537
- i0__namespace.ɵɵelementStart(0, "span");
15538
- i0__namespace.ɵɵtext(1);
15539
- i0__namespace.ɵɵpipe(2, "ccdLinkCasesReasonValue");
15540
- i0__namespace.ɵɵelementEnd();
15541
- }
15542
- if (rf & 2) {
15543
- var reason_r12 = i0__namespace.ɵɵnextContext().$implicit;
15544
- i0__namespace.ɵɵadvance(1);
15545
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(2, 1, reason_r12.Reason.value), " ");
15546
- }
15547
- }
15548
15558
  function CheckYourAnswersComponent_tr_17_span_8_br_3_Template(rf, ctx) {
15549
15559
  if (rf & 1) {
15550
15560
  i0__namespace.ɵɵelement(0, "br");
@@ -15553,28 +15563,26 @@
15553
15563
  function CheckYourAnswersComponent_tr_17_span_8_Template(rf, ctx) {
15554
15564
  if (rf & 1) {
15555
15565
  i0__namespace.ɵɵelementStart(0, "span");
15556
- i0__namespace.ɵɵtemplate(1, CheckYourAnswersComponent_tr_17_span_8_span_1_Template, 3, 3, "span", 19);
15557
- i0__namespace.ɵɵtemplate(2, CheckYourAnswersComponent_tr_17_span_8_span_2_Template, 3, 3, "span", 19);
15566
+ i0__namespace.ɵɵtext(1);
15567
+ i0__namespace.ɵɵpipe(2, "ccdLinkCasesReasonValue");
15558
15568
  i0__namespace.ɵɵtemplate(3, CheckYourAnswersComponent_tr_17_span_8_br_3_Template, 1, 0, "br", 19);
15559
15569
  i0__namespace.ɵɵelementEnd();
15560
15570
  }
15561
15571
  if (rf & 2) {
15572
+ var reason_r12 = ctx.$implicit;
15562
15573
  var isLast_r13 = ctx.last;
15563
- var ctx_r10 = i0__namespace.ɵɵnextContext(2);
15564
- i0__namespace.ɵɵadvance(1);
15565
- i0__namespace.ɵɵproperty("ngIf", ctx_r10.isLinkCasesJourney);
15566
- i0__namespace.ɵɵadvance(1);
15567
- i0__namespace.ɵɵproperty("ngIf", !ctx_r10.isLinkCasesJourney);
15568
15574
  i0__namespace.ɵɵadvance(1);
15575
+ i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(2, 2, reason_r12.reasonCode), "");
15576
+ i0__namespace.ɵɵadvance(2);
15569
15577
  i0__namespace.ɵɵproperty("ngIf", !isLast_r13);
15570
15578
  }
15571
15579
  }
15572
15580
  function CheckYourAnswersComponent_tr_17_td_10_Template(rf, ctx) {
15573
15581
  if (rf & 1) {
15574
- var _r20_1 = i0__namespace.ɵɵgetCurrentView();
15582
+ var _r16_1 = i0__namespace.ɵɵgetCurrentView();
15575
15583
  i0__namespace.ɵɵelementStart(0, "td", 14);
15576
15584
  i0__namespace.ɵɵelementStart(1, "a", 15);
15577
- i0__namespace.ɵɵlistener("click", function CheckYourAnswersComponent_tr_17_td_10_Template_a_click_1_listener() { i0__namespace.ɵɵrestoreView(_r20_1); var ctx_r19 = i0__namespace.ɵɵnextContext(2); return ctx_r19.onChange(); });
15585
+ i0__namespace.ɵɵlistener("click", function CheckYourAnswersComponent_tr_17_td_10_Template_a_click_1_listener() { i0__namespace.ɵɵrestoreView(_r16_1); var ctx_r15 = i0__namespace.ɵɵnextContext(2); return ctx_r15.onChange(); });
15578
15586
  i0__namespace.ɵɵtext(2, "Change");
15579
15587
  i0__namespace.ɵɵelementEnd();
15580
15588
  i0__namespace.ɵɵelementEnd();
@@ -15592,7 +15600,7 @@
15592
15600
  i0__namespace.ɵɵelementEnd();
15593
15601
  i0__namespace.ɵɵelementEnd();
15594
15602
  i0__namespace.ɵɵelementStart(7, "td", 14);
15595
- i0__namespace.ɵɵtemplate(8, CheckYourAnswersComponent_tr_17_span_8_Template, 4, 3, "span", 17);
15603
+ i0__namespace.ɵɵtemplate(8, CheckYourAnswersComponent_tr_17_span_8_Template, 4, 4, "span", 17);
15596
15604
  i0__namespace.ɵɵelementEnd();
15597
15605
  i0__namespace.ɵɵelement(9, "td", 14);
15598
15606
  i0__namespace.ɵɵtemplate(10, CheckYourAnswersComponent_tr_17_td_10_Template, 3, 0, "td", 18);
@@ -15732,8 +15740,8 @@
15732
15740
 
15733
15741
  function LinkCasesComponent_div_8_span_4_Template(rf, ctx) {
15734
15742
  if (rf & 1) {
15735
- i0__namespace.ɵɵelementStart(0, "span", 30);
15736
- i0__namespace.ɵɵelementStart(1, "span", 31);
15743
+ i0__namespace.ɵɵelementStart(0, "span", 28);
15744
+ i0__namespace.ɵɵelementStart(1, "span", 29);
15737
15745
  i0__namespace.ɵɵtext(2, "Error:");
15738
15746
  i0__namespace.ɵɵelementEnd();
15739
15747
  i0__namespace.ɵɵtext(3);
@@ -15745,10 +15753,10 @@
15745
15753
  i0__namespace.ɵɵtextInterpolate1(" ", ctx_r4.caseNumberError, " ");
15746
15754
  }
15747
15755
  }
15748
- function LinkCasesComponent_div_8_span_11_Template(rf, ctx) {
15756
+ function LinkCasesComponent_div_8_span_10_Template(rf, ctx) {
15749
15757
  if (rf & 1) {
15750
- i0__namespace.ɵɵelementStart(0, "span", 30);
15751
- i0__namespace.ɵɵelementStart(1, "span", 31);
15758
+ i0__namespace.ɵɵelementStart(0, "span", 28);
15759
+ i0__namespace.ɵɵelementStart(1, "span", 29);
15752
15760
  i0__namespace.ɵɵtext(2, "Error:");
15753
15761
  i0__namespace.ɵɵelementEnd();
15754
15762
  i0__namespace.ɵɵtext(3);
@@ -15760,140 +15768,95 @@
15760
15768
  i0__namespace.ɵɵtextInterpolate1(" ", ctx_r5.caseReasonError, " ");
15761
15769
  }
15762
15770
  }
15763
- function LinkCasesComponent_div_8_div_13_Template(rf, ctx) {
15771
+ function LinkCasesComponent_div_8_div_12_Template(rf, ctx) {
15764
15772
  if (rf & 1) {
15765
- var _r12_1 = i0__namespace.ɵɵgetCurrentView();
15766
- i0__namespace.ɵɵelementStart(0, "div", 32);
15767
- i0__namespace.ɵɵelementStart(1, "input", 33);
15768
- i0__namespace.ɵɵlistener("change", function LinkCasesComponent_div_8_div_13_Template_input_change_1_listener($event) { i0__namespace.ɵɵrestoreView(_r12_1); var ctx_r11 = i0__namespace.ɵɵnextContext(2); return ctx_r11.toggleLinkCaseReasonOtherComments($event); });
15769
- i0__namespace.ɵɵelementEnd();
15770
- i0__namespace.ɵɵelementStart(2, "label", 34);
15773
+ i0__namespace.ɵɵelementStart(0, "div", 30);
15774
+ i0__namespace.ɵɵelement(1, "input", 31);
15775
+ i0__namespace.ɵɵelementStart(2, "label", 32);
15771
15776
  i0__namespace.ɵɵtext(3);
15772
15777
  i0__namespace.ɵɵelementEnd();
15773
15778
  i0__namespace.ɵɵelementEnd();
15774
15779
  }
15775
15780
  if (rf & 2) {
15776
- var reason_r9 = ctx.$implicit;
15777
- var pos_r10 = ctx.index;
15778
- i0__namespace.ɵɵproperty("formGroupName", pos_r10);
15781
+ var reason_r8 = ctx.$implicit;
15782
+ var pos_r9 = ctx.index;
15783
+ i0__namespace.ɵɵproperty("formGroupName", pos_r9);
15779
15784
  i0__namespace.ɵɵadvance(1);
15780
- i0__namespace.ɵɵpropertyInterpolate("id", reason_r9.key);
15781
- i0__namespace.ɵɵproperty("value", reason_r9.value_en);
15785
+ i0__namespace.ɵɵpropertyInterpolate("id", reason_r8.key);
15786
+ i0__namespace.ɵɵproperty("value", reason_r8.value_en);
15782
15787
  i0__namespace.ɵɵadvance(1);
15783
- i0__namespace.ɵɵpropertyInterpolate("for", reason_r9.key);
15788
+ i0__namespace.ɵɵpropertyInterpolate("for", reason_r8.key);
15784
15789
  i0__namespace.ɵɵadvance(1);
15785
- i0__namespace.ɵɵtextInterpolate(reason_r9.value_en);
15790
+ i0__namespace.ɵɵtextInterpolate(reason_r8.value_en);
15786
15791
  }
15787
15792
  }
15788
- function LinkCasesComponent_div_8_div_14_span_3_Template(rf, ctx) {
15793
+ function LinkCasesComponent_div_8_span_15_Template(rf, ctx) {
15789
15794
  if (rf & 1) {
15790
- i0__namespace.ɵɵelementStart(0, "span", 30);
15791
- i0__namespace.ɵɵelementStart(1, "span", 31);
15795
+ i0__namespace.ɵɵelementStart(0, "span", 28);
15796
+ i0__namespace.ɵɵelementStart(1, "span", 29);
15792
15797
  i0__namespace.ɵɵtext(2, "Error:");
15793
15798
  i0__namespace.ɵɵelementEnd();
15794
15799
  i0__namespace.ɵɵtext(3);
15795
15800
  i0__namespace.ɵɵelementEnd();
15796
15801
  }
15797
- if (rf & 2) {
15798
- var ctx_r13 = i0__namespace.ɵɵnextContext(3);
15799
- i0__namespace.ɵɵadvance(3);
15800
- i0__namespace.ɵɵtextInterpolate1(" ", ctx_r13.caseReasonCommentsError, " ");
15801
- }
15802
- }
15803
- var _c0$F = function (a0) { return { "govuk-form-group--error": a0 }; };
15804
- function LinkCasesComponent_div_8_div_14_Template(rf, ctx) {
15805
- if (rf & 1) {
15806
- i0__namespace.ɵɵelementStart(0, "div", 35);
15807
- i0__namespace.ɵɵelementStart(1, "h3", 22);
15808
- i0__namespace.ɵɵtext(2, "Comments");
15809
- i0__namespace.ɵɵelementEnd();
15810
- i0__namespace.ɵɵtemplate(3, LinkCasesComponent_div_8_div_14_span_3_Template, 4, 1, "span", 6);
15811
- i0__namespace.ɵɵelementStart(4, "textarea", 36);
15812
- i0__namespace.ɵɵtext(5, " ");
15813
- i0__namespace.ɵɵelementEnd();
15814
- i0__namespace.ɵɵelementStart(6, "div", 37);
15815
- i0__namespace.ɵɵtext(7, " You can enter up to 100 characters ");
15816
- i0__namespace.ɵɵelementEnd();
15817
- i0__namespace.ɵɵelementEnd();
15818
- }
15819
15802
  if (rf & 2) {
15820
15803
  var ctx_r7 = i0__namespace.ɵɵnextContext(2);
15821
- i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(2, _c0$F, !!ctx_r7.caseReasonCommentsError));
15822
- i0__namespace.ɵɵadvance(3);
15823
- i0__namespace.ɵɵproperty("ngIf", ctx_r7.caseReasonCommentsError);
15824
- }
15825
- }
15826
- function LinkCasesComponent_div_8_span_17_Template(rf, ctx) {
15827
- if (rf & 1) {
15828
- i0__namespace.ɵɵelementStart(0, "span", 30);
15829
- i0__namespace.ɵɵelementStart(1, "span", 31);
15830
- i0__namespace.ɵɵtext(2, "Error:");
15831
- i0__namespace.ɵɵelementEnd();
15832
- i0__namespace.ɵɵtext(3);
15833
- i0__namespace.ɵɵelementEnd();
15834
- }
15835
- if (rf & 2) {
15836
- var ctx_r8 = i0__namespace.ɵɵnextContext(2);
15837
15804
  i0__namespace.ɵɵadvance(3);
15838
- i0__namespace.ɵɵtextInterpolate1(" ", ctx_r8.caseSelectionError, " ");
15805
+ i0__namespace.ɵɵtextInterpolate1(" ", ctx_r7.caseSelectionError, " ");
15839
15806
  }
15840
15807
  }
15808
+ var _c0$F = function (a0) { return { "govuk-form-group--error": a0 }; };
15841
15809
  function LinkCasesComponent_div_8_Template(rf, ctx) {
15842
15810
  if (rf & 1) {
15843
- var _r15_1 = i0__namespace.ɵɵgetCurrentView();
15811
+ var _r11_1 = i0__namespace.ɵɵgetCurrentView();
15844
15812
  i0__namespace.ɵɵelementStart(0, "div", 21);
15845
- i0__namespace.ɵɵelementStart(1, "div", 5);
15846
- i0__namespace.ɵɵelementStart(2, "h3", 22);
15847
- i0__namespace.ɵɵtext(3, "Enter case reference");
15813
+ i0__namespace.ɵɵelementStart(1, "h3", 22);
15814
+ i0__namespace.ɵɵtext(2, "Enter case reference");
15848
15815
  i0__namespace.ɵɵelementEnd();
15816
+ i0__namespace.ɵɵelementStart(3, "div", 5);
15849
15817
  i0__namespace.ɵɵtemplate(4, LinkCasesComponent_div_8_span_4_Template, 4, 1, "span", 6);
15850
15818
  i0__namespace.ɵɵelement(5, "input", 23);
15851
15819
  i0__namespace.ɵɵelementEnd();
15852
- i0__namespace.ɵɵelementStart(6, "div", 24);
15853
- i0__namespace.ɵɵelementStart(7, "h3", 22);
15854
- i0__namespace.ɵɵtext(8, "Why should these cases be linked?");
15820
+ i0__namespace.ɵɵelementStart(6, "h3", 22);
15821
+ i0__namespace.ɵɵtext(7, "Why should these cases be linked?");
15855
15822
  i0__namespace.ɵɵelementEnd();
15856
- i0__namespace.ɵɵelementStart(9, "div", 25);
15857
- i0__namespace.ɵɵtext(10, " Select all that apply. ");
15823
+ i0__namespace.ɵɵelementStart(8, "div", 24);
15824
+ i0__namespace.ɵɵtext(9, " Select all that apply. ");
15858
15825
  i0__namespace.ɵɵelementEnd();
15859
- i0__namespace.ɵɵtemplate(11, LinkCasesComponent_div_8_span_11_Template, 4, 1, "span", 6);
15860
- i0__namespace.ɵɵelementStart(12, "div", 26);
15861
- i0__namespace.ɵɵtemplate(13, LinkCasesComponent_div_8_div_13_Template, 4, 5, "div", 27);
15826
+ i0__namespace.ɵɵtemplate(10, LinkCasesComponent_div_8_span_10_Template, 4, 1, "span", 6);
15827
+ i0__namespace.ɵɵelementStart(11, "div", 25);
15828
+ i0__namespace.ɵɵtemplate(12, LinkCasesComponent_div_8_div_12_Template, 4, 5, "div", 26);
15862
15829
  i0__namespace.ɵɵelementEnd();
15863
- i0__namespace.ɵɵelementEnd();
15864
- i0__namespace.ɵɵtemplate(14, LinkCasesComponent_div_8_div_14_Template, 8, 4, "div", 28);
15865
- i0__namespace.ɵɵelement(15, "br");
15866
- i0__namespace.ɵɵelement(16, "br");
15867
- i0__namespace.ɵɵtemplate(17, LinkCasesComponent_div_8_span_17_Template, 4, 1, "span", 6);
15868
- i0__namespace.ɵɵelementStart(18, "button", 29);
15869
- i0__namespace.ɵɵlistener("click", function LinkCasesComponent_div_8_Template_button_click_18_listener() { i0__namespace.ɵɵrestoreView(_r15_1); var ctx_r14 = i0__namespace.ɵɵnextContext(); return ctx_r14.submitCaseInfo(); });
15870
- i0__namespace.ɵɵtext(19, "Propose case link");
15830
+ i0__namespace.ɵɵelement(13, "br");
15831
+ i0__namespace.ɵɵelement(14, "br");
15832
+ i0__namespace.ɵɵtemplate(15, LinkCasesComponent_div_8_span_15_Template, 4, 1, "span", 6);
15833
+ i0__namespace.ɵɵelementStart(16, "button", 27);
15834
+ i0__namespace.ɵɵlistener("click", function LinkCasesComponent_div_8_Template_button_click_16_listener() { i0__namespace.ɵɵrestoreView(_r11_1); var ctx_r10 = i0__namespace.ɵɵnextContext(); return ctx_r10.submitCaseInfo(); });
15835
+ i0__namespace.ɵɵtext(17, "Propose case link");
15871
15836
  i0__namespace.ɵɵelementEnd();
15872
15837
  i0__namespace.ɵɵelementEnd();
15873
15838
  }
15874
15839
  if (rf & 2) {
15875
15840
  var ctx_r0 = i0__namespace.ɵɵnextContext();
15876
15841
  i0__namespace.ɵɵproperty("formGroup", ctx_r0.linkCaseForm);
15877
- i0__namespace.ɵɵadvance(1);
15878
- i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(8, _c0$F, !!ctx_r0.caseNumberError));
15879
15842
  i0__namespace.ɵɵadvance(3);
15843
+ i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(7, _c0$F, !!ctx_r0.caseNumberError));
15844
+ i0__namespace.ɵɵadvance(1);
15880
15845
  i0__namespace.ɵɵproperty("ngIf", ctx_r0.caseNumberError);
15881
- i0__namespace.ɵɵadvance(2);
15882
- i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(10, _c0$F, !!ctx_r0.caseReasonError));
15883
- i0__namespace.ɵɵadvance(5);
15846
+ i0__namespace.ɵɵadvance(6);
15884
15847
  i0__namespace.ɵɵproperty("ngIf", ctx_r0.caseReasonError);
15885
- i0__namespace.ɵɵadvance(2);
15886
- i0__namespace.ɵɵproperty("ngForOf", ctx_r0.linkCaseReasons);
15887
15848
  i0__namespace.ɵɵadvance(1);
15888
- i0__namespace.ɵɵproperty("ngIf", ctx_r0.showComments);
15849
+ i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(9, _c0$F, !!ctx_r0.caseReasonError));
15850
+ i0__namespace.ɵɵadvance(1);
15851
+ i0__namespace.ɵɵproperty("ngForOf", ctx_r0.linkCaseReasons);
15889
15852
  i0__namespace.ɵɵadvance(3);
15890
15853
  i0__namespace.ɵɵproperty("ngIf", ctx_r0.caseSelectionError);
15891
15854
  }
15892
15855
  }
15893
15856
  function LinkCasesComponent_span_13_Template(rf, ctx) {
15894
15857
  if (rf & 1) {
15895
- i0__namespace.ɵɵelementStart(0, "span", 30);
15896
- i0__namespace.ɵɵelementStart(1, "span", 31);
15858
+ i0__namespace.ɵɵelementStart(0, "span", 28);
15859
+ i0__namespace.ɵɵelementStart(1, "span", 29);
15897
15860
  i0__namespace.ɵɵtext(2, "Error:");
15898
15861
  i0__namespace.ɵɵelementEnd();
15899
15862
  i0__namespace.ɵɵtext(3);
@@ -15914,18 +15877,18 @@
15914
15877
  i0__namespace.ɵɵelementEnd();
15915
15878
  }
15916
15879
  if (rf & 2) {
15917
- var reason_r19 = ctx.$implicit;
15880
+ var reason_r15 = ctx.$implicit;
15918
15881
  i0__namespace.ɵɵadvance(1);
15919
- i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind1(2, 1, reason_r19));
15882
+ i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind1(2, 1, reason_r15.reasonCode));
15920
15883
  }
15921
15884
  }
15922
15885
  var _c1$f = function (a0) { return { "table-group-error": a0 }; };
15923
15886
  function LinkCasesComponent_tr_31_Template(rf, ctx) {
15924
15887
  if (rf & 1) {
15925
- var _r21_1 = i0__namespace.ɵɵgetCurrentView();
15888
+ var _r17_1 = i0__namespace.ɵɵgetCurrentView();
15926
15889
  i0__namespace.ɵɵelementStart(0, "tr", 10);
15927
- i0__namespace.ɵɵelementStart(1, "td", 38);
15928
- i0__namespace.ɵɵelement(2, "div", 39);
15890
+ i0__namespace.ɵɵelementStart(1, "td", 33);
15891
+ i0__namespace.ɵɵelement(2, "div", 34);
15929
15892
  i0__namespace.ɵɵelementStart(3, "span");
15930
15893
  i0__namespace.ɵɵtext(4);
15931
15894
  i0__namespace.ɵɵelement(5, "br");
@@ -15933,55 +15896,55 @@
15933
15896
  i0__namespace.ɵɵpipe(7, "ccdCaseReference");
15934
15897
  i0__namespace.ɵɵelementEnd();
15935
15898
  i0__namespace.ɵɵelementEnd();
15936
- i0__namespace.ɵɵelementStart(8, "td", 40);
15899
+ i0__namespace.ɵɵelementStart(8, "td", 35);
15937
15900
  i0__namespace.ɵɵtext(9);
15938
15901
  i0__namespace.ɵɵelementEnd();
15939
- i0__namespace.ɵɵelementStart(10, "td", 38);
15902
+ i0__namespace.ɵɵelementStart(10, "td", 33);
15940
15903
  i0__namespace.ɵɵtext(11);
15941
15904
  i0__namespace.ɵɵelementEnd();
15942
- i0__namespace.ɵɵelementStart(12, "td", 40);
15905
+ i0__namespace.ɵɵelementStart(12, "td", 35);
15943
15906
  i0__namespace.ɵɵtext(13);
15944
15907
  i0__namespace.ɵɵelementEnd();
15945
- i0__namespace.ɵɵelementStart(14, "td", 38);
15946
- i0__namespace.ɵɵtemplate(15, LinkCasesComponent_tr_31_span_15_Template, 4, 3, "span", 41);
15908
+ i0__namespace.ɵɵelementStart(14, "td", 33);
15909
+ i0__namespace.ɵɵtemplate(15, LinkCasesComponent_tr_31_span_15_Template, 4, 3, "span", 36);
15947
15910
  i0__namespace.ɵɵelementEnd();
15948
- i0__namespace.ɵɵelementStart(16, "td", 38);
15949
- i0__namespace.ɵɵelementStart(17, "a", 42);
15950
- i0__namespace.ɵɵlistener("click", function LinkCasesComponent_tr_31_Template_a_click_17_listener() { i0__namespace.ɵɵrestoreView(_r21_1); var pos_r17 = ctx.index; var case_r16 = ctx.$implicit; var ctx_r20 = i0__namespace.ɵɵnextContext(); return ctx_r20.onSelectedLinkedCaseRemove(pos_r17, case_r16.caseReference); });
15911
+ i0__namespace.ɵɵelementStart(16, "td", 33);
15912
+ i0__namespace.ɵɵelementStart(17, "a", 37);
15913
+ i0__namespace.ɵɵlistener("click", function LinkCasesComponent_tr_31_Template_a_click_17_listener() { i0__namespace.ɵɵrestoreView(_r17_1); var pos_r13 = ctx.index; var case_r12 = ctx.$implicit; var ctx_r16 = i0__namespace.ɵɵnextContext(); return ctx_r16.onSelectedLinkedCaseRemove(pos_r13, case_r12.caseReference); });
15951
15914
  i0__namespace.ɵɵtext(18, "Remove");
15952
15915
  i0__namespace.ɵɵelementEnd();
15953
15916
  i0__namespace.ɵɵelementEnd();
15954
15917
  i0__namespace.ɵɵelementEnd();
15955
15918
  }
15956
15919
  if (rf & 2) {
15957
- var case_r16 = ctx.$implicit;
15920
+ var case_r12 = ctx.$implicit;
15958
15921
  var ctx_r2 = i0__namespace.ɵɵnextContext();
15959
15922
  i0__namespace.ɵɵadvance(2);
15960
- i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(12, _c1$f, ctx_r2.caseSelectionError && case_r16.caseReference === ctx_r2.linkCaseForm.value.caseNumber));
15923
+ i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(12, _c1$f, ctx_r2.caseSelectionError && case_r12.caseReference === ctx_r2.linkCaseForm.value.caseNumber));
15961
15924
  i0__namespace.ɵɵadvance(2);
15962
- i0__namespace.ɵɵtextInterpolate1("", case_r16.caseName, " ");
15925
+ i0__namespace.ɵɵtextInterpolate1("", case_r12.caseName, " ");
15963
15926
  i0__namespace.ɵɵadvance(2);
15964
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(7, 10, case_r16.caseReference), "");
15927
+ i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(7, 10, case_r12.caseReference), "");
15965
15928
  i0__namespace.ɵɵadvance(2);
15966
- i0__namespace.ɵɵproperty("title", case_r16.caseTypeDescription);
15929
+ i0__namespace.ɵɵproperty("title", case_r12.caseTypeDescription);
15967
15930
  i0__namespace.ɵɵadvance(1);
15968
- i0__namespace.ɵɵtextInterpolate(case_r16.caseType);
15931
+ i0__namespace.ɵɵtextInterpolate(case_r12.caseType);
15969
15932
  i0__namespace.ɵɵadvance(2);
15970
- i0__namespace.ɵɵtextInterpolate(case_r16.caseService);
15933
+ i0__namespace.ɵɵtextInterpolate(case_r12.caseService);
15971
15934
  i0__namespace.ɵɵadvance(1);
15972
- i0__namespace.ɵɵproperty("title", case_r16.caseStateDescription);
15935
+ i0__namespace.ɵɵproperty("title", case_r12.caseStateDescription);
15973
15936
  i0__namespace.ɵɵadvance(1);
15974
- i0__namespace.ɵɵtextInterpolate(case_r16.caseState);
15937
+ i0__namespace.ɵɵtextInterpolate(case_r12.caseState);
15975
15938
  i0__namespace.ɵɵadvance(2);
15976
- i0__namespace.ɵɵproperty("ngForOf", case_r16.reasons);
15939
+ i0__namespace.ɵɵproperty("ngForOf", case_r12.reasons);
15977
15940
  i0__namespace.ɵɵadvance(2);
15978
- i0__namespace.ɵɵattribute("id", case_r16.caseReference);
15941
+ i0__namespace.ɵɵattribute("id", case_r12.caseReference);
15979
15942
  }
15980
15943
  }
15981
15944
  function LinkCasesComponent_tr_32_Template(rf, ctx) {
15982
15945
  if (rf & 1) {
15983
15946
  i0__namespace.ɵɵelementStart(0, "tr", 10);
15984
- i0__namespace.ɵɵelementStart(1, "td", 43);
15947
+ i0__namespace.ɵɵelementStart(1, "td", 38);
15985
15948
  i0__namespace.ɵɵtext(2, " None ");
15986
15949
  i0__namespace.ɵɵelementEnd();
15987
15950
  i0__namespace.ɵɵelementEnd();
@@ -15996,7 +15959,7 @@
15996
15959
  this.linkedCasesStateEmitter = new i0.EventEmitter();
15997
15960
  this.errorMessages = [];
15998
15961
  this.selectedCases = [];
15999
- this.showComments = false;
15962
+ this.linkCaseReasons = [];
16000
15963
  this.ISO_FORMAT = 'YYYY-MM-DDTHH:mm:ss.SSS';
16001
15964
  }
16002
15965
  LinkCasesComponent.prototype.ngOnInit = function () {
@@ -16016,7 +15979,6 @@
16016
15979
  this.linkCaseForm = this.fb.group({
16017
15980
  caseNumber: ['', [i2.Validators.minLength(16), this.validatorsUtils.regexPattern(exports.Patterns.CASE_REF)]],
16018
15981
  reasonType: this.getReasonTypeFormArray,
16019
- otherDescription: ['', [i2.Validators.maxLength(100)]]
16020
15982
  });
16021
15983
  };
16022
15984
  Object.defineProperty(LinkCasesComponent.prototype, "getReasonTypeFormArray", {
@@ -16036,22 +15998,16 @@
16036
15998
  enumerable: false,
16037
15999
  configurable: true
16038
16000
  });
16039
- LinkCasesComponent.prototype.toggleLinkCaseReasonOtherComments = function (event) {
16040
- this.linkCaseReasons.find(function (reason) { return reason.value_en === event.target.value; }).selected = event.target.checked;
16041
- this.showComments = this.linkCaseReasons.find(function (reason) { return reason.value_en === 'Other'; }).selected;
16042
- };
16043
16001
  LinkCasesComponent.prototype.submitCaseInfo = function () {
16044
16002
  this.errorMessages = [];
16045
16003
  this.caseReasonError = null;
16046
- this.caseReasonCommentsError = null;
16047
16004
  this.caseNumberError = null;
16048
16005
  this.caseSelectionError = null;
16049
16006
  this.noSelectedCaseError = null;
16050
16007
  if (this.linkCaseForm.valid &&
16051
16008
  !this.isCaseSelected(this.selectedCases) &&
16052
16009
  !this.isCaseSelected(this.linkedCasesService.linkedCases) &&
16053
- !this.isCaseSelectedSameAsCurrentCase() &&
16054
- !this.isOtherOptionSelectedButOtherDescriptionNotEntered()) {
16010
+ !this.isCaseSelectedSameAsCurrentCase()) {
16055
16011
  this.getCaseInfo();
16056
16012
  }
16057
16013
  else {
@@ -16068,9 +16024,6 @@
16068
16024
  LinkCasesComponent.prototype.isCaseSelectedSameAsCurrentCase = function () {
16069
16025
  return this.linkCaseForm.value.caseNumber.split('-').join('') === this.linkedCasesService.caseId.split('-').join('');
16070
16026
  };
16071
- LinkCasesComponent.prototype.isOtherOptionSelectedButOtherDescriptionNotEntered = function () {
16072
- return this.showComments && this.linkCaseForm.value.otherDescription.trim().length === 0;
16073
- };
16074
16027
  LinkCasesComponent.prototype.showErrorInfo = function () {
16075
16028
  if (this.linkCaseForm.controls.caseNumber.invalid) {
16076
16029
  this.caseNumberError = exports.LinkedCasesErrorMessages.CaseNumberError;
@@ -16088,25 +16041,6 @@
16088
16041
  fieldId: 'caseReason',
16089
16042
  });
16090
16043
  }
16091
- if (this.linkCaseForm.controls.reasonType.valid
16092
- && this.linkCaseReasons.find(function (reason) { return reason.value_en === 'Other'; }).selected) {
16093
- if (this.linkCaseForm.controls.otherDescription.value.trim().length === 0) {
16094
- this.caseReasonCommentsError = exports.LinkedCasesErrorMessages.otherDescriptionError;
16095
- this.errorMessages.push({
16096
- title: 'dummy-case-reason-comments',
16097
- description: exports.LinkedCasesErrorMessages.otherDescriptionError,
16098
- fieldId: 'otherDescription',
16099
- });
16100
- }
16101
- if (this.linkCaseForm.controls.otherDescription.value.trim().length > 100) {
16102
- this.caseReasonCommentsError = exports.LinkedCasesErrorMessages.otherDescriptionMaxLengthError;
16103
- this.errorMessages.push({
16104
- title: 'dummy-case-reason-comments',
16105
- description: exports.LinkedCasesErrorMessages.otherDescriptionMaxLengthError,
16106
- fieldId: 'otherDescription',
16107
- });
16108
- }
16109
- }
16110
16044
  if (this.isCaseSelected(this.selectedCases)) {
16111
16045
  this.caseSelectionError = exports.LinkedCasesErrorMessages.CaseProposedError;
16112
16046
  this.errorMessages.push({
@@ -16162,7 +16096,6 @@
16162
16096
  }
16163
16097
  _this.linkedCasesService.caseFieldValue.push({ id: caseView.case_id.toString(), value: ccdApiCaseLinkData });
16164
16098
  _this.selectedCases.push(caseLink);
16165
- _this.linkCaseReasons.forEach(function (reason) { return reason.selected = false; });
16166
16099
  _this.initForm();
16167
16100
  _this.emitLinkedCasesState(false);
16168
16101
  }, function (error) {
@@ -16186,31 +16119,23 @@
16186
16119
  });
16187
16120
  };
16188
16121
  LinkCasesComponent.prototype.getSelectedCaseReasons = function () {
16189
- var _this = this;
16190
16122
  var selectedReasons = [];
16191
16123
  this.linkCaseForm.controls.reasonType.value.forEach(function (selectedReason) {
16192
16124
  if (selectedReason.selected) {
16193
16125
  selectedReasons.push({
16194
- Reason: selectedReason.key,
16195
- OtherDescription: selectedReason.value_en === 'Other'
16196
- ? _this.linkCaseForm.controls.otherDescription.value
16197
- : ''
16126
+ reasonCode: selectedReason.key
16198
16127
  });
16199
16128
  }
16200
16129
  });
16201
16130
  return selectedReasons;
16202
16131
  };
16203
16132
  LinkCasesComponent.prototype.getSelectedCCDTypeCaseReason = function () {
16204
- var _this = this;
16205
16133
  var selectedReasons = [];
16206
16134
  this.linkCaseForm.controls.reasonType.value.forEach(function (selectedReason) {
16207
16135
  if (selectedReason.selected) {
16208
16136
  selectedReasons.push({
16209
16137
  value: {
16210
16138
  Reason: selectedReason.key,
16211
- OtherDescription: selectedReason.value_en === 'Other'
16212
- ? _this.linkCaseForm.controls.otherDescription.value
16213
- : ''
16214
16139
  }
16215
16140
  });
16216
16141
  }
@@ -16249,7 +16174,7 @@
16249
16174
  return LinkCasesComponent;
16250
16175
  }());
16251
16176
  LinkCasesComponent.ɵfac = function LinkCasesComponent_Factory(t) { return new (t || LinkCasesComponent)(i0__namespace.ɵɵdirectiveInject(CasesService), i0__namespace.ɵɵdirectiveInject(i2__namespace.FormBuilder), i0__namespace.ɵɵdirectiveInject(ValidatorsUtils), i0__namespace.ɵɵdirectiveInject(LinkedCasesService)); };
16252
- LinkCasesComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: LinkCasesComponent, selectors: [["ccd-link-cases"]], outputs: { linkedCasesStateEmitter: "linkedCasesStateEmitter" }, decls: 36, vars: 11, consts: [[1, "govuk-grid-row"], [1, "govuk-grid-column-full"], [1, "govuk-caption-l"], [1, "govuk-heading-xl"], ["class", "form-group", 3, "formGroup", 4, "ngIf"], ["id", "caseNumber", 1, "govuk-form-group", 3, "ngClass"], ["class", "govuk-error-message", 4, "ngIf"], [1, "govuk-table"], [1, "govuk-table__caption", "govuk-table__caption--m"], [1, "govuk-table__head"], [1, "govuk-table__row"], ["scope", "col", "width", "300", 1, "govuk-table__header"], ["scope", "col", "width", "150", 1, "govuk-table__header"], ["scope", "col", "width", "200", 1, "govuk-table__header"], ["scope", "col", "width", "400", 1, "govuk-table__header"], ["scope", "col", "width", "50", 1, "govuk-table__header"], [1, "govuk-table__body"], ["class", "govuk-table__row", 4, "ngFor", "ngForOf"], ["class", "govuk-table__row", 4, "ngIf"], [1, "govuk-button-group"], ["type", "button", "id", "next-button", 1, "button", "button-primary", 3, "click"], [1, "form-group", 3, "formGroup"], [1, "govuk-heading-s"], ["formControlName", "caseNumber", "id", "width-20", "name", "width-20", "type", "text", 1, "govuk-input", "govuk-input--width-20"], [1, "govuk-!-margin-top-3", 3, "ngClass"], ["id", "waste-hint", 1, "govuk-hint"], ["data-module", "govuk-checkboxes", "formArrayName", "reasonType", "id", "caseReason", 1, "govuk-checkboxes"], ["class", "govuk-checkboxes__item", 3, "formGroupName", 4, "ngFor", "ngForOf"], ["id", "other-description-char-limit-error", "class", "govuk-!-margin-top-3", 3, "ngClass", 4, "ngIf"], ["id", "propose", "type", "button", "data-module", "govuk-button", 1, "govuk-button", "govuk-button--secondary", 3, "click"], [1, "govuk-error-message"], [1, "govuk-visually-hidden"], [1, "govuk-checkboxes__item", 3, "formGroupName"], ["formControlName", "selected", "name", "pos", "type", "checkbox", 1, "govuk-checkboxes__input", 3, "id", "value", "change"], [1, "govuk-label", "govuk-checkboxes__label", 3, "for"], ["id", "other-description-char-limit-error", 1, "govuk-!-margin-top-3", 3, "ngClass"], ["id", "otherDescription", "name", "otherDescription", "formControlName", "otherDescription", "rows", "5", "aria-describedby", "other-description-hint other-description-char-limit-info other-description-char-limit-error", 1, "govuk-textarea", "govuk-input--width-30"], ["id", "other-description-char-limit-info", "aria-live", "polite", 1, "govuk-hint", "govuk-character-count__message"], [1, "govuk-table__cell"], [1, "govuk-form-group--error", 3, "ngClass"], [1, "govuk-table__cell", 3, "title"], [4, "ngFor", "ngForOf"], [1, "govuk-link", "no-visited-state", 3, "click"], ["colspan", "6", 1, "govuk-table__cell"]], template: function LinkCasesComponent_Template(rf, ctx) {
16177
+ LinkCasesComponent.ɵcmp = i0__namespace.ɵɵ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) {
16253
16178
  if (rf & 1) {
16254
16179
  i0__namespace.ɵɵelementStart(0, "div", 0);
16255
16180
  i0__namespace.ɵɵelementStart(1, "div", 1);
@@ -16261,7 +16186,7 @@
16261
16186
  i0__namespace.ɵɵelementStart(6, "h1", 3);
16262
16187
  i0__namespace.ɵɵtext(7, "Select a\u00A0case you want to link to this case");
16263
16188
  i0__namespace.ɵɵelementEnd();
16264
- i0__namespace.ɵɵtemplate(8, LinkCasesComponent_div_8_Template, 20, 12, "div", 4);
16189
+ i0__namespace.ɵɵtemplate(8, LinkCasesComponent_div_8_Template, 18, 11, "div", 4);
16265
16190
  i0__namespace.ɵɵelement(9, "hr");
16266
16191
  i0__namespace.ɵɵelement(10, "br");
16267
16192
  i0__namespace.ɵɵelement(11, "br");
@@ -16353,14 +16278,14 @@
16353
16278
  if (rf & 1) {
16354
16279
  i0__namespace.ɵɵelementStart(0, "span");
16355
16280
  i0__namespace.ɵɵtext(1);
16356
- i0__namespace.ɵɵpipe(2, "ccdLinkCasesFromReasonValue");
16281
+ i0__namespace.ɵɵpipe(2, "ccdLinkCasesReasonValue");
16357
16282
  i0__namespace.ɵɵelement(3, "br");
16358
16283
  i0__namespace.ɵɵelementEnd();
16359
16284
  }
16360
16285
  if (rf & 2) {
16361
16286
  var reason_r11 = ctx.$implicit;
16362
16287
  i0__namespace.ɵɵadvance(1);
16363
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(2, 1, reason_r11), " ");
16288
+ i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(2, 1, reason_r11.reasonCode), " ");
16364
16289
  }
16365
16290
  }
16366
16291
  function LinkedCasesFromTableComponent_table_1_tbody_13_tr_1_td_18_Template(rf, ctx) {
@@ -16491,6 +16416,7 @@
16491
16416
  this.casesService = casesService;
16492
16417
  this.linkedCasesService = linkedCasesService;
16493
16418
  this.notifyAPIFailure = new i0.EventEmitter(false);
16419
+ this.getLinkedCasesResponse = [];
16494
16420
  this.showHideLinkText = 'Show';
16495
16421
  this.noLinkedCases = true;
16496
16422
  this.isServerError = false;
@@ -16512,23 +16438,20 @@
16512
16438
  LinkedCasesFromTableComponent.prototype.fetchPageData = function () {
16513
16439
  var _this = this;
16514
16440
  this.caseId = this.route.snapshot.data.case.case_id;
16515
- this.getLinkedCases().subscribe({
16516
- next: function (response) {
16517
- _this.isServerError = false;
16518
- _this.getLinkedCasesResponse = response.linkedCases && response.linkedCases.map(function (item) {
16519
- var mappedCasetype = _this.mapLookupIDToValueFromJurisdictions('CASE_TYPE', item.ccdCaseType);
16520
- var mappedCasetypeDescription = _this.mapLookupIDToValueFromJurisdictions('CASE_TYPE_DESCRIPTION', item.ccdCaseType);
16521
- var mappedCaseState = _this.mapLookupIDToValueFromJurisdictions('STATE', item.state);
16522
- var mappedCaseStateDescription = _this.mapLookupIDToValueFromJurisdictions('STATE_DESCRIPTION', item.state);
16523
- var mappedCaseService = _this.mapLookupIDToValueFromJurisdictions('JURISDICTION', item.ccdJurisdiction);
16524
- return Object.assign(Object.assign({}, item), { ccdCaseType: mappedCasetype, ccdCaseTypeDescription: mappedCasetypeDescription, ccdJurisdiction: mappedCaseService, state: mappedCaseState, stateDescription: mappedCaseStateDescription, caseNameHmctsInternal: item.caseNameHmctsInternal || LinkedCasesFromTableComponent.CASE_NAME_MISSING_TEXT, linkDetails: item.linkDetails });
16525
- });
16526
- _this.noLinkedCases = !response.linkedCases || !response.linkedCases.length;
16527
- },
16528
- error: function () {
16529
- _this.isServerError = true;
16530
- _this.notifyAPIFailure.emit(true);
16531
- }
16441
+ this.getLinkedCases().subscribe(function (response) {
16442
+ _this.isServerError = false;
16443
+ _this.getLinkedCasesResponse = response.linkedCases && response.linkedCases.map(function (item) {
16444
+ var mappedCasetype = _this.mapLookupIDToValueFromJurisdictions('CASE_TYPE', item.ccdCaseType);
16445
+ var mappedCasetypeDescription = _this.mapLookupIDToValueFromJurisdictions('CASE_TYPE_DESCRIPTION', item.ccdCaseType);
16446
+ var mappedCaseState = _this.mapLookupIDToValueFromJurisdictions('STATE', item.state);
16447
+ var mappedCaseStateDescription = _this.mapLookupIDToValueFromJurisdictions('STATE_DESCRIPTION', item.state);
16448
+ var mappedCaseService = _this.mapLookupIDToValueFromJurisdictions('JURISDICTION', item.ccdJurisdiction);
16449
+ return Object.assign(Object.assign({}, item), { ccdCaseType: mappedCasetype, ccdCaseTypeDescription: mappedCasetypeDescription, ccdJurisdiction: mappedCaseService, state: mappedCaseState, stateDescription: mappedCaseStateDescription, caseNameHmctsInternal: item.caseNameHmctsInternal || LinkedCasesFromTableComponent.CASE_NAME_MISSING_TEXT });
16450
+ });
16451
+ _this.noLinkedCases = !response.linkedCases || !response.linkedCases.length;
16452
+ }, function (err) {
16453
+ _this.isServerError = true;
16454
+ _this.notifyAPIFailure.emit(true);
16532
16455
  });
16533
16456
  };
16534
16457
  LinkedCasesFromTableComponent.prototype.getLinkedCases = function () {
@@ -16607,9 +16530,9 @@
16607
16530
  var isLast_r8 = ctx.last;
16608
16531
  var ctx_r5 = i0__namespace.ɵɵnextContext(4);
16609
16532
  i0__namespace.ɵɵadvance(1);
16610
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(2, 3, reason_r6.value), "");
16533
+ i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(2, 3, reason_r6), "");
16611
16534
  i0__namespace.ɵɵadvance(3);
16612
- i0__namespace.ɵɵproperty("ngIf", ctx_r5.hasLeadCaseOrConsolidated(reason_r6.value.Reason));
16535
+ i0__namespace.ɵɵproperty("ngIf", ctx_r5.hasLeadCaseOrConsolidated(reason_r6));
16613
16536
  i0__namespace.ɵɵadvance(1);
16614
16537
  i0__namespace.ɵɵproperty("ngIf", !isLast_r8);
16615
16538
  }
@@ -16723,7 +16646,7 @@
16723
16646
  i0__namespace.ɵɵadvance(14);
16724
16647
  i0__namespace.ɵɵproperty("ngForOf", ctx_r0.linkedCasesFromResponse);
16725
16648
  i0__namespace.ɵɵadvance(1);
16726
- i0__namespace.ɵɵproperty("ngIf", ctx_r0.linkedCasesFromResponse.length === 0 && (!ctx_r0.isServerError && !ctx_r0.isServerReasonCodeError));
16649
+ i0__namespace.ɵɵproperty("ngIf", ctx_r0.linkedCasesFromResponse && ctx_r0.linkedCasesFromResponse.length === 0 && (!ctx_r0.isServerError && !ctx_r0.isServerReasonCodeError));
16727
16650
  }
16728
16651
  }
16729
16652
  var LinkedCasesToTableComponent = /** @class */ (function () {
@@ -16805,7 +16728,7 @@
16805
16728
  unlink: false,
16806
16729
  reasons: item.reasons && item.reasons.map(function (reason) {
16807
16730
  return {
16808
- Reason: reason
16731
+ reasonCode: reason
16809
16732
  };
16810
16733
  }),
16811
16734
  };
@@ -16827,7 +16750,6 @@
16827
16750
  reasonCode === LinkedCasesToTableComponent.CASE_CONSOLIDATED_REASON_CODE;
16828
16751
  };
16829
16752
  LinkedCasesToTableComponent.prototype.mapResponse = function (esSearchCasesResponse) {
16830
- var _a;
16831
16753
  var caseInfo = this.caseField.value.find(function (item) { return item.value && item.value.CaseReference === esSearchCasesResponse.case_id; });
16832
16754
  return caseInfo && {
16833
16755
  caseReference: esSearchCasesResponse.case_id,
@@ -16837,7 +16759,8 @@
16837
16759
  service: esSearchCasesResponse.case_type && esSearchCasesResponse.case_type.jurisdiction.description || '',
16838
16760
  state: esSearchCasesResponse.state.name || '',
16839
16761
  stateDescription: esSearchCasesResponse.state.description || '',
16840
- reasons: (_a = caseInfo === null || caseInfo === void 0 ? void 0 : caseInfo.value) === null || _a === void 0 ? void 0 : _a.ReasonForLink
16762
+ reasons: caseInfo.value && caseInfo.value.ReasonForLink &&
16763
+ caseInfo.value.ReasonForLink.map(function (reason) { return reason.value && reason.value.Reason; }),
16841
16764
  };
16842
16765
  };
16843
16766
  return LinkedCasesToTableComponent;
@@ -17205,11 +17128,6 @@
17205
17128
  }
17206
17129
  return LinkReason;
17207
17130
  }());
17208
- var LinkFromReason = /** @class */ (function () {
17209
- function LinkFromReason() {
17210
- }
17211
- return LinkFromReason;
17212
- }());
17213
17131
  var LinkedCasesResponse = /** @class */ (function () {
17214
17132
  function LinkedCasesResponse() {
17215
17133
  }
@@ -17608,11 +17526,7 @@
17608
17526
  var reasonCodeAPIurl = this.appConfig.getRDCommonDataApiUrl() + '/lov/categories/CaseLinkingReasonCode';
17609
17527
  this.commonDataService.getRefData(reasonCodeAPIurl).subscribe({
17610
17528
  next: function (reasons) {
17611
- // Sort in ascending order
17612
- var linkCaseReasons = reasons.list_of_values.sort(function (a, b) { return (a.value_en > b.value_en) ? 1 : -1; });
17613
- // Move Other option to the end of the list
17614
- _this.linkedCasesService.linkCaseReasons = linkCaseReasons === null || linkCaseReasons === void 0 ? void 0 : linkCaseReasons.filter(function (reason) { return reason.value_en !== 'Other'; });
17615
- _this.linkedCasesService.linkCaseReasons.push(linkCaseReasons === null || linkCaseReasons === void 0 ? void 0 : linkCaseReasons.find(function (reason) { return reason.value_en === 'Other'; }));
17529
+ _this.linkedCasesService.linkCaseReasons = reasons.list_of_values.sort(function (a, b) { return (a.value_en > b.value_en) ? 1 : -1; });
17616
17530
  }
17617
17531
  });
17618
17532
  };
@@ -24959,46 +24873,14 @@
24959
24873
  }], null, null);
24960
24874
  })();
24961
24875
 
24962
- var LinkCasesFromReasonValuePipe = /** @class */ (function () {
24963
- function LinkCasesFromReasonValuePipe(linkedCasesService) {
24964
- this.linkedCasesService = linkedCasesService;
24965
- }
24966
- LinkCasesFromReasonValuePipe.prototype.transform = function (linkFromReason) {
24967
- var _a, _b, _c;
24968
- if (linkFromReason === null || linkFromReason === void 0 ? void 0 : linkFromReason.otherDescription) {
24969
- var reasonCodeMapping = (_a = this.linkedCasesService.linkCaseReasons) === null || _a === void 0 ? void 0 : _a.find(function (reason) { return reason.key === linkFromReason.reasonCode; });
24970
- return (reasonCodeMapping === null || reasonCodeMapping === void 0 ? void 0 : reasonCodeMapping.value_en) === 'Other'
24971
- ? (reasonCodeMapping === null || reasonCodeMapping === void 0 ? void 0 : reasonCodeMapping.value_en) + " - " + linkFromReason.otherDescription
24972
- : reasonCodeMapping === null || reasonCodeMapping === void 0 ? void 0 : reasonCodeMapping.value_en;
24973
- }
24974
- return (_c = (_b = this.linkedCasesService.linkCaseReasons) === null || _b === void 0 ? void 0 : _b.find(function (reason) { return reason.key === linkFromReason.reasonCode; })) === null || _c === void 0 ? void 0 : _c.value_en;
24975
- };
24976
- return LinkCasesFromReasonValuePipe;
24977
- }());
24978
- LinkCasesFromReasonValuePipe.ɵfac = function LinkCasesFromReasonValuePipe_Factory(t) { return new (t || LinkCasesFromReasonValuePipe)(i0__namespace.ɵɵdirectiveInject(LinkedCasesService)); };
24979
- LinkCasesFromReasonValuePipe.ɵpipe = i0__namespace.ɵɵdefinePipe({ name: "ccdLinkCasesFromReasonValue", type: LinkCasesFromReasonValuePipe, pure: true });
24980
- (function () {
24981
- (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(LinkCasesFromReasonValuePipe, [{
24982
- type: i0.Pipe,
24983
- args: [{
24984
- name: 'ccdLinkCasesFromReasonValue'
24985
- }]
24986
- }], function () { return [{ type: LinkedCasesService }]; }, null);
24987
- })();
24988
-
24989
24876
  var LinkCasesReasonValuePipe = /** @class */ (function () {
24990
24877
  function LinkCasesReasonValuePipe(linkedCasesService) {
24991
24878
  this.linkedCasesService = linkedCasesService;
24992
24879
  }
24993
- LinkCasesReasonValuePipe.prototype.transform = function (linkReason) {
24994
- var _a, _b, _c;
24995
- if (linkReason === null || linkReason === void 0 ? void 0 : linkReason.OtherDescription) {
24996
- var reasonCodeMapping = (_a = this.linkedCasesService.linkCaseReasons) === null || _a === void 0 ? void 0 : _a.find(function (reason) { return reason.key === linkReason.Reason; });
24997
- return (reasonCodeMapping === null || reasonCodeMapping === void 0 ? void 0 : reasonCodeMapping.value_en) === 'Other'
24998
- ? (reasonCodeMapping === null || reasonCodeMapping === void 0 ? void 0 : reasonCodeMapping.value_en) + " - " + linkReason.OtherDescription
24999
- : reasonCodeMapping === null || reasonCodeMapping === void 0 ? void 0 : reasonCodeMapping.value_en;
25000
- }
25001
- return (_c = (_b = this.linkedCasesService.linkCaseReasons) === null || _b === void 0 ? void 0 : _b.find(function (reason) { return reason.key === linkReason.Reason; })) === null || _c === void 0 ? void 0 : _c.value_en;
24880
+ LinkCasesReasonValuePipe.prototype.transform = function (reasonCode) {
24881
+ var reasonCodeMapping = this.linkedCasesService.linkCaseReasons &&
24882
+ this.linkedCasesService.linkCaseReasons.find(function (reason) { return reason.key === reasonCode; });
24883
+ return reasonCodeMapping && reasonCodeMapping.value_en;
25002
24884
  };
25003
24885
  return LinkCasesReasonValuePipe;
25004
24886
  }());
@@ -25047,8 +24929,7 @@
25047
24929
  ReadFieldsFilterPipe,
25048
24930
  CcdTabFieldsPipe,
25049
24931
  CcdPageFieldsPipe,
25050
- LinkCasesReasonValuePipe,
25051
- LinkCasesFromReasonValuePipe
24932
+ LinkCasesReasonValuePipe
25052
24933
  ];
25053
24934
  var PipesModule = /** @class */ (function () {
25054
24935
  function PipesModule() {
@@ -25069,8 +24950,7 @@
25069
24950
  ReadFieldsFilterPipe,
25070
24951
  CcdTabFieldsPipe,
25071
24952
  CcdPageFieldsPipe,
25072
- LinkCasesReasonValuePipe,
25073
- LinkCasesFromReasonValuePipe], imports: [i1.CommonModule], exports: [CaseReferencePipe,
24953
+ LinkCasesReasonValuePipe], imports: [i1.CommonModule], exports: [CaseReferencePipe,
25074
24954
  SortSearchResultPipe,
25075
24955
  CcdCaseTitlePipe,
25076
24956
  CcdCollectionTableCaseFieldsFilterPipe,
@@ -25078,8 +24958,7 @@
25078
24958
  ReadFieldsFilterPipe,
25079
24959
  CcdTabFieldsPipe,
25080
24960
  CcdPageFieldsPipe,
25081
- LinkCasesReasonValuePipe,
25082
- LinkCasesFromReasonValuePipe] });
24961
+ LinkCasesReasonValuePipe] });
25083
24962
  })();
25084
24963
  (function () {
25085
24964
  (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(PipesModule, [{
@@ -25653,7 +25532,7 @@
25653
25532
  CaseFileViewFieldComponent, [i1__namespace.NgIf, CaseFileViewFolderComponent, i11__namespace.ɵcs], []);
25654
25533
  i0__namespace.ɵɵsetComponentScope(CaseFileViewFieldReadComponent, [i1__namespace.NgIf, CaseFileViewFolderComponent, i11__namespace.ɵcs], []);
25655
25534
  i0__namespace.ɵɵsetComponentScope(LinkedCasesToTableComponent, [i1__namespace.NgIf, i1__namespace.NgForOf], [CaseReferencePipe, LinkCasesReasonValuePipe]);
25656
- i0__namespace.ɵɵsetComponentScope(LinkedCasesFromTableComponent, [i1__namespace.NgIf, i1__namespace.NgForOf], [CaseReferencePipe, LinkCasesFromReasonValuePipe]);
25535
+ i0__namespace.ɵɵsetComponentScope(LinkedCasesFromTableComponent, [i1__namespace.NgIf, i1__namespace.NgForOf], [CaseReferencePipe, LinkCasesReasonValuePipe]);
25657
25536
  i0__namespace.ɵɵsetComponentScope(LinkCasesComponent, [i1__namespace.NgIf, i2__namespace.NgControlStatusGroup, i2__namespace.FormGroupDirective, i1__namespace.NgClass, i2__namespace.DefaultValueAccessor, i2__namespace.NgControlStatus, i2__namespace.FormControlName, i2__namespace.FormArrayName, i1__namespace.NgForOf, i2__namespace.FormGroupName, i2__namespace.CheckboxControlValueAccessor], [CaseReferencePipe, LinkCasesReasonValuePipe]);
25658
25537
  i0__namespace.ɵɵsetComponentScope(CheckYourAnswersComponent, [i1__namespace.NgIf, i1__namespace.NgForOf], [CaseReferencePipe, LinkCasesReasonValuePipe]);
25659
25538
 
@@ -35526,10 +35405,8 @@
35526
35405
  exports.LabelSubstitutorModule = LabelSubstitutorModule;
35527
35406
  exports.LinkCaseReason = LinkCaseReason;
35528
35407
  exports.LinkCasesComponent = LinkCasesComponent;
35529
- exports.LinkCasesFromReasonValuePipe = LinkCasesFromReasonValuePipe;
35530
35408
  exports.LinkCasesReasonValuePipe = LinkCasesReasonValuePipe;
35531
35409
  exports.LinkDetails = LinkDetails;
35532
- exports.LinkFromReason = LinkFromReason;
35533
35410
  exports.LinkReason = LinkReason;
35534
35411
  exports.LinkedCasesFromTableComponent = LinkedCasesFromTableComponent;
35535
35412
  exports.LinkedCasesResponse = LinkedCasesResponse;