@hmcts/ccd-case-ui-toolkit 7.0.21 → 7.0.22

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.
@@ -13056,17 +13056,19 @@ class ReadComplexFieldComponent extends AbstractFieldReadComponent {
13056
13056
  this.context = PaletteContext.DEFAULT;
13057
13057
  }
13058
13058
  }
13059
- this.caseField?.field_type?.complex_fields?.forEach((field) => {
13060
- if (field?.isDynamic()) {
13061
- field.list_items = this.caseField.value[field.id]?.list_items;
13062
- field.value = {
13063
- list_items: field.list_items,
13064
- value: this.caseField.value[field.id]?.value && this.caseField.value[field.id].value.code ?
13065
- this.caseField.value[field.id].value.code :
13066
- this.caseField.value[field.id]?.value
13067
- };
13068
- }
13069
- });
13059
+ if (this.caseField?.field_type && this.caseField.field_type.complex_fields) {
13060
+ this.caseField?.field_type?.complex_fields?.forEach((field) => {
13061
+ if (field?.isDynamic()) {
13062
+ field.list_items = this.caseField.value[field.id]?.list_items;
13063
+ field.value = {
13064
+ list_items: field.list_items,
13065
+ value: this.caseField.value[field.id]?.value && this.caseField.value[field.id].value.code ?
13066
+ this.caseField.value[field.id].value.code :
13067
+ this.caseField.value[field.id]?.value
13068
+ };
13069
+ }
13070
+ });
13071
+ }
13070
13072
  }
13071
13073
  }
13072
13074
  ReadComplexFieldComponent.ɵfac = /*@__PURE__*/ function () { let ɵReadComplexFieldComponent_BaseFactory; return function ReadComplexFieldComponent_Factory(t) { return (ɵReadComplexFieldComponent_BaseFactory || (ɵReadComplexFieldComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ReadComplexFieldComponent)))(t || ReadComplexFieldComponent); }; }();
@@ -13647,7 +13649,7 @@ WriteDocumentFieldComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type:
13647
13649
 
13648
13650
  class DynamicListPipe {
13649
13651
  transform(value, items) {
13650
- const item = items.find(i => i.code === value);
13652
+ const item = items?.find(i => i.code === value);
13651
13653
  return item ? item.label : DynamicListPipe.EMPTY;
13652
13654
  }
13653
13655
  }
@@ -29717,29 +29719,29 @@ function CaseHistoryComponent_div_0_Template(rf, ctx) { if (rf & 1) {
29717
29719
  i0.ɵɵadvance(6);
29718
29720
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(15, 19, "Date"));
29719
29721
  i0.ɵɵadvance(3);
29720
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(18, 21, ctx_r0.caseHistory.event.timestamp));
29722
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(18, 21, ctx_r0.caseHistory.event.timestamp, "local"));
29721
29723
  i0.ɵɵadvance(4);
29722
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(22, 23, "Author"));
29724
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(22, 24, "Author"));
29723
29725
  i0.ɵɵadvance(3);
29724
- i0.ɵɵtextInterpolate2("", i0.ɵɵpipeBind1(25, 25, ctx_r0.caseHistory.event.user_first_name), " ", i0.ɵɵpipeBind1(26, 27, ctx_r0.caseHistory.event.user_last_name), "");
29726
+ i0.ɵɵtextInterpolate2("", i0.ɵɵpipeBind1(25, 26, ctx_r0.caseHistory.event.user_first_name), " ", i0.ɵɵpipeBind1(26, 28, ctx_r0.caseHistory.event.user_last_name), "");
29725
29727
  i0.ɵɵadvance(5);
29726
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(30, 29, "End state"));
29728
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(30, 30, "End state"));
29727
29729
  i0.ɵɵadvance(3);
29728
29730
  i0.ɵɵtextInterpolate(ctx_r0.caseHistory.event.state_name);
29729
29731
  i0.ɵɵadvance(3);
29730
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(36, 31, "Event"));
29732
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(36, 32, "Event"));
29731
29733
  i0.ɵɵadvance(3);
29732
29734
  i0.ɵɵtextInterpolate(ctx_r0.caseHistory.event.event_name);
29733
29735
  i0.ɵɵadvance(3);
29734
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(42, 33, "Summary"));
29736
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(42, 34, "Summary"));
29735
29737
  i0.ɵɵadvance(3);
29736
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(45, 35, ctx_r0.caseHistory.event.summary));
29738
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(45, 36, ctx_r0.caseHistory.event.summary));
29737
29739
  i0.ɵɵadvance(4);
29738
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(49, 37, "Comment"));
29740
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(49, 38, "Comment"));
29739
29741
  i0.ɵɵadvance(3);
29740
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(52, 39, ctx_r0.caseHistory.event.comment));
29742
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(52, 40, ctx_r0.caseHistory.event.comment));
29741
29743
  i0.ɵɵadvance(4);
29742
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(56, 41, "Case Details"));
29744
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(56, 42, "Case Details"));
29743
29745
  i0.ɵɵadvance(2);
