@hmcts/ccd-case-ui-toolkit 7.1.35-qm-callbackerror → 7.1.35-rc1

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 (62) hide show
  1. package/esm2022/lib/shared/components/case-editor/case-edit/case-edit.component.mjs +37 -15
  2. package/esm2022/lib/shared/components/case-editor/case-edit-utils/case-edit.utils.mjs +13 -1
  3. package/esm2022/lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-cancelled/case-event-completion-task-cancelled.component.mjs +3 -2
  4. package/esm2022/lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-reassigned/case-event-completion-task-reassigned.component.mjs +4 -3
  5. package/esm2022/lib/shared/components/case-editor/services/cases.service.mjs +4 -3
  6. package/esm2022/lib/shared/components/case-editor/services/event-completion-state-machine.service.mjs +5 -4
  7. package/esm2022/lib/shared/components/case-viewer/case-event-trigger/case-event-trigger.component.mjs +10 -5
  8. package/esm2022/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.mjs +10 -6
  9. package/esm2022/lib/shared/components/case-viewer/services/event-trigger.resolver.mjs +9 -5
  10. package/esm2022/lib/shared/components/event-start/event-guard/event-start.guard.mjs +36 -48
  11. package/esm2022/lib/shared/components/event-start/services/event-start-state-machine.service.mjs +5 -3
  12. package/esm2022/lib/shared/components/palette/history/event-log/event-log-table.component.mjs +41 -18
  13. package/esm2022/lib/shared/components/palette/history/event-log/event-log.component.mjs +9 -9
  14. package/esm2022/lib/shared/components/palette/linked-cases/components/link-cases/link-cases.component.mjs +17 -17
  15. package/esm2022/lib/shared/components/palette/linked-cases/components/unlink-cases/unlink-cases.component.mjs +10 -10
  16. package/esm2022/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.mjs +30 -13
  17. package/esm2022/lib/shared/components/palette/palette.module.mjs +3 -2
  18. package/esm2022/lib/shared/components/palette/query-management/components/qualifying-questions/qualifying-question-detail/qualifying-question-detail.component.mjs +12 -10
  19. package/esm2022/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.mjs +50 -29
  20. package/esm2022/lib/shared/components/palette/query-management/components/query-details/query-details.component.mjs +158 -104
  21. package/esm2022/lib/shared/components/palette/query-management/components/query-write/query-write-respond-to-query/query-write-respond-to-query.component.mjs +104 -41
  22. package/esm2022/lib/shared/components/palette/query-management/read-query-management-field.component.mjs +4 -21
  23. package/esm2022/lib/shared/domain/work-allocation/Task.mjs +1 -1
  24. package/esm2022/lib/shared/services/http/http-error.service.mjs +11 -4
  25. package/esm2022/lib/shared/services/loading/loading.service.mjs +13 -1
  26. package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs +1153 -950
  27. package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
  28. package/lib/shared/components/case-editor/case-edit/case-edit.component.d.ts +6 -2
  29. package/lib/shared/components/case-editor/case-edit/case-edit.component.d.ts.map +1 -1
  30. package/lib/shared/components/case-editor/case-edit-utils/case-edit.utils.d.ts +2 -0
  31. package/lib/shared/components/case-editor/case-edit-utils/case-edit.utils.d.ts.map +1 -1
  32. package/lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-cancelled/case-event-completion-task-cancelled.component.d.ts.map +1 -1
  33. package/lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-reassigned/case-event-completion-task-reassigned.component.d.ts.map +1 -1
  34. package/lib/shared/components/case-editor/services/cases.service.d.ts.map +1 -1
  35. package/lib/shared/components/case-editor/services/event-completion-state-machine.service.d.ts.map +1 -1
  36. package/lib/shared/components/case-viewer/case-event-trigger/case-event-trigger.component.d.ts +3 -2
  37. package/lib/shared/components/case-viewer/case-event-trigger/case-event-trigger.component.d.ts.map +1 -1
  38. package/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.d.ts +3 -2
  39. package/lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.d.ts.map +1 -1
  40. package/lib/shared/components/case-viewer/services/event-trigger.resolver.d.ts +3 -1
  41. package/lib/shared/components/case-viewer/services/event-trigger.resolver.d.ts.map +1 -1
  42. package/lib/shared/components/event-start/event-guard/event-start.guard.d.ts +2 -3
  43. package/lib/shared/components/event-start/event-guard/event-start.guard.d.ts.map +1 -1
  44. package/lib/shared/components/event-start/services/event-start-state-machine.service.d.ts.map +1 -1
  45. package/lib/shared/components/palette/history/event-log/event-log-table.component.d.ts +4 -0
  46. package/lib/shared/components/palette/history/event-log/event-log-table.component.d.ts.map +1 -1
  47. package/lib/shared/components/palette/linked-cases/components/unlink-cases/unlink-cases.component.d.ts.map +1 -1
  48. package/lib/shared/components/palette/linked-cases/write-linked-cases-field.component.d.ts.map +1 -1
  49. package/lib/shared/components/palette/query-management/components/qualifying-questions/qualifying-question-detail/qualifying-question-detail.component.d.ts.map +1 -1
  50. package/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.d.ts +5 -1
  51. package/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.d.ts.map +1 -1
  52. package/lib/shared/components/palette/query-management/components/query-details/query-details.component.d.ts +17 -5
  53. package/lib/shared/components/palette/query-management/components/query-details/query-details.component.d.ts.map +1 -1
  54. package/lib/shared/components/palette/query-management/components/query-write/query-write-respond-to-query/query-write-respond-to-query.component.d.ts +17 -5
  55. package/lib/shared/components/palette/query-management/components/query-write/query-write-respond-to-query/query-write-respond-to-query.component.d.ts.map +1 -1
  56. package/lib/shared/domain/work-allocation/Task.d.ts +1 -0
  57. package/lib/shared/domain/work-allocation/Task.d.ts.map +1 -1
  58. package/lib/shared/services/http/http-error.service.d.ts +3 -1
  59. package/lib/shared/services/http/http-error.service.d.ts.map +1 -1
  60. package/lib/shared/services/loading/loading.service.d.ts +4 -0
  61. package/lib/shared/services/loading/loading.service.d.ts.map +1 -1
  62. package/package.json +1 -1
@@ -8,10 +8,10 @@ import * as i1$1 from '@angular/router';
8
8
  import { RouterModule, NavigationStart, NavigationEnd } from '@angular/router';
9
9
  import * as i4 from '@angular/forms';
10
10
  import { NG_VALUE_ACCESSOR, NG_VALIDATORS, FormArray, FormGroup, FormControl, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms';
11
- import { throwError, Subject, EMPTY, Observable, BehaviorSubject, of, timer, fromEvent, forkJoin, Subscription, combineLatest } from 'rxjs';
11
+ import { BehaviorSubject, throwError, Subject, EMPTY, Observable, of, timer, fromEvent, forkJoin, Subscription, combineLatest } from 'rxjs';
12
12
  import * as i1$2 from '@angular/common/http';
13
13
  import { HttpErrorResponse, HttpHeaders, HttpParams } from '@angular/common/http';
14
- import { catchError, map, publish, refCount, switchMap, debounceTime, delay, distinctUntilChanged, finalize, timeout, mergeMap, retryWhen, tap, delayWhen, publishReplay, take, first, takeUntil, filter } from 'rxjs/operators';
14
+ import { distinctUntilChanged, catchError, map, publish, refCount, switchMap, debounceTime, delay, finalize, timeout, mergeMap, retryWhen, tap, delayWhen, publishReplay, take, first, takeUntil, filter } from 'rxjs/operators';
15
15
  import { polling } from 'rx-polling-hmcts';
16
16
  import { Type, Expose, plainToClassFromExist, plainToClass } from 'class-transformer';
17
17
  import moment from 'moment';
@@ -59,7 +59,7 @@ import { MatLegacyTabsModule } from '@angular/material/legacy-tabs';
59
59
  import { decompressFromUTF16, compressToUTF16 } from 'lz-string';
60
60
 
61
61
  const _c0$14 = [[["", "footerSolsNavLinks", ""]], [["", "footerCaseWorkerNavLinks", ""]]];
62
- const _c1$v = ["[footerSolsNavLinks]", "[footerCaseWorkerNavLinks]"];
62
+ const _c1$u = ["[footerSolsNavLinks]", "[footerCaseWorkerNavLinks]"];
63
63
  function FooterComponent_div_2_Template(rf, ctx) { if (rf & 1) {
64
64
  i0.ɵɵelementStart(0, "div", 3)(1, "div", 4);
65
65
  i0.ɵɵprojection(2);
@@ -135,7 +135,7 @@ class FooterComponent {
135
135
  phone;
136
136
  workhours;
137
137
  static ɵfac = function FooterComponent_Factory(t) { return new (t || FooterComponent)(); };
138
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: FooterComponent, selectors: [["cut-footer-bar"]], inputs: { email: "email", isSolicitor: "isSolicitor", phone: "phone", workhours: "workhours" }, ngContentSelectors: _c1$v, decls: 4, vars: 4, consts: [["id", "footer", "role", "footer", 1, "group", "js-footer"], [1, "footer-wrapper"], ["class", "footer-meta", 4, "ngIf"], [1, "footer-meta"], [1, "footer-meta-inner"], [1, "open-government-licence"], [1, "logo"], ["href", "https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/", "rel", "license"], [1, "copyright"], ["href", "https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/copyright-and-re-use/crown-copyright/"], [1, "title"], [1, "footer-text"], [1, "email"], [3, "href"], [1, "phone"], [1, "work-hours"]], template: function FooterComponent_Template(rf, ctx) { if (rf & 1) {
138
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: FooterComponent, selectors: [["cut-footer-bar"]], inputs: { email: "email", isSolicitor: "isSolicitor", phone: "phone", workhours: "workhours" }, ngContentSelectors: _c1$u, decls: 4, vars: 4, consts: [["id", "footer", "role", "footer", 1, "group", "js-footer"], [1, "footer-wrapper"], ["class", "footer-meta", 4, "ngIf"], [1, "footer-meta"], [1, "footer-meta-inner"], [1, "open-government-licence"], [1, "logo"], ["href", "https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/", "rel", "license"], [1, "copyright"], ["href", "https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/copyright-and-re-use/crown-copyright/"], [1, "title"], [1, "footer-text"], [1, "email"], [3, "href"], [1, "phone"], [1, "work-hours"]], template: function FooterComponent_Template(rf, ctx) { if (rf & 1) {
139
139
  i0.ɵɵprojectionDef(_c0$14);
140
140
  i0.ɵɵelementStart(0, "footer", 0)(1, "div", 1);
141
141
  i0.ɵɵtemplate(2, FooterComponent_div_2_Template, 20, 15, "div", 2)(3, FooterComponent_div_3_Template, 20, 16, "div", 2);
@@ -164,7 +164,7 @@ class FooterComponent {
164
164
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(FooterComponent, { className: "FooterComponent", filePath: "lib/components/footer/footer.component.ts", lineNumber: 8 }); })();
165
165
 
166
166
  const _c0$13 = [[["", "headerNavigation", ""]]];
167
- const _c1$u = ["[headerNavigation]"];
167
+ const _c1$t = ["[headerNavigation]"];
168
168
  function HeaderBarComponent_div_3_Template(rf, ctx) { if (rf & 1) {
169
169
  i0.ɵɵelementStart(0, "div")(1, "a", 12);
170
170
  i0.ɵɵelement(2, "img", 13);
@@ -206,7 +206,7 @@ class HeaderBarComponent {
206
206
  this.signOutRequest.emit();
207
207
  }
208
208
  static ɵfac = function HeaderBarComponent_Factory(t) { return new (t || HeaderBarComponent)(); };
209
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HeaderBarComponent, selectors: [["cut-header-bar"]], inputs: { title: "title", isSolicitor: "isSolicitor", username: "username" }, outputs: { signOutRequest: "signOutRequest" }, ngContentSelectors: _c1$u, decls: 17, vars: 14, consts: [["role", "banner", "id", "global-header", 1, "with-proposition"], [1, "header-wrapper"], [1, "header-global"], [4, "ngIf"], ["class", "global-header", 4, "ngIf"], [1, "header-proposition"], [1, "content"], ["href", "#proposition-links", 1, "js-header-toggle", "menu"], ["id", "proposition-menu", 4, "ngIf"], [1, "proposition-right"], ["id", "user-name"], ["id", "sign-out", "href", "javascript:void(0)", 3, "click"], ["href", "https://www.gov.uk", "title", "Go to the GOV.UK homepage", "id", "logo", 1, "content", 2, "margin-left", "0px"], ["src", "/img/gov.uk_logotype_crown_invert_trans.png?0.23.0", "width", "36", "height", "32", "alt", ""], [1, "global-header"], [1, "title"], ["id", "proposition-menu"], [1, "title-solicitor"], ["id", "proposition-name"]], template: function HeaderBarComponent_Template(rf, ctx) { if (rf & 1) {
209
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HeaderBarComponent, selectors: [["cut-header-bar"]], inputs: { title: "title", isSolicitor: "isSolicitor", username: "username" }, outputs: { signOutRequest: "signOutRequest" }, ngContentSelectors: _c1$t, decls: 17, vars: 14, consts: [["role", "banner", "id", "global-header", 1, "with-proposition"], [1, "header-wrapper"], [1, "header-global"], [4, "ngIf"], ["class", "global-header", 4, "ngIf"], [1, "header-proposition"], [1, "content"], ["href", "#proposition-links", 1, "js-header-toggle", "menu"], ["id", "proposition-menu", 4, "ngIf"], [1, "proposition-right"], ["id", "user-name"], ["id", "sign-out", "href", "javascript:void(0)", 3, "click"], ["href", "https://www.gov.uk", "title", "Go to the GOV.UK homepage", "id", "logo", 1, "content", 2, "margin-left", "0px"], ["src", "/img/gov.uk_logotype_crown_invert_trans.png?0.23.0", "width", "36", "height", "32", "alt", ""], [1, "global-header"], [1, "title"], ["id", "proposition-menu"], [1, "title-solicitor"], ["id", "proposition-name"]], template: function HeaderBarComponent_Template(rf, ctx) { if (rf & 1) {
210
210
  i0.ɵɵprojectionDef(_c0$13);
211
211
  i0.ɵɵelementStart(0, "header", 0)(1, "div", 1)(2, "div", 2);
212
212
  i0.ɵɵtemplate(3, HeaderBarComponent_div_3_Template, 5, 3, "div", 3)(4, HeaderBarComponent_div_4_Template, 5, 3, "div", 4);
@@ -258,11 +258,11 @@ class HeaderBarComponent {
258
258
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(HeaderBarComponent, { className: "HeaderBarComponent", filePath: "lib/components/header/header-bar/header-bar.component.ts", lineNumber: 8 }); })();
259
259
 
260
260
  const _c0$12 = [[["", "leftNavLinks", ""]], [["", "rightNavLinks", ""]]];
261
- const _c1$t = ["[leftNavLinks]", "[rightNavLinks]"];
261
+ const _c1$s = ["[leftNavLinks]", "[rightNavLinks]"];
262
262
  class NavigationComponent {
263
263
  isSolicitor;
264
264
  static ɵfac = function NavigationComponent_Factory(t) { return new (t || NavigationComponent)(); };
265
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: NavigationComponent, selectors: [["cut-nav-bar"]], inputs: { isSolicitor: "isSolicitor" }, ngContentSelectors: _c1$t, decls: 4, vars: 2, consts: [[1, "cut-nav-bar"]], template: function NavigationComponent_Template(rf, ctx) { if (rf & 1) {
265
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: NavigationComponent, selectors: [["cut-nav-bar"]], inputs: { isSolicitor: "isSolicitor" }, ngContentSelectors: _c1$s, decls: 4, vars: 2, consts: [[1, "cut-nav-bar"]], template: function NavigationComponent_Template(rf, ctx) { if (rf & 1) {
266
266
  i0.ɵɵprojectionDef(_c0$12);
267
267
  i0.ɵɵelementStart(0, "div")(1, "nav", 0);
268
268
  i0.ɵɵprojection(2);
@@ -383,10 +383,10 @@ class HeadersModule {
383
383
  (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(HeadersModule, { declarations: [PhaseComponent, HeaderBarComponent, NavigationComponent, NavigationItemComponent], imports: [CommonModule, RouterModule, i1.RpxTranslationModule], exports: [PhaseComponent, HeaderBarComponent, NavigationComponent, NavigationItemComponent] }); })();
384
384
 
385
385
  const _c0$11 = [[["", "topBody", ""]], [["", "leftBody", ""]], [["", "rightBody", ""]]];
386
- const _c1$s = ["[topBody]", "[leftBody]", "[rightBody]"];
386
+ const _c1$r = ["[topBody]", "[leftBody]", "[rightBody]"];
387
387
  class BodyComponent {
388
388
  static ɵfac = function BodyComponent_Factory(t) { return new (t || BodyComponent)(); };
389
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: BodyComponent, selectors: [["cut-body"]], ngContentSelectors: _c1$s, decls: 4, vars: 0, consts: [[1, "global-display"]], template: function BodyComponent_Template(rf, ctx) { if (rf & 1) {
389
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: BodyComponent, selectors: [["cut-body"]], ngContentSelectors: _c1$r, decls: 4, vars: 0, consts: [[1, "global-display"]], template: function BodyComponent_Template(rf, ctx) { if (rf & 1) {
390
390
  i0.ɵɵprojectionDef(_c0$11);
391
391
  i0.ɵɵelementStart(0, "div", 0);
392
392
  i0.ɵɵprojection(1);
@@ -1001,7 +1001,7 @@ class NotificationBannerComponent {
1001
1001
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(NotificationBannerComponent, { className: "NotificationBannerComponent", filePath: "lib/components/banners/notification-banner/notification-banner.component.ts", lineNumber: 10 }); })();
1002
1002
 
1003
1003
  const _c0$_ = ["*"];
1004
- const _c1$r = a0 => ({ "js-hidden": a0 });
1004
+ const _c1$q = a0 => ({ "js-hidden": a0 });
1005
1005
  class TabComponent {
1006
1006
  id;
1007
1007
  title;
@@ -1013,7 +1013,7 @@ class TabComponent {
1013
1013
  i0.ɵɵprojection(1);
1014
1014
  i0.ɵɵelementEnd();
1015
1015
  } if (rf & 2) {
1016
- i0.ɵɵproperty("id", ctx.id)("ngClass", i0.ɵɵpureFunction1(3, _c1$r, !ctx.selected));
1016
+ i0.ɵɵproperty("id", ctx.id)("ngClass", i0.ɵɵpureFunction1(3, _c1$q, !ctx.selected));
1017
1017
  i0.ɵɵattribute("aria-hidden", !ctx.selected);
1018
1018
  } }, dependencies: [i5.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:0px;border-color:#bfc1c3;padding-bottom:11px;margin-bottom:0;color:#0b0c0c}}"] });
1019
1019
  }
@@ -1030,7 +1030,7 @@ class TabComponent {
1030
1030
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TabComponent, { className: "TabComponent", filePath: "lib/components/tabs/tab.component.ts", lineNumber: 10 }); })();
1031
1031
 
1032
1032
  const _c0$Z = ["tab"];
1033
- const _c1$q = ["*"];
1033
+ const _c1$p = ["*"];
1034
1034
  const _c2$4 = () => ["."];
1035
1035
  const _c3 = a0 => ({ "tabs-toggle-selected": a0 });
1036
1036
  function TabsComponent_li_2_Template(rf, ctx) { if (rf & 1) {
@@ -1080,7 +1080,7 @@ class TabsComponent {
1080
1080
  } if (rf & 2) {
1081
1081
  let _t;
1082
1082
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.tabs = _t);
1083
- } }, ngContentSelectors: _c1$q, decls: 5, vars: 1, consts: [["tab", ""], [1, "tabs"], ["role", "list", 1, "tabs-list"], ["class", "tabs-list-item", 4, "ngFor", "ngForOf"], [1, "tabs-content"], [1, "tabs-list-item"], ["role", "tab", "tabindex", "0", 1, "tabs-toggle", 3, "click", "routerLink", "fragment", "ngClass"]], template: function TabsComponent_Template(rf, ctx) { if (rf & 1) {
1083
+ } }, ngContentSelectors: _c1$p, decls: 5, vars: 1, consts: [["tab", ""], [1, "tabs"], ["role", "list", 1, "tabs-list"], ["class", "tabs-list-item", 4, "ngFor", "ngForOf"], [1, "tabs-content"], [1, "tabs-list-item"], ["role", "tab", "tabindex", "0", 1, "tabs-toggle", 3, "click", "routerLink", "fragment", "ngClass"]], template: function TabsComponent_Template(rf, ctx) { if (rf & 1) {
1084
1084
  i0.ɵɵprojectionDef();
1085
1085
  i0.ɵɵelementStart(0, "div", 1)(1, "ul", 2);
1086
1086
  i0.ɵɵtemplate(2, TabsComponent_li_2_Template, 5, 11, "li", 3);
@@ -1400,10 +1400,70 @@ class AuthService {
1400
1400
  args: [DOCUMENT]
1401
1401
  }] }], null); })();
1402
1402
 
1403
+ class LoadingService {
1404
+ registered = new Map();
1405
+ loading = new BehaviorSubject(false);
1406
+ sharedSpinners = [];
1407
+ get isLoading() {
1408
+ return this.loading.pipe(distinctUntilChanged());
1409
+ }
1410
+ register() {
1411
+ const token = this.generateToken();
1412
+ this.registered.set(token, token);
1413
+ this.loading.next(true);
1414
+ return token;
1415
+ }
1416
+ unregister(token) {
1417
+ this.registered.delete(token);
1418
+ this.loading.next(this.registered.size > 0);
1419
+ }
1420
+ addSharedSpinner(spinnerId) {
1421
+ this.sharedSpinners.push(spinnerId);
1422
+ }
1423
+ hasSharedSpinner() {
1424
+ return this.sharedSpinners.length > 0;
1425
+ }
1426
+ unregisterSharedSpinner() {
1427
+ this.registered.delete(this.sharedSpinners[0]);
1428
+ this.sharedSpinners.shift();
1429
+ this.loading.next(this.registered.size > 0);
1430
+ }
1431
+ generateToken() {
1432
+ const timestamp = window.performance.now();
1433
+ return `toolkit-loading-${timestamp}`; // format: [source-library]-[unique incrementing number]
1434
+ }
1435
+ static ɵfac = function LoadingService_Factory(t) { return new (t || LoadingService)(); };
1436
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: LoadingService, factory: LoadingService.ɵfac });
1437
+ }
1438
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LoadingService, [{
1439
+ type: Injectable
1440
+ }], null, null); })();
1441
+
1442
+ class LoadingModule {
1443
+ static ɵfac = function LoadingModule_Factory(t) { return new (t || LoadingModule)(); };
1444
+ static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: LoadingModule });
1445
+ static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
1446
+ LoadingService
1447
+ ] });
1448
+ }
1449
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LoadingModule, [{
1450
+ type: NgModule,
1451
+ args: [{
1452
+ imports: [],
1453
+ declarations: [],
1454
+ exports: [],
1455
+ providers: [
1456
+ LoadingService
1457
+ ]
1458
+ }]
1459
+ }], null, null); })();
1460
+
1403
1461
  class HttpErrorService {
1404
1462
  authService;
1405
- constructor(authService) {
1463
+ loadingService;
1464
+ constructor(authService, loadingService) {
1406
1465
  this.authService = authService;
1466
+ this.loadingService = loadingService;
1407
1467
  }
1408
1468
  static CONTENT_TYPE = 'Content-Type';
1409
1469
  static JSON = 'json';
@@ -1447,18 +1507,21 @@ class HttpErrorService {
1447
1507
  handle(error, redirectIfNotAuthorised = true) {
1448
1508
  console.error('Handling error in http error service.');
1449
1509
  console.error(error);
1510
+ if (this.loadingService.hasSharedSpinner()) {
1511
+ this.loadingService.unregisterSharedSpinner();
1512
+ }
1450
1513
  const httpError = HttpErrorService.convertToHttpError(error);
1451
1514
  if (redirectIfNotAuthorised && httpError.status === 401) {
1452
1515
  this.authService.signIn();
1453
1516
  }
1454
1517
  return throwError(httpError);
1455
1518
  }
1456
- static ɵfac = function HttpErrorService_Factory(t) { return new (t || HttpErrorService)(i0.ɵɵinject(AuthService)); };
1519
+ static ɵfac = function HttpErrorService_Factory(t) { return new (t || HttpErrorService)(i0.ɵɵinject(AuthService), i0.ɵɵinject(LoadingService)); };
1457
1520
  static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: HttpErrorService, factory: HttpErrorService.ɵfac });
1458
1521
  }
1459
1522
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HttpErrorService, [{
1460
1523
  type: Injectable
1461
- }], () => [{ type: AuthService }], null); })();
1524
+ }], () => [{ type: AuthService }, { type: LoadingService }], null); })();
1462
1525
 
1463
1526
  class HttpService {
1464
1527
  httpclient;
@@ -7319,33 +7382,6 @@ class RequestOptionsBuilder {
7319
7382
  type: Injectable
7320
7383
  }], null, null); })();
7321
7384
 
7322
- class LoadingService {
7323
- registered = new Map();
7324
- loading = new BehaviorSubject(false);
7325
- get isLoading() {
7326
- return this.loading.pipe(distinctUntilChanged());
7327
- }
7328
- register() {
7329
- const token = this.generateToken();
7330
- this.registered.set(token, token);
7331
- this.loading.next(true);
7332
- return token;
7333
- }
7334
- unregister(token) {
7335
- this.registered.delete(token);
7336
- this.loading.next(this.registered.size > 0);
7337
- }
7338
- generateToken() {
7339
- const timestamp = window.performance.now();
7340
- return `toolkit-loading-${timestamp}`; // format: [source-library]-[unique incrementing number]
7341
- }
7342
- static ɵfac = function LoadingService_Factory(t) { return new (t || LoadingService)(); };
7343
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: LoadingService, factory: LoadingService.ɵfac });
7344
- }
7345
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LoadingService, [{
7346
- type: Injectable
7347
- }], null, null); })();
7348
-
7349
7385
  class SearchService {
7350
7386
  appConfig;
7351
7387
  httpService;
@@ -7798,25 +7834,6 @@ class BrowserService {
7798
7834
  type: Injectable
7799
7835
  }], null, null); })();
7800
7836
 
7801
- class LoadingModule {
7802
- static ɵfac = function LoadingModule_Factory(t) { return new (t || LoadingModule)(); };
7803
- static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: LoadingModule });
7804
- static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
7805
- LoadingService
7806
- ] });
7807
- }
7808
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LoadingModule, [{
7809
- type: NgModule,
7810
- args: [{
7811
- imports: [],
7812
- declarations: [],
7813
- exports: [],
7814
- providers: [
7815
- LoadingService
7816
- ]
7817
- }]
7818
- }], null, null); })();
7819
-
7820
7837
  class CaseAccessUtils {
7821
7838
  // User role mapping
7822
7839
  static JUDGE_ROLE = 'judge';
@@ -8036,455 +8053,6 @@ class WizardPageFieldToCaseFieldMapper {
8036
8053
  }]
8037
8054
  }], null, null); })();
8038
8055
 
