@hmcts/ccd-case-ui-toolkit 5.0.47-linked-cases-from-table-check → 5.0.49-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.
Files changed (21) hide show
  1. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js +19 -35
  2. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js.map +1 -1
  3. package/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js +1 -1
  4. package/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js.map +1 -1
  5. package/esm2015/lib/shared/components/case-viewer/services/case.resolver.js +11 -6
  6. package/esm2015/lib/shared/components/palette/case-file-view/case-file-view-field-read.component.js +4 -4
  7. package/esm2015/lib/shared/components/palette/case-file-view/case-file-view-field.component.js +4 -4
  8. package/esm2015/lib/shared/components/palette/case-link/components/link-cases/link-cases.component.js +2 -11
  9. package/esm2015/lib/shared/components/palette/case-link/components/linked-cases-table/linked-cases-from-table.component.js +1 -14
  10. package/esm2015/lib/shared/components/palette/case-link/services/linked-cases.service.js +1 -2
  11. package/esm2015/lib/shared/components/palette/palette.service.js +3 -1
  12. package/fesm2015/hmcts-ccd-case-ui-toolkit.js +19 -35
  13. package/fesm2015/hmcts-ccd-case-ui-toolkit.js.map +1 -1
  14. package/lib/shared/components/case-viewer/services/case.resolver.d.ts.map +1 -1
  15. package/lib/shared/components/palette/case-link/components/link-cases/link-cases.component.d.ts.map +1 -1
  16. package/lib/shared/components/palette/case-link/components/linked-cases-table/linked-cases-from-table.component.d.ts +0 -1
  17. package/lib/shared/components/palette/case-link/components/linked-cases-table/linked-cases-from-table.component.d.ts.map +1 -1
  18. package/lib/shared/components/palette/case-link/services/linked-cases.service.d.ts +0 -1
  19. package/lib/shared/components/palette/case-link/services/linked-cases.service.d.ts.map +1 -1
  20. package/lib/shared/components/palette/palette.service.d.ts.map +1 -1
  21. package/package.json +1 -1
@@ -11409,7 +11409,6 @@
11409
11409
  this.isLinkedCasesEventTrigger = false;
11410
11410
  this.linkCaseReasons = [];
11411
11411
  this.linkedCases = [];
11412
- this.linkedCasesFrom = [];
11413
11412
  this.initialCaseLinks = [];
11414
11413
  this.editMode = false;
11415
11414
  this.jurisdictionsResponse = [];
@@ -12004,7 +12003,7 @@
12004
12003
  if (rf & 2) {
12005
12004
  var ctx_r2 = i0__namespace.ɵɵnextContext(2);
12006
12005
  i0__namespace.ɵɵadvance(1);
12007
- i0__namespace.ɵɵproperty("url", ctx_r2.currentDocument.document_binary_url)("downloadFileName", ctx_r2.currentDocument.document_filename)("showToolbar", true)("contentType", ctx_r2.currentDocument.content_type)("enableAnnotations", true)("enableRedactions", true)("height", "94.5vh");
12006
+ i0__namespace.ɵɵproperty("url", ctx_r2.currentDocument.document_binary_url)("downloadFileName", ctx_r2.currentDocument.document_filename)("showToolbar", true)("contentType", ctx_r2.currentDocument.content_type)("enableAnnotations", true)("enableRedactions", true);
12008
12007
  }
12009
12008
  }
12010
12009
  function CaseFileViewFieldComponent_div_1_Template(rf, ctx) {
@@ -12022,7 +12021,7 @@
12022
12021
  i0__namespace.ɵɵelementEnd();
12023
12022
  i0__namespace.ɵɵelement(6, "div", 9);
12024
12023
  i0__namespace.ɵɵelementStart(7, "div", 10);
12025
- i0__namespace.ɵɵtemplate(8, CaseFileViewFieldComponent_div_1_ng_container_8_Template, 2, 7, "ng-container", 1);
12024
+ i0__namespace.ɵɵtemplate(8, CaseFileViewFieldComponent_div_1_ng_container_8_Template, 2, 6, "ng-container", 1);
12026
12025
  i0__namespace.ɵɵelementEnd();
12027
12026
  i0__namespace.ɵɵelementEnd();
12028
12027
  i0__namespace.ɵɵelementEnd();
@@ -12103,7 +12102,7 @@
12103
12102
  }());
