@hmcts/ccd-case-ui-toolkit 7.0.62 → 7.0.63-incorrect-font-size-fix

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 (27) 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-edit-submit/case-edit-submit.component.mjs +3 -3
  3. 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
  4. package/esm2022/lib/shared/components/case-editor/services/cases.service.mjs +53 -27
  5. package/esm2022/lib/shared/components/case-editor/services/event-completion-state-machine.service.mjs +13 -6
  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/domain/work-allocation/Task.mjs +1 -1
  9. package/esm2022/lib/shared/services/fields/fields.utils.mjs +8 -1
  10. package/esm2022/lib/shared/services/profile/profile.service.mjs +2 -1
  11. package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs +110 -51
  12. package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
  13. package/lib/shared/components/case-editor/case-edit/case-edit.component.d.ts.map +1 -1
  14. 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
  15. 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
  16. package/lib/shared/components/case-editor/services/cases.service.d.ts +2 -1
  17. package/lib/shared/components/case-editor/services/cases.service.d.ts.map +1 -1
  18. package/lib/shared/components/case-editor/services/event-completion-state-machine.service.d.ts +1 -0
  19. package/lib/shared/components/case-editor/services/event-completion-state-machine.service.d.ts.map +1 -1
  20. package/lib/shared/components/event-start/event-guard/event-start.guard.d.ts +1 -1
  21. package/lib/shared/components/event-start/event-guard/event-start.guard.d.ts.map +1 -1
  22. package/lib/shared/components/event-start/services/event-start-state-machine.service.d.ts.map +1 -1
  23. package/lib/shared/domain/work-allocation/Task.d.ts +4 -0
  24. package/lib/shared/domain/work-allocation/Task.d.ts.map +1 -1
  25. package/lib/shared/services/fields/fields.utils.d.ts +2 -0
  26. package/lib/shared/services/fields/fields.utils.d.ts.map +1 -1
  27. package/package.json +1 -1
@@ -23,6 +23,7 @@ export class ProfileService {
23
23
  .set('experimental', 'true')
24
24
  .set('Accept', ProfileService.V2_MEDIATYPE_USER_PROFILE)
25
25
  .set('Content-Type', 'application/json');
26
+ // Not adding client context header because header is added to call immediately afterwards
26
27
  return this.httpService
27
28
  .get(url, { headers, observe: 'body' })
28
29
  .pipe(map((p) => plainToClass(Profile, p)));
@@ -33,4 +34,4 @@ export class ProfileService {
33
34
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ProfileService, [{
34
35
  type: Injectable
35
36
  }], () => [{ type: i1.HttpService }, { type: i2.AbstractAppConfig }], null); })();
36
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZmlsZS5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY2NkLWNhc2UtdWktdG9vbGtpdC9zcmMvbGliL3NoYXJlZC9zZXJ2aWNlcy9wcm9maWxlL3Byb2ZpbGUuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDbkQsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUMzQyxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFFakQsT0FBTyxFQUF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HR0cFNlcnZpY2UsIHByaXZhdGUgcmVhZG9ubHkgYXBwQ29uZmlnOiBBYnN0cmFjdEFwcENvbmZpZykge31cblxuICBwdWJsaWMgZ2V0KCk6IE9ic2VydmFibGU8UHJvZmlsZT4ge1xuICAgIGNvbnN0IHVybCA9IHRoaXMuYXBwQ29uZmlnLmdldENhc2VEYXRhVXJsKCkgKyBQcm9maWxlU2VydmljZS5VUkw7XG4gICAgY29uc3QgaGVhZGVycyA9IG5ldyBIdHRwSGVhZGVycygpXG4gICAgICAuc2V0KCdleHBlcmltZW50YWwnLCAndHJ1ZScpXG4gICAgICAuc2V0KCdBY2NlcHQnLCBQcm9maWxlU2VydmljZS5WMl9NRURJQVRZUEVfVVNFUl9QUk9GSUxFKVxuICAgICAgLnNldCgnQ29udGVudC1UeXBlJywgJ2FwcGxpY2F0aW9uL2pzb24nKTtcblxuICAgIHJldHVybiB0aGlzLmh0dHBTZXJ2aWNlXG4gICAgICAuZ2V0KHVybCwge2hlYWRlcnMsIG9ic2VydmU6ICdib2R5J30pXG4gICAgICAucGlwZShcbiAgICAgICAgbWFwKChwOiBvYmplY3QpID0+IHBsYWluVG9DbGFzcyhQcm9maWxlLCBwKSlcbiAgICAgICk7XG4gIH1cblxufVxuIl19
37
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvZmlsZS5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY2NkLWNhc2UtdWktdG9vbGtpdC9zcmMvbGliL3NoYXJlZC9zZXJ2aWNlcy9wcm9maWxlL3Byb2ZpbGUuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDbkQsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUs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nO1xuICBwcml2YXRlIHN0YXRpYyByZWFkb25seSBVUkwgPSAnL2ludGVybmFsL3Byb2ZpbGUnO1xuXG4gIGNvbnN0cnVjdG9yKHByaXZhdGUgcmVhZG9ubHkgaHR0cFNlcnZpY2U6IEh0dHBTZXJ2aWNlLCBwcml2YXRlIHJlYWRvbmx5IGFwcENvbmZpZzogQWJzdHJhY3RBcHBDb25maWcpIHt9XG5cbiAgcHVibGljIGdldCgpOiBPYnNlcnZhYmxlPFByb2ZpbGU+IHtcbiAgICBjb25zdCB1cmwgPSB0aGlzLmFwcENvbmZpZy5nZXRDYXNlRGF0YVVybCgpICsgUHJvZmlsZVNlcnZpY2UuVVJMO1xuICAgIGNvbnN0IGhlYWRlcnMgPSBuZXcgSHR0cEhlYWRlcnMoKVxuICAgICAgLnNldCgnZXhwZXJpbWVudGFsJywgJ3RydWUnKVxuICAgICAgLnNldCgnQWNjZXB0JywgUHJvZmlsZVNlcnZpY2UuVjJfTUVESUFUWVBFX1VTRVJfUFJPRklMRSlcbiAgICAgIC5zZXQoJ0NvbnRlbnQtVHlwZScsICdhcHBsaWNhdGlvbi9qc29uJyk7XG4gICAgLy8gTm90IGFkZGluZyBjbGllbnQgY29udGV4dCBoZWFkZXIgYmVjYXVzZSBoZWFkZXIgaXMgYWRkZWQgdG8gY2FsbCBpbW1lZGlhdGVseSBhZnRlcndhcmRzXG4gICAgcmV0dXJuIHRoaXMuaHR0cFNlcnZpY2VcbiAgICAgIC5nZXQodXJsLCB7aGVhZGVycywgb2JzZXJ2ZTogJ2JvZHknfSlcbiAgICAgIC5waXBlKFxuICAgICAgICBtYXAoKHA6IG9iamVjdCkgPT4gcGxhaW5Ub0NsYXNzKFByb2ZpbGUsIHApKVxuICAgICAgKTtcbiAgfVxuXG59XG4iXX0=
@@ -4340,6 +4340,13 @@ class FieldsUtils {
4340
4340
  return '';
4341
4341
  }
