@hmcts/ccd-case-ui-toolkit 7.3.54-unused-package → 7.3.55-message-interpolation

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.
@@ -6883,6 +6883,7 @@ class LabelSubstitutorModule {
6883
6883
  static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ providers: [
6884
6884
  FieldsUtils,
6885
6885
  CurrencyPipe,
6886
+ PlaceholderService
6886
6887
  ] });
6887
6888
  }
6888
6889
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LabelSubstitutorModule, [{
@@ -6897,6 +6898,7 @@ class LabelSubstitutorModule {
6897
6898
  providers: [
6898
6899
  FieldsUtils,
6899
6900
  CurrencyPipe,
6901
+ PlaceholderService
6900
6902
  ]
6901
6903
  }]
6902
6904
  }], null, null); })();
@@ -8918,10 +8920,10 @@ class CaseworkerService {
8918
8920
  this.appConfig = appConfig;
8919
8921
  this.errorService = errorService;
8920
8922
  }
8921
- getUserByIdamId(idamId) {
8922
- const url = `${this.appConfig.getWorkAllocationApiUrl()}/caseworker/getUserByIdamId`;
8923
+ getCaseworkers(serviceId) {
8924
+ const url = `${this.appConfig.getWorkAllocationApiUrl()}/caseworker/getUsersByServiceName`;
8923
8925
  return this.http
8924
- .post(url, idamId)
8926
+ .post(url, { services: [serviceId] })
8925
8927
  .pipe(catchError(error => {
8926
8928
  this.errorService.setError(error);
8927
8929
  return throwError(error);
@@ -11336,6 +11338,8 @@ class CaseEditPageComponent {
11336
11338
  dialogRefAfterClosedSub;
11337
11339
  saveDraftSub;
11338
11340
  caseFormValidationErrorsSub;
11341
+ fieldsUtils = new FieldsUtils();
11342
+ placeholderService = new PlaceholderService();
11339
11343
  static scrollToTop() {
11340
11344
  window.scrollTo(0, 0);
11341
11345
  }
@@ -11502,7 +11506,7 @@ class CaseEditPageComponent {
11502
11506
  ? group.get(`${casefield.id}_judicialUserControl`)
11503
11507
  : group.get(casefield.id);
11504
11508
  if (fieldElement) {
11505
- const label = casefield.label || 'Field';
11509
+ const label = this.getInterpolatedFieldLabel(casefield);
11506
11510
  let id = casefield.id;
11507
11511
  if (fieldElement['component'] && fieldElement['component'].parent) {
11508
11512
  if (fieldElement['component'].idPrefix.indexOf(`_${id}_`) === -1) {
@@ -11562,7 +11566,7 @@ class CaseEditPageComponent {
11562
11566
  });
11563
11567
  }
11564
11568
  else {
11565
- this.validationErrors.push({ id, message: `Select or fill the required ${casefield.label} field` });
11569
+ this.validationErrors.push({ id, message: `Select or fill the required ${label} field` });
11566
11570
  fieldElement.markAsDirty();
11567
11571
  }
11568
11572
  }
@@ -11965,6 +11969,16 @@ class CaseEditPageComponent {
11965
11969
  getRpxTranslatePipeArgs(fieldLabel) {
11966
11970
  return fieldLabel ? ({ FIELDLABEL: fieldLabel }) : null;
11967
11971
  }
11972
+ getInterpolatedFieldLabel(caseField) {
11973
+ const label = caseField.label || 'Field';
11974
+ const dataControl = this.editForm?.controls?.['data'];
11975
+ const formFields = dataControl && typeof dataControl.getRawValue === 'function'
11976
+ ? dataControl.getRawValue()
11977
+ : {};
11978
+ const contextFields = this.caseFields?.length ? this.caseFields : this.eventTrigger?.case_fields || [];
11979
+ const fields = this.fieldsUtils.mergeLabelCaseFieldsAndFormFields(contextFields, formFields);
11980
+ return this.placeholderService.resolvePlaceholders(fields, label);
11981
+ }
11968
11982
  onEventCanBeCompleted(eventCanBeCompleted) {
11969
11983
  this.caseEdit.onEventCanBeCompleted({
11970
11984
  eventTrigger: this.eventTrigger,
@@ -12015,7 +12029,7 @@ class CaseEditPageComponent {
12015
12029
  type: Component,
12016
12030
  args: [{ selector: 'ccd-case-edit-page', standalone: false, template: "<ng-container *ngIf=\"currentPage\">\n <h1 *ngIf=\"!currentPage.label\" class=\"govuk-heading-l\">{{eventTrigger.name | rpxTranslate}}</h1>\n <ng-container *ngIf=\"currentPage.label\">\n <span class=\"govuk-caption-l\">{{ eventTrigger.name | rpxTranslate}}</span>\n <h1 class=\"govuk-heading-l\">{{currentPage.label | rpxTranslate}}</h1>\n </ng-container>\n</ng-container>\n\n<!--Case ID or Title -->\n<div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n<ng-template #titleBlock>\n <ccd-markdown [content]=\"getCaseTitle() | ccdCaseTitle: caseFields : editForm.controls['data'] | rpxTranslate\"></ccd-markdown>\n</ng-template>\n<ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n</ng-template>\n\n<!-- Error message summary -->\n<div *ngIf=\"validationErrors.length > 0\" class=\"govuk-error-summary\" aria-labelledby=\"error-summary-title\" role=\"alert\" tabindex=\"-1\" data-module=\"govuk-error-summary\">\n <h2 class=\"govuk-error-summary__title\" id=\"error-summary-title\">\n {{'There is a problem' | rpxTranslate}}\n </h2>\n <div *ngFor=\"let validationError of validationErrors\" class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li>\n <a (click)=\"navigateToErrorElement(validationError.id)\" (keyup.enter)=\"navigateToErrorElement(validationError.id)\" tabindex=\"0\" class=\"validation-error\">\n {{ validationError.message | rpxTranslate: getRpxTranslatePipeArgs(validationError.label | rpxTranslate): null }}\n </a>\n </li>\n </ul>\n </div>\n</div>\n\n<ccd-case-edit-generic-errors [error]=\"caseEdit.error\"></ccd-case-edit-generic-errors>\n\n<ccd-callback-errors\n [triggerTextContinue]=\"triggerTextStart\"\n [triggerTextIgnore]=\"triggerTextIgnoreWarnings\"\n [callbackErrorsSubject]=\"caseEdit.callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\">\n</ccd-callback-errors>\n<div class=\"width-50\">\n <form *ngIf=\"currentPage\" class=\"form\" [formGroup]=\"editForm\" (submit)=\"nextStep()\">\n <fieldset id=\"fieldset-case-data\">\n <legend style=\"display: none;\"></legend>\n <!-- single column -->\n <ccd-case-edit-form id='caseEditForm' *ngIf=\"!currentPage.isMultiColumn()\" [fields]=\"currentPage.getCol1Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"\n [pageChangeSubject]=\"pageChangeSubject\"\n (valuesChanged)=\"applyValuesChanged($event)\"></ccd-case-edit-form>\n <!-- two columns -->\n <div *ngIf=\"currentPage.isMultiColumn()\" class=\"grid-row\">\n <div class=\"column-two-thirds rightBorderSeparator\">\n <ccd-case-edit-form id='caseEditForm1' [fields]=\"currentPage.getCol1Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"></ccd-case-edit-form>\n </div>\n <div class=\"column-one-third\">\n <ccd-case-edit-form id='caseEditForm2' [fields]=\"currentPage.getCol2Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"></ccd-case-edit-form>\n </div>\n </div>\n </fieldset>\n\n <div class=\"form-group form-group-related\">\n <button class=\"button button-secondary\" type=\"button\" (click)=\"toPreviousPage()\" *ngIf=\"!isAtStart()\" [disabled]=\"isDisabled()\">\n {{'Previous' | rpxTranslate}}\n </button>\n <button class=\"button\" type=\"submit\" [disabled]=\"submitting()\">{{triggerText | rpxTranslate}}</button>\n </div>\n\n <p class=\"cancel\"><button type=\"button\" (click)=\"cancel()\" class=\"govuk-js-link\">{{getCancelText() | rpxTranslate}}</button></p>\n </form>\n</div>\n\n<ccd-case-event-completion *ngIf=\"caseEdit.isEventCompletionChecksRequired\"\n [eventCompletionParams]=\"caseEdit.eventCompletionParams\"\n (eventCanBeCompleted)=\"onEventCanBeCompleted($event)\">\n</ccd-case-event-completion>\n", styles: [".rightBorderSeparator{border-right-width:4px;border-right-color:#ffcc02;border-right-style:solid}.validation-error{cursor:pointer;text-decoration:underline;color:#d4351c}\n"] }]
12017
12031
  }], () => [{ type: CaseEditComponent }, { type: i1$1.ActivatedRoute }, { type: FormValueService }, { type: FormErrorService }, { type: i0.ChangeDetectorRef }, { type: PageValidationService }, { type: i1$3.MatLegacyDialog }, { type: CaseFieldService }, { type: CaseEditDataService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }, { type: MultipageComponentStateService }, { type: AddressesService }, { type: LinkedCasesService }, { type: CaseFlagStateService }], null); })();
12018
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditPageComponent, { className: "CaseEditPageComponent", filePath: "lib/shared/components/case-editor/case-edit-page/case-edit-page.component.ts", lineNumber: 35 }); })();
12032
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditPageComponent, { className: "CaseEditPageComponent", filePath: "lib/shared/components/case-editor/case-edit-page/case-edit-page.component.ts", lineNumber: 36 }); })();
12019
12033
 
12020
12034
  class CallbackErrorsContext {
12021
12035
  triggerText;
@@ -12461,9 +12475,12 @@ class CaseEventCompletionTaskReassignedComponent {
12461
12475
  this.jurisdiction = task.jurisdiction;
12462
12476
  this.caseType = task.case_type_id;
12463
12477
  // Current user is a caseworker?
12464
- this.caseworkerSubscription = this.caseworkerService.getUserByIdamId(task.assignee).subscribe(caseworker => {
12465
- if (caseworker) {
12466
- this.assignedUserName = `${caseworker.firstName} ${caseworker.lastName}`;
12478
+ this.caseworkerSubscription = this.caseworkerService.getCaseworkers(task.jurisdiction).subscribe(result => {
12479
+ if (result && result[0].service === task.jurisdiction && result[0].caseworkers) {
12480
+ const caseworker = result[0].caseworkers.find(x => x.idamId === task.assignee);
12481
+ if (caseworker) {
12482
+ this.assignedUserName = `${caseworker.firstName} ${caseworker.lastName}`;
12483
+ }
12467
12484
  }
12468
12485
  if (!this.assignedUserName) {
12469
12486
  // Current user is a judicial user?
@@ -29441,22 +29458,24 @@ class UpdateFlagTitleDisplayPipe extends AsyncPipe {
29441
29458
 
29442
29459
  const _c0$l = (a0, a1, a2) => [a0, false, undefined, true, a1, a2];
29443
29460
  function ReadComplexFieldRawComponent_ng_container_1_Template(rf, ctx) { if (rf & 1) {
29444
- i0.ɵɵelementContainerStart(0);
29445
- i0.ɵɵelementStart(1, "dt", 2)(2, "span", 3);
29446
- i0.ɵɵtext(3);
29447
- i0.ɵɵpipe(4, "rpxTranslate");
29461
+ i0.ɵɵelementContainerStart(0)(1, 2);
29462
+ i0.ɵɵelementStart(2, "dt", 3)(3, "span", 4);
29463
+ i0.ɵɵtext(4);
29464
+ i0.ɵɵpipe(5, "rpxTranslate");
29448
29465
  i0.ɵɵelementEnd()();
29449
- i0.ɵɵelementStart(5, "dd", 2);
29450
- i0.ɵɵelement(6, "ccd-field-read", 4);
29466
+ i0.ɵɵelementStart(6, "dd", 3);
29467
+ i0.ɵɵelement(7, "ccd-field-read", 5);
29451
29468
  i0.ɵɵelementEnd();
29452
- i0.ɵɵelementContainerEnd();
29469
+ i0.ɵɵelementContainerEnd()();
29453
29470
  } if (rf & 2) {
29454
29471
  const field_r1 = ctx.$implicit;
29455
29472
  const ctx_r1 = i0.ɵɵnextContext();
29456
29473
  i0.ɵɵadvance();
29474
+ i0.ɵɵproperty("caseField", field_r1)("formGroup", ctx_r1.topLevelFormGroup)("contextFields", ctx_r1.caseFields);
29475
+ i0.ɵɵadvance();
29457
29476
  i0.ɵɵproperty("hidden", field_r1.hidden || field_r1.field_type.type === "Label");
29458
29477
  i0.ɵɵadvance(2);
29459
- i0.ɵɵtextInterpolate(ctx_r1.isTranslatable(field_r1) ? i0.ɵɵpipeBind1(4, 8, field_r1.label) : field_r1.label);
29478
+ i0.ɵɵtextInterpolate(ctx_r1.isTranslatable(field_r1) ? i0.ɵɵpipeBind1(5, 11, field_r1.label) : field_r1.label);
29460
29479
  i0.ɵɵadvance(2);
29461
29480
  i0.ɵɵproperty("hidden", field_r1.hidden);
29462
29481
  i0.ɵɵadvance();
@@ -29469,9 +29488,9 @@ function ReadComplexFieldRawComponent_ng_container_1_Template(rf, ctx) { if (rf
29469
29488
  class ReadComplexFieldRawComponent extends AbstractFieldReadComponent {
29470
29489
  caseFields = [];
29471
29490
  static ɵfac = /*@__PURE__*/ (() => { let ɵReadComplexFieldRawComponent_BaseFactory; return function ReadComplexFieldRawComponent_Factory(__ngFactoryType__) { return (ɵReadComplexFieldRawComponent_BaseFactory || (ɵReadComplexFieldRawComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ReadComplexFieldRawComponent)))(__ngFactoryType__ || ReadComplexFieldRawComponent); }; })();
29472
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ReadComplexFieldRawComponent, selectors: [["ccd-read-complex-field-raw"]], inputs: { caseFields: "caseFields" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 3, vars: 12, consts: [[1, "complex-raw"], [4, "ngFor", "ngForOf"], [3, "hidden"], [1, "text-16"], [3, "caseField", "context", "caseFields", "topLevelFormGroup", "idPrefix"]], template: function ReadComplexFieldRawComponent_Template(rf, ctx) { if (rf & 1) {
29491
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ReadComplexFieldRawComponent, selectors: [["ccd-read-complex-field-raw"]], inputs: { caseFields: "caseFields" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 3, vars: 12, consts: [[1, "complex-raw"], [4, "ngFor", "ngForOf"], ["ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields"], [3, "hidden"], [1, "text-16"], [3, "caseField", "context", "caseFields", "topLevelFormGroup", "idPrefix"]], template: function ReadComplexFieldRawComponent_Template(rf, ctx) { if (rf & 1) {
29473
29492
  i0.ɵɵelementStart(0, "dl", 0);
29474
- i0.ɵɵtemplate(1, ReadComplexFieldRawComponent_ng_container_1_Template, 7, 10, "ng-container", 1);
29493
+ i0.ɵɵtemplate(1, ReadComplexFieldRawComponent_ng_container_1_Template, 8, 13, "ng-container", 1);
29475
29494
  i0.ɵɵpipe(2, "ccdReadFieldsFilter");
29476
29495
  i0.ɵɵelementEnd();
29477
29496
  } if (rf & 2) {
@@ -29481,7 +29500,7 @@ class ReadComplexFieldRawComponent extends AbstractFieldReadComponent {
29481
29500
  }
29482
29501
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ReadComplexFieldRawComponent, [{
29483
29502
  type: Component,
29484
- args: [{ selector: 'ccd-read-complex-field-raw', standalone: false, template: "<dl class=\"complex-raw\">\n <ng-container *ngFor=\"let field of caseField | ccdReadFieldsFilter:false :undefined :true :topLevelFormGroup :id()\">\n <dt [hidden]=\"field.hidden || field.field_type.type === 'Label'\"><span class=\"text-16\">{{isTranslatable(field) ? (field.label | rpxTranslate) : field.label}}</span></dt>\n <dd [hidden]=\"field.hidden\">\n <ccd-field-read [caseField]=\"field\" [context]=\"context\" [caseFields]=\"caseFields\" [topLevelFormGroup]=\"topLevelFormGroup\" [idPrefix]=\"idPrefix\"></ccd-field-read>\n </dd>\n </ng-container>\n</dl>\n", styles: ["dl.complex-raw{list-style-type:none;margin:5px 0 10px}dl.complex-raw dl.complex-raw{padding-left:2ch}dl.complex-raw dt{font-weight:700}\n"] }]
29503
+ args: [{ selector: 'ccd-read-complex-field-raw', standalone: false, template: "<dl class=\"complex-raw\">\n <ng-container *ngFor=\"let field of caseField | ccdReadFieldsFilter:false :undefined :true :topLevelFormGroup :id()\">\n <ng-container ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"topLevelFormGroup\" [contextFields]=\"caseFields\">\n <dt [hidden]=\"field.hidden || field.field_type.type === 'Label'\"><span class=\"text-16\">{{isTranslatable(field) ? (field.label | rpxTranslate) : field.label}}</span></dt>\n <dd [hidden]=\"field.hidden\">\n <ccd-field-read [caseField]=\"field\" [context]=\"context\" [caseFields]=\"caseFields\" [topLevelFormGroup]=\"topLevelFormGroup\" [idPrefix]=\"idPrefix\"></ccd-field-read>\n </dd>\n </ng-container>\n </ng-container>\n</dl>\n", styles: ["dl.complex-raw{list-style-type:none;margin:5px 0 10px}dl.complex-raw dl.complex-raw{padding-left:2ch}dl.complex-raw dt{font-weight:700}\n"] }]
29485
29504
  }], null, { caseFields: [{
29486
29505
  type: Input
29487
29506
  }] }); })();
@@ -32352,7 +32371,7 @@ i0.ɵɵsetComponentScope(ReadOrderSummaryRowComponent, function () { return [Rea
32352
32371
  i0.ɵɵsetComponentScope(ReadComplexFieldComponent, function () { return [i5.NgSwitch, i5.NgSwitchCase, i5.NgSwitchDefault, ReadComplexFieldRawComponent,
32353
32372
  ReadComplexFieldTableComponent,
32354
32373
  ReadComplexFieldCollectionTableComponent]; }, []);
32355
- i0.ɵɵsetComponentScope(ReadComplexFieldRawComponent, function () { return [i5.NgForOf, FieldReadComponent]; }, function () { return [ReadFieldsFilterPipe, i1.RpxTranslatePipe]; });
32374
+ i0.ɵɵsetComponentScope(ReadComplexFieldRawComponent, function () { return [i5.NgForOf, i4.NgControlStatusGroup, i4.FormGroupDirective, LabelSubstitutorDirective, FieldReadComponent]; }, function () { return [ReadFieldsFilterPipe, i1.RpxTranslatePipe]; });
32356
32375
  i0.ɵɵsetComponentScope(ReadComplexFieldTableComponent, function () { return [i5.NgForOf, i5.NgIf, FieldReadComponent]; }, function () { return [IsCompoundPipe, ReadFieldsFilterPipe, i1.RpxTranslatePipe]; });
32357
32376
  i0.ɵɵsetComponentScope(ReadComplexFieldCollectionTableComponent, function () { return [i5.NgForOf, i5.NgIf, FieldReadComponent,
32358
32377
  ReadCaseLinkFieldComponent]; }, function () { return [i5.KeyValuePipe, IsCompoundPipe, CcdCollectionTableCaseFieldsFilterPipe, ReadFieldsFilterPipe, i1.RpxTranslatePipe]; });
@@ -37572,9 +37591,12 @@ class TaskAssignedComponent {
37572
37591
  // Current user is a caseworker?
37573
37592
  this.jurisdiction = this.task.jurisdiction;
37574
37593
  this.caseType = this.task.case_type_id;
37575
- this.caseworkerSubscription = this.caseworkerService.getUserByIdamId(this.task.assignee).subscribe(caseworker => {
37576
- if (caseworker) {
37577
- this.assignedUserName = `${caseworker.firstName} ${caseworker.lastName}`;
37594
+ this.caseworkerSubscription = this.caseworkerService.getCaseworkers(this.task.jurisdiction).subscribe(result => {
37595
+ if (result && result[0].service === this.task.jurisdiction && result[0].caseworkers) {
37596
+ const caseworker = result[0].caseworkers.find(x => x.idamId === this.task.assignee);
37597
+ if (caseworker) {
37598
+ this.assignedUserName = `${caseworker.firstName} ${caseworker.lastName}`;
37599
+ }
37578
37600
  }
37579
37601
  if (!this.assignedUserName) {
37580
37602
  // Current user is a judicial user?