12104
12103
  CaseFileViewFieldComponent.PARAM_CASE_ID = 'cid';
12105
12104
  CaseFileViewFieldComponent.ɵfac = function CaseFileViewFieldComponent_Factory(t) { return new (t || CaseFileViewFieldComponent)(i0__namespace.ɵɵdirectiveInject(i0__namespace.ElementRef), i0__namespace.ɵɵdirectiveInject(i1__namespace$1.ActivatedRoute), i0__namespace.ɵɵdirectiveInject(CaseFileViewService), i0__namespace.ɵɵdirectiveInject(DocumentManagementService), i0__namespace.ɵɵdirectiveInject(LoadingService)); };
12106
- CaseFileViewFieldComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: CaseFileViewFieldComponent, selectors: [["ccd-case-file-view-field"]], decls: 2, vars: 2, consts: [["class", "govuk-grid-column-two-thirds", 4, "ngIf"], [4, "ngIf"], [1, "govuk-grid-column-two-thirds"], [1, "govuk-heading-xl"], [1, "govuk-body"], [1, "govuk-heading-l"], ["id", "case-file-view", 1, "govuk-form-group"], [1, "document-tree-container"], [1, "document-tree-container__tree", 3, "categoriesAndDocuments", "allowMoving", "clickedDocument", "moveDocument"], [1, "slider"], [1, "media-viewer-container"], [3, "url", "downloadFileName", "showToolbar", "contentType", "enableAnnotations", "enableRedactions", "height"]], template: function CaseFileViewFieldComponent_Template(rf, ctx) {
12105
+ CaseFileViewFieldComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: CaseFileViewFieldComponent, selectors: [["ccd-case-file-view-field"]], decls: 2, vars: 2, consts: [["class", "govuk-grid-column-two-thirds", 4, "ngIf"], [4, "ngIf"], [1, "govuk-grid-column-two-thirds"], [1, "govuk-heading-xl"], [1, "govuk-body"], [1, "govuk-heading-l"], ["id", "case-file-view", 1, "govuk-form-group"], [1, "document-tree-container"], [1, "document-tree-container__tree", 3, "categoriesAndDocuments", "allowMoving", "clickedDocument", "moveDocument"], [1, "slider"], [1, "media-viewer-container"], [3, "url", "downloadFileName", "showToolbar", "contentType", "enableAnnotations", "enableRedactions"]], template: function CaseFileViewFieldComponent_Template(rf, ctx) {
12107
12106
  if (rf & 1) {
12108
12107
  i0__namespace.ɵɵtemplate(0, CaseFileViewFieldComponent_div_0_Template, 5, 0, "div", 0);
12109
12108
  i0__namespace.ɵɵtemplate(1, CaseFileViewFieldComponent_div_1_Template, 9, 3, "div", 1);
@@ -12146,7 +12145,7 @@
12146
12145
  if (rf & 2) {
12147
12146
  var ctx_r2 = i0__namespace.ɵɵnextContext(2);
12148
12147
  i0__namespace.ɵɵadvance(1);
12149
- i0__namespace.ɵɵproperty("url", ctx_r2.currentDocument.document_binary_url)("downloadFileName", ctx_r2.currentDocument.document_filename)("showToolbar", true)("contentType", ctx_r2.currentDocument.content_type)("enableAnnotations", true)("enableRedactions", true)("height", "94.5vh");
12148
+ i0__namespace.ɵɵproperty("url", ctx_r2.currentDocument.document_binary_url)("downloadFileName", ctx_r2.currentDocument.document_filename)("showToolbar", true)("contentType", ctx_r2.currentDocument.content_type)("enableAnnotations", true)("enableRedactions", true);
12150
12149
  }
12151
12150
  }
12152
12151
  function CaseFileViewFieldReadComponent_div_1_Template(rf, ctx) {
@@ -12164,7 +12163,7 @@
12164
12163
  i0__namespace.ɵɵelementEnd();
12165
12164
  i0__namespace.ɵɵelement(6, "div", 9);
12166
12165
  i0__namespace.ɵɵelementStart(7, "div", 10);
12167
- i0__namespace.ɵɵtemplate(8, CaseFileViewFieldReadComponent_div_1_ng_container_8_Template, 2, 7, "ng-container", 1);
12166
+ i0__namespace.ɵɵtemplate(8, CaseFileViewFieldReadComponent_div_1_ng_container_8_Template, 2, 6, "ng-container", 1);
12168
12167
  i0__namespace.ɵɵelementEnd();
12169
12168
  i0__namespace.ɵɵelementEnd();
12170
12169
  i0__namespace.ɵɵelementEnd();
@@ -12187,7 +12186,7 @@
12187
12186
  return CaseFileViewFieldReadComponent;
12188
12187
  }(CaseFileViewFieldComponent));
12189
12188
  CaseFileViewFieldReadComponent.ɵfac = function CaseFileViewFieldReadComponent_Factory(t) { return ɵCaseFileViewFieldReadComponent_BaseFactory(t || CaseFileViewFieldReadComponent); };
12190
- CaseFileViewFieldReadComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: CaseFileViewFieldReadComponent, selectors: [["ccd-case-file-view-field"]], features: [i0__namespace.ɵɵInheritDefinitionFeature], decls: 2, vars: 2, consts: [["class", "govuk-grid-column-two-thirds", 4, "ngIf"], [4, "ngIf"], [1, "govuk-grid-column-two-thirds"], [1, "govuk-heading-xl"], [1, "govuk-body"], [1, "govuk-heading-l"], ["id", "case-file-view", 1, "govuk-form-group"], [1, "document-tree-container"], [1, "document-tree-container__tree", 3, "categoriesAndDocuments", "allowMoving", "clickedDocument", "moveDocument"], [1, "slider"], [1, "media-viewer-container"], [3, "url", "downloadFileName", "showToolbar", "contentType", "enableAnnotations", "enableRedactions", "height"]], template: function CaseFileViewFieldReadComponent_Template(rf, ctx) {
12189
+ CaseFileViewFieldReadComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: CaseFileViewFieldReadComponent, selectors: [["ccd-case-file-view-field"]], features: [i0__namespace.ɵɵInheritDefinitionFeature], decls: 2, vars: 2, consts: [["class", "govuk-grid-column-two-thirds", 4, "ngIf"], [4, "ngIf"], [1, "govuk-grid-column-two-thirds"], [1, "govuk-heading-xl"], [1, "govuk-body"], [1, "govuk-heading-l"], ["id", "case-file-view", 1, "govuk-form-group"], [1, "document-tree-container"], [1, "document-tree-container__tree", 3, "categoriesAndDocuments", "allowMoving", "clickedDocument", "moveDocument"], [1, "slider"], [1, "media-viewer-container"], [3, "url", "downloadFileName", "showToolbar", "contentType", "enableAnnotations", "enableRedactions"]], template: function CaseFileViewFieldReadComponent_Template(rf, ctx) {
12191
12190
  if (rf & 1) {
12192
12191
  i0__namespace.ɵɵtemplate(0, CaseFileViewFieldReadComponent_div_0_Template, 5, 0, "div", 0);
12193
12192
  i0__namespace.ɵɵtemplate(1, CaseFileViewFieldReadComponent_div_1_Template, 9, 3, "div", 1);
@@ -17854,6 +17853,8 @@
17854
17853
  return write ? WriteOrganisationFieldComponent : ReadOrganisationFieldComponent;
17855
17854
  case 'JudicialUser':
17856
17855
  return write ? WriteJudicialUserFieldComponent : ReadJudicialUserFieldComponent;
17856
+ case 'CaseLink':
17857
+ return write ? WriteCaseLinkFieldComponent : ReadCaseLinkFieldComponent;
17857
17858
  default:
17858
17859
  return write ? WriteComplexFieldComponent : ReadComplexFieldComponent;
17859
17860
  }
@@ -21419,8 +21420,7 @@
21419
21420
  if (this.linkCaseForm.valid &&
21420
21421
  !this.isCaseSelected(this.selectedCases) &&
21421
21422
  !this.isCaseSelected(this.linkedCasesService.linkedCases) &&
21422
- !this.isCaseSelectedSameAsCurrentCase() &&
21423
- !this.isCaseSelected(this.linkedCasesService.linkedCasesFrom)) {
21423
+ !this.isCaseSelectedSameAsCurrentCase()) {
21424
21424
  this.getCaseInfo();
21425
21425
  }
21426
21426
  else {
@@ -21470,14 +21470,6 @@
21470
21470
  fieldId: 'caseNumber',
21471
21471
  });
21472
21472
  }
21473
- if (this.isCaseSelected(this.linkedCasesService.linkedCasesFrom)) {
21474
- this.caseSelectionError = exports.LinkedCasesErrorMessages.CasesLinkedError;
21475
- this.errorMessages.push({
21476
- title: 'dummy-case-number',
21477
- description: exports.LinkedCasesErrorMessages.CasesLinkedError,
21478
- fieldId: 'caseNumber',
21479
- });
21480
- }
21481
21473
  if (this.linkCaseForm.value.caseNumber.split('-').join('') === this.linkedCasesService.caseId.split('-').join('')) {
21482
21474
  this.errorMessages.push({
21483
21475
  title: 'dummy-case-number',
@@ -21865,9 +21857,6 @@
21865
21857
  this.caseId = this.route.snapshot.data.case.case_id;
21866
21858
  this.getLinkedCases().subscribe(function (response) {
21867
21859
  _this.isServerError = false;
21868
- if (response.linkedCases) {
21869
- _this.setLinkiedCasesFrom(response.linkedCases);
21870
- }
21871
21860
  _this.getLinkedCasesResponse = response.linkedCases && response.linkedCases.map(function (item) {
21872
21861
  var mappedCasetype = _this.mapLookupIDToValueFromJurisdictions('CASE_TYPE', item.ccdCaseType);
21873
21862
  var mappedCasetypeDescription = _this.mapLookupIDToValueFromJurisdictions('CASE_TYPE_DESCRIPTION', item.ccdCaseType);
@@ -21882,16 +21871,6 @@
21882
21871
  _this.notifyAPIFailure.emit(true);
21883
21872
  });
21884
21873
  };
21885
- LinkedCasesFromTableComponent.prototype.setLinkiedCasesFrom = function (linkedCases) {
21886
- var caseLinks = linkedCases.map(function (item) {
21887
- return {
21888
- caseReference: item.caseReference,
21889
- caseService: item.ccdJurisdiction,
21890
- caseType: item.ccdCaseType,
21891
- };
21892
- });
21893
- this.linkedCasesService.linkedCasesFrom = caseLinks;
21894
- };
21895
21874
  LinkedCasesFromTableComponent.prototype.getLinkedCases = function () {
21896
21875
  return this.casesService.getLinkedCases(this.caseId);
21897
21876
  };
@@ -29239,7 +29218,7 @@
29239
29218
  }
29240
29219
  else {
29241
29220
  return this.caseNotifier.fetchAndRefresh(cid)
29242
- .pipe(operators.catchError(function (error) { return _this.checkAuthorizationError(error); }))
29221
+ .pipe(operators.catchError(function (error) { return _this.checkAuthorizationError(error, cid); }))
29243
29222
  .toPromise();
29244
29223
  }
29245
29224
  }
@@ -29252,20 +29231,25 @@
29252
29231
  _this.caseNotifier.cachedCaseView = classTransformer.plainToClassFromExist(new CaseView(), caseView);
29253
29232
  _this.caseNotifier.announceCase(_this.caseNotifier.cachedCaseView);
29254
29233
  return _this.caseNotifier.cachedCaseView;
29255
- }), operators.catchError(function (error) { return _this.checkAuthorizationError(error); })).toPromise();
29234
+ }), operators.catchError(function (error) { return _this.checkAuthorizationError(error, cid); })).toPromise();
29256
29235
  };
29257
- CaseResolver.prototype.checkAuthorizationError = function (error) {
29236
+ CaseResolver.prototype.checkAuthorizationError = function (error, caseReference) {
29237
+ console.error(error);
29258
29238
  // TODO Should be logged to remote logging infrastructure
29259
29239
  if (error.status === 400) {
29260
29240
  this.router.navigate(['/search/noresults']);
29261
29241
  return rxjs.of(null);
29262
29242
  }
29263
- console.error(error);
29243
+ // Error 403, navigate to restricted case access page
29244
+ if (error.status === 403) {
29245
+ this.router.navigate(["/cases/restricted-case-access/" + caseReference]);
29246
+ return rxjs.of(null);
29247
+ }
29264
29248
  if (CaseResolver.EVENT_REGEX.test(this.previousUrl) && error.status === 404) {
29265
29249
  this.router.navigate(['/list/case']);
29266
29250
  return rxjs.of(null);
29267
29251
  }
29268
- if (error.status !== 401 && error.status !== 403) {
29252
+ if (error.status !== 401) {
29269
29253
  this.router.navigate(['/error']);
29270
29254
  }
29271
29255
  this.goToDefaultPage();