29744
29746
  i0.ɵɵproperty("ngForOf", ctx_r0.tabs);
29745
29747
  } }
@@ -29793,13 +29795,13 @@ CaseHistoryComponent.PARAM_EVENT_ID = 'eid';
29793
29795
  CaseHistoryComponent.ERROR_MESSAGE = 'No case history to show';
29794
29796
  CaseHistoryComponent.ɵfac = function CaseHistoryComponent_Factory(t) { return new (t || CaseHistoryComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(AlertService), i0.ɵɵdirectiveInject(OrderService), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(CaseHistoryService)); };
29795
29797
  CaseHistoryComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseHistoryComponent, selectors: [["ccd-case-history"]], inputs: { event: "event" }, decls: 1, vars: 1, consts: [[4, "ngIf"], [1, "grid-row"], [1, "column-full"], [3, "caseDetails"], [1, "heading-h2"], ["aria-describedby", "event details table", 1, "EventDetails"], [4, "ngFor", "ngForOf"], [1, "caseHistorySection"], [1, "heading-h3"], [1, "CaseHistory", 3, "id"], ["ccdLabelSubstitutor", "", 3, "caseField", "contextFields", "hidden"], [3, "ngSwitch"], [4, "ngSwitchCase"], ["class", "compound-field", 4, "ngSwitchCase"], ["id", "case-viewer-label-header"], [1, "case-viewer-label"], [3, "caseField", "caseReference"], [1, "compound-field"], ["colspan", "2"]], template: function CaseHistoryComponent_Template(rf, ctx) { if (rf & 1) {
29796
- i0.ɵɵtemplate(0, CaseHistoryComponent_div_0_Template, 58, 43, "div", 0);
29798
+ i0.ɵɵtemplate(0, CaseHistoryComponent_div_0_Template, 58, 44, "div", 0);
29797
29799
  } if (rf & 2) {
29798
29800
  i0.ɵɵproperty("ngIf", ctx.isDataLoaded());
29799
29801
  } }, styles: [".CaseHistory[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .CaseHistory[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:none}.caseHistorySection[_ngcontent-%COMP%]{margin-top:40px}.EventDetails[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .EventDetails[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:none}th[_ngcontent-%COMP%]{width:1%;white-space:nowrap;vertical-align:top}.compound-field[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:0}.case-viewer-controls[_ngcontent-%COMP%]{margin-top:47px;margin-bottom:20px}ccd-case-header[_ngcontent-%COMP%]{float:left;margin-right:10px}ccd-event-trigger[_ngcontent-%COMP%]{float:right}.case-viewer-label[_ngcontent-%COMP%]{min-width:300px;white-space:normal}"] });
