@hmcts/ccd-case-ui-toolkit 6.13.10-eui-4157 → 6.13.10-exui-158

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 (45) hide show
  1. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js +581 -293
  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/case-editor/services/cases.service.js +7 -4
  6. package/esm2015/lib/shared/components/palette/base-field/field-read.component.js +2 -2
  7. package/esm2015/lib/shared/components/palette/base-field/field-write.component.js +2 -2
  8. package/esm2015/lib/shared/components/palette/collection/write-collection-field.component.js +13 -2
  9. package/esm2015/lib/shared/components/palette/dynamic-multi-select-list/index.js +3 -0
  10. package/esm2015/lib/shared/components/palette/dynamic-multi-select-list/read-dynamic-multi-select-list-field.component.js +47 -0
  11. package/esm2015/lib/shared/components/palette/dynamic-multi-select-list/write-dynamic-multi-select-list-field.component.js +153 -0
  12. package/esm2015/lib/shared/components/palette/dynamic-radio-list/write-dynamic-radio-list-field.component.js +5 -6
  13. package/esm2015/lib/shared/components/palette/index.js +2 -1
  14. package/esm2015/lib/shared/components/palette/palette.module.js +29 -1
  15. package/esm2015/lib/shared/components/palette/palette.service.js +4 -1
  16. package/esm2015/lib/shared/domain/definition/case-field.model.js +6 -3
  17. package/esm2015/lib/shared/domain/definition/field-type-enum.model.js +1 -1
  18. package/esm2015/lib/shared/pipes/complex/ccd-read-fields-filter.pipe.js +14 -11
  19. package/esm2015/lib/shared/services/form/field-type-sanitiser.js +16 -1
  20. package/fesm2015/hmcts-ccd-case-ui-toolkit.js +610 -361
  21. package/fesm2015/hmcts-ccd-case-ui-toolkit.js.map +1 -1
  22. package/lib/shared/components/case-editor/services/cases.service.d.ts +3 -1
  23. package/lib/shared/components/case-editor/services/cases.service.d.ts.map +1 -1
  24. package/lib/shared/components/palette/collection/write-collection-field.component.d.ts +1 -0
  25. package/lib/shared/components/palette/collection/write-collection-field.component.d.ts.map +1 -1
  26. package/lib/shared/components/palette/dynamic-multi-select-list/index.d.ts +3 -0
  27. package/lib/shared/components/palette/dynamic-multi-select-list/index.d.ts.map +1 -0
  28. package/lib/shared/components/palette/dynamic-multi-select-list/read-dynamic-multi-select-list-field.component.d.ts +9 -0
  29. package/lib/shared/components/palette/dynamic-multi-select-list/read-dynamic-multi-select-list-field.component.d.ts.map +1 -0
  30. package/lib/shared/components/palette/dynamic-multi-select-list/write-dynamic-multi-select-list-field.component.d.ts +17 -0
  31. package/lib/shared/components/palette/dynamic-multi-select-list/write-dynamic-multi-select-list-field.component.d.ts.map +1 -0
  32. package/lib/shared/components/palette/dynamic-radio-list/write-dynamic-radio-list-field.component.d.ts +1 -1
  33. package/lib/shared/components/palette/dynamic-radio-list/write-dynamic-radio-list-field.component.d.ts.map +1 -1
  34. package/lib/shared/components/palette/index.d.ts +1 -0
  35. package/lib/shared/components/palette/index.d.ts.map +1 -1
  36. package/lib/shared/components/palette/palette.module.d.ts +61 -59
  37. package/lib/shared/components/palette/palette.module.d.ts.map +1 -1
  38. package/lib/shared/components/palette/palette.service.d.ts.map +1 -1
  39. package/lib/shared/domain/definition/case-field.model.d.ts.map +1 -1
  40. package/lib/shared/domain/definition/field-type-enum.model.d.ts +1 -1
  41. package/lib/shared/domain/definition/field-type-enum.model.d.ts.map +1 -1
  42. package/lib/shared/pipes/complex/ccd-read-fields-filter.pipe.d.ts.map +1 -1
  43. package/lib/shared/services/form/field-type-sanitiser.d.ts +2 -0
  44. package/lib/shared/services/form/field-type-sanitiser.d.ts.map +1 -1
  45. package/package.json +1 -1
@@ -118,7 +118,7 @@
118
118
  i0__namespace.ɵɵtextInterpolate(ctx_r1.workhours);
119
119
  }
120
120
  }
121
- var _c0$_ = [[["", "footerSolsNavLinks", ""]], [["", "footerCaseWorkerNavLinks", ""]]];
121
+ var _c0$$ = [[["", "footerSolsNavLinks", ""]], [["", "footerCaseWorkerNavLinks", ""]]];
122
122
  var _c1$s = ["[footerSolsNavLinks]", "[footerCaseWorkerNavLinks]"];
123
123
  var FooterComponent = /** @class */ (function () {
124
124
  function FooterComponent() {
@@ -128,7 +128,7 @@
128
128
  FooterComponent.ɵfac = function FooterComponent_Factory(t) { return new (t || FooterComponent)(); };
129
129
  FooterComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: FooterComponent, selectors: [["cut-footer-bar"]], inputs: { email: "email", isSolicitor: "isSolicitor", phone: "phone", workhours: "workhours" }, ngContentSelectors: _c1$s, 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) {
130
130
  if (rf & 1) {
131
- i0__namespace.ɵɵprojectionDef(_c0$_);
131
+ i0__namespace.ɵɵprojectionDef(_c0$$);
132
132
  i0__namespace.ɵɵelementStart(0, "footer", 0);
133
133
  i0__namespace.ɵɵelementStart(1, "div", 1);
134
134
  i0__namespace.ɵɵtemplate(2, FooterComponent_div_2_Template, 15, 0, "div", 2);
@@ -207,7 +207,7 @@
207
207
  i0__namespace.ɵɵtextInterpolate(ctx_r2.title);
208
208
  }
209
209
  }
210
- var _c0$Z = [[["", "headerNavigation", ""]]];
210
+ var _c0$_ = [[["", "headerNavigation", ""]]];
211
211
  var _c1$r = ["[headerNavigation]"];
212
212
  var HeaderBarComponent = /** @class */ (function () {
213
213
  function HeaderBarComponent() {
@@ -221,7 +221,7 @@
221
221
  HeaderBarComponent.ɵfac = function HeaderBarComponent_Factory(t) { return new (t || HeaderBarComponent)(); };
222
222
  HeaderBarComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: HeaderBarComponent, selectors: [["cut-header-bar"]], inputs: { title: "title", isSolicitor: "isSolicitor", username: "username" }, outputs: { signOutRequest: "signOutRequest" }, ngContentSelectors: _c1$r, 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) {
223
223
  if (rf & 1) {
224
- i0__namespace.ɵɵprojectionDef(_c0$Z);
224
+ i0__namespace.ɵɵprojectionDef(_c0$_);
225
225
  i0__namespace.ɵɵelementStart(0, "header", 0);
226
226
  i0__namespace.ɵɵelementStart(1, "div", 1);
227
227
  i0__namespace.ɵɵelementStart(2, "div", 2);
@@ -282,7 +282,7 @@
282
282
  }] });
283
283
  })();
284
284
 
285
- var _c0$Y = [[["", "leftNavLinks", ""]], [["", "rightNavLinks", ""]]];
285
+ var _c0$Z = [[["", "leftNavLinks", ""]], [["", "rightNavLinks", ""]]];
286
286
  var _c1$q = ["[leftNavLinks]", "[rightNavLinks]"];
287
287
  var NavigationComponent = /** @class */ (function () {
288
288
  function NavigationComponent() {
@@ -292,7 +292,7 @@
292
292
  NavigationComponent.ɵfac = function NavigationComponent_Factory(t) { return new (t || NavigationComponent)(); };
293
293
  NavigationComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: NavigationComponent, selectors: [["cut-nav-bar"]], inputs: { isSolicitor: "isSolicitor" }, ngContentSelectors: _c1$q, decls: 4, vars: 2, consts: [[1, "cut-nav-bar"]], template: function NavigationComponent_Template(rf, ctx) {
294
294
  if (rf & 1) {
295
- i0__namespace.ɵɵprojectionDef(_c0$Y);
295
+ i0__namespace.ɵɵprojectionDef(_c0$Z);
296
296
  i0__namespace.ɵɵelementStart(0, "div");
297
297
  i0__namespace.ɵɵelementStart(1, "nav", 0);
298
298
  i0__namespace.ɵɵprojection(2);
@@ -437,7 +437,7 @@
437
437
  }], null, null);
438
438
  })();
439
439
 
440
- var _c0$X = [[["", "topBody", ""]], [["", "leftBody", ""]], [["", "rightBody", ""]]];
440
+ var _c0$Y = [[["", "topBody", ""]], [["", "leftBody", ""]], [["", "rightBody", ""]]];
441
441
  var _c1$p = ["[topBody]", "[leftBody]", "[rightBody]"];
442
442
  var BodyComponent = /** @class */ (function () {
443
443
  function BodyComponent() {
@@ -447,7 +447,7 @@
447
447
  BodyComponent.ɵfac = function BodyComponent_Factory(t) { return new (t || BodyComponent)(); };
448
448
  BodyComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: BodyComponent, selectors: [["cut-body"]], ngContentSelectors: _c1$p, decls: 4, vars: 0, consts: [[1, "global-display"]], template: function BodyComponent_Template(rf, ctx) {
449
449
  if (rf & 1) {
450
- i0__namespace.ɵɵprojectionDef(_c0$X);
450
+ i0__namespace.ɵɵprojectionDef(_c0$Y);
451
451
  i0__namespace.ɵɵelementStart(0, "div", 0);
452
452
  i0__namespace.ɵɵprojection(1);
453
453
  i0__namespace.ɵɵprojection(2, 1);
@@ -852,7 +852,7 @@
852
852
  return typeof state === "function" ? receiver === state : state.has(receiver);
853
853
  }
854
854
 
855
- var _c0$W = function (a0) { return { "govuk-input--error": a0 }; };
855
+ var _c0$X = function (a0) { return { "govuk-input--error": a0 }; };
856
856
  function DateInputComponent_div_16_Template(rf, ctx) {
857
857
  if (rf & 1) {
858
858
  var _r8_1 = i0__namespace.ɵɵgetCurrentView();
@@ -870,7 +870,7 @@
870
870
  i0__namespace.ɵɵadvance(1);
871
871
  i0__namespace.ɵɵproperty("for", ctx_r3.hourId());
872
872
  i0__namespace.ɵɵadvance(2);
873
- i0__namespace.ɵɵproperty("id", ctx_r3.hourId())("name", ctx_r3.hourId())("value", ctx_r3.displayHour)("ngClass", i0__namespace.ɵɵpureFunction1(5, _c0$W, ctx_r3.isInvalid));
873
+ i0__namespace.ɵɵproperty("id", ctx_r3.hourId())("name", ctx_r3.hourId())("value", ctx_r3.displayHour)("ngClass", i0__namespace.ɵɵpureFunction1(5, _c0$X, ctx_r3.isInvalid));
874
874
  }
875
875
  }
876
876
  function DateInputComponent_div_17_Template(rf, ctx) {
@@ -890,7 +890,7 @@
890
890
  i0__namespace.ɵɵadvance(1);
891
891
  i0__namespace.ɵɵproperty("for", ctx_r4.minuteId());
892
892
  i0__namespace.ɵɵadvance(2);
893
- i0__namespace.ɵɵproperty("id", ctx_r4.minuteId())("name", ctx_r4.minuteId())("value", ctx_r4.displayMinute)("ngClass", i0__namespace.ɵɵpureFunction1(5, _c0$W, ctx_r4.isInvalid));
893
+ i0__namespace.ɵɵproperty("id", ctx_r4.minuteId())("name", ctx_r4.minuteId())("value", ctx_r4.displayMinute)("ngClass", i0__namespace.ɵɵpureFunction1(5, _c0$X, ctx_r4.isInvalid));
894
894
  }
895
895
  }
896
896
  function DateInputComponent_div_18_Template(rf, ctx) {
@@ -910,7 +910,7 @@
910
910
  i0__namespace.ɵɵadvance(1);
911
911
  i0__namespace.ɵɵproperty("for", ctx_r5.secondId());
912
912
  i0__namespace.ɵɵadvance(2);
913
- i0__namespace.ɵɵproperty("id", ctx_r5.secondId())("name", ctx_r5.secondId())("value", ctx_r5.displaySecond)("ngClass", i0__namespace.ɵɵpureFunction1(5, _c0$W, ctx_r5.isInvalid));
913
+ i0__namespace.ɵɵproperty("id", ctx_r5.secondId())("name", ctx_r5.secondId())("value", ctx_r5.displaySecond)("ngClass", i0__namespace.ɵɵpureFunction1(5, _c0$X, ctx_r5.isInvalid));
914
914
  }
915
915
  }
916
916
  var DateInputComponent = /** @class */ (function () {
@@ -1144,15 +1144,15 @@
1144
1144
  i0__namespace.ɵɵadvance(2);
1145
1145
  i0__namespace.ɵɵproperty("for", ctx.dayId());
1146
1146
  i0__namespace.ɵɵadvance(2);
1147
- i0__namespace.ɵɵproperty("id", ctx.dayId())("name", ctx.dayId())("value", ctx.displayDay)("ngClass", i0__namespace.ɵɵpureFunction1(18, _c0$W, ctx.isInvalid));
1147
+ i0__namespace.ɵɵproperty("id", ctx.dayId())("name", ctx.dayId())("value", ctx.displayDay)("ngClass", i0__namespace.ɵɵpureFunction1(18, _c0$X, ctx.isInvalid));
1148
1148
  i0__namespace.ɵɵadvance(3);
1149
1149
  i0__namespace.ɵɵproperty("for", ctx.monthId());
1150
1150
  i0__namespace.ɵɵadvance(2);
1151
- i0__namespace.ɵɵproperty("id", ctx.monthId())("name", ctx.monthId())("value", ctx.displayMonth)("ngClass", i0__namespace.ɵɵpureFunction1(20, _c0$W, ctx.isInvalid));
1151
+ i0__namespace.ɵɵproperty("id", ctx.monthId())("name", ctx.monthId())("value", ctx.displayMonth)("ngClass", i0__namespace.ɵɵpureFunction1(20, _c0$X, ctx.isInvalid));
1152
1152
  i0__namespace.ɵɵadvance(3);
1153
1153
  i0__namespace.ɵɵproperty("for", ctx.yearId());
1154
1154
  i0__namespace.ɵɵadvance(2);
1155
- i0__namespace.ɵɵproperty("id", ctx.yearId())("name", ctx.yearId())("value", ctx.displayYear)("ngClass", i0__namespace.ɵɵpureFunction1(22, _c0$W, ctx.isInvalid));
1155
+ i0__namespace.ɵɵproperty("id", ctx.yearId())("name", ctx.yearId())("value", ctx.displayYear)("ngClass", i0__namespace.ɵɵpureFunction1(22, _c0$X, ctx.isInvalid));
1156
1156
  i0__namespace.ɵɵadvance(2);
1157
1157
  i0__namespace.ɵɵproperty("ngIf", ctx.isDateTime);
1158
1158
  i0__namespace.ɵɵadvance(1);
@@ -1233,7 +1233,7 @@
1233
1233
  i0__namespace.ɵɵelementContainerEnd();
1234
1234
  }
1235
1235
  }
1236
- var _c0$V = ["*"];
1236
+ var _c0$W = ["*"];
1237
1237
  exports.AlertMessageType = void 0;
1238
1238
  (function (AlertMessageType) {
1239
1239
  AlertMessageType["WARNING"] = "warning";
@@ -1254,7 +1254,7 @@
1254
1254
  AlertComponent.TYPE_ERROR = 'error';
1255
1255
  AlertComponent.TYPE_INFORMATION = 'information';
1256
1256
  AlertComponent.ɵfac = function AlertComponent_Factory(t) { return new (t || AlertComponent)(); };
1257
- AlertComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: AlertComponent, selectors: [["cut-alert"]], inputs: { type: "type", showIcon: "showIcon" }, ngContentSelectors: _c0$V, 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) {
1257
+ AlertComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: AlertComponent, selectors: [["cut-alert"]], inputs: { type: "type", showIcon: "showIcon" }, ngContentSelectors: _c0$W, 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) {
1258
1258
  if (rf & 1) {
1259
1259
  i0__namespace.ɵɵprojectionDef();
1260
1260
  i0__namespace.ɵɵelementStart(0, "div", 0);
@@ -1529,7 +1529,7 @@
1529
1529
  }] });
1530
1530
  })();
