@hmcts/ccd-case-ui-toolkit 7.0.38-exui-1856-rc1 → 7.0.38-fix-service-code-api

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.
@@ -1183,7 +1183,6 @@ var DisplayMode;
1183
1183
  DisplayMode[DisplayMode["ICON"] = 1] = "ICON";
1184
1184
  })(DisplayMode || (DisplayMode = {}));
1185
1185
 
1186
- /* istanbul ignore file */
1187
1186
  class AbstractAppConfig {
1188
1187
  /**
1189
1188
  * Dummy version replacing deprecated `getRemotePrintServiceUrl()`, to be removed in next major release
@@ -11325,7 +11324,7 @@ function CaseFileViewFieldComponent_div_2_ng_container_8_Template(rf, ctx) { if
11325
11324
  } if (rf & 2) {
11326
11325
  const ctx_r5 = i0.ɵɵnextContext(2);
11327
11326
  i0.ɵɵadvance(1);
11328
- i0.ɵɵproperty("url", ctx_r5.currentDocument.document_binary_url)("downloadFileName", ctx_r5.currentDocument.document_filename)("showToolbar", true)("contentType", ctx_r5.currentDocument.content_type)("enableAnnotations", true)("enableRedactions", true)("height", "94.5vh")("enableICP", ctx_r5.isIcpEnabled());
11327
+ i0.ɵɵproperty("url", ctx_r5.currentDocument.document_binary_url)("downloadFileName", ctx_r5.currentDocument.document_filename)("showToolbar", true)("contentType", ctx_r5.currentDocument.content_type)("enableAnnotations", true)("enableRedactions", true)("height", "94.5vh");
11329
11328
  } }
11330
11329
  function CaseFileViewFieldComponent_div_2_Template(rf, ctx) { if (rf & 1) {
11331
11330
  const _r7 = i0.ɵɵgetCurrentView();
@@ -11337,7 +11336,7 @@ function CaseFileViewFieldComponent_div_2_Template(rf, ctx) { if (rf & 1) {
11337
11336
  i0.ɵɵelementEnd()();
11338
11337
  i0.ɵɵelement(6, "div", 16);
11339
11338
  i0.ɵɵelementStart(7, "div", 17);
11340
- i0.ɵɵtemplate(8, CaseFileViewFieldComponent_div_2_ng_container_8_Template, 2, 8, "ng-container", 0);
11339
+ i0.ɵɵtemplate(8, CaseFileViewFieldComponent_div_2_ng_container_8_Template, 2, 7, "ng-container", 0);
11341
11340
  i0.ɵɵelementEnd()()();
11342
11341
  } if (rf & 2) {
11343
11342
  const ctx_r2 = i0.ɵɵnextContext();
@@ -11347,20 +11346,16 @@ function CaseFileViewFieldComponent_div_2_Template(rf, ctx) { if (rf & 1) {
11347
11346
  i0.ɵɵproperty("ngIf", ctx_r2.currentDocument);
11348
11347
  } }
11349
11348
  class CaseFileViewFieldComponent {
11350
- constructor(elementRef, route, caseFileViewService, documentManagementService, loadingService, sessionStorageService, caseNotifier, abstractConfig) {
11349
+ constructor(elementRef, route, caseFileViewService, documentManagementService, loadingService, sessionStorageService) {
11351
11350
  this.elementRef = elementRef;
11352
11351
  this.route = route;
11353
11352
  this.caseFileViewService = caseFileViewService;
11354
11353
  this.documentManagementService = documentManagementService;
11355
11354
  this.loadingService = loadingService;
11356
11355
  this.sessionStorageService = sessionStorageService;
11357
- this.caseNotifier = caseNotifier;
11358
- this.abstractConfig = abstractConfig;
11359
11356
  this.allowMoving = true;
11360
11357
  this.getCategoriesAndDocumentsError = false;
11361
11358
  this.errorMessages = [];
11362
- this.icp_jurisdictions = [];
11363
- this.icpEnabled = false;
11364
11359
  }
11365
11360
  ngOnInit() {
11366
11361
  const cid = this.route.snapshot.paramMap.get(CaseFileViewFieldComponent.PARAM_CASE_ID);
@@ -11377,8 +11372,6 @@ class CaseFileViewFieldComponent {
11377
11372
  const acls = this.caseField.acls.filter(acl => userInfo.roles.includes(acl.role));
11378
11373
  // As there can be more than one intersecting role, if any acls are update: true
11379
11374
  this.allowMoving = acls.some(acl => acl.update);
11380
- this.icp_jurisdictions = this.abstractConfig.getIcpJurisdictions();
11381
- this.icpEnabled = this.abstractConfig.getIcpEnable();
11382
11375
  }
11383
11376
  ngAfterViewInit() {
11384
11377
  const slider = this.elementRef.nativeElement.querySelector('.slider');
@@ -11437,13 +11430,10 @@ class CaseFileViewFieldComponent {
11437
11430
  this.categoriesAndDocumentsSubscription.unsubscribe();
11438
11431
  }
11439
11432
  }
11440
- isIcpEnabled() {
11441
- return this.icpEnabled && ((this.icp_jurisdictions?.length < 1) || this.icp_jurisdictions.includes(this.caseNotifier?.cachedCaseView?.case_type?.jurisdiction.id));
11442
- }
11443
11433
  }
11444
11434
  CaseFileViewFieldComponent.PARAM_CASE_ID = 'cid';
11445
- CaseFileViewFieldComponent.ɵfac = function CaseFileViewFieldComponent_Factory(t) { return new (t || CaseFileViewFieldComponent)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(CaseFileViewService), i0.ɵɵdirectiveInject(DocumentManagementService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(AbstractAppConfig)); };
11446
- CaseFileViewFieldComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseFileViewFieldComponent, selectors: [["ccd-case-file-view-field"]], decls: 3, vars: 3, consts: [[4, "ngIf"], ["class", "govuk-grid-column-two-thirds", 4, "ngIf"], ["id", "case-file-view-field-errors", "data-module", "govuk-error-summary", 1, "govuk-error-summary", "govuk-!-margin-bottom-4"], ["role", "alert"], [1, "govuk-error-summary__title"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [4, "ngFor", "ngForOf"], ["href", "javascript:void(0);"], [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", "enableICP"]], template: function CaseFileViewFieldComponent_Template(rf, ctx) { if (rf & 1) {
11435
+ CaseFileViewFieldComponent.ɵfac = function CaseFileViewFieldComponent_Factory(t) { return new (t || CaseFileViewFieldComponent)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(CaseFileViewService), i0.ɵɵdirectiveInject(DocumentManagementService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(SessionStorageService)); };
11436
+ CaseFileViewFieldComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseFileViewFieldComponent, selectors: [["ccd-case-file-view-field"]], decls: 3, vars: 3, consts: [[4, "ngIf"], ["class", "govuk-grid-column-two-thirds", 4, "ngIf"], ["id", "case-file-view-field-errors", "data-module", "govuk-error-summary", 1, "govuk-error-summary", "govuk-!-margin-bottom-4"], ["role", "alert"], [1, "govuk-error-summary__title"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [4, "ngFor", "ngForOf"], ["href", "javascript:void(0);"], [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) { if (rf & 1) {
11447
11437
  i0.ɵɵtemplate(0, CaseFileViewFieldComponent_ng_container_0_Template, 8, 1, "ng-container", 0);
11448
11438
  i0.ɵɵtemplate(1, CaseFileViewFieldComponent_div_1_Template, 5, 0, "div", 1);
11449
11439
  i0.ɵɵtemplate(2, CaseFileViewFieldComponent_div_2_Template, 9, 3, "div", 0);
@@ -11456,8 +11446,8 @@ CaseFileViewFieldComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type:
11456
11446
  } }, styles: ["#case-file-view[_ngcontent-%COMP%]{display:flex;border:2px solid #C9C9C9;height:100vh;position:relative}#case-file-view[_ngcontent-%COMP%] .document-tree-container[_ngcontent-%COMP%]{background-color:#faf8f8;width:30%;min-height:400px;min-width:10%}#case-file-view[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]{width:.2%;background-color:#6b6b6b}#case-file-view[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]:hover, #case-file-view[_ngcontent-%COMP%] .slider[_ngcontent-%COMP%]:focus{cursor:col-resize}#case-file-view[_ngcontent-%COMP%] .media-viewer-container[_ngcontent-%COMP%]{background-color:#dee0e2;flex:1 1 0;overflow:hidden}"] });
11457
11447
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseFileViewFieldComponent, [{
11458
11448
  type: Component,
11459
- args: [{ selector: 'ccd-case-file-view-field', template: "<ng-container *ngIf=\"errorMessages?.length\">\n <div\n id=\"case-file-view-field-errors\"\n class=\"govuk-error-summary govuk-!-margin-bottom-4\" data-module=\"govuk-error-summary\">\n <div role=\"alert\">\n <h2 class=\"govuk-error-summary__title\">\n There is a problem\n </h2>\n <div class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li *ngFor=\"let errorMessage of errorMessages\">\n <a href=\"javascript:void(0);\">{{ errorMessage }}</a>\n </li>\n </ul>\n </div>\n </div>\n </div>\n</ng-container>\n\n<div *ngIf=\"getCategoriesAndDocumentsError\" class=\"govuk-grid-column-two-thirds\">\n <h1 class=\"govuk-heading-xl\">Sorry, there is a problem with the service</h1>\n <p class=\"govuk-body\">Try again later.</p>\n</div>\n<div *ngIf=\"!getCategoriesAndDocumentsError\">\n <h2 class=\"govuk-heading-l\">Case file</h2>\n <div class=\"govuk-form-group\" id=\"case-file-view\">\n <!-- Document tree -->\n <div class=\"document-tree-container\">\n <ccd-case-file-view-folder\n class=\"document-tree-container__tree\"\n [categoriesAndDocuments]=\"categoriesAndDocuments$\"\n (clickedDocument)=\"setMediaViewerFile($event); resetErrorMessages()\"\n (moveDocument)=\"moveDocument($event)\"\n [allowMoving]=\"allowMoving\"\n ></ccd-case-file-view-folder>\n </div>\n <!-- Slider -->\n <div class=\"slider\"></div>\n <!-- Media viewer -->\n <div class=\"media-viewer-container\">\n <ng-container *ngIf=\"currentDocument\">\n <mv-media-viewer [url]=\"currentDocument.document_binary_url\"\n [downloadFileName]=\"currentDocument.document_filename\"\n [showToolbar]=\"true\"\n [contentType]=\"currentDocument.content_type\"\n [enableAnnotations]=\"true\"\n [enableRedactions]=\"true\"\n [height]=\"'94.5vh'\"\n [enableICP]=\"isIcpEnabled()\">\n </mv-media-viewer>\n </ng-container>\n </div>\n </div>\n</div>\n", styles: ["#case-file-view{display:flex;border:2px solid #C9C9C9;height:100vh;position:relative}#case-file-view .document-tree-container{background-color:#faf8f8;width:30%;min-height:400px;min-width:10%}#case-file-view .slider{width:.2%;background-color:#6b6b6b}#case-file-view .slider:hover,#case-file-view .slider:focus{cursor:col-resize}#case-file-view .media-viewer-container{background-color:#dee0e2;flex:1 1 0;overflow:hidden}\n"] }]
11460
- }], function () { return [{ type: i0.ElementRef }, { type: i1$1.ActivatedRoute }, { type: CaseFileViewService }, { type: DocumentManagementService }, { type: LoadingService }, { type: SessionStorageService }, { type: CaseNotifier }, { type: AbstractAppConfig }]; }, null); })();
11449
+ args: [{ selector: 'ccd-case-file-view-field', template: "<ng-container *ngIf=\"errorMessages?.length\">\n <div\n id=\"case-file-view-field-errors\"\n class=\"govuk-error-summary govuk-!-margin-bottom-4\" data-module=\"govuk-error-summary\">\n <div role=\"alert\">\n <h2 class=\"govuk-error-summary__title\">\n There is a problem\n </h2>\n <div class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li *ngFor=\"let errorMessage of errorMessages\">\n <a href=\"javascript:void(0);\">{{ errorMessage }}</a>\n </li>\n </ul>\n </div>\n </div>\n </div>\n</ng-container>\n\n<div *ngIf=\"getCategoriesAndDocumentsError\" class=\"govuk-grid-column-two-thirds\">\n <h1 class=\"govuk-heading-xl\">Sorry, there is a problem with the service</h1>\n <p class=\"govuk-body\">Try again later.</p>\n</div>\n<div *ngIf=\"!getCategoriesAndDocumentsError\">\n <h2 class=\"govuk-heading-l\">Case file</h2>\n <div class=\"govuk-form-group\" id=\"case-file-view\">\n <!-- Document tree -->\n <div class=\"document-tree-container\">\n <ccd-case-file-view-folder\n class=\"document-tree-container__tree\"\n [categoriesAndDocuments]=\"categoriesAndDocuments$\"\n (clickedDocument)=\"setMediaViewerFile($event); resetErrorMessages()\"\n (moveDocument)=\"moveDocument($event)\"\n [allowMoving]=\"allowMoving\"\n ></ccd-case-file-view-folder>\n </div>\n <!-- Slider -->\n <div class=\"slider\"></div>\n <!-- Media viewer -->\n <div class=\"media-viewer-container\">\n <ng-container *ngIf=\"currentDocument\">\n <mv-media-viewer [url]=\"currentDocument.document_binary_url\"\n [downloadFileName]=\"currentDocument.document_filename\"\n [showToolbar]=\"true\"\n [contentType]=\"currentDocument.content_type\"\n [enableAnnotations]=\"true\"\n [enableRedactions]=\"true\"\n [height]=\"'94.5vh'\">\n </mv-media-viewer>\n </ng-container>\n </div>\n </div>\n</div>\n", styles: ["#case-file-view{display:flex;border:2px solid #C9C9C9;height:100vh;position:relative}#case-file-view .document-tree-container{background-color:#faf8f8;width:30%;min-height:400px;min-width:10%}#case-file-view .slider{width:.2%;background-color:#6b6b6b}#case-file-view .slider:hover,#case-file-view .slider:focus{cursor:col-resize}#case-file-view .media-viewer-container{background-color:#dee0e2;flex:1 1 0;overflow:hidden}\n"] }]
11450
+ }], function () { return [{ type: i0.ElementRef }, { type: i1$1.ActivatedRoute }, { type: CaseFileViewService }, { type: DocumentManagementService }, { type: LoadingService }, { type: SessionStorageService }]; }, null); })();
11461
11451
 
11462
11452
  class CaseFlagStateService {
11463
11453
  constructor() {
@@ -17026,20 +17016,20 @@ class WriteLinkedCasesFieldComponent extends AbstractFieldWriteComponent {
17026
17016
  getLinkedCaseReasons(serviceId) {
17027
17017
  const reasonCodeAPIurl = `${this.appConfig.getRDCommonDataApiUrl()}/lov/categories/CaseLinkingReasonCode?serviceId=${serviceId}`;
17028
17018
  this.commonDataService.getRefData(reasonCodeAPIurl).subscribe({
17029
- next: reasons => {
17019
+ next: (reasons) => {
17030
17020
  // Sort in ascending order
17031
17021
  const linkCaseReasons = reasons.list_of_values.sort((a, b) => (a.value_en > b.value_en) ? 1 : -1);
17032
- this.linkedCasesService.linkCaseReasons = linkCaseReasons?.filter(reason => reason.value_en !== 'Other');
17022
+ this.linkedCasesService.linkCaseReasons = linkCaseReasons?.filter((reason) => reason.value_en !== 'Other');
17033
17023
  // Move Other option to the end of the list
17034
- this.linkedCasesService.linkCaseReasons.push(linkCaseReasons?.find(reason => reason.value_en === 'Other'));
17024
+ this.linkedCasesService.linkCaseReasons.push(linkCaseReasons?.find((reason) => reason.value_en === 'Other'));
17035
17025
  }
17036
17026
  });
17037
17027
  }
17038
17028
  getOrgService() {
17039
17029
  const servicesApiUrl = `refdata/location/orgServices?ccdCaseType=${this.caseDetails?.case_type?.id}`;
17040
- this.commonDataService.getServiceOrgData(servicesApiUrl).subscribe(result => {
17041
- result.forEach(ids => {
17042
- this.getLinkedCaseReasons(ids.service_id);
17030
+ this.commonDataService.getServiceOrgData(servicesApiUrl).subscribe((result) => {
17031
+ result.forEach((ids) => {
17032
+ this.getLinkedCaseReasons(ids.service_code);
17043
17033
  });
17044
17034
  });
17045
17035
  }