8039
- function convertNonASCIICharacter(character) {
8040
- if (character === '£') {
8041
- // pound sign will be frequently used and works for btoa despite being non-ASCII
8042
- // note: this could be done for other characters provided they work for btoa()
8043
- return character;
8044
- }
8045
- // Note: Will convert to HTML entity
8046
- return CaseEditUtils.PREFIX + character.charCodeAt(0) + CaseEditUtils.SUFFIX;
8047
- }
8048
- class CaseEditUtils {
8049
- static PREFIX = '&#';
8050
- static SUFFIX = ';';
8051
- convertNonASCIICharacters(rawString) {
8052
- return rawString ? rawString.replace(/[^\x20-\x7E]/g, function (c) {
8053
- return convertNonASCIICharacter(c);
8054
- }) : '';
8055
- }
8056
- convertHTMLEntities(editedString) {
8057
- const revertedCharacterList = editedString.split(CaseEditUtils.PREFIX);
8058
- let rawString = revertedCharacterList[0];
8059
- for (let index = 1; index < revertedCharacterList.length; index++) {
8060
- const currentSection = revertedCharacterList[index];
8061
- if (!currentSection.includes(CaseEditUtils.SUFFIX)) {
8062
- return rawString.concat(currentSection);
8063
- }
8064
- else {
8065
- const suffixSplitList = currentSection.split(CaseEditUtils.SUFFIX);
8066
- const characterCode = Number(suffixSplitList[0]);
8067
- rawString = rawString.concat(String.fromCharCode(characterCode), suffixSplitList[1]);
8068
- }
8069
- }
8070
- return rawString;
8071
- }
8072
- }
8073
-
8074
- class CasesService {
8075
- http;
8076
- appConfig;
8077
- orderService;
8078
- errorService;
8079
- wizardPageFieldToCaseFieldMapper;
8080
- loadingService;
8081
- sessionStorageService;
8082
- retryUtil;
8083
- // Internal (UI) API
8084
- static V2_MEDIATYPE_CASE_VIEW = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-case-view.v2+json';
8085
- static V2_MEDIATYPE_START_CASE_TRIGGER = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-start-case-trigger.v2+json;charset=UTF-8';
8086
- static V2_MEDIATYPE_START_EVENT_TRIGGER = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-start-event-trigger.v2+json;charset=UTF-8';
8087
- static V2_MEDIATYPE_START_DRAFT_TRIGGER = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-start-draft-trigger.v2+json;charset=UTF-8';
8088
- // External (Data Store) API
8089
- static V2_MEDIATYPE_CASE_DOCUMENTS = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.case-documents.v2+json;charset=UTF-8';
8090
- static V2_MEDIATYPE_CASE_DATA_VALIDATE = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.case-data-validate.v2+json;charset=UTF-8';
8091
- static V2_MEDIATYPE_CREATE_EVENT = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.create-event.v2+json;charset=UTF-8';
8092
- static V2_MEDIATYPE_CREATE_CASE = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.create-case.v2+json;charset=UTF-8';
8093
- static PUI_CASE_MANAGER = 'pui-case-manager';
8094
- get = this.getCaseView;
8095
- static updateChallengedAccessRequestAttributes(httpClient, caseId, attributesToUpdate) {
8096
- return httpClient.post(`/api/challenged-access-request/update-attributes`, {
8097
- caseId,
8098
- attributesToUpdate
8099
- });
8100
- }
8101
- static updateSpecificAccessRequestAttributes(httpClient, caseId, attributesToUpdate) {
8102
- return httpClient.post(`/api/specific-access-request/update-attributes`, {
8103
- caseId,
8104
- attributesToUpdate
8105
- });
8106
- }
8107
- constructor(http, appConfig, orderService, errorService, wizardPageFieldToCaseFieldMapper, loadingService, sessionStorageService, retryUtil) {
8108
- this.http = http;
8109
- this.appConfig = appConfig;
8110
- this.orderService = orderService;
8111
- this.errorService = errorService;
8112
- this.wizardPageFieldToCaseFieldMapper = wizardPageFieldToCaseFieldMapper;
8113
- this.loadingService = loadingService;
8114
- this.sessionStorageService = sessionStorageService;
8115
- this.retryUtil = retryUtil;
8116
- }
8117
- getCaseView(jurisdictionId, caseTypeId, caseId) {
8118
- const url = `${this.appConfig.getApiUrl()}/caseworkers/:uid/jurisdictions/${jurisdictionId}/case-types/${caseTypeId}/cases/${caseId}`;
8119
- const loadingToken = this.loadingService.register();
8120
- return this.http
8121
- .get(url)
8122
- .pipe(catchError(error => {
8123
- this.errorService.setError(error);
8124
- return throwError(error);
8125
- }), finalize(() => this.loadingService.unregister(loadingToken)));
8126
- }
8127
- getCaseViewV2(caseId) {
8128
- const url = `${this.appConfig.getCaseDataUrl()}/internal/cases/${caseId}`;
8129
- const headers = new HttpHeaders()
8130
- .set('experimental', 'true')
8131
- .set('Accept', CasesService.V2_MEDIATYPE_CASE_VIEW)
8132
- .set('Content-Type', 'application/json');
8133
- const loadingToken = this.loadingService.register();
8134
- let http$ = this.http.get(url, { headers, observe: 'body' });
8135
- const artificialDelay = this.appConfig.getTimeoutsCaseRetrievalArtificialDelay();
8136
- const timeoutPeriods = this.appConfig.getTimeoutsForCaseRetrieval();
8137
- console.log(`Timeout periods: ${timeoutPeriods} seconds.`);
8138
- if (timeoutPeriods && timeoutPeriods.length > 0 && timeoutPeriods[0] > 0) {
8139
- http$ = this.retryUtil.pipeTimeoutMechanismOn(http$, artificialDelay, timeoutPeriods);
8140
- }
8141
- else {
8142
- console.warn('Skipping to pipe a retry mechanism!');
8143
- }
8144
- http$ = this.pipeErrorProcessor(http$);
8145
- http$ = http$.pipe(finalize(() => this.finalizeGetCaseViewWith(caseId, loadingToken)));
8146
- return http$;
8147
- }
8148
- pipeErrorProcessor(in$) {
8149
- const out$ = in$.pipe(catchError(error => {
8150
- console.error(`Error while getting case view with getCaseViewV2! Error type: '${typeof error}, Error name: '${error?.name}'`);
8151
- console.error(error);
8152
- this.errorService.setError(error);
8153
- return throwError(error);
8154
- }));
8155
- return out$;
8156
- }
8157
- finalizeGetCaseViewWith(caseId, loadingToken) {
8158
- this.loadingService.unregister(loadingToken);
8159
- }
8160
- syncWait(seconds) {
8161
- const end = Date.now() + seconds * 1000;
8162
- while (Date.now() < end)
8163
- continue;
8164
- }
8165
- getEventTrigger(caseTypeId, eventTriggerId, caseId, ignoreWarning) {
8166
- ignoreWarning = undefined !== ignoreWarning ? ignoreWarning : 'false';
8167
- const url = this.buildEventTriggerUrl(caseTypeId, eventTriggerId, caseId, ignoreWarning);
8168
- let headers = new HttpHeaders();
8169
- headers = headers.set('experimental', 'true');
8170
- headers = headers.set('Content-Type', 'application/json');
8171
- headers = this.addClientContextHeader(headers);
8172
- if (Draft.isDraft(caseId)) {
8173
- headers = headers.set('Accept', CasesService.V2_MEDIATYPE_START_DRAFT_TRIGGER);
8174
- }
8175
- else if (caseId !== undefined && caseId !== null) {
8176
- headers = headers.set('Accept', CasesService.V2_MEDIATYPE_START_EVENT_TRIGGER);
8177
- }
8178
- else {
8179
- headers = headers.set('Accept', CasesService.V2_MEDIATYPE_START_CASE_TRIGGER);
8180
- }
8181
- return this.http
8182
- .get(url, { headers, observe: 'response' })
8183
- .pipe(map((response) => {
8184
- this.updateClientContextStorage(response.headers);
8185
- return FieldsUtils.handleNestedDynamicLists(response.body);
8186
- }), catchError(error => {
8187
- this.errorService.setError(error);
8188
- return throwError(error);
8189
- }), map((p) => plainToClass(CaseEventTrigger, p)), tap(eventTrigger => this.initialiseEventTrigger(eventTrigger)));
8190
- }
8191
- createEvent(caseDetails, eventData) {
8192
- const caseId = caseDetails.case_id;
8193
- const url = `${this.appConfig.getCaseDataUrl()}/cases/${caseId}/events`;
8194
- let headers = new HttpHeaders()
8195
- .set('experimental', 'true')
8196
- .set('Accept', CasesService.V2_MEDIATYPE_CREATE_EVENT)
8197
- .set('Content-Type', 'application/json');
8198
- headers = this.addClientContextHeader(headers);
8199
- return this.http
8200
- .post(url, eventData, { headers, observe: 'response' })
8201
- .pipe(map((response) => {
8202
- this.updateClientContextStorage(response.headers);
8203
- return response.body;
8204
- }), catchError(error => {
8205
- this.errorService.setError(error);
8206
- return throwError(error);
8207
- }));
8208
- }
8209
- validateCase(ctid, eventData, pageId) {
8210
- const pageIdString = pageId ? `?pageId=${pageId}` : '';
8211
- const url = `${this.appConfig.getCaseDataUrl()}/case-types/${ctid}/validate${pageIdString}`;
8212
- let headers = new HttpHeaders()
8213
- .set('experimental', 'true')
8214
- .set('Accept', CasesService.V2_MEDIATYPE_CASE_DATA_VALIDATE)
8215
- .set('Content-Type', 'application/json');
8216
- headers = this.addClientContextHeader(headers);
8217
- return this.http
8218
- .post(url, eventData, { headers, observe: 'response' })
8219
- .pipe(map((response) => {
8220
- this.updateClientContextStorage(response.headers);
8221
- return response.body;
8222
- }), catchError(error => {
8223
- this.errorService.setError(error);
8224
- return throwError(error);
8225
- }));
8226
- }
8227
- createCase(ctid, eventData) {
8228
- let ignoreWarning = 'false';
8229
- if (eventData.ignore_warning) {
8230
- ignoreWarning = 'true';
8231
- }
8232
- const url = `${this.appConfig.getCaseDataUrl()}/case-types/${ctid}/cases?ignore-warning=${ignoreWarning}`;
8233
- let headers = new HttpHeaders()
8234
- .set('experimental', 'true')
8235
- .set('Accept', CasesService.V2_MEDIATYPE_CREATE_CASE)
8236
- .set('Content-Type', 'application/json');
8237
- headers = this.addClientContextHeader(headers);
8238
- return this.http
8239
- .post(url, eventData, { headers, observe: 'response' })
8240
- .pipe(map((response) => {
8241
- this.updateClientContextStorage(response.headers);
8242
- return response.body;
8243
- }), catchError(error => {
8244
- this.errorService.setError(error);
8245
- return throwError(error);
8246
- }));
8247
- }
8248
- getPrintDocuments(caseId) {
8249
- const url = `${this.appConfig.getCaseDataUrl()}/cases/${caseId}/documents`;
8250
- let headers = new HttpHeaders()
8251
- .set('experimental', 'true')
8252
- .set('Accept', CasesService.V2_MEDIATYPE_CASE_DOCUMENTS)
8253
- .set('Content-Type', 'application/json');
8254
- headers = this.addClientContextHeader(headers);
8255
- return this.http
8256
- .get(url, { headers, observe: 'response' })
8257
- .pipe(map((response) => {
8258
- this.updateClientContextStorage(response.headers);
8259
- return response.body.documentResources;
8260
- }), catchError(error => {
8261
- this.errorService.setError(error);
8262
- return throwError(error);
8263
- }));
8264
- }
8265
- buildEventTriggerUrl(caseTypeId, eventTriggerId, caseId, ignoreWarning) {
8266
- let url = `${this.appConfig.getCaseDataUrl()}/internal`;
8267
- if (Draft.isDraft(caseId)) {
8268
- url += `/drafts/${caseId}`
8269
- + `/event-trigger`
8270
- + `?ignore-warning=${ignoreWarning}`;
8271
- }
8272
- else if (caseTypeId === undefined || caseTypeId === null) {
8273
- url += `/cases/${caseId}`
8274
- + `/event-triggers/${eventTriggerId}`
8275
- + `?ignore-warning=${ignoreWarning}`;
8276
- }
8277
- else {
8278
- url += `/case-types/${caseTypeId}`
8279
- + `/event-triggers/${eventTriggerId}`
8280
- + `?ignore-warning=${ignoreWarning}`;
8281
- }
8282
- return url;
8283
- }
8284
- initialiseEventTrigger(eventTrigger) {
8285
- if (!eventTrigger.wizard_pages) {
8286
- eventTrigger.wizard_pages = [];
8287
- }
8288
- eventTrigger.wizard_pages.forEach((wizardPage) => {
8289
- wizardPage.parsedShowCondition = ShowCondition.getInstance(wizardPage.show_condition);
8290
- wizardPage.case_fields = this.orderService.sort(this.wizardPageFieldToCaseFieldMapper.mapAll(wizardPage.wizard_page_fields, eventTrigger.case_fields));
8291
- });
8292
- }
8293
- getCourtOrHearingCentreName(locationId) {
8294
- return this.http.post(`/api/locations/getLocationsById`, { locations: [{ locationId }] });
8295
- }
8296
- createChallengedAccessRequest(caseId, request) {
8297
- // Assignment API endpoint
8298
- const userInfoStr = this.sessionStorageService.getItem('userDetails');
8299
- const camUtils = new CaseAccessUtils();
8300
- let userInfo;
8301
- if (userInfoStr) {
8302
- userInfo = JSON.parse(userInfoStr);
8303
- }
8304
- const roleCategory = userInfo.roleCategory || camUtils.getMappedRoleCategory(userInfo.roles, userInfo.roleCategories);
8305
- const roleName = camUtils.getAMRoleName('challenged', roleCategory);
8306
- const beginTime = new Date();
8307
- const endTime = new Date(new Date().setUTCHours(23, 59, 59, 999));
8308
- const id = userInfo.id ? userInfo.id : userInfo.uid;
8309
- const isNew = true;
8310
- const payload = camUtils.getAMPayload(id, id, roleName, roleCategory, 'CHALLENGED', caseId, request, beginTime, endTime, isNew);
8311
- return this.http.post(`/api/challenged-access-request`, payload);
8312
- }
8313
- createSpecificAccessRequest(caseId, sar) {
8314
- // Assignment API endpoint
8315
- const userInfoStr = this.sessionStorageService.getItem('userDetails');
8316
- const camUtils = new CaseAccessUtils();
8317
- let userInfo;
8318
- if (userInfoStr) {
8319
- userInfo = JSON.parse(userInfoStr);
8320
- }
8321
- const roleCategory = userInfo.roleCategory || camUtils.getMappedRoleCategory(userInfo.roles, userInfo.roleCategories);
8322
- const roleName = camUtils.getAMRoleName('specific', roleCategory);
8323
- const id = userInfo.id ? userInfo.id : userInfo.uid;
8324
- const payload = camUtils.getAMPayload(null, id, roleName, roleCategory, 'SPECIFIC', caseId, sar, null, null, true);
8325
- payload.roleRequest = {
8326
- ...payload.roleRequest,
8327
- process: 'specific-access',
8328
- replaceExisting: true,
8329
- assignerId: payload.requestedRoles[0].actorId,
8330
- reference: `${caseId}/${roleName}/${payload.requestedRoles[0].actorId}`
8331
- };
8332
- payload.requestedRoles[0] = {
8333
- ...payload.requestedRoles[0],
8334
- roleName: 'specific-access-requested',
8335
- roleCategory,
8336
- classification: 'PRIVATE',
8337
- endTime: new Date(new Date().setDate(new Date().getDate() + 30)),
8338
- beginTime: null,
8339
- grantType: 'BASIC',
8340
- readOnly: true
8341
- };
8342
- payload.requestedRoles[0].attributes = {
8343
- ...payload.requestedRoles[0].attributes,
8344
- requestedRole: roleName,
8345
- specificAccessReason: sar.specificReason
8346
- };
8347
- payload.requestedRoles[0].notes[0] = {
8348
- ...payload.requestedRoles[0].notes[0],
8349
- userId: payload.requestedRoles[0].actorId
8350
- };
8351
- return this.http.post(`/api/specific-access-request`, payload);
8352
- }
8353
- getLinkedCases(caseId) {
8354
- const url = `${this.appConfig.getCaseDataStoreApiUrl()}/${caseId}`;
8355
- return this.http
8356
- .get(url)
8357
- .pipe(catchError(error => throwError(error)));
8358
- }
8359
- addClientContextHeader(headers) {
8360
- const clientContextDetails = this.sessionStorageService.getItem('clientContext');
8361
- if (clientContextDetails) {
8362
- const caseEditUtils = new CaseEditUtils();
8363
- // below changes non-ASCII characters
8364
- const editedClientContext = caseEditUtils.convertNonASCIICharacters(clientContextDetails);
8365
- const clientContext = window.btoa(editedClientContext);
8366
- if (clientContext) {
8367
- headers = headers.set('Client-Context', clientContext);
8368
- }
8369
- }
8370
- return headers;
8371
- }
8372
- updateClientContextStorage(headers) {
8373
- if (headers && headers.get('Client-Context')) {
8374
- const caseEditUtils = new CaseEditUtils();
8375
- const clientContextString = window.atob(headers.get('Client-Context'));
8376
- // below reverts non-ASCII characters
8377
- const editedClientContextString = caseEditUtils.convertHTMLEntities(clientContextString);
8378
- this.sessionStorageService.setItem('clientContext', editedClientContextString);
8379
- }
8380
- }
8381
- static ɵfac = function CasesService_Factory(t) { return new (t || CasesService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(OrderService), i0.ɵɵinject(HttpErrorService), i0.ɵɵinject(WizardPageFieldToCaseFieldMapper), i0.ɵɵinject(LoadingService), i0.ɵɵinject(SessionStorageService), i0.ɵɵinject(RetryUtil)); };
8382
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CasesService, factory: CasesService.ɵfac });
8383
- }
8384
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CasesService, [{
8385
- type: Injectable
8386
- }], () => [{ type: HttpService }, { type: AbstractAppConfig }, { type: OrderService }, { type: HttpErrorService }, { type: WizardPageFieldToCaseFieldMapper }, { type: LoadingService }, { type: SessionStorageService }, { type: RetryUtil }], null); })();
8387
-
8388
- class EventTriggerService {
8389
- eventTriggerSource = new Subject();
8390
- announceEventTrigger(eventTrigger) {
8391
- this.eventTriggerSource.next(eventTrigger);
8392
- }
8393
- static ɵfac = function EventTriggerService_Factory(t) { return new (t || EventTriggerService)(); };
8394
- static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: EventTriggerService, factory: EventTriggerService.ɵfac, providedIn: 'root' });
8395
- }
8396
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EventTriggerService, [{
8397
- type: Injectable,
8398
- args: [{
8399
- providedIn: 'root',
8400
- }]
8401
- }], null, null); })();
8402
-
8403
- function CaseCreateComponent_div_0_Template(rf, ctx) { if (rf & 1) {
8404
- const _r1 = i0.ɵɵgetCurrentView();
8405
- i0.ɵɵelementStart(0, "div")(1, "ccd-case-edit", 1);
8406
- i0.ɵɵlistener("cancelled", function CaseCreateComponent_div_0_Template_ccd_case_edit_cancelled_1_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.emitCancelled($event)); })("submitted", function CaseCreateComponent_div_0_Template_ccd_case_edit_submitted_1_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.emitSubmitted($event)); });
8407
- i0.ɵɵelementEnd()();
8408
- } if (rf & 2) {
8409
- const ctx_r1 = i0.ɵɵnextContext();
8410
- i0.ɵɵadvance();
8411
- i0.ɵɵproperty("submit", ctx_r1.submit())("validate", ctx_r1.validate())("saveDraft", ctx_r1.saveDraft())("eventTrigger", ctx_r1.eventTrigger);
8412
- } }
8413
- class CaseCreateComponent {
8414
- casesService;
8415
- alertService;
8416
- draftService;
8417
- eventTriggerService;
8418
- jurisdiction;
8419
- caseType;
8420
- event;
8421
- cancelled = new EventEmitter();
8422
- submitted = new EventEmitter();
8423
- eventTrigger;
8424
- constructor(casesService, alertService, draftService, eventTriggerService) {
8425
- this.casesService = casesService;
8426
- this.alertService = alertService;
8427
- this.draftService = draftService;
8428
- this.eventTriggerService = eventTriggerService;
8429
- }
8430
- ngOnInit() {
8431
- this.casesService.getEventTrigger(this.caseType, this.event).toPromise()
8432
- .then(eventTrigger => {
8433
- this.eventTrigger = eventTrigger;
8434
- this.eventTriggerService.announceEventTrigger(eventTrigger);
8435
- })
8436
- .catch((error) => {
8437
- this.alertService.error({ phrase: error.message });
8438
- return throwError(error);
8439
- });
8440
- }
8441
- submit() {
8442
- return (sanitizedEditForm) => {
8443
- sanitizedEditForm.draft_id = this.eventTrigger.case_id;
8444
- return this.casesService.createCase(this.caseType, sanitizedEditForm);
8445
- };
8446
- }
8447
- validate() {
8448
- return (sanitizedEditForm, pageId) => this.casesService
8449
- .validateCase(this.caseType, sanitizedEditForm, pageId);
8450
- }
8451
- saveDraft() {
8452
- if (this.eventTrigger.can_save_draft) {
8453
- return (caseEventData) => this.draftService.createOrUpdateDraft(this.caseType, this.eventTrigger.case_id, caseEventData);
8454
- }
8455
- }
8456
- emitCancelled(event) {
8457
- this.cancelled.emit(event);
8458
- }
8459
- emitSubmitted(event) {
8460
- this.submitted.emit(event);
8461
- }
8462
- isDataLoaded() {
8463
- return this.eventTrigger ? true : false;
8464
- }
8465
- static ɵfac = function CaseCreateComponent_Factory(t) { return new (t || CaseCreateComponent)(i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(DraftService), i0.ɵɵdirectiveInject(EventTriggerService)); };
8466
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseCreateComponent, selectors: [["ccd-case-create"]], inputs: { jurisdiction: "jurisdiction", caseType: "caseType", event: "event" }, outputs: { cancelled: "cancelled", submitted: "submitted" }, decls: 1, vars: 1, consts: [[4, "ngIf"], [3, "cancelled", "submitted", "submit", "validate", "saveDraft", "eventTrigger"]], template: function CaseCreateComponent_Template(rf, ctx) { if (rf & 1) {
8467
- i0.ɵɵtemplate(0, CaseCreateComponent_div_0_Template, 2, 4, "div", 0);
8468
- } if (rf & 2) {
8469
- i0.ɵɵproperty("ngIf", ctx.isDataLoaded());
8470
- } }, encapsulation: 2 });
8471
- }
8472
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseCreateComponent, [{
8473
- type: Component,
8474
- args: [{ selector: 'ccd-case-create', template: "<div *ngIf=\"isDataLoaded()\">\n <ccd-case-edit [submit]=\"submit()\"\n [validate]=\"validate()\"\n [saveDraft]=\"saveDraft()\"\n [eventTrigger]=\"eventTrigger\"\n (cancelled)=\"emitCancelled($event)\"\n (submitted)=\"emitSubmitted($event)\"></ccd-case-edit>\n</div>" }]
8475
- }], () => [{ type: CasesService }, { type: AlertService }, { type: DraftService }, { type: EventTriggerService }], { jurisdiction: [{
8476
- type: Input
8477
- }], caseType: [{
8478
- type: Input
8479
- }], event: [{
8480
- type: Input
8481
- }], cancelled: [{
8482
- type: Output
8483
- }], submitted: [{
8484
- type: Output
8485
- }] }); })();
8486
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseCreateComponent, { className: "CaseCreateComponent", filePath: "lib/shared/components/case-editor/case-create/case-create.component.ts", lineNumber: 17 }); })();
8487
-
8488
8056
  class Confirmation {
8489
8057
  caseId;
8490
8058
  status;
@@ -8622,6 +8190,21 @@ class ConvertHrefToRouterService {
8622
8190
  type: Injectable
8623
8191
  }], () => [{ type: i1$1.Router }], null); })();
8624
8192
 