1531
1531
 
1532
- var _c0$U = function (a0) { return { "js-hidden": a0 }; };
1532
+ var _c0$V = function (a0) { return { "js-hidden": a0 }; };
1533
1533
  var _c1$o = ["*"];
1534
1534
  var TabComponent = /** @class */ (function () {
1535
1535
  function TabComponent() {
@@ -1545,7 +1545,7 @@
1545
1545
  i0__namespace.ɵɵelementEnd();
1546
1546
  }
1547
1547
  if (rf & 2) {
1548
- i0__namespace.ɵɵproperty("id", ctx.id)("ngClass", i0__namespace.ɵɵpureFunction1(3, _c0$U, !ctx.selected));
1548
+ i0__namespace.ɵɵproperty("id", ctx.id)("ngClass", i0__namespace.ɵɵpureFunction1(3, _c0$V, !ctx.selected));
1549
1549
  i0__namespace.ɵɵattribute("aria-hidden", !ctx.selected);
1550
1550
  }
1551
1551
  }, directives: [i1__namespace.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}}"] });
@@ -1568,7 +1568,7 @@
1568
1568
  }] });
1569
1569
  })();
1570
1570
 
1571
- var _c0$T = ["tab"];
1571
+ var _c0$U = ["tab"];
1572
1572
  var _c1$n = function () { return ["."]; };
1573
1573
  var _c2$3 = function (a0) { return { "tabs-toggle-selected": a0 }; };
1574
1574
  function TabsComponent_li_2_Template(rf, ctx) {
@@ -1622,7 +1622,7 @@
1622
1622
  }
1623
1623
  }, viewQuery: function TabsComponent_Query(rf, ctx) {
1624
1624
  if (rf & 1) {
1625
- i0__namespace.ɵɵviewQuery(_c0$T, 1);
1625
+ i0__namespace.ɵɵviewQuery(_c0$U, 1);
1626
1626
  }
1627
1627
  if (rf & 2) {
1628
1628
  var _t = void 0;
@@ -1701,7 +1701,7 @@
1701
1701
  }], null, null);
1702
1702
  })();
1703
1703
 
1704
- var _c0$S = function (a0, a1) { return { caseLocked: a0, someoneViewing: a1 }; };
1704
+ var _c0$T = function (a0, a1) { return { caseLocked: a0, someoneViewing: a1 }; };
1705
1705
  var ActivityBannerComponent = /** @class */ (function () {
1706
1706
  function ActivityBannerComponent() {
1707
1707
  }
@@ -1722,7 +1722,7 @@
1722
1722
  i0__namespace.ɵɵelementEnd();
1723
1723
  }
1724
1724
  if (rf & 2) {
1725
- i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction2(4, _c0$S, ctx.bannerType === "editor", ctx.bannerType === "viewer"));
1725
+ i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction2(4, _c0$T, ctx.bannerType === "editor", ctx.bannerType === "viewer"));
1726
1726
  i0__namespace.ɵɵadvance(2);
1727
1727
  i0__namespace.ɵɵpropertyInterpolate("alt", ctx.description);
1728
1728
  i0__namespace.ɵɵpropertyInterpolate("src", ctx.imageLink, i0__namespace.ɵɵsanitizeUrl);
@@ -3360,9 +3360,12 @@
3360
3360
  }
