@hmcts/ccd-case-ui-toolkit 7.0.21-markdown-pre-release-01 → 7.0.21-markdown-pre-release-02

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.
@@ -13085,17 +13085,19 @@ class ReadComplexFieldComponent extends AbstractFieldReadComponent {
13085
13085
  this.context = PaletteContext.DEFAULT;
13086
13086
  }
13087
13087
  }
13088
- this.caseField?.field_type?.complex_fields?.forEach((field) => {
13089
- if (field?.isDynamic()) {
13090
- field.list_items = this.caseField.value[field.id]?.list_items;
13091
- field.value = {
13092
- list_items: field.list_items,
13093
- value: this.caseField.value[field.id]?.value && this.caseField.value[field.id].value.code ?
13094
- this.caseField.value[field.id].value.code :
13095
- this.caseField.value[field.id]?.value
13096
- };
13097
- }
13098
- });
13088
+ if (this.caseField?.field_type && this.caseField.field_type.complex_fields) {
13089
+ this.caseField?.field_type?.complex_fields?.forEach((field) => {
13090
+ if (field?.isDynamic()) {
13091
+ field.list_items = this.caseField.value[field.id]?.list_items;
13092
+ field.value = {
13093
+ list_items: field.list_items,
13094
+ value: this.caseField.value[field.id]?.value && this.caseField.value[field.id].value.code ?
13095
+ this.caseField.value[field.id].value.code :
13096
+ this.caseField.value[field.id]?.value
13097
+ };
13098
+ }
13099
+ });
13100
+ }
13099
13101
  }
13100
13102
  }
13101
13103
  ReadComplexFieldComponent.ɵfac = /*@__PURE__*/ function () { let ɵReadComplexFieldComponent_BaseFactory; return function ReadComplexFieldComponent_Factory(t) { return (ɵReadComplexFieldComponent_BaseFactory || (ɵReadComplexFieldComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ReadComplexFieldComponent)))(t || ReadComplexFieldComponent); }; }();
@@ -13676,7 +13678,7 @@ WriteDocumentFieldComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type:
13676
13678
 
13677
13679
  class DynamicListPipe {
13678
13680
  transform(value, items) {
13679
- const item = items.find(i => i.code === value);
13681
+ const item = items?.find(i => i.code === value);
13680
13682
  return item ? item.label : DynamicListPipe.EMPTY;
13681
13683
  }
13682
13684
  }
@@ -29807,29 +29809,29 @@ function CaseHistoryComponent_div_0_Template(rf, ctx) { if (rf & 1) {
29807
29809
  i0.ɵɵadvance(6);
29808
29810
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(15, 19, "Date"));
29809
29811
  i0.ɵɵadvance(3);
29810
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(18, 21, ctx_r0.caseHistory.event.timestamp));
29812
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(18, 21, ctx_r0.caseHistory.event.timestamp, "local"));
29811
29813
  i0.ɵɵadvance(4);
29812
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(22, 23, "Author"));
29814
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(22, 24, "Author"));
29813
29815
  i0.ɵɵadvance(3);
29814
- i0.ɵɵtextInterpolate2("", i0.ɵɵpipeBind1(25, 25, ctx_r0.caseHistory.event.user_first_name), " ", i0.ɵɵpipeBind1(26, 27, ctx_r0.caseHistory.event.user_last_name), "");
29816
+ i0.ɵɵtextInterpolate2("", i0.ɵɵpipeBind1(25, 26, ctx_r0.caseHistory.event.user_first_name), " ", i0.ɵɵpipeBind1(26, 28, ctx_r0.caseHistory.event.user_last_name), "");
29815
29817
  i0.ɵɵadvance(5);
29816
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(30, 29, "End state"));
29818
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(30, 30, "End state"));
29817
29819
  i0.ɵɵadvance(3);
29818
29820
  i0.ɵɵtextInterpolate(ctx_r0.caseHistory.event.state_name);
29819
29821
  i0.ɵɵadvance(3);
29820
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(36, 31, "Event"));
29822
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(36, 32, "Event"));
29821
29823
  i0.ɵɵadvance(3);
29822
29824
  i0.ɵɵtextInterpolate(ctx_r0.caseHistory.event.event_name);
29823
29825
  i0.ɵɵadvance(3);
29824
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(42, 33, "Summary"));
29826
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(42, 34, "Summary"));
29825
29827
  i0.ɵɵadvance(3);
29826
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(45, 35, ctx_r0.caseHistory.event.summary));
29828
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(45, 36, ctx_r0.caseHistory.event.summary));
29827
29829
  i0.ɵɵadvance(4);
29828
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(49, 37, "Comment"));
29830
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(49, 38, "Comment"));
29829
29831
  i0.ɵɵadvance(3);
29830
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(52, 39, ctx_r0.caseHistory.event.comment));
29832
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(52, 40, ctx_r0.caseHistory.event.comment));
29831
29833
  i0.ɵɵadvance(4);
29832
- i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(56, 41, "Case Details"));
29834
+ i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(56, 42, "Case Details"));
29833
29835
  i0.ɵɵadvance(2);
29834
29836
  i0.ɵɵproperty("ngForOf", ctx_r0.tabs);
29835
29837
  } }
@@ -29883,13 +29885,13 @@ CaseHistoryComponent.PARAM_EVENT_ID = 'eid';
29883
29885
  CaseHistoryComponent.ERROR_MESSAGE = 'No case history to show';
29884
29886
  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)); };
29885
29887
  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) {
29886
- i0.ɵɵtemplate(0, CaseHistoryComponent_div_0_Template, 58, 43, "div", 0);
29888
+ i0.ɵɵtemplate(0, CaseHistoryComponent_div_0_Template, 58, 44, "div", 0);
29887
29889
  } if (rf & 2) {
29888
29890
  i0.ɵɵproperty("ngIf", ctx.isDataLoaded());
29889
29891
  } }, 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}"] });
29890
29892
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseHistoryComponent, [{
29891
29893
  type: Component,
29892
- 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"] }]
29894
+ 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"] }]
29893
29895
  }], function () { return [{ type: i1$1.ActivatedRoute }, { type: AlertService }, { type: OrderService }, { type: CaseNotifier }, { type: CaseHistoryService }]; }, { event: [{
29894
29896
  type: Input
29895
29897
  }] }); })();