@hmcts/ccd-case-ui-toolkit 6.19.6-rc3 → 6.19.6-restricted-case-access

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.
@@ -31064,7 +31064,7 @@
31064
31064
  else {
31065
31065
  console.info('getAndCacheCaseView - Path B.');
31066
31066
  return this.caseNotifier.fetchAndRefresh(cid)
31067
- .pipe(operators.catchError(function (error) { return _this.processErrorInCaseFetch(error); }))
31067
+ .pipe(operators.catchError(function (error) { return _this.processErrorInCaseFetch(error, cid); }))
31068
31068
  .toPromise();
31069
31069
  }
31070
31070
  }
@@ -31077,9 +31077,9 @@
31077
31077
  _this.caseNotifier.cachedCaseView = classTransformer.plainToClassFromExist(new CaseView(), caseView);
31078
31078
  _this.caseNotifier.announceCase(_this.caseNotifier.cachedCaseView);
31079
31079
  return _this.caseNotifier.cachedCaseView;
31080
- }), operators.catchError(function (error) { return _this.processErrorInCaseFetch(error); })).toPromise();
31080
+ }), operators.catchError(function (error) { return _this.processErrorInCaseFetch(error, cid); })).toPromise();
31081
31081
  };
31082
- CaseResolver.prototype.processErrorInCaseFetch = function (error) {
31082
+ CaseResolver.prototype.processErrorInCaseFetch = function (error, caseReference) {
31083
31083
  console.error('!!! processErrorInCaseFetch !!!');
31084
31084
  console.error(error);
31085
31085
  // TODO Should be logged to remote logging infrastructure
@@ -31087,12 +31087,16 @@
31087
31087
  this.router.navigate(['/search/noresults']);
31088
31088
  return rxjs.of(null);
31089
31089
  }
31090
- console.error(error);
31091
31090
  if (CaseResolver.EVENT_REGEX.test(this.previousUrl) && error.status === 404) {
31092
31091
  this.router.navigate(['/list/case']);
31093
31092
  return rxjs.of(null);
31094
31093
  }
31095
- if (error.status !== 401 && error.status !== 403) {
31094
+ // Error 403, navigate to restricted case access page
31095
+ if (error.status === 403) {
31096
+ this.router.navigate(["/cases/restricted-case-access/" + caseReference]);
31097
+ return rxjs.of(null);
31098
+ }
31099
+ if (error.status !== 401) {
31096
31100
  this.router.navigate(['/error']);
31097
31101
  }
31098
31102
  this.goToDefaultPage();