3361
3361
  Object.defineProperty(CaseField.prototype, "value", {
3362
3362
  get: function () {
3363
- if (this.isDynamic()) {
3363
+ if (this.field_type && (this.field_type.type === 'DynamicList' || this.field_type.type === 'DynamicRadioList')) {
3364
3364
  return this._value && this._value.value ? this._value.value.code : this._value;
3365
3365
  }
3366
+ else if (this.field_type && this.field_type.type === 'DynamicMultiSelectList') {
3367
+ return this._value && this._value.value ? this._value.value : this._value;
3368
+ }
3366
3369
  else {
3367
3370
  return this._value;
3368
3371
  }
@@ -3452,7 +3455,7 @@
3452
3455
  };
3453
3456
  CaseField.prototype.isDynamic = function () {
3454
3457
  var _this = this;
3455
- var dynamicFieldTypes = ['DynamicList', 'DynamicRadioList'];
3458
+ var dynamicFieldTypes = ['DynamicList', 'DynamicRadioList', 'DynamicMultiSelectList'];
3456
3459
  if (!this.field_type) {
3457
3460
  return false;
3458
3461
  }
@@ -5653,6 +5656,9 @@
5653
5656
  }
5654
5657
  caseFields.forEach(function (caseField) {
5655
5658
  switch (caseField.field_type.type) {
5659
+ case FieldTypeSanitiser.FIELD_TYPE_DYNAMIC_MULTISELECT_LIST:
5660
+ _this.convertArrayToDynamicListOutput(caseField, data);
5661
+ break;
5656
5662
  case FieldTypeSanitiser.FIELD_TYPE_DYNAMIC_RADIO_LIST:
5657
5663
  case FieldTypeSanitiser.FIELD_TYPE_DYNAMIC_LIST:
5658
5664
  _this.convertStringToDynamicListOutput(caseField, data);
@@ -5670,6 +5676,17 @@
5670
5676
  }
5671
5677
  });
5672
5678
  };
5679
+ FieldTypeSanitiser.prototype.convertArrayToDynamicListOutput = function (field, data) {
5680
+ var values = data[field.id];
5681
+ if (Array.isArray(values)) {
5682
+ var listItems = this.getListItems(field);
5683
+ var matches = listItems.filter(function (item) { return values.map(function (v) { return v.code; }).indexOf(item.code) !== -1; });
5684
+ data[field.id] = {
5685
+ value: matches,
5686
+ list_items: listItems
5687
+ };
5688
+ }
5689
+ };
5673
5690
  FieldTypeSanitiser.prototype.convertStringToDynamicListOutput = function (field, data) {
5674
5691
  var stringValue = data[field.id];
5675
5692
  if (typeof stringValue === 'string') {
@@ -5700,6 +5717,7 @@
5700
5717
  FieldTypeSanitiser.FIELD_TYPE_COLLECTION = 'Collection';
5701
5718
  FieldTypeSanitiser.FIELD_TYPE_DYNAMIC_LIST = 'DynamicList';
5702
5719
  FieldTypeSanitiser.FIELD_TYPE_DYNAMIC_RADIO_LIST = 'DynamicRadioList';
5720
+ FieldTypeSanitiser.FIELD_TYPE_DYNAMIC_MULTISELECT_LIST = 'DynamicMultiSelectList';
5703
5721
  FieldTypeSanitiser.ɵfac = function FieldTypeSanitiser_Factory(t) { return new (t || FieldTypeSanitiser)(); };
5704
5722
  FieldTypeSanitiser.ɵprov = i0__namespace.ɵɵdefineInjectable({ token: FieldTypeSanitiser, factory: FieldTypeSanitiser.ɵfac });
5705
5723
  (function () {
@@ -8403,13 +8421,223 @@
8403
8421
  }], null, null);
8404
8422
  })();
8405
8423
 
8424
+ var MULTIPLE_TASKS_FOUND = 'More than one task found!';
8425
+ var WorkAllocationService = /** @class */ (function () {
8426
+ function WorkAllocationService(http, appConfig, errorService, alertService, sessionStorageService) {
8427
+ this.http = http;
8428
+ this.appConfig = appConfig;
8429
+ this.errorService = errorService;
8430
+ this.alertService = alertService;
8431
+ this.sessionStorageService = sessionStorageService;
8432
+ // Check to see if work allocation is enabled
8433
+ }
8434
+ /**
8435
+ * Call the API to get tasks matching the search criteria.
8436
+ * @param searchRequest The search parameters that specify which tasks to match.
8437
+ */
8438
+ WorkAllocationService.prototype.searchTasks = function (searchRequest) {
8439
+ var _this = this;
8440
+ // Do not need to check if WA enabled as parent method will do that
8441
+ var url = this.appConfig.getWorkAllocationApiUrl() + "/searchForCompletable";
8442
+ return this.http
8443
+ .post(url, { searchRequest: searchRequest }, null, false)
8444
+ .pipe(operators.map(function (response) { return response; }), operators.catchError(function (error) {
8445
+ _this.errorService.setError(error);
8446
+ // explicitly eat away 401 error and 400 error
8447
+ if (error && error.status && (error.status === 401 || error.status === 400)) {
8448
+ // do nothing
8449
+ console.log('error status 401 or 400', error);
8450
+ }
8451
+ else {
8452
+ return rxjs.throwError(error);
8453
+ }
8454
+ }));
8455
+ };
8456
+ WorkAllocationService.prototype.isWAEnabled = function (jurisdiction, caseType) {
8457
+ this.features = this.appConfig.getWAServiceConfig();
8458
+ var enabled = false;
8459
+ if (!jurisdiction || !caseType) {
8460
+ var caseInfo = JSON.parse(this.sessionStorageService.getItem('caseInfo'));
8461
+ jurisdiction = caseInfo.jurisdiction;
8462
+ caseType = caseInfo.caseType;
8463
+ }
8464
+ if (!this.features || !this.features.configurations) {
8465
+ return false;
8466
+ }
8467
+ this.features.configurations.forEach(function (serviceConfig) {
8468
+ if (serviceConfig.serviceName === jurisdiction && (serviceConfig.caseTypes.indexOf(caseType) !== -1)) {
8469
+ enabled = true;
8470
+ }
8471
+ });
8472
+ return enabled;
8473
+ };
8474
+ /**
8475
+ * Call the API to assign a task.
8476
+ * @param taskId specifies which task should be assigned.
8477
+ * @param userId specifies the user the task should be assigned to.
8478
+ */
8479
+ WorkAllocationService.prototype.assignTask = function (taskId, userId) {
8480
+ var _this = this;
8481
+ if (!this.isWAEnabled()) {
8482
+ return rxjs.of(null);
8483
+ }
8484
+ var url = this.appConfig.getWorkAllocationApiUrl() + "/task/" + taskId + "/assign";
8485
+ return this.http
8486
+ .post(url, { userId: userId })
8487
+ .pipe(operators.catchError(function (error) {
8488
+ _this.errorService.setError(error);
8489
+ return rxjs.throwError(error);
8490
+ }));
8491
+ };
8492
+ /**
8493
+ * Call the API to complete a task.
8494
+ * @param taskId specifies which task should be completed.
8495
+ */
8496
+ WorkAllocationService.prototype.completeTask = function (taskId) {
8497
+ var _this = this;
8498
+ if (!this.isWAEnabled()) {
8499
+ return rxjs.of(null);
8500
+ }
8501
+ var url = this.appConfig.getWorkAllocationApiUrl() + "/task/" + taskId + "/complete";
8502
+ return this.http
8503
+ .post(url, {})
8504
+ .pipe(operators.catchError(function (error) {
8505
+ _this.errorService.setError(error);
8506
+ // this will subscribe to get the user details and decide whether to display an error message
8507
+ _this.http.get(_this.appConfig.getUserInfoApiUrl()).pipe(operators.map(function (response) { return response; })).subscribe(function (response) {
8508
+ _this.handleTaskCompletionError(response);
8509
+ });
8510
+ return rxjs.throwError(error);
8511
+ }));
8512
+ };
8513
+ /**
8514
+ * Call the API to assign and complete a task.
8515
+ * @param taskId specifies which task should be completed.
8516
+ */
8517
+ WorkAllocationService.prototype.assignAndCompleteTask = function (taskId) {
8518
+ var _this = this;
8519
+ if (!this.isWAEnabled()) {
8520
+ return rxjs.of(null);
8521
+ }
8522
+ var url = this.appConfig.getWorkAllocationApiUrl() + "/task/" + taskId + "/complete";
8523
+ return this.http
8524
+ .post(url, {
8525
+ completion_options: {
8526
+ assign_and_complete: true
8527
+ }
8528
+ })
8529
+ .pipe(operators.catchError(function (error) {
8530
+ _this.errorService.setError(error);
8531
+ // this will subscribe to get the user details and decide whether to display an error message
8532
+ _this.http.get(_this.appConfig.getUserInfoApiUrl()).pipe(operators.map(function (response) { return response; })).subscribe(function (response) {
8533
+ _this.handleTaskCompletionError(response);
8534
+ });
8535
+ return rxjs.throwError(error);
8536
+ }));
8537
+ };
8538
+ /**
8539
+ * Handles the response from the observable to get the user details when task is completed.
8540
+ * @param response is the response given from the observable which contains the user detaild.
8541
+ */
8542
+ WorkAllocationService.prototype.handleTaskCompletionError = function (response) {
8543
+ var userDetails = response;
8544
+ if (this.userIsCaseworker(userDetails.userInfo.roles)) {
8545
+ // when submitting the completion of task if not yet rendered cases/case confirm then preserve the alert for re-rendering
8546
+ this.alertService.setPreserveAlerts(true, ['cases/case', 'submit']);
8547
+ this.alertService.warning('A task could not be completed successfully. Please complete the task associated with the case manually.');
8548
+ }
8549
+ };
8550
+ /**
8551
+ * Returns true if the user's role is equivalent to a caseworker.
8552
+ * @param roles is the list of roles found from the current user.
8553
+ */
8554
+ WorkAllocationService.prototype.userIsCaseworker = function (roles) {
8555
+ var lowerCaseRoles = roles.map(function (role) { return role.toLowerCase(); });
8556
+ // When/if lib & target permanently change to es2016, replace indexOf with includes
8557
+ return (lowerCaseRoles.indexOf(WorkAllocationService.iACCaseOfficer) !== -1)
8558
+ || (lowerCaseRoles.indexOf(WorkAllocationService.iACAdmOfficer) !== -1);
8559
+ };
8560
+ /**
8561
+ * Look for open tasks for a case and event combination. There are 5 possible scenarios:
8562
+ * 1. No tasks found => Success.
8563
+ * 2. One task found => Mark as done => Success.
8564
+ * 3. One task found => Mark as done throws error => Failure.
8565
+ * 4. More than one task found => Failure.
8566
+ * 5. Search call throws an error => Failure.
8567
+ * @param ccdId The ID of the case to find tasks for.
8568
+ * @param eventId The ID of the event to find tasks for.
8569
+ */
8570
+ WorkAllocationService.prototype.completeAppropriateTask = function (ccdId, eventId, jurisdiction, caseTypeId) {
8571
+ var _this = this;
8572
+ if (!this.isWAEnabled(jurisdiction, caseTypeId)) {
8573
+ return rxjs.of(null);
8574
+ }
8575
+ var taskSearchParameter = {
8576
+ ccdId: ccdId,
8577
+ eventId: eventId,
8578
+ jurisdiction: jurisdiction,
8579
+ caseTypeId: caseTypeId
8580
+ };
8581
+ return this.searchTasks(taskSearchParameter)
8582
+ .pipe(operators.map(function (response) {
8583
+ var tasks = response.tasks;
8584
+ if (tasks && tasks.length > 0) {
8585
+ if (tasks.length === 1) {
8586
+ _this.completeTask(tasks[0].id).subscribe();
8587
+ }
8588
+ else {
8589
+ // This is a problem. Throw an appropriate error.
8590
+ throw new Error(MULTIPLE_TASKS_FOUND);
8591
+ }
8592
+ }
8593
+ return true; // All good. Nothing to see here.
8594
+ }), operators.catchError(function (error) {
8595
+ // Simply rethrow it.
8596
+ return rxjs.throwError(error);
8597
+ }));
8598
+ };
8599
+ /**
8600
+ * Return tasks for case and event.
8601
+ */
8602
+ WorkAllocationService.prototype.getTasksByCaseIdAndEventId = function (eventId, caseId, caseType, jurisdiction) {
8603
+ var defaultPayload = {
8604
+ task_required_for_event: false,
8605
+ tasks: []
8606
+ };
8607
+ if (!this.isWAEnabled()) {
8608
+ return rxjs.of(defaultPayload);
8609
+ }
8610
+ return this.http.get(this.appConfig.getWorkAllocationApiUrl() + "/case/tasks/" + caseId + "/event/" + eventId + "/caseType/" + caseType + "/jurisdiction/" + jurisdiction);
8611
+ };
8612
+ /**
8613
+ * Call the API to get a task
8614
+ */
8615
+ WorkAllocationService.prototype.getTask = function (taskId) {
8616
+ if (!this.isWAEnabled()) {
8617
+ return rxjs.of({ task: null });
8618
+ }
8619
+ return this.http.get(this.appConfig.getWorkAllocationApiUrl() + "/task/" + taskId);
8620
+ };
8621
+ return WorkAllocationService;
8622
+ }());
8623
+ WorkAllocationService.iACCaseOfficer = 'caseworker-ia-caseofficer';
8624
+ WorkAllocationService.iACAdmOfficer = 'caseworker-ia-admofficer';
8625
+ WorkAllocationService.ɵfac = function WorkAllocationService_Factory(t) { return new (t || WorkAllocationService)(i0__namespace.ɵɵinject(HttpService), i0__namespace.ɵɵinject(AbstractAppConfig), i0__namespace.ɵɵinject(HttpErrorService), i0__namespace.ɵɵinject(AlertService), i0__namespace.ɵɵinject(SessionStorageService)); };
8626
+ WorkAllocationService.ɵprov = i0__namespace.ɵɵdefineInjectable({ token: WorkAllocationService, factory: WorkAllocationService.ɵfac });
8627
+ (function () {
8628
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(WorkAllocationService, [{
8629
+ type: i0.Injectable
8630
+ }], function () { return [{ type: HttpService }, { type: AbstractAppConfig }, { type: HttpErrorService }, { type: AlertService }, { type: SessionStorageService }]; }, null);
8631
+ })();
8632
+
8406
8633
  var CasesService = /** @class */ (function () {
8407
- function CasesService(http, appConfig, orderService, errorService, wizardPageFieldToCaseFieldMapper, loadingService, sessionStorageService) {
8634
+ function CasesService(http, appConfig, orderService, errorService, wizardPageFieldToCaseFieldMapper, workAllocationService, loadingService, sessionStorageService) {
8408
8635
  this.http = http;
8409
8636
  this.appConfig = appConfig;
8410
8637
  this.orderService = orderService;
8411
8638
  this.errorService = errorService;
8412
8639
  this.wizardPageFieldToCaseFieldMapper = wizardPageFieldToCaseFieldMapper;
8640
+ this.workAllocationService = workAllocationService;
8413
8641
  this.loadingService = loadingService;
8414
8642
  this.sessionStorageService = sessionStorageService;
8415
8643
  this.get = this.getCaseView;
@@ -8644,12 +8872,12 @@
8644
8872
  CasesService.V2_MEDIATYPE_CREATE_EVENT = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.create-event.v2+json;charset=UTF-8';
8645
8873
  CasesService.V2_MEDIATYPE_CREATE_CASE = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.create-case.v2+json;charset=UTF-8';
8646
8874
  CasesService.PUI_CASE_MANAGER = 'pui-case-manager';
8647
- CasesService.ɵfac = function CasesService_Factory(t) { return new (t || CasesService)(i0__namespace.ɵɵinject(HttpService), i0__namespace.ɵɵinject(AbstractAppConfig), i0__namespace.ɵɵinject(OrderService), i0__namespace.ɵɵinject(HttpErrorService), i0__namespace.ɵɵinject(WizardPageFieldToCaseFieldMapper), i0__namespace.ɵɵinject(LoadingService), i0__namespace.ɵɵinject(SessionStorageService)); };
8875
+ CasesService.ɵfac = function CasesService_Factory(t) { return new (t || CasesService)(i0__namespace.ɵɵinject(HttpService), i0__namespace.ɵɵinject(AbstractAppConfig), i0__namespace.ɵɵinject(OrderService), i0__namespace.ɵɵinject(HttpErrorService), i0__namespace.ɵɵinject(WizardPageFieldToCaseFieldMapper), i0__namespace.ɵɵinject(WorkAllocationService), i0__namespace.ɵɵinject(LoadingService), i0__namespace.ɵɵinject(SessionStorageService)); };
8648
8876
  CasesService.ɵprov = i0__namespace.ɵɵdefineInjectable({ token: CasesService, factory: CasesService.ɵfac });
8649
8877
  (function () {
8650
8878
  (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(CasesService, [{
8651
8879
  type: i0.Injectable
8652
- }], function () { return [{ type: HttpService }, { type: AbstractAppConfig }, { type: OrderService }, { type: HttpErrorService }, { type: WizardPageFieldToCaseFieldMapper }, { type: LoadingService }, { type: SessionStorageService }]; }, null);
8880
+ }], function () { return [{ type: HttpService }, { type: AbstractAppConfig }, { type: OrderService }, { type: HttpErrorService }, { type: WizardPageFieldToCaseFieldMapper }, { type: WorkAllocationService }, { type: LoadingService }, { type: SessionStorageService }]; }, null);
8653
8881
  })();
8654
8882
 
8655
8883
  var EventTriggerService = /** @class */ (function () {
@@ -9303,215 +9531,6 @@
9303
9531
  }], function () { return [{ type: CaseFieldService }]; }, null);
9304
9532
  })();
9305
9533
 