8193
+ class EventTriggerService {
8194
+ eventTriggerSource = new Subject();
8195
+ announceEventTrigger(eventTrigger) {
8196
+ this.eventTriggerSource.next(eventTrigger);
8197
+ }
8198
+ static ɵfac = function EventTriggerService_Factory(t) { return new (t || EventTriggerService)(); };
8199
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: EventTriggerService, factory: EventTriggerService.ɵfac, providedIn: 'root' });
8200
+ }
8201
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EventTriggerService, [{
8202
+ type: Injectable,
8203
+ args: [{
8204
+ providedIn: 'root',
8205
+ }]
8206
+ }], null, null); })();
8207
+
8625
8208
  class WizardFactoryService {
8626
8209
  create(eventTrigger) {
8627
8210
  return new Wizard(eventTrigger.wizard_pages);
@@ -8904,7 +8487,7 @@ class EventCompletionStateMachineService {
8904
8487
  entryActionForStateCompleteEventAndTask(state, context) {
8905
8488
  // Trigger final state to complete processing of state machine
8906
8489
  state.trigger(EventCompletionStates.Final);
8907
- const clientContextStr = context.sessionStorageService.getItem('clientContext');
8490
+ const clientContextStr = context.sessionStorageService.getItem(CaseEditComponent.CLIENT_CONTEXT);
8908
8491
  const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
8909
8492
  if (userTask?.task_data) {
8910
8493
  context.sessionStorageService.setItem('assignNeeded', 'false');
@@ -8927,7 +8510,7 @@ class EventCompletionStateMachineService {
8927
8510
  entryActionForStateTaskUnassigned(state, context) {
8928
8511
  // Trigger final state to complete processing of state machine
8929
8512
  state.trigger(EventCompletionStates.Final);
8930
- const clientContextStr = context.sessionStorageService.getItem('clientContext');
8513
+ const clientContextStr = context.sessionStorageService.getItem(CaseEditComponent.CLIENT_CONTEXT);
8931
8514
  const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
8932
8515
  if (userTask?.task_data) {
8933
8516
  context.sessionStorageService.setItem('assignNeeded', 'true');
@@ -8967,7 +8550,7 @@ class EventCompletionStateMachineService {
8967
8550
  this.stateTaskUnassigned.addTransition(EventCompletionStates.Final, this.stateFinal);
8968
8551
  }
8969
8552
  taskPresentInSessionStorage(context) {
8970
- const clientContextStr = context.sessionStorageService.getItem('clientContext');
8553
+ const clientContextStr = context.sessionStorageService.getItem(CaseEditComponent.CLIENT_CONTEXT);
8971
8554
  const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
8972
8555
  return !!userTask.task_data;
8973
8556
  }
@@ -9334,8 +8917,11 @@ class CaseEditComponent {
9334
8917
  workAllocationService;
9335
8918
  alertService;
9336
8919
  abstractConfig;
8920
+ cookieService;
9337
8921
  static ORIGIN_QUERY_PARAM = 'origin';
9338
8922
  static ALERT_MESSAGE = 'Page is being refreshed so you will be redirected to the first page of this event.';
8923
+ static CLIENT_CONTEXT = 'clientContext';
8924
+ static TASK_EVENT_COMPLETION_INFO = 'taskEventCompletionInfo';
9339
8925
  eventTrigger;
9340
8926
  submit;
9341
8927
  validate;
@@ -9359,7 +8945,7 @@ class CaseEditComponent {
9359
8945
  error;
9360
8946
  callbackErrorsSubject = new Subject();
9361
8947
  validPageList = [];
9362
- constructor(fb, caseNotifier, router, route, fieldsUtils, fieldsPurger, registrarService, wizardFactory, sessionStorageService, windowsService, formValueService, formErrorService, loadingService, validPageListCaseFieldsService, workAllocationService, alertService, abstractConfig) {
8948
+ constructor(fb, caseNotifier, router, route, fieldsUtils, fieldsPurger, registrarService, wizardFactory, sessionStorageService, windowsService, formValueService, formErrorService, loadingService, validPageListCaseFieldsService, workAllocationService, alertService, abstractConfig, cookieService) {
9363
8949
  this.fb = fb;
9364
8950
  this.caseNotifier = caseNotifier;
9365
8951
  this.router = router;
@@ -9377,6 +8963,7 @@ class CaseEditComponent {
9377
8963
  this.workAllocationService = workAllocationService;
9378
8964
  this.alertService = alertService;
9379
8965
  this.abstractConfig = abstractConfig;
8966
+ this.cookieService = cookieService;
9380
8967
  }
9381
8968
  ngOnInit() {
9382
8969
  this.wizard = this.wizardFactory.create(this.eventTrigger);
@@ -9483,12 +9070,12 @@ class CaseEditComponent {
9483
9070
  this.isSubmitting = true;
9484
9071
  // We have to run the event completion checks if task in session storage
9485
9072
  // and if the task is in session storage, then is it associated to the case
9486
- const clientContextStr = this.sessionStorageService.getItem('clientContext');
9073
+ const clientContextStr = this.sessionStorageService.getItem(CaseEditComponent.CLIENT_CONTEXT);
9487
9074
  const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
9488
9075
  const taskInSessionStorage = userTask ? userTask.task_data : null;
9489
9076
  let taskEventCompletionInfo;
9490
9077
  let userInfo;
9491
- const taskEventCompletionStr = this.sessionStorageService.getItem('taskEventCompletionInfo');
9078
+ const taskEventCompletionStr = this.sessionStorageService.getItem(CaseEditComponent.TASK_EVENT_COMPLETION_INFO);
9492
9079
  const userInfoStr = this.sessionStorageService.getItem('userDetails');
9493
9080
  const assignNeeded = this.sessionStorageService.getItem('assignNeeded');
9494
9081
  if (taskEventCompletionStr) {
@@ -9518,7 +9105,7 @@ class CaseEditComponent {
9518
9105
  taskId: taskInSessionStorage.id,
9519
9106
  createdTimestamp: Date.now()
9520
9107
  };
9521
- this.sessionStorageService.setItem('taskEventCompletionInfo', JSON.stringify(taskEventCompletionInfo));
9108
+ this.sessionStorageService.setItem(CaseEditComponent.TASK_EVENT_COMPLETION_INFO, JSON.stringify(taskEventCompletionInfo));
9522
9109
  this.isEventCompletionChecksRequired = true;
9523
9110
  }
9524
9111
  else {
@@ -9690,8 +9277,9 @@ class CaseEditComponent {
9690
9277
  }), finalize(() => {
9691
9278
  this.loadingService.unregister(loadingSpinnerToken);
9692
9279
  // on event completion ensure the previous event clientContext/taskEventCompletionInfo removed
9693
- this.sessionStorageService.removeItem('clientContext');
9694
- this.sessionStorageService.removeItem('taskEventCompletionInfo');
9280
+ // Note - Not removeTaskFromClientContext because could interfere with other logic
9281
+ this.sessionStorageService.removeItem(CaseEditComponent.CLIENT_CONTEXT);
9282
+ this.sessionStorageService.removeItem(CaseEditComponent.TASK_EVENT_COMPLETION_INFO);
9695
9283
  this.isSubmitting = false;
9696
9284
  }))
9697
9285
  .subscribe(() => {
@@ -9718,124 +9306,585 @@ class CaseEditComponent {
9718
9306
  }
9719
9307
  });
9720
9308
  }
9721
- postCompleteTaskIfRequired() {
9722
- const clientContextStr = this.sessionStorageService.getItem('clientContext');
9723
- const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
9724
- const [task, taskToBeCompleted] = userTask ? [userTask.task_data, userTask.complete_task] : [null, false];
9725
- const assignNeeded = this.sessionStorageService.getItem('assignNeeded') === 'true';
9726
- if (task && assignNeeded && taskToBeCompleted) {
9727
- this.abstractConfig.logMessage(`postCompleteTaskIfRequired with assignNeeded: taskId ${task.id} and event name ${this.eventTrigger.name}`);
9728
- return this.workAllocationService.assignAndCompleteTask(task.id, this.eventTrigger.name);
9729
- }
9730
- else if (task && taskToBeCompleted) {
9731
- this.abstractConfig.logMessage(`postCompleteTaskIfRequired: taskId ${task.id} and event name ${this.eventTrigger.name}`);
9732
- return this.workAllocationService.completeTask(task.id, this.eventTrigger.name);
9309
+ postCompleteTaskIfRequired() {
9310
+ const clientContextStr = this.sessionStorageService.getItem(CaseEditComponent.CLIENT_CONTEXT);
9311
+ const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
9312
+ const [task, taskToBeCompleted] = userTask ? [userTask.task_data, userTask.complete_task] : [null, false];
9313
+ const assignNeeded = this.sessionStorageService.getItem('assignNeeded') === 'true';
9314
+ if (task && assignNeeded && taskToBeCompleted) {
9315
+ this.abstractConfig.logMessage(`postCompleteTaskIfRequired with assignNeeded: taskId ${task.id} and event name ${this.eventTrigger.name}`);
9316
+ return this.workAllocationService.assignAndCompleteTask(task.id, this.eventTrigger.name);
9317
+ }
9318
+ else if (task && taskToBeCompleted) {
9319
+ this.abstractConfig.logMessage(`postCompleteTaskIfRequired: taskId ${task.id} and event name ${this.eventTrigger.name}`);
9320
+ return this.workAllocationService.completeTask(task.id, this.eventTrigger.name);
9321
+ }
9322
+ return of(true);
9323
+ }
9324
+ finishEventCompletionLogic(eventResponse) {
9325
+ this.caseNotifier.cachedCaseView = null;
9326
+ this.sessionStorageService.removeItem('eventUrl');
9327
+ const confirmation = this.buildConfirmation(eventResponse);
9328
+ if (confirmation && (confirmation.getHeader() || confirmation.getBody())) {
9329
+ this.confirm(confirmation);
9330
+ }
9331
+ else {
9332
+ this.emitSubmitted(eventResponse);
9333
+ }
9334
+ }
9335
+ buildConfirmation(response) {
9336
+ if (response['after_submit_callback_response']) {
9337
+ return new Confirmation(response['id'], response['callback_response_status'], response['after_submit_callback_response']['confirmation_header'], response['after_submit_callback_response']['confirmation_body']);
9338
+ }
9339
+ else {
9340
+ return null;
9341
+ }
9342
+ }
9343
+ // checks whether current clientContext relevant for the event
9344
+ taskExistsForThisEvent(taskInSessionStorage, taskEventCompletionInfo, eventDetails) {
9345
+ if (!taskInSessionStorage || taskInSessionStorage.case_id !== eventDetails.caseId) {
9346
+ return false;
9347
+ }
9348
+ if (!taskEventCompletionInfo) {
9349
+ // if no task event present then there is no task to complete from previous event present
9350
+ // EXUI-2668 - Add additional logic to confirm the task is relevant to the event
9351
+ if (this.taskIsForEvent(taskInSessionStorage, eventDetails)) {
9352
+ return true;
9353
+ }
9354
+ else {
9355
+ // client context still needed for language
9356
+ removeTaskFromClientContext(this.sessionStorageService);
9357
+ return false;
9358
+ }
9359
+ }
9360
+ else {
9361
+ if (taskEventCompletionInfo.taskId !== taskInSessionStorage.id) {
9362
+ return true;
9363
+ }
9364
+ else if ((taskEventCompletionInfo.taskId === taskInSessionStorage.id &&
9365
+ this.eventDetailsDoNotMatch(taskEventCompletionInfo, eventDetails))
9366
+ || this.eventMoreThanDayAgo(taskEventCompletionInfo.createdTimestamp)) {
9367
+ // if the session storage not related to event, ignore it and remove
9368
+ removeTaskFromClientContext(this.sessionStorageService);
9369
+ this.sessionStorageService.removeItem(CaseEditComponent.TASK_EVENT_COMPLETION_INFO);
9370
+ return false;
9371
+ }
9372
+ if (eventDetails.assignNeeded === 'false' && eventDetails.userId !== taskInSessionStorage.assignee) {
9373
+ // if the user does not match task assignee, assign is now needed
9374
+ // data cannot be deleted and ignored as it matches understanding
9375
+ this.sessionStorageService.setItem('assignNeeded', 'true');
9376
+ }
9377
+ return true;
9378
+ }
9379
+ }
9380
+ onEventCanBeCompleted({ eventTrigger, eventCanBeCompleted, caseDetails, form, submit }) {
9381
+ if (eventCanBeCompleted) {
9382
+ // Submit
9383
+ const caseEventData = this.generateCaseEventData({ eventTrigger, form });
9384
+ this.caseSubmit({ form, caseEventData, submit });
9385
+ }
9386
+ else {
9387
+ // Navigate to tasks tab on case details page
9388
+ this.router.navigate([`/cases/case-details/${this.getCaseId(caseDetails)}/tasks`], { relativeTo: this.route });
9389
+ }
9390
+ }
9391
+ getStatus(response) {
9392
+ return this.hasCallbackFailed(response) ? response['callback_response_status'] : response['delete_draft_response_status'];
9393
+ }
9394
+ hasCallbackFailed(response) {
9395
+ return response['callback_response_status'] !== 'CALLBACK_COMPLETED';
9396
+ }
9397
+ eventMoreThanDayAgo(timestamp) {
9398
+ if ((new Date().getTime() - timestamp) > (24 * 60 * 60 * 1000)) {
9399
+ return true;
9400
+ }
9401
+ return false;
9402
+ }
9403
+ eventDetailsDoNotMatch(taskEventCompletionInfo, eventDetails) {
9404
+ if (taskEventCompletionInfo.eventId !== eventDetails.eventId
9405
+ || taskEventCompletionInfo.caseId !== eventDetails.caseId
9406
+ || taskEventCompletionInfo.userId !== eventDetails.userId) {
9407
+ return true;
9408
+ }
9409
+ return false;
9410
+ }
9411
+ taskIsForEvent(task, eventDetails) {
9412
+ // EXUI-2668 - Ensure description for task includes event ID
9413
+ // Note - This is a failsafe for an edge case that may never occur again
9414
+ // Description may not include eventId in some cases which may mean task not completed (however this will be easy to check)
9415
+ // In instances of the above taskEventCompletionInfo will be created to block this check from occurring
9416
+ this.abstractConfig.logMessage(`checking taskIsForEvent: task ID ${task.id}, task description ${task.description}, event name ${eventDetails.eventId}`);
9417
+ return task.case_id === eventDetails.caseId && (task.description?.includes(eventDetails.eventId));
9418
+ }
9419
+ static ɵfac = function CaseEditComponent_Factory(t) { return new (t || CaseEditComponent)(i0.ɵɵdirectiveInject(i4.FormBuilder), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(FieldsUtils), i0.ɵɵdirectiveInject(FieldsPurger), i0.ɵɵdirectiveInject(ConditionalShowRegistrarService), i0.ɵɵdirectiveInject(WizardFactoryService), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(WindowService), i0.ɵɵdirectiveInject(FormValueService), i0.ɵɵdirectiveInject(FormErrorService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(ValidPageListCaseFieldsService), i0.ɵɵdirectiveInject(WorkAllocationService), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(AbstractAppConfig), i0.ɵɵdirectiveInject(ReadCookieService)); };
9420
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditComponent, selectors: [["ccd-case-edit"]], inputs: { eventTrigger: "eventTrigger", submit: "submit", validate: "validate", saveDraft: "saveDraft", caseDetails: "caseDetails" }, outputs: { cancelled: "cancelled", submitted: "submitted" }, features: [i0.ɵɵProvidersFeature([GreyBarService])], decls: 1, vars: 0, template: function CaseEditComponent_Template(rf, ctx) { if (rf & 1) {
9421
+ i0.ɵɵelement(0, "router-outlet");
9422
+ } }, dependencies: [i1$1.RouterOutlet], styles: ["#fieldset-case-data[_ngcontent-%COMP%]{margin-bottom:30px}#fieldset-case-data[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{width:1%;white-space:nowrap;vertical-align:top}.compound-field[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:0}#confirmation-header[_ngcontent-%COMP%]{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body[_ngcontent-%COMP%]{width:630px;background-color:#fff}.valign-top[_ngcontent-%COMP%]{vertical-align:top}.summary-fields[_ngcontent-%COMP%]{margin-bottom:30px}.summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:0px}a.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:default}.case-field-label[_ngcontent-%COMP%]{width:45%}.case-field-content[_ngcontent-%COMP%]{width:50%}.no-bottom-border[_ngcontent-%COMP%]{border-bottom:none}.case-field-change[_ngcontent-%COMP%]{width:5%}"] });
9423
+ }
9424
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditComponent, [{
9425
+ type: Component,
9426
+ args: [{ selector: 'ccd-case-edit', providers: [GreyBarService], template: "<router-outlet></router-outlet>\n", styles: ["#fieldset-case-data{margin-bottom:30px}#fieldset-case-data th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}#confirmation-header{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body{width:630px;background-color:#fff}.valign-top{vertical-align:top}.summary-fields{margin-bottom:30px}.summary-fields tbody tr th,.summary-fields tbody tr td{border-bottom:0px}a.disabled{pointer-events:none;cursor:default}.case-field-label{width:45%}.case-field-content{width:50%}.no-bottom-border{border-bottom:none}.case-field-change{width:5%}\n"] }]
9427
+ }], () => [{ type: i4.FormBuilder }, { type: CaseNotifier }, { type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: FieldsUtils }, { type: FieldsPurger }, { type: ConditionalShowRegistrarService }, { type: WizardFactoryService }, { type: SessionStorageService }, { type: WindowService }, { type: FormValueService }, { type: FormErrorService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }, { type: WorkAllocationService }, { type: AlertService }, { type: AbstractAppConfig }, { type: ReadCookieService }], { eventTrigger: [{
9428
+ type: Input
9429
+ }], submit: [{
9430
+ type: Input
9431
+ }], validate: [{
9432
+ type: Input
9433
+ }], saveDraft: [{
9434
+ type: Input
9435
+ }], caseDetails: [{
9436
+ type: Input
9437
+ }], cancelled: [{
9438
+ type: Output
9439
+ }], submitted: [{
9440
+ type: Output
9441
+ }] }); })();
9442
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditComponent, { className: "CaseEditComponent", filePath: "lib/shared/components/case-editor/case-edit/case-edit.component.ts", lineNumber: 37 }); })();
9443
+
9444
+ function convertNonASCIICharacter(character) {
9445
+ if (character === '£') {
9446
+ // pound sign will be frequently used and works for btoa despite being non-ASCII
9447
+ // note: this could be done for other characters provided they work for btoa()
9448
+ return character;
9449
+ }
9450
+ // Note: Will convert to HTML entity
9451
+ return CaseEditUtils.PREFIX + character.charCodeAt(0) + CaseEditUtils.SUFFIX;
9452
+ }
9453
+ class CaseEditUtils {
9454
+ static PREFIX = '&#';
9455
+ static SUFFIX = ';';
9456
+ convertNonASCIICharacters(rawString) {
9457
+ return rawString ? rawString.replace(/[^\x20-\x7E]/g, function (c) {
9458
+ return convertNonASCIICharacter(c);
9459
+ }) : '';
9460
+ }
9461
+ convertHTMLEntities(editedString) {
9462
+ const revertedCharacterList = editedString.split(CaseEditUtils.PREFIX);
9463
+ let rawString = revertedCharacterList[0];
9464
+ for (let index = 1; index < revertedCharacterList.length; index++) {
9465
+ const currentSection = revertedCharacterList[index];
9466
+ if (!currentSection.includes(CaseEditUtils.SUFFIX)) {
9467
+ return rawString.concat(currentSection);
9468
+ }
9469
+ else {
9470
+ const suffixSplitList = currentSection.split(CaseEditUtils.SUFFIX);
9471
+ const characterCode = Number(suffixSplitList[0]);
9472
+ rawString = rawString.concat(String.fromCharCode(characterCode), suffixSplitList[1]);
9473
+ }
9474
+ }
9475
+ return rawString;
9476
+ }
9477
+ }
9478
+ function removeTaskFromClientContext(sessionStorageService) {
9479
+ if (!sessionStorageService) {
9480
+ return;
9481
+ }
9482
+ const clientContextString = sessionStorageService.getItem(CaseEditComponent.CLIENT_CONTEXT);
9483
+ const clientContext = clientContextString ? JSON.parse(clientContextString) : null;
9484
+ if (clientContext?.client_context?.user_task) {
9485
+ delete clientContext.client_context.user_task;
9486
+ sessionStorageService.setItem(CaseEditComponent.CLIENT_CONTEXT, JSON.stringify(clientContext));
9487
+ }
9488
+ }
9489
+
9490
+ class CasesService {
9491
+ http;
9492
+ appConfig;
9493
+ orderService;
9494
+ errorService;
9495
+ wizardPageFieldToCaseFieldMapper;
9496
+ loadingService;
9497
+ sessionStorageService;
9498
+ retryUtil;
9499
+ // Internal (UI) API
9500
+ static V2_MEDIATYPE_CASE_VIEW = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-case-view.v2+json';
9501
+ static V2_MEDIATYPE_START_CASE_TRIGGER = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-start-case-trigger.v2+json;charset=UTF-8';
9502
+ static V2_MEDIATYPE_START_EVENT_TRIGGER = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-start-event-trigger.v2+json;charset=UTF-8';
9503
+ static V2_MEDIATYPE_START_DRAFT_TRIGGER = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.ui-start-draft-trigger.v2+json;charset=UTF-8';
9504
+ // External (Data Store) API
9505
+ static V2_MEDIATYPE_CASE_DOCUMENTS = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.case-documents.v2+json;charset=UTF-8';
9506
+ static V2_MEDIATYPE_CASE_DATA_VALIDATE = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.case-data-validate.v2+json;charset=UTF-8';
9507
+ static V2_MEDIATYPE_CREATE_EVENT = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.create-event.v2+json;charset=UTF-8';
9508
+ static V2_MEDIATYPE_CREATE_CASE = 'application/vnd.uk.gov.hmcts.ccd-data-store-api.create-case.v2+json;charset=UTF-8';
9509
+ static PUI_CASE_MANAGER = 'pui-case-manager';
9510
+ get = this.getCaseView;
9511
+ static updateChallengedAccessRequestAttributes(httpClient, caseId, attributesToUpdate) {
9512
+ return httpClient.post(`/api/challenged-access-request/update-attributes`, {
9513
+ caseId,
9514
+ attributesToUpdate
9515
+ });
9516
+ }
9517
+ static updateSpecificAccessRequestAttributes(httpClient, caseId, attributesToUpdate) {
9518
+ return httpClient.post(`/api/specific-access-request/update-attributes`, {
9519
+ caseId,
9520
+ attributesToUpdate
9521
+ });
9522
+ }
9523
+ constructor(http, appConfig, orderService, errorService, wizardPageFieldToCaseFieldMapper, loadingService, sessionStorageService, retryUtil) {
9524
+ this.http = http;
9525
+ this.appConfig = appConfig;
9526
+ this.orderService = orderService;
9527
+ this.errorService = errorService;
9528
+ this.wizardPageFieldToCaseFieldMapper = wizardPageFieldToCaseFieldMapper;
9529
+ this.loadingService = loadingService;
9530
+ this.sessionStorageService = sessionStorageService;
9531
+ this.retryUtil = retryUtil;
9532
+ }
9533
+ getCaseView(jurisdictionId, caseTypeId, caseId) {
9534
+ const url = `${this.appConfig.getApiUrl()}/caseworkers/:uid/jurisdictions/${jurisdictionId}/case-types/${caseTypeId}/cases/${caseId}`;
9535
+ const loadingToken = this.loadingService.register();
9536
+ return this.http
9537
+ .get(url)
9538
+ .pipe(catchError(error => {
9539
+ this.errorService.setError(error);
9540
+ return throwError(error);
9541
+ }), finalize(() => this.loadingService.unregister(loadingToken)));
9542
+ }
9543
+ getCaseViewV2(caseId) {
9544
+ const url = `${this.appConfig.getCaseDataUrl()}/internal/cases/${caseId}`;
9545
+ const headers = new HttpHeaders()
9546
+ .set('experimental', 'true')
9547
+ .set('Accept', CasesService.V2_MEDIATYPE_CASE_VIEW)
9548
+ .set('Content-Type', 'application/json');
9549
+ const loadingToken = this.loadingService.register();
9550
+ let http$ = this.http.get(url, { headers, observe: 'body' });
9551
+ const artificialDelay = this.appConfig.getTimeoutsCaseRetrievalArtificialDelay();
9552
+ const timeoutPeriods = this.appConfig.getTimeoutsForCaseRetrieval();
9553
+ console.log(`Timeout periods: ${timeoutPeriods} seconds.`);
9554
+ if (timeoutPeriods && timeoutPeriods.length > 0 && timeoutPeriods[0] > 0) {
9555
+ http$ = this.retryUtil.pipeTimeoutMechanismOn(http$, artificialDelay, timeoutPeriods);
9556
+ }
9557
+ else {
9558
+ console.warn('Skipping to pipe a retry mechanism!');
9559
+ }
9560
+ http$ = this.pipeErrorProcessor(http$);
9561
+ http$ = http$.pipe(finalize(() => this.finalizeGetCaseViewWith(caseId, loadingToken)));
9562
+ return http$;
9563
+ }
9564
+ pipeErrorProcessor(in$) {
9565
+ const out$ = in$.pipe(catchError(error => {
9566
+ console.error(`Error while getting case view with getCaseViewV2! Error type: '${typeof error}, Error name: '${error?.name}'`);
9567
+ console.error(error);
9568
+ this.errorService.setError(error);
9569
+ return throwError(error);
9570
+ }));
9571
+ return out$;
9572
+ }
9573
+ finalizeGetCaseViewWith(caseId, loadingToken) {
9574
+ this.loadingService.unregister(loadingToken);
9575
+ }
9576
+ syncWait(seconds) {
9577
+ const end = Date.now() + seconds * 1000;
9578
+ while (Date.now() < end)
9579
+ continue;
9580
+ }
9581
+ getEventTrigger(caseTypeId, eventTriggerId, caseId, ignoreWarning) {
9582
+ ignoreWarning = undefined !== ignoreWarning ? ignoreWarning : 'false';
9583
+ const url = this.buildEventTriggerUrl(caseTypeId, eventTriggerId, caseId, ignoreWarning);
9584
+ let headers = new HttpHeaders();
9585
+ headers = headers.set('experimental', 'true');
9586
+ headers = headers.set('Content-Type', 'application/json');
9587
+ headers = this.addClientContextHeader(headers);
9588
+ if (Draft.isDraft(caseId)) {
9589
+ headers = headers.set('Accept', CasesService.V2_MEDIATYPE_START_DRAFT_TRIGGER);
9590
+ }
9591
+ else if (caseId !== undefined && caseId !== null) {
9592
+ headers = headers.set('Accept', CasesService.V2_MEDIATYPE_START_EVENT_TRIGGER);
9593
+ }
9594
+ else {
9595
+ headers = headers.set('Accept', CasesService.V2_MEDIATYPE_START_CASE_TRIGGER);
9596
+ }
9597
+ return this.http
9598
+ .get(url, { headers, observe: 'response' })
9599
+ .pipe(map((response) => {
9600
+ this.updateClientContextStorage(response.headers);
9601
+ return FieldsUtils.handleNestedDynamicLists(response.body);
9602
+ }), catchError(error => {
9603
+ this.errorService.setError(error);
9604
+ return throwError(error);
9605
+ }), map((p) => plainToClass(CaseEventTrigger, p)), tap(eventTrigger => this.initialiseEventTrigger(eventTrigger)));
9606
+ }
9607
+ createEvent(caseDetails, eventData) {
9608
+ const caseId = caseDetails.case_id;
9609
+ const url = `${this.appConfig.getCaseDataUrl()}/cases/${caseId}/events`;
9610
+ let headers = new HttpHeaders()
9611
+ .set('experimental', 'true')
9612
+ .set('Accept', CasesService.V2_MEDIATYPE_CREATE_EVENT)
9613
+ .set('Content-Type', 'application/json');
9614
+ headers = this.addClientContextHeader(headers);
9615
+ return this.http
9616
+ .post(url, eventData, { headers, observe: 'response' })
9617
+ .pipe(map((response) => {
9618
+ this.updateClientContextStorage(response.headers);
9619
+ return response.body;
9620
+ }), catchError(error => {
9621
+ this.errorService.setError(error);
9622
+ return throwError(error);
9623
+ }));
9624
+ }
9625
+ validateCase(ctid, eventData, pageId) {
9626
+ const pageIdString = pageId ? `?pageId=${pageId}` : '';
9627
+ const url = `${this.appConfig.getCaseDataUrl()}/case-types/${ctid}/validate${pageIdString}`;
9628
+ let headers = new HttpHeaders()
9629
+ .set('experimental', 'true')
9630
+ .set('Accept', CasesService.V2_MEDIATYPE_CASE_DATA_VALIDATE)
9631
+ .set('Content-Type', 'application/json');
9632
+ headers = this.addClientContextHeader(headers);
9633
+ return this.http
9634
+ .post(url, eventData, { headers, observe: 'response' })
9635
+ .pipe(map((response) => {
9636
+ this.updateClientContextStorage(response.headers);
9637
+ return response.body;
9638
+ }), catchError(error => {
9639
+ this.errorService.setError(error);
9640
+ return throwError(error);
9641
+ }));
9642
+ }
9643
+ createCase(ctid, eventData) {
9644
+ let ignoreWarning = 'false';
9645
+ if (eventData.ignore_warning) {
9646
+ ignoreWarning = 'true';
9647
+ }
9648
+ const url = `${this.appConfig.getCaseDataUrl()}/case-types/${ctid}/cases?ignore-warning=${ignoreWarning}`;
9649
+ let headers = new HttpHeaders()
9650
+ .set('experimental', 'true')
9651
+ .set('Accept', CasesService.V2_MEDIATYPE_CREATE_CASE)
9652
+ .set('Content-Type', 'application/json');
9653
+ headers = this.addClientContextHeader(headers);
9654
+ return this.http
9655
+ .post(url, eventData, { headers, observe: 'response' })
9656
+ .pipe(map((response) => {
9657
+ this.updateClientContextStorage(response.headers);
9658
+ return response.body;
9659
+ }), catchError(error => {
9660
+ this.errorService.setError(error);
9661
+ return throwError(error);
9662
+ }));
9663
+ }
9664
+ getPrintDocuments(caseId) {
9665
+ const url = `${this.appConfig.getCaseDataUrl()}/cases/${caseId}/documents`;
9666
+ let headers = new HttpHeaders()
9667
+ .set('experimental', 'true')
9668
+ .set('Accept', CasesService.V2_MEDIATYPE_CASE_DOCUMENTS)
9669
+ .set('Content-Type', 'application/json');
9670
+ headers = this.addClientContextHeader(headers);
9671
+ return this.http
9672
+ .get(url, { headers, observe: 'response' })
9673
+ .pipe(map((response) => {
9674
+ this.updateClientContextStorage(response.headers);
9675
+ return response.body.documentResources;
9676
+ }), catchError(error => {
9677
+ this.errorService.setError(error);
9678
+ return throwError(error);
9679
+ }));
9680
+ }
9681
+ buildEventTriggerUrl(caseTypeId, eventTriggerId, caseId, ignoreWarning) {
9682
+ let url = `${this.appConfig.getCaseDataUrl()}/internal`;
9683
+ if (Draft.isDraft(caseId)) {
9684
+ url += `/drafts/${caseId}`
9685
+ + `/event-trigger`
9686
+ + `?ignore-warning=${ignoreWarning}`;
9733
9687
  }
9734
- return of(true);
9735
- }
9736
- finishEventCompletionLogic(eventResponse) {
9737
- this.caseNotifier.cachedCaseView = null;
9738
- this.sessionStorageService.removeItem('eventUrl');
9739
- const confirmation = this.buildConfirmation(eventResponse);
9740
- if (confirmation && (confirmation.getHeader() || confirmation.getBody())) {
9741
- this.confirm(confirmation);
9688
+ else if (caseTypeId === undefined || caseTypeId === null) {
9689
+ url += `/cases/${caseId}`
9690
+ + `/event-triggers/${eventTriggerId}`
9691
+ + `?ignore-warning=${ignoreWarning}`;
9742
9692
  }
9743
9693
  else {
9744
- this.emitSubmitted(eventResponse);
9694
+ url += `/case-types/${caseTypeId}`
9695
+ + `/event-triggers/${eventTriggerId}`
9696
+ + `?ignore-warning=${ignoreWarning}`;
9745
9697
  }
9698
+ return url;
9746
9699
  }
9747
- buildConfirmation(response) {
9748
- if (response['after_submit_callback_response']) {
9749
- return new Confirmation(response['id'], response['callback_response_status'], response['after_submit_callback_response']['confirmation_header'], response['after_submit_callback_response']['confirmation_body']);
9750
- }
9751
- else {
9752
- return null;
9700
+ initialiseEventTrigger(eventTrigger) {
9701
+ if (!eventTrigger.wizard_pages) {
9702
+ eventTrigger.wizard_pages = [];
9753
9703
  }
9704
+ eventTrigger.wizard_pages.forEach((wizardPage) => {
9705
+ wizardPage.parsedShowCondition = ShowCondition.getInstance(wizardPage.show_condition);
9706
+ wizardPage.case_fields = this.orderService.sort(this.wizardPageFieldToCaseFieldMapper.mapAll(wizardPage.wizard_page_fields, eventTrigger.case_fields));
9707
+ });
9754
9708
  }
9755
- // checks whether current clientContext relevant for the event
9756
- taskExistsForThisEvent(taskInSessionStorage, taskEventCompletionInfo, eventDetails) {
9757
- if (!taskInSessionStorage || taskInSessionStorage.case_id !== eventDetails.caseId) {
9758
- return false;
9709
+ getCourtOrHearingCentreName(locationId) {
9710
+ return this.http.post(`/api/locations/getLocationsById`, { locations: [{ locationId }] });
9711
+ }
9712
+ createChallengedAccessRequest(caseId, request) {
9713
+ // Assignment API endpoint
9714
+ const userInfoStr = this.sessionStorageService.getItem('userDetails');
9715
+ const camUtils = new CaseAccessUtils();
9716
+ let userInfo;
9717
+ if (userInfoStr) {
9718
+ userInfo = JSON.parse(userInfoStr);
9759
9719
  }
9760
- if (!taskEventCompletionInfo) {
9761
- // if no task event present then there is no task to complete from previous event present
9762
- return true;
9720
+ const roleCategory = userInfo.roleCategory || camUtils.getMappedRoleCategory(userInfo.roles, userInfo.roleCategories);
9721
+ const roleName = camUtils.getAMRoleName('challenged', roleCategory);
9722
+ const beginTime = new Date();
9723
+ const endTime = new Date(new Date().setUTCHours(23, 59, 59, 999));
9724
+ const id = userInfo.id ? userInfo.id : userInfo.uid;
9725
+ const isNew = true;
9726
+ const payload = camUtils.getAMPayload(id, id, roleName, roleCategory, 'CHALLENGED', caseId, request, beginTime, endTime, isNew);
9727
+ return this.http.post(`/api/challenged-access-request`, payload);
9728
+ }
9729
+ createSpecificAccessRequest(caseId, sar) {
9730
+ // Assignment API endpoint
9731
+ const userInfoStr = this.sessionStorageService.getItem('userDetails');
9732
+ const camUtils = new CaseAccessUtils();
9733
+ let userInfo;
9734
+ if (userInfoStr) {
9735
+ userInfo = JSON.parse(userInfoStr);
9763
9736
  }
9764
- else {
9765
- if (taskEventCompletionInfo.taskId !== taskInSessionStorage.id) {
9766
- return true;
9767
- }
9768
- else if ((taskEventCompletionInfo.taskId === taskInSessionStorage.id &&
9769
- this.eventDetailsDoNotMatch(taskEventCompletionInfo, eventDetails))
9770
- || this.eventMoreThanDayAgo(taskEventCompletionInfo.createdTimestamp)) {
9771
- // if the session storage not related to event, ignore it and remove
9772
- this.sessionStorageService.removeItem('clientContext');
9773
- this.sessionStorageService.removeItem('taskEventCompletionInfo');
9774
- return false;
9775
- }
9776
- if (eventDetails.assignNeeded === 'false' && eventDetails.userId !== taskInSessionStorage.assignee) {
9777
- // if the user does not match task assignee, assign is now needed
9778
- // data cannot be deleted and ignored as it matches understanding
9779
- this.sessionStorageService.setItem('assignNeeded', 'true');
9737
+ const roleCategory = userInfo.roleCategory || camUtils.getMappedRoleCategory(userInfo.roles, userInfo.roleCategories);
9738
+ const roleName = camUtils.getAMRoleName('specific', roleCategory);
9739
+ const id = userInfo.id ? userInfo.id : userInfo.uid;
9740
+ const payload = camUtils.getAMPayload(null, id, roleName, roleCategory, 'SPECIFIC', caseId, sar, null, null, true);
9741
+ payload.roleRequest = {
9742
+ ...payload.roleRequest,
9743
+ process: 'specific-access',
9744
+ replaceExisting: true,
9745
+ assignerId: payload.requestedRoles[0].actorId,
9746
+ reference: `${caseId}/${roleName}/${payload.requestedRoles[0].actorId}`
9747
+ };
9748
+ payload.requestedRoles[0] = {
9749
+ ...payload.requestedRoles[0],
9750
+ roleName: 'specific-access-requested',
9751
+ roleCategory,
9752
+ classification: 'PRIVATE',
9753
+ endTime: new Date(new Date().setDate(new Date().getDate() + 30)),
9754
+ beginTime: null,
9755
+ grantType: 'BASIC',
9756
+ readOnly: true
9757
+ };
9758
+ payload.requestedRoles[0].attributes = {
9759
+ ...payload.requestedRoles[0].attributes,
9760
+ requestedRole: roleName,
9761
+ specificAccessReason: sar.specificReason
9762
+ };
9763
+ payload.requestedRoles[0].notes[0] = {
9764
+ ...payload.requestedRoles[0].notes[0],
9765
+ userId: payload.requestedRoles[0].actorId
9766
+ };
9767
+ return this.http.post(`/api/specific-access-request`, payload);
9768
+ }
9769
+ getLinkedCases(caseId) {
9770
+ const url = `${this.appConfig.getCaseDataStoreApiUrl()}/${caseId}`;
9771
+ return this.http
9772
+ .get(url)
9773
+ .pipe(catchError(error => throwError(error)));
9774
+ }
9775
+ addClientContextHeader(headers) {
9776
+ const clientContextDetails = this.sessionStorageService.getItem(CaseEditComponent.CLIENT_CONTEXT);
9777
+ if (clientContextDetails) {
9778
+ const caseEditUtils = new CaseEditUtils();
9779
+ // below changes non-ASCII characters
9780
+ const editedClientContext = caseEditUtils.convertNonASCIICharacters(clientContextDetails);
9781
+ const clientContext = window.btoa(editedClientContext);
9782
+ if (clientContext) {
9783
+ headers = headers.set('Client-Context', clientContext);
9780
9784
  }
9781
- return true;
9782
9785
  }
9786
+ return headers;
9783
9787
  }
9784
- onEventCanBeCompleted({ eventTrigger, eventCanBeCompleted, caseDetails, form, submit }) {
9785
- if (eventCanBeCompleted) {
9786
- // Submit
9787
- const caseEventData = this.generateCaseEventData({ eventTrigger, form });
9788
- this.caseSubmit({ form, caseEventData, submit });
9789
- }
9790
- else {
9791
- // Navigate to tasks tab on case details page
9792
- this.router.navigate([`/cases/case-details/${this.getCaseId(caseDetails)}/tasks`], { relativeTo: this.route });
9788
+ updateClientContextStorage(headers) {
9789
+ if (headers && headers.get('Client-Context')) {
9790
+ const caseEditUtils = new CaseEditUtils();
9791
+ const clientContextString = window.atob(headers.get('Client-Context'));
9792
+ // below reverts non-ASCII characters
9793
+ const editedClientContextString = caseEditUtils.convertHTMLEntities(clientContextString);
9794
+ this.sessionStorageService.setItem(CaseEditComponent.CLIENT_CONTEXT, editedClientContextString);
9793
9795
  }
9794
9796
  }
9795
- getStatus(response) {
9796
- return this.hasCallbackFailed(response) ? response['callback_response_status'] : response['delete_draft_response_status'];
9797
+ static ɵfac = function CasesService_Factory(t) { return new (t || CasesService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(OrderService), i0.ɵɵinject(HttpErrorService), i0.ɵɵinject(WizardPageFieldToCaseFieldMapper), i0.ɵɵinject(LoadingService), i0.ɵɵinject(SessionStorageService), i0.ɵɵinject(RetryUtil)); };
9798
+ static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CasesService, factory: CasesService.ɵfac });
9799
+ }
9800
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CasesService, [{
9801
+ type: Injectable
9802
+ }], () => [{ type: HttpService }, { type: AbstractAppConfig }, { type: OrderService }, { type: HttpErrorService }, { type: WizardPageFieldToCaseFieldMapper }, { type: LoadingService }, { type: SessionStorageService }, { type: RetryUtil }], null); })();
9803
+
9804
+ function CaseCreateComponent_div_0_Template(rf, ctx) { if (rf & 1) {
9805
+ const _r1 = i0.ɵɵgetCurrentView();
9806
+ i0.ɵɵelementStart(0, "div")(1, "ccd-case-edit", 1);
9807
+ i0.ɵɵlistener("cancelled", function CaseCreateComponent_div_0_Template_ccd_case_edit_cancelled_1_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.emitCancelled($event)); })("submitted", function CaseCreateComponent_div_0_Template_ccd_case_edit_submitted_1_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.emitSubmitted($event)); });
9808
+ i0.ɵɵelementEnd()();
9809
+ } if (rf & 2) {
9810
+ const ctx_r1 = i0.ɵɵnextContext();
9811
+ i0.ɵɵadvance();
9812
+ i0.ɵɵproperty("submit", ctx_r1.submit())("validate", ctx_r1.validate())("saveDraft", ctx_r1.saveDraft())("eventTrigger", ctx_r1.eventTrigger);
9813
+ } }
9814
+ class CaseCreateComponent {
9815
+ casesService;
9816
+ alertService;
9817
+ draftService;
9818
+ eventTriggerService;
9819
+ jurisdiction;
9820
+ caseType;
9821
+ event;
9822
+ cancelled = new EventEmitter();
9823
+ submitted = new EventEmitter();
9824
+ eventTrigger;
9825
+ constructor(casesService, alertService, draftService, eventTriggerService) {
9826
+ this.casesService = casesService;
9827
+ this.alertService = alertService;
9828
+ this.draftService = draftService;
9829
+ this.eventTriggerService = eventTriggerService;
9797
9830
  }
9798
- hasCallbackFailed(response) {
9799
- return response['callback_response_status'] !== 'CALLBACK_COMPLETED';
9831
+ ngOnInit() {
9832
+ this.casesService.getEventTrigger(this.caseType, this.event).toPromise()
9833
+ .then(eventTrigger => {
9834
+ this.eventTrigger = eventTrigger;
9835
+ this.eventTriggerService.announceEventTrigger(eventTrigger);
9836
+ })
9837
+ .catch((error) => {
9838
+ this.alertService.error({ phrase: error.message });
9839
+ return throwError(error);
9840
+ });
9800
9841
  }
9801
- eventMoreThanDayAgo(timestamp) {
9802
- if ((new Date().getTime() - timestamp) > (24 * 60 * 60 * 1000)) {
9803
- return true;
9804
- }
9805
- return false;
9842
+ submit() {
9843
+ return (sanitizedEditForm) => {
9844
+ sanitizedEditForm.draft_id = this.eventTrigger.case_id;
9845
+ return this.casesService.createCase(this.caseType, sanitizedEditForm);
9846
+ };
9806
9847
  }
9807
- eventDetailsDoNotMatch(taskEventCompletionInfo, eventDetails) {
9808
- if (taskEventCompletionInfo.eventId !== eventDetails.eventId
9809
- || taskEventCompletionInfo.caseId !== eventDetails.caseId
9810
- || taskEventCompletionInfo.userId !== eventDetails.userId) {
9811
- return true;
9848
+ validate() {
9849
+ return (sanitizedEditForm, pageId) => this.casesService
9850
+ .validateCase(this.caseType, sanitizedEditForm, pageId);
9851
+ }
9852
+ saveDraft() {
9853
+ if (this.eventTrigger.can_save_draft) {
9854
+ return (caseEventData) => this.draftService.createOrUpdateDraft(this.caseType, this.eventTrigger.case_id, caseEventData);
9812
9855
  }
9813
- return false;
9814
9856
  }
9815
- static ɵfac = function CaseEditComponent_Factory(t) { return new (t || CaseEditComponent)(i0.ɵɵdirectiveInject(i4.FormBuilder), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(FieldsUtils), i0.ɵɵdirectiveInject(FieldsPurger), i0.ɵɵdirectiveInject(ConditionalShowRegistrarService), i0.ɵɵdirectiveInject(WizardFactoryService), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(WindowService), i0.ɵɵdirectiveInject(FormValueService), i0.ɵɵdirectiveInject(FormErrorService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(ValidPageListCaseFieldsService), i0.ɵɵdirectiveInject(WorkAllocationService), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(AbstractAppConfig)); };
9816
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditComponent, selectors: [["ccd-case-edit"]], inputs: { eventTrigger: "eventTrigger", submit: "submit", validate: "validate", saveDraft: "saveDraft", caseDetails: "caseDetails" }, outputs: { cancelled: "cancelled", submitted: "submitted" }, features: [i0.ɵɵProvidersFeature([GreyBarService])], decls: 1, vars: 0, template: function CaseEditComponent_Template(rf, ctx) { if (rf & 1) {
9817
- i0.ɵɵelement(0, "router-outlet");
9818
- } }, dependencies: [i1$1.RouterOutlet], styles: ["#fieldset-case-data[_ngcontent-%COMP%]{margin-bottom:30px}#fieldset-case-data[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{width:1%;white-space:nowrap;vertical-align:top}.compound-field[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:0}#confirmation-header[_ngcontent-%COMP%]{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body[_ngcontent-%COMP%]{width:630px;background-color:#fff}.valign-top[_ngcontent-%COMP%]{vertical-align:top}.summary-fields[_ngcontent-%COMP%]{margin-bottom:30px}.summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:0px}a.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:default}.case-field-label[_ngcontent-%COMP%]{width:45%}.case-field-content[_ngcontent-%COMP%]{width:50%}.no-bottom-border[_ngcontent-%COMP%]{border-bottom:none}.case-field-change[_ngcontent-%COMP%]{width:5%}"] });
9857
+ emitCancelled(event) {
9858
+ this.cancelled.emit(event);
9859
+ }
9860
+ emitSubmitted(event) {
9861
+ this.submitted.emit(event);
9862
+ }
9863
+ isDataLoaded() {
9864
+ return this.eventTrigger ? true : false;
9865
+ }
9866
+ static ɵfac = function CaseCreateComponent_Factory(t) { return new (t || CaseCreateComponent)(i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(DraftService), i0.ɵɵdirectiveInject(EventTriggerService)); };
9867
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseCreateComponent, selectors: [["ccd-case-create"]], inputs: { jurisdiction: "jurisdiction", caseType: "caseType", event: "event" }, outputs: { cancelled: "cancelled", submitted: "submitted" }, decls: 1, vars: 1, consts: [[4, "ngIf"], [3, "cancelled", "submitted", "submit", "validate", "saveDraft", "eventTrigger"]], template: function CaseCreateComponent_Template(rf, ctx) { if (rf & 1) {
9868
+ i0.ɵɵtemplate(0, CaseCreateComponent_div_0_Template, 2, 4, "div", 0);
9869
+ } if (rf & 2) {
9870
+ i0.ɵɵproperty("ngIf", ctx.isDataLoaded());
9871
+ } }, encapsulation: 2 });
9819
9872
  }
9820
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditComponent, [{
9873
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseCreateComponent, [{
9821
9874
  type: Component,
9822
- args: [{ selector: 'ccd-case-edit', providers: [GreyBarService], template: "<router-outlet></router-outlet>\n", styles: ["#fieldset-case-data{margin-bottom:30px}#fieldset-case-data th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}#confirmation-header{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body{width:630px;background-color:#fff}.valign-top{vertical-align:top}.summary-fields{margin-bottom:30px}.summary-fields tbody tr th,.summary-fields tbody tr td{border-bottom:0px}a.disabled{pointer-events:none;cursor:default}.case-field-label{width:45%}.case-field-content{width:50%}.no-bottom-border{border-bottom:none}.case-field-change{width:5%}\n"] }]
9823
- }], () => [{ type: i4.FormBuilder }, { type: CaseNotifier }, { type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: FieldsUtils }, { type: FieldsPurger }, { type: ConditionalShowRegistrarService }, { type: WizardFactoryService }, { type: SessionStorageService }, { type: WindowService }, { type: FormValueService }, { type: FormErrorService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }, { type: WorkAllocationService }, { type: AlertService }, { type: AbstractAppConfig }], { eventTrigger: [{
9824
- type: Input
9825
- }], submit: [{
9826
- type: Input
9827
- }], validate: [{
9875
+ args: [{ selector: 'ccd-case-create', template: "<div *ngIf=\"isDataLoaded()\">\n <ccd-case-edit [submit]=\"submit()\"\n [validate]=\"validate()\"\n [saveDraft]=\"saveDraft()\"\n [eventTrigger]=\"eventTrigger\"\n (cancelled)=\"emitCancelled($event)\"\n (submitted)=\"emitSubmitted($event)\"></ccd-case-edit>\n</div>" }]
9876
+ }], () => [{ type: CasesService }, { type: AlertService }, { type: DraftService }, { type: EventTriggerService }], { jurisdiction: [{
9828
9877
  type: Input
9829
- }], saveDraft: [{
9878
+ }], caseType: [{
9830
9879
  type: Input
9831
- }], caseDetails: [{
9880
+ }], event: [{
9832
9881
  type: Input
9833
9882
  }], cancelled: [{
9834
9883
  type: Output
9835
9884
  }], submitted: [{
9836
9885
  type: Output
9837
9886
  }] }); })();
9838
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditComponent, { className: "CaseEditComponent", filePath: "lib/shared/components/case-editor/case-edit/case-edit.component.ts", lineNumber: 35 }); })();
9887
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseCreateComponent, { className: "CaseCreateComponent", filePath: "lib/shared/components/case-editor/case-create/case-create.component.ts", lineNumber: 17 }); })();
9839
9888
 
9840
9889
  function CaseEditConfirmComponent_div_3_Template(rf, ctx) { if (rf & 1) {
9841
9890
  i0.ɵɵelement(0, "div");
@@ -11260,7 +11309,7 @@ class CaseEventCompletionTaskCancelledComponent {
11260
11309
  }
11261
11310
  onContinue() {
11262
11311
  // Removes task to complete so event completes without task
11263
- this.context.sessionStorageService.removeItem('clientContext');
11312
+ this.context.sessionStorageService.removeItem(CaseEditComponent.CLIENT_CONTEXT);
11264
11313
  // may be able to remove this call below since it is now unneccesary
11265
11314
  this.notifyEventCompletionCancelled.emit(true);
11266
11315
  }
@@ -11446,7 +11495,7 @@ class CaseEventCompletionTaskReassignedComponent {
11446
11495
  }
11447
11496
  onContinue() {
11448
11497
  // Get task details
11449
- const clientContextStr = this.sessionStorageService.getItem('clientContext');
11498
+ const clientContextStr = this.sessionStorageService.getItem(CaseEditComponent.CLIENT_CONTEXT);
11450
11499
  const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
11451
11500
  const task = userTask ? userTask.task_data : null;
11452
11501
  // not complete_task not utilised here as related to event completion
@@ -11476,7 +11525,7 @@ class CaseEventCompletionTaskReassignedComponent {
11476
11525
  }], notifyEventCompletionReassigned: [{
11477
11526
  type: Output
11478
11527
  }] }); })();
11479
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEventCompletionTaskReassignedComponent, { className: "CaseEventCompletionTaskReassignedComponent", filePath: "lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-reassigned/case-event-completion-task-reassigned.component.ts", lineNumber: 15 }); })();
11528
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEventCompletionTaskReassignedComponent, { className: "CaseEventCompletionTaskReassignedComponent", filePath: "lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-reassigned/case-event-completion-task-reassigned.component.ts", lineNumber: 16 }); })();
11480
11529
 
11481
11530
  class AddressOption {
11482
11531
  description;
@@ -11774,7 +11823,7 @@ class WriteComplexFieldComponent extends AbstractFieldWriteComponent {
11774
11823
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(WriteComplexFieldComponent, { className: "WriteComplexFieldComponent", filePath: "lib/shared/components/palette/complex/write-complex-field.component.ts", lineNumber: 21 }); })();
11775
11824
 
11776
11825
  const _c0$V = ["writeComplexFieldComponent"];
11777
- const _c1$p = a0 => ({ "form-group-error": a0 });
11826
+ const _c1$o = a0 => ({ "form-group-error": a0 });
11778
11827
  const _c2$3 = a0 => ({ "govuk-input--error": a0 });
11779
11828
  function WriteAddressFieldComponent_div_1_div_4_span_5_Template(rf, ctx) { if (rf & 1) {
11780
11829
  i0.ɵɵelementStart(0, "span", 14);
@@ -11801,7 +11850,7 @@ function WriteAddressFieldComponent_div_1_div_4_Template(rf, ctx) { if (rf & 1)
11801
11850
  i0.ɵɵelementEnd()();
11802
11851
  } if (rf & 2) {
11803
11852
  const ctx_r1 = i0.ɵɵnextContext(2);
11804
- i0.ɵɵproperty("id", ctx_r1.createElementId("postcodeLookup"))("ngClass", i0.ɵɵpureFunction1(13, _c1$p, ctx_r1.missingPostcode));
11853
+ i0.ɵɵproperty("id", ctx_r1.createElementId("postcodeLookup"))("ngClass", i0.ɵɵpureFunction1(13, _c1$o, ctx_r1.missingPostcode));
11805
11854
  i0.ɵɵadvance();
11806
11855
  i0.ɵɵproperty("for", ctx_r1.createElementId("postcodeInput"));
11807
11856
  i0.ɵɵadvance(2);
@@ -11847,7 +11896,7 @@ function WriteAddressFieldComponent_div_1_div_5_Template(rf, ctx) { if (rf & 1)
11847
11896
  i0.ɵɵelementEnd()();
11848
11897
  } if (rf & 2) {
11849
11898
  const ctx_r1 = i0.ɵɵnextContext(2);
11850
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(9, _c1$p, ctx_r1.noAddressSelected));
11899
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(9, _c1$o, ctx_r1.noAddressSelected));
11851
11900
  i0.ɵɵadvance();
11852
11901
  i0.ɵɵproperty("for", ctx_r1.createElementId("addressList"));
11853
11902
  i0.ɵɵadvance(2);
@@ -13280,7 +13329,7 @@ class ReadCaseLinkFieldComponent extends AbstractFieldReadComponent {
13280
13329
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadCaseLinkFieldComponent, { className: "ReadCaseLinkFieldComponent", filePath: "lib/shared/components/palette/case-link/read-case-link-field.component.ts", lineNumber: 8 }); })();
13281
13330
 
13282
13331
  const _c0$U = ["writeComplexFieldComponent"];
13283
- const _c1$o = a0 => ({ "form-group-error": a0 });
13332
+ const _c1$n = a0 => ({ "form-group-error": a0 });
13284
13333
  function WriteCaseLinkFieldComponent_span_2_Template(rf, ctx) { if (rf & 1) {
13285
13334
  i0.ɵɵelementStart(0, "span", 6);
13286
13335
  i0.ɵɵtext(1);
@@ -13372,7 +13421,7 @@ class WriteCaseLinkFieldComponent extends AbstractFieldWriteComponent {
13372
13421
  i0.ɵɵelement(5, "input", 5);
13373
13422
  i0.ɵɵelementEnd();
13374
13423
  } if (rf & 2) {
13375
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(7, _c1$o, !ctx.caseReferenceControl.valid && (ctx.caseReferenceControl.dirty || ctx.caseReferenceControl.touched)));
13424
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(7, _c1$n, !ctx.caseReferenceControl.valid && (ctx.caseReferenceControl.dirty || ctx.caseReferenceControl.touched)));
13376
13425
  i0.ɵɵadvance();
13377
13426
  i0.ɵɵproperty("for", ctx.id());
13378
13427
  i0.ɵɵadvance();
@@ -13395,7 +13444,7 @@ class WriteCaseLinkFieldComponent extends AbstractFieldWriteComponent {
13395
13444
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(WriteCaseLinkFieldComponent, { className: "WriteCaseLinkFieldComponent", filePath: "lib/shared/components/palette/case-link/write-case-link-field.component.ts", lineNumber: 11 }); })();
13396
13445
 
13397
13446
  const _c0$T = (a0, a1, a2, a3, a4, a5) => ({ id: a0, label: a1, field_type: a2, display_context_parameter: a3, value: a4, hidden: a5 });
