@hmcts/ccd-case-ui-toolkit 4.12.8-task-event-completion → 4.12.10-task-event-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.
package/RELEASE-NOTES.md CHANGED
@@ -3,7 +3,7 @@
3
3
  ### Version 4.12.0
4
4
  Add refunds functionality
5
5
 
6
- ### Version 4.12.8-task-event-completion"
6
+ ### Version 4.12.10-task-event-completion"
7
7
  **Task event completion and state machine** Task event completion and state machine
8
8
 
9
9
  ### Version 4.7.6-tab-not-defined-error"
package/dist/index.umd.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @hmcts/ccd-case-ui-toolkit - Case UI Toolkit
3
- * @version v4.12.8-task-event-completion
3
+ * @version v4.12.10-task-event-completion
4
4
  * @link undefined
5
5
  * @license MIT
6
6
  */
@@ -20205,6 +20205,7 @@ var CaseEventCompletionComponent = /** @class */ (function () {
20205
20205
  task: this.eventCompletionParams.task,
20206
20206
  caseId: this.eventCompletionParams.caseId,
20207
20207
  eventId: this.eventCompletionParams.eventId,
20208
+ reassignedTask: null,
20208
20209
  router: this.router,
20209
20210
  route: this.route,
20210
20211
  sessionStorageService: this.sessionStorageService,
@@ -20348,7 +20349,7 @@ var CaseEventCompletionTaskReassignedComponent = /** @class */ (function () {
20348
20349
  var _this = this;
20349
20350
  // Get case id and task from the parent component
20350
20351
  this.caseId = this.parentComponent.context.caseId;
20351
- var task = this.parentComponent.context.task;
20352
+ var task = this.parentComponent.context.reassignedTask;
20352
20353
  // Current user is a caseworker?
20353
20354
  this.caseworkerSubscription = this.caseworkerService.getCaseworkers(task.jurisdiction).subscribe(function (result) {
20354
20355
  if (result && result[0].service === task.jurisdiction && result[0].caseworkers) {
@@ -21409,9 +21410,15 @@ var EventCompletionStateMachineService = /** @class */ (function () {
21409
21410
  break;
21410
21411
  case Task_1.TaskState.Assigned:
21411
21412
  // Task is in assigned state
21412
- taskResponse.task.assignee === context.task.assignee
21413
- ? state.trigger(domain_1.EventCompletionStates.CompleteEventAndTask)
21414
- : state.trigger(domain_1.EventCompletionStates.TaskAssignedToAnotherUser);
21413
+ if (taskResponse.task.assignee === context.task.assignee) {
21414
+ // Task still assigned to current user, complete event and task
21415
+ state.trigger(domain_1.EventCompletionStates.CompleteEventAndTask);
21416
+ }
21417
+ else {
21418
+ // Task has been reassigned to another user, display error message
21419
+ context.reassignedTask = taskResponse.task;
21420
+ state.trigger(domain_1.EventCompletionStates.TaskAssignedToAnotherUser);
21421
+ }
21415
21422
  break;
21416
21423
  default:
21417
21424
  // Allow user to complete the event