9306
- var MULTIPLE_TASKS_FOUND = 'More than one task found!';
9307
- var WorkAllocationService = /** @class */ (function () {
9308
- function WorkAllocationService(http, appConfig, errorService, alertService, sessionStorageService) {
9309
- this.http = http;
9310
- this.appConfig = appConfig;
9311
- this.errorService = errorService;
9312
- this.alertService = alertService;
9313
- this.sessionStorageService = sessionStorageService;
9314
- // Check to see if work allocation is enabled
9315
- }
9316
- /**
9317
- * Call the API to get tasks matching the search criteria.
9318
- * @param searchRequest The search parameters that specify which tasks to match.
9319
- */
9320
- WorkAllocationService.prototype.searchTasks = function (searchRequest) {
9321
- var _this = this;
9322
- // Do not need to check if WA enabled as parent method will do that
9323
- var url = this.appConfig.getWorkAllocationApiUrl() + "/searchForCompletable";
9324
- return this.http
9325
- .post(url, { searchRequest: searchRequest }, null, false)
9326
- .pipe(operators.map(function (response) { return response; }), operators.catchError(function (error) {
9327
- _this.errorService.setError(error);
9328
- // explicitly eat away 401 error and 400 error
9329
- if (error && error.status && (error.status === 401 || error.status === 400)) {
9330
- // do nothing
9331
- console.log('error status 401 or 400', error);
9332
- }
9333
- else {
9334
- return rxjs.throwError(error);
9335
- }
9336
- }));
9337
- };
9338
- WorkAllocationService.prototype.isWAEnabled = function (jurisdiction, caseType) {
9339
- this.features = this.appConfig.getWAServiceConfig();
9340
- var enabled = false;
9341
- if (!jurisdiction || !caseType) {
9342
- var caseInfo = JSON.parse(this.sessionStorageService.getItem('caseInfo'));
9343
- jurisdiction = caseInfo.jurisdiction;
9344
- caseType = caseInfo.caseType;
9345
- }
9346
- if (!this.features || !this.features.configurations) {
9347
- return false;
9348
- }
9349
- this.features.configurations.forEach(function (serviceConfig) {
9350
- if (serviceConfig.serviceName === jurisdiction && (serviceConfig.caseTypes.indexOf(caseType) !== -1)) {
9351
- enabled = true;
9352
- }
9353
- });
9354
- return enabled;
9355
- };
9356
- /**
9357
- * Call the API to assign a task.
9358
- * @param taskId specifies which task should be assigned.
9359
- * @param userId specifies the user the task should be assigned to.
9360
- */
9361
- WorkAllocationService.prototype.assignTask = function (taskId, userId) {
9362
- var _this = this;
9363
- if (!this.isWAEnabled()) {
9364
- return rxjs.of(null);
9365
- }
9366
- var url = this.appConfig.getWorkAllocationApiUrl() + "/task/" + taskId + "/assign";
9367
- return this.http
9368
- .post(url, { userId: userId })
9369
- .pipe(operators.catchError(function (error) {
9370
- _this.errorService.setError(error);
9371
- return rxjs.throwError(error);
9372
- }));
9373
- };
9374
- /**
9375
- * Call the API to complete a task.
9376
- * @param taskId specifies which task should be completed.
9377
- */
9378
- WorkAllocationService.prototype.completeTask = function (taskId) {
9379
- var _this = this;
9380
- if (!this.isWAEnabled()) {
9381
- return rxjs.of(null);
9382
- }
9383
- var url = this.appConfig.getWorkAllocationApiUrl() + "/task/" + taskId + "/complete";
9384
- return this.http
9385
- .post(url, {})
9386
- .pipe(operators.catchError(function (error) {
9387
- _this.errorService.setError(error);
9388
- // this will subscribe to get the user details and decide whether to display an error message
9389
- _this.http.get(_this.appConfig.getUserInfoApiUrl()).pipe(operators.map(function (response) { return response; })).subscribe(function (response) {
9390
- _this.handleTaskCompletionError(response);
9391
- });
9392
- return rxjs.throwError(error);
9393
- }));
9394
- };
9395
- /**
9396
- * Call the API to assign and complete a task.
9397
- * @param taskId specifies which task should be completed.
9398
- */
9399
- WorkAllocationService.prototype.assignAndCompleteTask = function (taskId) {
9400
- var _this = this;
9401
- if (!this.isWAEnabled()) {
9402
- return rxjs.of(null);
9403
- }
9404
- var url = this.appConfig.getWorkAllocationApiUrl() + "/task/" + taskId + "/complete";
9405
- return this.http
9406
- .post(url, {
9407
- completion_options: {
9408
- assign_and_complete: true
9409
- }
9410
- })
9411
- .pipe(operators.catchError(function (error) {
9412
- _this.errorService.setError(error);
9413
- // this will subscribe to get the user details and decide whether to display an error message
9414
- _this.http.get(_this.appConfig.getUserInfoApiUrl()).pipe(operators.map(function (response) { return response; })).subscribe(function (response) {
9415
- _this.handleTaskCompletionError(response);
9416
- });
9417
- return rxjs.throwError(error);
9418
- }));
9419
- };
9420
- /**
9421
- * Handles the response from the observable to get the user details when task is completed.
9422
- * @param response is the response given from the observable which contains the user detaild.
9423
- */
9424
- WorkAllocationService.prototype.handleTaskCompletionError = function (response) {
9425
- var userDetails = response;
9426
- if (this.userIsCaseworker(userDetails.userInfo.roles)) {
9427
- // when submitting the completion of task if not yet rendered cases/case confirm then preserve the alert for re-rendering
9428
- this.alertService.setPreserveAlerts(true, ['cases/case', 'submit']);
9429
- this.alertService.warning('A task could not be completed successfully. Please complete the task associated with the case manually.');
9430
- }
9431
- };
9432
- /**
9433
- * Returns true if the user's role is equivalent to a caseworker.
9434
- * @param roles is the list of roles found from the current user.
9435
- */
9436
- WorkAllocationService.prototype.userIsCaseworker = function (roles) {
9437
- var lowerCaseRoles = roles.map(function (role) { return role.toLowerCase(); });
9438
- // When/if lib & target permanently change to es2016, replace indexOf with includes
9439
- return (lowerCaseRoles.indexOf(WorkAllocationService.iACCaseOfficer) !== -1)
9440
- || (lowerCaseRoles.indexOf(WorkAllocationService.iACAdmOfficer) !== -1);
9441
- };
9442
- /**
9443
- * Look for open tasks for a case and event combination. There are 5 possible scenarios:
9444
- * 1. No tasks found => Success.
9445
- * 2. One task found => Mark as done => Success.
9446
- * 3. One task found => Mark as done throws error => Failure.
9447
- * 4. More than one task found => Failure.
9448
- * 5. Search call throws an error => Failure.
9449
- * @param ccdId The ID of the case to find tasks for.
9450
- * @param eventId The ID of the event to find tasks for.
9451
- */
9452
- WorkAllocationService.prototype.completeAppropriateTask = function (ccdId, eventId, jurisdiction, caseTypeId) {
9453
- var _this = this;
9454
- if (!this.isWAEnabled(jurisdiction, caseTypeId)) {
9455
- return rxjs.of(null);
9456
- }
9457
- var taskSearchParameter = {
9458
- ccdId: ccdId,
9459
- eventId: eventId,
9460
- jurisdiction: jurisdiction,
9461
- caseTypeId: caseTypeId
9462
- };
9463
- return this.searchTasks(taskSearchParameter)
9464
- .pipe(operators.map(function (response) {
9465
- var tasks = response.tasks;
9466
- if (tasks && tasks.length > 0) {
9467
- if (tasks.length === 1) {
9468
- _this.completeTask(tasks[0].id).subscribe();
9469
- }
9470
- else {
9471
- // This is a problem. Throw an appropriate error.
9472
- throw new Error(MULTIPLE_TASKS_FOUND);
9473
- }
9474
- }
9475
- return true; // All good. Nothing to see here.
9476
- }), operators.catchError(function (error) {
9477
- // Simply rethrow it.
9478
- return rxjs.throwError(error);
9479
- }));
9480
- };
9481
- /**
9482
- * Return tasks for case and event.
9483
- */
9484
- WorkAllocationService.prototype.getTasksByCaseIdAndEventId = function (eventId, caseId, caseType, jurisdiction) {
9485
- var defaultPayload = {
9486
- task_required_for_event: false,
9487
- tasks: []
9488
- };
9489
- if (!this.isWAEnabled()) {
9490
- return rxjs.of(defaultPayload);
9491
- }
9492
- return this.http.get(this.appConfig.getWorkAllocationApiUrl() + "/case/tasks/" + caseId + "/event/" + eventId + "/caseType/" + caseType + "/jurisdiction/" + jurisdiction);
9493
- };
9494
- /**
9495
- * Call the API to get a task
9496
- */
9497
- WorkAllocationService.prototype.getTask = function (taskId) {
9498
- if (!this.isWAEnabled()) {
9499
- return rxjs.of({ task: null });
9500
- }
9501
- return this.http.get(this.appConfig.getWorkAllocationApiUrl() + "/task/" + taskId);
9502
- };
9503
- return WorkAllocationService;
9504
- }());
9505
- WorkAllocationService.iACCaseOfficer = 'caseworker-ia-caseofficer';
9506
- WorkAllocationService.iACAdmOfficer = 'caseworker-ia-admofficer';
9507
- WorkAllocationService.ɵfac = function WorkAllocationService_Factory(t) { return new (t || WorkAllocationService)(i0__namespace.ɵɵinject(HttpService), i0__namespace.ɵɵinject(AbstractAppConfig), i0__namespace.ɵɵinject(HttpErrorService), i0__namespace.ɵɵinject(AlertService), i0__namespace.ɵɵinject(SessionStorageService)); };
9508
- WorkAllocationService.ɵprov = i0__namespace.ɵɵdefineInjectable({ token: WorkAllocationService, factory: WorkAllocationService.ɵfac });
9509
- (function () {
9510
- (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(WorkAllocationService, [{
9511
- type: i0.Injectable
9512
- }], function () { return [{ type: HttpService }, { type: AbstractAppConfig }, { type: HttpErrorService }, { type: AlertService }, { type: SessionStorageService }]; }, null);
9513
- })();
9514
-
9515
9534
  var CaseEditComponent = /** @class */ (function () {
9516
9535
  function CaseEditComponent(fb, router, route, fieldsUtils, fieldsPurger, registrarService, wizardFactory, sessionStorageService, windowsService) {
9517
9536
  this.fb = fb;
@@ -11011,7 +11030,7 @@
11011
11030
  return AddressOption;
11012
11031
  }());
11013
11032
 
11014
- var _c0$R = ["writeComplexFieldComponent"];
11033
+ var _c0$S = ["writeComplexFieldComponent"];
11015
11034
  function WriteAddressFieldComponent_div_1_div_4_span_4_Template(rf, ctx) {
11016
11035
  if (rf & 1) {
11017
11036
  i0__namespace.ɵɵelementStart(0, "span", 14);
@@ -11225,7 +11244,7 @@
11225
11244
  WriteAddressFieldComponent.ɵfac = function WriteAddressFieldComponent_Factory(t) { return new (t || WriteAddressFieldComponent)(i0__namespace.ɵɵdirectiveInject(AddressesService), i0__namespace.ɵɵdirectiveInject(IsCompoundPipe)); };
11226
11245
  WriteAddressFieldComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: WriteAddressFieldComponent, selectors: [["ccd-write-address-field"]], viewQuery: function WriteAddressFieldComponent_Query(rf, ctx) {
11227
11246
  if (rf & 1) {
11228
- i0__namespace.ɵɵviewQuery(_c0$R, 1);
11247
+ i0__namespace.ɵɵviewQuery(_c0$S, 1);
11229
11248
  i0__namespace.ɵɵviewQuery(FocusElementDirective, 1);
11230
11249
  }
11231
11250
  if (rf & 2) {
@@ -11897,7 +11916,7 @@
11897
11916
  i0__namespace.ɵɵproperty("formGroup", ctx_r10.caseFlagParentFormGroup)("optional", ctx_r10.flagCommentsOptional);
11898
11917
  }
11899
11918
  }
11900
- var _c0$Q = function (a0) { return { "form-group-error": a0 }; };
11919
+ var _c0$R = function (a0) { return { "form-group-error": a0 }; };
11901
11920
  function WriteCaseFlagFieldComponent_div_1_Template(rf, ctx) {
11902
11921
  if (rf & 1) {
11903
11922
  i0__namespace.ɵɵelementStart(0, "div", 8);
@@ -11918,7 +11937,7 @@
11918
11937
  i0__namespace.ɵɵadvance(1);
11919
11938
  i0__namespace.ɵɵproperty("ngSwitch", ctx_r1.fieldState);
11920
11939
  i0__namespace.ɵɵadvance(1);
11921
- i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(8, _c0$Q, ctx_r1.errorMessages.length > 0));
11940
+ i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(8, _c0$R, ctx_r1.errorMessages.length > 0));
11922
11941
  i0__namespace.ɵɵadvance(1);
11923
11942
  i0__namespace.ɵɵtextInterpolate1(" ", ctx_r1.createFlagCaption, " ");
11924
11943
  i0__namespace.ɵɵadvance(1);
@@ -12394,7 +12413,7 @@
12394
12413
  }], null, null);
12395
12414
  })();
12396
12415
 