13398
- const _c1$n = (a0, a1, a2, a3, a4) => ({ id: a0, label: a1, field_type: a2, value: a3, hidden: a4 });
13447
+ const _c1$m = (a0, a1, a2, a3, a4) => ({ id: a0, label: a1, field_type: a2, value: a3, hidden: a4 });
13399
13448
  function ReadCollectionFieldComponent_table_0_tbody_2_Template(rf, ctx) { if (rf & 1) {
13400
13449
  i0.ɵɵelementStart(0, "tbody")(1, "tr");
13401
13450
  i0.ɵɵelement(2, "th", 4);
@@ -13416,7 +13465,7 @@ function ReadCollectionFieldComponent_table_0_tbody_3_tr_1_Template(rf, ctx) { i
13416
13465
  const i_r3 = ctx.index;
13417
13466
  const ctx_r0 = i0.ɵɵnextContext(3);
13418
13467
  i0.ɵɵadvance(2);
13419
- i0.ɵɵproperty("caseField", i0.ɵɵpureFunction5(4, _c1$n, i_r3, ctx_r0.caseField.label + " " + (i_r3 + 1), ctx_r0.caseField.field_type.collection_field_type, item_r2.value, ctx_r0.caseField.hidden))("context", ctx_r0.context)("topLevelFormGroup", ctx_r0.topLevelFormGroup)("idPrefix", ctx_r0.buildIdPrefix(i_r3));
13468
+ i0.ɵɵproperty("caseField", i0.ɵɵpureFunction5(4, _c1$m, i_r3, ctx_r0.caseField.label + " " + (i_r3 + 1), ctx_r0.caseField.field_type.collection_field_type, item_r2.value, ctx_r0.caseField.hidden))("context", ctx_r0.context)("topLevelFormGroup", ctx_r0.topLevelFormGroup)("idPrefix", ctx_r0.buildIdPrefix(i_r3));
13420
13469
  } }
13421
13470
  function ReadCollectionFieldComponent_table_0_tbody_3_Template(rf, ctx) { if (rf & 1) {
13422
13471
  i0.ɵɵelementStart(0, "tbody");
@@ -14222,7 +14271,7 @@ class FileUploadStateService {
14222
14271
  }], null, null); })();
14223
14272
 
14224
14273
  const _c0$R = ["fileInput"];
14225
- const _c1$m = a0 => ({ "form-group-error bottom-30": a0 });
14274
+ const _c1$l = a0 => ({ "form-group-error bottom-30": a0 });
14226
14275
  function WriteDocumentFieldComponent_span_6_Template(rf, ctx) { if (rf & 1) {
14227
14276
  i0.ɵɵelementStart(0, "span", 12);
14228
14277
  i0.ɵɵtext(1);
@@ -14611,7 +14660,7 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
14611
14660
  i0.ɵɵpipe(17, "rpxTranslate");
14612
14661
  i0.ɵɵelementEnd()();
14613
14662
  } if (rf & 2) {
14614
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(18, _c1$m, !ctx.valid));
14663
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(18, _c1$l, !ctx.valid));
14615
14664
  i0.ɵɵadvance();
14616
14665
  i0.ɵɵproperty("for", ctx.id());
14617
14666
  i0.ɵɵadvance();
@@ -15139,7 +15188,7 @@ class ReadDynamicRadioListFieldComponent extends AbstractFieldReadComponent {
15139
15188
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadDynamicRadioListFieldComponent, { className: "ReadDynamicRadioListFieldComponent", filePath: "lib/shared/components/palette/dynamic-radio-list/read-dynamic-radio-list-field.component.ts", lineNumber: 8 }); })();
15140
15189
 
15141
15190
  const _c0$O = a0 => ({ "form-group-error": a0 });
15142
- const _c1$l = a0 => ({ selected: a0 });
15191
+ const _c1$k = a0 => ({ selected: a0 });
15143
15192
  function WriteDynamicRadioListFieldComponent_span_4_Template(rf, ctx) { if (rf & 1) {
15144
15193
  i0.ɵɵelementStart(0, "span", 7);
15145
15194
  i0.ɵɵtext(1);
@@ -15189,7 +15238,7 @@ function WriteDynamicRadioListFieldComponent_div_9_Template(rf, ctx) { if (rf &
15189
15238
  } if (rf & 2) {
15190
15239
  const radioButton_r2 = ctx.$implicit;
15191
15240
  const ctx_r0 = i0.ɵɵnextContext();
15192
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(9, _c1$l, ctx_r0.dynamicRadioListControl.value === radioButton_r2.code));
15241
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(9, _c1$k, ctx_r0.dynamicRadioListControl.value === radioButton_r2.code));
15193
15242
  i0.ɵɵadvance();
15194
15243
  i0.ɵɵproperty("id", ctx_r0.createElementId(radioButton_r2.code))("name", ctx_r0.id())("formControl", ctx_r0.dynamicRadioListControl)("value", radioButton_r2.code);
15195
15244
  i0.ɵɵadvance();
@@ -15287,7 +15336,7 @@ class ReadEmailFieldComponent extends AbstractFieldReadComponent {
15287
15336
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadEmailFieldComponent, { className: "ReadEmailFieldComponent", filePath: "lib/shared/components/palette/email/read-email-field.component.ts", lineNumber: 10 }); })();
15288
15337
 
15289
15338
  const _c0$N = a0 => ({ "form-group-error": a0 });
15290
- const _c1$k = a0 => ({ "govuk-input--error": a0 });
15339
+ const _c1$j = a0 => ({ "govuk-input--error": a0 });
15291
15340
  function WriteEmailFieldComponent_span_2_Template(rf, ctx) { if (rf & 1) {
15292
15341
  i0.ɵɵelementStart(0, "span", 6);
15293
15342
  i0.ɵɵtext(1);
@@ -15342,7 +15391,7 @@ class WriteEmailFieldComponent extends AbstractFieldWriteComponent {
15342
15391
  i0.ɵɵadvance();
15343
15392
  i0.ɵɵproperty("ngIf", ctx.emailControl.errors && (ctx.emailControl.dirty || ctx.emailControl.touched));
15344
15393
  i0.ɵɵadvance();
15345
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(10, _c1$k, ctx.emailControl.errors && (ctx.emailControl.dirty || ctx.emailControl.touched)))("id", ctx.id())("formControl", ctx.emailControl);
15394
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(10, _c1$j, ctx.emailControl.errors && (ctx.emailControl.dirty || ctx.emailControl.touched)))("id", ctx.id())("formControl", ctx.emailControl);
15346
15395
  } }, dependencies: [i5.NgClass, i5.NgIf, i4.DefaultValueAccessor, i4.NgControlStatus, i4.FormControlDirective, FieldLabelPipe, FirstErrorPipe, i1.RpxTranslatePipe], encapsulation: 2 });
15347
15396
  }
15348
15397
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WriteEmailFieldComponent, [{
@@ -15510,7 +15559,7 @@ class ReadFixedRadioListFieldComponent extends AbstractFieldReadComponent {
15510
15559
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadFixedRadioListFieldComponent, { className: "ReadFixedRadioListFieldComponent", filePath: "lib/shared/components/palette/fixed-radio-list/read-fixed-radio-list-field.component.ts", lineNumber: 8 }); })();
15511
15560
 
15512
15561
  const _c0$L = a0 => ({ "form-group-error": a0 });
15513
- const _c1$j = a0 => ({ selected: a0 });
15562
+ const _c1$i = a0 => ({ selected: a0 });
15514
15563
  function WriteFixedRadioListFieldComponent_span_4_Template(rf, ctx) { if (rf & 1) {
15515
15564
  i0.ɵɵelementStart(0, "span", 6);
15516
15565
  i0.ɵɵtext(1);
@@ -15551,7 +15600,7 @@ function WriteFixedRadioListFieldComponent_div_8_Template(rf, ctx) { if (rf & 1)
15551
15600
  } if (rf & 2) {
15552
15601
  const radioButton_r2 = ctx.$implicit;
15553
15602
  const ctx_r0 = i0.ɵɵnextContext();
15554
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(9, _c1$j, ctx_r0.fixedRadioListControl.value === radioButton_r2.code));
15603
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(9, _c1$i, ctx_r0.fixedRadioListControl.value === radioButton_r2.code));
15555
15604
  i0.ɵɵadvance();
15556
15605
  i0.ɵɵproperty("id", ctx_r0.id() + "-" + radioButton_r2.code)("name", ctx_r0.id())("formControl", ctx_r0.fixedRadioListControl)("value", radioButton_r2.code);
15557
15606
  i0.ɵɵadvance();
@@ -15654,7 +15703,7 @@ class ReadJudicialUserFieldComponent extends AbstractFieldReadComponent {
15654
15703
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadJudicialUserFieldComponent, { className: "ReadJudicialUserFieldComponent", filePath: "lib/shared/components/palette/judicial-user/read-judicial-user-field.component.ts", lineNumber: 11 }); })();
15655
15704
 
15656
15705
  const _c0$K = a0 => ({ "form-group-error": a0 });
15657
- const _c1$i = a0 => ({ "hide-autocomplete": a0 });
15706
+ const _c1$h = a0 => ({ "hide-autocomplete": a0 });
15658
15707
  function WriteJudicialUserFieldComponent_span_2_Template(rf, ctx) { if (rf & 1) {
15659
15708
  i0.ɵɵelementStart(0, "span", 10);
15660
15709
  i0.ɵɵtext(1);
@@ -15693,7 +15742,7 @@ function WriteJudicialUserFieldComponent_mat_option_8_Template(rf, ctx) { if (rf
15693
15742
  } if (rf & 2) {
15694
15743
  const judicialUser_r4 = ctx.$implicit;
15695
15744
  const ctx_r1 = i0.ɵɵnextContext();
15696
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(4, _c1$i, !ctx_r1.showAutocomplete))("value", judicialUser_r4);
15745
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(4, _c1$h, !ctx_r1.showAutocomplete))("value", judicialUser_r4);
15697
15746
  i0.ɵɵadvance();
15698
15747
  i0.ɵɵtextInterpolate2(" ", (judicialUser_r4 == null ? null : judicialUser_r4.fullName) ? judicialUser_r4.fullName : "", "", (judicialUser_r4 == null ? null : judicialUser_r4.emailId) ? " (" + judicialUser_r4.emailId + ")" : "", " ");
15699
15748
  } }
@@ -16419,7 +16468,7 @@ class ValidatorsUtils {
16419
16468
  }], null, null); })();
16420
16469
 
16421
16470
  const _c0$J = a0 => ({ "govuk-form-group--error": a0 });
16422
- const _c1$h = a0 => ({ "table-group-error": a0 });
16471
+ const _c1$g = a0 => ({ "table-group-error": a0 });
16423
16472
  function LinkCasesComponent_div_8_span_4_Template(rf, ctx) { if (rf & 1) {
16424
16473
  i0.ɵɵelementStart(0, "span", 30)(1, "span", 31);
16425
16474
  i0.ɵɵtext(2, "Error:");
@@ -16596,7 +16645,7 @@ function LinkCasesComponent_tr_31_Template(rf, ctx) { if (rf & 1) {
16596
16645
  const case_r9 = ctx.$implicit;
16597
16646
  const ctx_r1 = i0.ɵɵnextContext();
16598
16647
  i0.ɵɵadvance(2);
16599
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(12, _c1$h, ctx_r1.caseSelectionError && case_r9.caseReference === ctx_r1.linkCaseForm.value.caseNumber));
16648
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(12, _c1$g, ctx_r1.caseSelectionError && case_r9.caseReference === ctx_r1.linkCaseForm.value.caseNumber));
16600
16649
  i0.ɵɵadvance(2);
16601
16650
  i0.ɵɵtextInterpolate1("", case_r9.caseName, " ");
16602
16651
  i0.ɵɵadvance(2);
@@ -16679,8 +16728,8 @@ class LinkCasesComponent {
16679
16728
  })), this.validatorsUtils.formArraySelectedValidator());
16680
16729
  }
16681
16730
  toggleLinkCaseReasonOtherComments(event) {
16682
- this.linkCaseReasons.find(reason => reason.value_en === event.target.value).selected = event.target.checked;
16683
- this.showComments = this.linkCaseReasons.find(reason => reason.value_en === 'Other').selected;
16731
+ this.linkCaseReasons.find((reason) => reason.value_en === event.target.value).selected = event.target.checked;
16732
+ this.showComments = this.linkCaseReasons.find((reason) => reason.value_en === 'Other')?.selected;
16684
16733
  }
16685
16734
  submitCaseInfo() {
16686
16735
  this.errorMessages = [];
@@ -16719,7 +16768,7 @@ class LinkCasesComponent {
16719
16768
  this.errorMessages.push({
16720
16769
  title: 'dummy-case-number',
16721
16770
  description: LinkedCasesErrorMessages.CaseNumberError,
16722
- fieldId: 'caseNumber',
16771
+ fieldId: 'caseNumber'
16723
16772
  });
16724
16773
  }
16725
16774
  if (this.linkCaseForm.controls.reasonType.invalid) {
@@ -16727,17 +16776,17 @@ class LinkCasesComponent {
16727
16776
  this.errorMessages.push({
16728
16777
  title: 'dummy-case-reason',
16729
16778
  description: LinkedCasesErrorMessages.ReasonSelectionError,
16730
- fieldId: 'caseReason',
16779
+ fieldId: 'caseReason'
16731
16780
  });
16732
16781
  }
16733
16782
  if (this.linkCaseForm.controls.reasonType.valid
16734
- && this.linkCaseReasons.find(reason => reason.value_en === 'Other').selected) {
16783
+ && this.linkCaseReasons.find((reason) => reason.value_en === 'Other').selected) {
16735
16784
  if (this.linkCaseForm.controls.otherDescription.value.trim().length === 0) {
16736
16785
  this.caseReasonCommentsError = LinkedCasesErrorMessages.otherDescriptionError;
16737
16786
  this.errorMessages.push({
16738
16787
  title: 'dummy-case-reason-comments',
16739
16788
  description: LinkedCasesErrorMessages.otherDescriptionError,
16740
- fieldId: 'otherDescription',
16789
+ fieldId: 'otherDescription'
16741
16790
  });
16742
16791
  }
16743
16792
  if (this.linkCaseForm.controls.otherDescription.value.trim().length > 100) {
@@ -16745,7 +16794,7 @@ class LinkCasesComponent {
16745
16794
  this.errorMessages.push({
16746
16795
  title: 'dummy-case-reason-comments',
16747
16796
  description: LinkedCasesErrorMessages.otherDescriptionMaxLengthError,
16748
- fieldId: 'otherDescription',
16797
+ fieldId: 'otherDescription'
16749
16798
  });
16750
16799
  }
16751
16800
  }
@@ -16754,7 +16803,7 @@ class LinkCasesComponent {
16754
16803
  this.errorMessages.push({
16755
16804
  title: 'dummy-case-number',
16756
16805
  description: LinkedCasesErrorMessages.CaseProposedError,
16757
- fieldId: 'caseNumber',
16806
+ fieldId: 'caseNumber'
16758
16807
  });
16759
16808
  }
16760
16809
  if (this.isCaseSelected(this.linkedCasesService.linkedCases)) {
@@ -16762,14 +16811,14 @@ class LinkCasesComponent {
16762
16811
  this.errorMessages.push({
16763
16812
  title: 'dummy-case-number',
16764
16813
  description: LinkedCasesErrorMessages.CasesLinkedError,
16765
- fieldId: 'caseNumber',
16814
+ fieldId: 'caseNumber'
16766
16815
  });
16767
16816
  }
16768
16817
  if (this.linkCaseForm.value.caseNumber.split('-').join('') === this.linkedCasesService.caseId.split('-').join('')) {
16769
16818
  this.errorMessages.push({
16770
16819
  title: 'dummy-case-number',
16771
16820
  description: LinkedCasesErrorMessages.ProposedCaseWithIn,
16772
- fieldId: 'caseNumber',
16821
+ fieldId: 'caseNumber'
16773
16822
  });
16774
16823
  }
16775
16824
  window.scrollTo(0, 0);
@@ -16790,7 +16839,7 @@ class LinkCasesComponent {
16790
16839
  caseState: caseView.state.name || '',
16791
16840
  caseStateDescription: caseView.state.description || '',
16792
16841
  caseService: caseView.case_type && caseView.case_type.jurisdiction && caseView.case_type.jurisdiction.description || '',
16793
- caseName: this.linkedCasesService.getCaseName(caseView),
16842
+ caseName: this.linkedCasesService.getCaseName(caseView)
16794
16843
  };
16795
16844
  const ccdApiCaseLinkData = {
16796
16845
  CaseReference: caseView.case_id,
@@ -16803,7 +16852,7 @@ class LinkCasesComponent {
16803
16852
  }
16804
16853
  this.linkedCasesService.caseFieldValue.push({ id: caseView.case_id.toString(), value: ccdApiCaseLinkData });
16805
16854
  this.selectedCases.push(caseLink);
16806
- this.linkCaseReasons.forEach(reason => reason.selected = false);
16855
+ this.linkCaseReasons.forEach((reason) => reason.selected = false);
16807
16856
  this.initForm();
16808
16857
  this.emitLinkedCasesState(false);
16809
16858
  }, (error) => {
@@ -16811,7 +16860,7 @@ class LinkCasesComponent {
16811
16860
  this.errorMessages.push({
16812
16861
  title: 'dummy-case-number',
16813
16862
  description: LinkedCasesErrorMessages.CaseCheckAgainError,
16814
- fieldId: 'caseNumber',
16863
+ fieldId: 'caseNumber'
16815
16864
  });
16816
16865
  this.emitLinkedCasesState(false);
16817
16866
  window.scrollTo(0, 0);
@@ -16823,7 +16872,7 @@ class LinkCasesComponent {
16823
16872
  this.linkedCasesStateEmitter.emit({
16824
16873
  currentLinkedCasesPage: LinkedCasesPages.LINK_CASE,
16825
16874
  errorMessages: this.errorMessages,
16826
- navigateToNextPage: isNavigateToNextPage,
16875
+ navigateToNextPage: isNavigateToNextPage
16827
16876
  });
16828
16877
  }
16829
16878
  getSelectedCaseReasons() {
@@ -16858,7 +16907,7 @@ class LinkCasesComponent {
16858
16907
  }
16859
16908
  onSelectedLinkedCaseRemove(pos, selectedCaseReference) {
16860
16909
  const caseFieldValue = this.linkedCasesService.caseFieldValue || [];
16861
- const updatedItems = caseFieldValue.filter(item => item.value && item.value.CaseReference !== selectedCaseReference);
16910
+ const updatedItems = caseFieldValue.filter((item) => item.value && item.value.CaseReference !== selectedCaseReference);
16862
16911
  if (updatedItems) {
16863
16912
  this.linkedCasesService.caseFieldValue = updatedItems;
16864
16913
  }
@@ -16879,7 +16928,7 @@ class LinkCasesComponent {
16879
16928
  this.errorMessages.push({
16880
16929
  title: 'dummy-case-selection',
16881
16930
  description: LinkedCasesErrorMessages.CaseSelectionError,
16882
- fieldId: 'caseReason',
16931
+ fieldId: 'caseReason'
16883
16932
  });
16884
16933
  navigateToNextPage = false;
16885
16934
  }
@@ -17614,7 +17663,7 @@ class UnLinkCasesComponent {
17614
17663
  }
17615
17664
  else {
17616
17665
  this.casesService.getCaseViewV2(this.caseId).subscribe((caseView) => {
17617
- const linkedCasesTab = caseView.tabs.find(tab => tab.id === UnLinkCasesComponent.LINKED_CASES_TAB_ID);
17666
+ const linkedCasesTab = caseView.tabs.find((tab) => tab.id === UnLinkCasesComponent.LINKED_CASES_TAB_ID);
17618
17667
  if (linkedCasesTab) {
17619
17668
  const linkedCases = linkedCasesTab.fields[0].value;
17620
17669
  this.linkedCases = linkedCases;
@@ -17626,22 +17675,22 @@ class UnLinkCasesComponent {
17626
17675
  }
17627
17676
  getAllLinkedCaseInformation() {
17628
17677
  const searchCasesResponse = [];
17629
- this.linkedCases.forEach(linkedCase => {
17678
+ this.linkedCases.forEach((linkedCase) => {
17630
17679
  searchCasesResponse.push(this.casesService.getCaseViewV2(linkedCase.caseReference));
17631
17680
  });
17632
17681
  if (searchCasesResponse.length) {
17633
17682
  this.searchCasesByCaseIds(searchCasesResponse).subscribe((searchCases) => {
17634
17683
  searchCases.forEach((response) => {
17635
- const linkedCaseFromList = this.linkedCases.find(linkedCase => linkedCase.caseReference === response.case_id);
17684
+ const linkedCaseFromList = this.linkedCases.find((linkedCase) => linkedCase.caseReference === response.case_id);
17636
17685
  if (linkedCaseFromList) {
17637
17686
  const caseName = this.linkedCasesService.getCaseName(response);
17638
- this.linkedCases.find(linkedCase => linkedCase.caseReference === response.case_id).caseName = caseName;
17687
+ this.linkedCases.find((linkedCase) => linkedCase.caseReference === response.case_id).caseName = caseName;
17639
17688
  }
17640
17689
  });
17641
17690
  this.initForm();
17642
17691
  this.linkedCasesService.linkedCases = this.linkedCases;
17643
17692
  this.isServerError = false;
17644
- }, err => {
17693
+ }, (err) => {
17645
17694
  this.isServerError = true;
17646
17695
  this.notifyAPIFailure.emit(true);
17647
17696
  });
@@ -17656,7 +17705,7 @@ class UnLinkCasesComponent {
17656
17705
  });
17657
17706
  }
17658
17707
  get getLinkedCasesFormArray() {
17659
- const formFieldArray = this.linkedCases.map(val => this.fb.group({
17708
+ const formFieldArray = this.linkedCases.map((val) => this.fb.group({
17660
17709
  caseReference: val.caseReference,
17661
17710
  reasons: val.reasons,
17662
17711
  createdDateTime: val.createdDateTime,
@@ -17670,7 +17719,7 @@ class UnLinkCasesComponent {
17670
17719
  }
17671
17720
  onChange(caseSelected) {
17672
17721
  this.resetErrorMessages();
17673
- const selectedCase = this.linkedCases.find(linkedCase => linkedCase.caseReference === caseSelected.value);
17722
+ const selectedCase = this.linkedCases.find((linkedCase) => linkedCase.caseReference === caseSelected.value);
17674
17723
  if (selectedCase) {
17675
17724
  selectedCase.unlink = caseSelected.checked ? true : false;
17676
17725
  }
@@ -17678,7 +17727,7 @@ class UnLinkCasesComponent {
17678
17727
  onNext() {
17679
17728
  this.resetErrorMessages();
17680
17729
  let navigateToNextPage = true;
17681
- const casesMarkedToUnlink = this.linkedCases.find(linkedCase => linkedCase.unlink && linkedCase.unlink === true);
17730
+ const casesMarkedToUnlink = this.linkedCases.find((linkedCase) => linkedCase.unlink && linkedCase.unlink === true);
17682
17731
  if (!casesMarkedToUnlink) {
17683
17732
  this.errorMessages.push({
17684
17733
  title: 'case-selection',
@@ -17696,7 +17745,7 @@ class UnLinkCasesComponent {
17696
17745
  this.linkedCasesStateEmitter.emit({
17697
17746
  currentLinkedCasesPage: LinkedCasesPages.UNLINK_CASE,
17698
17747
  errorMessages: this.errorMessages,
17699
- navigateToNextPage: isNavigateToNextPage,
17748
+ navigateToNextPage: isNavigateToNextPage
17700
17749
  });
17701
17750
  }
17702
17751
  resetErrorMessages() {
@@ -18039,14 +18088,16 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
18039
18088
  // Get linked case reasons from ref data
18040
18089
  this.linkedCasesService.editMode = false;
18041
18090
  this.subscriptions.add(this.caseEditDataService.caseDetails$.subscribe({
18042
- next: caseDetails => { this.initialiseCaseDetails(caseDetails); }
18091
+ next: (caseDetails) => {
18092
+ this.initialiseCaseDetails(caseDetails);
18093
+ }
18043
18094
  }));
18044
18095
  this.getOrgService();
18045
18096
  this.subscriptions.add(this.caseEditDataService.caseEventTriggerName$.subscribe({
18046
- next: name => this.linkedCasesService.isLinkedCasesEventTrigger = (name === LinkedCasesEventTriggers.LINK_CASES)
18097
+ next: (name) => this.linkedCasesService.isLinkedCasesEventTrigger = (name === LinkedCasesEventTriggers.LINK_CASES)
18047
18098
  }));
18048
18099
  this.subscriptions.add(this.caseEditDataService.caseEditForm$.subscribe({
18049
- next: editForm => this.caseEditForm = editForm
18100
+ next: (editForm) => this.caseEditForm = editForm
18050
18101
  }));
18051
18102
  }
18052
18103
  initialiseCaseDetails(caseDetails) {
@@ -18122,13 +18173,28 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
18122
18173
  }
18123
18174
  }
18124
18175
  submitLinkedCases() {
18176
+ let caseFieldValue = [...(this.linkedCasesService.caseFieldValue || [])];
18125
18177
  if (!this.linkedCasesService.isLinkedCasesEventTrigger) {
18126
- const unlinkedCaseRefereneIds = this.linkedCasesService.linkedCases.filter(item => item.unlink).map(item => item.caseReference);
18127
- const caseFieldValue = this.linkedCasesService.caseFieldValue;
18128
- this.linkedCasesService.caseFieldValue = caseFieldValue.filter(item => unlinkedCaseRefereneIds.indexOf(item.id) === -1);
18178
+ const unlinkedCaseReferenceIds = this.linkedCasesService.linkedCases
18179
+ .filter((item) => item.unlink)
18180
+ .map((item) => item.caseReference);
18181
+ caseFieldValue = caseFieldValue.filter((item) => !unlinkedCaseReferenceIds.includes(item.id));
18182
+ }
18183
+ // Replace the caseLinks value in this.formGroup
18184
+ this.formGroup.patchValue({
18185
+ caseLinks: caseFieldValue
18186
+ });
18187
+ // Replace the caseLinks control in caseEditForm.controls.data
18188
+ const dataFormGroup = this.caseEditForm.controls.data;
18189
+ if (dataFormGroup) {
18190
+ // Remove the existing caseLinks control (if it exists)
18191
+ if (dataFormGroup.contains('caseLinks')) {
18192
+ dataFormGroup.removeControl('caseLinks');
18193
+ }
18194
+ // Add the new control with the replacement value
18195
+ dataFormGroup.addControl('caseLinks', new FormControl(caseFieldValue || []));
18129
18196
  }
18130
- this.formGroup.value.caseLinks = this.linkedCasesService.caseFieldValue;
18131
- this.caseEditForm.controls['data'] = new FormGroup({ caseLinks: new FormControl(this.linkedCasesService.caseFieldValue || []) });
18197
+ // Set the updated form in the caseEditDataService
18132
18198
  this.caseEditDataService.setCaseEditForm(this.caseEditForm);
18133
18199
  }
18134
18200
  isAtFinalPage() {
@@ -18145,11 +18211,11 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
18145
18211
  }
18146
18212
  getLinkedCases() {
18147
18213
  this.casesService.getCaseViewV2(this.linkedCasesService.caseId).subscribe((caseView) => {
18148
- const caseViewFiltered = caseView.tabs.filter(tab => {
18214
+ const caseViewFiltered = caseView.tabs.filter((tab) => {
18149
18215
  return tab.fields.some(({ field_type }) => field_type && field_type.collection_field_type && field_type.collection_field_type.id === 'CaseLink');
18150
18216
  });
18151
18217
  if (caseViewFiltered) {
18152
- const caseLinkFieldValue = caseViewFiltered.map(filtered => filtered.fields?.length > 0 && filtered.fields.filter(field => field.id === 'caseLinks')[0].value);
18218
+ const caseLinkFieldValue = caseViewFiltered.map((filtered) => filtered.fields?.length > 0 && filtered.fields.filter((field) => field.id === 'caseLinks')[0].value);
18153
18219
  this.linkedCasesService.caseFieldValue = caseLinkFieldValue.length ? caseLinkFieldValue[0] : [];
18154
18220
  this.linkedCasesService.getAllLinkedCaseInformation();
18155
18221
  }
@@ -18189,7 +18255,7 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
18189
18255
  type: Component,
18190
18256
  args: [{ selector: 'ccd-write-linked-cases-field', template: "<div class=\"form-group govuk-!-margin-bottom-2\" [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group\" [ngSwitch]=\"linkedCasesPage\">\n <ng-container *ngSwitchCase=\"linkedCasesPages.BEFORE_YOU_START\">\n <ccd-linked-cases-before-you-start\n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\"></ccd-linked-cases-before-you-start>\n </ng-container>\n <ng-container *ngSwitchCase=\"linkedCasesPages.NO_LINKED_CASES\">\n <ccd-no-linked-cases\n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\"></ccd-no-linked-cases>\n </ng-container>\n <ng-container *ngSwitchCase=\"linkedCasesPages.LINK_CASE\">\n <ccd-link-cases\n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\"></ccd-link-cases>\n </ng-container>\n <ng-container *ngSwitchCase=\"linkedCasesPages.UNLINK_CASE\">\n <ccd-unlink-cases\n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\"></ccd-unlink-cases>\n </ng-container>\n <ng-container *ngSwitchCase=\"linkedCasesPages.CHECK_YOUR_ANSWERS\">\n <ccd-linked-cases-check-your-answers\n (linkedCasesStateEmitter)=\"onLinkedCasesStateEmitted($event)\"></ccd-linked-cases-check-your-answers>\n </ng-container>\n </div>\n</div>\n" }]
18191
18257
  }], () => [{ type: AbstractAppConfig }, { type: CommonDataService }, { type: CasesService }, { type: LinkedCasesService }, { type: CaseEditDataService }], null); })();
18192
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(WriteLinkedCasesFieldComponent, { className: "WriteLinkedCasesFieldComponent", filePath: "lib/shared/components/palette/linked-cases/write-linked-cases-field.component.ts", lineNumber: 19 }); })();
18258
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(WriteLinkedCasesFieldComponent, { className: "WriteLinkedCasesFieldComponent", filePath: "lib/shared/components/palette/linked-cases/write-linked-cases-field.component.ts", lineNumber: 18 }); })();
18193
18259
 
18194
18260
  function ReadMoneyGbpFieldComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
18195
18261
  i0.ɵɵelementContainerStart(0);
@@ -18609,7 +18675,7 @@ class ReadNumberFieldComponent extends AbstractFieldReadComponent {
18609
18675
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadNumberFieldComponent, { className: "ReadNumberFieldComponent", filePath: "lib/shared/components/palette/number/read-number-field.component.ts", lineNumber: 8 }); })();
18610
18676
 
18611
18677
  const _c0$F = a0 => ({ "form-group-error": a0 });
18612
- const _c1$g = a0 => ({ "govuk-input--error": a0 });
18678
+ const _c1$f = a0 => ({ "govuk-input--error": a0 });
18613
18679
  function WriteNumberFieldComponent_span_2_Template(rf, ctx) { if (rf & 1) {
18614
18680
  i0.ɵɵelementStart(0, "span", 6);
18615
18681
  i0.ɵɵtext(1);
@@ -18664,7 +18730,7 @@ class WriteNumberFieldComponent extends AbstractFieldWriteComponent {
18664
18730
  i0.ɵɵadvance();
18665
18731
  i0.ɵɵproperty("ngIf", ctx.numberControl.errors && ctx.numberControl.dirty);
18666
18732
  i0.ɵɵadvance();
18667
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(10, _c1$g, ctx.numberControl.errors && ctx.numberControl.dirty))("id", ctx.id())("formControl", ctx.numberControl);
18733
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(10, _c1$f, ctx.numberControl.errors && ctx.numberControl.dirty))("id", ctx.id())("formControl", ctx.numberControl);
18668
18734
  } }, dependencies: [i5.NgClass, i5.NgIf, i4.DefaultValueAccessor, i4.NumberValueAccessor, i4.NgControlStatus, i4.FormControlDirective, FieldLabelPipe, FirstErrorPipe, i1.RpxTranslatePipe], encapsulation: 2 });
18669
18735
  }
18670
18736
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WriteNumberFieldComponent, [{
@@ -19292,7 +19358,7 @@ class ReadPhoneUKFieldComponent extends AbstractFieldReadComponent {
19292
19358
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadPhoneUKFieldComponent, { className: "ReadPhoneUKFieldComponent", filePath: "lib/shared/components/palette/phone-uk/read-phone-uk-field.component.ts", lineNumber: 8 }); })();
19293
19359
 
19294
19360
  const _c0$D = a0 => ({ "form-group-error": a0 });
19295
- const _c1$f = a0 => ({ "govuk-input--error": a0 });
19361
+ const _c1$e = a0 => ({ "govuk-input--error": a0 });
19296
19362
  function WritePhoneUKFieldComponent_span_2_Template(rf, ctx) { if (rf & 1) {
19297
19363
  i0.ɵɵelementStart(0, "span", 6);
19298
19364
  i0.ɵɵtext(1);
@@ -19347,7 +19413,7 @@ class WritePhoneUKFieldComponent extends AbstractFieldWriteComponent {
19347
19413
  i0.ɵɵadvance();
19348
19414
  i0.ɵɵproperty("ngIf", ctx.phoneUkControl.errors && (ctx.phoneUkControl.dirty || ctx.phoneUkControl.touched));
19349
19415
  i0.ɵɵadvance();
19350
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(10, _c1$f, ctx.phoneUkControl.errors && ctx.phoneUkControl.dirty))("id", ctx.id())("formControl", ctx.phoneUkControl);
19416
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(10, _c1$e, ctx.phoneUkControl.errors && ctx.phoneUkControl.dirty))("id", ctx.id())("formControl", ctx.phoneUkControl);
19351
19417
  } }, dependencies: [i5.NgClass, i5.NgIf, i4.DefaultValueAccessor, i4.NgControlStatus, i4.FormControlDirective, FieldLabelPipe, FirstErrorPipe, i1.RpxTranslatePipe], encapsulation: 2 });
19352
19418
  }
19353
19419
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(WritePhoneUKFieldComponent, [{
@@ -19576,8 +19642,10 @@ function QualifyingQuestionDetailComponent_ng_container_0_Template(rf, ctx) { if
19576
19642
  i0.ɵɵtext(5);
19577
19643
  i0.ɵɵpipe(6, "rpxTranslate");
19578
19644
  i0.ɵɵelementEnd();
19579
- i0.ɵɵelement(7, "ccd-markdown", 3);
19580
- i0.ɵɵpipe(8, "rpxTranslate");
19645
+ i0.ɵɵelementStart(7, "div", 3);
19646
+ i0.ɵɵelement(8, "ccd-markdown", 4);
19647
+ i0.ɵɵpipe(9, "rpxTranslate");
19648
+ i0.ɵɵelementEnd();
19581
19649
  i0.ɵɵelementContainerEnd();
19582
19650
  } if (rf & 2) {
19583
19651
  const ctx_r0 = i0.ɵɵnextContext();
@@ -19585,25 +19653,25 @@ function QualifyingQuestionDetailComponent_ng_container_0_Template(rf, ctx) { if
19585
19653
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 3, "Are you contacting us about any of the following:"), " ");
19586
19654
  i0.ɵɵadvance(3);
19587
19655
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 5, ctx_r0.qualifyingQuestion.name), " ");
19588
- i0.ɵɵadvance(2);
19589
- i0.ɵɵproperty("content", i0.ɵɵpipeBind1(8, 7, ctx_r0.qualifyingQuestion.markdown));
19656
+ i0.ɵɵadvance(3);
19657
+ i0.ɵɵproperty("content", i0.ɵɵpipeBind1(9, 7, ctx_r0.qualifyingQuestion.markdown));
19590
19658
  } }
19591
19659
  class QualifyingQuestionDetailComponent {
19592
19660
  qualifyingQuestion;
19593
19661
  static ɵfac = function QualifyingQuestionDetailComponent_Factory(t) { return new (t || QualifyingQuestionDetailComponent)(); };
19594
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QualifyingQuestionDetailComponent, selectors: [["ccd-qualifying-question-detail"]], inputs: { qualifyingQuestion: "qualifyingQuestion" }, decls: 1, vars: 1, consts: [[4, "ngIf"], [1, "govuk-caption-l"], [1, "govuk-heading-l"], [3, "content"]], template: function QualifyingQuestionDetailComponent_Template(rf, ctx) { if (rf & 1) {
19595
- i0.ɵɵtemplate(0, QualifyingQuestionDetailComponent_ng_container_0_Template, 9, 9, "ng-container", 0);
19662
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QualifyingQuestionDetailComponent, selectors: [["ccd-qualifying-question-detail"]], inputs: { qualifyingQuestion: "qualifyingQuestion" }, decls: 1, vars: 1, consts: [[4, "ngIf"], [1, "govuk-caption-l"], [1, "govuk-heading-l"], [1, "qm-qualifying-question"], [3, "content"]], template: function QualifyingQuestionDetailComponent_Template(rf, ctx) { if (rf & 1) {
19663
+ i0.ɵɵtemplate(0, QualifyingQuestionDetailComponent_ng_container_0_Template, 10, 9, "ng-container", 0);
19596
19664
  } if (rf & 2) {
19597
19665
  i0.ɵɵproperty("ngIf", ctx.qualifyingQuestion == null ? null : ctx.qualifyingQuestion.markdown);
19598
- } }, dependencies: [i5.NgIf, MarkdownComponent, i1.RpxTranslatePipe], encapsulation: 2 });
19666
+ } }, dependencies: [i5.NgIf, MarkdownComponent, i1.RpxTranslatePipe], styles: [".qm-qualifying-question[_ngcontent-%COMP%] .markdown[_ngcontent-%COMP%]{font-size:19px}"] });
19599
19667
  }
19600
19668
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(QualifyingQuestionDetailComponent, [{
19601
19669
  type: Component,
19602
- args: [{ selector: 'ccd-qualifying-question-detail', template: "<ng-container *ngIf=\"qualifyingQuestion?.markdown\">\n <span class=\"govuk-caption-l\">\n {{ 'Are you contacting us about any of the following:' | rpxTranslate }}\n </span>\n <h1 class=\"govuk-heading-l\">\n {{ qualifyingQuestion.name | rpxTranslate }}\n </h1>\n <ccd-markdown\n [content]=\"qualifyingQuestion.markdown | rpxTranslate\">\n </ccd-markdown>\n</ng-container>\n" }]
19670
+ args: [{ selector: 'ccd-qualifying-question-detail', template: "<ng-container *ngIf=\"qualifyingQuestion?.markdown\">\n <span class=\"govuk-caption-l\">\n {{ 'Are you contacting us about any of the following:' | rpxTranslate }}\n </span>\n <h1 class=\"govuk-heading-l\">\n {{ qualifyingQuestion.name | rpxTranslate }}\n </h1>\n <div class=\"qm-qualifying-question\">\n <ccd-markdown\n [content]=\"qualifyingQuestion.markdown | rpxTranslate\">\n </ccd-markdown>\n </div>\n</ng-container>\n", styles: [".qm-qualifying-question .markdown{font-size:19px}\n"] }]
19603
19671
  }], null, { qualifyingQuestion: [{
19604
19672
  type: Input
19605
19673
  }] }); })();
19606
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QualifyingQuestionDetailComponent, { className: "QualifyingQuestionDetailComponent", filePath: "lib/shared/components/palette/query-management/components/qualifying-questions/qualifying-question-detail/qualifying-question-detail.component.ts", lineNumber: 8 }); })();
19674
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QualifyingQuestionDetailComponent, { className: "QualifyingQuestionDetailComponent", filePath: "lib/shared/components/palette/query-management/components/qualifying-questions/qualifying-question-detail/qualifying-question-detail.component.ts", lineNumber: 9 }); })();
19607
19675
 
