@hmcts/ccd-case-ui-toolkit 6.19.12-restricted-case-access → 6.19.13

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.
@@ -1985,13 +1985,6 @@
1985
1985
  error[key] = response.error.hasOwnProperty(key) && response.error[key] ? response.error[key] : error[key];
1986
1986
  });
1987
1987
  }
1988
- // Error object in HttpErrorResponse will be empty for 403 errors
1989
- // Set the error properties of HttpError accordingly
1990
- if ((response === null || response === void 0 ? void 0 : response.status) === 403) {
1991
- error.error = response.statusText;
1992
- error.status = response.status;
1993
- error.message = response.message;
1994
- }
1995
1988
  return error;
1996
1989
  };
1997
1990
  return HttpError;
@@ -2090,13 +2083,14 @@
2090
2083
  this.authService = authService;
2091
2084
  }
2092
2085
  HttpErrorService.convertToHttpError = function (error) {
2093
- var _a;
2094
2086
  if (error instanceof HttpError) {
2095
2087
  return error;
2096
2088
  }
2097
2089
  var httpError = new HttpError();
2098
2090
  if (error instanceof i1$2.HttpErrorResponse) {
2099
- if (((_a = error.headers) === null || _a === void 0 ? void 0 : _a.get(HttpErrorService.CONTENT_TYPE).indexOf(HttpErrorService.JSON)) !== -1) {
2091
+ if (error.headers
2092
+ && error.headers.get(HttpErrorService.CONTENT_TYPE)
2093
+ && error.headers.get(HttpErrorService.CONTENT_TYPE).indexOf(HttpErrorService.JSON) !== -1) {
2100
2094
  try {
2101
2095
  httpError = HttpError.from(error);
2102
2096
  }
@@ -2131,7 +2125,7 @@
2131
2125
  console.error('Handling error in http error service.');
2132
2126
  console.error(error);
2133
2127
  var httpError = HttpErrorService.convertToHttpError(error);
2134
- if (redirectIfNotAuthorised && httpError.status === 401) {
2128
+ if (redirectIfNotAuthorised && (httpError.status === 401 || httpError.status === 403)) {
2135
2129
  this.authService.signIn();
2136
2130
  }
2137
2131
  return rxjs.throwError(httpError);
@@ -14702,15 +14696,6 @@
14702
14696
  _this.valid = true;
14703
14697
  return _this;
14704
14698
  }
14705
- WriteDocumentFieldComponent.prototype.clickout = function (event) {
14706
- // Capturing the event of the associated ElementRef <input type="file" #fileInpu
14707
- if (this.fileInput.nativeElement.contains(event.target)) {
14708
- this.clickInsideTheDocument = true;
14709
- }
14710
- else {
14711
- this.fileValidations();
14712
- }
14713
- };
14714
14699
  WriteDocumentFieldComponent.prototype.ngOnInit = function () {
14715
14700
  this.secureModeOn = this.appConfig.getDocumentSecureMode();
14716
14701
  if (this.secureModeOn) {
@@ -14972,10 +14957,6 @@
14972
14957
  var _t = void 0;
14973
14958
  i0__namespace.ɵɵqueryRefresh(_t = i0__namespace.ɵɵloadQuery()) && (ctx.fileInput = _t.first);
14974
14959
  }
14975
- }, hostBindings: function WriteDocumentFieldComponent_HostBindings(rf, ctx) {
14976
- if (rf & 1) {
14977
- i0__namespace.ɵɵlistener("click", function WriteDocumentFieldComponent_click_HostBindingHandler($event) { return ctx.clickout($event); }, false, i0__namespace.ɵɵresolveDocument);
14978
- }
14979
14960
  }, features: [i0__namespace.ɵɵInheritDefinitionFeature], decls: 19, vars: 22, consts: [[1, "form-group", 3, "ngClass"], [3, "for"], [1, "form-label"], ["class", "form-hint", 4, "ngIf"], ["class", "error-message", 4, "ngIf"], [3, "caseField", 4, "ngIf"], [2, "position", "relative"], [3, "id", "click"], ["type", "file", 1, "form-control", "bottom-30", 3, "id", "accept", "keydown.Tab", "change"], ["fileInput", ""], [1, "form-group", "bottom-30"], ["type", "button", "aria-label", "Cancel upload", 1, "button", "button-secondary", 3, "disabled", "click"], [1, "form-hint"], [1, "error-message"], [3, "caseField"]], template: function WriteDocumentFieldComponent_Template(rf, ctx) {
14980
14961
  if (rf & 1) {
14981
14962
  i0__namespace.ɵɵelementStart(0, "div", 0);
@@ -15044,9 +15025,6 @@
15044
15025
  }], function () { return [{ type: AbstractAppConfig }, { type: CaseNotifier }, { type: DocumentManagementService }, { type: i1__namespace$3.MatDialog }, { type: FileUploadStateService }, { type: JurisdictionService }]; }, { fileInput: [{
15045
15026
  type: i0.ViewChild,
15046
15027
  args: ['fileInput', { static: false }]
15047
- }], clickout: [{
15048
- type: i0.HostListener,
15049
- args: ['document:click', ['$event']]
15050
15028
  }] });
15051
15029
  })();
15052
15030
 
@@ -31098,14 +31076,13 @@
31098
31076
  i0__namespace.ɵɵsetComponentScope(CaseTimelineComponent, [i2__namespace.NgIf, i2__namespace.NgSwitch, i2__namespace.NgSwitchCase, EventLogComponent, CaseHistoryComponent], [i1__namespace.RpxTranslatePipe]);
31099
31077
 
31100
31078
  var CaseResolver = /** @class */ (function () {
31101
- function CaseResolver(caseNotifier, draftService, navigationNotifierService, router, sessionStorage, appConfig) {
31079
+ function CaseResolver(caseNotifier, draftService, navigationNotifierService, router, sessionStorage) {
31102
31080
  var _this = this;
31103
31081
  this.caseNotifier = caseNotifier;
31104
31082
  this.draftService = draftService;
31105
31083
  this.navigationNotifierService = navigationNotifierService;
31106
31084
  this.router = router;
31107
31085
  this.sessionStorage = sessionStorage;
31108
- this.appConfig = appConfig;
31109
31086
  router.events.pipe(operators.filter(function (event) { return event instanceof i1$1.NavigationEnd; }))
31110
31087
  .subscribe(function (event) {
31111
31088
  _this.previousUrl = event.url;
@@ -31151,7 +31128,7 @@
31151
31128
  else {
31152
31129
  console.info('getAndCacheCaseView - Path B.');
31153
31130
  return this.caseNotifier.fetchAndRefresh(cid)
31154
- .pipe(operators.catchError(function (error) { return _this.processErrorInCaseFetch(error, cid); }))
31131
+ .pipe(operators.catchError(function (error) { return _this.processErrorInCaseFetch(error); }))
31155
31132
  .toPromise();
31156
31133
  }
31157
31134
  }
@@ -31164,9 +31141,9 @@
31164
31141
  _this.caseNotifier.cachedCaseView = classTransformer.plainToClassFromExist(new CaseView(), caseView);
31165
31142
  _this.caseNotifier.announceCase(_this.caseNotifier.cachedCaseView);
31166
31143
  return _this.caseNotifier.cachedCaseView;
31167
- }), operators.catchError(function (error) { return _this.processErrorInCaseFetch(error, cid); })).toPromise();
31144
+ }), operators.catchError(function (error) { return _this.processErrorInCaseFetch(error); })).toPromise();
31168
31145
  };