12397
- var _c0$P = ["writeComplexFieldComponent"];
12416
+ var _c0$Q = ["writeComplexFieldComponent"];
12398
12417
  function WriteCaseLinkFieldComponent_span_2_Template(rf, ctx) {
12399
12418
  if (rf & 1) {
12400
12419
  i0__namespace.ɵɵelementStart(0, "span", 6);
@@ -12499,7 +12518,7 @@
12499
12518
  WriteCaseLinkFieldComponent.ɵfac = function WriteCaseLinkFieldComponent_Factory(t) { return ɵWriteCaseLinkFieldComponent_BaseFactory(t || WriteCaseLinkFieldComponent); };
12500
12519
  WriteCaseLinkFieldComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: WriteCaseLinkFieldComponent, selectors: [["ccd-write-case-link-field"]], viewQuery: function WriteCaseLinkFieldComponent_Query(rf, ctx) {
12501
12520
  if (rf & 1) {
12502
- i0__namespace.ɵɵviewQuery(_c0$P, 1);
12521
+ i0__namespace.ɵɵviewQuery(_c0$Q, 1);
12503
12522
  }
12504
12523
  if (rf & 2) {
12505
12524
  var _t = void 0;
@@ -12544,7 +12563,7 @@
12544
12563
  }] });
12545
12564
  })();
12546
12565
 
12547
- var _c0$O = function (a0, a1, a2, a3, a4, a5) { return { id: a0, label: a1, field_type: a2, display_context_parameter: a3, value: a4, hidden: a5 }; };
12566
+ var _c0$P = function (a0, a1, a2, a3, a4, a5) { return { id: a0, label: a1, field_type: a2, display_context_parameter: a3, value: a4, hidden: a5 }; };
12548
12567
  function ReadCollectionFieldComponent_table_0_tbody_2_Template(rf, ctx) {
12549
12568
  if (rf & 1) {
12550
12569
  i0__namespace.ɵɵelementStart(0, "tbody");
@@ -12559,7 +12578,7 @@
12559
12578
  if (rf & 2) {
12560
12579
  var ctx_r1 = i0__namespace.ɵɵnextContext(2);
12561
12580
  i0__namespace.ɵɵadvance(4);
12562
- i0__namespace.ɵɵproperty("caseField", i0__namespace.ɵɵpureFunction6(3, _c0$O, 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);
12581
+ i0__namespace.ɵɵproperty("caseField", i0__namespace.ɵɵpureFunction6(3, _c0$P, 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);
12563
12582
  }
12564
12583
  }
12565
12584
  var _c1$k = function (a0, a1, a2, a3, a4) { return { id: a0, label: a1, field_type: a2, value: a3, hidden: a4 }; };
@@ -12710,7 +12729,7 @@
12710
12729
  }], function () { return [{ type: i1__namespace$3.MatDialogRef }]; }, null);
12711
12730
  })();
12712
12731
 
12713
- var _c0$N = ["collectionItem"];
12732
+ var _c0$O = ["collectionItem"];
12714
12733
  function WriteCollectionFieldComponent_h2_7_span_1_Template(rf, ctx) {
12715
12734
  if (rf & 1) {
12716
12735
  i0__namespace.ɵɵelementStart(0, "span", 9);
@@ -12952,6 +12971,11 @@
12952
12971
  // Manually resetting errors is required to prevent `ExpressionChangedAfterItHasBeenCheckedError`
12953
12972
  this.formArray.setErrors(null);
12954
12973
  var item = { value: null };
12974
+ if (this.isCollectionDynamic()) {
12975
+ item = Object.assign({}, this.caseField.value[this.caseField.value.length - 1]);
12976
+ var key = Number(item['id'][item['id'].length - 1]) + 1;
12977
+ item.id = item['id'].replace(/.$/, key.toString());
12978
+ }
12955
12979
  this.caseField.value.push(item);
12956
12980
  var index = this.caseField.value.length - 1;
12957
12981
  var caseField = this.buildCaseField(item, index, true);
@@ -12974,6 +12998,12 @@
12974
12998
  setTimeout(function () { return _this.focusLastItem(); });
12975
12999
  }
12976
13000
  };
13001
+ WriteCollectionFieldComponent.prototype.isCollectionDynamic = function () {
13002
+ if (!this.caseField.field_type || !this.caseField.field_type.collection_field_type) {
13003
+ return false;
13004
+ }
13005
+ return this.caseField.field_type.collection_field_type.id === 'DynamicRadioList';
13006
+ };
12977
13007
  WriteCollectionFieldComponent.prototype.newCaseField = function (id, item, index, isNew) {
12978
13008
  if (isNew === void 0) { isNew = false; }
12979
13009
  var isNotAuthorisedToUpdate = !isNew && this.isNotAuthorisedToUpdate(index);
@@ -13123,7 +13153,7 @@
13123
13153
  WriteCollectionFieldComponent.ɵfac = function WriteCollectionFieldComponent_Factory(t) { return new (t || WriteCollectionFieldComponent)(i0__namespace.ɵɵdirectiveInject(i1__namespace$3.MatDialog), i0__namespace.ɵɵdirectiveInject(i2__namespace$1.ScrollToService), i0__namespace.ɵɵdirectiveInject(ProfileNotifier)); };
13124
13154
  WriteCollectionFieldComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: WriteCollectionFieldComponent, selectors: [["ccd-write-collection-field"]], viewQuery: function WriteCollectionFieldComponent_Query(rf, ctx) {
13125
13155
  if (rf & 1) {
13126
- i0__namespace.ɵɵviewQuery(_c0$N, 1);
13156
+ i0__namespace.ɵɵviewQuery(_c0$O, 1);
13127
13157
  }
13128
13158
  if (rf & 2) {
13129
13159
  var _t = void 0;
@@ -13817,7 +13847,7 @@
13817
13847
  }], null, null);
13818
13848
  })();
13819
13849
 
13820
- var _c0$M = ["fileInput"];
13850
+ var _c0$N = ["fileInput"];
13821
13851
  function WriteDocumentFieldComponent_span_6_Template(rf, ctx) {
13822
13852
  if (rf & 1) {
13823
13853
  i0__namespace.ɵɵelementStart(0, "span", 12);
@@ -14111,7 +14141,7 @@
14111
14141
  WriteDocumentFieldComponent.ɵfac = function WriteDocumentFieldComponent_Factory(t) { return new (t || WriteDocumentFieldComponent)(i0__namespace.ɵɵdirectiveInject(AbstractAppConfig), i0__namespace.ɵɵdirectiveInject(CaseNotifier), i0__namespace.ɵɵdirectiveInject(DocumentManagementService), i0__namespace.ɵɵdirectiveInject(i1__namespace$3.MatDialog), i0__namespace.ɵɵdirectiveInject(FileUploadStateService)); };
14112
14142
  WriteDocumentFieldComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: WriteDocumentFieldComponent, selectors: [["ccd-write-document-field"]], viewQuery: function WriteDocumentFieldComponent_Query(rf, ctx) {
14113
14143
  if (rf & 1) {
14114
- i0__namespace.ɵɵviewQuery(_c0$M, 1);
14144
+ i0__namespace.ɵɵviewQuery(_c0$N, 1);
14115
14145
  }
14116
14146
  if (rf & 2) {
14117
14147
  var _t = void 0;
@@ -14311,7 +14341,7 @@
14311
14341
  i0__namespace.ɵɵtextInterpolate(type_r5.label);
14312
14342
  }
14313
14343
  }
14314
- var _c0$L = function (a0) { return { "form-group-error": a0 }; };
14344
+ var _c0$M = function (a0) { return { "form-group-error": a0 }; };
14315
14345
  var WriteDynamicListFieldComponent = /** @class */ (function (_super) {
14316
14346
  __extends(WriteDynamicListFieldComponent, _super);
14317
14347
  function WriteDynamicListFieldComponent() {
@@ -14360,7 +14390,7 @@
14360
14390
  i0__namespace.ɵɵelementEnd();
14361
14391
  }
14362
14392
  if (rf & 2) {
14363
- i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(10, _c0$L, !ctx.dynamicListFormControl.valid && (ctx.dynamicListFormControl.dirty || ctx.dynamicListFormControl.touched)));
14393
+ i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(10, _c0$M, !ctx.dynamicListFormControl.valid && (ctx.dynamicListFormControl.dirty || ctx.dynamicListFormControl.touched)));
14364
14394
  i0__namespace.ɵɵadvance(1);
14365
14395
  i0__namespace.ɵɵproperty("for", ctx.id());
14366
14396
  i0__namespace.ɵɵadvance(1);
@@ -14510,7 +14540,7 @@
14510
14540
  i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind1(2, 1, ctx_r3.dynamicRadioListControl.errors));
14511
14541
  }
14512
14542
  }
14513
- var _c0$K = function (a0) { return { selected: a0 }; };
14543
+ var _c0$L = function (a0) { return { selected: a0 }; };
14514
14544
  function WriteDynamicRadioListFieldComponent_div_9_Template(rf, ctx) {
14515
14545
  if (rf & 1) {
14516
14546
  i0__namespace.ɵɵelementStart(0, "div", 10);
@@ -14523,12 +14553,11 @@
14523
14553
  if (rf & 2) {
14524
14554
  var radioButton_r5 = ctx.$implicit;
14525
14555
  var ctx_r4 = i0__namespace.ɵɵnextContext();
14526
- i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(7, _c0$K, ctx_r4.dynamicRadioListControl.value === radioButton_r5.code));
14556
+ i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(7, _c0$L, ctx_r4.dynamicRadioListControl.value === radioButton_r5.code));
14527
14557
  i0__namespace.ɵɵadvance(1);
14528
- i0__namespace.ɵɵpropertyInterpolate("name", ctx_r4.id());
14529
- i0__namespace.ɵɵproperty("id", ctx_r4.buildElementId(radioButton_r5.code))("formControl", ctx_r4.dynamicRadioListControl)("value", radioButton_r5.code);
14558
+ i0__namespace.ɵɵproperty("id", ctx_r4.createElementId(radioButton_r5.code))("name", ctx_r4.createElementId(radioButton_r5.code))("formControl", ctx_r4.dynamicRadioListControl)("value", radioButton_r5.code);
14530
14559
  i0__namespace.ɵɵadvance(1);
14531
- i0__namespace.ɵɵproperty("for", ctx_r4.buildElementId(radioButton_r5.code));
14560
+ i0__namespace.ɵɵproperty("for", ctx_r4.createElementId(radioButton_r5.code));
14532
14561
  i0__namespace.ɵɵadvance(1);
14533
14562
  i0__namespace.ɵɵtextInterpolate(radioButton_r5.label);
14534
14563
  }
@@ -14557,8 +14586,8 @@
14557
14586
  this.dynamicRadioListControl = this.registerControl(new i2.FormControl(this.caseField.value));
14558
14587
  this.dynamicRadioListControl.setValue(this.caseField.value);
14559
14588
  };
14560
- WriteDynamicRadioListFieldComponent.prototype.buildElementId = function (name) {
14561
- return this.id() + "-" + name;
14589
+ WriteDynamicRadioListFieldComponent.prototype.createElementId = function (name) {
14590
+ return this.parent && this.parent.value ? this.parent.value.id + this.parent.value.value : _super.prototype.createElementId.call(this, name);
14562
14591
  };
14563
14592
  return WriteDynamicRadioListFieldComponent;
14564
14593
  }(AbstractFieldWriteComponent));
@@ -14688,7 +14717,7 @@
14688
14717
  i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind2(2, 1, ctx_r2.emailControl.errors, ctx_r2.caseField.label));
14689
14718
  }
14690
14719
  }
14691
- var _c0$J = function (a0) { return { "form-group-error": a0 }; };
14720
+ var _c0$K = function (a0) { return { "form-group-error": a0 }; };
14692
14721
  var _c1$h = function (a0) { return { "govuk-input--error": a0 }; };
14693
14722
  var WriteEmailFieldComponent = /** @class */ (function (_super) {
14694
14723
  __extends(WriteEmailFieldComponent, _super);
@@ -14713,7 +14742,7 @@
14713
14742
  i0__namespace.ɵɵelementEnd();
14714
14743
  }
14715
14744
  if (rf & 2) {
14716
- i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(8, _c0$J, !ctx.emailControl.valid && (ctx.emailControl.dirty || ctx.emailControl.touched)));
14745
+ i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(8, _c0$K, !ctx.emailControl.valid && (ctx.emailControl.dirty || ctx.emailControl.touched)));
14717
14746
  i0__namespace.ɵɵadvance(1);
14718
14747
  i0__namespace.ɵɵproperty("for", ctx.id());
14719
14748
  i0__namespace.ɵɵadvance(1);
@@ -14845,7 +14874,7 @@
14845
14874
  i0__namespace.ɵɵtextInterpolate(type_r4.label);
14846
14875
  }
14847
14876
  }