19608
19676
  var RaiseQueryErrorMessage;
19609
19677
  (function (RaiseQueryErrorMessage) {
@@ -20262,6 +20330,7 @@ class QueryCheckYourAnswersComponent {
20262
20330
  caseViewTrigger;
20263
20331
  caseDetails;
20264
20332
  queryId;
20333
+ tid;
20265
20334
  createEventSubscription;
20266
20335
  searchTasksSubscription;
20267
20336
  queryCreateContextEnum = QueryCreateContext;
@@ -20270,6 +20339,7 @@ class QueryCheckYourAnswersComponent {
20270
20339
  fieldId;
20271
20340
  attachments;
20272
20341
  errorMessages = [];
20342
+ filteredTask = [];
20273
20343
  constructor(route, router, casesService, caseNotifier, workAllocationService, sessionStorageService, qualifyingQuestionService) {
20274
20344
  this.route = route;
20275
20345
  this.router = router;
@@ -20281,6 +20351,7 @@ class QueryCheckYourAnswersComponent {
20281
20351
  }
20282
20352
  ngOnInit() {
20283
20353
  this.queryId = this.route.snapshot.params.qid;
20354
+ this.tid = this.route.snapshot.queryParams?.tid;
20284
20355
  this.caseNotifier.caseView.pipe(take(1)).subscribe((caseDetails) => {
20285
20356
  this.caseDetails = caseDetails;
20286
20357
  // Find the appropriate event trigger based on the queryCreateContext
@@ -20293,6 +20364,23 @@ class QueryCheckYourAnswersComponent {
20293
20364
  // Get the document attachments
20294
20365
  this.getDocumentAttachments();
20295
20366
  this.setCaseQueriesCollectionData();
20367
+ if (this.queryCreateContext === QueryCreateContext.RESPOND) {
20368
+ this.searchTasksSubscription = this.workAllocationService.getTasksByCaseIdAndEventId(this.RESPOND_TO_QUERY_EVENT_TRIGGER_ID, this.caseDetails.case_id, this.caseDetails.case_type.id, this.caseDetails.case_type.jurisdiction.id)
20369
+ .subscribe({
20370
+ next: (response) => {
20371
+ // Filter task by query id
20372
+ if (response.tasks?.length > 1) {
20373
+ this.filteredTask = response.tasks?.find((task) => task.case_id === this.tid);
20374
+ }
20375
+ else {
20376
+ this.filteredTask = response.tasks;
20377
+ }
20378
+ },
20379
+ error: (error) => {
20380
+ console.error('Error in searchTasksSubscription:', error);
20381
+ }
20382
+ });
20383
+ }
20296
20384
  }
20297
20385
  ngOnDestroy() {
20298
20386
  this.createEventSubscription?.unsubscribe();
@@ -20315,7 +20403,25 @@ class QueryCheckYourAnswersComponent {
20315
20403
  return;
20316
20404
  }
20317
20405
  const data = this.generateCaseQueriesCollectionData();
20318
- this.createEventSubscription = this.casesService.createEvent(this.caseDetails, {
20406
+ const createEvent$ = this.createEvent(data);
20407
+ if (this.queryCreateContext === QueryCreateContext.RESPOND) {
20408
+ const completeTask$ = this.workAllocationService.completeTask(this.filteredTask[0].id, this.caseViewTrigger.name);
20409
+ this.createEventSubscription = forkJoin([createEvent$, completeTask$]).subscribe({
20410
+ next: ([createEventResponse, tasksResponse]) => {
20411
+ this.finaliseSubmission();
20412
+ },
20413
+ error: (error) => this.handleError(error)
20414
+ });
20415
+ }
20416
+ else {
20417
+ this.createEventSubscription = createEvent$.subscribe({
20418
+ next: () => this.finaliseSubmission(),
20419
+ error: (error) => this.handleError(error)
20420
+ });
20421
+ }
20422
+ }
20423
+ createEvent(data) {
20424
+ return this.casesService.createEvent(this.caseDetails, {
20319
20425
  data,
20320
20426
  event: {
20321
20427
  id: this.caseViewTrigger?.id,
@@ -20324,34 +20430,16 @@ class QueryCheckYourAnswersComponent {
20324
20430
  },
20325
20431
  event_token: this.eventData?.event_token,
20326
20432
  ignore_warning: false
20327
- }).subscribe(() => {
20328
- // Search and complete task
20329
- this.searchAndCompleteTask();
20330
- // Emit query submitted event
20331
- this.querySubmitted.emit(true);
20332
- this.qualifyingQuestionService.clearQualifyingQuestionSelection();
20333
- },
20334
- // Error
20335
- () => this.router.navigate(['/', 'service-down']));
20336
- }
20337
- searchAndCompleteTask() {
20338
- // Search Task
20339
- const searchParameter = { ccdId: this.caseDetails.case_id };
20340
- this.searchTasksSubscription = this.workAllocationService.searchTasks(searchParameter)
20341
- .subscribe((response) => {
20342
- // Filter task by query id
20343
- const filteredTask = response.tasks?.find((task) => Object.values(task.additional_properties).some((value) => value === this.queryId));
20344
- // Trigger event completion
20345
- this.eventCompletionParams = {
20346
- caseId: this.caseDetails.case_id,
20347
- eventId: this.RESPOND_TO_QUERY_EVENT_TRIGGER_ID,
20348
- task: filteredTask
20349
- };
20350
- }, (error) => {
20351
- console.error('Error in searchTasksSubscription:', error);
20352
- // Handle error appropriately
20353
20433
  });
20354
20434
  }
20435
+ finaliseSubmission() {
20436
+ this.querySubmitted.emit(true);
20437
+ this.qualifyingQuestionService.clearQualifyingQuestionSelection();
20438
+ }
20439
+ handleError(error) {
20440
+ console.error('Error in API calls:', error);
20441
+ this.router.navigate(['/', 'service-down']);
20442
+ }
20355
20443
  generateCaseQueriesCollectionData() {
20356
20444
  const currentUserDetails = JSON.parse(this.sessionStorageService.getItem('userDetails'));
20357
20445
  const caseMessage = this.queryCreateContext === QueryCreateContext.NEW_QUERY
@@ -20560,10 +20648,32 @@ class QueryCheckYourAnswersComponent {
20560
20648
  }], querySubmitted: [{
20561
20649
  type: Output
20562
20650
  }] }); })();
20563
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryCheckYourAnswersComponent, { className: "QueryCheckYourAnswersComponent", filePath: "lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.ts", lineNumber: 27 }); })();
20651
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryCheckYourAnswersComponent, { className: "QueryCheckYourAnswersComponent", filePath: "lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.ts", lineNumber: 26 }); })();
20564
20652
 
20565
- function QueryDetailsComponent_ng_container_0_tr_46_Template(rf, ctx) { if (rf & 1) {
20566
- i0.ɵɵelementStart(0, "tr", 11)(1, "th", 7);
20653
+ function QueryDetailsComponent_ng_container_0_cut_alert_1_Template(rf, ctx) { if (rf & 1) {
20654
+ i0.ɵɵelementStart(0, "cut-alert", 11);
20655
+ i0.ɵɵelementContainerStart(1);
20656
+ i0.ɵɵtext(2);
20657
+ i0.ɵɵelementContainerEnd();
20658
+ i0.ɵɵelementEnd();
20659
+ } if (rf & 2) {
20660
+ const ctx_r0 = i0.ɵɵnextContext(2);
20661
+ i0.ɵɵadvance(2);
20662
+ i0.ɵɵtextInterpolate(ctx_r0.message);
20663
+ } }
20664
+ function QueryDetailsComponent_ng_container_0_p_3_Template(rf, ctx) { if (rf & 1) {
20665
+ const _r2 = i0.ɵɵgetCurrentView();
20666
+ i0.ɵɵelementStart(0, "p")(1, "a", 12);
20667
+ i0.ɵɵlistener("click", function QueryDetailsComponent_ng_container_0_p_3_Template_a_click_1_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.onBack()); });
20668
+ i0.ɵɵtext(2);
20669
+ i0.ɵɵpipe(3, "rpxTranslate");
20670
+ i0.ɵɵelementEnd()();
20671
+ } if (rf & 2) {
20672
+ i0.ɵɵadvance(2);
20673
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 1, "Back to query list"));
20674
+ } }
20675
+ function QueryDetailsComponent_ng_container_0_tr_44_Template(rf, ctx) { if (rf & 1) {
20676
+ i0.ɵɵelementStart(0, "tr", 13)(1, "th", 7);
20567
20677
  i0.ɵɵtext(2);
20568
20678
  i0.ɵɵpipe(3, "rpxTranslate");
20569
20679
  i0.ɵɵelementEnd();
@@ -20572,34 +20682,34 @@ function QueryDetailsComponent_ng_container_0_tr_46_Template(rf, ctx) { if (rf &
20572
20682
  i0.ɵɵpipe(6, "date");
20573
20683
  i0.ɵɵelementEnd()();
20574
20684
  } if (rf & 2) {
20575
- const ctx_r1 = i0.ɵɵnextContext(2);
20685
+ const ctx_r0 = i0.ɵɵnextContext(2);
20576
20686
  i0.ɵɵadvance(2);
20577
20687
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 2, "What is the date of the hearing?"));
20578
20688
  i0.ɵɵadvance(3);
20579
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(6, 4, ctx_r1.query.hearingDate, "dd MMM yyyy"));
20689
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(6, 4, ctx_r0.query.hearingDate, "dd MMM yyyy"));
20580
20690
  } }
20581
- function QueryDetailsComponent_ng_container_0_tr_47_ccd_query_attachments_read_5_Template(rf, ctx) { if (rf & 1) {
20582
- i0.ɵɵelement(0, "ccd-query-attachments-read", 13);
20691
+ function QueryDetailsComponent_ng_container_0_tr_45_ccd_query_attachments_read_5_Template(rf, ctx) { if (rf & 1) {
20692
+ i0.ɵɵelement(0, "ccd-query-attachments-read", 15);
20583
20693
  } if (rf & 2) {
20584
- const ctx_r1 = i0.ɵɵnextContext(3);
20585
- i0.ɵɵproperty("attachments", ctx_r1.query.attachments);
20694
+ const ctx_r0 = i0.ɵɵnextContext(3);
20695
+ i0.ɵɵproperty("attachments", ctx_r0.query.attachments);
20586
20696
  } }
20587
- function QueryDetailsComponent_ng_container_0_tr_47_Template(rf, ctx) { if (rf & 1) {
20697
+ function QueryDetailsComponent_ng_container_0_tr_45_Template(rf, ctx) { if (rf & 1) {
20588
20698
  i0.ɵɵelementStart(0, "tr", 6)(1, "th", 7);
20589
20699
  i0.ɵɵtext(2);
20590
20700
  i0.ɵɵpipe(3, "rpxTranslate");
20591
20701
  i0.ɵɵelementEnd();
20592
20702
  i0.ɵɵelementStart(4, "td", 8);
20593
- i0.ɵɵtemplate(5, QueryDetailsComponent_ng_container_0_tr_47_ccd_query_attachments_read_5_Template, 1, 1, "ccd-query-attachments-read", 12);
20703
+ i0.ɵɵtemplate(5, QueryDetailsComponent_ng_container_0_tr_45_ccd_query_attachments_read_5_Template, 1, 1, "ccd-query-attachments-read", 14);
20594
20704
  i0.ɵɵelementEnd()();
20595
20705
  } if (rf & 2) {
20596
- const ctx_r1 = i0.ɵɵnextContext(2);
20706
+ const ctx_r0 = i0.ɵɵnextContext(2);
20597
20707
  i0.ɵɵadvance(2);
20598
20708
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 2, "Attachments"));
20599
20709
  i0.ɵɵadvance(3);
20600
- i0.ɵɵproperty("ngIf", ctx_r1.query.attachments);
20710
+ i0.ɵɵproperty("ngIf", ctx_r0.query.attachments);
20601
20711
  } }
20602
- function QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_ng_container_1_tr_15_Template(rf, ctx) { if (rf & 1) {
20712
+ function QueryDetailsComponent_ng_container_0_ng_container_46_ng_container_1_ng_container_1_tr_15_Template(rf, ctx) { if (rf & 1) {
20603
20713
  i0.ɵɵelementStart(0, "tr", 6)(1, "th", 7);
20604
20714
  i0.ɵɵtext(2);
20605
20715
  i0.ɵɵpipe(3, "rpxTranslate");
@@ -20614,19 +20724,19 @@ function QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_ng_
20614
20724
  i0.ɵɵadvance(3);
20615
20725
  i0.ɵɵtextInterpolate(child_r3.name);
20616
20726
  } }
20617
- function QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_ng_container_1_tr_22_ccd_query_attachments_read_5_Template(rf, ctx) { if (rf & 1) {
20618
- i0.ɵɵelement(0, "ccd-query-attachments-read", 13);
20727
+ function QueryDetailsComponent_ng_container_0_ng_container_46_ng_container_1_ng_container_1_tr_22_ccd_query_attachments_read_5_Template(rf, ctx) { if (rf & 1) {
20728
+ i0.ɵɵelement(0, "ccd-query-attachments-read", 15);
20619
20729
  } if (rf & 2) {
20620
20730
  const child_r3 = i0.ɵɵnextContext(3).$implicit;
20621
20731
  i0.ɵɵproperty("attachments", child_r3.attachments);
20622
20732
  } }
20623
- function QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_ng_container_1_tr_22_Template(rf, ctx) { if (rf & 1) {
20733
+ function QueryDetailsComponent_ng_container_0_ng_container_46_ng_container_1_ng_container_1_tr_22_Template(rf, ctx) { if (rf & 1) {
20624
20734
  i0.ɵɵelementStart(0, "tr", 6)(1, "th", 7);
20625
20735
  i0.ɵɵtext(2);
20626
20736
  i0.ɵɵpipe(3, "rpxTranslate");
20627
20737
  i0.ɵɵelementEnd();
20628
20738
  i0.ɵɵelementStart(4, "td", 8);
20629
- i0.ɵɵtemplate(5, QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_ng_container_1_tr_22_ccd_query_attachments_read_5_Template, 1, 1, "ccd-query-attachments-read", 12);
20739
+ i0.ɵɵtemplate(5, QueryDetailsComponent_ng_container_0_ng_container_46_ng_container_1_ng_container_1_tr_22_ccd_query_attachments_read_5_Template, 1, 1, "ccd-query-attachments-read", 14);
20630
20740
  i0.ɵɵelementEnd()();
20631
20741
  } if (rf & 2) {
20632
20742
  const child_r3 = i0.ɵɵnextContext(2).$implicit;
@@ -20635,7 +20745,7 @@ function QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_ng_
20635
20745
  i0.ɵɵadvance(3);
20636
20746
  i0.ɵɵproperty("ngIf", child_r3.attachments);
20637
20747
  } }
20638
- function QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
20748
+ function QueryDetailsComponent_ng_container_0_ng_container_46_ng_container_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
20639
20749
  i0.ɵɵelementContainerStart(0);
20640
20750
  i0.ɵɵelementStart(1, "table", 3);
20641
20751
  i0.ɵɵpipe(2, "rpxTranslate");
@@ -20651,7 +20761,7 @@ function QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_ng_
20651
20761
  i0.ɵɵtext(13);
20652
20762
  i0.ɵɵpipe(14, "date");
20653
20763
  i0.ɵɵelementEnd()();
20654
- i0.ɵɵtemplate(15, QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_ng_container_1_tr_15_Template, 6, 4, "tr", 10);
20764
+ i0.ɵɵtemplate(15, QueryDetailsComponent_ng_container_0_ng_container_46_ng_container_1_ng_container_1_tr_15_Template, 6, 4, "tr", 10);
20655
20765
  i0.ɵɵelementStart(16, "tr", 6)(17, "th", 7);
20656
20766
  i0.ɵɵtext(18);
20657
20767
  i0.ɵɵpipe(19, "rpxTranslate");
@@ -20659,12 +20769,12 @@ function QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_ng_
20659
20769
  i0.ɵɵelementStart(20, "td", 8);
20660
20770
  i0.ɵɵtext(21);
20661
20771
  i0.ɵɵelementEnd()();
20662
- i0.ɵɵtemplate(22, QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_ng_container_1_tr_22_Template, 6, 4, "tr", 10);
20772
+ i0.ɵɵtemplate(22, QueryDetailsComponent_ng_container_0_ng_container_46_ng_container_1_ng_container_1_tr_22_Template, 6, 4, "tr", 10);
20663
20773
  i0.ɵɵelementEnd()();
20664
20774
  i0.ɵɵelementContainerEnd();
20665
20775
  } if (rf & 2) {
20666
20776
  const child_r3 = i0.ɵɵnextContext().$implicit;
20667
- const ctx_r1 = i0.ɵɵnextContext(3);
20777
+ const ctx_r0 = i0.ɵɵnextContext(3);
20668
20778
  i0.ɵɵadvance();
20669
20779
  i0.ɵɵattribute("aria-describedby", i0.ɵɵpipeBind1(2, 8, "Response of the query"));
20670
20780
  i0.ɵɵadvance(4);
@@ -20674,7 +20784,7 @@ function QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_ng_
20674
20784
  i0.ɵɵadvance(3);
20675
20785
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(14, 14, child_r3.createdOn, "dd MMM yyyy"));
20676
20786
  i0.ɵɵadvance(2);
20677
- i0.ɵɵproperty("ngIf", ctx_r1.isCaseworker());
20787
+ i0.ɵɵproperty("ngIf", ctx_r0.isCaseworker());
20678
20788
  i0.ɵɵadvance(3);
20679
20789
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(19, 17, "Response detail"));
20680
20790
  i0.ɵɵadvance(3);
@@ -20682,19 +20792,19 @@ function QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_ng_
20682
20792
  i0.ɵɵadvance();
20683
20793
  i0.ɵɵproperty("ngIf", child_r3.attachments.length > 0);
20684
20794
  } }
20685
- function QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_ng_template_2_tr_26_ccd_query_attachments_read_5_Template(rf, ctx) { if (rf & 1) {
20686
- i0.ɵɵelement(0, "ccd-query-attachments-read", 13);
20795
+ function QueryDetailsComponent_ng_container_0_ng_container_46_ng_container_1_ng_template_2_tr_26_ccd_query_attachments_read_5_Template(rf, ctx) { if (rf & 1) {
20796
+ i0.ɵɵelement(0, "ccd-query-attachments-read", 15);
20687
20797
  } if (rf & 2) {
20688
20798
  const child_r3 = i0.ɵɵnextContext(3).$implicit;
20689
20799
  i0.ɵɵproperty("attachments", child_r3.attachments);
20690
20800
  } }
20691
- function QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_ng_template_2_tr_26_Template(rf, ctx) { if (rf & 1) {
20801
+ function QueryDetailsComponent_ng_container_0_ng_container_46_ng_container_1_ng_template_2_tr_26_Template(rf, ctx) { if (rf & 1) {
20692
20802
  i0.ɵɵelementStart(0, "tr", 6)(1, "th", 7);
20693
20803
  i0.ɵɵtext(2);
20694
20804
  i0.ɵɵpipe(3, "rpxTranslate");
20695
20805
  i0.ɵɵelementEnd();
20696
20806
  i0.ɵɵelementStart(4, "td", 8);
20697
- i0.ɵɵtemplate(5, QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_ng_template_2_tr_26_ccd_query_attachments_read_5_Template, 1, 1, "ccd-query-attachments-read", 12);
20807
+ i0.ɵɵtemplate(5, QueryDetailsComponent_ng_container_0_ng_container_46_ng_container_1_ng_template_2_tr_26_ccd_query_attachments_read_5_Template, 1, 1, "ccd-query-attachments-read", 14);
20698
20808
  i0.ɵɵelementEnd()();
20699
20809
  } if (rf & 2) {
20700
20810
  const child_r3 = i0.ɵɵnextContext(2).$implicit;
@@ -20703,7 +20813,7 @@ function QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_ng_
20703
20813
  i0.ɵɵadvance(3);
20704
20814
  i0.ɵɵproperty("ngIf", child_r3.attachments);
20705
20815
  } }
20706
- function QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_ng_template_2_Template(rf, ctx) { if (rf & 1) {
20816
+ function QueryDetailsComponent_ng_container_0_ng_container_46_ng_container_1_ng_template_2_Template(rf, ctx) { if (rf & 1) {
20707
20817
  i0.ɵɵelementStart(0, "table", 3);
20708
20818
  i0.ɵɵpipe(1, "rpxTranslate");
20709
20819
  i0.ɵɵelementStart(2, "caption", 4)(3, "div");
@@ -20732,7 +20842,7 @@ function QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_ng_
20732
20842
  i0.ɵɵelementStart(24, "td", 8);
20733
20843
  i0.ɵɵtext(25);
20734
20844
  i0.ɵɵelementEnd()();
20735
- i0.ɵɵtemplate(26, QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_ng_template_2_tr_26_Template, 6, 4, "tr", 10);
20845
+ i0.ɵɵtemplate(26, QueryDetailsComponent_ng_container_0_ng_container_46_ng_container_1_ng_template_2_tr_26_Template, 6, 4, "tr", 10);
20736
20846
  i0.ɵɵelementEnd()();
20737
20847
  } if (rf & 2) {
20738
20848
  const child_r3 = i0.ɵɵnextContext().$implicit;
@@ -20754,9 +20864,9 @@ function QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_ng_
20754
20864
  i0.ɵɵadvance();
20755
20865
  i0.ɵɵproperty("ngIf", child_r3.attachments.length > 0);
20756
20866
  } }
20757
- function QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_Template(rf, ctx) { if (rf & 1) {
20867
+ function QueryDetailsComponent_ng_container_0_ng_container_46_ng_container_1_Template(rf, ctx) { if (rf & 1) {
20758
20868
  i0.ɵɵelementContainerStart(0);
20759
- i0.ɵɵtemplate(1, QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_ng_container_1_Template, 23, 19, "ng-container", 15)(2, QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_ng_template_2_Template, 27, 22, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
20869
+ i0.ɵɵtemplate(1, QueryDetailsComponent_ng_container_0_ng_container_46_ng_container_1_ng_container_1_Template, 23, 19, "ng-container", 17)(2, QueryDetailsComponent_ng_container_0_ng_container_46_ng_container_1_ng_template_2_Template, 27, 22, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
20760
20870
  i0.ɵɵelementContainerEnd();
20761
20871
  } if (rf & 2) {
20762
20872
  const i_r4 = ctx.index;
@@ -20764,117 +20874,125 @@ function QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_Tem
20764
20874
  i0.ɵɵadvance();
20765
20875
  i0.ɵɵproperty("ngIf", i_r4 % 2 === 0)("ngIfElse", followUpMessage_r5);
20766
20876
  } }
20767
- function QueryDetailsComponent_ng_container_0_ng_container_48_Template(rf, ctx) { if (rf & 1) {
20877
+ function QueryDetailsComponent_ng_container_0_ng_container_46_Template(rf, ctx) { if (rf & 1) {
20768
20878
  i0.ɵɵelementContainerStart(0);
20769
- i0.ɵɵtemplate(1, QueryDetailsComponent_ng_container_0_ng_container_48_ng_container_1_Template, 4, 2, "ng-container", 14);
20879
+ i0.ɵɵtemplate(1, QueryDetailsComponent_ng_container_0_ng_container_46_ng_container_1_Template, 4, 2, "ng-container", 16);
20770
20880
  i0.ɵɵelementContainerEnd();
20771
20881
  } if (rf & 2) {
20772
- const ctx_r1 = i0.ɵɵnextContext(2);
20882
+ const ctx_r0 = i0.ɵɵnextContext(2);
20773
20883
  i0.ɵɵadvance();
20774
- i0.ɵɵproperty("ngForOf", ctx_r1.query.children);
20884
+ i0.ɵɵproperty("ngForOf", ctx_r0.query.children);
20775
20885
  } }
20776
20886
  function QueryDetailsComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
20777
- const _r1 = i0.ɵɵgetCurrentView();
20778
20887
  i0.ɵɵelementContainerStart(0);
20779
- i0.ɵɵelement(1, "br");
20780
- i0.ɵɵelementStart(2, "p")(3, "a", 2);
20781
- i0.ɵɵlistener("click", function QueryDetailsComponent_ng_container_0_Template_a_click_3_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onBack()); });
20782
- i0.ɵɵtext(4);
20783
- i0.ɵɵpipe(5, "rpxTranslate");
20784
- i0.ɵɵelementEnd()();
20785
- i0.ɵɵelementStart(6, "div")(7, "table", 3);
20786
- i0.ɵɵpipe(8, "rpxTranslate");
20787
- i0.ɵɵelementStart(9, "caption", 4)(10, "div");
20788
- i0.ɵɵtext(11);
20789
- i0.ɵɵpipe(12, "rpxTranslate");
20888
+ i0.ɵɵtemplate(1, QueryDetailsComponent_ng_container_0_cut_alert_1_Template, 3, 1, "cut-alert", 2);
20889
+ i0.ɵɵelement(2, "br");
20890
+ i0.ɵɵtemplate(3, QueryDetailsComponent_ng_container_0_p_3_Template, 4, 3, "p", 1);
20891
+ i0.ɵɵelementStart(4, "div")(5, "table", 3);
20892
+ i0.ɵɵpipe(6, "rpxTranslate");
20893
+ i0.ɵɵelementStart(7, "caption", 4)(8, "div");
20894
+ i0.ɵɵtext(9);
20895
+ i0.ɵɵpipe(10, "rpxTranslate");
20790
20896
  i0.ɵɵelementEnd()();
20791
- i0.ɵɵelementStart(13, "tbody", 5)(14, "tr", 6)(15, "th", 7);
20792
- i0.ɵɵtext(16);
20793
- i0.ɵɵpipe(17, "rpxTranslate");
20897
+ i0.ɵɵelementStart(11, "tbody", 5)(12, "tr", 6)(13, "th", 7);
20898
+ i0.ɵɵtext(14);
20899
+ i0.ɵɵpipe(15, "rpxTranslate");
20794
20900
  i0.ɵɵelementEnd();
20795
- i0.ɵɵelementStart(18, "td", 8);
20796
- i0.ɵɵtext(19);
20901
+ i0.ɵɵelementStart(16, "td", 8);
20902
+ i0.ɵɵtext(17);
20797
20903
  i0.ɵɵelementEnd()();
20798
- i0.ɵɵelementStart(20, "tr", 6)(21, "th", 7);
20799
- i0.ɵɵtext(22);
20800
- i0.ɵɵpipe(23, "rpxTranslate");
20904
+ i0.ɵɵelementStart(18, "tr", 6)(19, "th", 7);
20905
+ i0.ɵɵtext(20);
20906
+ i0.ɵɵpipe(21, "rpxTranslate");
20801
20907
  i0.ɵɵelementEnd();
20802
- i0.ɵɵelementStart(24, "td", 8);
20803
- i0.ɵɵtext(25);
20804
- i0.ɵɵpipe(26, "date");
20908
+ i0.ɵɵelementStart(22, "td", 8);
20909
+ i0.ɵɵtext(23);
20910
+ i0.ɵɵpipe(24, "date");
20805
20911
  i0.ɵɵelementEnd()();
20806
- i0.ɵɵelementStart(27, "tr", 6)(28, "th", 7);
20807
- i0.ɵɵtext(29);
20808
- i0.ɵɵpipe(30, "rpxTranslate");
20912
+ i0.ɵɵelementStart(25, "tr", 6)(26, "th", 7);
20913
+ i0.ɵɵtext(27);
20914
+ i0.ɵɵpipe(28, "rpxTranslate");
20809
20915
  i0.ɵɵelementEnd();
20810
- i0.ɵɵelementStart(31, "td", 8);
20811
- i0.ɵɵtext(32);
20916
+ i0.ɵɵelementStart(29, "td", 8);
20917
+ i0.ɵɵtext(30);
20812
20918
  i0.ɵɵelementEnd()();
20813
- i0.ɵɵelementStart(33, "tr", 6)(34, "th", 7);
20814
- i0.ɵɵtext(35);
20815
- i0.ɵɵpipe(36, "rpxTranslate");
20919
+ i0.ɵɵelementStart(31, "tr", 6)(32, "th", 7);
20920
+ i0.ɵɵtext(33);
20921
+ i0.ɵɵpipe(34, "rpxTranslate");
20816
20922
  i0.ɵɵelementEnd();
20817
- i0.ɵɵelementStart(37, "td", 8);
20818
- i0.ɵɵtext(38);
20923
+ i0.ɵɵelementStart(35, "td", 8);
20924
+ i0.ɵɵtext(36);
20819
20925
  i0.ɵɵelementEnd()();
20820
- i0.ɵɵelementStart(39, "tr", 6)(40, "th", 7);
20821
- i0.ɵɵtext(41);
20822
- i0.ɵɵpipe(42, "rpxTranslate");
20926
+ i0.ɵɵelementStart(37, "tr", 6)(38, "th", 7);
20927
+ i0.ɵɵtext(39);
20928
+ i0.ɵɵpipe(40, "rpxTranslate");
20823
20929
  i0.ɵɵelementEnd();
20824
- i0.ɵɵelementStart(43, "td", 8);
20825
- i0.ɵɵtext(44);
20826
- i0.ɵɵpipe(45, "rpxTranslate");
20930
+ i0.ɵɵelementStart(41, "td", 8);
20931
+ i0.ɵɵtext(42);
20932
+ i0.ɵɵpipe(43, "rpxTranslate");
20827
20933
  i0.ɵɵelementEnd()();
20828
- i0.ɵɵtemplate(46, QueryDetailsComponent_ng_container_0_tr_46_Template, 7, 7, "tr", 9)(47, QueryDetailsComponent_ng_container_0_tr_47_Template, 6, 4, "tr", 10);
20934
+ i0.ɵɵtemplate(44, QueryDetailsComponent_ng_container_0_tr_44_Template, 7, 7, "tr", 9)(45, QueryDetailsComponent_ng_container_0_tr_45_Template, 6, 4, "tr", 10);
20829
20935
  i0.ɵɵelementEnd()()();
20830
- i0.ɵɵtemplate(48, QueryDetailsComponent_ng_container_0_ng_container_48_Template, 2, 1, "ng-container", 1);
20936
+ i0.ɵɵtemplate(46, QueryDetailsComponent_ng_container_0_ng_container_46_Template, 2, 1, "ng-container", 1);
20831
20937
  i0.ɵɵelementContainerEnd();
20832
20938
  } if (rf & 2) {
20833
- const ctx_r1 = i0.ɵɵnextContext();
20834
- i0.ɵɵadvance(4);
20835
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(5, 20, "Back to query list"));
20836
- i0.ɵɵadvance(3);
20837
- i0.ɵɵattribute("aria-describedby", i0.ɵɵpipeBind1(8, 22, "Details of the query"));
20939
+ const ctx_r0 = i0.ɵɵnextContext();
20940
+ i0.ɵɵadvance();
20941
+ i0.ɵɵproperty("ngIf", ctx_r0.hasRespondedToQuery());
20942
+ i0.ɵɵadvance(2);
20943
+ i0.ɵɵproperty("ngIf", ctx_r0.showLink);
20944
+ i0.ɵɵadvance(2);
20945
+ i0.ɵɵattribute("aria-describedby", i0.ɵɵpipeBind1(6, 21, "Details of the query"));
20838
20946
  i0.ɵɵadvance(4);
20839
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(12, 24, "Query details"));
20947
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(10, 23, "Query details"));
20840
20948
  i0.ɵɵadvance(5);
20841
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(17, 26, "Last submitted by"));
20949
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(15, 25, "Last submitted by"));
20842
20950
  i0.ɵɵadvance(3);
20843
- i0.ɵɵtextInterpolate(ctx_r1.query.lastSubmittedBy);
20951
+ i0.ɵɵtextInterpolate(ctx_r0.query.lastSubmittedBy);
20844
20952
  i0.ɵɵadvance(3);
20845
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(23, 28, "Submission date"));
20953
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(21, 27, "Submission date"));
20846
20954
  i0.ɵɵadvance(3);
20847
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(26, 30, ctx_r1.query.createdOn, "dd MMM yyyy"));
20955
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(24, 29, ctx_r0.query.createdOn, "dd MMM yyyy"));
20848
20956
  i0.ɵɵadvance(4);
20849
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(30, 33, "Query subject"));
20957
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(28, 32, "Query subject"));
20850
20958
  i0.ɵɵadvance(3);
20851
- i0.ɵɵtextInterpolate(ctx_r1.query.subject);
20959
+ i0.ɵɵtextInterpolate(ctx_r0.query.subject);
20852
20960
  i0.ɵɵadvance(3);
20853
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(36, 35, "Query body"));
20961
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(34, 34, "Query body"));
20854
20962
  i0.ɵɵadvance(3);
20855
- i0.ɵɵtextInterpolate(ctx_r1.query.body);
20963
+ i0.ɵɵtextInterpolate(ctx_r0.query.body);
20856
20964
  i0.ɵɵadvance(2);
20857
- i0.ɵɵclassProp("govuk-table__header--no-border", ctx_r1.query.isHearingRelated);
20965
+ i0.ɵɵclassProp("govuk-table__header--no-border", ctx_r0.query.isHearingRelated);
20858
20966
  i0.ɵɵadvance();
20859
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(42, 37, "Is the query hearing related?"), " ");
20967
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(40, 36, "Is the query hearing related?"), " ");
20860
20968
  i0.ɵɵadvance(2);
