@hmcts/ccd-case-ui-toolkit 7.3.43-exui-4277-test-1 → 7.3.43-exui-3229

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.
@@ -8748,9 +8748,14 @@ class CaseEditWizardGuard {
8748
8748
  }
8749
8749
  goToFirst(wizard, canShowPredicate, route) {
8750
8750
  const firstPage = wizard.firstPage(canShowPredicate);
8751
- // If there’s no specific wizard page called, it makes another navigation to either the first page available or to the submit page
8752
- // TODO should find a way to navigate to target page without going through the whole loop (and make a second call to BE) again
8753
- return this.router.navigate([...this.parentUrlSegments(route), firstPage ? firstPage.id : 'submit'], { queryParams: route.queryParams });
8751
+ // This route transition is an internal wizard redirect used to append the first page id to the URL.
8752
+ // Mark it in navigation state so EventStartGuard can skip duplicate work allocation checks.
8753
+ return this.router.navigate([...this.parentUrlSegments(route), firstPage ? firstPage.id : 'submit'], {
8754
+ queryParams: route.queryParams,
8755
+ state: {
8756
+ [EVENT_START_FIRST_PAGE_REDIRECT]: true
8757
+ }
8758
+ });
8754
8759
  }
8755
8760
  goToSubmit(route) {
8756
8761
  return this.router.navigate([...this.parentUrlSegments(route), 'submit'], { queryParams: route.queryParams });
@@ -9972,6 +9977,7 @@ class CaseEditComponent {
9972
9977
  }] }); })();
9973
9978
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditComponent, { className: "CaseEditComponent", filePath: "lib/shared/components/case-editor/case-edit/case-edit.component.ts", lineNumber: 38 }); })();
9974
9979
 
9980
+ const EVENT_START_FIRST_PAGE_REDIRECT = 'eventStartFirstPageRedirect';
9975
9981
  function convertNonASCIICharacter(character) {
9976
9982
  if (character === '£') {
9977
9983
  // pound sign will be frequently used and works for btoa despite being non-ASCII
@@ -37458,6 +37464,10 @@ class EventStartGuard {
37458
37464
  }
37459
37465
  }
37460
37466
  return caseDataObservable.pipe(switchMap(() => {
37467
+ if (this.shouldSkipDuplicateWorkAllocationCall()) {
37468
+ this.abstractConfig.logMessage(`EventStartGuard: skipping duplicate work allocation call for caseId ${caseId} and eventId ${eventId}`);
37469
+ return of(true);
37470
+ }
37461
37471
  if (this.jurisdiction && this.caseType) {
37462
37472
  if (this.caseId === caseId) {
37463
37473
  return this.workAllocationService.getTasksByCaseIdAndEventId(eventId, caseId, this.caseType, this.jurisdiction)
@@ -37471,6 +37481,9 @@ class EventStartGuard {
37471
37481
  return of(false);
37472
37482
  }));
37473
37483
  }
37484
+ shouldSkipDuplicateWorkAllocationCall() {
37485
+ return this.router.getCurrentNavigation()?.extras?.state?.[EVENT_START_FIRST_PAGE_REDIRECT] === true;
37486
+ }
37474
37487
  checkTaskInEventNotRequired(payload, caseId, taskId, eventId, userId) {
37475
37488
  if (!payload || !payload.tasks) {
37476
37489
  return true;