@hmcts/ccd-case-ui-toolkit 6.13.10-b → 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) {
@@ -11516,10 +11517,16 @@
11516
11517
  var CaseFileViewFieldReadComponent = /** @class */ (function (_super) {
11517
11518
  __extends(CaseFileViewFieldReadComponent, _super);
11518
11519
  function CaseFileViewFieldReadComponent() {
11519
- var _this = _super.apply(this, __spread(arguments)) || this;
11520
- _this.allowMoving = false;
11521
- return _this;
11520
+ return _super !== null && _super.apply(this, arguments) || this;
11522
11521
  }
11522
+ CaseFileViewFieldReadComponent.prototype.ngOnInit = function () {
11523
+ _super.prototype.ngOnInit.call(this);
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; });
11529
+ };
11523
11530
  return CaseFileViewFieldReadComponent;
11524
11531
  }(CaseFileViewFieldComponent));
11525
11532
  CaseFileViewFieldReadComponent.ɵfac = function CaseFileViewFieldReadComponent_Factory(t) { return ɵCaseFileViewFieldReadComponent_BaseFactory(t || CaseFileViewFieldReadComponent); };