29800
29802
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseHistoryComponent, [{
29801
29803
  type: Component,
29802
- args: [{ selector: 'ccd-case-history', template: "<div *ngIf=\"isDataLoaded()\">\n <div class=\"grid-row\">\n <div class=\"column-full\">\n <ccd-case-header [caseDetails]=\"caseDetails\"></ccd-case-header>\n </div>\n </div>\n <div class=\"grid-row\">\n <div class=\"column-full\">\n <div>\n <h2 class=\"heading-h2\">{{'Event Details' | rpxTranslate}}</h2>\n <table class=\"EventDetails\" aria-describedby=\"event details table\">\n <tbody>\n <tr>\n <th>{{'Date' | rpxTranslate}}</th>\n <td>{{caseHistory.event.timestamp | ccdDate}}</td>\n </tr>\n <tr>\n <th>{{'Author' | rpxTranslate}}</th>\n <td>{{caseHistory.event.user_first_name | titlecase}} {{caseHistory.event.user_last_name | uppercase}}</td>\n </tr>\n <tr>\n <th>{{'End state' | rpxTranslate}}</th>\n <td>{{caseHistory.event.state_name}}</td>\n </tr>\n <tr>\n <th>{{'Event' | rpxTranslate}}</th>\n <td>{{caseHistory.event.event_name}}</td>\n </tr>\n <tr>\n <th>{{'Summary' | rpxTranslate}}</th>\n <td>{{caseHistory.event.summary | ccdDash}}</td>\n </tr>\n <tr>\n <th>{{'Comment' | rpxTranslate}}</th>\n <td>{{caseHistory.event.comment | ccdDash}}</td>\n </tr>\n </tbody>\n </table>\n </div>\n <div>\n <h2 class=\"heading-h2\">{{'Case Details' | rpxTranslate}}</h2>\n <ng-container *ngFor=\"let tab of tabs\">\n <div class=\"caseHistorySection\">\n <h3 class=\"heading-h3\">{{tab.label}}</h3>\n <table class=\"CaseHistory\" id=\"{{tab.id}}\" [attr.aria-describedby]=\"'case history table' | rpxTranslate\">\n <ng-container *ngFor=\"let field of tab | ccdTabFields | ccdReadFieldsFilter:false :undefined :true\">\n <div ccdLabelSubstitutor [caseField]=\"field\" [contextFields]=\"tab.fields\" [hidden]=\"field.hidden\">\n <ng-container [ngSwitch]=\"!(field | ccdIsCompound)\">\n <tr *ngSwitchCase=\"true\">\n <th id=\"case-viewer-label-header\">\n <div class=\"case-viewer-label\">{{field.label}}</div>\n </th>\n <td>\n <ccd-field-read [caseField]=\"field\" [caseReference]=\"caseHistory.case_id\"></ccd-field-read>\n </td>\n </tr>\n <tr *ngSwitchCase=\"false\" class=\"compound-field\">\n <td colspan=\"2\">\n <ccd-field-read [caseField]=\"field\" [caseReference]=\"caseHistory.case_id\"></ccd-field-read>\n </td>\n </tr>\n </ng-container>\n </div>\n </ng-container>\n </table>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n</div>\n", styles: [".CaseHistory th,.CaseHistory td{border-bottom:none}.caseHistorySection{margin-top:40px}.EventDetails th,.EventDetails td{border-bottom:none}th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}.case-viewer-controls{margin-top:47px;margin-bottom:20px}ccd-case-header{float:left;margin-right:10px}ccd-event-trigger{float:right}.case-viewer-label{min-width:300px;white-space:normal}\n"] }]
29804
+ args: [{ selector: 'ccd-case-history', template: "<div *ngIf=\"isDataLoaded()\">\n <div class=\"grid-row\">\n <div class=\"column-full\">\n <ccd-case-header [caseDetails]=\"caseDetails\"></ccd-case-header>\n </div>\n </div>\n <div class=\"grid-row\">\n <div class=\"column-full\">\n <div>\n <h2 class=\"heading-h2\">{{'Event Details' | rpxTranslate}}</h2>\n <table class=\"EventDetails\" aria-describedby=\"event details table\">\n <tbody>\n <tr>\n <th>{{'Date' | rpxTranslate}}</th>\n <td>{{caseHistory.event.timestamp | ccdDate : 'local'}}</td>\n </tr>\n <tr>\n <th>{{'Author' | rpxTranslate}}</th>\n <td>{{caseHistory.event.user_first_name | titlecase}} {{caseHistory.event.user_last_name | uppercase}}</td>\n </tr>\n <tr>\n <th>{{'End state' | rpxTranslate}}</th>\n <td>{{caseHistory.event.state_name}}</td>\n </tr>\n <tr>\n <th>{{'Event' | rpxTranslate}}</th>\n <td>{{caseHistory.event.event_name}}</td>\n </tr>\n <tr>\n <th>{{'Summary' | rpxTranslate}}</th>\n <td>{{caseHistory.event.summary | ccdDash}}</td>\n </tr>\n <tr>\n <th>{{'Comment' | rpxTranslate}}</th>\n <td>{{caseHistory.event.comment | ccdDash}}</td>\n </tr>\n </tbody>\n </table>\n </div>\n <div>\n <h2 class=\"heading-h2\">{{'Case Details' | rpxTranslate}}</h2>\n <ng-container *ngFor=\"let tab of tabs\">\n <div class=\"caseHistorySection\">\n <h3 class=\"heading-h3\">{{tab.label}}</h3>\n <table class=\"CaseHistory\" id=\"{{tab.id}}\" [attr.aria-describedby]=\"'case history table' | rpxTranslate\">\n <ng-container *ngFor=\"let field of tab | ccdTabFields | ccdReadFieldsFilter:false :undefined :true\">\n <div ccdLabelSubstitutor [caseField]=\"field\" [contextFields]=\"tab.fields\" [hidden]=\"field.hidden\">\n <ng-container [ngSwitch]=\"!(field | ccdIsCompound)\">\n <tr *ngSwitchCase=\"true\">\n <th id=\"case-viewer-label-header\">\n <div class=\"case-viewer-label\">{{field.label}}</div>\n </th>\n <td>\n <ccd-field-read [caseField]=\"field\" [caseReference]=\"caseHistory.case_id\"></ccd-field-read>\n </td>\n </tr>\n <tr *ngSwitchCase=\"false\" class=\"compound-field\">\n <td colspan=\"2\">\n <ccd-field-read [caseField]=\"field\" [caseReference]=\"caseHistory.case_id\"></ccd-field-read>\n </td>\n </tr>\n </ng-container>\n </div>\n </ng-container>\n </table>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n</div>\n", styles: [".CaseHistory th,.CaseHistory td{border-bottom:none}.caseHistorySection{margin-top:40px}.EventDetails th,.EventDetails td{border-bottom:none}th{width:1%;white-space:nowrap;vertical-align:top}.compound-field td{padding:0}.case-viewer-controls{margin-top:47px;margin-bottom:20px}ccd-case-header{float:left;margin-right:10px}ccd-event-trigger{float:right}.case-viewer-label{min-width:300px;white-space:normal}\n"] }]
29803
29805
  }], function () { return [{ type: i1$1.ActivatedRoute }, { type: AlertService }, { type: OrderService }, { type: CaseNotifier }, { type: CaseHistoryService }]; }, { event: [{
29804
29806
  type: Input
29805
29807
  }] }); })();