14848
- var _c0$I = function (a0) { return { "form-group-error": a0 }; };
14877
+ var _c0$J = function (a0) { return { "form-group-error": a0 }; };
14849
14878
  var WriteFixedListFieldComponent = /** @class */ (function (_super) {
14850
14879
  __extends(WriteFixedListFieldComponent, _super);
14851
14880
  function WriteFixedListFieldComponent() {
@@ -14894,7 +14923,7 @@
14894
14923
  i0__namespace.ɵɵelementEnd();
14895
14924
  }
14896
14925
  if (rf & 2) {
14897
- i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(9, _c0$I, !ctx.fixedListFormControl.valid && (ctx.fixedListFormControl.dirty || ctx.fixedListFormControl.touched)));
14926
+ i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(9, _c0$J, !ctx.fixedListFormControl.valid && (ctx.fixedListFormControl.dirty || ctx.fixedListFormControl.touched)));
14898
14927
  i0__namespace.ɵɵadvance(1);
14899
14928
  i0__namespace.ɵɵproperty("for", ctx.id());
14900
14929
  i0__namespace.ɵɵadvance(1);
@@ -15012,7 +15041,7 @@
15012
15041
  i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind2(2, 1, ctx_r2.fixedRadioListControl.errors, ctx_r2.caseField.label));
15013
15042
  }
15014
15043
  }
15015
- var _c0$H = function (a0) { return { selected: a0 }; };
15044
+ var _c0$I = function (a0) { return { selected: a0 }; };
15016
15045
  function WriteFixedRadioListFieldComponent_div_8_Template(rf, ctx) {
15017
15046
  if (rf & 1) {
15018
15047
  i0__namespace.ɵɵelementStart(0, "div", 9);
@@ -15025,7 +15054,7 @@
15025
15054
  if (rf & 2) {
15026
15055
  var radioButton_r4 = ctx.$implicit;
15027
15056
  var ctx_r3 = i0__namespace.ɵɵnextContext();
15028
- i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(7, _c0$H, ctx_r3.fixedRadioListControl.value === radioButton_r4.code));
15057
+ i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(7, _c0$I, ctx_r3.fixedRadioListControl.value === radioButton_r4.code));
15029
15058
  i0__namespace.ɵɵadvance(1);
15030
15059
  i0__namespace.ɵɵproperty("id", ctx_r3.id() + "-" + radioButton_r4.code)("name", ctx_r3.id())("formControl", ctx_r3.fixedRadioListControl)("value", radioButton_r4.code);
15031
15060
  i0__namespace.ɵɵadvance(1);
@@ -15195,7 +15224,7 @@
15195
15224
  i0__namespace.ɵɵtextInterpolate1(" ", ctx_r1.caseField.hint_text, " ");
15196
15225
  }
15197
15226
  }
15198
- var _c0$G = function (a0) { return { "hide-autocomplete": a0 }; };
15227
+ var _c0$H = function (a0) { return { "hide-autocomplete": a0 }; };
15199
15228
  function WriteJudicialUserFieldComponent_mat_option_7_Template(rf, ctx) {
15200
15229
  if (rf & 1) {
15201
15230
  var _r7_1 = i0__namespace.ɵɵgetCurrentView();
@@ -15207,7 +15236,7 @@
15207
15236
  if (rf & 2) {
15208
15237
  var judicialUser_r5 = ctx.$implicit;
15209
15238
  var ctx_r3 = i0__namespace.ɵɵnextContext();
15210
- i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(4, _c0$G, !ctx_r3.showAutocomplete))("value", judicialUser_r5.idamId);
15239
+ i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(4, _c0$H, !ctx_r3.showAutocomplete))("value", judicialUser_r5.idamId);
15211
15240
  i0__namespace.ɵɵadvance(1);
15212
15241
  i0__namespace.ɵɵtextInterpolate2(" ", judicialUser_r5.fullName, " (", judicialUser_r5.emailId, ") ");
15213
15242
  }
@@ -15997,7 +16026,7 @@
15997
16026
  i0__namespace.ɵɵtextInterpolate1(" ", ctx_r13.caseReasonCommentsError, " ");
15998
16027
  }
15999
16028
  }
16000
- var _c0$F = function (a0) { return { "govuk-form-group--error": a0 }; };
16029
+ var _c0$G = function (a0) { return { "govuk-form-group--error": a0 }; };
16001
16030
  function LinkCasesComponent_div_8_div_14_Template(rf, ctx) {
16002
16031
  if (rf & 1) {
16003
16032
  i0__namespace.ɵɵelementStart(0, "div", 35);
@@ -16015,7 +16044,7 @@
16015
16044
  }
16016
16045
  if (rf & 2) {
16017
16046
  var ctx_r7 = i0__namespace.ɵɵnextContext(2);
16018
- i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(2, _c0$F, !!ctx_r7.caseReasonCommentsError));
16047
+ i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(2, _c0$G, !!ctx_r7.caseReasonCommentsError));
16019
16048
  i0__namespace.ɵɵadvance(3);
16020
16049
  i0__namespace.ɵɵproperty("ngIf", ctx_r7.caseReasonCommentsError);
16021
16050
  }
@@ -16072,11 +16101,11 @@
16072
16101
  var ctx_r0 = i0__namespace.ɵɵnextContext();
16073
16102
  i0__namespace.ɵɵproperty("formGroup", ctx_r0.linkCaseForm);
16074
16103
  i0__namespace.ɵɵadvance(1);
16075
- i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(8, _c0$F, !!ctx_r0.caseNumberError));
16104
+ i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(8, _c0$G, !!ctx_r0.caseNumberError));
16076
16105
  i0__namespace.ɵɵadvance(3);
16077
16106
  i0__namespace.ɵɵproperty("ngIf", ctx_r0.caseNumberError);
16078
16107
  i0__namespace.ɵɵadvance(2);
16079
- i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(10, _c0$F, !!ctx_r0.caseReasonError));
16108
+ i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(10, _c0$G, !!ctx_r0.caseReasonError));
16080
16109
  i0__namespace.ɵɵadvance(5);
16081
16110
  i0__namespace.ɵɵproperty("ngIf", ctx_r0.caseReasonError);
16082
16111
  i0__namespace.ɵɵadvance(2);
@@ -16510,7 +16539,7 @@
16510
16539
  i0__namespace.ɵɵadvance(4);
16511
16540
  i0__namespace.ɵɵproperty("ngIf", ctx.linkCaseForm);
16512
16541
  i0__namespace.ɵɵadvance(4);
16513
- i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(9, _c0$F, !!ctx.noSelectedCaseError));
16542
+ i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(9, _c0$G, !!ctx.noSelectedCaseError));
16514
16543
  i0__namespace.ɵɵadvance(1);
16515
16544
  i0__namespace.ɵɵproperty("ngIf", ctx.noSelectedCaseError);
16516
16545
  i0__namespace.ɵɵadvance(18);
@@ -17194,7 +17223,7 @@
17194
17223
  i0__namespace.ɵɵtextInterpolate2(" ", case_r4.caseName, " ", i0__namespace.ɵɵpipeBind1(4, 6, case_r4.caseReference), " ");
17195
17224
  }
17196
17225
  }
17197
- var _c0$E = function (a0) { return { "govuk-form-group--error": a0 }; };
17226
+ var _c0$F = function (a0) { return { "govuk-form-group--error": a0 }; };
17198
17227
  function UnLinkCasesComponent_div_0_div_4_Template(rf, ctx) {
17199
17228
  if (rf & 1) {
17200
17229
  i0__namespace.ɵɵelementStart(0, "div", 7);
@@ -17206,7 +17235,7 @@
17206
17235
  }
17207
17236
  if (rf & 2) {
17208
17237
  var ctx_r1 = i0__namespace.ɵɵnextContext(2);
17209
- i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(4, _c0$E, ctx_r1.unlinkErrorMessage))("formGroup", ctx_r1.unlinkCaseForm);
17238
+ i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(4, _c0$F, ctx_r1.unlinkErrorMessage))("formGroup", ctx_r1.unlinkCaseForm);
17210
17239
  i0__namespace.ɵɵadvance(1);
17211
17240
  i0__namespace.ɵɵproperty("ngIf", ctx_r1.unlinkErrorMessage);
17212
17241
  i0__namespace.ɵɵadvance(2);
@@ -18148,7 +18177,7 @@
18148
18177
  i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind2(2, 1, ctx_r2.moneyGbpControl.errors, ctx_r2.caseField.label));
18149
18178
  }
18150
18179
  }
18151
- var _c0$D = function (a0) { return { "form-group-error": a0 }; };
18180
+ var _c0$E = function (a0) { return { "form-group-error": a0 }; };
18152
18181
  var WriteMoneyGbpFieldComponent = /** @class */ (function (_super) {
18153
18182
  __extends(WriteMoneyGbpFieldComponent, _super);
18154
18183
  function WriteMoneyGbpFieldComponent() {
@@ -18178,7 +18207,7 @@
18178
18207
  i0__namespace.ɵɵelementEnd();
18179
18208
  }
18180
18209
  if (rf & 2) {
18181
- i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(11, _c0$D, !ctx.moneyGbpControl.valid && (ctx.moneyGbpControl.dirty || ctx.moneyGbpControl.touched)));
18210
+ i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(11, _c0$E, !ctx.moneyGbpControl.valid && (ctx.moneyGbpControl.dirty || ctx.moneyGbpControl.touched)));
18182
18211
  i0__namespace.ɵɵadvance(1);
18183
18212
  i0__namespace.ɵɵproperty("for", ctx.id());
18184
18213
  i0__namespace.ɵɵadvance(1);
@@ -18326,7 +18355,7 @@
18326
18355
  i0__namespace.ɵɵtextInterpolate(checkbox_r4.label);
18327
18356
  }
18328
18357
  }
18329
- var _c0$C = function (a0) { return { "error": a0 }; };
18358
+ var _c0$D = function (a0) { return { "error": a0 }; };
18330
18359
  var WriteMultiSelectListFieldComponent = /** @class */ (function (_super) {
18331
18360
  __extends(WriteMultiSelectListFieldComponent, _super);
18332
18361
  function WriteMultiSelectListFieldComponent() {
@@ -18390,7 +18419,7 @@
18390
18419
  i0__namespace.ɵɵelementEnd();
18391
18420
  }
18392
18421
  if (rf & 2) {
18393
- i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(6, _c0$C, !ctx.checkboxes.valid && (ctx.checkboxes.dirty || ctx.checkboxes.touched)))("id", ctx.id());
18422
+ i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(6, _c0$D, !ctx.checkboxes.valid && (ctx.checkboxes.dirty || ctx.checkboxes.touched)))("id", ctx.id());
18394
18423
  i0__namespace.ɵɵadvance(3);
18395
18424
  i0__namespace.ɵɵproperty("ngIf", ctx.caseField.label);
18396
18425
  i0__namespace.ɵɵadvance(1);
@@ -18481,7 +18510,7 @@
18481
18510
  i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind2(2, 1, ctx_r2.numberControl.errors, ctx_r2.caseField.label));
18482
18511
  }
18483
18512
  }
18484
- var _c0$B = function (a0) { return { "form-group-error": a0 }; };
18513
+ var _c0$C = function (a0) { return { "form-group-error": a0 }; };
18485
18514
  var _c1$e = function (a0) { return { "govuk-input--error": a0 }; };
18486
18515
  var WriteNumberFieldComponent = /** @class */ (function (_super) {
18487
18516
  __extends(WriteNumberFieldComponent, _super);
@@ -18506,7 +18535,7 @@
18506
18535
  i0__namespace.ɵɵelementEnd();
18507
18536
  }
18508
18537
  if (rf & 2) {
18509
- i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(8, _c0$B, !ctx.numberControl.valid && ctx.numberControl.dirty));
18538
+ i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(8, _c0$C, !ctx.numberControl.valid && ctx.numberControl.dirty));
18510
18539
  i0__namespace.ɵɵadvance(1);
18511
18540
  i0__namespace.ɵɵproperty("for", ctx.id());
18512
18541
  i0__namespace.ɵɵadvance(1);
@@ -18807,7 +18836,7 @@
18807
18836
  i0__namespace.ɵɵelementEnd();
18808
18837
  }
18809
18838
  }
18810
- var _c0$A = function (a0) { return { "scroll-container ": a0 }; };
18839
+ var _c0$B = function (a0) { return { "scroll-container ": a0 }; };
18811
18840
  function WriteOrganisationFieldComponent_fieldset_3_div_14_Template(rf, ctx) {
18812
18841
  if (rf & 1) {
18813
18842
  i0__namespace.ɵɵelementStart(0, "div", 26);
@@ -18823,7 +18852,7 @@
18823
18852
  var ctx_r2 = i0__namespace.ɵɵnextContext(2);
18824
18853
  var tmp_0_0 = null;
18825
18854
  var tmp_2_0 = null;
18826
- i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(11, _c0$A, ((tmp_0_0 = i0__namespace.ɵɵpipeBind1(1, 3, ctx_r2.simpleOrganisations$)) == null ? null : tmp_0_0.length) > 10));
18855
+ i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(11, _c0$B, ((tmp_0_0 = i0__namespace.ɵɵpipeBind1(1, 3, ctx_r2.simpleOrganisations$)) == null ? null : tmp_0_0.length) > 10));
18827
18856
  i0__namespace.ɵɵadvance(2);
18828
18857
  i0__namespace.ɵɵproperty("ngForOf", i0__namespace.ɵɵpipeBind1(3, 5, ctx_r2.simpleOrganisations$));
