@hmcts/ccd-case-ui-toolkit 7.0.60 → 7.0.61-task-changed-on-completion

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 (38) hide show
  1. package/esm2022/lib/app.config.mjs +1 -1
  2. package/esm2022/lib/shared/components/case-editor/case-edit/case-edit.component.mjs +12 -5
  3. package/esm2022/lib/shared/components/case-editor/case-editor.module.mjs +1 -1
  4. package/esm2022/lib/shared/components/case-editor/case-event-completion/case-event-completion.component.mjs +40 -28
  5. package/esm2022/lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-cancelled/case-event-completion-task-cancelled.component.mjs +18 -17
  6. package/esm2022/lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-reassigned/case-event-completion-task-reassigned.component.mjs +26 -38
  7. package/esm2022/lib/shared/components/case-editor/domain/event-completion-state-machine-context.model.mjs +1 -1
  8. package/esm2022/lib/shared/components/case-editor/domain/event-completion-task-states.model.mjs +6 -0
  9. package/esm2022/lib/shared/components/case-editor/services/event-completion-state-machine.service.mjs +10 -4
  10. package/esm2022/lib/shared/components/case-editor/services/work-allocation.service.mjs +8 -5
  11. package/esm2022/lib/shared/components/palette/palette.module.mjs +5 -1
  12. package/esm2022/lib/shared/domain/work-allocation/task-response.model.mjs +1 -1
  13. package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs +161 -130
  14. package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
  15. package/lib/app.config.d.ts +1 -0
  16. package/lib/app.config.d.ts.map +1 -1
  17. package/lib/shared/components/case-editor/case-edit/case-edit.component.d.ts +3 -1
  18. package/lib/shared/components/case-editor/case-edit/case-edit.component.d.ts.map +1 -1
  19. package/lib/shared/components/case-editor/case-editor.module.d.ts.map +1 -1
  20. package/lib/shared/components/case-editor/case-event-completion/case-event-completion.component.d.ts +5 -3
  21. package/lib/shared/components/case-editor/case-event-completion/case-event-completion.component.d.ts.map +1 -1
  22. package/lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-cancelled/case-event-completion-task-cancelled.component.d.ts +7 -5
  23. package/lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-cancelled/case-event-completion-task-cancelled.component.d.ts.map +1 -1
  24. package/lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-reassigned/case-event-completion-task-reassigned.component.d.ts +6 -11
  25. 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
  26. package/lib/shared/components/case-editor/domain/event-completion-state-machine-context.model.d.ts +1 -1
  27. package/lib/shared/components/case-editor/domain/event-completion-state-machine-context.model.d.ts.map +1 -1
  28. package/lib/shared/components/case-editor/domain/event-completion-task-states.model.d.ts +5 -0
  29. package/lib/shared/components/case-editor/domain/event-completion-task-states.model.d.ts.map +1 -0
  30. package/lib/shared/components/case-editor/services/event-completion-state-machine.service.d.ts.map +1 -1
  31. package/lib/shared/components/case-editor/services/work-allocation.service.d.ts +2 -2
  32. package/lib/shared/components/case-editor/services/work-allocation.service.d.ts.map +1 -1
  33. package/lib/shared/domain/work-allocation/task-response.model.d.ts +1 -1
  34. package/lib/shared/domain/work-allocation/task-response.model.d.ts.map +1 -1
  35. package/package.json +1 -1
  36. package/esm2022/lib/shared/components/case-editor/domain/event-completion-portal-types.model.mjs +0 -6
  37. package/lib/shared/components/case-editor/domain/event-completion-portal-types.model.d.ts +0 -5
  38. package/lib/shared/components/case-editor/domain/event-completion-portal-types.model.d.ts.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, Input, EventEmitter, Output, NgModule, ViewEncapsulation, forwardRef, Pipe, ViewChildren, ContentChildren, Injectable, Inject, ChangeDetectorRef, Directive, InjectionToken, Injector, ViewChild, HostListener, ViewContainerRef, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2
+ import { Component, Input, EventEmitter, Output, NgModule, ViewEncapsulation, forwardRef, Pipe, ViewChildren, ContentChildren, Injectable, Inject, ChangeDetectorRef, Directive, InjectionToken, ViewChild, HostListener, Injector, ViewContainerRef, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
3
3
  import * as i5 from '@angular/common';
4
4
  import { CommonModule, DOCUMENT, AsyncPipe, CurrencyPipe, formatDate } from '@angular/common';
5
5
  import * as i1 from 'rpx-xui-translation';
@@ -24,7 +24,6 @@ import { StateMachine } from '@edium/fsm';
24
24
  import * as i1$3 from '@angular/material/legacy-dialog';
25
25
  import { MAT_LEGACY_DIALOG_DATA, MatLegacyDialogModule } from '@angular/material/legacy-dialog';
26
26
  import { MatDialogConfig } from '@angular/material/dialog';
27
- import { ComponentPortal, PortalModule } from '@angular/cdk/portal';
28
27
  import * as i2 from '@nicky-lenaers/ngx-scroll-to';
29
28
  import { ScrollToModule } from '@nicky-lenaers/ngx-scroll-to';
30
29
  import * as marked from 'marked';
@@ -52,6 +51,7 @@ import * as i15 from '@angular/material/legacy-input';
52
51
  import { MatLegacyInputModule } from '@angular/material/legacy-input';
53
52
  import * as i14 from '@hmcts/media-viewer';
54
53
  import { MediaViewerModule } from '@hmcts/media-viewer';
54
+ import { PortalModule } from '@angular/cdk/portal';
55
55
  import * as i2$3 from 'ngx-pagination';
56
56
  import { NgxPaginationModule, PaginatePipe } from 'ngx-pagination';
57
57
  import * as i10 from '@angular/material/legacy-tabs';
@@ -8676,11 +8676,11 @@ var TaskState;
8676
8676
  TaskState["PendingReConfiguration"] = "PENDING_RECONFIGURATION";
8677
8677
  })(TaskState || (TaskState = {}));
8678
8678
 