31169
- CaseResolver.prototype.processErrorInCaseFetch = function (error, caseReference) {
31146
+ CaseResolver.prototype.processErrorInCaseFetch = function (error) {
31170
31147
  console.error('!!! processErrorInCaseFetch !!!');
31171
31148
  console.error(error);
31172
31149
  // TODO Should be logged to remote logging infrastructure
@@ -31174,16 +31151,12 @@
31174
31151
  this.router.navigate(['/search/noresults']);
31175
31152
  return rxjs.of(null);
31176
31153
  }
31154
+ console.error(error);
31177
31155
  if (CaseResolver.EVENT_REGEX.test(this.previousUrl) && error.status === 404) {
31178
31156
  this.router.navigate(['/list/case']);
31179
31157
  return rxjs.of(null);
31180
31158
  }
31181
- // Error 403 and enable-restricted-case-access Launch Darkly flag is enabled, navigate to restricted case access page
31182
- if (error.status === 403 && this.appConfig.getEnableRestrictedCaseAccessConfig()) {
31183
- this.router.navigate(["/cases/restricted-case-access/" + caseReference]);
31184
- return rxjs.of(null);
31185
- }
31186
- if (error.status !== 401) {
31159
+ if (error.status !== 401 && error.status !== 403) {
31187
31160
  this.router.navigate(['/error']);
31188
31161
  }
31189
31162
  this.goToDefaultPage();
@@ -31210,12 +31183,12 @@
31210
31183
  CaseResolver.CASE_CREATED_MSG = 'The case has been created successfully';
31211
31184
  CaseResolver.defaultWAPage = '/work/my-work/list';
31212
31185
  CaseResolver.defaultPage = '/cases';
31213
- CaseResolver.ɵfac = function CaseResolver_Factory(t) { return new (t || CaseResolver)(i0__namespace.ɵɵinject(CaseNotifier), i0__namespace.ɵɵinject(DraftService), i0__namespace.ɵɵinject(NavigationNotifierService), i0__namespace.ɵɵinject(i1__namespace$1.Router), i0__namespace.ɵɵinject(SessionStorageService), i0__namespace.ɵɵinject(AbstractAppConfig)); };
31186
+ CaseResolver.ɵfac = function CaseResolver_Factory(t) { return new (t || CaseResolver)(i0__namespace.ɵɵinject(CaseNotifier), i0__namespace.ɵɵinject(DraftService), i0__namespace.ɵɵinject(NavigationNotifierService), i0__namespace.ɵɵinject(i1__namespace$1.Router), i0__namespace.ɵɵinject(SessionStorageService)); };
31214
31187
  CaseResolver.ɵprov = i0__namespace.ɵɵdefineInjectable({ token: CaseResolver, factory: CaseResolver.ɵfac });
31215
31188
  (function () {
31216
31189
  (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(CaseResolver, [{
31217
31190
  type: i0.Injectable
31218
- }], function () { return [{ type: CaseNotifier }, { type: DraftService }, { type: NavigationNotifierService }, { type: i1__namespace$1.Router }, { type: SessionStorageService }, { type: AbstractAppConfig }]; }, null);
31191
+ }], function () { return [{ type: CaseNotifier }, { type: DraftService }, { type: NavigationNotifierService }, { type: i1__namespace$1.Router }, { type: SessionStorageService }]; }, null);
31219
31192
  })();
31220
31193
 
31221
31194
  var EventTriggerResolver = /** @class */ (function () {