@hmcts/ccd-case-ui-toolkit 7.3.62 → 7.3.63

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.
@@ -8915,9 +8915,14 @@ class CaseEditWizardGuard {
8915
8915
  }
8916
8916
  goToFirst(wizard, canShowPredicate, route) {
8917
8917
  const firstPage = wizard.firstPage(canShowPredicate);
8918
- // If there’s no specific wizard page called, it makes another navigation to either the first page available or to the submit page
8919
- // TODO should find a way to navigate to target page without going through the whole loop (and make a second call to BE) again
8920
- return this.router.navigate([...this.parentUrlSegments(route), firstPage ? firstPage.id : 'submit'], { queryParams: route.queryParams });
8918
+ // This route transition is an internal wizard redirect used to append the first page id to the URL.
8919
+ // Mark it in navigation state so EventStartGuard can skip duplicate work allocation checks.
8920
+ return this.router.navigate([...this.parentUrlSegments(route), firstPage ? firstPage.id : 'submit'], {
8921
+ queryParams: route.queryParams,
8922
+ state: {
8923
+ [EVENT_START_FIRST_PAGE_REDIRECT]: true
8924
+ }
8925
+ });
8921
8926
  }
8922
8927
  goToSubmit(route) {
8923
8928
  return this.router.navigate([...this.parentUrlSegments(route), 'submit'], { queryParams: route.queryParams });
@@ -10140,6 +10145,7 @@ class CaseEditComponent {
10140
10145
  }] }); })();
10141
10146
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditComponent, { className: "CaseEditComponent", filePath: "lib/shared/components/case-editor/case-edit/case-edit.component.ts", lineNumber: 39 }); })();
10142
10147
 
10148
+ const EVENT_START_FIRST_PAGE_REDIRECT = 'eventStartFirstPageRedirect';
10143
10149
  function convertNonASCIICharacter(character) {
10144
10150
  if (character === '£') {
10145
10151
  // pound sign will be frequently used and works for btoa despite being non-ASCII
@@ -37935,6 +37941,10 @@ class EventStartGuard {
37935
37941
  }
37936
37942
  }
37937
37943
  return caseDataObservable.pipe(switchMap(() => {
37944
+ if (this.shouldSkipDuplicateWorkAllocationCall()) {
37945
+ this.abstractConfig.logMessage(`EventStartGuard: skipping duplicate work allocation call for caseId ${caseId} and eventId ${eventId}`);
37946
+ return of(true);
37947
+ }
37938
37948
  if (this.jurisdiction && this.caseType) {
37939
37949
  if (this.caseId === caseId) {
37940
37950
  return this.workAllocationService.getTasksByCaseIdAndEventId(eventId, caseId, this.caseType, this.jurisdiction)
@@ -37948,6 +37958,9 @@ class EventStartGuard {
37948
37958
  return of(false);
37949
37959
  }));
37950
37960
  }
37961
+ shouldSkipDuplicateWorkAllocationCall() {
37962
+ return this.router.getCurrentNavigation()?.extras?.state?.[EVENT_START_FIRST_PAGE_REDIRECT] === true;
37963
+ }
37951
37964
  checkTaskInEventNotRequired(payload, caseId, taskId, eventId, userId) {
37952
37965
  if (!payload || !payload.tasks) {
37953
37966
  return true;