@hmcts/ccd-case-ui-toolkit 4.12.12-task-event-completion → 4.12.16-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.12-task-event-completion"
6
+ ### Version 4.12.16-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.12-task-event-completion
3
+ * @version v4.12.16-task-event-completion
4
4
  * @link undefined
5
5
  * @license MIT
6
6
  */
@@ -19489,16 +19489,18 @@ var CaseEditSubmitComponent = /** @class */ (function () {
19489
19489
  CaseEditSubmitComponent.prototype.submit = function () {
19490
19490
  this.isSubmitting = true;
19491
19491
  // We have to run the event completion checks if task in session storage
19492
+ // and if the task is in session storage, then is it associated to the case
19493
+ var taskInSessionStorage;
19492
19494
  var taskStr = this.sessionStorageService.getItem('taskToComplete');
19493
19495
  if (taskStr) {
19494
- // Task is in session storage
19495
- var task = JSON.parse(taskStr);
19496
- this.task = task;
19496
+ taskInSessionStorage = JSON.parse(taskStr);
19497
+ }
19498
+ if (taskInSessionStorage && taskInSessionStorage.case_id === this.getCaseId()) {
19497
19499
  // Show event completion component to perform event completion checks
19498
19500
  this.eventCompletionParams = {
19499
19501
  caseId: this.getCaseId(),
19500
19502
  eventId: this.getEventId(),
19501
- task: task
19503
+ task: taskInSessionStorage
19502
19504
  };
19503
19505
  this.eventCompletionChecksRequired = true;
19504
19506
  }
@@ -26215,6 +26217,8 @@ var EventStartGuard = /** @class */ (function () {
26215
26217
  }
26216
26218
  };
26217
26219
  EventStartGuard.prototype.checkForTasks = function (payload, caseId, eventId, taskId) {
26220
+ // Clear taskToComplete from session as we will be starting the process for new task
26221
+ this.sessionStorageService.removeItem('taskToComplete');
26218
26222
  if (payload.task_required_for_event) {
26219
26223
  // There are some issues in EventTriggerResolver/CaseService and/or CCD for some events
26220
26224
  // which triggers the CanActivate guard again.
@@ -44391,6 +44395,12 @@ var SessionStorageService = /** @class */ (function () {
44391
44395
  SessionStorageService.prototype.setItem = function (key, value) {
44392
44396
  sessionStorage.setItem(key, value);
44393
44397
  };
44398
+ /**
44399
+ * Remove an item from the session storage.
44400
+ */
44401
+ SessionStorageService.prototype.removeItem = function (key) {
44402
+ sessionStorage.removeItem(key);
44403
+ };
44394
44404
  /**
44395
44405
  * Clear all the items held in session storage.
44396
44406
  */