18829
18858
  i0__namespace.ɵɵadvance(2);
@@ -19227,6 +19256,231 @@
19227
19256
  }], function () { return [{ type: AbstractAppConfig }, { type: SessionStorageService }]; }, null);
19228
19257
  })();
19229
19258
 
19259
+ function ReadDynamicMultiSelectListFieldComponent_div_0_Template(rf, ctx) {
19260
+ if (rf & 1) {
19261
+ i0__namespace.ɵɵelementStart(0, "div");
19262
+ i0__namespace.ɵɵtext(1);
19263
+ i0__namespace.ɵɵpipe(2, "ccdFixedList");
19264
+ i0__namespace.ɵɵelementEnd();
19265
+ }
19266
+ if (rf & 2) {
19267
+ var value_r1 = ctx.$implicit;
19268
+ var ctx_r0 = i0__namespace.ɵɵnextContext();
19269
+ i0__namespace.ɵɵadvance(1);
19270
+ i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind2(2, 1, value_r1.code, ctx_r0.caseField.list_items), "\n");
19271
+ }
19272
+ }
19273
+ var ReadDynamicMultiSelectListFieldComponent = /** @class */ (function (_super) {
19274
+ __extends(ReadDynamicMultiSelectListFieldComponent, _super);
19275
+ function ReadDynamicMultiSelectListFieldComponent() {
19276
+ return _super !== null && _super.apply(this, arguments) || this;
19277
+ }
19278
+ ReadDynamicMultiSelectListFieldComponent.prototype.ngOnInit = function () {
19279
+ /**
19280
+ *
19281
+ * Reassigning list_items from formatted_list when list_items is empty
19282
+ */
19283
+ if (!this.caseField.list_items && this.caseField.formatted_value && this.caseField.formatted_value.list_items) {
19284
+ this.caseField.list_items = this.caseField.formatted_value.list_items;
19285
+ }
19286
+ if (!this.caseField.value && this.caseField.formatted_value && this.caseField.formatted_value.value) {
19287
+ this.caseField.value = this.caseField.formatted_value.value;
19288
+ }
19289
+ _super.prototype.ngOnInit.call(this);
19290
+ };
19291
+ return ReadDynamicMultiSelectListFieldComponent;
19292
+ }(AbstractFieldReadComponent));
19293
+ ReadDynamicMultiSelectListFieldComponent.ɵfac = function ReadDynamicMultiSelectListFieldComponent_Factory(t) { return ɵReadDynamicMultiSelectListFieldComponent_BaseFactory(t || ReadDynamicMultiSelectListFieldComponent); };
19294
+ ReadDynamicMultiSelectListFieldComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: ReadDynamicMultiSelectListFieldComponent, selectors: [["ccd-read-dynamic-multi-select-list-field"]], features: [i0__namespace.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [[4, "ngFor", "ngForOf"]], template: function ReadDynamicMultiSelectListFieldComponent_Template(rf, ctx) {
19295
+ if (rf & 1) {
19296
+ i0__namespace.ɵɵtemplate(0, ReadDynamicMultiSelectListFieldComponent_div_0_Template, 3, 4, "div", 0);
19297
+ }
19298
+ if (rf & 2) {
19299
+ i0__namespace.ɵɵproperty("ngForOf", ctx.caseField.value);
19300
+ }
19301
+ }, directives: [i1__namespace.NgForOf], pipes: [FixedListPipe], styles: [".multi-select-list-field-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{padding:5px 0}.multi-select-list-field-table[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child > td[_ngcontent-%COMP%]{border-bottom:none}.multi-select-list-field-table[_ngcontent-%COMP%] td.collection-actions[_ngcontent-%COMP%]{width:1px;white-space:nowrap}"] });
19302
+ var ɵReadDynamicMultiSelectListFieldComponent_BaseFactory = /*@__PURE__*/ i0__namespace.ɵɵgetInheritedFactory(ReadDynamicMultiSelectListFieldComponent);
19303
+ (function () {
19304
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(ReadDynamicMultiSelectListFieldComponent, [{
19305
+ type: i0.Component,
19306
+ args: [{
19307
+ selector: 'ccd-read-dynamic-multi-select-list-field',
19308
+ templateUrl: './read-dynamic-multi-select-list-field.html',
19309
+ styleUrls: ['./read-dynamic-multi-select-list-field.component.scss']
19310
+ }]
19311
+ }], null, null);
19312
+ })();
19313
+
19314
+ function WriteDynamicMultiSelectListFieldComponent_span_3_Template(rf, ctx) {
19315
+ if (rf & 1) {
19316
+ i0__namespace.ɵɵelementStart(0, "span", 5);
19317
+ i0__namespace.ɵɵtext(1);
19318
+ i0__namespace.ɵɵpipe(2, "ccdFieldLabel");
19319
+ i0__namespace.ɵɵelementEnd();
19320
+ }
19321
+ if (rf & 2) {
19322
+ var ctx_r0 = i0__namespace.ɵɵnextContext();
19323
+ i0__namespace.ɵɵadvance(1);
19324
+ i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind1(2, 1, ctx_r0.caseField));
19325
+ }
19326
+ }
19327
+ function WriteDynamicMultiSelectListFieldComponent_span_4_Template(rf, ctx) {
19328
+ if (rf & 1) {
19329
+ i0__namespace.ɵɵelementStart(0, "span", 6);
19330
+ i0__namespace.ɵɵtext(1);
19331
+ i0__namespace.ɵɵelementEnd();
19332
+ }
19333
+ if (rf & 2) {
19334
+ var ctx_r1 = i0__namespace.ɵɵnextContext();
19335
+ i0__namespace.ɵɵadvance(1);
19336
+ i0__namespace.ɵɵtextInterpolate(ctx_r1.caseField.hint_text);
19337
+ }
19338
+ }
19339
+ function WriteDynamicMultiSelectListFieldComponent_span_5_Template(rf, ctx) {
19340
+ if (rf & 1) {
19341
+ i0__namespace.ɵɵelementStart(0, "span", 7);
19342
+ i0__namespace.ɵɵtext(1);
19343
+ i0__namespace.ɵɵpipe(2, "ccdFirstError");
19344
+ i0__namespace.ɵɵelementEnd();
19345
+ }
19346
+ if (rf & 2) {
19347
+ var ctx_r2 = i0__namespace.ɵɵnextContext();
19348
+ i0__namespace.ɵɵadvance(1);
19349
+ i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind1(2, 1, ctx_r2.checkboxes.errors));
19350
+ }
19351
+ }
19352
+ function WriteDynamicMultiSelectListFieldComponent_ng_container_6_Template(rf, ctx) {
19353
+ if (rf & 1) {
19354
+ var _r6_1 = i0__namespace.ɵɵgetCurrentView();
19355
+ i0__namespace.ɵɵelementContainerStart(0);
19356
+ i0__namespace.ɵɵelementStart(1, "div", 8);
19357
+ i0__namespace.ɵɵelementStart(2, "input", 9);
19358
+ i0__namespace.ɵɵlistener("change", function WriteDynamicMultiSelectListFieldComponent_ng_container_6_Template_input_change_2_listener($event) { i0__namespace.ɵɵrestoreView(_r6_1); var ctx_r5 = i0__namespace.ɵɵnextContext(); return ctx_r5.onCheckChange($event); });
19359
+ i0__namespace.ɵɵelementEnd();
19360
+ i0__namespace.ɵɵelementStart(3, "label", 10);
19361
+ i0__namespace.ɵɵtext(4);
19362
+ i0__namespace.ɵɵelementEnd();
19363
+ i0__namespace.ɵɵelementEnd();
19364
+ i0__namespace.ɵɵelementContainerEnd();
19365
+ }
19366
+ if (rf & 2) {
19367
+ var checkbox_r4 = ctx.$implicit;
19368
+ var ctx_r3 = i0__namespace.ɵɵnextContext();
19369
+ i0__namespace.ɵɵadvance(2);
19370
+ i0__namespace.ɵɵpropertyInterpolate("id", ctx_r3.createElementId(checkbox_r4.code));
19371
+ i0__namespace.ɵɵpropertyInterpolate("name", ctx_r3.id());
19372
+ i0__namespace.ɵɵproperty("value", checkbox_r4.code)("checked", ctx_r3.isSelected(checkbox_r4.code));
19373
+ i0__namespace.ɵɵadvance(1);
19374
+ i0__namespace.ɵɵpropertyInterpolate("for", ctx_r3.createElementId(checkbox_r4.code));
19375
+ i0__namespace.ɵɵadvance(1);
19376
+ i0__namespace.ɵɵtextInterpolate(checkbox_r4.label);
19377
+ }
19378
+ }
19379
+ var _c0$A = function (a0) { return { "error": a0 }; };
19380
+ var WriteDynamicMultiSelectListFieldComponent = /** @class */ (function (_super) {
19381
+ __extends(WriteDynamicMultiSelectListFieldComponent, _super);
19382
+ function WriteDynamicMultiSelectListFieldComponent() {
19383
+ return _super !== null && _super.apply(this, arguments) || this;
19384
+ }
19385
+ WriteDynamicMultiSelectListFieldComponent.prototype.ngOnInit = function () {
19386
+ var _this = this;
19387
+ this.checkboxes = new i2.FormArray([]);
19388
+ this.setInitialCaseList();
19389
+ this.setInitialCaseFieldValue();
19390
+ // Initialise array with existing values
19391
+ if (this.caseField.value && Array.isArray(this.caseField.value)) {
19392
+ var values = this.caseField.value;
19393
+ values.forEach(function (value) {
19394
+ _this.checkboxes.push(new i2.FormControl(value));
19395
+ });
19396
+ }
19397
+ this.dynamicListFormControl = this.registerControl(new i2.FormControl(this.checkboxes.value));
19398
+ this.dynamicListFormControl.setValue(this.checkboxes.value);
19399
+ };
19400
+ WriteDynamicMultiSelectListFieldComponent.prototype.onCheckChange = function (event) {
19401
+ var _this = this;
19402
+ var target = event.target;
19403
+ if (!target || !target.value) {
19404
+ return;
19405
+ }
19406
+ var selectedListItem = this.getValueListItem(target.value);
19407
+ if (!this.isSelected(target.value)) {
19408
+ // Add a new control in the FormArray
19409
+ this.checkboxes.push(new i2.FormControl(selectedListItem));
19410
+ }
19411
+ else {
19412
+ // Remove the control from the FormArray
19413
+ this.checkboxes.controls.forEach(function (ctrl, i) {
19414
+ if (ctrl.value.code === target.value) {
19415
+ _this.checkboxes.removeAt(i);
19416
+ }
19417
+ });
19418
+ }
19419
+ this.dynamicListFormControl.setValue(this.checkboxes.value);
19420
+ };
19421
+ WriteDynamicMultiSelectListFieldComponent.prototype.isSelected = function (code) {
19422
+ if (this.checkboxes && this.checkboxes.controls) {
19423
+ return this.checkboxes.controls.find(function (control) { return control.value.code === code; });
19424
+ }
19425
+ };
19426
+ WriteDynamicMultiSelectListFieldComponent.prototype.getValueListItem = function (value) {
19427
+ return this.caseField.list_items.find(function (i) { return i.code === value; });
19428
+ };
19429
+ WriteDynamicMultiSelectListFieldComponent.prototype.setInitialCaseList = function () {
19430
+ var hasListItems = this.caseField.list_items && this.caseField.list_items.length > 0;
19431
+ var hasFormattedListItems = this.caseField.formatted_value && this.caseField.formatted_value.list_items.length > 0;
19432
+ if (!hasListItems && hasFormattedListItems) {
19433
+ this.caseField.list_items = this.caseField.formatted_value.list_items;
19434
+ }
19435
+ };
19436
+ WriteDynamicMultiSelectListFieldComponent.prototype.setInitialCaseFieldValue = function () {
19437
+ if (!this.caseField.value && this.caseField.formatted_value && this.caseField.formatted_value.value) {
19438
+ this.caseField.value = this.caseField.formatted_value.value;
19439
+ }
19440
+ var isNull = this.caseField.value === undefined || this.caseField.value === '';
19441
+ if (isNull || !Array.isArray(this.caseField.value)) {
19442
+ this.caseField.value = [];
19443
+ }
19444
+ };
19445
+ return WriteDynamicMultiSelectListFieldComponent;
19446
+ }(AbstractFieldWriteComponent));
19447
+ WriteDynamicMultiSelectListFieldComponent.ɵfac = function WriteDynamicMultiSelectListFieldComponent_Factory(t) { return ɵWriteDynamicMultiSelectListFieldComponent_BaseFactory(t || WriteDynamicMultiSelectListFieldComponent); };
19448
+ WriteDynamicMultiSelectListFieldComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: WriteDynamicMultiSelectListFieldComponent, selectors: [["ccd-write-dynamic-multi-select-list-field"]], features: [i0__namespace.ɵɵInheritDefinitionFeature], decls: 7, vars: 8, consts: [[1, "form-group", "bottom-30", 3, "ngClass", "id"], ["class", "form-label", 4, "ngIf"], ["class", "form-hint", 4, "ngIf"], ["class", "error-message", 4, "ngIf"], [4, "ngFor", "ngForOf"], [1, "form-label"], [1, "form-hint"], [1, "error-message"], [1, "multiple-choice"], ["type", "checkbox", 1, "form-control", 3, "id", "name", "value", "checked", "change"], [1, "form-label", 3, "for"]], template: function WriteDynamicMultiSelectListFieldComponent_Template(rf, ctx) {
19449
+ if (rf & 1) {
19450
+ i0__namespace.ɵɵelementStart(0, "div", 0);
19451
+ i0__namespace.ɵɵelementStart(1, "fieldset");
19452
+ i0__namespace.ɵɵelementStart(2, "legend");
19453
+ i0__namespace.ɵɵtemplate(3, WriteDynamicMultiSelectListFieldComponent_span_3_Template, 3, 3, "span", 1);
19454
+ i0__namespace.ɵɵtemplate(4, WriteDynamicMultiSelectListFieldComponent_span_4_Template, 2, 1, "span", 2);
19455
+ i0__namespace.ɵɵtemplate(5, WriteDynamicMultiSelectListFieldComponent_span_5_Template, 3, 3, "span", 3);
19456
+ i0__namespace.ɵɵelementEnd();
19457
+ i0__namespace.ɵɵtemplate(6, WriteDynamicMultiSelectListFieldComponent_ng_container_6_Template, 5, 6, "ng-container", 4);
19458
+ i0__namespace.ɵɵelementEnd();
19459
+ i0__namespace.ɵɵelementEnd();
19460
+ }
19461
+ if (rf & 2) {
19462
+ i0__namespace.ɵɵproperty("ngClass", i0__namespace.ɵɵpureFunction1(6, _c0$A, !ctx.checkboxes.valid && ctx.checkboxes.touched))("id", ctx.id());
19463
+ i0__namespace.ɵɵadvance(3);
19464
+ i0__namespace.ɵɵproperty("ngIf", ctx.caseField.label);
19465
+ i0__namespace.ɵɵadvance(1);
19466
+ i0__namespace.ɵɵproperty("ngIf", ctx.caseField.hint_text);
19467
+ i0__namespace.ɵɵadvance(1);
19468
+ i0__namespace.ɵɵproperty("ngIf", ctx.checkboxes.errors && ctx.checkboxes.touched);
19469
+ i0__namespace.ɵɵadvance(1);
19470
+ i0__namespace.ɵɵproperty("ngForOf", ctx.caseField.list_items);
19471
+ }
19472
+ }, directives: [i1__namespace.NgClass, i1__namespace.NgIf, i1__namespace.NgForOf], pipes: [FieldLabelPipe, FirstErrorPipe], encapsulation: 2 });
19473
+ var ɵWriteDynamicMultiSelectListFieldComponent_BaseFactory = /*@__PURE__*/ i0__namespace.ɵɵgetInheritedFactory(WriteDynamicMultiSelectListFieldComponent);
19474
+ (function () {
19475
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(WriteDynamicMultiSelectListFieldComponent, [{
19476
+ type: i0.Component,
19477
+ args: [{
19478
+ selector: 'ccd-write-dynamic-multi-select-list-field',
19479
+ templateUrl: './write-dynamic-multi-select-list-field.html'
19480
+ }]
19481
+ }], null, null);
19482
+ })();
19483
+
19230
19484
  var ReadPhoneUKFieldComponent = /** @class */ (function (_super) {
19231
19485
  __extends(ReadPhoneUKFieldComponent, _super);
19232
19486
  function ReadPhoneUKFieldComponent() {
@@ -19889,6 +20143,8 @@
19889
20143
  return write ? WriteFixedListFieldComponent : ReadFixedListFieldComponent;
19890
20144
  case 'DynamicRadioList':
19891
20145
  return write ? WriteDynamicRadioListFieldComponent : ReadDynamicRadioListFieldComponent;
20146
+ case 'DynamicMultiSelectList':
20147
+ return write ? WriteDynamicMultiSelectListFieldComponent : ReadDynamicMultiSelectListFieldComponent;
19892
20148
  case 'FixedRadioList':
19893
20149
  return write ? WriteFixedRadioListFieldComponent : ReadFixedRadioListFieldComponent;
19894
20150
  case 'Complex':
@@ -19958,7 +20214,7 @@
19958
20214
  })();
19959
20215
 
19960
20216
  var _c0$v = ["fieldContainer"];
19961
- var FIX_CASEFIELD_FOR$1 = ['FixedList', 'DynamicList'];
20217
+ var FIX_CASEFIELD_FOR$1 = ['FixedList', 'DynamicList', 'DynamicMultiSelectList'];
19962
20218
  var FieldReadComponent = /** @class */ (function (_super) {
19963
20219
  __extends(FieldReadComponent, _super);
19964
20220
  function FieldReadComponent(resolver, paletteService) {
@@ -20048,7 +20304,7 @@
20048
20304
  })();
20049
20305
 
20050
20306
  var _c0$u = ["fieldContainer"];
20051
- var FIX_CASEFIELD_FOR = ['FixedList', 'DynamicList'];
20307
+ var FIX_CASEFIELD_FOR = ['FixedList', 'DynamicList', 'DynamicMultiSelectList'];
20052
20308
  var FieldWriteComponent = /** @class */ (function (_super) {
20053
20309
  __extends(FieldWriteComponent, _super);
20054
20310
  function FieldWriteComponent(resolver, paletteService) {
@@ -25008,23 +25264,26 @@
25008
25264
  || !ReadFieldsFilterPipe.isEmpty(value[field.id]);
25009
25265
  };
25010
25266
  ReadFieldsFilterPipe.getValue = function (field, values, index) {
25011
- var value;
25012
- if (index >= 0) {
25013
- value = values[index].value[field.id];
25014
- }
25015
- else {
25016
- value = values[field.id];
25267
+ if (ReadFieldsFilterPipe.isEmpty(field.value)) {
25268
+ var value = void 0;
25269
+ if (index >= 0) {
25270
+ value = values[index].value[field.id];
25271
+ }
25272
+ else {
25273
+ value = values[field.id];
25274
+ }
25275
+ return value;
25017
25276
  }
25018
- return ReadFieldsFilterPipe.isEmpty(field.value) ? value : field.value;
25277
+ return field.value;
25019
25278
  };
25020
- ReadFieldsFilterPipe.evaluateConditionalShow = function (field, formValue, path, formGroupAvaliable, fieldId) {
25279
+ ReadFieldsFilterPipe.evaluateConditionalShow = function (field, formValue, path, formGroupAvailable, fieldId) {
25021
25280
  if (field.display_context === 'HIDDEN') {
25022
25281
  field.hidden = true;
25023
25282
  }
25024
25283
  else if (field.show_condition) {
25025
25284
  var cond = void 0;
25026
- if (fieldId && field.show_condition.indexOf(fieldId) > -1 && !formGroupAvaliable && !!Object.keys(formValue).length) {
25027
- var search = fieldId + '.';
25285
+ if (fieldId && field.show_condition.indexOf(fieldId + ".") > -1 && !formGroupAvailable && !!Object.keys(formValue).length) {
25286
+ var search = fieldId + ".";
25028
25287
  var searchRegExp = new RegExp(search, 'g');
25029
25288
  var replaceWith = '';
25030
25289
  cond = ShowCondition.getInstance(field.show_condition.replace(searchRegExp, replaceWith));
@@ -25433,6 +25692,8 @@
25433
25692
  WriteDocumentFieldComponent,
25434
25693
  WriteDynamicListFieldComponent,
25435
25694
  WriteDynamicRadioListFieldComponent,
25695
+ WriteDynamicMultiSelectListFieldComponent,
25696
+ ReadDynamicMultiSelectListFieldComponent,
25436
25697
  WriteTextFieldComponent,
25437
25698
  WriteDateContainerFieldComponent,
25438
25699
  WriteTextAreaFieldComponent,
@@ -25462,6 +25723,13 @@
25462
25723
  CaseFileViewOverlayMenuComponent,
25463
25724
  CaseFileViewFolderDocumentActionsComponent,
25464
25725
  CaseFileViewFolderSelectorComponent,
25726
+ // component for dynamic list
25727
+ WriteDynamicMultiSelectListFieldComponent,
25728
+ WriteDynamicRadioListFieldComponent,
25729
+ WriteDynamicListFieldComponent,
25730
+ ReadDynamicMultiSelectListFieldComponent,
25731
+ ReadDynamicListFieldComponent,
25732
+ ReadDynamicRadioListFieldComponent,
25465
25733
  LinkedCasesToTableComponent,
25466
25734
  LinkedCasesFromTableComponent,
25467
25735
  BeforeYouStartComponent,
@@ -25592,6 +25860,8 @@
25592
25860
  WriteDocumentFieldComponent,
25593
25861
  WriteDynamicListFieldComponent,
25594
25862
  WriteDynamicRadioListFieldComponent,
25863
+ WriteDynamicMultiSelectListFieldComponent,
25864
+ ReadDynamicMultiSelectListFieldComponent,
25595
25865
  WriteTextFieldComponent,
25596
25866
  WriteDateContainerFieldComponent,
25597
25867
  WriteTextAreaFieldComponent,
@@ -25621,6 +25891,13 @@
25621
25891
  CaseFileViewOverlayMenuComponent,
25622
25892
  CaseFileViewFolderDocumentActionsComponent,
25623
25893
  CaseFileViewFolderSelectorComponent,
25894
+ // component for dynamic list
25895
+ WriteDynamicMultiSelectListFieldComponent,
25896
+ WriteDynamicRadioListFieldComponent,
25897
+ WriteDynamicListFieldComponent,
25898
+ ReadDynamicMultiSelectListFieldComponent,
25899
+ ReadDynamicListFieldComponent,
25900
+ ReadDynamicRadioListFieldComponent,
25624
25901
  LinkedCasesToTableComponent,
25625
25902
  LinkedCasesFromTableComponent,
25626
25903
  BeforeYouStartComponent,
@@ -25710,6 +25987,8 @@
25710
25987
  WriteDocumentFieldComponent,
25711
25988
  WriteDynamicListFieldComponent,
25712
25989
  WriteDynamicRadioListFieldComponent,
25990
+ WriteDynamicMultiSelectListFieldComponent,
25991
+ ReadDynamicMultiSelectListFieldComponent,
25713
25992
  WriteTextFieldComponent,
25714
25993
  WriteDateContainerFieldComponent,
25715
25994
  WriteTextAreaFieldComponent,
@@ -25739,6 +26018,13 @@
25739
26018
  CaseFileViewOverlayMenuComponent,
25740
26019
  CaseFileViewFolderDocumentActionsComponent,
25741
26020
  CaseFileViewFolderSelectorComponent,
26021
+ // component for dynamic list
26022
+ WriteDynamicMultiSelectListFieldComponent,
26023
+ WriteDynamicRadioListFieldComponent,
26024
+ WriteDynamicListFieldComponent,
26025
+ ReadDynamicMultiSelectListFieldComponent,
26026
+ ReadDynamicListFieldComponent,
26027
+ ReadDynamicRadioListFieldComponent,
25742
26028
  LinkedCasesToTableComponent,
25743
26029
  LinkedCasesFromTableComponent,
25744
26030
  BeforeYouStartComponent,
@@ -35805,6 +36091,7 @@
35805
36091
  exports.ReadDateFieldComponent = ReadDateFieldComponent;
35806
36092
  exports.ReadDocumentFieldComponent = ReadDocumentFieldComponent;
35807
36093
  exports.ReadDynamicListFieldComponent = ReadDynamicListFieldComponent;
36094
+ exports.ReadDynamicMultiSelectListFieldComponent = ReadDynamicMultiSelectListFieldComponent;
35808
36095
  exports.ReadDynamicRadioListFieldComponent = ReadDynamicRadioListFieldComponent;
35809
36096
  exports.ReadEmailFieldComponent = ReadEmailFieldComponent;
35810
36097
  exports.ReadFieldsFilterPipe = ReadFieldsFilterPipe;
@@ -35881,6 +36168,7 @@
35881
36168
  exports.WriteDateFieldComponent = WriteDateFieldComponent;
35882
36169
  exports.WriteDocumentFieldComponent = WriteDocumentFieldComponent;
35883
36170
  exports.WriteDynamicListFieldComponent = WriteDynamicListFieldComponent;
36171
+ exports.WriteDynamicMultiSelectListFieldComponent = WriteDynamicMultiSelectListFieldComponent;
35884
36172
  exports.WriteDynamicRadioListFieldComponent = WriteDynamicRadioListFieldComponent;
35885
36173
  exports.WriteEmailFieldComponent = WriteEmailFieldComponent;
35886
36174
  exports.WriteFixedListFieldComponent = WriteFixedListFieldComponent;