20861
- i0.ɵɵclassProp("govuk-table__cell--no-border", ctx_r1.query.isHearingRelated);
20969
+ i0.ɵɵclassProp("govuk-table__cell--no-border", ctx_r0.query.isHearingRelated);
20862
20970
  i0.ɵɵadvance();
20863
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind3(45, 39, "Is the query hearing related?", null, ctx_r1.query.isHearingRelated), "");
20971
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind3(43, 38, "Is the query hearing related?", null, ctx_r0.query.isHearingRelated), "");
20864
20972
  i0.ɵɵadvance(2);
20865
- i0.ɵɵproperty("ngIf", ctx_r1.query.isHearingRelated === "Yes");
20973
+ i0.ɵɵproperty("ngIf", ctx_r0.query.isHearingRelated === "Yes");
20866
20974
  i0.ɵɵadvance();
20867
- i0.ɵɵproperty("ngIf", ctx_r1.query.attachments.length > 0);
20975
+ i0.ɵɵproperty("ngIf", ctx_r0.query.attachments.length > 0);
20868
20976
  i0.ɵɵadvance();
20869
- i0.ɵɵproperty("ngIf", (ctx_r1.query.children == null ? null : ctx_r1.query.children.length) > 0);
20977
+ i0.ɵɵproperty("ngIf", (ctx_r0.query.children == null ? null : ctx_r0.query.children.length) > 0);
20870
20978
  } }
20871
20979
  class QueryDetailsComponent {
20872
20980
  sessionStorageService;
20981
+ route;
20982
+ router;
20873
20983
  query;
20874
20984
  backClicked = new EventEmitter();
20875
20985
  caseId;
20876
- constructor(sessionStorageService) {
20986
+ hasResponded = new EventEmitter();
20987
+ totalNumberOfQueryChildren;
20988
+ showLink = true;
20989
+ message;
20990
+ static QUERY_ITEM_RESPOND = '3';
20991
+ queryItemId;
20992
+ constructor(sessionStorageService, route, router) {
20877
20993
  this.sessionStorageService = sessionStorageService;
20994
+ this.route = route;
20995
+ this.router = router;
20878
20996
  }
20879
20997
  onBack() {
20880
20998
  this.backClicked.emit(true);
@@ -20885,24 +21003,45 @@ class QueryDetailsComponent {
20885
21003
  && !(userDetails.roles.includes('pui-case-manager')
20886
21004
  || userDetails.roles.some((role) => role.toLowerCase().includes('judge')));
20887
21005
  }
20888
- static ɵfac = function QueryDetailsComponent_Factory(t) { return new (t || QueryDetailsComponent)(i0.ɵɵdirectiveInject(SessionStorageService)); };
20889
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QueryDetailsComponent, selectors: [["ccd-query-details"]], inputs: { query: "query", caseId: "caseId" }, outputs: { backClicked: "backClicked" }, decls: 1, vars: 1, consts: [["followUpMessage", ""], [4, "ngIf"], ["href", "javascript:void(0)", 1, "govuk-link", 3, "click"], [1, "govuk-table", "query-details-table"], [1, "govuk-table__caption", "govuk-table__caption--l"], [1, "govuk-table__body"], [1, "govuk-table__row"], ["scope", "row", 1, "govuk-table__header"], [1, "govuk-table__cell"], ["class", "govuk-table__row govuk-table__row--isHearingRelated", 4, "ngIf"], ["class", "govuk-table__row", 4, "ngIf"], [1, "govuk-table__row", "govuk-table__row--isHearingRelated"], [3, "attachments", 4, "ngIf"], [3, "attachments"], [4, "ngFor", "ngForOf"], [4, "ngIf", "ngIfElse"]], template: function QueryDetailsComponent_Template(rf, ctx) { if (rf & 1) {
20890
- i0.ɵɵtemplate(0, QueryDetailsComponent_ng_container_0_Template, 49, 43, "ng-container", 1);
21006
+ ngOnChanges() {
21007
+ this.toggleLinkVisibility();
21008
+ this.hasRespondedToQuery();
21009
+ }
21010
+ toggleLinkVisibility() {
21011
+ this.queryItemId = this.route.snapshot.params.qid;
21012
+ this.showLink = this.queryItemId !== QueryDetailsComponent.QUERY_ITEM_RESPOND;
21013
+ }
21014
+ hasRespondedToQuery() {
21015
+ if (this.totalNumberOfQueryChildren >= 0 && this.isCaseworker() && this.totalNumberOfQueryChildren % 2 !== 0) {
21016
+ this.message = Constants.TASK_COMPLETION_ERROR;
21017
+ this.hasResponded.emit(true);
21018
+ return true;
21019
+ }
21020
+ this.hasResponded.emit(false);
21021
+ return false;
21022
+ }
21023
+ static ɵfac = function QueryDetailsComponent_Factory(t) { return new (t || QueryDetailsComponent)(i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(i1$1.Router)); };
21024
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QueryDetailsComponent, selectors: [["ccd-query-details"]], inputs: { query: "query", caseId: "caseId", totalNumberOfQueryChildren: "totalNumberOfQueryChildren" }, outputs: { backClicked: "backClicked", hasResponded: "hasResponded" }, features: [i0.ɵɵNgOnChangesFeature], decls: 1, vars: 1, consts: [["followUpMessage", ""], [4, "ngIf"], ["type", "error", 4, "ngIf"], [1, "govuk-table", "query-details-table"], [1, "govuk-table__caption", "govuk-table__caption--l"], [1, "govuk-table__body"], [1, "govuk-table__row"], ["scope", "row", 1, "govuk-table__header"], [1, "govuk-table__cell"], ["class", "govuk-table__row govuk-table__row--isHearingRelated", 4, "ngIf"], ["class", "govuk-table__row", 4, "ngIf"], ["type", "error"], ["href", "javascript:void(0)", 1, "govuk-link", 3, "click"], [1, "govuk-table__row", "govuk-table__row--isHearingRelated"], [3, "attachments", 4, "ngIf"], [3, "attachments"], [4, "ngFor", "ngForOf"], [4, "ngIf", "ngIfElse"]], template: function QueryDetailsComponent_Template(rf, ctx) { if (rf & 1) {
21025
+ i0.ɵɵtemplate(0, QueryDetailsComponent_ng_container_0_Template, 47, 42, "ng-container", 1);
20891
21026
  } if (rf & 2) {
20892
21027
  i0.ɵɵproperty("ngIf", ctx.query);
20893
21028
  } }, styles: [".query-details-table[_ngcontent-%COMP%] .govuk-table__header[_ngcontent-%COMP%]{width:330px}"] });
20894
21029
  }
20895
21030
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(QueryDetailsComponent, [{
20896
21031
  type: Component,
20897
- args: [{ selector: 'ccd-query-details', template: "<ng-container *ngIf=\"query\">\n <br/>\n <p>\n <a class=\"govuk-link\" href=\"javascript:void(0)\" (click)=\"onBack()\">{{ 'Back to query list' | rpxTranslate }}</a>\n </p>\n <div>\n <table class=\"govuk-table query-details-table\" [attr.aria-describedby]=\"'Details of the query' | rpxTranslate\">\n <caption class=\"govuk-table__caption govuk-table__caption--l\">\n <div>{{ 'Query details' | rpxTranslate }}</div>\n </caption>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last submitted by' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.lastSubmittedBy }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Submission date' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.createdOn | date: 'dd MMM yyyy' }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Query subject' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.subject }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Query body' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.body }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\" [class.govuk-table__header--no-border]=\"query.isHearingRelated\">\n {{ 'Is the query hearing related?' | rpxTranslate }}\n </th>\n <td class=\"govuk-table__cell\" [class.govuk-table__cell--no-border]=\"query.isHearingRelated\">\n {{ 'Is the query hearing related?' | rpxTranslate: null : (query.isHearingRelated) }}</td>\n </tr>\n <tr class=\"govuk-table__row govuk-table__row--isHearingRelated\" *ngIf=\"query.isHearingRelated === 'Yes'\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'What is the date of the hearing?' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.hearingDate | date: 'dd MMM yyyy' }}</td>\n </tr>\n <tr class=\"govuk-table__row\" *ngIf=\"query.attachments.length > 0\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Attachments' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">\n <ccd-query-attachments-read\n *ngIf=\"query.attachments\"\n [attachments]=\"query.attachments\"\n >\n </ccd-query-attachments-read>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <ng-container *ngIf=\"query.children?.length > 0\">\n <ng-container *ngFor=\"let child of query.children; let i = index;\">\n <ng-container *ngIf=\"i % 2 === 0; else followUpMessage\">\n <table class=\"govuk-table query-details-table\" [attr.aria-describedby]=\"'Response of the query' | rpxTranslate\">\n <caption class=\"govuk-table__caption govuk-table__caption--l\">\n <div>{{ 'Response' | rpxTranslate }}</div>\n </caption>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last response date' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.createdOn | date: 'dd MMM yyyy' }}</td>\n </tr>\n\n <tr *ngIf=\"isCaseworker()\" class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Caseworker name' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.name }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Response detail' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.body }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\" *ngIf=\"child.attachments.length > 0\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Attachments' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">\n <ccd-query-attachments-read\n *ngIf=\"child.attachments\"\n [attachments]=\"child.attachments\"\n >\n </ccd-query-attachments-read>\n </td>\n </tr>\n </tbody>\n </table>\n </ng-container>\n\n <ng-template #followUpMessage>\n <!-- <div class=\"query_details_caption\">{{ 'Follow-up' | rpxTranslate }}</div> -->\n <table class=\"govuk-table query-details-table\"\n [attr.aria-describedby]=\"'Follow-up of the response' | rpxTranslate\">\n <caption class=\"govuk-table__caption govuk-table__caption--l\">\n <div>{{ 'Follow up query' | rpxTranslate }}</div>\n </caption>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last submission date' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.createdOn | date: 'dd MMM yyyy' }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last submitted by' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.name }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Query detail' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.body }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\" *ngIf=\"child.attachments.length > 0\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Attachments' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">\n <ccd-query-attachments-read\n *ngIf=\"child.attachments\"\n [attachments]=\"child.attachments\"\n >\n </ccd-query-attachments-read>\n </td>\n </tr>\n </tbody>\n </table>\n </ng-template>\n </ng-container>\n </ng-container>\n</ng-container>\n", styles: [".query-details-table .govuk-table__header{width:330px}\n"] }]
20898
- }], () => [{ type: SessionStorageService }], { query: [{
21032
+ args: [{ selector: 'ccd-query-details', template: "<ng-container *ngIf=\"query\">\n <cut-alert type=\"error\" *ngIf=\"hasRespondedToQuery()\">\n <ng-container>{{message}}</ng-container>\n </cut-alert>\n\n <br/>\n <p *ngIf=\"showLink\">\n <a class=\"govuk-link\" href=\"javascript:void(0)\" (click)=\"onBack()\">{{ 'Back to query list' | rpxTranslate }}</a>\n </p>\n <div>\n <table class=\"govuk-table query-details-table\" [attr.aria-describedby]=\"'Details of the query' | rpxTranslate\">\n <caption class=\"govuk-table__caption govuk-table__caption--l\">\n <div>{{ 'Query details' | rpxTranslate }}</div>\n </caption>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last submitted by' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.lastSubmittedBy }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Submission date' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.createdOn | date: 'dd MMM yyyy' }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Query subject' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.subject }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Query body' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.body }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\" [class.govuk-table__header--no-border]=\"query.isHearingRelated\">\n {{ 'Is the query hearing related?' | rpxTranslate }}\n </th>\n <td class=\"govuk-table__cell\" [class.govuk-table__cell--no-border]=\"query.isHearingRelated\">\n {{ 'Is the query hearing related?' | rpxTranslate: null : (query.isHearingRelated) }}</td>\n </tr>\n <tr class=\"govuk-table__row govuk-table__row--isHearingRelated\" *ngIf=\"query.isHearingRelated === 'Yes'\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'What is the date of the hearing?' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.hearingDate | date: 'dd MMM yyyy' }}</td>\n </tr>\n <tr class=\"govuk-table__row\" *ngIf=\"query.attachments.length > 0\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Attachments' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">\n <ccd-query-attachments-read\n *ngIf=\"query.attachments\"\n [attachments]=\"query.attachments\"\n >\n </ccd-query-attachments-read>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <ng-container *ngIf=\"query.children?.length > 0\">\n <ng-container *ngFor=\"let child of query.children; let i = index;\">\n <ng-container *ngIf=\"i % 2 === 0; else followUpMessage\">\n <table class=\"govuk-table query-details-table\" [attr.aria-describedby]=\"'Response of the query' | rpxTranslate\">\n <caption class=\"govuk-table__caption govuk-table__caption--l\">\n <div>{{ 'Response' | rpxTranslate }}</div>\n </caption>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last response date' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.createdOn | date: 'dd MMM yyyy' }}</td>\n </tr>\n\n <tr *ngIf=\"isCaseworker()\" class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Caseworker name' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.name }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Response detail' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.body }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\" *ngIf=\"child.attachments.length > 0\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Attachments' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">\n <ccd-query-attachments-read\n *ngIf=\"child.attachments\"\n [attachments]=\"child.attachments\"\n >\n </ccd-query-attachments-read>\n </td>\n </tr>\n </tbody>\n </table>\n </ng-container>\n\n <ng-template #followUpMessage>\n <!-- <div class=\"query_details_caption\">{{ 'Follow-up' | rpxTranslate }}</div> -->\n <table class=\"govuk-table query-details-table\"\n [attr.aria-describedby]=\"'Follow-up of the response' | rpxTranslate\">\n <caption class=\"govuk-table__caption govuk-table__caption--l\">\n <div>{{ 'Follow up query' | rpxTranslate }}</div>\n </caption>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last submission date' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.createdOn | date: 'dd MMM yyyy' }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last submitted by' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.name }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Query detail' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.body }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\" *ngIf=\"child.attachments.length > 0\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Attachments' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">\n <ccd-query-attachments-read\n *ngIf=\"child.attachments\"\n [attachments]=\"child.attachments\"\n >\n </ccd-query-attachments-read>\n </td>\n </tr>\n </tbody>\n </table>\n </ng-template>\n </ng-container>\n </ng-container>\n</ng-container>\n", styles: [".query-details-table .govuk-table__header{width:330px}\n"] }]
21033
+ }], () => [{ type: SessionStorageService }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }], { query: [{
20899
21034
  type: Input
20900
21035
  }], backClicked: [{
20901
21036
  type: Output
20902
21037
  }], caseId: [{
20903
21038
  type: Input
21039
+ }], hasResponded: [{
21040
+ type: Output
21041
+ }], totalNumberOfQueryChildren: [{
21042
+ type: Input
20904
21043
  }] }); })();
20905
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryDetailsComponent, { className: "QueryDetailsComponent", filePath: "lib/shared/components/palette/query-management/components/query-details/query-details.component.ts", lineNumber: 10 }); })();
21044
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryDetailsComponent, { className: "QueryDetailsComponent", filePath: "lib/shared/components/palette/query-management/components/query-details/query-details.component.ts", lineNumber: 11 }); })();
20906
21045
 
20907
21046
  class QueryEventCompletionComponent {
20908
21047
  eventCompletionParams;
@@ -21494,8 +21633,8 @@ class QueryWriteRaiseQueryComponent {
21494
21633
  }] }); })();
21495
21634
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryWriteRaiseQueryComponent, { className: "QueryWriteRaiseQueryComponent", filePath: "lib/shared/components/palette/query-management/components/query-write/query-write-raise-query/query-write-raise-query.component.ts", lineNumber: 8 }); })();
21496
21635
 
21497
- function QueryWriteRespondToQueryComponent_div_12_p_11_Template(rf, ctx) { if (rf & 1) {
21498
- i0.ɵɵelementStart(0, "p", 15)(1, "span", 16);
21636
+ function QueryWriteRespondToQueryComponent_div_12_div_1_p_10_Template(rf, ctx) { if (rf & 1) {
21637
+ i0.ɵɵelementStart(0, "p", 16)(1, "span", 17);
21499
21638
  i0.ɵɵtext(2);
21500
21639
  i0.ɵɵpipe(3, "rpxTranslate");
21501
21640
  i0.ɵɵelementEnd();
@@ -21503,66 +21642,123 @@ function QueryWriteRespondToQueryComponent_div_12_p_11_Template(rf, ctx) { if (r
21503
21642
  i0.ɵɵpipe(5, "rpxTranslate");
21504
21643
  i0.ɵɵelementEnd();
21505
21644
  } if (rf & 2) {
21506
- const ctx_r0 = i0.ɵɵnextContext(2);
21645
+ const ctx_r0 = i0.ɵɵnextContext(3);
21507
21646
  i0.ɵɵadvance(2);
21508
21647
  i0.ɵɵtextInterpolate1("", i0.ɵɵpipeBind1(3, 2, "Error:"), " ");
21509
21648
  i0.ɵɵadvance(2);
21510
21649
  i0.ɵɵtextInterpolate1("", ctx_r0.queryCreateContext === ctx_r0.queryCreateContextEnum.RESPOND ? ctx_r0.raiseQueryErrorMessages.RESPOND_QUERY_BODY : i0.ɵɵpipeBind1(5, 4, ctx_r0.raiseQueryErrorMessages.QUERY_BODY), " ");
21511
21650
  } }
21512
- function QueryWriteRespondToQueryComponent_div_12_Template(rf, ctx) { if (rf & 1) {
21513
- i0.ɵɵelementStart(0, "div", 7)(1, "div")(2, "h1", 8);
21514
- i0.ɵɵtext(3);
21515
- i0.ɵɵpipe(4, "rpxTranslate");
21651
+ function QueryWriteRespondToQueryComponent_div_12_div_1_Template(rf, ctx) { if (rf & 1) {
21652
+ i0.ɵɵelementStart(0, "div")(1, "h1", 9);
21653
+ i0.ɵɵtext(2);
21654
+ i0.ɵɵpipe(3, "rpxTranslate");
21516
21655
  i0.ɵɵelementEnd();
21517
- i0.ɵɵelementStart(5, "div", 9)(6, "div", 10)(7, "div", 11)(8, "label", 12);
21518
- i0.ɵɵtext(9);
21519
- i0.ɵɵpipe(10, "rpxTranslate");
21656
+ i0.ɵɵelementStart(4, "div", 10)(5, "div", 11)(6, "div", 12)(7, "label", 13);
21657
+ i0.ɵɵtext(8);
21658
+ i0.ɵɵpipe(9, "rpxTranslate");
21520
21659
  i0.ɵɵelementEnd()();
21521
- i0.ɵɵtemplate(11, QueryWriteRespondToQueryComponent_div_12_p_11_Template, 6, 6, "p", 13);
21522
- i0.ɵɵelementStart(12, "textarea", 14);
21523
- i0.ɵɵtext(13, " ");
21524
- i0.ɵɵelementEnd()()()()();
21660
+ i0.ɵɵtemplate(10, QueryWriteRespondToQueryComponent_div_12_div_1_p_10_Template, 6, 6, "p", 14);
21661
+ i0.ɵɵelementStart(11, "textarea", 15);
21662
+ i0.ɵɵtext(12, " ");
21663
+ i0.ɵɵelementEnd()()()();
21525
21664
  } if (rf & 2) {
21526
- let tmp_3_0;
21527
- let tmp_5_0;
21665
+ let tmp_4_0;
21528
21666
  let tmp_6_0;
21529
- const ctx_r0 = i0.ɵɵnextContext();
21530
- i0.ɵɵadvance(3);
21531
- i0.ɵɵtextInterpolate1(" ", ctx_r0.queryCreateContext === ctx_r0.queryCreateContextEnum.RESPOND ? "Respond to a query" : i0.ɵɵpipeBind1(4, 9, "Ask a follow-up question"), " ");
21667
+ let tmp_7_0;
21668
+ const ctx_r0 = i0.ɵɵnextContext(2);
21669
+ i0.ɵɵadvance(2);
21670
+ i0.ɵɵtextInterpolate1(" ", ctx_r0.queryCreateContext === ctx_r0.queryCreateContextEnum.RESPOND ? "Respond to a query" : i0.ɵɵpipeBind1(3, 9, "Ask a follow-up question"), " ");
21532
21671
  i0.ɵɵadvance(2);
21533
21672
  i0.ɵɵproperty("formGroup", ctx_r0.formGroup);
21534
21673
  i0.ɵɵadvance();
21535
- i0.ɵɵclassProp("govuk-form-group--error", ctx_r0.submitted && ((tmp_3_0 = ctx_r0.formGroup.get("body")) == null ? null : tmp_3_0.hasError("required")));
21674
+ i0.ɵɵclassProp("govuk-form-group--error", ctx_r0.submitted && ((tmp_4_0 = ctx_r0.formGroup.get("body")) == null ? null : tmp_4_0.hasError("required")));
21536
21675
  i0.ɵɵadvance(3);
21537
- i0.ɵɵtextInterpolate1(" ", ctx_r0.queryCreateContext === ctx_r0.queryCreateContextEnum.RESPOND ? "Response detail" : i0.ɵɵpipeBind1(10, 11, "Query Body"), " ");
21676
+ i0.ɵɵtextInterpolate1(" ", ctx_r0.queryCreateContext === ctx_r0.queryCreateContextEnum.RESPOND ? "Response detail" : i0.ɵɵpipeBind1(9, 11, "Query Body"), " ");
21538
21677
  i0.ɵɵadvance(2);
21539
- i0.ɵɵproperty("ngIf", ctx_r0.submitted && ((tmp_5_0 = ctx_r0.formGroup.get("body")) == null ? null : tmp_5_0.hasError("required")));
21678
+ i0.ɵɵproperty("ngIf", ctx_r0.submitted && ((tmp_6_0 = ctx_r0.formGroup.get("body")) == null ? null : tmp_6_0.hasError("required")));
21540
21679
  i0.ɵɵadvance();
21541
- i0.ɵɵclassProp("govuk-textarea--error", ctx_r0.submitted && ((tmp_6_0 = ctx_r0.formGroup.get("body")) == null ? null : tmp_6_0.hasError("required")));
21680
+ i0.ɵɵclassProp("govuk-textarea--error", ctx_r0.submitted && ((tmp_7_0 = ctx_r0.formGroup.get("body")) == null ? null : tmp_7_0.hasError("required")));
21542
21681
  i0.ɵɵproperty("formControlName", "body");
21543
21682
  } }
21683
+ function QueryWriteRespondToQueryComponent_div_12_Template(rf, ctx) { if (rf & 1) {
21684
+ i0.ɵɵelementStart(0, "div", 7);
21685
+ i0.ɵɵtemplate(1, QueryWriteRespondToQueryComponent_div_12_div_1_Template, 13, 13, "div", 8);
21686
+ i0.ɵɵelementEnd();
21687
+ } if (rf & 2) {
21688
+ const ctx_r0 = i0.ɵɵnextContext();
21689
+ i0.ɵɵadvance();
21690
+ i0.ɵɵproperty("ngIf", !ctx_r0.hasRespondedToQuery);
21691
+ } }
21544
21692
  class QueryWriteRespondToQueryComponent {
21545
21693
  caseNotifier;
21694
+ route;
21546
21695
  queryItem;
21547
21696
  formGroup;
21548
21697
  queryCreateContext;
21549
21698
  submitted = false;
21699
+ caseQueriesCollections;
21550
21700
  showForm;
21701
+ hasRespondedToQueryTask = new EventEmitter();
21551
21702
  queryCreateContextEnum = QueryCreateContext;
21552
21703
  raiseQueryErrorMessages = RaiseQueryErrorMessage;
21553
21704
  caseId;
21705
+ queryItemId;
21554
21706
  caseDetails;
21555
- constructor(caseNotifier) {
21707
+ totalNumberOfQueryChildren;
21708
+ queryItemDisplay;
21709
+ hasRespondedToQuery = false;
21710
+ static QUERY_ITEM_RESPOND = '3';
21711
+ static QUERY_ITEM_FOLLOWUP = '4';
21712
+ constructor(caseNotifier, route) {
21556
21713
  this.caseNotifier = caseNotifier;
21714
+ this.route = route;
21557
21715
  }
21558
21716
  ngOnInit() {
21559
- this.caseNotifier.caseView.pipe(take(1)).subscribe(caseDetails => {
21560
- this.caseId = caseDetails.case_id;
21561
- this.caseDetails = caseDetails;
21717
+ this.queryItemId = this.route.snapshot.params.qid;
21718
+ this.caseNotifier.caseView.pipe(take(1)).subscribe({
21719
+ next: (caseDetails) => {
21720
+ this.caseId = caseDetails?.case_id ?? '';
21721
+ this.caseDetails = caseDetails;
21722
+ },
21723
+ error: (err) => {
21724
+ console.error('Error retrieving case details:', err);
21725
+ }
21562
21726
  });
21563
21727
  }
21564
- static ɵfac = function QueryWriteRespondToQueryComponent_Factory(t) { return new (t || QueryWriteRespondToQueryComponent)(i0.ɵɵdirectiveInject(CaseNotifier)); };
21565
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QueryWriteRespondToQueryComponent, selectors: [["ccd-query-write-respond-to-query"]], inputs: { queryItem: "queryItem", formGroup: "formGroup", queryCreateContext: "queryCreateContext", submitted: "submitted", showForm: "showForm" }, decls: 13, vars: 9, consts: [[1, "govuk-!-margin-bottom-6"], [1, "govuk-caption-l"], [1, "govuk-heading-l", "govuk-!-margin-bottom-0"], [1, "govuk-!-margin-bottom-4"], [3, "caseDetails"], [3, "query"], ["class", "query-respond", 4, "ngIf"], [1, "query-respond"], [1, "govuk-heading-m"], [3, "formGroup"], [1, "govuk-form-group", "body-textarea"], [1, "govuk-label-wrapper"], ["for", "body", 1, "govuk-label", "govuk-label--m", "govuk-!-font-weight-bold"], ["id", "body-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "body", "name", "body", "rows", "5", "aria-describedby", "body-hint body-error", 1, "govuk-textarea", 3, "formControlName"], ["id", "body-error", 1, "govuk-error-message"], [1, "govuk-visually-hidden"]], template: function QueryWriteRespondToQueryComponent_Template(rf, ctx) { if (rf & 1) {
21728
+ ngOnChanges() {
21729
+ if (this.queryItemId === QueryWriteRespondToQueryComponent.QUERY_ITEM_RESPOND
21730
+ && this.caseQueriesCollections?.length > 0) {
21731
+ if (!this.caseQueriesCollections[0]) {
21732
+ console.error('caseQueriesCollections[0] is undefined!', this.caseQueriesCollections);
21733
+ return;
21734
+ }
21735
+ const numberOfQueryChildren = new QueryListData(this.caseQueriesCollections[0]);
21736
+ this.totalNumberOfQueryChildren = numberOfQueryChildren?.queries?.[0]?.children?.length || 0;
21737
+ const messageId = this.route.snapshot.params.dataid;
21738
+ if (!messageId) {
21739
+ console.warn('No messageId found in route params:', this.route.snapshot.params);
21740
+ return;
21741
+ }
21742
+ const filteredMessages = this.caseQueriesCollections
21743
+ .map((caseData) => caseData?.caseMessages || []) // Ensure caseMessages is always an array
21744
+ .flat() // Flatten into a single array of messages
21745
+ .filter((message) => message?.value?.id === messageId); // Safe access
21746
+ if (filteredMessages.length > 0) {
21747
+ const matchingMessage = filteredMessages[0]?.value;
21748
+ if (matchingMessage) {
21749
+ this.queryItemDisplay = new QueryListItem();
21750
+ Object.assign(this.queryItemDisplay, matchingMessage);
21751
+ this.queryItem = this.queryItemDisplay;
21752
+ }
21753
+ }
21754
+ }
21755
+ }
21756
+ hasResponded(value) {
21757
+ this.hasRespondedToQuery = value;
21758
+ this.hasRespondedToQueryTask.emit(value);
21759
+ }
21760
+ static ɵfac = function QueryWriteRespondToQueryComponent_Factory(t) { return new (t || QueryWriteRespondToQueryComponent)(i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute)); };
21761
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QueryWriteRespondToQueryComponent, selectors: [["ccd-query-write-respond-to-query"]], inputs: { queryItem: "queryItem", formGroup: "formGroup", queryCreateContext: "queryCreateContext", submitted: "submitted", caseQueriesCollections: "caseQueriesCollections", showForm: "showForm" }, outputs: { hasRespondedToQueryTask: "hasRespondedToQueryTask" }, features: [i0.ɵɵNgOnChangesFeature], decls: 13, vars: 10, consts: [[1, "govuk-!-margin-bottom-6"], [1, "govuk-caption-l"], [1, "govuk-heading-l", "govuk-!-margin-bottom-0"], [1, "govuk-!-margin-bottom-4"], [3, "caseDetails"], [3, "hasResponded", "query", "totalNumberOfQueryChildren"], ["class", "query-respond", 4, "ngIf"], [1, "query-respond"], [4, "ngIf"], [1, "govuk-heading-m"], [3, "formGroup"], [1, "govuk-form-group", "body-textarea"], [1, "govuk-label-wrapper"], ["for", "body", 1, "govuk-label", "govuk-label--m", "govuk-!-font-weight-bold"], ["id", "body-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "body", "name", "body", "rows", "5", "aria-describedby", "body-hint body-error", 1, "govuk-textarea", 3, "formControlName"], ["id", "body-error", 1, "govuk-error-message"], [1, "govuk-visually-hidden"]], template: function QueryWriteRespondToQueryComponent_Template(rf, ctx) { if (rf & 1) {
21566
21762
  i0.ɵɵelementStart(0, "div", 0)(1, "div", 0)(2, "div", 1);
21567
21763
  i0.ɵɵtext(3);
21568
21764
  i0.ɵɵpipe(4, "rpxTranslate");
@@ -21574,27 +21770,27 @@ class QueryWriteRespondToQueryComponent {
21574
21770
  i0.ɵɵelementStart(8, "div", 3);
21575
21771
  i0.ɵɵelement(9, "ccd-query-case-details-header", 4);
21576
21772
  i0.ɵɵelementEnd();
21577
- i0.ɵɵelementStart(10, "div");
21578
- i0.ɵɵelement(11, "ccd-query-details", 5);
21579
- i0.ɵɵelementEnd()();
21580
- i0.ɵɵtemplate(12, QueryWriteRespondToQueryComponent_div_12_Template, 14, 13, "div", 6);
21773
+ i0.ɵɵelementStart(10, "div")(11, "ccd-query-details", 5);
21774
+ i0.ɵɵlistener("hasResponded", function QueryWriteRespondToQueryComponent_Template_ccd_query_details_hasResponded_11_listener($event) { return ctx.hasResponded($event); });
21775
+ i0.ɵɵelementEnd()()();
21776
+ i0.ɵɵtemplate(12, QueryWriteRespondToQueryComponent_div_12_Template, 2, 1, "div", 6);
21581
21777
  } if (rf & 2) {
21582
21778
  i0.ɵɵadvance(3);
21583
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(4, 5, "Respond to a query"));
21779
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(4, 6, "Respond to a query"));
21584
21780
  i0.ɵɵadvance(3);
21585
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(7, 7, "Query details"));
21781
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(7, 8, "Query details"));
21586
21782
  i0.ɵɵadvance(3);
21587
21783
  i0.ɵɵproperty("caseDetails", ctx.caseDetails);
21588
21784
  i0.ɵɵadvance(2);
21589
- i0.ɵɵproperty("query", ctx.queryItem);
21785
+ i0.ɵɵproperty("query", ctx.queryItem)("totalNumberOfQueryChildren", ctx.totalNumberOfQueryChildren);
21590
21786
  i0.ɵɵadvance();
21591
21787
  i0.ɵɵproperty("ngIf", ctx.showForm);
21592
21788
  } }, styles: [".query-respond[_ngcontent-%COMP%]{width:100%;max-width:720px}"] });
21593
21789
  }
21594
21790
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(QueryWriteRespondToQueryComponent, [{
21595
21791
  type: Component,
21596
- args: [{ selector: 'ccd-query-write-respond-to-query', template: "<div class=\"govuk-!-margin-bottom-6\">\n <div class=\"govuk-!-margin-bottom-6\">\n <div class=\"govuk-caption-l\">{{ 'Respond to a query' | rpxTranslate }}</div>\n <h1 class=\"govuk-heading-l govuk-!-margin-bottom-0\">{{ 'Query details' | rpxTranslate }}</h1>\n </div>\n\n <div class=\"govuk-!-margin-bottom-4\">\n <ccd-query-case-details-header [caseDetails]=\"caseDetails\"></ccd-query-case-details-header>\n </div>\n\n <div>\n <ccd-query-details [query]=\"queryItem\"></ccd-query-details>\n </div>\n</div>\n\n<div class=\"query-respond\" *ngIf=\"showForm\">\n <div>\n <h1 class=\"govuk-heading-m\">\n {{ queryCreateContext === queryCreateContextEnum.RESPOND ? 'Respond to a query' : 'Ask a follow-up question' | rpxTranslate }}\n </h1>\n\n <div [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group body-textarea\"\n [class.govuk-form-group--error]=\"submitted && formGroup.get('body')?.hasError('required')\">\n <div class=\"govuk-label-wrapper\">\n <label class=\"govuk-label govuk-label--m govuk-!-font-weight-bold\" for=\"body\">\n {{ queryCreateContext === queryCreateContextEnum.RESPOND ? 'Response detail' : 'Query Body' | rpxTranslate }}\n </label>\n </div>\n <p id=\"body-error\" class=\"govuk-error-message\"\n *ngIf=\"submitted && formGroup.get('body')?.hasError('required')\">\n <span class=\"govuk-visually-hidden\">{{ 'Error:' | rpxTranslate }} </span>{{ queryCreateContext === queryCreateContextEnum.RESPOND ? raiseQueryErrorMessages.RESPOND_QUERY_BODY : raiseQueryErrorMessages.QUERY_BODY | rpxTranslate }}\n </p>\n <textarea [formControlName]=\"'body'\" class=\"govuk-textarea\"\n [class.govuk-textarea--error]=\"submitted && formGroup.get('body')?.hasError('required')\" id=\"body\"\n name=\"body\" rows=\"5\" aria-describedby=\"body-hint body-error\">\n </textarea>\n </div>\n </div>\n </div>\n</div>\n", styles: [".query-respond{width:100%;max-width:720px}\n"] }]
21597
- }], () => [{ type: CaseNotifier }], { queryItem: [{
21792
+ args: [{ selector: 'ccd-query-write-respond-to-query', template: "<div class=\"govuk-!-margin-bottom-6\">\n <div class=\"govuk-!-margin-bottom-6\">\n <div class=\"govuk-caption-l\">{{ 'Respond to a query' | rpxTranslate }}</div>\n <h1 class=\"govuk-heading-l govuk-!-margin-bottom-0\">{{ 'Query details' | rpxTranslate }}</h1>\n </div>\n\n <div class=\"govuk-!-margin-bottom-4\">\n <ccd-query-case-details-header [caseDetails]=\"caseDetails\"></ccd-query-case-details-header>\n </div>\n\n <div>\n <ccd-query-details [query]=\"queryItem\"\n [totalNumberOfQueryChildren]=\"totalNumberOfQueryChildren\"\n (hasResponded)=\"hasResponded($event)\"></ccd-query-details>\n </div>\n</div>\n<div class=\"query-respond\" *ngIf=\"showForm\">\n <div *ngIf=\"!hasRespondedToQuery\">\n <h1 class=\"govuk-heading-m\">\n {{ queryCreateContext === queryCreateContextEnum.RESPOND ? 'Respond to a query' : 'Ask a follow-up question' | rpxTranslate }}\n </h1>\n\n <div [formGroup]=\"formGroup\">\n <div class=\"govuk-form-group body-textarea\"\n [class.govuk-form-group--error]=\"submitted && formGroup.get('body')?.hasError('required')\">\n <div class=\"govuk-label-wrapper\">\n <label class=\"govuk-label govuk-label--m govuk-!-font-weight-bold\" for=\"body\">\n {{ queryCreateContext === queryCreateContextEnum.RESPOND ? 'Response detail' : 'Query Body' | rpxTranslate }}\n </label>\n </div>\n <p id=\"body-error\" class=\"govuk-error-message\"\n *ngIf=\"submitted && formGroup.get('body')?.hasError('required')\">\n <span class=\"govuk-visually-hidden\">{{ 'Error:' | rpxTranslate }} </span>{{ queryCreateContext === queryCreateContextEnum.RESPOND ? raiseQueryErrorMessages.RESPOND_QUERY_BODY : raiseQueryErrorMessages.QUERY_BODY | rpxTranslate }}\n </p>\n <textarea [formControlName]=\"'body'\" class=\"govuk-textarea\"\n [class.govuk-textarea--error]=\"submitted && formGroup.get('body')?.hasError('required')\" id=\"body\"\n name=\"body\" rows=\"5\" aria-describedby=\"body-hint body-error\">\n </textarea>\n </div>\n </div>\n </div>\n</div>\n", styles: [".query-respond{width:100%;max-width:720px}\n"] }]
21793
+ }], () => [{ type: CaseNotifier }, { type: i1$1.ActivatedRoute }], { queryItem: [{
21598
21794
  type: Input
21599
21795
  }], formGroup: [{
21600
21796
  type: Input
@@ -21602,8 +21798,12 @@ class QueryWriteRespondToQueryComponent {
21602
21798
  type: Input
21603
21799
  }], submitted: [{
21604
21800
  type: Input
21801
+ }], caseQueriesCollections: [{
21802
+ type: Input
21605
21803
  }], showForm: [{
21606
21804
  type: Input
21805
+ }], hasRespondedToQueryTask: [{
21806
+ type: Output
21607
21807
  }] }); })();
21608
21808
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryWriteRespondToQueryComponent, { className: "QueryWriteRespondToQueryComponent", filePath: "lib/shared/components/palette/query-management/components/query-write/query-write-respond-to-query/query-write-respond-to-query.component.ts", lineNumber: 14 }); })();
21609
21809
 
@@ -21734,7 +21934,6 @@ class QueryConfirmationComponent {
21734
21934
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryConfirmationComponent, { className: "QueryConfirmationComponent", filePath: "lib/shared/components/palette/query-management/components/query-confirmation/query-confirmation.component.ts", lineNumber: 9 }); })();
21735
21935
 
