@hmcts/ccd-case-ui-toolkit 7.0.61 → 7.0.62-exui-2146-rc2

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 (34) hide show
  1. package/esm2022/lib/shared/components/case-editor/case-edit/case-edit.component.mjs +9 -10
  2. package/esm2022/lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-reassigned/case-event-completion-task-reassigned.component.mjs +17 -15
  3. package/esm2022/lib/shared/components/case-editor/services/cases.service.mjs +53 -27
  4. package/esm2022/lib/shared/components/case-editor/services/event-completion-state-machine.service.mjs +13 -6
  5. package/esm2022/lib/shared/components/case-editor/services/work-allocation.service.mjs +9 -3
  6. package/esm2022/lib/shared/components/event-start/event-guard/event-start.guard.mjs +13 -5
  7. package/esm2022/lib/shared/components/event-start/services/event-start-state-machine.service.mjs +11 -3
  8. package/esm2022/lib/shared/components/palette/case-file-view/case-file-view-field.component.mjs +8 -7
  9. package/esm2022/lib/shared/components/palette/case-file-view/components/case-file-view-folder/case-file-view-folder.component.mjs +14 -13
  10. package/esm2022/lib/shared/components/palette/case-file-view/test-data/categories-and-documents-test-data.mjs +12 -12
  11. package/esm2022/lib/shared/domain/work-allocation/Task.mjs +1 -1
  12. package/esm2022/lib/shared/services/fields/fields.utils.mjs +8 -1
  13. package/esm2022/lib/shared/services/profile/profile.service.mjs +2 -1
  14. package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs +135 -69
  15. package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
  16. package/lib/shared/components/case-editor/case-edit/case-edit.component.d.ts.map +1 -1
  17. package/lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-reassigned/case-event-completion-task-reassigned.component.d.ts +1 -2
  18. 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
  19. package/lib/shared/components/case-editor/services/cases.service.d.ts +2 -1
  20. package/lib/shared/components/case-editor/services/cases.service.d.ts.map +1 -1
  21. package/lib/shared/components/case-editor/services/event-completion-state-machine.service.d.ts +1 -0
  22. package/lib/shared/components/case-editor/services/event-completion-state-machine.service.d.ts.map +1 -1
  23. package/lib/shared/components/case-editor/services/work-allocation.service.d.ts.map +1 -1
  24. package/lib/shared/components/event-start/event-guard/event-start.guard.d.ts +1 -1
  25. package/lib/shared/components/event-start/event-guard/event-start.guard.d.ts.map +1 -1
  26. package/lib/shared/components/event-start/services/event-start-state-machine.service.d.ts.map +1 -1
  27. package/lib/shared/components/palette/case-file-view/case-file-view-field.component.d.ts +1 -0
  28. package/lib/shared/components/palette/case-file-view/case-file-view-field.component.d.ts.map +1 -1
  29. package/lib/shared/components/palette/case-file-view/components/case-file-view-folder/case-file-view-folder.component.d.ts.map +1 -1
  30. package/lib/shared/domain/work-allocation/Task.d.ts +4 -0
  31. package/lib/shared/domain/work-allocation/Task.d.ts.map +1 -1
  32. package/lib/shared/services/fields/fields.utils.d.ts +2 -0
  33. package/lib/shared/services/fields/fields.utils.d.ts.map +1 -1
  34. package/package.json +1 -1
@@ -40,7 +40,6 @@ import * as i2$2 from '@angular/cdk/overlay';
40
40
  import { OverlayModule } from '@angular/cdk/overlay';
41
41
  import * as i7 from '@angular/cdk/tree';
42
42
  import { NestedTreeControl, CdkTreeModule } from '@angular/cdk/tree';
43
- import moment$1 from 'moment/moment';
44
43
  import * as i4$1 from '@angular-material-components/datetime-picker';
45
44
  import { NGX_MAT_DATE_FORMATS, NgxMatDateAdapter, NgxMatDatetimePickerModule, NgxMatTimepickerModule, NgxMatNativeDateModule } from '@angular-material-components/datetime-picker';
46
45
  import { NgxMatMomentAdapter, NGX_MAT_MOMENT_DATE_ADAPTER_OPTIONS } from '@angular-material-components/moment-adapter';
@@ -4340,6 +4339,13 @@ class FieldsUtils {
4340
4339
  return '';
4341
4340
  }
4342
4341
  }