4342
4342
  }
4343
+ static getUserTaskFromClientContext(clientContextStr) {
4344
+ if (clientContextStr) {
4345
+ let clientContext = JSON.parse(clientContextStr);
4346
+ return clientContext.client_context.user_task;
4347
+ }
4348
+ return null;
4349
+ }
4343
4350
  buildCanShowPredicate(eventTrigger, form) {
4344
4351
  const currentState = this.getCurrentEventState(eventTrigger, form);
4345
4352
  return (page) => {
@@ -7175,6 +7182,7 @@ class ProfileService {
7175
7182
  .set('experimental', 'true')
7176
7183
  .set('Accept', ProfileService.V2_MEDIATYPE_USER_PROFILE)
7177
7184
  .set('Content-Type', 'application/json');
7185
+ // Not adding client context header because header is added to call immediately afterwards
7178
7186
  return this.httpService
7179
7187
  .get(url, { headers, observe: 'body' })
7180
7188
  .pipe(map((p) => plainToClass(Profile, p)));
@@ -8071,6 +8079,7 @@ class CasesService {
8071
8079
  let headers = new HttpHeaders();
8072
8080
  headers = headers.set('experimental', 'true');
8073
8081
  headers = headers.set('Content-Type', 'application/json');
8082
+ headers = this.addClientContextHeader(headers);
8074
8083
  if (Draft.isDraft(caseId)) {
8075
8084
  headers = headers.set('Accept', CasesService.V2_MEDIATYPE_START_DRAFT_TRIGGER);
8076
8085
  }
@@ -8081,9 +8090,10 @@ class CasesService {
8081
8090
  headers = headers.set('Accept', CasesService.V2_MEDIATYPE_START_CASE_TRIGGER);
8082
8091
  }
8083
8092
  return this.http
8084
- .get(url, { headers, observe: 'body' })
8085
- .pipe(map(body => {
8086
- return FieldsUtils.handleNestedDynamicLists(body);
8093
+ .get(url, { headers, observe: 'response' })
8094
+ .pipe(map((response) => {
8095
+ this.updateClientContextStorage(response.headers);
8096
+ return FieldsUtils.handleNestedDynamicLists(response.body);
8087
8097
  }), catchError(error => {
8088
8098
  this.errorService.setError(error);
8089
8099
  return throwError(error);
@@ -8092,13 +8102,17 @@ class CasesService {
8092
8102
  createEvent(caseDetails, eventData) {
8093
8103
  const caseId = caseDetails.case_id;
8094
8104
  const url = `${this.appConfig.getCaseDataUrl()}/cases/${caseId}/events`;
8095
- const headers = new HttpHeaders()
8105
+ let headers = new HttpHeaders()
8096
8106
  .set('experimental', 'true')
8097
8107
  .set('Accept', CasesService.V2_MEDIATYPE_CREATE_EVENT)
8098
8108
  .set('Content-Type', 'application/json');
8109
+ headers = this.addClientContextHeader(headers);
8099
8110
  return this.http
8100
- .post(url, eventData, { headers, observe: 'body' })
8101
- .pipe(catchError(error => {
8111
+ .post(url, eventData, { headers, observe: 'response' })
8112
+ .pipe(map((response) => {
8113
+ this.updateClientContextStorage(response.headers);
8114
+ return response.body;
8115
+ }), catchError(error => {
8102
8116
  this.errorService.setError(error);
8103
8117
  return throwError(error);
8104
8118
  }));
@@ -8106,13 +8120,17 @@ class CasesService {
8106
8120
  validateCase(ctid, eventData, pageId) {
8107
8121
  const pageIdString = pageId ? `?pageId=${pageId}` : '';
8108
8122
  const url = `${this.appConfig.getCaseDataUrl()}/case-types/${ctid}/validate${pageIdString}`;
8109
- const headers = new HttpHeaders()
8123
+ let headers = new HttpHeaders()
8110
8124
  .set('experimental', 'true')
8111
8125
  .set('Accept', CasesService.V2_MEDIATYPE_CASE_DATA_VALIDATE)
8112
8126
  .set('Content-Type', 'application/json');
8127
+ headers = this.addClientContextHeader(headers);
8113
8128
  return this.http
8114
- .post(url, eventData, { headers, observe: 'body' })
8115
- .pipe(catchError(error => {
8129
+ .post(url, eventData, { headers, observe: 'response' })
8130
+ .pipe(map((response) => {
8131
+ this.updateClientContextStorage(response.headers);
8132
+ return response.body;
8133
+ }), catchError(error => {
8116
8134
  this.errorService.setError(error);
8117
8135
  return throwError(error);
8118
8136
  }));
@@ -8123,26 +8141,34 @@ class CasesService {
8123
8141
  ignoreWarning = 'true';
8124
8142
  }
8125
8143
  const url = `${this.appConfig.getCaseDataUrl()}/case-types/${ctid}/cases?ignore-warning=${ignoreWarning}`;
8126
- const headers = new HttpHeaders()
8144
+ let headers = new HttpHeaders()
8127
8145
  .set('experimental', 'true')
8128
8146
  .set('Accept', CasesService.V2_MEDIATYPE_CREATE_CASE)
8129
8147
  .set('Content-Type', 'application/json');
8148
+ headers = this.addClientContextHeader(headers);
8130
8149
  return this.http
8131
- .post(url, eventData, { headers, observe: 'body' })
8132
- .pipe(catchError(error => {
8150
+ .post(url, eventData, { headers, observe: 'response' })
8151
+ .pipe(map((response) => {
8152
+ this.updateClientContextStorage(response.headers);
8153
+ return response.body;
8154
+ }), catchError(error => {
8133
8155
  this.errorService.setError(error);
8134
8156
  return throwError(error);
8135
8157
  }));
8136
8158
  }
8137
8159
  getPrintDocuments(caseId) {
8138
8160
  const url = `${this.appConfig.getCaseDataUrl()}/cases/${caseId}/documents`;
8139
- const headers = new HttpHeaders()
8161
+ let headers = new HttpHeaders()
8140
8162
  .set('experimental', 'true')
8141
8163
  .set('Accept', CasesService.V2_MEDIATYPE_CASE_DOCUMENTS)
8142
8164
  .set('Content-Type', 'application/json');
8165
+ headers = this.addClientContextHeader(headers);
8143
8166
  return this.http
8144
- .get(url, { headers, observe: 'body' })
8145
- .pipe(map(body => body.documentResources), catchError(error => {
8167
+ .get(url, { headers, observe: 'response' })
8168
+ .pipe(map((response) => {
8169
+ this.updateClientContextStorage(response.headers);
8170
+ return response.body.documentResources;
8171
+ }), catchError(error => {
8146
8172
  this.errorService.setError(error);
8147
8173
  return throwError(error);
8148
8174
  }));
@@ -8175,17 +8201,6 @@ class CasesService {
8175
8201
  wizardPage.case_fields = this.orderService.sort(this.wizardPageFieldToCaseFieldMapper.mapAll(wizardPage.wizard_page_fields, eventTrigger.case_fields));
8176
8202
  });
8177
8203
  }
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
8204
  getCourtOrHearingCentreName(locationId) {
8190
8205
  return this.http.post(`/api/locations/getLocationsById`, { locations: [{ locationId }] });
8191
8206
  }
@@ -8252,6 +8267,25 @@ class CasesService {
8252
8267
  .get(url)
8253
8268
  .pipe(catchError(error => throwError(error)));
8254
8269
  }
8270
+ addClientContextHeader(headers) {
8271
+ const clientContextDetails = this.sessionStorageService.getItem('clientContext');
8272
+ if (clientContextDetails) {
8273
+ // may require URI encoding in certain circumstances
8274
+ const clientContext = window.btoa(clientContextDetails);
8275
+ if (clientContext) {
8276
+ headers = headers.set('Client-Context', clientContext);
8277
+ }
8278
+ }
8279
+ return headers;
8280
+ }
8281
+ updateClientContextStorage(headers) {
8282
+ // for mocking - TODO: Kasi Remove/Uncomment for testing
8283
+ // headers = this.setMockClientContextHeader(headers);
8284
+ if (headers && headers.get('Client-Context')) {
8285
+ const clientContextString = window.atob(headers.get('Client-Context'));
8286
+ this.sessionStorageService.setItem('clientContext', clientContextString);
8287
+ }
8288
+ }
8255
8289
  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
8290
  static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: CasesService, factory: CasesService.ɵfac });
8257
8291
  }
@@ -8764,8 +8798,9 @@ class EventCompletionStateMachineService {
8764
8798
  entryActionForStateCompleteEventAndTask(state, context) {
8765
8799
  // Trigger final state to complete processing of state machine
8766
8800
  state.trigger(EventCompletionStates.Final);
8767
- const taskStr = context.sessionStorageService.getItem('taskToComplete');
8768
- if (taskStr) {
8801
+ const clientContextStr = context.sessionStorageService.getItem('clientContext');
8802
+ const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
8803
+ if (userTask?.task_data) {
8769
8804
  context.sessionStorageService.setItem('assignNeeded', 'false');
8770
8805
  // just set event can be completed
8771
8806
  context.component.eventCanBeCompleted.emit(true);
@@ -8784,9 +8819,9 @@ class EventCompletionStateMachineService {
8784
8819
  entryActionForStateTaskUnassigned(state, context) {
8785
8820
  // Trigger final state to complete processing of state machine
8786
8821
  state.trigger(EventCompletionStates.Final);
8787
- // Get task details
8788
- const taskStr = context.sessionStorageService.getItem('taskToComplete');
8789
- if (taskStr) {
8822
+ const clientContextStr = context.sessionStorageService.getItem('clientContext');
8823
+ const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
8824
+ if (userTask?.task_data) {
8790
8825
  context.sessionStorageService.setItem('assignNeeded', 'true');
8791
8826
  context.component.eventCanBeCompleted.emit(true);
8792
8827
  }
@@ -8821,6 +8856,11 @@ class EventCompletionStateMachineService {
8821
8856
  addTransitionsForStateTaskUnassigned() {
8822
8857
  this.stateTaskUnassigned.addTransition(EventCompletionStates.Final, this.stateFinal);
8823
8858
  }
8859
+ taskPresentInSessionStorage(context) {
8860
+ const clientContextStr = context.sessionStorageService.getItem('clientContext');
8861
+ const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
8862
+ return !!userTask.task_data;
8863
+ }
8824
8864
  static ɵfac = function EventCompletionStateMachineService_Factory(t) { return new (t || EventCompletionStateMachineService)(); };
8825
8865
  static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: EventCompletionStateMachineService, factory: EventCompletionStateMachineService.ɵfac });
8826
8866
  }
@@ -9336,13 +9376,12 @@ class CaseEditComponent {
9336
9376
  this.isSubmitting = true;
9337
9377
  // We have to run the event completion checks if task in session storage
9338
9378
  // and if the task is in session storage, then is it associated to the case
9339
- let taskInSessionStorage;
9379
+ const clientContextStr = this.sessionStorageService.getItem('clientContext');
9380
+ const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
9381
+ const taskInSessionStorage = userTask ? userTask.task_data : null;
9340
9382
  let taskEventInSessionStorage;
9341
9383
  const taskStr = this.sessionStorageService.getItem('taskToComplete');
9342
9384
  const taskEventStr = this.sessionStorageService.getItem('taskEvent');
9343
- if (taskStr) {
9344
- taskInSessionStorage = JSON.parse(taskStr);
9345
- }
9346
9385
  if (taskEventStr) {
9347
9386
  taskEventInSessionStorage = JSON.parse(taskEventStr);
9348
9387
  }
@@ -9553,15 +9592,15 @@ class CaseEditComponent {
9553
9592
  });
9554
9593
  }
9555
9594
  postCompleteTaskIfRequired() {
9556
- const taskStr = this.sessionStorageService.getItem('taskToComplete');
9595
+ const clientContextStr = this.sessionStorageService.getItem('clientContext');
9596
+ const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
9597
+ const [task, taskToBeCompleted] = userTask ? [userTask.task_data, userTask.complete_task] : [null, false];
9557
9598
  const assignNeeded = this.sessionStorageService.getItem('assignNeeded') === 'true';
9558
- if (taskStr && assignNeeded) {
9559
- const task = JSON.parse(taskStr);
9599
+ if (task && assignNeeded && taskToBeCompleted) {
9560
9600
  this.abstractConfig.logMessage(`postCompleteTaskIfRequired with assignNeeded: taskId ${task.id} and event name ${this.eventTrigger.name}`);
9561
9601
  return this.workAllocationService.assignAndCompleteTask(task.id, this.eventTrigger.name);
9562
9602
  }
9563
- else if (taskStr) {
9564
- const task = JSON.parse(taskStr);
9603
+ else if (task && taskToBeCompleted) {
9565
9604
  this.abstractConfig.logMessage(`postCompleteTaskIfRequired: taskId ${task.id} and event name ${this.eventTrigger.name}`);
9566
9605
  return this.workAllocationService.completeTask(task.id, this.eventTrigger.name);
9567
9606
  }
@@ -11163,8 +11202,12 @@ class CaseEventCompletionTaskReassignedComponent {
11163
11202
  }
11164
11203
  onContinue() {
11165
11204
  // Get task details
11166
- const taskStr = this.sessionStorageService.getItem('taskToComplete');
11167
- if (taskStr) {
11205
+ const clientContextStr = this.sessionStorageService.getItem('clientContext');
11206
+ const userTask = FieldsUtils.getUserTaskFromClientContext(clientContextStr);
11207
+ const task = userTask ? userTask.task_data : null;
11208
+ // not complete_task not utilised here as related to event completion
11209
+ // service wanting task associated with event to not be completed not directly relevant
11210
+ if (task) {
11168
11211
  this.sessionStorageService.setItem('assignNeeded', 'true');
11169
11212
  // set event can be completed to true
11170
11213
  this.parentComponent.eventCanBeCompleted.emit(true);
@@ -11188,7 +11231,7 @@ class CaseEventCompletionTaskReassignedComponent {
11188
11231
  type: Inject,
11189
11232
  args: [COMPONENT_PORTAL_INJECTION_TOKEN]
11190
11233
  }] }, { type: i1$1.ActivatedRoute }, { type: WorkAllocationService }, { type: SessionStorageService }, { type: JudicialworkerService }, { type: CaseworkerService }, { type: AlertService }], null); })();
11191
- (() => { (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 }); })();
11234
+ (() => { (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 }); })();
11192
11235
 
11193
11236
  function CaseEventCompletionComponent_ng_template_0_Template(rf, ctx) { }
11194
11237
  const COMPONENT_PORTAL_INJECTION_TOKEN = new InjectionToken('');
@@ -29038,7 +29081,7 @@ class CaseEditSubmitComponent {
29038
29081
  return 'Cancel';
29039
29082
  }
29040
29083
  static ɵfac = function CaseEditSubmitComponent_Factory(t) { return new (t || CaseEditSubmitComponent)(i0.ɵɵdirectiveInject(CaseEditComponent), i0.ɵɵdirectiveInject(FieldsUtils), i0.ɵɵdirectiveInject(CaseFieldService), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(ProfileNotifier), i0.ɵɵdirectiveInject(FormValidatorsService)); };
29041
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditSubmitComponent, selectors: [["ccd-case-edit-submit"]], decls: 23, vars: 21, consts: [["titleBlock", ""], ["idBlock", ""], [1, "govuk-heading-l"], [4, "ngIf", "ngIfThen", "ngIfElse"], [3, "error"], [3, "callbackErrorsContext", "callbackErrorsSubject"], [1, "check-your-answers", 3, "submit", "formGroup"], [4, "ngIf"], [3, "eventCompletionParams", "eventCanBeCompleted", 4, "ngIf"], [1, "form-group", "form-group-related"], ["class", "button button-secondary", "type", "button", 3, "disabled", "click", 4, "ngIf"], ["type", "submit", 1, "button", 3, "disabled"], [1, "cancel"], ["href", "javascript:void(0)", 3, "click"], [3, "content"], ["class", "heading-h2", 4, "ngIf"], [1, "heading-h2"], ["class", "text-16", 4, "ngIf"], ["aria-describedby", "check your answers table", 1, "form-table"], [4, "ngFor", "ngForOf"], [1, "text-16"], ["ccdLabelSubstitutor", "", 3, "caseField", "hidden", "formGroup", "contextFields"], ["class", "valign-top case-field-label", 4, "ngIf"], [1, "form-cell", "case-field-content"], [3, "formGroup", "topLevelFormGroup", "caseField", "context", "caseFields"], [1, "valign-top", "case-field-label"], [1, "valign-top", "check-your-answers__change", "case-field-change"], ["href", "javascript:void(0)", 3, "click", 4, "ngIf"], ["aria-describedby", "summary fields table", 1, "summary-fields"], [3, "ngSwitch"], ["ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields", 4, "ngSwitchCase"], ["class", "compound-field", "ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields", 4, "ngSwitchCase"], ["ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields"], ["id", "summary-field-label"], [1, "form-cell"], [3, "formGroup", "caseField"], ["ccdLabelSubstitutor", "", 1, "compound-field", 3, "caseField", "formGroup", "contextFields"], ["colspan", "2"], [3, "formGroup", "caseField", "caseFields"], ["id", "fieldset-event", "formGroupName", "event"], [2, "display", "none"], [1, "form-group", 3, "ngClass"], ["for", "field-trigger-summary", 1, "form-label"], [1, "form-hint"], ["class", "error-message", 4, "ngIf"], ["type", "text", "id", "field-trigger-summary", "formControlName", "summary", "maxlength", "1024", 1, "form-control", "bottom-30", "width-50", 3, "ngClass"], ["for", "field-trigger-description", 1, "form-label"], ["id", "field-trigger-description", "formControlName", "description", "maxlength", "65536", 1, "form-control", "bottom-30", "width-50", 3, "ngClass"], [1, "error-message"], [3, "eventCanBeCompleted", "eventCompletionParams"], ["type", "button", 1, "button", "button-secondary", 3, "click", "disabled"]], template: function CaseEditSubmitComponent_Template(rf, ctx) { if (rf & 1) {
29084
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditSubmitComponent, selectors: [["ccd-case-edit-submit"]], decls: 23, vars: 21, consts: [["titleBlock", ""], ["idBlock", ""], [1, "govuk-heading-l"], [4, "ngIf", "ngIfThen", "ngIfElse"], [3, "error"], [3, "callbackErrorsContext", "callbackErrorsSubject"], [1, "check-your-answers", 3, "submit", "formGroup"], [4, "ngIf"], [3, "eventCompletionParams", "eventCanBeCompleted", 4, "ngIf"], [1, "form-group", "form-group-related"], ["class", "button button-secondary", "type", "button", 3, "disabled", "click", 4, "ngIf"], ["type", "submit", 1, "button", 3, "disabled"], [1, "cancel"], ["href", "javascript:void(0)", 3, "click"], [3, "content"], ["class", "heading-h2", 4, "ngIf"], [1, "heading-h2"], ["class", "text-16", 4, "ngIf"], ["aria-describedby", "check your answers table", 1, "form-table"], [4, "ngFor", "ngForOf"], [1, "text-16"], ["ccdLabelSubstitutor", "", 3, "caseField", "hidden", "formGroup", "contextFields"], ["class", "valign-top case-field-label", 4, "ngIf"], [1, "form-cell", "case-field-content", "text-16"], [3, "formGroup", "topLevelFormGroup", "caseField", "context", "caseFields"], [1, "valign-top", "case-field-label"], [1, "valign-top", "check-your-answers__change", "case-field-change"], ["href", "javascript:void(0)", 3, "click", 4, "ngIf"], ["aria-describedby", "summary fields table", 1, "summary-fields"], [3, "ngSwitch"], ["ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields", 4, "ngSwitchCase"], ["class", "compound-field", "ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields", 4, "ngSwitchCase"], ["ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields"], ["id", "summary-field-label"], [1, "form-cell"], [3, "formGroup", "caseField"], ["ccdLabelSubstitutor", "", 1, "compound-field", 3, "caseField", "formGroup", "contextFields"], ["colspan", "2"], [3, "formGroup", "caseField", "caseFields"], ["id", "fieldset-event", "formGroupName", "event"], [2, "display", "none"], [1, "form-group", 3, "ngClass"], ["for", "field-trigger-summary", 1, "form-label"], [1, "form-hint"], ["class", "error-message", 4, "ngIf"], ["type", "text", "id", "field-trigger-summary", "formControlName", "summary", "maxlength", "1024", 1, "form-control", "bottom-30", "width-50", 3, "ngClass"], ["for", "field-trigger-description", 1, "form-label"], ["id", "field-trigger-description", "formControlName", "description", "maxlength", "65536", 1, "form-control", "bottom-30", "width-50", 3, "ngClass"], [1, "error-message"], [3, "eventCanBeCompleted", "eventCompletionParams"], ["type", "button", 1, "button", "button-secondary", 3, "click", "disabled"]], template: function CaseEditSubmitComponent_Template(rf, ctx) { if (rf & 1) {
29042
29085
  const _r1 = i0.ɵɵgetCurrentView();
29043
29086
  i0.ɵɵelementStart(0, "div")(1, "h1", 2);
29044
29087
  i0.ɵɵtext(2);
@@ -29094,7 +29137,7 @@ class CaseEditSubmitComponent {
29094
29137
  }
29095
29138
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditSubmitComponent, [{
29096
29139
  type: Component,
29097
- args: [{ selector: 'ccd-case-edit-submit', template: "<div>\n <!-- Event trigger name -->\n <h1 class=\"govuk-heading-l\">{{eventTrigger.name | rpxTranslate}}</h1>\n\n <!--Case ID or Title -->\n <div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n <ng-template #titleBlock>\n <ccd-markdown [content]=\"getCaseTitle() | ccdCaseTitle: contextFields : editForm.controls['data']\"></ccd-markdown>\n </ng-template>\n <ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n </ng-template>\n\n <ccd-case-edit-generic-errors [error]=\"caseEdit.error\"></ccd-case-edit-generic-errors>\n\n <ccd-callback-errors [callbackErrorsSubject]=\"caseEdit.callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\"></ccd-callback-errors>\n\n <form class=\"check-your-answers\" [formGroup]=\"editForm\" (submit)=\"submit()\">\n <div *ngIf=\"!caseEdit.isEventCompletionChecksRequired\">\n <ng-container *ngIf=\"checkYourAnswerFieldsToDisplayExists()\">\n <h2 class=\"heading-h2\">{{pageTitle | rpxTranslate }}</h2>\n <span class=\"text-16\" *ngIf=\"!caseEdit.isCaseFlagSubmission\">{{'Check the information below carefully.' | rpxTranslate}}</span>\n\n <table class=\"form-table\" aria-describedby=\"check your answers table\">\n <tbody>\n <ng-container *ngFor=\"let page of wizard.pages\">\n <ng-container *ngIf=\"isShown(page)\">\n <ng-container *ngFor=\"let field of page\n | ccdPageFields: editForm\n | ccdReadFieldsFilter: false :undefined :true :allFieldsValues\n | ccdCYAPageLabelFilter\">\n <ng-container *ngIf=\"canShowFieldInCYA(field)\">\n <tr ccdLabelSubstitutor [caseField]=\"field\" [hidden]=\"field.hidden\"\n [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <th *ngIf=\"!isLabel(field) && !caseEdit.isCaseFlagSubmission\" class=\"valign-top case-field-label\">\n <span class=\"text-16\">{{field.label | rpxTranslate}}</span>\n </th>\n <td class=\"form-cell case-field-content\" [attr.colspan]=\"isLabel(field) ? '2' : '1'\">\n <ccd-field-read\n [formGroup]=\"editForm.controls['data']\" [topLevelFormGroup]=\"editForm.controls['data']\"\n [caseField]=\"summaryCaseField(field)\" [context]=\"paletteContext\" [caseFields]=\"contextFields\"></ccd-field-read>\n </td>\n <ng-container *ngIf=\"!caseEdit.isCaseFlagSubmission\">\n <td class=\"valign-top check-your-answers__change case-field-change\">\n <a *ngIf=\"isChangeAllowed(field)\" (click)=\"navigateToPage(page.id)\"\n href=\"javascript:void(0)\">\n <span class=\"text-16\" attr.aria-label=\"{{'Change' | rpxTranslate}} {{ field.label | rpxTranslate }}\">\n {{'Change' | rpxTranslate}}\n </span>\n </a>\n </td>\n </ng-container>\n </tr>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n </tbody>\n </table>\n </ng-container>\n <ng-container *ngIf=\"readOnlySummaryFieldsToDisplayExists()\">\n\n <table class=\"summary-fields\" aria-describedby=\"summary fields table\">\n <tbody>\n <ng-container *ngFor=\"let field of showSummaryFields\">\n <ng-container [ngSwitch]=\"!(field | ccdIsCompound)\">\n <tr *ngSwitchCase=\"true\" ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <th id=\"summary-field-label\">{{field.label}}</th>\n <td class=\"form-cell\">\n <ccd-field-read [formGroup]=\"editForm.controls['data']\" [caseField]=\"summaryCaseField(field)\"></ccd-field-read>\n </td>\n </tr>\n <tr *ngSwitchCase=\"false\" class=\"compound-field\" ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <td colspan=\"2\">\n <ccd-field-read [formGroup]=\"editForm.controls['data']\" [caseField]=\"summaryCaseField(field)\" [caseFields]=\"contextFields\"></ccd-field-read>\n </td>\n </tr>\n </ng-container>\n </ng-container>\n </tbody>\n </table>\n </ng-container>\n <ng-container *ngIf=\"showEventNotes()\">\n <fieldset id=\"fieldset-event\" formGroupName=\"event\">\n <legend style=\"display: none;\"></legend>\n <div class=\"form-group\" [ngClass]=\"{'form-group-error': !!summary && !summary.valid && (summary.dirty || summary.touched)}\">\n <label for=\"field-trigger-summary\" class=\"form-label\">\n Event summary (optional)\n <span class=\"form-hint\">A few words describing the purpose of the event.</span>\n </label>\n <span class=\"error-message\" *ngIf=\"summary?.errors && (summary.dirty || summary.touched)\">\n {{summary.errors | ccdFirstError: eventSummaryLabel | rpxTranslate}}\n </span>\n <input type=\"text\" id=\"field-trigger-summary\" class=\"form-control bottom-30 width-50\"\n [ngClass]=\"{'govuk-input--error': summary?.errors && (summary.dirty || summary.touched)}\" formControlName=\"summary\" maxlength=\"1024\">\n </div>\n <div class=\"form-group\" [ngClass]=\"{'form-group-error': !!description && !description.valid && (description.dirty || description.touched)}\">\n <label for=\"field-trigger-description\" class=\"form-label\">Event description (optional)</label>\n <span class=\"error-message\" *ngIf=\"description?.errors && (description.dirty || description.touched)\">\n {{description.errors | ccdFirstError: eventDescriptionLabel | rpxTranslate}}\n </span>\n <textarea id=\"field-trigger-description\" class=\"form-control bottom-30 width-50\" formControlName=\"description\"\n [ngClass]=\"{'govuk-input--error': description?.errors && (description.dirty || description.touched)}\" maxlength=\"65536\"></textarea>\n </div>\n </fieldset>\n </ng-container>\n </div>\n <ccd-case-event-completion *ngIf=\"caseEdit.isEventCompletionChecksRequired\"\n [eventCompletionParams]=\"caseEdit.eventCompletionParams\"\n (eventCanBeCompleted)=\"onEventCanBeCompleted($event)\">\n </ccd-case-event-completion>\n <div class=\"form-group form-group-related\">\n <button *ngIf=\"!caseEdit.isCaseFlagSubmission\" class=\"button button-secondary\" type=\"button\" [disabled]=\"!hasPrevious() || caseEdit.isSubmitting\" (click)=\"previous()\">\n {{'Previous' | rpxTranslate}}\n </button>\n <button type=\"submit\" [disabled]=\"isDisabled\" class=\"button\">\n {{triggerText | rpxTranslate}}\n </button>\n </div>\n <p class=\"cancel\">\n <a (click)=\"cancel()\" href=\"javascript:void(0)\" [class.disabled]=\"caseEdit.isSubmitting\">{{getCancelText() | rpxTranslate}}</a>\n </p>\n </form>\n</div>\n\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"] }]
29140
+ args: [{ selector: 'ccd-case-edit-submit', template: "<div>\n <!-- Event trigger name -->\n <h1 class=\"govuk-heading-l\">{{eventTrigger.name | rpxTranslate}}</h1>\n\n <!--Case ID or Title -->\n <div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n <ng-template #titleBlock>\n <ccd-markdown [content]=\"getCaseTitle() | ccdCaseTitle: contextFields : editForm.controls['data']\"></ccd-markdown>\n </ng-template>\n <ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n </ng-template>\n\n <ccd-case-edit-generic-errors [error]=\"caseEdit.error\"></ccd-case-edit-generic-errors>\n\n <ccd-callback-errors [callbackErrorsSubject]=\"caseEdit.callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\"></ccd-callback-errors>\n\n <form class=\"check-your-answers\" [formGroup]=\"editForm\" (submit)=\"submit()\">\n <div *ngIf=\"!caseEdit.isEventCompletionChecksRequired\">\n <ng-container *ngIf=\"checkYourAnswerFieldsToDisplayExists()\">\n <h2 class=\"heading-h2\">{{pageTitle | rpxTranslate }}</h2>\n <span class=\"text-16\" *ngIf=\"!caseEdit.isCaseFlagSubmission\">{{'Check the information below carefully.' | rpxTranslate}}</span>\n\n <table class=\"form-table\" aria-describedby=\"check your answers table\">\n <tbody>\n <ng-container *ngFor=\"let page of wizard.pages\">\n <ng-container *ngIf=\"isShown(page)\">\n <ng-container *ngFor=\"let field of page\n | ccdPageFields: editForm\n | ccdReadFieldsFilter: false :undefined :true :allFieldsValues\n | ccdCYAPageLabelFilter\">\n <ng-container *ngIf=\"canShowFieldInCYA(field)\">\n <tr ccdLabelSubstitutor [caseField]=\"field\" [hidden]=\"field.hidden\"\n [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <th *ngIf=\"!isLabel(field) && !caseEdit.isCaseFlagSubmission\" class=\"valign-top case-field-label\">\n <span class=\"text-16\">{{field.label | rpxTranslate}}</span>\n </th>\n <td class=\"form-cell case-field-content text-16\" [attr.colspan]=\"isLabel(field) ? '2' : '1'\">\n <ccd-field-read\n [formGroup]=\"editForm.controls['data']\" [topLevelFormGroup]=\"editForm.controls['data']\"\n [caseField]=\"summaryCaseField(field)\" [context]=\"paletteContext\" [caseFields]=\"contextFields\"></ccd-field-read>\n </td>\n <ng-container *ngIf=\"!caseEdit.isCaseFlagSubmission\">\n <td class=\"valign-top check-your-answers__change case-field-change\">\n <a *ngIf=\"isChangeAllowed(field)\" (click)=\"navigateToPage(page.id)\"\n href=\"javascript:void(0)\">\n <span class=\"text-16\" attr.aria-label=\"{{'Change' | rpxTranslate}} {{ field.label | rpxTranslate }}\">\n {{'Change' | rpxTranslate}}\n </span>\n </a>\n </td>\n </ng-container>\n </tr>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n </tbody>\n </table>\n </ng-container>\n <ng-container *ngIf=\"readOnlySummaryFieldsToDisplayExists()\">\n\n <table class=\"summary-fields\" aria-describedby=\"summary fields table\">\n <tbody>\n <ng-container *ngFor=\"let field of showSummaryFields\">\n <ng-container [ngSwitch]=\"!(field | ccdIsCompound)\">\n <tr *ngSwitchCase=\"true\" ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <th id=\"summary-field-label\">{{field.label}}</th>\n <td class=\"form-cell\">\n <ccd-field-read [formGroup]=\"editForm.controls['data']\" [caseField]=\"summaryCaseField(field)\"></ccd-field-read>\n </td>\n </tr>\n <tr *ngSwitchCase=\"false\" class=\"compound-field\" ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"editForm.controls['data']\" [contextFields]=\"contextFields\">\n <td colspan=\"2\">\n <ccd-field-read [formGroup]=\"editForm.controls['data']\" [caseField]=\"summaryCaseField(field)\" [caseFields]=\"contextFields\"></ccd-field-read>\n </td>\n </tr>\n </ng-container>\n </ng-container>\n </tbody>\n </table>\n </ng-container>\n <ng-container *ngIf=\"showEventNotes()\">\n <fieldset id=\"fieldset-event\" formGroupName=\"event\">\n <legend style=\"display: none;\"></legend>\n <div class=\"form-group\" [ngClass]=\"{'form-group-error': !!summary && !summary.valid && (summary.dirty || summary.touched)}\">\n <label for=\"field-trigger-summary\" class=\"form-label\">\n Event summary (optional)\n <span class=\"form-hint\">A few words describing the purpose of the event.</span>\n </label>\n <span class=\"error-message\" *ngIf=\"summary?.errors && (summary.dirty || summary.touched)\">\n {{summary.errors | ccdFirstError: eventSummaryLabel | rpxTranslate}}\n </span>\n <input type=\"text\" id=\"field-trigger-summary\" class=\"form-control bottom-30 width-50\"\n [ngClass]=\"{'govuk-input--error': summary?.errors && (summary.dirty || summary.touched)}\" formControlName=\"summary\" maxlength=\"1024\">\n </div>\n <div class=\"form-group\" [ngClass]=\"{'form-group-error': !!description && !description.valid && (description.dirty || description.touched)}\">\n <label for=\"field-trigger-description\" class=\"form-label\">Event description (optional)</label>\n <span class=\"error-message\" *ngIf=\"description?.errors && (description.dirty || description.touched)\">\n {{description.errors | ccdFirstError: eventDescriptionLabel | rpxTranslate}}\n </span>\n <textarea id=\"field-trigger-description\" class=\"form-control bottom-30 width-50\" formControlName=\"description\"\n [ngClass]=\"{'govuk-input--error': description?.errors && (description.dirty || description.touched)}\" maxlength=\"65536\"></textarea>\n </div>\n </fieldset>\n </ng-container>\n </div>\n <ccd-case-event-completion *ngIf=\"caseEdit.isEventCompletionChecksRequired\"\n [eventCompletionParams]=\"caseEdit.eventCompletionParams\"\n (eventCanBeCompleted)=\"onEventCanBeCompleted($event)\">\n </ccd-case-event-completion>\n <div class=\"form-group form-group-related\">\n <button *ngIf=\"!caseEdit.isCaseFlagSubmission\" class=\"button button-secondary\" type=\"button\" [disabled]=\"!hasPrevious() || caseEdit.isSubmitting\" (click)=\"previous()\">\n {{'Previous' | rpxTranslate}}\n </button>\n <button type=\"submit\" [disabled]=\"isDisabled\" class=\"button\">\n {{triggerText | rpxTranslate}}\n </button>\n </div>\n <p class=\"cancel\">\n <a (click)=\"cancel()\" href=\"javascript:void(0)\" [class.disabled]=\"caseEdit.isSubmitting\">{{getCancelText() | rpxTranslate}}</a>\n </p>\n </form>\n</div>\n\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"] }]
29098
29141
  }], () => [{ type: CaseEditComponent }, { type: FieldsUtils }, { type: CaseFieldService }, { type: i1$1.ActivatedRoute }, { type: OrderService }, { type: ProfileNotifier }, { type: FormValidatorsService }], null); })();
29099
29142
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditSubmitComponent, { className: "CaseEditSubmitComponent", filePath: "lib/shared/components/case-editor/case-edit-submit/case-edit-submit.component.ts", lineNumber: 27 }); })();
29100
29143
 
@@ -33558,7 +33601,7 @@ class EventStartGuard {
33558
33601
  workAllocationService;
33559
33602
  router;
33560
33603
  sessionStorageService;
33561
- static TASK_TO_COMPLETE = 'taskToComplete';
33604
+ static CLIENT_CONTEXT = 'clientContext';
33562
33605
  constructor(workAllocationService, router, sessionStorageService) {
33563
33606
  this.workAllocationService = workAllocationService;
33564
33607
  this.router = router;
@@ -33609,18 +33652,26 @@ class EventStartGuard {
33609
33652
  task = tasksAssignedToUser[0];
33610
33653
  }
33611
33654
  // if one task assigned to user, allow user to complete event
33612
- this.sessionStorageService.setItem(EventStartGuard.TASK_TO_COMPLETE, JSON.stringify(task));
33655
+ const storeClientContext = {
33656
+ client_context: {
33657
+ user_task: {
33658
+ task_data: task,
33659
+ complete_task: true
33660
+ }
33661
+ }
33662
+ };
33663
+ this.sessionStorageService.setItem(EventStartGuard.CLIENT_CONTEXT, JSON.stringify(storeClientContext));
33613
33664
  return true;
33614
33665
  }
33615
33666
  }
33616
33667
  removeTaskFromSessionStorage() {
33617
- this.sessionStorageService.removeItem(EventStartGuard.TASK_TO_COMPLETE);
33668
+ this.sessionStorageService.removeItem(EventStartGuard.CLIENT_CONTEXT);
33618
33669
  }
33619
33670
  checkForTasks(payload, caseId, eventId, taskId) {
33620
33671
  if (taskId && payload?.tasks?.length > 0) {
33621
33672
  const task = payload.tasks.find((t) => t.id == taskId);
33622
33673
  if (task) {
33623
- this.sessionStorageService.setItem(EventStartGuard.TASK_TO_COMPLETE, JSON.stringify(task));
33674
+ this.sessionStorageService.setItem(EventStartGuard.CLIENT_CONTEXT, JSON.stringify(task));
33624
33675
  }
33625
33676
  else {
33626
33677
  this.removeTaskFromSessionStorage();
@@ -33788,9 +33839,17 @@ class EventStartStateMachineService {
33788
33839
  task = context.tasks[0];
33789
33840
  }
33790
33841
  const taskStr = JSON.stringify(task);
33791
- console.log('entryActionForStateOneTaskAssignedToUser: setting taskToComplete to ' + taskStr);
33842
+ console.log('entryActionForStateOneTaskAssignedToUser: setting client context task_data to ' + taskStr);
33792
33843
  // Store task to session
33793
- context.sessionStorageService.setItem('taskToComplete', taskStr);
33844
+ const clientContext = {
33845
+ client_context: {
33846
+ user_task: {
33847
+ task_data: task,
33848
+ complete_task: true
33849
+ }
33850
+ }
33851
+ };
33852
+ context.sessionStorageService.setItem('clientContext', JSON.stringify(clientContext));
33794
33853
  // Allow user to perform the event
33795
33854
  context.router.navigate([`/cases/case-details/${context.caseId}/trigger/${context.eventId}`], { relativeTo: context.route });
33796
33855
  }