21736
21936
  const _c0$B = (a0, a1) => ["/query-management", "query", a0, "4", a1];
21737
- const _c1$e = (a0, a1) => ["/query-management", "query", a0, "3", a1];
21738
21937
  function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_Template(rf, ctx) { if (rf & 1) {
21739
21938
  const _r1 = i0.ɵɵgetCurrentView();
21740
21939
  i0.ɵɵelementStart(0, "div", 5)(1, "ccd-query-list", 6);
@@ -21802,33 +22001,17 @@ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_Template
21802
22001
  i0.ɵɵadvance();
21803
22002
  i0.ɵɵproperty("ngIf", (ctx_r1.query == null ? null : ctx_r1.query.children == null ? null : ctx_r1.query.children.length) > 0 && (ctx_r1.query == null ? null : ctx_r1.query.children == null ? null : ctx_r1.query.children.length) % 2 === 1)("ngIfElse", queryIsInReview_r5);
21804
22003
  } }
21805
- function ReadQueryManagementFieldComponent_ng_template_1_ng_container_2_Template(rf, ctx) { if (rf & 1) {
21806
- i0.ɵɵelementContainerStart(0);
21807
- i0.ɵɵelementStart(1, "button", 9);
21808
- i0.ɵɵtext(2);
21809
- i0.ɵɵpipe(3, "rpxTranslate");
21810
- i0.ɵɵelementEnd();
21811
- i0.ɵɵelementContainerEnd();
21812
- } if (rf & 2) {
21813
- const ctx_r1 = i0.ɵɵnextContext(2);
21814
- i0.ɵɵadvance();
21815
- i0.ɵɵproperty("routerLink", i0.ɵɵpureFunction2(4, _c1$e, ctx_r1.caseId, ctx_r1.query.id));
21816
- i0.ɵɵadvance();
21817
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 2, "Respond to a query"), " ");
21818
- } }
21819
22004
  function ReadQueryManagementFieldComponent_ng_template_1_Template(rf, ctx) { if (rf & 1) {
21820
22005
  const _r4 = i0.ɵɵgetCurrentView();
21821
22006
  i0.ɵɵelementStart(0, "ccd-query-details", 7);
21822
22007
  i0.ɵɵlistener("backClicked", function ReadQueryManagementFieldComponent_ng_template_1_Template_ccd_query_details_backClicked_0_listener() { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.showQueryList = true); });
21823
22008
  i0.ɵɵelementEnd();
21824
- i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_Template, 4, 2, "ng-container", 8)(2, ReadQueryManagementFieldComponent_ng_template_1_ng_container_2_Template, 4, 7, "ng-container", 8);
22009
+ i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_Template, 4, 2, "ng-container", 8);
21825
22010
  } if (rf & 2) {
21826
22011
  const ctx_r1 = i0.ɵɵnextContext();
21827
22012
  i0.ɵɵproperty("query", ctx_r1.query)("caseId", ctx_r1.caseId);
21828
22013
  i0.ɵɵadvance();
21829
22014
  i0.ɵɵproperty("ngIf", !ctx_r1.isCaseworker());
21830
- i0.ɵɵadvance();
21831
- i0.ɵɵproperty("ngIf", (ctx_r1.query == null ? null : ctx_r1.query.children == null ? null : ctx_r1.query.children.length) >= 0 && ctx_r1.isCaseworker() && (ctx_r1.query == null ? null : ctx_r1.query.children == null ? null : ctx_r1.query.children.length) % 2 === 0);
21832
22015
  } }
21833
22016
  class ReadQueryManagementFieldComponent extends AbstractFieldReadComponent {
21834
22017
  route;
@@ -21887,7 +22070,7 @@ class ReadQueryManagementFieldComponent extends AbstractFieldReadComponent {
21887
22070
  }
21888
22071
  static ɵfac = function ReadQueryManagementFieldComponent_Factory(t) { return new (t || ReadQueryManagementFieldComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(CaseNotifier)); };
21889
22072
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ReadQueryManagementFieldComponent, selectors: [["ccd-read-query-management-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 3, vars: 2, consts: [["singleQueryDetails", ""], ["queryIsInReview", ""], [4, "ngIf", "ngIfElse"], [4, "ngFor", "ngForOf"], ["class", "govuk-!-margin-top-8 govuk-!-margin-bottom-8", 4, "ngIf"], [1, "govuk-!-margin-top-8", "govuk-!-margin-bottom-8"], [3, "selectedQuery", "caseQueriesCollection"], [3, "backClicked", "query", "caseId"], [4, "ngIf"], ["id", "ask-follow-up-question", "data-module", "govuk-button", 1, "govuk-button", 3, "routerLink"], [1, "govuk-!-font-weight-bold"]], template: function ReadQueryManagementFieldComponent_Template(rf, ctx) { if (rf & 1) {
21890
- i0.ɵɵtemplate(0, ReadQueryManagementFieldComponent_ng_container_0_Template, 2, 1, "ng-container", 2)(1, ReadQueryManagementFieldComponent_ng_template_1_Template, 3, 4, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
22073
+ i0.ɵɵtemplate(0, ReadQueryManagementFieldComponent_ng_container_0_Template, 2, 1, "ng-container", 2)(1, ReadQueryManagementFieldComponent_ng_template_1_Template, 2, 3, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
21891
22074
  } if (rf & 2) {
21892
22075
  const singleQueryDetails_r6 = i0.ɵɵreference(2);
21893
22076
  i0.ɵɵproperty("ngIf", ctx.showQueryList)("ngIfElse", singleQueryDetails_r6);
@@ -21895,7 +22078,7 @@ class ReadQueryManagementFieldComponent extends AbstractFieldReadComponent {
21895
22078
  }
21896
22079
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ReadQueryManagementFieldComponent, [{
21897
22080
  type: Component,
21898
- args: [{ selector: 'ccd-read-query-management-field', template: "<ng-container *ngIf=\"showQueryList; else singleQueryDetails\">\n <ng-container *ngFor=\"let caseQueriesCollection of caseQueriesCollections\">\n <div *ngIf=\"showQueryList\" class=\"govuk-!-margin-top-8 govuk-!-margin-bottom-8\">\n <ccd-query-list (selectedQuery)=\"setQuery($event)\" [caseQueriesCollection]=\"caseQueriesCollection\"></ccd-query-list>\n </div>\n </ng-container>\n</ng-container>\n\n<ng-template #singleQueryDetails>\n <ccd-query-details\n [query]=\"query\"\n (backClicked)=\"showQueryList = true\"\n [caseId]=\"caseId\"\n ></ccd-query-details>\n\n <ng-container *ngIf=\"!isCaseworker()\">\n <ng-container *ngIf=\"query?.children?.length > 0 && query?.children?.length % 2 === 1; else queryIsInReview\">\n <button id=\"ask-follow-up-question\" class=\"govuk-button\" data-module=\"govuk-button\"\n [routerLink]=\"['/query-management', 'query', caseId, '4', query.id]\">\n {{ 'Ask a follow-up question' | rpxTranslate }}\n </button>\n </ng-container>\n\n <ng-template #queryIsInReview>\n <div>\n <p class=\"govuk-!-font-weight-bold\">{{ 'Your query is under review' | rpxTranslate }}</p>\n <p>{{ 'Our team will read your query and will respond. Do not submit the same query more than once.' | rpxTranslate }}</p>\n </div>\n </ng-template>\n </ng-container>\n\n <ng-container *ngIf=\"query?.children?.length >= 0 && isCaseworker() && query?.children?.length % 2 === 0\">\n <button id=\"ask-follow-up-question\" class=\"govuk-button\" data-module=\"govuk-button\"\n [routerLink]=\"['/query-management', 'query', caseId, '3', query.id]\"\n >\n {{ 'Respond to a query' | rpxTranslate }}\n </button>\n </ng-container>\n</ng-template>\n" }]
22081
+ args: [{ selector: 'ccd-read-query-management-field', template: "<ng-container *ngIf=\"showQueryList; else singleQueryDetails\">\n <ng-container *ngFor=\"let caseQueriesCollection of caseQueriesCollections\">\n <div *ngIf=\"showQueryList\" class=\"govuk-!-margin-top-8 govuk-!-margin-bottom-8\">\n <ccd-query-list (selectedQuery)=\"setQuery($event)\" [caseQueriesCollection]=\"caseQueriesCollection\"></ccd-query-list>\n </div>\n </ng-container>\n</ng-container>\n\n<ng-template #singleQueryDetails>\n <ccd-query-details\n [query]=\"query\"\n (backClicked)=\"showQueryList = true\"\n [caseId]=\"caseId\"\n ></ccd-query-details>\n\n <ng-container *ngIf=\"!isCaseworker()\">\n <ng-container *ngIf=\"query?.children?.length > 0 && query?.children?.length % 2 === 1; else queryIsInReview\">\n <button id=\"ask-follow-up-question\" class=\"govuk-button\" data-module=\"govuk-button\"\n [routerLink]=\"['/query-management', 'query', caseId, '4', query.id]\">\n {{ 'Ask a follow-up question' | rpxTranslate }}\n </button>\n </ng-container>\n\n <ng-template #queryIsInReview>\n <div>\n <p class=\"govuk-!-font-weight-bold\">{{ 'Your query is under review' | rpxTranslate }}</p>\n <p>{{ 'Our team will read your query and will respond. Do not submit the same query more than once.' | rpxTranslate }}</p>\n </div>\n </ng-template>\n </ng-container>\n</ng-template>\n" }]
21899
22082
  }], () => [{ type: i1$1.ActivatedRoute }, { type: SessionStorageService }, { type: CaseNotifier }], null); })();
21900
22083
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadQueryManagementFieldComponent, { className: "ReadQueryManagementFieldComponent", filePath: "lib/shared/components/palette/query-management/read-query-management-field.component.ts", lineNumber: 14 }); })();
21901
22084
 
@@ -27459,7 +27642,7 @@ function EventLogTableComponent_tr_20_div_3_Template(rf, ctx) { if (rf & 1) {
27459
27642
  i0.ɵɵproperty("ngIf", event_r2.state_id !== "Draft");
27460
27643
  } }
27461
27644
  function EventLogTableComponent_tr_20_div_4_a_1_Template(rf, ctx) { if (rf & 1) {
27462
- i0.ɵɵelementStart(0, "a", 18);
27645
+ i0.ɵɵelementStart(0, "a", 19);
27463
27646
  i0.ɵɵtext(1);
27464
27647
  i0.ɵɵpipe(2, "rpxTranslate");
27465
27648
  i0.ɵɵelementEnd();
@@ -27471,14 +27654,29 @@ function EventLogTableComponent_tr_20_div_4_a_1_Template(rf, ctx) { if (rf & 1)
27471
27654
  i0.ɵɵadvance();
27472
27655
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 4, event_r2.event_name));
27473
27656
  } }
27657
+ function EventLogTableComponent_tr_20_div_4_span_2_Template(rf, ctx) { if (rf & 1) {
27658
+ i0.ɵɵelementStart(0, "span", 20);
27659
+ i0.ɵɵtext(1);
27660
+ i0.ɵɵpipe(2, "rpxTranslate");
27661
+ i0.ɵɵelementEnd();
27662
+ } if (rf & 2) {
27663
+ const event_r2 = i0.ɵɵnextContext(2).$implicit;
27664
+ const ctx_r2 = i0.ɵɵnextContext();
27665
+ i0.ɵɵattribute("aria-label", ctx_r2.getAriaLabelforLink(event_r2));
27666
+ i0.ɵɵadvance();
27667
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 2, event_r2.event_name));
27668
+ } }
27474
27669
  function EventLogTableComponent_tr_20_div_4_Template(rf, ctx) { if (rf & 1) {
27475
27670
  i0.ɵɵelementStart(0, "div");
27476
- i0.ɵɵtemplate(1, EventLogTableComponent_tr_20_div_4_a_1_Template, 3, 8, "a", 17);
27671
+ i0.ɵɵtemplate(1, EventLogTableComponent_tr_20_div_4_a_1_Template, 3, 8, "a", 17)(2, EventLogTableComponent_tr_20_div_4_span_2_Template, 3, 4, "span", 18);
27477
27672
  i0.ɵɵelementEnd();
27478
27673
  } if (rf & 2) {
27479
27674
  const event_r2 = i0.ɵɵnextContext().$implicit;
27675
+ const ctx_r2 = i0.ɵɵnextContext();
27480
27676
  i0.ɵɵadvance();
27481
- i0.ɵɵproperty("ngIf", event_r2.state_id !== "Draft");
27677
+ i0.ɵɵproperty("ngIf", event_r2.state_id !== "Draft" && !ctx_r2.isUserExternal);
27678
+ i0.ɵɵadvance();
27679
+ i0.ɵɵproperty("ngIf", ctx_r2.isUserExternal);
27482
27680
  } }
27483
27681
  function EventLogTableComponent_tr_20_span_5_Template(rf, ctx) { if (rf & 1) {
27484
27682
  i0.ɵɵelementStart(0, "span");
@@ -27490,10 +27688,10 @@ function EventLogTableComponent_tr_20_span_5_Template(rf, ctx) { if (rf & 1) {
27490
27688
  i0.ɵɵtextInterpolate(event_r2.event_name);
27491
27689
  } }
27492
27690
  function EventLogTableComponent_tr_20_div_6_Template(rf, ctx) { if (rf & 1) {
27493
- i0.ɵɵelementStart(0, "div", 19)(1, "a", 20);
27494
- i0.ɵɵelement(2, "img", 21);
27691
+ i0.ɵɵelementStart(0, "div", 21)(1, "a", 22);
27692
+ i0.ɵɵelement(2, "img", 23);
27495
27693
  i0.ɵɵelementEnd();
27496
- i0.ɵɵelementStart(3, "span", 22);
27694
+ i0.ɵɵelementStart(3, "span", 24);
27497
27695
  i0.ɵɵtext(4);
27498
27696
  i0.ɵɵelementEnd()();
27499
27697
  } if (rf & 2) {
@@ -27511,7 +27709,7 @@ function EventLogTableComponent_tr_20_Template(rf, ctx) { if (rf & 1) {
27511
27709
  i0.ɵɵlistener("click", function EventLogTableComponent_tr_20_Template_tr_click_0_listener() { const event_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.select(event_r2)); })("keyup", function EventLogTableComponent_tr_20_Template_tr_keyup_0_listener() { const event_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.select(event_r2)); });
27512
27710
  i0.ɵɵelementStart(1, "td");
27513
27711
  i0.ɵɵelementContainerStart(2, 5);
27514
- i0.ɵɵtemplate(3, EventLogTableComponent_tr_20_div_3_Template, 2, 1, "div", 6)(4, EventLogTableComponent_tr_20_div_4_Template, 2, 1, "div", 7);
27712
+ i0.ɵɵtemplate(3, EventLogTableComponent_tr_20_div_3_Template, 2, 1, "div", 6)(4, EventLogTableComponent_tr_20_div_4_Template, 3, 2, "div", 7);
27515
27713
  i0.ɵɵelementContainerEnd();
27516
27714
  i0.ɵɵtemplate(5, EventLogTableComponent_tr_20_span_5_Template, 2, 1, "span", 8)(6, EventLogTableComponent_tr_20_div_6_Template, 5, 3, "div", 9);
27517
27715
  i0.ɵɵelementEnd();
@@ -27555,13 +27753,19 @@ function EventLogTableComponent_tr_20_Template(rf, ctx) { if (rf & 1) {
27555
27753
  i0.ɵɵtextInterpolate2("", i0.ɵɵpipeBind1(18, 21, event_r2.user_first_name), " ", i0.ɵɵpipeBind1(19, 23, event_r2.user_last_name), "");
27556
27754
  } }
27557
27755
  class EventLogTableComponent {
27756
+ sessionStorage;
27558
27757
  events;
27559
27758
  selected;
27560
27759
  onSelect = new EventEmitter();
27561
27760
  onCaseHistory = new EventEmitter();
27562
27761
  isPartOfCaseTimeline = false;
27762
+ isUserExternal;
27763
+ constructor(sessionStorage) {
27764
+ this.sessionStorage = sessionStorage;
27765
+ }
27563
27766
  ngOnInit() {
27564
27767
  this.isPartOfCaseTimeline = this.onCaseHistory.observers.length > 0;
27768
+ this.isUserExternal = JSON.parse(this.sessionStorage.getItem('userDetails')).roles.includes('pui-case-manager');
27565
27769
  }
27566
27770
  select(event) {
27567
27771
  this.selected = event;
@@ -27601,8 +27805,8 @@ class EventLogTableComponent {
27601
27805
  getAriaLabelforLink(event) {
27602
27806
  return `press enter key to open event ${event.event_name} link in separate window`;
27603
27807
  }
27604
- static ɵfac = function EventLogTableComponent_Factory(t) { return new (t || EventLogTableComponent)(); };
27605
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: EventLogTableComponent, selectors: [["ccd-event-log-table"]], inputs: { events: "events", selected: "selected" }, outputs: { onSelect: "onSelect", onCaseHistory: "onCaseHistory" }, decls: 21, vars: 13, consts: [[1, "EventLogTable"], [1, "heading-h2"], [1, "text-16"], ["tabindex", "0", 3, "ngClass", "click", "keyup", 4, "ngFor", "ngForOf"], ["tabindex", "0", 3, "click", "keyup", "ngClass"], [3, "ngSwitch"], ["id", "case-timeline", 4, "ngSwitchCase"], [4, "ngSwitchCase"], [4, "ngIf"], ["class", "tooltip", 4, "ngIf"], ["tabindex", "0", 3, "keydown.enter"], [1, "tooltip", "text-16"], [1, "tooltiptext"], ["tabindex", "0"], ["id", "case-timeline"], ["class", "text-16 event-link", 3, "click", 4, "ngIf"], [1, "text-16", "event-link", 3, "click"], ["class", "text-16 event-link", 3, "routerLink", "target", 4, "ngIf"], [1, "text-16", "event-link", 3, "routerLink", "target"], [1, "tooltip"], ["target", "_blank", "rel", "noopener", 3, "href"], ["alt", "document image", "src", "data:image/png;base64,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", 1, "doc-img"], [1, "tooltiptext", "doc-tooltip"]], template: function EventLogTableComponent_Template(rf, ctx) { if (rf & 1) {
27808
+ static ɵfac = function EventLogTableComponent_Factory(t) { return new (t || EventLogTableComponent)(i0.ɵɵdirectiveInject(SessionStorageService)); };
27809
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: EventLogTableComponent, selectors: [["ccd-event-log-table"]], inputs: { events: "events", selected: "selected" }, outputs: { onSelect: "onSelect", onCaseHistory: "onCaseHistory" }, decls: 21, vars: 13, consts: [[1, "EventLogTable"], [1, "heading-h2"], [1, "text-16"], ["tabindex", "0", 3, "ngClass", "click", "keyup", 4, "ngFor", "ngForOf"], ["tabindex", "0", 3, "click", "keyup", "ngClass"], [3, "ngSwitch"], ["id", "case-timeline", 4, "ngSwitchCase"], [4, "ngSwitchCase"], [4, "ngIf"], ["class", "tooltip", 4, "ngIf"], ["tabindex", "0", 3, "keydown.enter"], [1, "tooltip", "text-16"], [1, "tooltiptext"], ["tabindex", "0"], ["id", "case-timeline"], ["class", "text-16 event-link", 3, "click", 4, "ngIf"], [1, "text-16", "event-link", 3, "click"], ["class", "text-16 event-link", 3, "routerLink", "target", 4, "ngIf"], ["class", "text-16 event-link", 4, "ngIf"], [1, "text-16", "event-link", 3, "routerLink", "target"], [1, "text-16", "event-link"], [1, "tooltip"], ["target", "_blank", "rel", "noopener", 3, "href"], ["alt", "document image", "src", "data:image/png;base64,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", 1, "doc-img"], [1, "tooltiptext", "doc-tooltip"]], template: function EventLogTableComponent_Template(rf, ctx) { if (rf & 1) {
27606
27810
  i0.ɵɵelementStart(0, "table", 0)(1, "caption")(2, "h2", 1);
27607
27811
  i0.ɵɵtext(3);
27608
27812
  i0.ɵɵpipe(4, "rpxTranslate");
@@ -27637,8 +27841,8 @@ class EventLogTableComponent {
27637
27841
  }
27638
27842
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EventLogTableComponent, [{
27639
27843
  type: Component,
27640
- args: [{ selector: 'ccd-event-log-table', template: "<table class=\"EventLogTable\">\n <caption><h2 class=\"heading-h2\">{{'History' | rpxTranslate}}</h2></caption>\n <thead>\n <tr>\n <th><span class=\"text-16\">{{'Event' | rpxTranslate}}</span></th>\n <th><span class=\"text-16\">{{'Date' | rpxTranslate}}</span></th>\n <th><span class=\"text-16\">{{'Author' | rpxTranslate}}</span></th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let event of events\" (click)=\"select(event)\" (keyup)=\"select(event)\" [ngClass]=\"{'EventLogTable-Selected': selected === event}\" tabindex=\"0\" attr.aria-label=\"{{getAriaLabelforRow(event)}}\">\n <td>\n <ng-container [ngSwitch]=\"isPartOfCaseTimeline\">\n <div id=\"case-timeline\" *ngSwitchCase=\"true\">\n <a (click)=\"caseHistoryClicked(event.id)\"\n *ngIf=\"event.state_id !== 'Draft'\" class=\"text-16 event-link\" attr.aria-label=\"{{getAriaLabelforLink(event)}}\">{{event.event_name | rpxTranslate}}</a>\n </div>\n <div *ngSwitchCase=\"false\">\n <a [routerLink]=\"['./', 'event', event.id, 'history']\"\n [target]=\"'_blank'\"\n *ngIf=\"event.state_id !== 'Draft'\" class=\"text-16 event-link\" attr.aria-label=\"{{getAriaLabelforLink(event)}}\">{{event.event_name | rpxTranslate}}</a>\n </div>\n </ng-container>\n <span *ngIf=\"event.state_id === 'Draft'\">{{event.event_name}}</span>\n <div class=\"tooltip\" *ngIf=\"significantItemExist(event)\">\n <a href=\"{{getSignificantItemUrl(event)}}\" target=\"_blank\" rel=\"noopener\" attr.aria-label=\"{{getAriaLabelforLink(event)}}\">\n <img class=\"doc-img\" alt=\"document image\" src=\"data:image/png;base64,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\"/>\n </a>\n <span class=\"tooltiptext doc-tooltip\">{{getSignificantItemDesc(event)}}</span>\n </div>\n </td>\n <td tabindex=\"0\" attr.aria-label=\"{{getAriaLabelforColumn(event)}}\" (keydown.enter)=\"select(event)\"><div class=\"tooltip text-16\">{{event.timestamp | ccdDate : 'local'}}\n <span class=\"tooltiptext\">{{'Local:' | rpxTranslate}} {{event.timestamp | ccdDate : 'local'}}</span>\n </div></td>\n <td tabindex=\"0\"><span class=\"text-16\">{{event.user_first_name | titlecase}} {{event.user_last_name | uppercase}}</span></td>\n </tr>\n </tbody>\n</table>\n", styles: ["#case-timeline a{cursor:pointer;text-decoration:underline;color:#005ea5}#case-timeline a:hover{color:#2b8cc4}#case-timeline a:visited{color:#4c2c92}.EventLogTable tbody>tr td:first-child{padding-left:10px}.EventLogTable tbody>tr.EventLogTable-Selected{border-left:8px solid #005ea5;background-color:#f8f8f8}.EventLogTable tbody>tr.EventLogTable-Selected td:first-child{padding-left:6px}.EventLogTable tbody>tr:not(.EventLogTable-Selected):hover{border-left:8px solid #2b8cc4;background-color:#f8f8f8;cursor:pointer;cursor:hand}.EventLogTable tbody>tr:not(.EventLogTable-Selected):hover td:first-child{padding-left:6px}.EventLogTable tbody>tr .event-link{float:left;padding-right:8px}.EventLogTable tbody>tr .doc-img{width:16px;float:left}.EventLogTable tbody>tr .doc-tooltip{left:35%;bottom:7px}.EventLogTable tbody>tr .doc-tooltip:after{border-color:transparent}\n"] }]
27641
- }], null, { events: [{
27844
+ args: [{ selector: 'ccd-event-log-table', template: "<table class=\"EventLogTable\">\n <caption><h2 class=\"heading-h2\">{{'History' | rpxTranslate}}</h2></caption>\n <thead>\n <tr>\n <th><span class=\"text-16\">{{'Event' | rpxTranslate}}</span></th>\n <th><span class=\"text-16\">{{'Date' | rpxTranslate}}</span></th>\n <th><span class=\"text-16\">{{'Author' | rpxTranslate}}</span></th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let event of events\" (click)=\"select(event)\" (keyup)=\"select(event)\" [ngClass]=\"{'EventLogTable-Selected': selected === event}\" tabindex=\"0\" attr.aria-label=\"{{getAriaLabelforRow(event)}}\">\n <td>\n <ng-container [ngSwitch]=\"isPartOfCaseTimeline\">\n <div id=\"case-timeline\" *ngSwitchCase=\"true\">\n <a (click)=\"caseHistoryClicked(event.id)\"\n *ngIf=\"event.state_id !== 'Draft'\" class=\"text-16 event-link\" attr.aria-label=\"{{getAriaLabelforLink(event)}}\">{{event.event_name | rpxTranslate}}</a>\n </div>\n <div *ngSwitchCase=\"false\">\n <a [routerLink]=\"['./', 'event', event.id, 'history']\"\n [target]=\"'_blank'\"\n *ngIf=\"event.state_id !== 'Draft' && !isUserExternal\" class=\"text-16 event-link\" attr.aria-label=\"{{getAriaLabelforLink(event)}}\">{{event.event_name | rpxTranslate}}</a>\n <span *ngIf=\"isUserExternal\" class=\"text-16 event-link\" attr.aria-label=\"{{getAriaLabelforLink(event)}}\">{{event.event_name | rpxTranslate}}</span>\n </div>\n </ng-container>\n <span *ngIf=\"event.state_id === 'Draft'\">{{event.event_name}}</span>\n <div class=\"tooltip\" *ngIf=\"significantItemExist(event)\">\n <a href=\"{{getSignificantItemUrl(event)}}\" target=\"_blank\" rel=\"noopener\" attr.aria-label=\"{{getAriaLabelforLink(event)}}\">\n <img class=\"doc-img\" alt=\"document image\" src=\"data:image/png;base64,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\"/>\n </a>\n <span class=\"tooltiptext doc-tooltip\">{{getSignificantItemDesc(event)}}</span>\n </div>\n </td>\n <td tabindex=\"0\" attr.aria-label=\"{{getAriaLabelforColumn(event)}}\" (keydown.enter)=\"select(event)\"><div class=\"tooltip text-16\">{{event.timestamp | ccdDate : 'local'}}\n <span class=\"tooltiptext\">{{'Local:' | rpxTranslate}} {{event.timestamp | ccdDate : 'local'}}</span>\n </div></td>\n <td tabindex=\"0\"><span class=\"text-16\">{{event.user_first_name | titlecase}} {{event.user_last_name | uppercase}}</span></td>\n </tr>\n </tbody>\n</table>\n", styles: ["#case-timeline a{cursor:pointer;text-decoration:underline;color:#005ea5}#case-timeline a:hover{color:#2b8cc4}#case-timeline a:visited{color:#4c2c92}.EventLogTable tbody>tr td:first-child{padding-left:10px}.EventLogTable tbody>tr.EventLogTable-Selected{border-left:8px solid #005ea5;background-color:#f8f8f8}.EventLogTable tbody>tr.EventLogTable-Selected td:first-child{padding-left:6px}.EventLogTable tbody>tr:not(.EventLogTable-Selected):hover{border-left:8px solid #2b8cc4;background-color:#f8f8f8;cursor:pointer;cursor:hand}.EventLogTable tbody>tr:not(.EventLogTable-Selected):hover td:first-child{padding-left:6px}.EventLogTable tbody>tr .event-link{float:left;padding-right:8px}.EventLogTable tbody>tr .doc-img{width:16px;float:left}.EventLogTable tbody>tr .doc-tooltip{left:35%;bottom:7px}.EventLogTable tbody>tr .doc-tooltip:after{border-color:transparent}\n"] }]
27845
+ }], () => [{ type: SessionStorageService }], { events: [{
27642
27846
  type: Input
27643
27847
  }], selected: [{
27644
27848
  type: Input
@@ -27647,11 +27851,11 @@ class EventLogTableComponent {
27647
27851
  }], onCaseHistory: [{
27648
27852
  type: Output
27649
27853
  }] }); })();
27650
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(EventLogTableComponent, { className: "EventLogTableComponent", filePath: "lib/shared/components/palette/history/event-log/event-log-table.component.ts", lineNumber: 10 }); })();
27854
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(EventLogTableComponent, { className: "EventLogTableComponent", filePath: "lib/shared/components/palette/history/event-log/event-log-table.component.ts", lineNumber: 11 }); })();
27651
27855
 
27652
27856
  function EventLogComponent_ccd_event_log_table_3_Template(rf, ctx) { if (rf & 1) {
27653
27857
  const _r1 = i0.ɵɵgetCurrentView();
27654
- i0.ɵɵelementStart(0, "ccd-event-log-table", 7);
27858
+ i0.ɵɵelementStart(0, "ccd-event-log-table", 8);
27655
27859
  i0.ɵɵlistener("onSelect", function EventLogComponent_ccd_event_log_table_3_Template_ccd_event_log_table_onSelect_0_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.select($event)); })("onCaseHistory", function EventLogComponent_ccd_event_log_table_3_Template_ccd_event_log_table_onCaseHistory_0_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.caseHistoryClicked($event)); });
27656
27860
  i0.ɵɵelementEnd();
27657
27861
  } if (rf & 2) {
@@ -27660,7 +27864,7 @@ function EventLogComponent_ccd_event_log_table_3_Template(rf, ctx) { if (rf & 1)
27660
27864
  } }
27661
27865
  function EventLogComponent_ccd_event_log_table_4_Template(rf, ctx) { if (rf & 1) {
27662
27866
  const _r3 = i0.ɵɵgetCurrentView();
27663
- i0.ɵɵelementStart(0, "ccd-event-log-table", 8);
27867
+ i0.ɵɵelementStart(0, "ccd-event-log-table", 9);
27664
27868
  i0.ɵɵlistener("onSelect", function EventLogComponent_ccd_event_log_table_4_Template_ccd_event_log_table_onSelect_0_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.select($event)); });
27665
27869
  i0.ɵɵelementEnd();
27666
27870
  } if (rf & 2) {
@@ -27668,7 +27872,7 @@ function EventLogComponent_ccd_event_log_table_4_Template(rf, ctx) { if (rf & 1)
27668
27872
  i0.ɵɵproperty("events", ctx_r1.events)("selected", ctx_r1.selected);
27669
27873
  } }
27670
27874
  function EventLogComponent_ccd_event_log_details_7_Template(rf, ctx) { if (rf & 1) {
27671
- i0.ɵɵelement(0, "ccd-event-log-details", 9);
27875
+ i0.ɵɵelement(0, "ccd-event-log-details", 10);
27672
27876
  } if (rf & 2) {
27673
27877
  const ctx_r1 = i0.ɵɵnextContext();
27674
27878
  i0.ɵɵproperty("event", ctx_r1.selected);
@@ -27689,14 +27893,14 @@ class EventLogComponent {
27689
27893
  this.onCaseHistory.emit(eventId);
27690
27894
  }
27691
27895
  static ɵfac = function EventLogComponent_Factory(t) { return new (t || EventLogComponent)(); };
27692
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: EventLogComponent, selectors: [["ccd-event-log"]], inputs: { events: "events" }, outputs: { onCaseHistory: "onCaseHistory" }, decls: 8, vars: 4, consts: [[1, "grid-row"], [1, "column-one-half"], [3, "ngSwitch"], [3, "events", "selected", "onSelect", "onCaseHistory", 4, "ngSwitchCase"], [3, "events", "selected", "onSelect", 4, "ngSwitchCase"], [1, "EventLog-DetailsPanel"], [3, "event", 4, "ngIf"], [3, "onSelect", "onCaseHistory", "events", "selected"], [3, "onSelect", "events", "selected"], [3, "event"]], template: function EventLogComponent_Template(rf, ctx) { if (rf & 1) {
27896
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: EventLogComponent, selectors: [["ccd-event-log"]], inputs: { events: "events" }, outputs: { onCaseHistory: "onCaseHistory" }, decls: 8, vars: 4, consts: [[1, "grid-row"], [1, "column-one-half", "scrollbar"], [3, "ngSwitch"], [3, "events", "selected", "onSelect", "onCaseHistory", 4, "ngSwitchCase"], [3, "events", "selected", "onSelect", 4, "ngSwitchCase"], [1, "column-one-half"], [1, "EventLog-DetailsPanel"], [3, "event", 4, "ngIf"], [3, "onSelect", "onCaseHistory", "events", "selected"], [3, "onSelect", "events", "selected"], [3, "event"]], template: function EventLogComponent_Template(rf, ctx) { if (rf & 1) {
27693
27897
  i0.ɵɵelementStart(0, "div", 0)(1, "div", 1);
27694
27898
  i0.ɵɵelementContainerStart(2, 2);
27695
27899
  i0.ɵɵtemplate(3, EventLogComponent_ccd_event_log_table_3_Template, 1, 2, "ccd-event-log-table", 3)(4, EventLogComponent_ccd_event_log_table_4_Template, 1, 2, "ccd-event-log-table", 4);
27696
27900
  i0.ɵɵelementContainerEnd();
27697
27901
  i0.ɵɵelementEnd();
27698
- i0.ɵɵelementStart(5, "div", 1)(6, "div", 5);
27699
- i0.ɵɵtemplate(7, EventLogComponent_ccd_event_log_details_7_Template, 1, 1, "ccd-event-log-details", 6);
27902
+ i0.ɵɵelementStart(5, "div", 5)(6, "div", 6);
27903
+ i0.ɵɵtemplate(7, EventLogComponent_ccd_event_log_details_7_Template, 1, 1, "ccd-event-log-details", 7);
27700
27904
  i0.ɵɵelementEnd()()();
27701
27905
  } if (rf & 2) {
27702
27906
  i0.ɵɵadvance(2);
@@ -27707,11 +27911,11 @@ class EventLogComponent {
27707
27911
  i0.ɵɵproperty("ngSwitchCase", false);
27708
27912
  i0.ɵɵadvance(3);
27709
27913
  i0.ɵɵproperty("ngIf", ctx.selected);
27710
- } }, styles: ["@media (max-width: 991px){[class*=col-md][_ngcontent-%COMP%]{margin-bottom:30px}}.EventLog-DetailsPanel[_ngcontent-%COMP%]{border:1px solid #bfc1c3;padding:0 10px 10px;margin-top:20px}"] });
27914
+ } }, styles: ["@media (max-width: 991px){[class*=col-md][_ngcontent-%COMP%]{margin-bottom:30px}}.column-half[_ngcontent-%COMP%], .column-one-half[_ngcontent-%COMP%]{float:left;width:50%}@media (min-width: 641px){.scrollbar[_ngcontent-%COMP%]{height:70vh;overflow-y:auto}}.EventLog-DetailsPanel[_ngcontent-%COMP%]{border:1px solid #bfc1c3;padding:0 10px 10px;margin-top:20px}"] });
27711
27915
  }