4342
+ static getUserTaskFromClientContext(clientContextStr) {
4343
+ if (clientContextStr) {
4344
+ let clientContext = JSON.parse(clientContextStr);
4345
+ return clientContext.client_context.user_task;
4346
+ }
4347
+ return null;
4348
+ }
4343
4349
  buildCanShowPredicate(eventTrigger, form) {
4344
4350
  const currentState = this.getCurrentEventState(eventTrigger, form);
4345
4351
  return (page) => {
@@ -7175,6 +7181,7 @@ class ProfileService {
7175
7181
  .set('experimental', 'true')
7176
7182
  .set('Accept', ProfileService.V2_MEDIATYPE_USER_PROFILE)
7177
7183
  .set('Content-Type', 'application/json');
7184
+ // Not adding client context header because header is added to call immediately afterwards
7178
7185
  return this.httpService
7179
7186
  .get(url, { headers, observe: 'body' })
7180
7187
  .pipe(map((p) => plainToClass(Profile, p)));
@@ -8071,6 +8078,7 @@ class CasesService {
8071
8078
  let headers = new HttpHeaders();
8072
8079
  headers = headers.set('experimental', 'true');
8073
8080
  headers = headers.set('Content-Type', 'application/json');
8081
+ headers = this.addClientContextHeader(headers);
8074
8082
  if (Draft.isDraft(caseId)) {
8075
8083
  headers = headers.set('Accept', CasesService.V2_MEDIATYPE_START_DRAFT_TRIGGER);
8076
8084
  }
@@ -8081,9 +8089,10 @@ class CasesService {
8081
8089
  headers = headers.set('Accept', CasesService.V2_MEDIATYPE_START_CASE_TRIGGER);
8082
8090
  }
8083
8091
  return this.http
8084
- .get(url, { headers, observe: 'body' })
8085
- .pipe(map(body => {
8086
- return FieldsUtils.handleNestedDynamicLists(body);
8092
+ .get(url, { headers, observe: 'response' })
8093
+ .pipe(map((response) => {
8094
+ this.updateClientContextStorage(response.headers);
8095
+ return FieldsUtils.handleNestedDynamicLists(response.body);
8087
8096
  }), catchError(error => {
8088
8097
  this.errorService.setError(error);
8089
8098
  return throwError(error);
@@ -8092,13 +8101,17 @@ class CasesService {
8092
8101
  createEvent(caseDetails, eventData) {
8093
8102
  const caseId = caseDetails.case_id;
8094
8103
  const url = `${this.appConfig.getCaseDataUrl()}/cases/${caseId}/events`;
8095
- const headers = new HttpHeaders()
8104
+ let headers = new HttpHeaders()
8096
8105
  .set('experimental', 'true')
8097
8106
  .set('Accept', CasesService.V2_MEDIATYPE_CREATE_EVENT)
8098
8107
  .set('Content-Type', 'application/json');
8108
+ headers = this.addClientContextHeader(headers);
8099
8109
  return this.http
8100
- .post(url, eventData, { headers, observe: 'body' })
8101
- .pipe(catchError(error => {
8110
+ .post(url, eventData, { headers, observe: 'response' })
8111
+ .pipe(map((response) => {
8112
+ this.updateClientContextStorage(response.headers);
8113
+ return response.body;
8114
+ }), catchError(error => {
8102
8115
  this.errorService.setError(error);
8103
8116
  return throwError(error);
8104
8117
  }));
@@ -8106,13 +8119,17 @@ class CasesService {
8106
8119
  validateCase(ctid, eventData, pageId) {
8107
8120
  const pageIdString = pageId ? `?pageId=${pageId}` : '';
8108
8121
  const url = `${this.appConfig.getCaseDataUrl()}/case-types/${ctid}/validate${pageIdString}`;
8109
- const headers = new HttpHeaders()
8122
+ let headers = new HttpHeaders()
8110
8123
  .set('experimental', 'true')
8111
8124
  .set('Accept', CasesService.V2_MEDIATYPE_CASE_DATA_VALIDATE)
8112
8125
  .set('Content-Type', 'application/json');
8126
+ headers = this.addClientContextHeader(headers);
8113
8127
  return this.http
8114
- .post(url, eventData, { headers, observe: 'body' })
8115
- .pipe(catchError(error => {
8128
+ .post(url, eventData, { headers, observe: 'response' })
8129
+ .pipe(map((response) => {
8130
+ this.updateClientContextStorage(response.headers);
8131
+ return response.body;
8132
+ }), catchError(error => {
8116
8133
  this.errorService.setError(error);
8117
8134
  return throwError(error);
8118
8135
  }));
@@ -8123,26 +8140,34 @@ class CasesService {
8123
8140
  ignoreWarning = 'true';
8124
8141
  }
8125
8142
  const url = `${this.appConfig.getCaseDataUrl()}/case-types/${ctid}/cases?ignore-warning=${ignoreWarning}`;
8126
- const headers = new HttpHeaders()
8143
+ let headers = new HttpHeaders()
8127
8144
  .set('experimental', 'true')
8128
8145
  .set('Accept', CasesService.V2_MEDIATYPE_CREATE_CASE)
8129
8146
  .set('Content-Type', 'application/json');
8147
+ headers = this.addClientContextHeader(headers);
8130
8148
  return this.http
8131
- .post(url, eventData, { headers, observe: 'body' })
8132
- .pipe(catchError(error => {
8149
+ .post(url, eventData, { headers, observe: 'response' })
8150
+ .pipe(map((response) => {
8151
+ this.updateClientContextStorage(response.headers);
8152
+ return response.body;
8153
+ }), catchError(error => {
8133
8154
  this.errorService.setError(error);
8134
8155
  return throwError(error);
8135
8156
  }));
8136
8157
  }
8137
8158
  getPrintDocuments(caseId) {
8138
8159
  const url = `${this.appConfig.getCaseDataUrl()}/cases/${caseId}/documents`;
8139
- const headers = new HttpHeaders()
8160
+ let headers = new HttpHeaders()
8140
8161
  .set('experimental', 'true')
8141
8162
  .set('Accept', CasesService.V2_MEDIATYPE_CASE_DOCUMENTS)
8142
8163
  .set('Content-Type', 'application/json');
8164
+ headers = this.addClientContextHeader(headers);
8143
8165
  return this.http
8144
- .get(url, { headers, observe: 'body' })
8145
- .pipe(map(body => body.documentResources), catchError(error => {
8166
+ .get(url, { headers, observe: 'response' })
8167
+ .pipe(map((response) => {
8168
+ this.updateClientContextStorage(response.headers);
8169
+ return response.body.documentResources;
8170
+ }), catchError(error => {
8146
8171
  this.errorService.setError(error);
8147
8172
  return throwError(error);
8148
8173
  }));
@@ -8175,17 +8200,6 @@ class CasesService {
8175
8200
  wizardPage.case_fields = this.orderService.sort(this.wizardPageFieldToCaseFieldMapper.mapAll(wizardPage.wizard_page_fields, eventTrigger.case_fields));
8176
8201
  });
8177
8202
  }
8178
- /*
8179
- Checks if the user has role of pui-case-manager and returns true or false
8180
- */
8181
- isPuiCaseManager() {
8182
- const userInfoStr = this.sessionStorageService.getItem('userDetails');
8183
- if (userInfoStr) {
8184
- const userInfo = JSON.parse(userInfoStr);
8185
- return userInfo && userInfo.roles && (userInfo.roles.indexOf(CasesService.PUI_CASE_MANAGER) !== -1);
8186
- }
8187
- return false;
8188
- }
8189
8203
  getCourtOrHearingCentreName(locationId) {
8190
8204
  return this.http.post(`/api/locations/getLocationsById`, { locations: [{ locationId }] });
8191
8205
  }
@@ -8252,6 +8266,25 @@ class CasesService {
8252
8266
  .get(url)
8253
8267
  .pipe(catchError(error => throwError(error)));
8254
8268
  }
8269
+ addClientContextHeader(headers) {
8270
+ const clientContextDetails = this.sessionStorageService.getItem('clientContext');
8271
+ if (clientContextDetails) {
8272
+ // may require URI encoding in certain circumstances
8273
+ const clientContext = window.btoa(clientContextDetails);
8274
+ if (clientContext) {
8275
+ headers = headers.set('Client-Context', clientContext);
8276
+ }
8277
+ }
8278
+ return headers;
8279
+ }
8280
+ updateClientContextStorage(headers) {
8281
+ // for mocking - TODO: Kasi Remove/Uncomment for testing
8282
+ // headers = this.setMockClientContextHeader(headers);
8283
+ if (headers && headers.get('Client-Context')) {
8284
+ const clientContextString = window.atob(headers.get('Client-Context'));
8285
+ this.sessionStorageService.setItem('clientContext', clientContextString);
8286
+ }
8287
+ }
8255
8288
  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)); };
8256
8289
  static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CasesService, factory: CasesService.ɵfac });
8257
8290
  }
@@ -8764,8 +8797,9 @@ class EventCompletionStateMachineService {
8764
8797
  entryActionForStateCompleteEventAndTask(state, context) {
8765
8798
  // Trigger final state to complete processing of state machine
8766
8799
  state.trigger(EventCompletionStates.Final);
8767
- const taskStr = context.sessionStorageService.getItem('taskToComplete');
8768
- if (taskStr) {
8800
+ const clientContextStr = context.sessionStorageService.getItem('clientContext');
8801
+ const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
8802
+ if (userTask?.task_data) {
8769
8803
  context.sessionStorageService.setItem('assignNeeded', 'false');
8770
8804
  // just set event can be completed
8771
8805
  context.component.eventCanBeCompleted.emit(true);
@@ -8784,9 +8818,9 @@ class EventCompletionStateMachineService {
8784
8818
  entryActionForStateTaskUnassigned(state, context) {
8785
8819
  // Trigger final state to complete processing of state machine
8786
8820
  state.trigger(EventCompletionStates.Final);
8787
- // Get task details
8788
- const taskStr = context.sessionStorageService.getItem('taskToComplete');
8789
- if (taskStr) {
8821
+ const clientContextStr = context.sessionStorageService.getItem('clientContext');
8822
+ const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
8823
+ if (userTask?.task_data) {
8790
8824
  context.sessionStorageService.setItem('assignNeeded', 'true');
8791
8825
  context.component.eventCanBeCompleted.emit(true);
8792
8826
  }
@@ -8821,6 +8855,11 @@ class EventCompletionStateMachineService {
8821
8855
  addTransitionsForStateTaskUnassigned() {
8822
8856
  this.stateTaskUnassigned.addTransition(EventCompletionStates.Final, this.stateFinal);
8823
8857
  }
8858
+ taskPresentInSessionStorage(context) {
8859
+ const clientContextStr = context.sessionStorageService.getItem('clientContext');
8860
+ const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
8861
+ return !!userTask.task_data;
8862
+ }
8824
8863
  static ɵfac = function EventCompletionStateMachineService_Factory(t) { return new (t || EventCompletionStateMachineService)(); };
8825
8864
  static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: EventCompletionStateMachineService, factory: EventCompletionStateMachineService.ɵfac });
8826
8865
  }
@@ -8947,8 +8986,14 @@ class WorkAllocationService {
8947
8986
  }
8948
8987
  isWAEnabled(jurisdiction, caseType) {
8949
8988
  this.features = this.appConfig.getWAServiceConfig();
8950
- const ftstr = JSON.stringify(this.features);
8951
- this.appConfig.logMessage(`isWAEnabled: wa-service-config returning ${ftstr.length > 0}`);
8989
+ if (this.features) {
8990
+ const ftstr = JSON.stringify(this.features);
8991
+ this.appConfig?.logMessage(`isWAEnabled: wa-service-config returning ${ftstr?.length > 0}`);
8992
+ }
8993
+ else {
8994
+ this.appConfig?.logMessage(`isWAEnabled: wa-service-config returning no features`);
8995
+ return false;
8996
+ }
8952
8997
  let enabled = false;
8953
8998
  if (!jurisdiction || !caseType) {
8954
8999
  const caseInfo = JSON.parse(this.sessionStorageService.getItem('caseInfo'));
@@ -9330,13 +9375,12 @@ class CaseEditComponent {
9330
9375
  this.isSubmitting = true;
9331
9376
  // We have to run the event completion checks if task in session storage
9332
9377
  // and if the task is in session storage, then is it associated to the case
9333
- let taskInSessionStorage;
9378
+ const clientContextStr = this.sessionStorageService.getItem('clientContext');
9379
+ const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
9380
+ const taskInSessionStorage = userTask ? userTask.task_data : null;
9334
9381
  let taskEventInSessionStorage;
9335
9382
  const taskStr = this.sessionStorageService.getItem('taskToComplete');
9336
9383
  const taskEventStr = this.sessionStorageService.getItem('taskEvent');
9337
- if (taskStr) {
9338
- taskInSessionStorage = JSON.parse(taskStr);
9339
- }
9340
9384
  if (taskEventStr) {
9341
9385
  taskEventInSessionStorage = JSON.parse(taskEventStr);
9342
9386
  }
@@ -9547,15 +9591,15 @@ class CaseEditComponent {
9547
9591
  });
9548
9592
  }
9549
9593
  postCompleteTaskIfRequired() {
9550
- const taskStr = this.sessionStorageService.getItem('taskToComplete');
9594
+ const clientContextStr = this.sessionStorageService.getItem('clientContext');
9595
+ const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
9596
+ const [task, taskToBeCompleted] = userTask ? [userTask.task_data, userTask.complete_task] : [null, false];
9551
9597
  const assignNeeded = this.sessionStorageService.getItem('assignNeeded') === 'true';
9552
- if (taskStr && assignNeeded) {
9553
- const task = JSON.parse(taskStr);
9598
+ if (task && assignNeeded && taskToBeCompleted) {
9554
9599
  this.abstractConfig.logMessage(`postCompleteTaskIfRequired with assignNeeded: taskId ${task.id} and event name ${this.eventTrigger.name}`);
9555
9600
  return this.workAllocationService.assignAndCompleteTask(task.id, this.eventTrigger.name);
9556
9601
  }
9557
- else if (taskStr) {
9558
- const task = JSON.parse(taskStr);
9602
+ else if (task && taskToBeCompleted) {
9559
9603
  this.abstractConfig.logMessage(`postCompleteTaskIfRequired: taskId ${task.id} and event name ${this.eventTrigger.name}`);
9560
9604
  return this.workAllocationService.completeTask(task.id, this.eventTrigger.name);
9561
9605
  }
@@ -11157,8 +11201,12 @@ class CaseEventCompletionTaskReassignedComponent {
11157
11201
  }
11158
11202
  onContinue() {
11159
11203
  // Get task details
11160
- const taskStr = this.sessionStorageService.getItem('taskToComplete');
11161
- if (taskStr) {
11204
+ const clientContextStr = this.sessionStorageService.getItem('clientContext');
11205
+ const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
11206
+ const task = userTask ? userTask.task_data : null;
11207
+ // not complete_task not utilised here as related to event completion
11208
+ // service wanting task associated with event to not be completed not directly relevant
11209
+ if (task) {
11162
11210
  this.sessionStorageService.setItem('assignNeeded', 'true');
11163
11211
  // set event can be completed to true
11164
11212
  this.parentComponent.eventCanBeCompleted.emit(true);
@@ -11182,7 +11230,7 @@ class CaseEventCompletionTaskReassignedComponent {
11182
11230
  type: Inject,
11183
11231
  args: [COMPONENT_PORTAL_INJECTION_TOKEN]
11184
11232
  }] }, { type: i1$1.ActivatedRoute }, { type: WorkAllocationService }, { type: SessionStorageService }, { type: JudicialworkerService }, { type: CaseworkerService }, { type: AlertService }], null); })();
11185
- (() => { (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 }); })();
11233
+ (() => { (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: 19 }); })();
11186
11234
 
11187
11235
  function CaseEventCompletionComponent_ng_template_0_Template(rf, ctx) { }
11188
11236
  const COMPONENT_PORTAL_INJECTION_TOKEN = new InjectionToken('');
@@ -11917,7 +11965,7 @@ function CaseFileViewFieldComponent_div_2_ng_container_8_Template(rf, ctx) { if
11917
11965
  } if (rf & 2) {
11918
11966
  const ctx_r1 = i0.ɵɵnextContext(2);
11919
11967
  i0.ɵɵadvance();
11920
- i0.ɵɵproperty("url", ctx_r1.currentDocument.document_binary_url)("downloadFileName", ctx_r1.currentDocument.document_filename)("showToolbar", true)("contentType", ctx_r1.currentDocument.content_type)("enableAnnotations", true)("enableRedactions", true)("height", "94.5vh")("enableICP", ctx_r1.isIcpEnabled());
11968
+ i0.ɵɵproperty("url", ctx_r1.currentDocument.document_binary_url)("downloadFileName", ctx_r1.currentDocument.document_filename)("showToolbar", true)("contentType", ctx_r1.currentDocument.content_type)("enableAnnotations", true)("enableRedactions", true)("height", "94.5vh")("caseId", ctx_r1.caseId)("enableICP", ctx_r1.isIcpEnabled());
11921
11969
  } }
11922
11970
  function CaseFileViewFieldComponent_div_2_Template(rf, ctx) { if (rf & 1) {
11923
11971
  const _r3 = i0.ɵɵgetCurrentView();
@@ -11929,7 +11977,7 @@ function CaseFileViewFieldComponent_div_2_Template(rf, ctx) { if (rf & 1) {
11929
11977
  i0.ɵɵelementEnd()();
11930
11978
  i0.ɵɵelement(6, "div", 16);
11931
11979
  i0.ɵɵelementStart(7, "div", 17);
11932
- i0.ɵɵtemplate(8, CaseFileViewFieldComponent_div_2_ng_container_8_Template, 2, 8, "ng-container", 0);
11980
+ i0.ɵɵtemplate(8, CaseFileViewFieldComponent_div_2_ng_container_8_Template, 2, 9, "ng-container", 0);
11933
11981
  i0.ɵɵelementEnd()()();
11934
11982
  } if (rf & 2) {
11935
11983
  const ctx_r1 = i0.ɵɵnextContext();
@@ -11958,6 +12006,7 @@ class CaseFileViewFieldComponent {
11958
12006
  caseField;
11959
12007
  icp_jurisdictions = [];
11960
12008
  icpEnabled = false;
12009
+ caseId;
11961
12010
  constructor(elementRef, route, caseFileViewService, documentManagementService, loadingService, sessionStorageService, caseNotifier, abstractConfig) {
11962
12011
  this.elementRef = elementRef;
11963
12012
  this.route = route;
@@ -11969,8 +12018,8 @@ class CaseFileViewFieldComponent {
11969
12018
  this.abstractConfig = abstractConfig;
11970
12019
  }
11971
12020
  ngOnInit() {
11972
- const cid = this.route.snapshot.paramMap.get(CaseFileViewFieldComponent.PARAM_CASE_ID);
11973
- this.categoriesAndDocuments$ = this.caseFileViewService.getCategoriesAndDocuments(cid);
12021
+ this.caseId = this.route.snapshot.paramMap.get(CaseFileViewFieldComponent.PARAM_CASE_ID);
12022
+ this.categoriesAndDocuments$ = this.caseFileViewService.getCategoriesAndDocuments(this.caseId);
11974
12023
  this.categoriesAndDocumentsSubscription = this.categoriesAndDocuments$.subscribe({
11975
12024
  next: data => {
11976
12025
  this.caseVersion = data.case_version;
@@ -12047,7 +12096,7 @@ class CaseFileViewFieldComponent {
12047
12096
  return this.icpEnabled && ((this.icp_jurisdictions?.length < 1) || this.icp_jurisdictions.includes(this.caseNotifier?.cachedCaseView?.case_type?.jurisdiction.id));
12048
12097
  }
12049
12098
  static ɵfac = function CaseFileViewFieldComponent_Factory(t) { return new (t || CaseFileViewFieldComponent)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(CaseFileViewService), i0.ɵɵdirectiveInject(DocumentManagementService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(AbstractAppConfig)); };
12050
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseFileViewFieldComponent, selectors: [["ccd-case-file-view-field"]], decls: 3, vars: 3, consts: [[4, "ngIf"], ["class", "govuk-grid-column-two-thirds", 4, "ngIf"], ["id", "case-file-view-field-errors", "data-module", "govuk-error-summary", 1, "govuk-error-summary", "govuk-!-margin-bottom-4"], ["role", "alert"], [1, "govuk-error-summary__title"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [4, "ngFor", "ngForOf"], ["href", "javascript:void(0);"], [1, "govuk-grid-column-two-thirds"], [1, "govuk-heading-xl"], [1, "govuk-body"], [1, "govuk-heading-l"], ["id", "case-file-view", 1, "govuk-form-group"], [1, "document-tree-container"], [1, "document-tree-container__tree", 3, "clickedDocument", "moveDocument", "categoriesAndDocuments", "allowMoving"], [1, "slider"], [1, "media-viewer-container"], [3, "url", "downloadFileName", "showToolbar", "contentType", "enableAnnotations", "enableRedactions", "height", "enableICP"]], template: function CaseFileViewFieldComponent_Template(rf, ctx) { if (rf & 1) {
12099
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseFileViewFieldComponent, selectors: [["ccd-case-file-view-field"]], decls: 3, vars: 3, consts: [[4, "ngIf"], ["class", "govuk-grid-column-two-thirds", 4, "ngIf"], ["id", "case-file-view-field-errors", "data-module", "govuk-error-summary", 1, "govuk-error-summary", "govuk-!-margin-bottom-4"], ["role", "alert"], [1, "govuk-error-summary__title"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [4, "ngFor", "ngForOf"], ["href", "javascript:void(0);"], [1, "govuk-grid-column-two-thirds"], [1, "govuk-heading-xl"], [1, "govuk-body"], [1, "govuk-heading-l"], ["id", "case-file-view", 1, "govuk-form-group"], [1, "document-tree-container"], [1, "document-tree-container__tree", 3, "clickedDocument", "moveDocument", "categoriesAndDocuments", "allowMoving"], [1, "slider"], [1, "media-viewer-container"], [3, "url", "downloadFileName", "showToolbar", "contentType", "enableAnnotations", "enableRedactions", "height", "caseId", "enableICP"]], template: function CaseFileViewFieldComponent_Template(rf, ctx) { if (rf & 1) {
12051
12100
  i0.ɵɵtemplate(0, CaseFileViewFieldComponent_ng_container_0_Template, 8, 1, "ng-container", 0)(1, CaseFileViewFieldComponent_div_1_Template, 5, 0, "div", 1)(2, CaseFileViewFieldComponent_div_2_Template, 9, 3, "div", 0);
12052
12101
  } if (rf & 2) {
12053
12102
  i0.ɵɵproperty("ngIf", ctx.errorMessages == null ? null : ctx.errorMessages.length);
@@ -12059,7 +12108,7 @@ class CaseFileViewFieldComponent {
12059
12108
  }
12060
12109
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseFileViewFieldComponent, [{
12061
12110
  type: Component,
12062
- args: [{ selector: 'ccd-case-file-view-field', template: "<ng-container *ngIf=\"errorMessages?.length\">\n <div\n id=\"case-file-view-field-errors\"\n class=\"govuk-error-summary govuk-!-margin-bottom-4\" data-module=\"govuk-error-summary\">\n <div role=\"alert\">\n <h2 class=\"govuk-error-summary__title\">\n There is a problem\n </h2>\n <div class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li *ngFor=\"let errorMessage of errorMessages\">\n <a href=\"javascript:void(0);\">{{ errorMessage }}</a>\n </li>\n </ul>\n </div>\n </div>\n </div>\n</ng-container>\n\n<div *ngIf=\"getCategoriesAndDocumentsError\" class=\"govuk-grid-column-two-thirds\">\n <h1 class=\"govuk-heading-xl\">Sorry, there is a problem with the service</h1>\n <p class=\"govuk-body\">Try again later.</p>\n</div>\n<div *ngIf=\"!getCategoriesAndDocumentsError\">\n <h2 class=\"govuk-heading-l\">Case file</h2>\n <div class=\"govuk-form-group\" id=\"case-file-view\">\n <!-- Document tree -->\n <div class=\"document-tree-container\">\n <ccd-case-file-view-folder\n class=\"document-tree-container__tree\"\n [categoriesAndDocuments]=\"categoriesAndDocuments$\"\n (clickedDocument)=\"setMediaViewerFile($event); resetErrorMessages()\"\n (moveDocument)=\"moveDocument($event)\"\n [allowMoving]=\"allowMoving\"\n ></ccd-case-file-view-folder>\n </div>\n <!-- Slider -->\n <div class=\"slider\"></div>\n <!-- Media viewer -->\n <div class=\"media-viewer-container\">\n <ng-container *ngIf=\"currentDocument\">\n <mv-media-viewer [url]=\"currentDocument.document_binary_url\"\n [downloadFileName]=\"currentDocument.document_filename\"\n [showToolbar]=\"true\"\n [contentType]=\"currentDocument.content_type\"\n [enableAnnotations]=\"true\"\n [enableRedactions]=\"true\"\n [height]=\"'94.5vh'\"\n [enableICP]=\"isIcpEnabled()\">\n </mv-media-viewer>\n </ng-container>\n </div>\n </div>\n</div>\n", styles: ["#case-file-view{display:flex;border:2px solid #C9C9C9;height:100vh;position:relative}#case-file-view .document-tree-container{background-color:#faf8f8;width:30%;min-height:400px;min-width:10%}#case-file-view .slider{width:.2%;background-color:#6b6b6b}#case-file-view .slider:hover,#case-file-view .slider:focus{cursor:col-resize}#case-file-view .media-viewer-container{background-color:#dee0e2;flex:1 1 0;overflow:hidden}\n"] }]
12111
+ args: [{ selector: 'ccd-case-file-view-field', template: "<ng-container *ngIf=\"errorMessages?.length\">\n <div\n id=\"case-file-view-field-errors\"\n class=\"govuk-error-summary govuk-!-margin-bottom-4\" data-module=\"govuk-error-summary\">\n <div role=\"alert\">\n <h2 class=\"govuk-error-summary__title\">\n There is a problem\n </h2>\n <div class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li *ngFor=\"let errorMessage of errorMessages\">\n <a href=\"javascript:void(0);\">{{ errorMessage }}</a>\n </li>\n </ul>\n </div>\n </div>\n </div>\n</ng-container>\n\n<div *ngIf=\"getCategoriesAndDocumentsError\" class=\"govuk-grid-column-two-thirds\">\n <h1 class=\"govuk-heading-xl\">Sorry, there is a problem with the service</h1>\n <p class=\"govuk-body\">Try again later.</p>\n</div>\n<div *ngIf=\"!getCategoriesAndDocumentsError\">\n <h2 class=\"govuk-heading-l\">Case file</h2>\n <div class=\"govuk-form-group\" id=\"case-file-view\">\n <!-- Document tree -->\n <div class=\"document-tree-container\">\n <ccd-case-file-view-folder\n class=\"document-tree-container__tree\"\n [categoriesAndDocuments]=\"categoriesAndDocuments$\"\n (clickedDocument)=\"setMediaViewerFile($event); resetErrorMessages()\"\n (moveDocument)=\"moveDocument($event)\"\n [allowMoving]=\"allowMoving\"\n ></ccd-case-file-view-folder>\n </div>\n <!-- Slider -->\n <div class=\"slider\"></div>\n <!-- Media viewer -->\n <div class=\"media-viewer-container\">\n <ng-container *ngIf=\"currentDocument\">\n <mv-media-viewer [url]=\"currentDocument.document_binary_url\"\n [downloadFileName]=\"currentDocument.document_filename\"\n [showToolbar]=\"true\"\n [contentType]=\"currentDocument.content_type\"\n [enableAnnotations]=\"true\"\n [enableRedactions]=\"true\"\n [height]=\"'94.5vh'\"\n [caseId]=\"caseId\"\n [enableICP]=\"isIcpEnabled()\">\n </mv-media-viewer>\n </ng-container>\n </div>\n </div>\n</div>\n", styles: ["#case-file-view{display:flex;border:2px solid #C9C9C9;height:100vh;position:relative}#case-file-view .document-tree-container{background-color:#faf8f8;width:30%;min-height:400px;min-width:10%}#case-file-view .slider{width:.2%;background-color:#6b6b6b}#case-file-view .slider:hover,#case-file-view .slider:focus{cursor:col-resize}#case-file-view .media-viewer-container{background-color:#dee0e2;flex:1 1 0;overflow:hidden}\n"] }]
12063
12112
  }], () => [{ type: i0.ElementRef }, { type: i1$1.ActivatedRoute }, { type: CaseFileViewService }, { type: DocumentManagementService }, { type: LoadingService }, { type: SessionStorageService }, { type: CaseNotifier }, { type: AbstractAppConfig }], null); })();
12064
12113
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseFileViewFieldComponent, { className: "CaseFileViewFieldComponent", filePath: "lib/shared/components/palette/case-file-view/case-file-view-field.component.ts", lineNumber: 17 }); })();
12065
12114
 
@@ -22387,10 +22436,11 @@ function CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_4_Template(rf, c
22387
22436
  i0.ɵɵelement(6, "br");
22388
22437
  i0.ɵɵelementStart(7, "span", 17);
22389
22438
  i0.ɵɵtext(8);
22390
- i0.ɵɵpipe(9, "date");
22439
+ i0.ɵɵpipe(9, "ccdDate");
22440
+ i0.ɵɵpipe(10, "date");
22391
22441
  i0.ɵɵelementEnd()();
22392
- i0.ɵɵelementStart(10, "div", 18)(11, "ccd-case-file-view-folder-document-actions", 19);
22393
- i0.ɵɵlistener("changeFolderAction", function CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_4_Template_ccd_case_file_view_folder_document_actions_changeFolderAction_11_listener() { const node_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.triggerDocumentAction("changeFolder", node_r2)); })("openInANewTabAction", function CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_4_Template_ccd_case_file_view_folder_document_actions_openInANewTabAction_11_listener() { const node_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.triggerDocumentAction("openInANewTab", node_r2)); })("downloadAction", function CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_4_Template_ccd_case_file_view_folder_document_actions_downloadAction_11_listener() { const node_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.triggerDocumentAction("download", node_r2)); })("printAction", function CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_4_Template_ccd_case_file_view_folder_document_actions_printAction_11_listener() { const node_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.triggerDocumentAction("print", node_r2)); });
22442
+ i0.ɵɵelementStart(11, "div", 18)(12, "ccd-case-file-view-folder-document-actions", 19);
22443
+ i0.ɵɵlistener("changeFolderAction", function CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_4_Template_ccd_case_file_view_folder_document_actions_changeFolderAction_12_listener() { const node_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.triggerDocumentAction("changeFolder", node_r2)); })("openInANewTabAction", function CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_4_Template_ccd_case_file_view_folder_document_actions_openInANewTabAction_12_listener() { const node_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.triggerDocumentAction("openInANewTab", node_r2)); })("downloadAction", function CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_4_Template_ccd_case_file_view_folder_document_actions_downloadAction_12_listener() { const node_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.triggerDocumentAction("download", node_r2)); })("printAction", function CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_4_Template_ccd_case_file_view_folder_document_actions_printAction_12_listener() { const node_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.triggerDocumentAction("print", node_r2)); });
22394
22444
  i0.ɵɵelementEnd()()()();
22395
22445
  } if (rf & 2) {
22396
22446
  const node_r2 = ctx.$implicit;
@@ -22400,8 +22450,8 @@ function CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_4_Template(rf, c
22400
22450
  i0.ɵɵadvance(4);
22401
22451
  i0.ɵɵtextInterpolate1(" ", node_r2.name, " ");
22402
22452
  i0.ɵɵadvance(3);
22403
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(9, 5, node_r2.upload_timestamp, "dd MMM YYYY HH:mm"));
22404
- i0.ɵɵadvance(3);
22453
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(10, 8, i0.ɵɵpipeBind2(9, 5, node_r2.upload_timestamp, "local"), "dd MMM YYYY HH:mm"));
22454
+ i0.ɵɵadvance(4);
22405
22455
  i0.ɵɵproperty("allowMoving", ctx_r2.allowMoving);
22406
22456
  } }
22407
22457
  function CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_5_Template(rf, ctx) { if (rf & 1) {
@@ -22434,7 +22484,7 @@ function CaseFileViewFolderComponent_div_8_Template(rf, ctx) { if (rf & 1) {
22434
22484
  i0.ɵɵelementStart(0, "div", 7);
22435
22485
  i0.ɵɵtemplate(1, CaseFileViewFolderComponent_div_8_div_1_Template, 2, 0, "div", 8);
22436
22486
  i0.ɵɵelementStart(2, "div")(3, "cdk-tree", 9);
22437
- i0.ɵɵtemplate(4, CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_4_Template, 12, 8, "cdk-nested-tree-node", 10)(5, CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_5_Template, 10, 6, "cdk-nested-tree-node", 11);
22487
+ i0.ɵɵtemplate(4, CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_4_Template, 13, 11, "cdk-nested-tree-node", 10)(5, CaseFileViewFolderComponent_div_8_cdk_nested_tree_node_5_Template, 10, 6, "cdk-nested-tree-node", 11);
22438
22488
  i0.ɵɵelementEnd()()();
22439
22489
  } if (rf & 2) {
22440
22490
  const ctx_r2 = i0.ɵɵnextContext();
@@ -22541,7 +22591,7 @@ class CaseFileViewFolderComponent {
22541
22591
  documentTreeNode.document_binary_url = document.document_binary_url;
22542
22592
  documentTreeNode.attribute_path = document.attribute_path;
22543
22593
  documentTreeNode.upload_timestamp = this.appConfig.getEnableCaseFileViewVersion1_1()
22544
- && document.upload_timestamp ? moment$1(document.upload_timestamp).format('DD MMM YYYY HH:mm:ss') : '';
22594
+ && document.upload_timestamp ? document.upload_timestamp.toString() : '';
22545
22595
  documentsToReturn.push(documentTreeNode);
22546
22596
  });
22547
22597
  return documentsToReturn;
@@ -22556,7 +22606,7 @@ class CaseFileViewFolderComponent {
22556
22606
  documentTreeNode.document_binary_url = document.document_binary_url;
22557
22607
  documentTreeNode.attribute_path = document.attribute_path;
22558
22608
  documentTreeNode.upload_timestamp = this.appConfig.getEnableCaseFileViewVersion1_1()
22559
- && document.upload_timestamp ? moment$1(document.upload_timestamp).format('DD MMM YYYY HH:mm:ss') : '';
22609
+ && document.upload_timestamp ? document.upload_timestamp.toString() : '';
22560
22610
  documents.push(documentTreeNode);
22561
22611
  });
22562
22612
  const uncategorisedNode = new DocumentTreeNode();
@@ -22690,11 +22740,11 @@ class CaseFileViewFolderComponent {
22690
22740
  i0.ɵɵtextInterpolate1("Documents (", ctx.documentCount, ")");
22691
22741
  i0.ɵɵadvance(3);
22692
22742
  i0.ɵɵproperty("ngIf", ctx.documentTreeData);
22693
- } }, dependencies: [i5.NgIf, i4.DefaultValueAccessor, i4.NgControlStatus, i4.NgControlStatusGroup, i4.FormGroupDirective, i4.FormControlName, i7.CdkNestedTreeNode, i7.CdkTreeNodeDef, i7.CdkTreeNodeToggle, i7.CdkTree, i7.CdkTreeNodeOutlet, CaseFileViewFolderSortComponent, CaseFileViewFolderDocumentActionsComponent, i5.DatePipe], styles: ["[_nghost-%COMP%]{display:flex;height:100%;flex-direction:column}[_nghost-%COMP%] .document-tree-container[_ngcontent-%COMP%]{flex:1 0}.document-filter-container[_ngcontent-%COMP%]{border-bottom:2px solid #C9C9C9}.document-filter-container[_ngcontent-%COMP%] .document-filter[_ngcontent-%COMP%]{padding:10px}.document-filter-container[_ngcontent-%COMP%] .document-filter[_ngcontent-%COMP%] .document-search[_ngcontent-%COMP%]{background:url(/assets/images/icon-search-black.svg) no-repeat right #fff;background-position-x:calc(100% - 4px);padding-right:30px;width:100%}.document-filter-container[_ngcontent-%COMP%] .documents-title[_ngcontent-%COMP%]{height:30%;margin-left:8px;font-weight:700}.document-tree-container[_ngcontent-%COMP%]{padding:4px;overflow-x:hidden;overflow-y:scroll}.document-tree-container__node[_ngcontent-%COMP%]{display:block}.document-tree-container__node[_ngcontent-%COMP%] .document-tree-container__node[_ngcontent-%COMP%]{padding-left:40px}.document-tree-container[_ngcontent-%COMP%] .document-tree-invisible[_ngcontent-%COMP%]{display:none}.document-tree-container[_ngcontent-%COMP%]::-webkit-scrollbar{width:7px}.document-tree-container[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border:4px solid rgba(0,0,0,0);background-clip:padding-box;border-radius:9999px;background-color:#aaa}.document-tree-container[_ngcontent-%COMP%]::-webkit-scrollbar-button{display:none}.document-tree-container[_ngcontent-%COMP%]::-webkit-scrollbar-track-piece{background:#eee}.document-tree-container[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#ccc}.document-folders-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;border-bottom:2px solid #C9C9C9;padding:10px}.document-folders-header__title[_ngcontent-%COMP%]{font-weight:700}.node[_ngcontent-%COMP%]{display:flex;align-items:center;width:100%;padding:10px;background:none;border:0;cursor:pointer;white-space:nowrap}.node--selected[_ngcontent-%COMP%]{background:#fff2cc}.node__icon[_ngcontent-%COMP%]{position:relative;display:inline-block}.node__count[_ngcontent-%COMP%]{color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:.875rem;padding-top:4px}.node__iconImg[_ngcontent-%COMP%]{display:block;height:30px;width:30px}.node__name[_ngcontent-%COMP%]{margin-left:6px;font-size:1rem;overflow:hidden;text-overflow:ellipsis}.node__document-options[_ngcontent-%COMP%]{margin-left:auto;margin-right:0}.node__document-upload-timestamp[_ngcontent-%COMP%]{font-size:.8rem;float:left;padding-left:10px}"] });
22743
+ } }, dependencies: [i5.NgIf, i4.DefaultValueAccessor, i4.NgControlStatus, i4.NgControlStatusGroup, i4.FormGroupDirective, i4.FormControlName, i7.CdkNestedTreeNode, i7.CdkTreeNodeDef, i7.CdkTreeNodeToggle, i7.CdkTree, i7.CdkTreeNodeOutlet, CaseFileViewFolderSortComponent, CaseFileViewFolderDocumentActionsComponent, i5.DatePipe, DatePipe], styles: ["[_nghost-%COMP%]{display:flex;height:100%;flex-direction:column}[_nghost-%COMP%] .document-tree-container[_ngcontent-%COMP%]{flex:1 0}.document-filter-container[_ngcontent-%COMP%]{border-bottom:2px solid #C9C9C9}.document-filter-container[_ngcontent-%COMP%] .document-filter[_ngcontent-%COMP%]{padding:10px}.document-filter-container[_ngcontent-%COMP%] .document-filter[_ngcontent-%COMP%] .document-search[_ngcontent-%COMP%]{background:url(/assets/images/icon-search-black.svg) no-repeat right #fff;background-position-x:calc(100% - 4px);padding-right:30px;width:100%}.document-filter-container[_ngcontent-%COMP%] .documents-title[_ngcontent-%COMP%]{height:30%;margin-left:8px;font-weight:700}.document-tree-container[_ngcontent-%COMP%]{padding:4px;overflow-x:hidden;overflow-y:scroll}.document-tree-container__node[_ngcontent-%COMP%]{display:block}.document-tree-container__node[_ngcontent-%COMP%] .document-tree-container__node[_ngcontent-%COMP%]{padding-left:40px}.document-tree-container[_ngcontent-%COMP%] .document-tree-invisible[_ngcontent-%COMP%]{display:none}.document-tree-container[_ngcontent-%COMP%]::-webkit-scrollbar{width:7px}.document-tree-container[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border:4px solid rgba(0,0,0,0);background-clip:padding-box;border-radius:9999px;background-color:#aaa}.document-tree-container[_ngcontent-%COMP%]::-webkit-scrollbar-button{display:none}.document-tree-container[_ngcontent-%COMP%]::-webkit-scrollbar-track-piece{background:#eee}.document-tree-container[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#ccc}.document-folders-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;border-bottom:2px solid #C9C9C9;padding:10px}.document-folders-header__title[_ngcontent-%COMP%]{font-weight:700}.node[_ngcontent-%COMP%]{display:flex;align-items:center;width:100%;padding:10px;background:none;border:0;cursor:pointer;white-space:nowrap}.node--selected[_ngcontent-%COMP%]{background:#fff2cc}.node__icon[_ngcontent-%COMP%]{position:relative;display:inline-block}.node__count[_ngcontent-%COMP%]{color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:.875rem;padding-top:4px}.node__iconImg[_ngcontent-%COMP%]{display:block;height:30px;width:30px}.node__name[_ngcontent-%COMP%]{margin-left:6px;font-size:1rem;overflow:hidden;text-overflow:ellipsis}.node__document-options[_ngcontent-%COMP%]{margin-left:auto;margin-right:0}.node__document-upload-timestamp[_ngcontent-%COMP%]{font-size:.8rem;float:left;padding-left:10px}"] });
22694
22744
  }
22695
22745
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseFileViewFolderComponent, [{
22696
22746
  type: Component,
22697
- args: [{ selector: 'ccd-case-file-view-folder', template: "<div class=\"document-filter-container\">\n <div class=\"form-group document-filter\" [formGroup]=\"documentFilterFormGroup\">\n <input class=\"form-control document-search\"\n type=\"search\"\n id=\"document-search\"\n name=\"documentSearchFormControl\"\n formControlName=\"documentSearchFormControl\"\n placeholder=\"Search by document name\"\n aria-label=\"Search by document name\">\n </div>\n</div>\n\n<div class=\"document-folders-header\">\n <div class=\"document-folders-header__title\">Documents ({{ documentCount }})</div>\n <div>\n <ccd-case-file-view-folder-sort\n (sortAscending)=\"sortDataSourceAscending($event)\"\n (sortDescending)=\"sortDataSourceDescending($event)\"\n ></ccd-case-file-view-folder-sort>\n </div>\n</div>\n\n<div class=\"document-tree-container\" *ngIf=\"documentTreeData\">\n <div *ngIf=\"!nestedDataSource || nestedDataSource.length === 0\">\n No results found\n </div>\n <div>\n <cdk-tree [dataSource]=\"nestedDataSource\" [treeControl]=\"nestedTreeControl\">\n <!-- document -->\n <cdk-nested-tree-node class=\"document-tree-container__node document-tree-container__node--document\" *cdkTreeNodeDef=\"let node\">\n <button class=\"node\" (click)=\"selectedNodeItem = node; clickedDocument.emit(node)\"\n [class.node--selected]=\"selectedNodeItem?.name === node.name\">\n <div class=\"node__icon\" disabled>\n <img src=\"/assets/img/case-file-view/case-file-view-document.svg\" class=\"node__iconImg\" alt=\"Document icon\">\n </div>\n <span class=\"node__name node-name-document\">\n {{node.name}}\n <br>\n <span class=\"node__document-upload-timestamp\">{{node.upload_timestamp | date:\"dd MMM YYYY HH:mm\"}}</span>\n </span>\n <div class=\"node__document-options\">\n <ccd-case-file-view-folder-document-actions\n (changeFolderAction)=\"triggerDocumentAction('changeFolder', node)\"\n (openInANewTabAction)=\"triggerDocumentAction('openInANewTab', node)\"\n (downloadAction)=\"triggerDocumentAction('download', node)\"\n (printAction)=\"triggerDocumentAction('print', node)\"\n [allowMoving]=\"allowMoving\"\n >\n </ccd-case-file-view-folder-document-actions>\n </div>\n </button>\n </cdk-nested-tree-node>\n <!-- folder-->\n <cdk-nested-tree-node class=\"document-tree-container__node document-tree-container__folder\" *cdkTreeNodeDef=\"let node; when: nestedChildren\">\n <button class=\"node\" cdkTreeNodeToggle>\n <div class=\"node__icon\" [attr.aria-label]=\"'toggle ' + node.name\" >\n <img class=\"node__iconImg\"\n [src]=\"nestedTreeControl.isExpanded(node) ? '/assets/images/folder-open.png' : '/assets/images/folder.png'\" alt=\"Folder icon\">\n <span class=\"node__count\">{{node.childDocumentCount}}</span>\n </div>\n <span class=\"node__name node__name--folder\">{{node.name}}</span>\n </button>\n\n <div [class.document-tree-invisible]=\"!nestedTreeControl.isExpanded(node)\">\n <ng-container cdkTreeNodeOutlet></ng-container>\n </div>\n </cdk-nested-tree-node>\n </cdk-tree>\n </div>\n</div>\n", styles: [":host{display:flex;height:100%;flex-direction:column}:host .document-tree-container{flex:1 0}.document-filter-container{border-bottom:2px solid #C9C9C9}.document-filter-container .document-filter{padding:10px}.document-filter-container .document-filter .document-search{background:url(/assets/images/icon-search-black.svg) no-repeat right #fff;background-position-x:calc(100% - 4px);padding-right:30px;width:100%}.document-filter-container .documents-title{height:30%;margin-left:8px;font-weight:700}.document-tree-container{padding:4px;overflow-x:hidden;overflow-y:scroll}.document-tree-container__node{display:block}.document-tree-container__node .document-tree-container__node{padding-left:40px}.document-tree-container .document-tree-invisible{display:none}.document-tree-container::-webkit-scrollbar{width:7px}.document-tree-container::-webkit-scrollbar-thumb{border:4px solid rgba(0,0,0,0);background-clip:padding-box;border-radius:9999px;background-color:#aaa}.document-tree-container::-webkit-scrollbar-button{display:none}.document-tree-container::-webkit-scrollbar-track-piece{background:#eee}.document-tree-container::-webkit-scrollbar-thumb{background:#ccc}.document-folders-header{display:flex;align-items:center;justify-content:space-between;border-bottom:2px solid #C9C9C9;padding:10px}.document-folders-header__title{font-weight:700}.node{display:flex;align-items:center;width:100%;padding:10px;background:none;border:0;cursor:pointer;white-space:nowrap}.node--selected{background:#fff2cc}.node__icon{position:relative;display:inline-block}.node__count{color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:.875rem;padding-top:4px}.node__iconImg{display:block;height:30px;width:30px}.node__name{margin-left:6px;font-size:1rem;overflow:hidden;text-overflow:ellipsis}.node__document-options{margin-left:auto;margin-right:0}.node__document-upload-timestamp{font-size:.8rem;float:left;padding-left:10px}\n"] }]
22747
+ args: [{ selector: 'ccd-case-file-view-folder', template: "<div class=\"document-filter-container\">\n <div class=\"form-group document-filter\" [formGroup]=\"documentFilterFormGroup\">\n <input class=\"form-control document-search\"\n type=\"search\"\n id=\"document-search\"\n name=\"documentSearchFormControl\"\n formControlName=\"documentSearchFormControl\"\n placeholder=\"Search by document name\"\n aria-label=\"Search by document name\">\n </div>\n</div>\n\n<div class=\"document-folders-header\">\n <div class=\"document-folders-header__title\">Documents ({{ documentCount }})</div>\n <div>\n <ccd-case-file-view-folder-sort\n (sortAscending)=\"sortDataSourceAscending($event)\"\n (sortDescending)=\"sortDataSourceDescending($event)\"\n ></ccd-case-file-view-folder-sort>\n </div>\n</div>\n\n<div class=\"document-tree-container\" *ngIf=\"documentTreeData\">\n <div *ngIf=\"!nestedDataSource || nestedDataSource.length === 0\">\n No results found\n </div>\n <div>\n <cdk-tree [dataSource]=\"nestedDataSource\" [treeControl]=\"nestedTreeControl\">\n <!-- document -->\n <cdk-nested-tree-node class=\"document-tree-container__node document-tree-container__node--document\" *cdkTreeNodeDef=\"let node\">\n <button class=\"node\" (click)=\"selectedNodeItem = node; clickedDocument.emit(node)\"\n [class.node--selected]=\"selectedNodeItem?.name === node.name\">\n <div class=\"node__icon\" disabled>\n <img src=\"/assets/img/case-file-view/case-file-view-document.svg\" class=\"node__iconImg\" alt=\"Document icon\">\n </div>\n <span class=\"node__name node-name-document\">\n {{node.name}}\n <br>\n <span class=\"node__document-upload-timestamp\">{{node.upload_timestamp | ccdDate : 'local' | date:\"dd MMM YYYY HH:mm\"}}</span>\n </span>\n <div class=\"node__document-options\">\n <ccd-case-file-view-folder-document-actions\n (changeFolderAction)=\"triggerDocumentAction('changeFolder', node)\"\n (openInANewTabAction)=\"triggerDocumentAction('openInANewTab', node)\"\n (downloadAction)=\"triggerDocumentAction('download', node)\"\n (printAction)=\"triggerDocumentAction('print', node)\"\n [allowMoving]=\"allowMoving\"\n >\n </ccd-case-file-view-folder-document-actions>\n </div>\n </button>\n </cdk-nested-tree-node>\n <!-- folder-->\n <cdk-nested-tree-node class=\"document-tree-container__node document-tree-container__folder\" *cdkTreeNodeDef=\"let node; when: nestedChildren\">\n <button class=\"node\" cdkTreeNodeToggle>\n <div class=\"node__icon\" [attr.aria-label]=\"'toggle ' + node.name\" >\n <img class=\"node__iconImg\"\n [src]=\"nestedTreeControl.isExpanded(node) ? '/assets/images/folder-open.png' : '/assets/images/folder.png'\" alt=\"Folder icon\">\n <span class=\"node__count\">{{node.childDocumentCount}}</span>\n </div>\n <span class=\"node__name node__name--folder\">{{node.name}}</span>\n </button>\n\n <div [class.document-tree-invisible]=\"!nestedTreeControl.isExpanded(node)\">\n <ng-container cdkTreeNodeOutlet></ng-container>\n </div>\n </cdk-nested-tree-node>\n </cdk-tree>\n </div>\n</div>\n", styles: [":host{display:flex;height:100%;flex-direction:column}:host .document-tree-container{flex:1 0}.document-filter-container{border-bottom:2px solid #C9C9C9}.document-filter-container .document-filter{padding:10px}.document-filter-container .document-filter .document-search{background:url(/assets/images/icon-search-black.svg) no-repeat right #fff;background-position-x:calc(100% - 4px);padding-right:30px;width:100%}.document-filter-container .documents-title{height:30%;margin-left:8px;font-weight:700}.document-tree-container{padding:4px;overflow-x:hidden;overflow-y:scroll}.document-tree-container__node{display:block}.document-tree-container__node .document-tree-container__node{padding-left:40px}.document-tree-container .document-tree-invisible{display:none}.document-tree-container::-webkit-scrollbar{width:7px}.document-tree-container::-webkit-scrollbar-thumb{border:4px solid rgba(0,0,0,0);background-clip:padding-box;border-radius:9999px;background-color:#aaa}.document-tree-container::-webkit-scrollbar-button{display:none}.document-tree-container::-webkit-scrollbar-track-piece{background:#eee}.document-tree-container::-webkit-scrollbar-thumb{background:#ccc}.document-folders-header{display:flex;align-items:center;justify-content:space-between;border-bottom:2px solid #C9C9C9;padding:10px}.document-folders-header__title{font-weight:700}.node{display:flex;align-items:center;width:100%;padding:10px;background:none;border:0;cursor:pointer;white-space:nowrap}.node--selected{background:#fff2cc}.node__icon{position:relative;display:inline-block}.node__count{color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:.875rem;padding-top:4px}.node__iconImg{display:block;height:30px;width:30px}.node__name{margin-left:6px;font-size:1rem;overflow:hidden;text-overflow:ellipsis}.node__document-options{margin-left:auto;margin-right:0}.node__document-upload-timestamp{font-size:.8rem;float:left;padding-left:10px}\n"] }]
22698
22748
  }], () => [{ type: WindowService }, { type: i1$1.Router }, { type: DocumentManagementService }, { type: i1$3.MatLegacyDialog }, { type: AbstractAppConfig }], { categoriesAndDocuments: [{
22699
22749
  type: Input
22700
22750
  }], allowMoving: [{
@@ -22704,7 +22754,7 @@ class CaseFileViewFolderComponent {
22704
22754
  }], moveDocument: [{
22705
22755
  type: Output
22706
22756
  }] }); })();
22707
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseFileViewFolderComponent, { className: "CaseFileViewFolderComponent", filePath: "lib/shared/components/palette/case-file-view/components/case-file-view-folder/case-file-view-folder.component.ts", lineNumber: 28 }); })();
22757
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseFileViewFolderComponent, { className: "CaseFileViewFolderComponent", filePath: "lib/shared/components/palette/case-file-view/components/case-file-view-folder/case-file-view-folder.component.ts", lineNumber: 27 }); })();
22708
22758
 
22709
22759
  const _c0$s = a0 => ({ "form-group-error": a0 });
22710
22760
  function AddCommentsComponent_span_7_Template(rf, ctx) { if (rf & 1) {
@@ -33552,7 +33602,7 @@ class EventStartGuard {
33552
33602
  workAllocationService;
33553
33603
  router;
33554
33604
  sessionStorageService;
33555
- static TASK_TO_COMPLETE = 'taskToComplete';
33605
+ static CLIENT_CONTEXT = 'clientContext';
33556
33606
  constructor(workAllocationService, router, sessionStorageService) {
33557
33607
  this.workAllocationService = workAllocationService;
33558
33608
  this.router = router;
@@ -33603,18 +33653,26 @@ class EventStartGuard {
33603
33653
  task = tasksAssignedToUser[0];
33604
33654
  }
33605
33655
  // if one task assigned to user, allow user to complete event
33606
- this.sessionStorageService.setItem(EventStartGuard.TASK_TO_COMPLETE, JSON.stringify(task));
33656
+ const storeClientContext = {
33657
+ client_context: {
33658
+ user_task: {
33659
+ task_data: task,
33660
+ complete_task: true
33661
+ }
33662
+ }
33663
+ };
33664
+ this.sessionStorageService.setItem(EventStartGuard.CLIENT_CONTEXT, JSON.stringify(storeClientContext));
33607
33665
  return true;
33608
33666
  }
33609
33667
  }
33610
33668
  removeTaskFromSessionStorage() {
33611
- this.sessionStorageService.removeItem(EventStartGuard.TASK_TO_COMPLETE);
33669
+ this.sessionStorageService.removeItem(EventStartGuard.CLIENT_CONTEXT);
33612
33670
  }
33613
33671
  checkForTasks(payload, caseId, eventId, taskId) {
33614
33672
  if (taskId && payload?.tasks?.length > 0) {
33615
33673
  const task = payload.tasks.find((t) => t.id == taskId);
33616
33674
  if (task) {
33617
- this.sessionStorageService.setItem(EventStartGuard.TASK_TO_COMPLETE, JSON.stringify(task));
33675
+ this.sessionStorageService.setItem(EventStartGuard.CLIENT_CONTEXT, JSON.stringify(task));
33618
33676
  }
33619
33677
  else {
33620
33678
  this.removeTaskFromSessionStorage();
@@ -33782,9 +33840,17 @@ class EventStartStateMachineService {
33782
33840
  task = context.tasks[0];
33783
33841
  }
33784
33842
  const taskStr = JSON.stringify(task);
33785
- console.log('entryActionForStateOneTaskAssignedToUser: setting taskToComplete to ' + taskStr);
33843
+ console.log('entryActionForStateOneTaskAssignedToUser: setting client context task_data to ' + taskStr);
33786
33844
  // Store task to session
33787
- context.sessionStorageService.setItem('taskToComplete', taskStr);
33845
+ const clientContext = {
33846
+ client_context: {
33847
+ user_task: {
33848
+ task_data: task,
33849
+ complete_task: true
33850
+ }
33851
+ }
33852
+ };
33853
+ context.sessionStorageService.setItem('clientContext', JSON.stringify(clientContext));
33788
33854
  // Allow user to perform the event
33789
33855
  context.router.navigate([`/cases/case-details/${context.caseId}/trigger/${context.eventId}`], { relativeTo: context.route });
33790
33856
  }