8679
- var EventCompletionPortalTypes;
8680
- (function (EventCompletionPortalTypes) {
8681
- EventCompletionPortalTypes[EventCompletionPortalTypes["TaskCancelled"] = 0] = "TaskCancelled";
8682
- EventCompletionPortalTypes[EventCompletionPortalTypes["TaskReassigned"] = 1] = "TaskReassigned";
8683
- })(EventCompletionPortalTypes || (EventCompletionPortalTypes = {}));
8679
+ var EventCompletionTaskStates;
8680
+ (function (EventCompletionTaskStates) {
8681
+ EventCompletionTaskStates[EventCompletionTaskStates["TaskCancelled"] = 0] = "TaskCancelled";
8682
+ EventCompletionTaskStates[EventCompletionTaskStates["TaskReassigned"] = 1] = "TaskReassigned";
8683
+ })(EventCompletionTaskStates || (EventCompletionTaskStates = {}));
8684
8684
 
8685
8685
  const EVENT_COMPLETION_STATE_MACHINE = 'EVENT COMPLETION STATE MACHINE';
8686
8686
  class EventCompletionStateMachineService {
@@ -8719,6 +8719,7 @@ class EventCompletionStateMachineService {
8719
8719
  this.addTransitionsForStateTaskUnassigned();
8720
8720
  }
8721
8721
  entryActionForStateCheckTasksCanBeCompleted(state, context) {
8722
+ const assignNeeded = context.sessionStorageService.getItem('assignNeeded');
8722
8723
  context.workAllocationService.getTask(context.task.id).subscribe(taskResponse => {
8723
8724
  if (taskResponse && taskResponse.task && taskResponse.task.task_state) {
8724
8725
  switch (taskResponse.task.task_state.toUpperCase()) {
@@ -8738,6 +8739,11 @@ class EventCompletionStateMachineService {
8738
8739
  // Task still assigned to current user, complete event and task
8739
8740
  state.trigger(EventCompletionStates.CompleteEventAndTask);
8740
8741
  }
8742
+ else if (assignNeeded === 'true - override') {
8743
+ // this will treat task as unassigned instead of reassigned to complete after user confirmation
8744
+ // assignNeeded will also be immediately overwritten to true
8745
+ state.trigger(EventCompletionStates.TaskUnassigned);
8746
+ }
8741
8747
  else {
8742
8748
  // Task has been reassigned to another user, display error message
8743
8749
  context.reassignedTask = taskResponse.task;
@@ -8759,7 +8765,7 @@ class EventCompletionStateMachineService {
8759
8765
  // Trigger final state to complete processing of state machine
8760
8766
  state.trigger(EventCompletionStates.Final);
8761
8767
  // Load case event completion task cancelled component
8762
- context.component.showPortal(EventCompletionPortalTypes.TaskCancelled);
8768
+ context.component.setTaskState(EventCompletionTaskStates.TaskCancelled);
8763
8769
  }
8764
8770
  entryActionForStateCompleteEventAndTask(state, context) {
8765
8771
  // Trigger final state to complete processing of state machine
@@ -8779,7 +8785,7 @@ class EventCompletionStateMachineService {
8779
8785
  // Trigger final state to complete processing of state machine
8780
8786
  state.trigger(EventCompletionStates.Final);
8781
8787
  // Load case event completion task reassigned component
8782
- context.component.showPortal(EventCompletionPortalTypes.TaskReassigned);
8788
+ context.component.setTaskState(EventCompletionTaskStates.TaskReassigned);
8783
8789
  }
8784
8790
  entryActionForStateTaskUnassigned(state, context) {
8785
8791
  // Trigger final state to complete processing of state machine
@@ -8948,7 +8954,7 @@ class WorkAllocationService {
8948
8954
  isWAEnabled(jurisdiction, caseType) {
8949
8955
  this.features = this.appConfig.getWAServiceConfig();
8950
8956
  const ftstr = JSON.stringify(this.features);
8951
- console.log(`isWAEnabled: ${ftstr}`);
8957
+ this.appConfig.logMessage(`isWAEnabled: wa-service-config returning ${ftstr.length > 0}`);
8952
8958
  let enabled = false;
8953
8959
  if (!jurisdiction || !caseType) {
8954
8960
  const caseInfo = JSON.parse(this.sessionStorageService.getItem('caseInfo'));
@@ -8956,7 +8962,7 @@ class WorkAllocationService {
8956
8962
  caseType = caseInfo.caseType;
8957
8963
  }
8958
8964
  if (!this.features || !this.features.configurations) {
8959
- console.log('isWAEnabled: no features');
8965
+ this.appConfig.logMessage('isWAEnabled: no features');
8960
8966
  return false;
8961
8967
  }
8962
8968
  this.features.configurations.forEach(serviceConfig => {
@@ -8964,7 +8970,7 @@ class WorkAllocationService {
8964
8970
  enabled = true;
8965
8971
  }
8966
8972
  });
8967
- console.log(`isWAEnabled: returning ${enabled}`);
8973
+ this.appConfig.logMessage(`isWAEnabled: returning ${enabled}`);
8968
8974
  return enabled;
8969
8975
  }
8970
8976
  /**
@@ -8992,7 +8998,7 @@ class WorkAllocationService {
8992
8998
  if (!this.isWAEnabled()) {
8993
8999
  return of(null);
8994
9000
  }
8995
- console.log(`completeTask: completing ${taskId}`);
9001
+ this.appConfig.logMessage(`completeTask: completing ${taskId}`);
8996
9002
  const url = `${this.appConfig.getWorkAllocationApiUrl()}/task/${taskId}/complete`;
8997
9003
  return this.http
8998
9004
  .post(url, { actionByEvent: true, eventName: eventName })
@@ -9013,6 +9019,7 @@ class WorkAllocationService {
9013
9019
  if (!this.isWAEnabled()) {
9014
9020
  return of(null);
9015
9021
  }
9022
+ this.appConfig.logMessage(`assignAndCompleteTask: completing ${taskId}`);
9016
9023
  const url = `${this.appConfig.getWorkAllocationApiUrl()}/task/${taskId}/complete`;
9017
9024
  return this.http
9018
9025
  .post(url, {
@@ -9100,6 +9107,7 @@ class WorkAllocationService {
9100
9107
  tasks: []
9101
9108
  };
9102
9109
  if (!this.isWAEnabled()) {
9110
+ this.appConfig.logMessage(`isWAEnabled false for ${caseId} in event ${eventId}`);
9103
9111
  return of(defaultPayload);
9104
9112
  }
9105
9113
  return this.http.get(`${this.appConfig.getWorkAllocationApiUrl()}/case/tasks/${caseId}/event/${eventId}/caseType/${caseType}/jurisdiction/${jurisdiction}`);
@@ -9111,6 +9119,7 @@ class WorkAllocationService {
9111
9119
  if (!this.isWAEnabled()) {
9112
9120
  return of({ task: null });
9113
9121
  }
9122
+ this.appConfig.logMessage(`getTask: ${taskId}`);
9114
9123
  return this.http.get(`${this.appConfig.getWorkAllocationApiUrl()}/task/${taskId}`);
9115
9124
  }
9116
9125
  static ɵfac = function WorkAllocationService_Factory(t) { return new (t || WorkAllocationService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(HttpErrorService), i0.ɵɵinject(AlertService), i0.ɵɵinject(SessionStorageService)); };
@@ -9173,6 +9182,7 @@ class CaseEditComponent {
9173
9182
  validPageListCaseFieldsService;
9174
9183
  workAllocationService;
9175
9184
  alertService;
9185
+ abstractConfig;
9176
9186
  static ORIGIN_QUERY_PARAM = 'origin';
9177
9187
  static ALERT_MESSAGE = 'Page is being refreshed so you will be redirected to the first page of this event.';
9178
9188
  eventTrigger;
@@ -9198,7 +9208,7 @@ class CaseEditComponent {
9198
9208
  error;
9199
9209
  callbackErrorsSubject = new Subject();
9200
9210
  validPageList = [];
9201
- constructor(fb, caseNotifier, router, route, fieldsUtils, fieldsPurger, registrarService, wizardFactory, sessionStorageService, windowsService, formValueService, formErrorService, loadingService, validPageListCaseFieldsService, workAllocationService, alertService) {
9211
+ constructor(fb, caseNotifier, router, route, fieldsUtils, fieldsPurger, registrarService, wizardFactory, sessionStorageService, windowsService, formValueService, formErrorService, loadingService, validPageListCaseFieldsService, workAllocationService, alertService, abstractConfig) {
9202
9212
  this.fb = fb;
9203
9213
  this.caseNotifier = caseNotifier;
9204
9214
  this.router = router;
@@ -9215,6 +9225,7 @@ class CaseEditComponent {
9215
9225
  this.validPageListCaseFieldsService = validPageListCaseFieldsService;
9216
9226
  this.workAllocationService = workAllocationService;
9217
9227
  this.alertService = alertService;
9228
+ this.abstractConfig = abstractConfig;
9218
9229
  }
9219
9230
  ngOnInit() {
9220
9231
  this.wizard = this.wizardFactory.create(this.eventTrigger);
@@ -9338,6 +9349,7 @@ class CaseEditComponent {
9338
9349
  const eventId = this.getEventId(form);
9339
9350
  const caseId = this.getCaseId(caseDetails);
9340
9351
  if (this.taskExistsForThisEventAndCase(taskInSessionStorage, taskEventInSessionStorage, eventId, caseId)) {
9352
+ this.abstractConfig.logMessage(`task exist for this event for caseId and eventId as ${caseId} ${eventId}`);
9341
9353
  // Show event completion component to perform event completion checks
9342
9354
  this.eventCompletionParams = ({
9343
9355
  caseId,
@@ -9545,10 +9557,12 @@ class CaseEditComponent {
9545
9557
  const assignNeeded = this.sessionStorageService.getItem('assignNeeded') === 'true';
9546
9558
  if (taskStr && assignNeeded) {
9547
9559
  const task = JSON.parse(taskStr);
9560
+ this.abstractConfig.logMessage(`postCompleteTaskIfRequired with assignNeeded: taskId ${task.id} and event name ${this.eventTrigger.name}`);
9548
9561
  return this.workAllocationService.assignAndCompleteTask(task.id, this.eventTrigger.name);
9549
9562
  }
9550
9563
  else if (taskStr) {
9551
9564
  const task = JSON.parse(taskStr);
9565
+ this.abstractConfig.logMessage(`postCompleteTaskIfRequired: taskId ${task.id} and event name ${this.eventTrigger.name}`);
9552
9566
  return this.workAllocationService.completeTask(task.id, this.eventTrigger.name);
9553
9567
  }
9554
9568
  return of(true);
@@ -9608,7 +9622,7 @@ class CaseEditComponent {
9608
9622
  hasCallbackFailed(response) {
9609
9623
  return response['callback_response_status'] !== 'CALLBACK_COMPLETED';
9610
9624
  }
9611
- static ɵfac = function CaseEditComponent_Factory(t) { return new (t || CaseEditComponent)(i0.ɵɵdirectiveInject(i4.FormBuilder), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(FieldsUtils), i0.ɵɵdirectiveInject(FieldsPurger), i0.ɵɵdirectiveInject(ConditionalShowRegistrarService), i0.ɵɵdirectiveInject(WizardFactoryService), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(WindowService), i0.ɵɵdirectiveInject(FormValueService), i0.ɵɵdirectiveInject(FormErrorService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(ValidPageListCaseFieldsService), i0.ɵɵdirectiveInject(WorkAllocationService), i0.ɵɵdirectiveInject(AlertService)); };
9625
+ static ɵfac = function CaseEditComponent_Factory(t) { return new (t || CaseEditComponent)(i0.ɵɵdirectiveInject(i4.FormBuilder), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(FieldsUtils), i0.ɵɵdirectiveInject(FieldsPurger), i0.ɵɵdirectiveInject(ConditionalShowRegistrarService), i0.ɵɵdirectiveInject(WizardFactoryService), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(WindowService), i0.ɵɵdirectiveInject(FormValueService), i0.ɵɵdirectiveInject(FormErrorService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(ValidPageListCaseFieldsService), i0.ɵɵdirectiveInject(WorkAllocationService), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(AbstractAppConfig)); };
9612
9626
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditComponent, selectors: [["ccd-case-edit"]], inputs: { eventTrigger: "eventTrigger", submit: "submit", validate: "validate", saveDraft: "saveDraft", caseDetails: "caseDetails" }, outputs: { cancelled: "cancelled", submitted: "submitted" }, features: [i0.ɵɵProvidersFeature([GreyBarService])], decls: 1, vars: 0, template: function CaseEditComponent_Template(rf, ctx) { if (rf & 1) {
9613
9627
  i0.ɵɵelement(0, "router-outlet");
9614
9628
  } }, dependencies: [i1$1.RouterOutlet], styles: ["#fieldset-case-data[_ngcontent-%COMP%]{margin-bottom:30px}#fieldset-case-data[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{width:1%;white-space:nowrap;vertical-align:top}.compound-field[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:0}#confirmation-header[_ngcontent-%COMP%]{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body[_ngcontent-%COMP%]{width:630px;background-color:#fff}.valign-top[_ngcontent-%COMP%]{vertical-align:top}.summary-fields[_ngcontent-%COMP%]{margin-bottom:30px}.summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .summary-fields[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:0px}a.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:default}.case-field-label[_ngcontent-%COMP%]{width:45%}.case-field-content[_ngcontent-%COMP%]{width:50%}.no-bottom-border[_ngcontent-%COMP%]{border-bottom:none}.case-field-change[_ngcontent-%COMP%]{width:5%}"] });
@@ -9616,7 +9630,7 @@ class CaseEditComponent {
9616
9630
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditComponent, [{
9617
9631
  type: Component,
9618
9632
  args: [{ selector: 'ccd-case-edit', providers: [GreyBarService], template: "<router-outlet></router-outlet>\n", styles: ["#fieldset-case-data{margin-bottom:30px}#fieldset-case-data th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}#confirmation-header{width:630px;background-color:#17958b;border:solid 1px #979797;color:#fff;text-align:center}#confirmation-body{width:630px;background-color:#fff}.valign-top{vertical-align:top}.summary-fields{margin-bottom:30px}.summary-fields tbody tr th,.summary-fields tbody tr td{border-bottom:0px}a.disabled{pointer-events:none;cursor:default}.case-field-label{width:45%}.case-field-content{width:50%}.no-bottom-border{border-bottom:none}.case-field-change{width:5%}\n"] }]
9619
- }], () => [{ type: i4.FormBuilder }, { type: CaseNotifier }, { type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: FieldsUtils }, { type: FieldsPurger }, { type: ConditionalShowRegistrarService }, { type: WizardFactoryService }, { type: SessionStorageService }, { type: WindowService }, { type: FormValueService }, { type: FormErrorService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }, { type: WorkAllocationService }, { type: AlertService }], { eventTrigger: [{
9633
+ }], () => [{ type: i4.FormBuilder }, { type: CaseNotifier }, { type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: FieldsUtils }, { type: FieldsPurger }, { type: ConditionalShowRegistrarService }, { type: WizardFactoryService }, { type: SessionStorageService }, { type: WindowService }, { type: FormValueService }, { type: FormErrorService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }, { type: WorkAllocationService }, { type: AlertService }, { type: AbstractAppConfig }], { eventTrigger: [{
9620
9634
  type: Input
9621
9635
  }], submit: [{
9622
9636
  type: Input
@@ -9631,7 +9645,7 @@ class CaseEditComponent {
9631
9645
  }], submitted: [{
9632
9646
  type: Output
9633
9647
  }] }); })();
9634
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditComponent, { className: "CaseEditComponent", filePath: "lib/shared/components/case-editor/case-edit/case-edit.component.ts", lineNumber: 33 }); })();
9648
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditComponent, { className: "CaseEditComponent", filePath: "lib/shared/components/case-editor/case-edit/case-edit.component.ts", lineNumber: 34 }); })();
9635
9649
 
9636
9650
  function CaseEditConfirmComponent_div_3_Template(rf, ctx) { if (rf & 1) {
9637
9651
  i0.ɵɵelement(0, "div");
@@ -10950,20 +10964,118 @@ class CallbackErrorsComponent {
10950
10964
  }] }); })();
10951
10965
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CallbackErrorsComponent, { className: "CallbackErrorsComponent", filePath: "lib/shared/components/error/callback-errors.component.ts", lineNumber: 10 }); })();
10952
10966
 
10967
+ function CaseEventCompletionComponent_app_case_event_completion_task_cancelled_0_Template(rf, ctx) { if (rf & 1) {
10968
+ const _r1 = i0.ɵɵgetCurrentView();
10969
+ i0.ɵɵelementStart(0, "app-case-event-completion-task-cancelled", 2);
10970
+ i0.ɵɵlistener("notifyEventCompletionCancelled", function CaseEventCompletionComponent_app_case_event_completion_task_cancelled_0_Template_app_case_event_completion_task_cancelled_notifyEventCompletionCancelled_0_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.setEventCanBeCompleted($event)); });
10971
+ i0.ɵɵelementEnd();
10972
+ } if (rf & 2) {
10973
+ const ctx_r1 = i0.ɵɵnextContext();
10974
+ i0.ɵɵproperty("context", ctx_r1.context);
10975
+ } }
10976
+ function CaseEventCompletionComponent_app_case_event_completion_task_reassigned_1_Template(rf, ctx) { if (rf & 1) {
10977
+ const _r3 = i0.ɵɵgetCurrentView();
10978
+ i0.ɵɵelementStart(0, "app-case-event-completion-task-reassigned", 3);
10979
+ i0.ɵɵlistener("notifyEventCompletionReassigned", function CaseEventCompletionComponent_app_case_event_completion_task_reassigned_1_Template_app_case_event_completion_task_reassigned_notifyEventCompletionReassigned_0_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.setEventCanBeCompleted($event)); });
10980
+ i0.ɵɵelementEnd();
10981
+ } if (rf & 2) {
10982
+ const ctx_r1 = i0.ɵɵnextContext();
10983
+ i0.ɵɵproperty("context", ctx_r1.context);
10984
+ } }
10985
+ const COMPONENT_PORTAL_INJECTION_TOKEN = new InjectionToken('');
10986
+ class CaseEventCompletionComponent {
10987
+ service;
10988
+ router;
10989
+ route;
10990
+ sessionStorageService;
10991
+ workAllocationService;
10992
+ alertService;
10993
+ eventCompletionParams;
10994
+ eventCanBeCompleted = new EventEmitter();
10995
+ eventCompletionTaskStates = EventCompletionTaskStates;
10996
+ stateMachine;
10997
+ context;
10998
+ taskState;
10999
+ constructor(service, router, route, sessionStorageService, workAllocationService, alertService) {
11000
+ this.service = service;
11001
+ this.router = router;
11002
+ this.route = route;
11003
+ this.sessionStorageService = sessionStorageService;
11004
+ this.workAllocationService = workAllocationService;
11005
+ this.alertService = alertService;
11006
+ }
11007
+ ngOnChanges(changes) {
11008
+ if (changes.eventCompletionParams?.currentValue) {
11009
+ // Setup the context
11010
+ this.context = {
11011
+ task: this.eventCompletionParams.task,
11012
+ caseId: this.eventCompletionParams.caseId,
11013
+ eventId: this.eventCompletionParams.eventId,
11014
+ reassignedTask: null,
11015
+ router: this.router,
11016
+ route: this.route,
11017
+ sessionStorageService: this.sessionStorageService,
11018
+ workAllocationService: this.workAllocationService,
11019
+ alertService: this.alertService,
11020
+ canBeCompleted: false,
11021
+ component: this
11022
+ };
11023
+ // Initialise state machine
11024
+ this.stateMachine = this.service.initialiseStateMachine(this.context);
11025
+ // Create states
11026
+ this.service.createStates(this.stateMachine);
11027
+ // Add transitions for the states
11028
+ this.service.addTransitions();
11029
+ // Start state machine
11030
+ this.service.startStateMachine(this.stateMachine);
11031
+ }
11032
+ }
11033
+ setTaskState(taskState) {
11034
+ this.taskState = taskState;
11035
+ }
11036
+ setEventCanBeCompleted(completable) {
11037
+ // note: event not completed from here as will then skip task completion
11038
+ if (!completable) {
11039
+ // if event cannot be completed ensure that this is communicated
11040
+ // otherwise this will be handled via onchanges
11041
+ this.eventCanBeCompleted.emit(completable);
11042
+ }
11043
+ }
11044
+ static ɵfac = function CaseEventCompletionComponent_Factory(t) { return new (t || CaseEventCompletionComponent)(i0.ɵɵdirectiveInject(EventCompletionStateMachineService), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(WorkAllocationService), i0.ɵɵdirectiveInject(AlertService)); };
11045
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEventCompletionComponent, selectors: [["ccd-case-event-completion"]], inputs: { eventCompletionParams: "eventCompletionParams" }, outputs: { eventCanBeCompleted: "eventCanBeCompleted" }, features: [i0.ɵɵNgOnChangesFeature], decls: 2, vars: 2, consts: [[3, "context", "notifyEventCompletionCancelled", 4, "ngIf"], [3, "context", "notifyEventCompletionReassigned", 4, "ngIf"], [3, "notifyEventCompletionCancelled", "context"], [3, "notifyEventCompletionReassigned", "context"]], template: function CaseEventCompletionComponent_Template(rf, ctx) { if (rf & 1) {
11046
+ i0.ɵɵtemplate(0, CaseEventCompletionComponent_app_case_event_completion_task_cancelled_0_Template, 1, 1, "app-case-event-completion-task-cancelled", 0)(1, CaseEventCompletionComponent_app_case_event_completion_task_reassigned_1_Template, 1, 1, "app-case-event-completion-task-reassigned", 1);
11047
+ } if (rf & 2) {
11048
+ i0.ɵɵproperty("ngIf", ctx.taskState === ctx.eventCompletionTaskStates.TaskCancelled);
11049
+ i0.ɵɵadvance();
11050
+ i0.ɵɵproperty("ngIf", ctx.taskState === ctx.eventCompletionTaskStates.TaskReassigned);
11051
+ } }, encapsulation: 2 });
11052
+ }
11053
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEventCompletionComponent, [{
11054
+ type: Component,
11055
+ args: [{ selector: 'ccd-case-event-completion', template: "<app-case-event-completion-task-cancelled\n *ngIf=\"taskState === eventCompletionTaskStates.TaskCancelled\"\n [context]=\"context\"\n (notifyEventCompletionCancelled)=\"setEventCanBeCompleted($event)\">\n</app-case-event-completion-task-cancelled>\n<app-case-event-completion-task-reassigned\n *ngIf=\"taskState === eventCompletionTaskStates.TaskReassigned\"\n [context]=\"context\"\n (notifyEventCompletionReassigned)=\"setEventCanBeCompleted($event)\">\n</app-case-event-completion-task-reassigned>" }]
11056
+ }], () => [{ type: EventCompletionStateMachineService }, { type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: SessionStorageService }, { type: WorkAllocationService }, { type: AlertService }], { eventCompletionParams: [{
11057
+ type: Input
11058
+ }], eventCanBeCompleted: [{
11059
+ type: Output
11060
+ }] }); })();
11061
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEventCompletionComponent, { className: "CaseEventCompletionComponent", filePath: "lib/shared/components/case-editor/case-event-completion/case-event-completion.component.ts", lineNumber: 20 }); })();
11062
+
10953
11063
  const _c0$X = a0 => ["/", "cases", "case-details", a0, "tasks"];
10954
11064
  class CaseEventCompletionTaskCancelledComponent {
10955
- parentComponent;
11065
+ context;
11066
+ notifyEventCompletionCancelled = new EventEmitter();
10956
11067
  caseId;
10957
- constructor(parentComponent) {
10958
- this.parentComponent = parentComponent;
10959
- this.caseId = this.parentComponent.context.caseId;
11068
+ ngOnInit() {
11069
+ this.caseId = this.context.caseId;
10960
11070
  }
10961
11071
  onContinue() {
10962
- // Emit event can be completed event
10963
- this.parentComponent.eventCanBeCompleted.emit(true);
11072
+ // Removes task to complete so event completes without task
11073
+ this.context.sessionStorageService.removeItem('taskToComplete');
11074
+ // may be able to remove this call below since it is now unneccesary
11075
+ this.notifyEventCompletionCancelled.emit(true);
10964
11076
  }
10965
- static ɵfac = function CaseEventCompletionTaskCancelledComponent_Factory(t) { return new (t || CaseEventCompletionTaskCancelledComponent)(i0.ɵɵdirectiveInject(COMPONENT_PORTAL_INJECTION_TOKEN)); };
10966
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEventCompletionTaskCancelledComponent, selectors: [["app-case-event-completion-task-cancelled"]], decls: 31, vars: 27, consts: [[1, "govuk-!-margin-9"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], ["href", "#"], [1, "govuk-form-group", "govuk-form-group--error"], [1, "govuk-heading-m"], [1, "form-group", "form-group-related"], ["data-module", "govuk-button", 1, "govuk-button", "govuk-!-margin-right-2", 3, "click"], ["data-module", "govuk-button", 1, "govuk-button", "govuk-button--secondary", 3, "routerLink"]], template: function CaseEventCompletionTaskCancelledComponent_Template(rf, ctx) { if (rf & 1) {
11077
+ static ɵfac = function CaseEventCompletionTaskCancelledComponent_Factory(t) { return new (t || CaseEventCompletionTaskCancelledComponent)(); };
11078
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEventCompletionTaskCancelledComponent, selectors: [["app-case-event-completion-task-cancelled"]], inputs: { context: "context" }, outputs: { notifyEventCompletionCancelled: "notifyEventCompletionCancelled" }, decls: 31, vars: 27, consts: [[1, "govuk-!-margin-9"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], ["href", "#"], [1, "govuk-form-group", "govuk-form-group--error"], [1, "govuk-heading-m"], [1, "form-group", "form-group-related"], ["data-module", "govuk-button", 1, "govuk-button", "govuk-!-margin-right-2", 3, "click"], ["data-module", "govuk-button", 1, "govuk-button", "govuk-button--secondary", 3, "routerLink"]], template: function CaseEventCompletionTaskCancelledComponent_Template(rf, ctx) { if (rf & 1) {
10967
11079
  i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "h2", 2);
10968
11080
  i0.ɵɵtext(3);
10969
11081
  i0.ɵɵpipe(4, "rpxTranslate");
@@ -11021,11 +11133,12 @@ class CaseEventCompletionTaskCancelledComponent {
11021
11133
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEventCompletionTaskCancelledComponent, [{
11022
11134
  type: Component,
11023
11135
  args: [{ selector: 'app-case-event-completion-task-cancelled', template: "<div class=\"govuk-!-margin-9\">\n <div class=\"govuk-error-summary\" aria-labelledby=\"error-summary-title\" role=\"alert\" tabindex=\"-1\" data-module=\"error-summary\">\n <h2 class=\"govuk-error-summary__title\" id=\"error-summary-title\">\n {{'There is a problem' | rpxTranslate}}\n </h2>\n <div class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li>\n <a href=\"#\">{{'Task cancelled/marked as done' | rpxTranslate}}</a>\n </li>\n </ul>\n </div>\n </div>\n\n <div class=\"govuk-form-group govuk-form-group--error\">\n <h2 class=\"govuk-heading-m\">{{'Task cancelled/marked as done' | rpxTranslate}}</h2>\n <p>{{'This task has been cancelled or marked as done.' | rpxTranslate}}</p>\n <p>{{'Click Continue to complete the event and save your progress.' | rpxTranslate}}</p>\n\n <p>{{'Alternatively, click Cancel to return to the tasks tab without saving your progress.' | rpxTranslate}}</p>\n\n <div class=\"form-group form-group-related\">\n <button class=\"govuk-button govuk-!-margin-right-2\" data-module=\"govuk-button\" (click)=\"onContinue()\">\n {{'Continue' | rpxTranslate}}\n </button>\n <a [routerLink]=\"['/', 'cases', 'case-details', caseId, 'tasks']\"\n class=\"govuk-button govuk-button--secondary\" data-module=\"govuk-button\">\n {{'Cancel' | rpxTranslate}}\n </a>\n </div>\n </div>\n</div>\n" }]
11024
- }], () => [{ type: CaseEventCompletionComponent, decorators: [{
11025
- type: Inject,
11026
- args: [COMPONENT_PORTAL_INJECTION_TOKEN]
11027
- }] }], null); })();
11028
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEventCompletionTaskCancelledComponent, { className: "CaseEventCompletionTaskCancelledComponent", filePath: "lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-cancelled/case-event-completion-task-cancelled.component.ts", lineNumber: 8 }); })();
11136
+ }], null, { context: [{
11137
+ type: Input
11138
+ }], notifyEventCompletionCancelled: [{
11139
+ type: Output
11140
+ }] }); })();
11141
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEventCompletionTaskCancelledComponent, { className: "CaseEventCompletionTaskCancelledComponent", filePath: "lib/shared/components/case-editor/case-event-completion/components/case-event-completion-task-cancelled/case-event-completion-task-cancelled.component.ts", lineNumber: 9 }); })();
11029
11142
 
11030
11143
  const _c0$W = a0 => ["/", "cases", "case-details", a0, "tasks"];
11031
11144
  function CaseEventCompletionTaskReassignedComponent_div_0_Template(rf, ctx) { if (rf & 1) {
@@ -11085,32 +11198,26 @@ function CaseEventCompletionTaskReassignedComponent_div_0_Template(rf, ctx) { if
11085
11198
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(30, 24, "Cancel"), " ");
11086
11199
  } }
11087
11200
  class CaseEventCompletionTaskReassignedComponent {
11088
- parentComponent;
11089
- route;
11090
- workAllocationService;
11091
11201
  sessionStorageService;
11092
11202
  judicialworkerService;
11093
11203
  caseworkerService;
11094
- alertService;
11204
+ context;
11205
+ notifyEventCompletionReassigned = new EventEmitter();
11095
11206
  caseId;
11096
11207
  assignedUserId;
11097
11208
  assignedUserName;
11098
11209
  subscription;
11099
11210
  caseworkerSubscription;
11100
11211
  judicialworkerSubscription;
11101
- constructor(parentComponent, route, workAllocationService, sessionStorageService, judicialworkerService, caseworkerService, alertService) {
11102
- this.parentComponent = parentComponent;
11103
- this.route = route;
11104
- this.workAllocationService = workAllocationService;
11212
+ constructor(sessionStorageService, judicialworkerService, caseworkerService) {
11105
11213
  this.sessionStorageService = sessionStorageService;
11106
11214
  this.judicialworkerService = judicialworkerService;
11107
11215
  this.caseworkerService = caseworkerService;
11108
- this.alertService = alertService;
11109
11216
  }
11110
11217
  ngOnInit() {
11111
11218
  // Get case id and task from the parent component
11112
- this.caseId = this.parentComponent.context.caseId;
11113
- const task = this.parentComponent.context.reassignedTask;
11219
+ this.caseId = this.context.caseId;
11220
+ const task = this.context.reassignedTask;
11114
11221
  // Current user is a caseworker?
11115
11222
  this.caseworkerSubscription = this.caseworkerService.getCaseworkers(task.jurisdiction).subscribe(result => {
11116
11223
  if (result && result[0].service === task.jurisdiction && result[0].caseworkers) {
@@ -11151,17 +11258,17 @@ class CaseEventCompletionTaskReassignedComponent {
11151
11258
  // Get task details
11152
11259
  const taskStr = this.sessionStorageService.getItem('taskToComplete');
11153
11260
  if (taskStr) {
11154
- this.sessionStorageService.setItem('assignNeeded', 'true');
11155
- // set event can be completed to true
11156
- this.parentComponent.eventCanBeCompleted.emit(true);
11261
+ // Set session to override reassignment settings so code flow does not return to this component
11262
+ this.sessionStorageService.setItem('assignNeeded', 'true - override');
11263
+ this.notifyEventCompletionReassigned.emit(true);
11157
11264
  }
11158
11265
  else {
11159
11266
  // Emit event cannot be completed event
11160
- this.parentComponent.eventCanBeCompleted.emit(false);
11267
+ this.notifyEventCompletionReassigned.emit(false);
11161
11268
  }
11162
11269
  }
11163
- static ɵfac = function CaseEventCompletionTaskReassignedComponent_Factory(t) { return new (t || CaseEventCompletionTaskReassignedComponent)(i0.ɵɵdirectiveInject(COMPONENT_PORTAL_INJECTION_TOKEN), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(WorkAllocationService), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(JudicialworkerService), i0.ɵɵdirectiveInject(CaseworkerService), i0.ɵɵdirectiveInject(AlertService)); };
11164
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEventCompletionTaskReassignedComponent, selectors: [["app-case-event-completion-task-reassigned"]], decls: 1, vars: 1, consts: [["class", "govuk-!-margin-9", 4, "ngIf"], [1, "govuk-!-margin-9"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], ["href", "#"], [1, "govuk-form-group", "govuk-form-group--error"], [1, "govuk-heading-m"], [1, "form-group", "form-group-related"], ["data-module", "govuk-button", 1, "govuk-button", "govuk-!-margin-right-2", 3, "click"], ["data-module", "govuk-button", 1, "govuk-button", "govuk-button--secondary", 3, "routerLink"]], template: function CaseEventCompletionTaskReassignedComponent_Template(rf, ctx) { if (rf & 1) {
11270
+ static ɵfac = function CaseEventCompletionTaskReassignedComponent_Factory(t) { return new (t || CaseEventCompletionTaskReassignedComponent)(i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(JudicialworkerService), i0.ɵɵdirectiveInject(CaseworkerService)); };
11271
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEventCompletionTaskReassignedComponent, selectors: [["app-case-event-completion-task-reassigned"]], inputs: { context: "context" }, outputs: { notifyEventCompletionReassigned: "notifyEventCompletionReassigned" }, decls: 1, vars: 1, consts: [["class", "govuk-!-margin-9", 4, "ngIf"], [1, "govuk-!-margin-9"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], ["href", "#"], [1, "govuk-form-group", "govuk-form-group--error"], [1, "govuk-heading-m"], [1, "form-group", "form-group-related"], ["data-module", "govuk-button", 1, "govuk-button", "govuk-!-margin-right-2", 3, "click"], ["data-module", "govuk-button", 1, "govuk-button", "govuk-button--secondary", 3, "routerLink"]], template: function CaseEventCompletionTaskReassignedComponent_Template(rf, ctx) { if (rf & 1) {
11165
11272
  i0.ɵɵtemplate(0, CaseEventCompletionTaskReassignedComponent_div_0_Template, 31, 28, "div", 0);
11166
11273
  } if (rf & 2) {
11167
11274
  i0.ɵɵproperty("ngIf", ctx.assignedUserName);
@@ -11170,92 +11277,12 @@ class CaseEventCompletionTaskReassignedComponent {
11170
11277
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEventCompletionTaskReassignedComponent, [{
11171
11278
  type: Component,
11172
11279
  args: [{ selector: 'app-case-event-completion-task-reassigned', template: "<div class=\"govuk-!-margin-9\" *ngIf=\"assignedUserName\">\n <div class=\"govuk-error-summary\" aria-labelledby=\"error-summary-title\" role=\"alert\" tabindex=\"-1\"\n data-module=\"error-summary\">\n <h2 class=\"govuk-error-summary__title\" id=\"error-summary-title\">\n {{'There is a problem' | rpxTranslate}}\n </h2>\n <div class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li>\n <a href=\"#\">{{'Task reassigned' | rpxTranslate}}</a>\n </li>\n </ul>\n </div>\n </div>\n\n <div class=\"govuk-form-group govuk-form-group--error\">\n <h2 class=\"govuk-heading-m\">{{'Task reassigned' | rpxTranslate}}</h2>\n <p>{{'This task has been reassigned to' | rpxTranslate}} {{assignedUserName}}.</p>\n <p>{{'Click Continue to reassign the task to you and save your progress.' | rpxTranslate}}</p>\n <p>{{'Alternatively, click Cancel to return to the tasks tab without saving your progress.' | rpxTranslate}}</p>\n <div class=\"form-group form-group-related\">\n <button class=\"govuk-button govuk-!-margin-right-2\" data-module=\"govuk-button\" (click)=\"onContinue()\">\n {{'Continue' | rpxTranslate}}\n </button>\n <a [routerLink]=\"['/', 'cases', 'case-details', caseId, 'tasks']\"\n class=\"govuk-button govuk-button--secondary\" data-module=\"govuk-button\">\n {{'Cancel' | rpxTranslate}}\n </a>\n </div>\n </div>\n</div>\n" }]
11173
- }], () => [{ type: CaseEventCompletionComponent, decorators: [{
11174
- type: Inject,
11175
- args: [COMPONENT_PORTAL_INJECTION_TOKEN]
11176
- }] }, { type: i1$1.ActivatedRoute }, { type: WorkAllocationService }, { type: SessionStorageService }, { type: JudicialworkerService }, { type: CaseworkerService }, { type: AlertService }], null); })();
11177
- (() => { (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 }); })();
11178
-
11179
- function CaseEventCompletionComponent_ng_template_0_Template(rf, ctx) { }
11180
- const COMPONENT_PORTAL_INJECTION_TOKEN = new InjectionToken('');
11181
- class CaseEventCompletionComponent {
11182
- service;
11183
- router;
11184
- route;
11185
- sessionStorageService;
11186
- workAllocationService;
11187
- alertService;
11188
- eventCompletionParams;
11189
- eventCanBeCompleted = new EventEmitter();
11190
- stateMachine;
11191
- context;
11192
- selectedComponentPortal;
11193
- constructor(service, router, route, sessionStorageService, workAllocationService, alertService) {
11194
- this.service = service;
11195
- this.router = router;
11196
- this.route = route;
11197
- this.sessionStorageService = sessionStorageService;
11198
- this.workAllocationService = workAllocationService;
11199
- this.alertService = alertService;
11200
- }
11201
- ngOnChanges(changes) {
11202
- if (changes.eventCompletionParams && changes.eventCompletionParams.currentValue) {
11203
- // Setup the context
11204
- this.context = {
11205
- task: this.eventCompletionParams.task,
11206
- caseId: this.eventCompletionParams.caseId,
11207
- eventId: this.eventCompletionParams.eventId,
11208
- reassignedTask: null,
11209
- router: this.router,
11210
- route: this.route,
11211
- sessionStorageService: this.sessionStorageService,
11212
- workAllocationService: this.workAllocationService,
11213
- alertService: this.alertService,
11214
- canBeCompleted: false,
11215
- component: this
11216
- };
11217
- // Initialise state machine
11218
- this.stateMachine = this.service.initialiseStateMachine(this.context);
11219
- // Create states
11220
- this.service.createStates(this.stateMachine);
11221
- // Add transitions for the states
11222
- this.service.addTransitions();
11223
- // Start state machine
11224
- this.service.startStateMachine(this.stateMachine);
11225
- }
11226
- }
11227
- showPortal(portalType) {
11228
- const injector = Injector.create({
11229
- providers: [
11230
- { provide: COMPONENT_PORTAL_INJECTION_TOKEN, useValue: this }
11231
- ]
11232
- });
11233
- // tslint:disable-next-line:switch-default
11234
- switch (portalType) {
11235
- case EventCompletionPortalTypes.TaskCancelled:
11236
- this.selectedComponentPortal = new ComponentPortal(CaseEventCompletionTaskCancelledComponent, null, injector);
11237
- break;
11238
- case EventCompletionPortalTypes.TaskReassigned:
11239
- this.selectedComponentPortal = new ComponentPortal(CaseEventCompletionTaskReassignedComponent, null, injector);
11240
- break;
11241
- }
11242
- }
11243
- static ɵfac = function CaseEventCompletionComponent_Factory(t) { return new (t || CaseEventCompletionComponent)(i0.ɵɵdirectiveInject(EventCompletionStateMachineService), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(WorkAllocationService), i0.ɵɵdirectiveInject(AlertService)); };
11244
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEventCompletionComponent, selectors: [["ccd-case-event-completion"]], inputs: { eventCompletionParams: "eventCompletionParams" }, outputs: { eventCanBeCompleted: "eventCanBeCompleted" }, features: [i0.ɵɵNgOnChangesFeature], decls: 1, vars: 1, consts: [[3, "cdkPortalOutlet"]], template: function CaseEventCompletionComponent_Template(rf, ctx) { if (rf & 1) {
11245
- i0.ɵɵtemplate(0, CaseEventCompletionComponent_ng_template_0_Template, 0, 0, "ng-template", 0);
11246
- } if (rf & 2) {
11247
- i0.ɵɵproperty("cdkPortalOutlet", ctx.selectedComponentPortal);
11248
- } }, encapsulation: 2 });
11249
- }
11250
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEventCompletionComponent, [{
11251
- type: Component,
11252
- args: [{ selector: 'ccd-case-event-completion', template: "<ng-template [cdkPortalOutlet]=\"selectedComponentPortal\"></ng-template>\n" }]
11253
- }], () => [{ type: EventCompletionStateMachineService }, { type: i1$1.Router }, { type: i1$1.ActivatedRoute }, { type: SessionStorageService }, { type: WorkAllocationService }, { type: AlertService }], { eventCompletionParams: [{
11280
+ }], () => [{ type: SessionStorageService }, { type: JudicialworkerService }, { type: CaseworkerService }], { context: [{
11254
11281
  type: Input
11255
- }], eventCanBeCompleted: [{
11282
+ }], notifyEventCompletionReassigned: [{
11256
11283
  type: Output
11257
11284
  }] }); })();
11258
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEventCompletionComponent, { className: "CaseEventCompletionComponent", filePath: "lib/shared/components/case-editor/case-event-completion/case-event-completion.component.ts", lineNumber: 21 }); })();
11285
+ (() => { (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: 17 }); })();
11259
11286
 
11260
11287
  class AddressOption {
11261
11288
  description;
@@ -28482,6 +28509,10 @@ i0.ɵɵsetComponentScope(QueryAttachmentsReadComponent, function () { return [i5
28482
28509
  i0.ɵɵsetComponentScope(QueryEventCompletionComponent, function () { return [
28483
28510
  // Case event completion
28484
28511
  CaseEventCompletionComponent]; }, []);
28512
+ i0.ɵɵsetComponentScope(
28513
+ // Case event completion
28514
+ CaseEventCompletionComponent, function () { return [i5.NgIf, CaseEventCompletionTaskCancelledComponent,
28515
+ CaseEventCompletionTaskReassignedComponent]; }, []);
28485
28516
 
28486
28517
  var CaseEditSubmitTitles;
28487
28518
  (function (CaseEditSubmitTitles) {