@hmcts/ccd-case-ui-toolkit 6.13.10-c → 6.13.10-d

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.
@@ -11372,12 +11372,13 @@
11372
11372
  }
11373
11373
  }
11374
11374
  var CaseFileViewFieldComponent = /** @class */ (function () {
11375
- function CaseFileViewFieldComponent(elementRef, route, caseFileViewService, documentManagementService, loadingService) {
11375
+ function CaseFileViewFieldComponent(elementRef, route, caseFileViewService, documentManagementService, loadingService, sessionStorageService) {
11376
11376
  this.elementRef = elementRef;
11377
11377
  this.route = route;
11378
11378
  this.caseFileViewService = caseFileViewService;
11379
11379
  this.documentManagementService = documentManagementService;
11380
11380
  this.loadingService = loadingService;
11381
+ this.sessionStorageService = sessionStorageService;
11381
11382
  this.allowMoving = true;
11382
11383
  this.getCategoriesAndDocumentsError = false;
11383
11384
  }
@@ -11438,7 +11439,7 @@
11438
11439
  return CaseFileViewFieldComponent;
11439
11440
  }());
11440
11441
  CaseFileViewFieldComponent.PARAM_CASE_ID = 'cid';
11441
- 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)); };
11442
+ 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), i0__namespace.ɵɵdirectiveInject(SessionStorageService)); };
11442
11443
  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) {
11443
11444
  if (rf & 1) {
11444
11445
  i0__namespace.ɵɵtemplate(0, CaseFileViewFieldComponent_div_0_Template, 5, 0, "div", 0);
@@ -11458,7 +11459,7 @@
11458
11459
  templateUrl: './case-file-view-field.component.html',
11459
11460
  styleUrls: ['./case-file-view-field.component.scss'],
11460
11461
  }]
11461
- }], function () { return [{ type: i0__namespace.ElementRef }, { type: i1__namespace$1.ActivatedRoute }, { type: CaseFileViewService }, { type: DocumentManagementService }, { type: LoadingService }]; }, null);
11462
+ }], function () { return [{ type: i0__namespace.ElementRef }, { type: i1__namespace$1.ActivatedRoute }, { type: CaseFileViewService }, { type: DocumentManagementService }, { type: LoadingService }, { type: SessionStorageService }]; }, null);
11462
11463
  })();
11463
11464
 
11464
11465
  function CaseFileViewFieldReadComponent_div_0_Template(rf, ctx) {
@@ -11520,7 +11521,11 @@
11520
11521
  }
11521
11522
  CaseFileViewFieldReadComponent.prototype.ngOnInit = function () {
11522
11523
  _super.prototype.ngOnInit.call(this);
11523
- this.allowMoving = this.caseField.acls.some(function (acl) { return acl.update; });
11524
+ var userInfo = JSON.parse(this.sessionStorageService.getItem('userDetails'));
11525
+ // Get acls that intersects from acl roles and user roles
11526
+ var acls = this.caseField.acls.filter(function (acl) { return userInfo.roles.includes(acl.role); });
11527
+ // As there can be more than one intersecting role, if any acls are update: true
11528
+ this.allowMoving = acls.some(function (acl) { return acl.update; });
11524
11529
  };
11525
11530
  return CaseFileViewFieldReadComponent;
11526
11531
  }(CaseFileViewFieldComponent));