27712
27916
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EventLogComponent, [{
27713
27917
  type: Component,
27714
- args: [{ selector: 'ccd-event-log', template: "<div class=\"grid-row\">\n <div class=\"column-one-half\">\n <ng-container [ngSwitch]=\"isPartOfCaseTimeline\">\n <ccd-event-log-table *ngSwitchCase=\"true\" [events]=\"events\" [selected]=\"selected\" (onSelect)=\"select($event)\" (onCaseHistory)=\"caseHistoryClicked($event)\"></ccd-event-log-table>\n <ccd-event-log-table *ngSwitchCase=\"false\" [events]=\"events\" [selected]=\"selected\" (onSelect)=\"select($event)\"></ccd-event-log-table>\n </ng-container>\n </div>\n <div class=\"column-one-half\">\n <div class=\"EventLog-DetailsPanel\">\n <ccd-event-log-details *ngIf=\"selected\" [event]=\"selected\"></ccd-event-log-details>\n </div>\n </div>\n</div>\n", styles: ["@media (max-width: 991px){[class*=col-md]{margin-bottom:30px}}.EventLog-DetailsPanel{border:1px solid #bfc1c3;padding:0 10px 10px;margin-top:20px}\n"] }]
27918
+ args: [{ selector: 'ccd-event-log', template: "<div class=\"grid-row\">\n <div class=\"column-one-half scrollbar\">\n <ng-container [ngSwitch]=\"isPartOfCaseTimeline\">\n <ccd-event-log-table\n *ngSwitchCase=\"true\"\n [events]=\"events\"\n [selected]=\"selected\"\n (onSelect)=\"select($event)\"\n (onCaseHistory)=\"caseHistoryClicked($event)\"\n ></ccd-event-log-table>\n <ccd-event-log-table\n *ngSwitchCase=\"false\"\n [events]=\"events\"\n [selected]=\"selected\"\n (onSelect)=\"select($event)\"\n ></ccd-event-log-table>\n </ng-container>\n </div>\n <div class=\"column-one-half\">\n <div class=\"EventLog-DetailsPanel\">\n <ccd-event-log-details\n *ngIf=\"selected\"\n [event]=\"selected\"\n ></ccd-event-log-details>\n </div>\n </div>\n</div>\n", styles: ["@media (max-width: 991px){[class*=col-md]{margin-bottom:30px}}.column-half,.column-one-half{float:left;width:50%}@media (min-width: 641px){.scrollbar{height:70vh;overflow-y:auto}}.EventLog-DetailsPanel{border:1px solid #bfc1c3;padding:0 10px 10px;margin-top:20px}\n"] }]
27715
27919
  }], null, { events: [{
27716
27920
  type: Input
27717
27921
  }], onCaseHistory: [{
@@ -29258,7 +29462,7 @@ i0.ɵɵsetComponentScope(
29258
29462
  // Components for Query Management
29259
29463
  ReadQueryManagementFieldComponent, function () { return [i5.NgForOf, i5.NgIf, i1$1.RouterLink, QueryDetailsComponent,
29260
29464
  QueryListComponent]; }, function () { return [i1.RpxTranslatePipe]; });
29261
- i0.ɵɵsetComponentScope(QueryDetailsComponent, function () { return [i5.NgForOf, i5.NgIf, QueryAttachmentsReadComponent]; }, function () { return [i5.DatePipe, i1.RpxTranslatePipe]; });
29465
+ i0.ɵɵsetComponentScope(QueryDetailsComponent, function () { return [i5.NgForOf, i5.NgIf, AlertComponent, QueryAttachmentsReadComponent]; }, function () { return [i5.DatePipe, i1.RpxTranslatePipe]; });
29262
29466
  i0.ɵɵsetComponentScope(QueryWriteRespondToQueryComponent, function () { return [i5.NgIf, i4.DefaultValueAccessor, i4.NgControlStatus, i4.NgControlStatusGroup, i4.FormGroupDirective, i4.FormControlName, QueryDetailsComponent,
29263
29467
  QueryCaseDetailsHeaderComponent]; }, function () { return [i1.RpxTranslatePipe]; });
29264
29468
  i0.ɵɵsetComponentScope(QueryWriteRaiseQueryComponent, function () { return [i5.NgClass, i5.NgIf, i4.DefaultValueAccessor, i4.RadioControlValueAccessor, i4.NgControlStatus, i4.NgControlStatusGroup, i4.FormGroupDirective, i4.FormControlName, QueryCaseDetailsHeaderComponent,
@@ -32283,13 +32487,14 @@ class EventTriggerResolver {
32283
32487
  router;
32284
32488
  appConfig;
32285
32489
  errorNotifier;
32490
+ loadingService;
32286
32491
  static PARAM_CASE_ID = 'cid';
32287
32492
  static PARAM_EVENT_ID = 'eid';
32288
32493
  static IGNORE_WARNING = 'ignoreWarning';
32289
32494
  static IGNORE_WARNING_VALUES = ['true', 'false'];
32290
32495
  cachedEventTrigger;
32291
32496
  cachedProfile;
32292
- constructor(casesService, alertService, profileService, profileNotifier, router, appConfig, errorNotifier) {
32497
+ constructor(casesService, alertService, profileService, profileNotifier, router, appConfig, errorNotifier, loadingService) {
32293
32498
  this.casesService = casesService;
32294
32499
  this.alertService = alertService;
32295
32500
  this.profileService = profileService;
@@ -32297,6 +32502,7 @@ class EventTriggerResolver {
32297
32502
  this.router = router;
32298
32503
  this.appConfig = appConfig;
32299
32504
  this.errorNotifier = errorNotifier;
32505
+ this.loadingService = loadingService;
32300
32506
  }
32301
32507
  resolve(route) {
32302
32508
  return this.isRootTriggerEventRoute(route) ? this.getAndCacheEventTrigger(route)
@@ -32327,7 +32533,7 @@ class EventTriggerResolver {
32327
32533
  }
32328
32534
  return this.casesService
32329
32535
  .getEventTrigger(caseTypeId, eventTriggerId, cid, ignoreWarning)
32330
- .pipe(map(eventTrigger => this.cachedEventTrigger = eventTrigger), catchError(error => {
32536
+ .pipe(map((eventTrigger) => this.cachedEventTrigger = eventTrigger), catchError((error) => {
32331
32537
  error.details = { eventId: eventTriggerId, ...error.details };
32332
32538
  this.alertService.setPreserveAlerts(true);
32333
32539
  this.alertService.error(error.message);
@@ -32336,12 +32542,12 @@ class EventTriggerResolver {
32336
32542
  return throwError(error);
32337
32543
  })).toPromise();
32338
32544
  }
32339
- static ɵfac = function EventTriggerResolver_Factory(t) { return new (t || EventTriggerResolver)(i0.ɵɵinject(CasesService), i0.ɵɵinject(AlertService), i0.ɵɵinject(ProfileService), i0.ɵɵinject(ProfileNotifier), i0.ɵɵinject(i1$1.Router), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(ErrorNotifierService)); };
32545
+ static ɵfac = function EventTriggerResolver_Factory(t) { return new (t || EventTriggerResolver)(i0.ɵɵinject(CasesService), i0.ɵɵinject(AlertService), i0.ɵɵinject(ProfileService), i0.ɵɵinject(ProfileNotifier), i0.ɵɵinject(i1$1.Router), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(ErrorNotifierService), i0.ɵɵinject(LoadingService)); };
32340
32546
  static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: EventTriggerResolver, factory: EventTriggerResolver.ɵfac });
32341
32547
  }
32342
32548
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EventTriggerResolver, [{
32343
32549
  type: Injectable
32344
- }], () => [{ type: CasesService }, { type: AlertService }, { type: ProfileService }, { type: ProfileNotifier }, { type: i1$1.Router }, { type: AbstractAppConfig }, { type: ErrorNotifierService }], null); })();
32550
+ }], () => [{ type: CasesService }, { type: AlertService }, { type: ProfileService }, { type: ProfileNotifier }, { type: i1$1.Router }, { type: AbstractAppConfig }, { type: ErrorNotifierService }, { type: LoadingService }], null); })();
32345
32551
 
32346
32552
  function CaseEventTriggerComponent_div_0_Template(rf, ctx) { if (rf & 1) {
32347
32553
  const _r1 = i0.ɵɵgetCurrentView();
@@ -32367,6 +32573,7 @@ class CaseEventTriggerComponent {
32367
32573
  caseReferencePipe;
32368
32574
  activityPollingService;
32369
32575
  sessionStorageService;
32576
+ loadingService;
32370
32577
  static EVENT_COMPLETION_MESSAGE = `Case #%CASEREFERENCE% has been updated with event: %NAME%`;
32371
32578
  static CALLBACK_FAILED_MESSAGE = ' but the callback service cannot be completed';
32372
32579
  BANNER = DisplayMode.BANNER;
@@ -32375,7 +32582,7 @@ class CaseEventTriggerComponent {
32375
32582
  activitySubscription;
32376
32583
  caseSubscription;
32377
32584
  parentUrl;
32378
- constructor(ngZone, casesService, caseNotifier, router, alertService, route, caseReferencePipe, activityPollingService, sessionStorageService) {
32585
+ constructor(ngZone, casesService, caseNotifier, router, alertService, route, caseReferencePipe, activityPollingService, sessionStorageService, loadingService) {
32379
32586
  this.ngZone = ngZone;
32380
32587
  this.casesService = casesService;
32381
32588
  this.caseNotifier = caseNotifier;
@@ -32385,8 +32592,12 @@ class CaseEventTriggerComponent {
32385
32592
  this.caseReferencePipe = caseReferencePipe;
32386
32593
  this.activityPollingService = activityPollingService;
32387
32594
  this.sessionStorageService = sessionStorageService;
32595
+ this.loadingService = loadingService;
32388
32596
  }
32389
32597
  ngOnInit() {
32598
+ if (this.loadingService.hasSharedSpinner()) {
32599
+ this.loadingService.unregisterSharedSpinner();
32600
+ }
32390
32601
  if (this.route.snapshot.data.case) {
32391
32602
  this.caseDetails = this.route.snapshot.data.case;
32392
32603
  }
@@ -32473,7 +32684,7 @@ class CaseEventTriggerComponent {
32473
32684
  isDataLoaded() {
32474
32685
  return !!(this.eventTrigger && this.caseDetails);
32475
32686
  }
32476
- static ɵfac = function CaseEventTriggerComponent_Factory(t) { return new (t || CaseEventTriggerComponent)(i0.ɵɵdirectiveInject(i0.NgZone), i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(CaseReferencePipe), i0.ɵɵdirectiveInject(ActivityPollingService), i0.ɵɵdirectiveInject(SessionStorageService)); };
32687
+ static ɵfac = function CaseEventTriggerComponent_Factory(t) { return new (t || CaseEventTriggerComponent)(i0.ɵɵdirectiveInject(i0.NgZone), i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(CaseReferencePipe), i0.ɵɵdirectiveInject(ActivityPollingService), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(LoadingService)); };
32477
32688
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEventTriggerComponent, selectors: [["ccd-case-event-trigger"]], decls: 1, vars: 1, consts: [["class", "screen-990", 4, "ngIf"], [1, "screen-990"], [3, "caseId", "displayMode"], [3, "cancelled", "submitted", "caseDetails", "submit", "validate", "eventTrigger"]], template: function CaseEventTriggerComponent_Template(rf, ctx) { if (rf & 1) {
32478
32689
  i0.ɵɵtemplate(0, CaseEventTriggerComponent_div_0_Template, 3, 6, "div", 0);
32479
32690
  } if (rf & 2) {
@@ -32483,7 +32694,7 @@ class CaseEventTriggerComponent {
32483
32694
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEventTriggerComponent, [{
32484
32695
  type: Component,
32485
32696
  args: [{ selector: 'ccd-case-event-trigger', template: "<div *ngIf=\"isDataLoaded()\" class=\"screen-990\">\n <ccd-activity [caseId]=\"caseDetails.case_id\" [displayMode]=\"BANNER\"></ccd-activity>\n <ccd-case-edit [caseDetails]=\"caseDetails\"\n [submit]=\"submit()\"\n [validate]=\"validate()\"\n [eventTrigger]=\"eventTrigger\"\n (cancelled)=\"cancel()\"\n (submitted)=\"submitted($event)\"></ccd-case-edit>\n</div>\n" }]
32486
- }], () => [{ type: i0.NgZone }, { type: CasesService }, { type: CaseNotifier }, { type: i1$1.Router }, { type: AlertService }, { type: i1$1.ActivatedRoute }, { type: CaseReferencePipe }, { type: ActivityPollingService }, { type: SessionStorageService }], null); })();
32697
+ }], () => [{ type: i0.NgZone }, { type: CasesService }, { type: CaseNotifier }, { type: i1$1.Router }, { type: AlertService }, { type: i1$1.ActivatedRoute }, { type: CaseReferencePipe }, { type: ActivityPollingService }, { type: SessionStorageService }, { type: LoadingService }], null); })();
32487
32698
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEventTriggerComponent, { className: "CaseEventTriggerComponent", filePath: "lib/shared/components/case-viewer/case-event-trigger/case-event-trigger.component.ts", lineNumber: 14 }); })();
32488
32699
 
32489
32700
  function CaseViewComponent_div_0_Template(rf, ctx) { if (rf & 1) {
@@ -33147,6 +33358,7 @@ class CaseFullAccessViewComponent {
33147
33358
  crf;
33148
33359
  sessionStorageService;
33149
33360
  rpxTranslationPipe;
33361
+ loadingService;
33150
33362
  static ORIGIN_QUERY_PARAM = 'origin';
33151
33363
  static TRIGGER_TEXT_START = 'Go';
33152
33364
  static TRIGGER_TEXT_CONTINUE = 'Ignore Warning and Go';
@@ -33183,7 +33395,7 @@ class CaseFullAccessViewComponent {
33183
33395
  eventId;
33184
33396
  callbackErrorsSubject;
33185
33397
  tabGroup;
33186
- constructor(ngZone, route, router, navigationNotifierService, orderService, activityPollingService, dialog, alertService, draftService, errorNotifierService, convertHrefToRouterService, location, crf, sessionStorageService, rpxTranslationPipe) {
33398
+ constructor(ngZone, route, router, navigationNotifierService, orderService, activityPollingService, dialog, alertService, draftService, errorNotifierService, convertHrefToRouterService, location, crf, sessionStorageService, rpxTranslationPipe, loadingService) {
33187
33399
  this.ngZone = ngZone;
33188
33400
  this.route = route;
33189
33401
  this.router = router;
@@ -33199,6 +33411,7 @@ class CaseFullAccessViewComponent {
33199
33411
  this.crf = crf;
33200
33412
  this.sessionStorageService = sessionStorageService;
33201
33413
  this.rpxTranslationPipe = rpxTranslationPipe;
33414
+ this.loadingService = loadingService;
33202
33415
  }
33203
33416
  ngOnInit() {
33204
33417
  this.callbackErrorsSubject = this.errorNotifierService.errorSource.pipe(filter((x) => {
@@ -33280,6 +33493,8 @@ class CaseFullAccessViewComponent {
33280
33493
  this.triggerText = CaseFullAccessViewComponent.TRIGGER_TEXT_START;
33281
33494
  }
33282
33495
  async applyTrigger(trigger) {
33496
+ const spinner = this.loadingService.register();
33497
+ this.loadingService.addSharedSpinner(spinner);
33283
33498
  this.errorNotifierService.announceError(null);
33284
33499
  const theQueryParams = {};
33285
33500
  if (this.ignoreWarning) {
@@ -33530,7 +33745,7 @@ class CaseFullAccessViewComponent {
33530
33745
  this.errorNotifierService.announceError(null);
33531
33746
  this.alertService.clear();
33532
33747
  }
33533
- static ɵfac = function CaseFullAccessViewComponent_Factory(t) { return new (t || CaseFullAccessViewComponent)(i0.ɵɵdirectiveInject(i0.NgZone), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(NavigationNotifierService), i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(ActivityPollingService), i0.ɵɵdirectiveInject(i1$3.MatLegacyDialog), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(DraftService), i0.ɵɵdirectiveInject(ErrorNotifierService), i0.ɵɵdirectiveInject(ConvertHrefToRouterService), i0.ɵɵdirectiveInject(i5.Location), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(i1.RpxTranslatePipe)); };
33748
+ static ɵfac = function CaseFullAccessViewComponent_Factory(t) { return new (t || CaseFullAccessViewComponent)(i0.ɵɵdirectiveInject(i0.NgZone), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(NavigationNotifierService), i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(ActivityPollingService), i0.ɵɵdirectiveInject(i1$3.MatLegacyDialog), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(DraftService), i0.ɵɵdirectiveInject(ErrorNotifierService), i0.ɵɵdirectiveInject(ConvertHrefToRouterService), i0.ɵɵdirectiveInject(i5.Location), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(i1.RpxTranslatePipe), i0.ɵɵdirectiveInject(LoadingService)); };
33534
33749
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseFullAccessViewComponent, selectors: [["ccd-case-full-access-view"]], viewQuery: function CaseFullAccessViewComponent_Query(rf, ctx) { if (rf & 1) {
33535
33750
  i0.ɵɵviewQuery(_c0$b, 5);
33536
33751
  } if (rf & 2) {
@@ -33575,7 +33790,7 @@ class CaseFullAccessViewComponent {
33575
33790
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseFullAccessViewComponent, [{
33576
33791
  type: Component,
33577
33792
  args: [{ selector: 'ccd-case-full-access-view', template: "<!-- Generic error heading and error message to be displayed only if there are no specific callback errors or warnings, or no error details -->\n<div *ngIf=\"error && !(error.callbackErrors || error.callbackWarnings || error.details)\" class=\"error-summary\"\n role=\"group\" aria-labelledby=\"edit-case-event_error-summary-heading\" tabindex=\"-1\">\n <h1 class=\"heading-h1 error-summary-heading\" id=\"edit-case-event_error-summary-heading\">\n {{'Something went wrong' | rpxTranslate}}\n </h1>\n <div class=\"govuk-error-summary__body\" id=\"edit-case-event_error-summary-body\">\n <p>{{\"We're working to fix the problem. Try again shortly.\" | rpxTranslate}}</p>\n <p>\n <a href=\"get-help\" target=\"_blank\">\n {{\"Contact us\" | rpxTranslate}}</a> {{\"if you're still having problems.\" | rpxTranslate}}\n </p>\n </div>\n</div>\n<!-- Callback error heading and error message to be displayed if there are specific error details -->\n<div *ngIf=\"error && error.details\" class=\"error-summary\" role=\"group\"\n aria-labelledby=\"edit-case-event_error-summary-heading\" tabindex=\"-1\">\n <h2 class=\"heading-h2 error-summary-heading\" id=\"edit-case-event_error-summary-heading\">\n {{'The callback data failed validation' | rpxTranslate}}\n </h2>\n <p>{{error.message | rpxTranslate}}</p>\n <ul *ngIf=\"error.details?.field_errors\" class=\"error-summary-list\">\n <li *ngFor=\"let fieldError of error.details.field_errors\">\n {{fieldError.message | rpxTranslate}}\n </li>\n </ul>\n</div>\n<ccd-callback-errors\n [triggerTextContinue]=\"triggerTextStart\"\n [triggerTextIgnore]=\"triggerTextIgnoreWarnings\"\n [callbackErrorsSubject]=\"callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\">\n</ccd-callback-errors>\n<ccd-activity [caseId]=\"caseDetails.case_id\" [displayMode]=\"BANNER\"></ccd-activity>\n<div class=\"grid-row\">\n <div class=\"column-one-half\">\n <ccd-case-header [caseDetails]=\"caseDetails\"></ccd-case-header>\n <div class=\"case-viewer-controls\" *ngIf=\"hasPrint && !isDraft() && isPrintEnabled()\">\n <a id=\"case-viewer-control-print\" routerLink=\"print\" class=\"button button-secondary\">{{'Print' | rpxTranslate}}</a>\n </div>\n </div>\n <div *ngIf=\"hasEventSelector\" class=\"column-one-half\">\n <ccd-event-trigger [isDisabled]=\"isTriggerButtonDisabled()\" [triggers]=\"caseDetails.triggers\"\n [triggerText]=\"triggerText\"\n [eventId]=\"eventId\"\n (onTriggerChange)=\"clearErrorsAndWarnings()\"\n (onTriggerSubmit)=\"applyTrigger($event)\"></ccd-event-trigger>\n </div>\n</div>\n<div class=\"grid-row\" *ngIf=\"activeCaseFlags && !caseFlagsExternalUser\">\n <div class=\"column-full\">\n <ccd-notification-banner [notificationBannerConfig]=\"notificationBannerConfig\" (linkClicked)=\"onLinkClicked($event)\">\n </ccd-notification-banner>\n </div>\n</div>\n<div class=\"grid-row\">\n <div class=\"column-full\">\n <ng-container *ngIf=\"hasTabsPresent()\">\n <mat-tab-group #tabGroup animationDuration=\"0ms\" (selectedIndexChange)=\"tabChanged($event)\" [disableRipple]=\"true\"\n [selectedIndex]=\"selectedTabIndex\">\n <mat-tab *ngFor=\"let tab of prependedTabs\" [id]=\"tab.id\" [label]=\"tab.label | rpxTranslate\">\n </mat-tab>\n <mat-tab *ngFor=\"let tab of sortedTabs; let curIdx=index\" [id]=\"tab.id\" [label]=\"tab.label | rpxTranslate\">\n <ng-template matTabContent>\n <table [class]=\"tab.id\" [attr.aria-label]=\"'case viewer table' | rpxTranslate\">\n <tbody>\n <ng-container *ngFor=\"let field of tab | ccdTabFields | ccdReadFieldsFilter:false :undefined :true : formGroup?.controls['data']\">\n <div ccdLabelSubstitutor [caseField]=\"field\" [contextFields]=\"caseFields\" [hidden]=\"field.hidden\">\n <ng-container [ngSwitch]=\"!(field | ccdIsCompound)\">\n <tr *ngSwitchCase=\"true\">\n <th id=\"case-viewer-field-label\" *ngIf=\"!isFieldToHaveNoLabel(field)\">\n <div class=\"case-viewer-label text-16\">\n {{field.label | rpxTranslate}}</div>\n </th>\n <td [id]=\"'case-viewer-field-read--' + field.id\" scope=\"col\">\n <span class=\"text-16\">\n <ccd-field-read [topLevelFormGroup]=\"formGroup?.controls['data']\"\n [caseField]=\"field\" [caseReference]=\"caseDetails.case_id\"\n [markdownUseHrefAsRouterLink]=\"markdownUseHrefAsRouterLink\">\n </ccd-field-read>\n </span>\n </td>\n </tr>\n <tr *ngSwitchCase=\"false\" class=\"compound-field\">\n <th [id]=\"'case-viewer-field-read--' + field.id\" scope=\"col\">\n <span class=\"text-16\">\n <ccd-field-read [topLevelFormGroup]=\"formGroup.controls['data']\"\n [caseField]=\"field\" [caseReference]=\"caseDetails.case_id\"\n [markdownUseHrefAsRouterLink]=\"markdownUseHrefAsRouterLink\">\n </ccd-field-read>\n </span>\n </th>\n </tr>\n </ng-container>\n </div>\n </ng-container>\n </tbody>\n </table>\n </ng-template>\n </mat-tab>\n <mat-tab *ngFor=\"let tab of appendedTabs\" [id]=\"tab.id\" [label]=\"tab.label | rpxTranslate\">\n </mat-tab>\n </mat-tab-group>\n <router-outlet *ngIf=\"(prependedTabs && prependedTabs.length) || (appendedTabs && appendedTabs.length)\"></router-outlet>\n </ng-container>\n </div>\n</div>\n", styles: ["th{width:1%;white-space:nowrap;vertical-align:top}.compound-field th{padding:0}.case-viewer-controls{margin-top:47px;margin-bottom:20px}ccd-case-header{float:left;margin-right:10px}ccd-event-trigger{float:right}.case-viewer-label{min-width:300px;white-space:normal}.markdown h3{margin-bottom:0}.hide-table-capion{position:absolute;visibility:hidden}\n"] }]
33578
- }], () => [{ type: i0.NgZone }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: NavigationNotifierService }, { type: OrderService }, { type: ActivityPollingService }, { type: i1$3.MatLegacyDialog }, { type: AlertService }, { type: DraftService }, { type: ErrorNotifierService }, { type: ConvertHrefToRouterService }, { type: i5.Location }, { type: i0.ChangeDetectorRef }, { type: SessionStorageService }, { type: i1.RpxTranslatePipe }], { hasPrint: [{
33793
+ }], () => [{ type: i0.NgZone }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: NavigationNotifierService }, { type: OrderService }, { type: ActivityPollingService }, { type: i1$3.MatLegacyDialog }, { type: AlertService }, { type: DraftService }, { type: ErrorNotifierService }, { type: ConvertHrefToRouterService }, { type: i5.Location }, { type: i0.ChangeDetectorRef }, { type: SessionStorageService }, { type: i1.RpxTranslatePipe }, { type: LoadingService }], { hasPrint: [{
33579
33794
  type: Input
33580
33795
  }], hasEventSelector: [{
33581
33796
  type: Input
@@ -33589,7 +33804,7 @@ class CaseFullAccessViewComponent {
33589
33804
  type: ViewChild,
33590
33805
  args: ['tabGroup', { static: false }]
33591
33806
  }] }); })();
33592
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseFullAccessViewComponent, { className: "CaseFullAccessViewComponent", filePath: "lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.ts", lineNumber: 43 }); })();
33807
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseFullAccessViewComponent, { className: "CaseFullAccessViewComponent", filePath: "lib/shared/components/case-viewer/case-full-access-view/case-full-access-view.component.ts", lineNumber: 44 }); })();
33593
33808
 
33594
33809
  class PrintUrlPipe {
33595
33810
  appConfig;
@@ -34339,7 +34554,6 @@ class EventStartGuard {
34339
34554
  sessionStorageService;
34340
34555
  abstractConfig;
34341
34556
  cookieService;
34342
- static CLIENT_CONTEXT = 'clientContext';
34343
34557
  constructor(workAllocationService, router, sessionStorageService, abstractConfig, cookieService) {
34344
34558
  this.workAllocationService = workAllocationService;
34345
34559
  this.router = router;
@@ -34360,7 +34574,7 @@ class EventStartGuard {
34360
34574
  const caseInfoStr = this.sessionStorageService.getItem('caseInfo');
34361
34575
  const languageCookie = this.cookieService.getCookie('exui-preferred-language');
34362
34576
  const currentLanguage = !!languageCookie && languageCookie !== '' ? languageCookie : 'en';
34363
- const preClientContext = this.sessionStorageService.getItem(EventStartGuard.CLIENT_CONTEXT);
34577
+ const preClientContext = this.sessionStorageService.getItem(CaseEditComponent.CLIENT_CONTEXT);
34364
34578
  if (!preClientContext) {
34365
34579
  // creates client context for language if not already existing
34366
34580
  const storeClientContext = {
@@ -34370,7 +34584,7 @@ class EventStartGuard {
34370
34584
  }
34371
34585
  }
34372
34586
  };
34373
- this.sessionStorageService.setItem(EventStartGuard.CLIENT_CONTEXT, JSON.stringify(storeClientContext));
34587
+ this.sessionStorageService.setItem(CaseEditComponent.CLIENT_CONTEXT, JSON.stringify(storeClientContext));
34374
34588
  }
34375
34589
  else {
34376
34590
  const clientContextObj = JSON.parse(preClientContext);
@@ -34384,7 +34598,7 @@ class EventStartGuard {
34384
34598
  }
34385
34599
  }
34386
34600
  };
34387
- this.sessionStorageService.setItem(EventStartGuard.CLIENT_CONTEXT, JSON.stringify(clientContextAddLanguage));
34601
+ this.sessionStorageService.setItem(CaseEditComponent.CLIENT_CONTEXT, JSON.stringify(clientContextAddLanguage));
34388
34602
  }
34389
34603
  }
34390
34604
  if (caseInfoStr) {
@@ -34402,7 +34616,7 @@ class EventStartGuard {
34402
34616
  }
34403
34617
  return of(false);
34404
34618
  }
34405
- checkTaskInEventNotRequired(payload, caseId, taskId) {
34619
+ checkTaskInEventNotRequired(payload, caseId, taskId, eventId, userId) {
34406
34620
  if (!payload || !payload.tasks) {
34407
34621
  return true;
34408
34622
  }
@@ -34432,55 +34646,18 @@ class EventStartGuard {
34432
34646
  else {
34433
34647
  task = tasksAssignedToUser[0];
34434
34648
  }
34435
- const currentLanguage = this.cookieService.getCookie('exui-preferred-language');
34436
- // if one task assigned to user, allow user to complete event
34437
- const storeClientContext = {
34438
- client_context: {
34439
- user_task: {
34440
- task_data: task,
34441
- complete_task: true
34442
- },
34443
- user_language: {
34444
- language: currentLanguage
34445
- }
34446
- }
34447
- };
34448
- this.sessionStorageService.setItem(EventStartGuard.CLIENT_CONTEXT, JSON.stringify(storeClientContext));
34649
+ this.setClientContextStorage(task, caseId, eventId, userId);
34449
34650
  return true;
34450
34651
  }
34451
34652
  }
34452
- removeTaskFromSessionStorage() {
34453
- this.sessionStorageService.removeItem(EventStartGuard.CLIENT_CONTEXT);
34454
- }
34455
34653
  checkForTasks(payload, caseId, eventId, taskId, userId) {
34456
34654
  if (taskId && payload?.tasks?.length > 0) {
34457
34655
  const task = payload.tasks.find((t) => t.id == taskId);
34458
34656
  if (task) {
34459
- // Store task to session
34460
- const taskEventCompletionInfo = {
34461
- caseId: caseId,
34462
- eventId: eventId,
34463
- userId: userId,
34464
- taskId: task.id,
34465
- createdTimestamp: Date.now()
34466
- };
34467
- const currentLanguage = this.cookieService.getCookie('exui-preferred-language');
34468
- const storeClientContext = {
34469
- client_context: {
34470
- user_task: {
34471
- task_data: task,
34472
- complete_task: true
34473
- },
34474
- user_language: {
34475
- language: currentLanguage
34476
- }
34477
- }
34478
- };
34479
- this.sessionStorageService.setItem('taskEventCompletionInfo', JSON.stringify(taskEventCompletionInfo));
34480
- this.sessionStorageService.setItem(EventStartGuard.CLIENT_CONTEXT, JSON.stringify(storeClientContext));
34657
+ this.setClientContextStorage(task, caseId, eventId, userId);
34481
34658
  }
34482
34659
  else {
34483
- this.removeTaskFromSessionStorage();
34660
+ removeTaskFromClientContext(this.sessionStorageService);
34484
34661
  }
34485
34662
  }
34486
34663
  if (payload.task_required_for_event) {
@@ -34495,9 +34672,34 @@ class EventStartGuard {
34495
34672
  return of(false);
34496
34673
  }
34497
34674
  else {
34498
- return of(this.checkTaskInEventNotRequired(payload, caseId, taskId));
34675
+ return of(this.checkTaskInEventNotRequired(payload, caseId, taskId, eventId, userId));
34499
34676
  }
34500
34677
  }
34678
+ // EXUI-2743 - Make taskEventCompletionInfo always available in session storage with client context
34679
+ setClientContextStorage(task, caseId, eventId, userId) {
34680
+ // Store task to session
34681
+ const taskEventCompletionInfo = {
34682
+ caseId: caseId,
34683
+ eventId: eventId,
34684
+ userId: userId,
34685
+ taskId: task.id,
34686
+ createdTimestamp: Date.now()
34687
+ };
34688
+ const currentLanguage = this.cookieService.getCookie('exui-preferred-language');
34689
+ const storeClientContext = {
34690
+ client_context: {
34691
+ user_task: {
34692
+ task_data: task,
34693
+ complete_task: true
34694
+ },
34695
+ user_language: {
34696
+ language: currentLanguage
34697
+ }
34698
+ }
34699
+ };
34700
+ this.sessionStorageService.setItem(CaseEditComponent.TASK_EVENT_COMPLETION_INFO, JSON.stringify(taskEventCompletionInfo));
34701
+ this.sessionStorageService.setItem(CaseEditComponent.CLIENT_CONTEXT, JSON.stringify(storeClientContext));
34702
+ }
34501
34703
  static ɵfac = function EventStartGuard_Factory(t) { return new (t || EventStartGuard)(i0.ɵɵinject(WorkAllocationService), i0.ɵɵinject(i1$1.Router), i0.ɵɵinject(SessionStorageService), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(ReadCookieService)); };
34502
34704
  static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: EventStartGuard, factory: EventStartGuard.ɵfac });
34503
34705
  }
@@ -34659,7 +34861,6 @@ class EventStartStateMachineService {
34659
34861
  }
34660
34862
  }
34661
34863
  };
34662
- context.sessionStorageService.setItem('clientContext', JSON.stringify(clientContext));
34663
34864
  let userInfo;
34664
34865
  const userInfoStr = context.sessionStorageService.getItem('userDetails');
34665
34866
  if (userInfoStr) {
@@ -34673,7 +34874,9 @@ class EventStartStateMachineService {
34673
34874
  taskId: task.id,
34674
34875
  createdTimestamp: Date.now()
34675
34876
  };
34676
- context.sessionStorageService.setItem('taskEventCompletionInfo', JSON.stringify(taskEventCompletionInfo));
34877
+ context.sessionStorageService.setItem(CaseEditComponent.TASK_EVENT_COMPLETION_INFO, JSON.stringify(taskEventCompletionInfo));
34878
+ // EXUI-2668 - Only add client context when taskEventCompletionInfo is set - stops auto completing incorrect tasks
34879
+ context.sessionStorageService.setItem(CaseEditComponent.CLIENT_CONTEXT, JSON.stringify(clientContext));
34677
34880
  // Allow user to perform the event
34678
34881
  context.router.navigate([`/cases/case-details/${context.caseId}/trigger/${context.eventId}`], { relativeTo: context.route });
34679
34882
  }