@hmcts/ccd-case-ui-toolkit 6.16.0-query-management-orchestrator-v3 → 6.16.0-query-management-query-list

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.
Files changed (37) hide show
  1. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js +198 -8
  2. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js.map +1 -1
  3. package/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js +1 -1
  4. package/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js.map +1 -1
  5. package/esm2015/lib/shared/components/palette/palette.module.js +2 -1
  6. package/esm2015/lib/shared/components/palette/query-management/__mocks__/index.js +1 -1
  7. package/esm2015/lib/shared/components/palette/query-management/components/query-list/query-list.component.js +90 -6
  8. package/esm2015/lib/shared/components/palette/query-management/domain/index.js +6 -2
  9. package/esm2015/lib/shared/components/palette/query-management/domain/party-messages/party-message.model.js +2 -0
  10. package/esm2015/lib/shared/components/palette/query-management/domain/party-messages/party-messages-group.model.js +2 -0
  11. package/esm2015/lib/shared/components/palette/query-management/domain/query-list/query-list-data/query-list-data.model.js +16 -0
  12. package/esm2015/lib/shared/components/palette/query-management/domain/query-list/query-list-item/query-list-item.model.js +32 -0
  13. package/esm2015/lib/shared/components/palette/query-management/domain/query-list/query-list-response-status.enum.js +6 -0
  14. package/esm2015/lib/shared/components/palette/query-management/read-query-management-field.component.js +18 -8
  15. package/fesm2015/hmcts-ccd-case-ui-toolkit.js +157 -11
  16. package/fesm2015/hmcts-ccd-case-ui-toolkit.js.map +1 -1
  17. package/lib/shared/components/palette/query-management/__mocks__/index.d.ts +2 -2
  18. package/lib/shared/components/palette/query-management/__mocks__/index.d.ts.map +1 -1
  19. package/lib/shared/components/palette/query-management/components/query-list/query-list.component.d.ts +7 -7
  20. package/lib/shared/components/palette/query-management/components/query-list/query-list.component.d.ts.map +1 -1
  21. package/lib/shared/components/palette/query-management/domain/index.d.ts +5 -1
  22. package/lib/shared/components/palette/query-management/domain/index.d.ts.map +1 -1
  23. package/lib/shared/components/palette/query-management/domain/{query-management.model.d.ts → party-messages/party-message.model.d.ts} +2 -7
  24. package/lib/shared/components/palette/query-management/domain/party-messages/party-message.model.d.ts.map +1 -0
  25. package/lib/shared/components/palette/query-management/domain/party-messages/party-messages-group.model.d.ts +7 -0
  26. package/lib/shared/components/palette/query-management/domain/party-messages/party-messages-group.model.d.ts.map +1 -0
  27. package/lib/shared/components/palette/query-management/domain/query-list/query-list-data/query-list-data.model.d.ts +9 -0
  28. package/lib/shared/components/palette/query-management/domain/query-list/query-list-data/query-list-data.model.d.ts.map +1 -0
  29. package/lib/shared/components/palette/query-management/domain/query-list/query-list-item/query-list-item.model.d.ts +23 -0
  30. package/lib/shared/components/palette/query-management/domain/query-list/query-list-item/query-list-item.model.d.ts.map +1 -0
  31. package/lib/shared/components/palette/query-management/domain/query-list/query-list-response-status.enum.d.ts +5 -0
  32. package/lib/shared/components/palette/query-management/domain/query-list/query-list-response-status.enum.d.ts.map +1 -0
  33. package/lib/shared/components/palette/query-management/read-query-management-field.component.d.ts +2 -2
  34. package/lib/shared/components/palette/query-management/read-query-management-field.component.d.ts.map +1 -1
  35. package/package.json +1 -1
  36. package/esm2015/lib/shared/components/palette/query-management/domain/query-management.model.js +0 -2
  37. package/lib/shared/components/palette/query-management/domain/query-management.model.d.ts.map +0 -1
@@ -19618,23 +19618,196 @@
19618
19618
  }], function () { return []; }, null);
19619
19619
  })();
19620
19620
 
19621
+ exports.QueryListResponseStatus = void 0;
19622
+ (function (QueryListResponseStatus) {
19623
+ QueryListResponseStatus["NEW"] = "New";
19624
+ QueryListResponseStatus["RESPONDED"] = "Responded";
19625
+ })(exports.QueryListResponseStatus || (exports.QueryListResponseStatus = {}));
19626
+
19627
+ var QueryListItem = /** @class */ (function () {
19628
+ function QueryListItem() {
19629
+ }
19630
+ Object.defineProperty(QueryListItem.prototype, "lastSubmittedMessage", {
19631
+ get: function () {
19632
+ if (this.children && this.children.length > 0) {
19633
+ return this.children.reduce(function (prev, current) {
19634
+ return (prev.createdOn > current.createdOn) ? prev : current;
19635
+ });
19636
+ }
19637
+ else {
19638
+ return this;
19639
+ }
19640
+ },
19641
+ enumerable: false,
19642
+ configurable: true
19643
+ });
19644
+ Object.defineProperty(QueryListItem.prototype, "lastSubmittedBy", {
19645
+ get: function () {
19646
+ return this.lastSubmittedMessage.name;
19647
+ },
19648
+ enumerable: false,
19649
+ configurable: true
19650
+ });
19651
+ Object.defineProperty(QueryListItem.prototype, "lastSubmittedDate", {
19652
+ get: function () {
19653
+ return new Date(this.lastSubmittedMessage.createdOn);
19654
+ },
19655
+ enumerable: false,
19656
+ configurable: true
19657
+ });
19658
+ Object.defineProperty(QueryListItem.prototype, "lastResponseBy", {
19659
+ get: function () {
19660
+ var _a;
19661
+ return ((_a = this.children) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.lastSubmittedMessage.name : '';
19662
+ },
19663
+ enumerable: false,
19664
+ configurable: true
19665
+ });
19666
+ Object.defineProperty(QueryListItem.prototype, "lastResponseDate", {
19667
+ get: function () {
19668
+ var _a;
19669
+ return ((_a = this.children) === null || _a === void 0 ? void 0 : _a.length) > 0 ? new Date(this.lastSubmittedMessage.createdOn) : null;
19670
+ },
19671
+ enumerable: false,
19672
+ configurable: true
19673
+ });
19674
+ Object.defineProperty(QueryListItem.prototype, "responseStatus", {
19675
+ get: function () {
19676
+ var _a;
19677
+ return ((_a = this.children) === null || _a === void 0 ? void 0 : _a.length) > 0 ? exports.QueryListResponseStatus.RESPONDED : exports.QueryListResponseStatus.NEW;
19678
+ },
19679
+ enumerable: false,
19680
+ configurable: true
19681
+ });
19682
+ return QueryListItem;
19683
+ }());
19684
+
19685
+ var QueryListData = /** @class */ (function () {
19686
+ function QueryListData(partyMessagesGroup) {
19687
+ this.partyName = partyMessagesGroup.partyName;
19688
+ this.roleOnCase = partyMessagesGroup.roleOnCase;
19689
+ // get the parent messages (messages without parentId) and add the children to them
19690
+ var parentMessages = partyMessagesGroup.partyMessages.filter(function (message) { return !message.parentId; });
19691
+ this.partyMessages = parentMessages.map(function (message) {
19692
+ var parentMessage = new QueryListItem();
19693
+ Object.assign(parentMessage, Object.assign(Object.assign({}, message), { children: partyMessagesGroup.partyMessages
19694
+ .filter(function (childMessage) { return childMessage.parentId === message.id; }) }));
19695
+ return parentMessage;
19696
+ });
19697
+ }
19698
+ return QueryListData;
19699
+ }());
19700
+
19701
+ function QueryListComponent_ng_container_0_tr_18_Template(rf, ctx) {
19702
+ if (rf & 1) {
19703
+ i0__namespace.ɵɵelementStart(0, "tr", 4);
19704
+ i0__namespace.ɵɵelementStart(1, "td", 8);
19705
+ i0__namespace.ɵɵelementStart(2, "a", 9);
19706
+ i0__namespace.ɵɵtext(3);
19707
+ i0__namespace.ɵɵelementEnd();
19708
+ i0__namespace.ɵɵelementEnd();
19709
+ i0__namespace.ɵɵelementStart(4, "td", 10);
19710
+ i0__namespace.ɵɵtext(5);
19711
+ i0__namespace.ɵɵelementEnd();
19712
+ i0__namespace.ɵɵelementStart(6, "td", 10);
19713
+ i0__namespace.ɵɵtext(7);
19714
+ i0__namespace.ɵɵpipe(8, "date");
19715
+ i0__namespace.ɵɵelementEnd();
19716
+ i0__namespace.ɵɵelementStart(9, "td", 10);
19717
+ i0__namespace.ɵɵtext(10);
19718
+ i0__namespace.ɵɵpipe(11, "date");
19719
+ i0__namespace.ɵɵelementEnd();
19720
+ i0__namespace.ɵɵelementStart(12, "td", 10);
19721
+ i0__namespace.ɵɵtext(13);
19722
+ i0__namespace.ɵɵelementEnd();
19723
+ i0__namespace.ɵɵelementEnd();
19724
+ }
19725
+ if (rf & 2) {
19726
+ var message_r2 = ctx.$implicit;
19727
+ i0__namespace.ɵɵadvance(3);
19728
+ i0__namespace.ɵɵtextInterpolate(message_r2.subject);
19729
+ i0__namespace.ɵɵadvance(2);
19730
+ i0__namespace.ɵɵtextInterpolate(message_r2.lastSubmittedBy);
19731
+ i0__namespace.ɵɵadvance(2);
19732
+ i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind2(8, 5, message_r2.lastSubmittedDate, "dd MMM YYYY"));
19733
+ i0__namespace.ɵɵadvance(3);
19734
+ i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind2(11, 8, message_r2.lastResponseDate, "dd MMM YYYY"));
19735
+ i0__namespace.ɵɵadvance(3);
19736
+ i0__namespace.ɵɵtextInterpolate(message_r2.responseStatus);
19737
+ }
19738
+ }
19739
+ function QueryListComponent_ng_container_0_Template(rf, ctx) {
19740
+ if (rf & 1) {
19741
+ i0__namespace.ɵɵelementContainerStart(0);
19742
+ i0__namespace.ɵɵelementStart(1, "table", 1);
19743
+ i0__namespace.ɵɵelementStart(2, "caption", 2);
19744
+ i0__namespace.ɵɵelementStart(3, "div");
19745
+ i0__namespace.ɵɵtext(4);
19746
+ i0__namespace.ɵɵelementEnd();
19747
+ i0__namespace.ɵɵelementEnd();
19748
+ i0__namespace.ɵɵelementStart(5, "thead", 3);
19749
+ i0__namespace.ɵɵelementStart(6, "tr", 4);
19750
+ i0__namespace.ɵɵelementStart(7, "th", 5);
19751
+ i0__namespace.ɵɵtext(8, "Queries");
19752
+ i0__namespace.ɵɵelementEnd();
19753
+ i0__namespace.ɵɵelementStart(9, "th", 5);
19754
+ i0__namespace.ɵɵtext(10, "Last submitted by");
19755
+ i0__namespace.ɵɵelementEnd();
19756
+ i0__namespace.ɵɵelementStart(11, "th", 5);
19757
+ i0__namespace.ɵɵtext(12, "Last submission date");
19758
+ i0__namespace.ɵɵelementEnd();
19759
+ i0__namespace.ɵɵelementStart(13, "th", 5);
19760
+ i0__namespace.ɵɵtext(14, "Last response date");
19761
+ i0__namespace.ɵɵelementEnd();
19762
+ i0__namespace.ɵɵelementStart(15, "th", 5);
19763
+ i0__namespace.ɵɵtext(16, "Response status");
19764
+ i0__namespace.ɵɵelementEnd();
19765
+ i0__namespace.ɵɵelementEnd();
19766
+ i0__namespace.ɵɵelementEnd();
19767
+ i0__namespace.ɵɵelementStart(17, "tbody", 6);
19768
+ i0__namespace.ɵɵtemplate(18, QueryListComponent_ng_container_0_tr_18_Template, 14, 11, "tr", 7);
19769
+ i0__namespace.ɵɵelementEnd();
19770
+ i0__namespace.ɵɵelementEnd();
19771
+ i0__namespace.ɵɵelementContainerEnd();
19772
+ }
19773
+ if (rf & 2) {
19774
+ var ctx_r0 = i0__namespace.ɵɵnextContext();
19775
+ i0__namespace.ɵɵadvance(4);
19776
+ i0__namespace.ɵɵtextInterpolate(ctx_r0.queryListData.partyName);
19777
+ i0__namespace.ɵɵadvance(14);
19778
+ i0__namespace.ɵɵproperty("ngForOf", ctx_r0.queryListData.partyMessages);
19779
+ }
19780
+ }
19621
19781
  var QueryListComponent = /** @class */ (function () {
19622
19782
  function QueryListComponent() {
19623
19783
  }
19624
- QueryListComponent.prototype.ngOnInit = function () {
19784
+ QueryListComponent.prototype.ngOnChanges = function (simpleChanges) {
19785
+ var _a;
19786
+ var currentPartyMessageGroup = (_a = simpleChanges.partyMessageGroup) === null || _a === void 0 ? void 0 : _a.currentValue;
19787
+ if (currentPartyMessageGroup) {
19788
+ this.queryListData = new QueryListData(currentPartyMessageGroup);
19789
+ }
19625
19790
  };
19626
19791
  return QueryListComponent;
19627
19792
  }());
19628
19793
  QueryListComponent.ɵfac = function QueryListComponent_Factory(t) { return new (t || QueryListComponent)(); };
19629
- QueryListComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: QueryListComponent, selectors: [["ccd-query-list"]], inputs: { partyMessages: "partyMessages" }, decls: 0, vars: 0, template: function QueryListComponent_Template(rf, ctx) { }, encapsulation: 2 });
19794
+ QueryListComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: QueryListComponent, selectors: [["ccd-query-list"]], inputs: { partyMessageGroup: "partyMessageGroup" }, features: [i0__namespace.ɵɵNgOnChangesFeature], decls: 1, vars: 1, consts: [[4, "ngIf"], [1, "govuk-table", "query-list__table"], [1, "govuk-table__cell", "query-list__caption", "query-list__row"], [1, "govuk-table__head"], [1, "govuk-table__row", "query-list__row"], ["scope", "col", 1, "govuk-table__header"], [1, "govuk-table__body"], ["class", "govuk-table__row query-list__row", 4, "ngFor", "ngForOf"], [1, "govuk-table__cell", "query-list__cell", "query-list__cell--first"], ["href", "javascript:void(0)"], [1, "govuk-table__cell", "query-list__cell"]], template: function QueryListComponent_Template(rf, ctx) {
19795
+ if (rf & 1) {
19796
+ i0__namespace.ɵɵtemplate(0, QueryListComponent_ng_container_0_Template, 19, 2, "ng-container", 0);
19797
+ }
19798
+ if (rf & 2) {
19799
+ i0__namespace.ɵɵproperty("ngIf", ctx.queryListData);
19800
+ }
19801
+ }, directives: [i1__namespace.NgIf, i1__namespace.NgForOf], pipes: [i1__namespace.DatePipe], styles: [".query-list__caption[_ngcontent-%COMP%], .query-list__table[_ngcontent-%COMP%]{border:1px solid #b1b4b6}.query-list__caption[_ngcontent-%COMP%]{background:#f3f2f1;border-bottom:0;font-weight:700}.query-list__row[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:first-child{padding-left:10px}.query-list__row[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:last-child{padding-right:10px}.query-list__cell--first[_ngcontent-%COMP%]{width:33%}"] });
19630
19802
  (function () {
19631
19803
  (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(QueryListComponent, [{
19632
19804
  type: i0.Component,
19633
19805
  args: [{
19634
19806
  selector: 'ccd-query-list',
19635
19807
  templateUrl: './query-list.component.html',
19808
+ styleUrls: ['./query-list.component.scss']
19636
19809
  }]
19637
- }], function () { return []; }, { partyMessages: [{
19810
+ }], null, { partyMessageGroup: [{
19638
19811
  type: i0.Input
19639
19812
  }] });
19640
19813
  })();
@@ -19654,6 +19827,20 @@
19654
19827
  }], null, null);
19655
19828
  })();
19656
19829
 
19830
+ function ReadQueryManagementFieldComponent_ng_container_0_Template(rf, ctx) {
19831
+ if (rf & 1) {
19832
+ i0__namespace.ɵɵelementContainerStart(0);
19833
+ i0__namespace.ɵɵelementStart(1, "div", 1);
19834
+ i0__namespace.ɵɵelement(2, "ccd-query-list", 2);
19835
+ i0__namespace.ɵɵelementEnd();
19836
+ i0__namespace.ɵɵelementContainerEnd();
19837
+ }
19838
+ if (rf & 2) {
19839
+ var singlePartyMessageGroup_r1 = ctx.$implicit;
19840
+ i0__namespace.ɵɵadvance(2);
19841
+ i0__namespace.ɵɵproperty("partyMessageGroup", singlePartyMessageGroup_r1);
19842
+ }
19843
+ }
19657
19844
  var ReadQueryManagementFieldComponent = /** @class */ (function (_super) {
19658
19845
  __extends(ReadQueryManagementFieldComponent, _super);
19659
19846
  function ReadQueryManagementFieldComponent(route) {
@@ -19664,7 +19851,7 @@
19664
19851
  ReadQueryManagementFieldComponent.prototype.ngOnInit = function () {
19665
19852
  if (this.context === exports.PaletteContext.DEFAULT) {
19666
19853
  // EUI-8303 Using mock data until CCD is ready with the API and data contract
19667
- this.partyMessages = partyMessagesMockData;
19854
+ this.partyMessagesGroups = partyMessagesMockData;
19668
19855
  // TODO: Actual implementation once the CCD API and data contract is available
19669
19856
  // Each parties will have a separate collection of party messages
19670
19857
  // Find whether queries tab is available in the case data
@@ -19678,14 +19865,14 @@
19678
19865
  return ReadQueryManagementFieldComponent;
19679
19866
  }(AbstractFieldReadComponent));
19680
19867
  ReadQueryManagementFieldComponent.ɵfac = function ReadQueryManagementFieldComponent_Factory(t) { return new (t || ReadQueryManagementFieldComponent)(i0__namespace.ɵɵdirectiveInject(i1__namespace$1.ActivatedRoute)); };
19681
- ReadQueryManagementFieldComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: ReadQueryManagementFieldComponent, selectors: [["ccd-read-query-management-field"]], features: [i0__namespace.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [[3, "partyMessages"]], template: function ReadQueryManagementFieldComponent_Template(rf, ctx) {
19868
+ ReadQueryManagementFieldComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: ReadQueryManagementFieldComponent, selectors: [["ccd-read-query-management-field"]], features: [i0__namespace.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [[4, "ngFor", "ngForOf"], [1, "govuk-!-margin-top-8", "govuk-!-margin-bottom-8"], [3, "partyMessageGroup"]], template: function ReadQueryManagementFieldComponent_Template(rf, ctx) {
19682
19869
  if (rf & 1) {
19683
- i0__namespace.ɵɵelement(0, "ccd-query-list", 0);
19870
+ i0__namespace.ɵɵtemplate(0, ReadQueryManagementFieldComponent_ng_container_0_Template, 3, 1, "ng-container", 0);
19684
19871
  }
19685
19872
  if (rf & 2) {
19686
- i0__namespace.ɵɵproperty("partyMessages", ctx.partyMessages);
19873
+ i0__namespace.ɵɵproperty("ngForOf", ctx.partyMessagesGroups);
19687
19874
  }
19688
- }, directives: [QueryListComponent], encapsulation: 2 });
19875
+ }, encapsulation: 2 });
19689
19876
  (function () {
19690
19877
  (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(ReadQueryManagementFieldComponent, [{
19691
19878
  type: i0.Component,
@@ -26287,6 +26474,7 @@
26287
26474
  // Components for linked cases
26288
26475
  LinkedCasesToTableComponent, i1__namespace.NgIf, LinkedCasesFromTableComponent
26289
26476
  ], []);
26477
+ i0__namespace.ɵɵsetComponentScope(ReadQueryManagementFieldComponent, [i1__namespace.NgForOf, QueryListComponent], []);
26290
26478
  i0__namespace.ɵɵsetComponentScope(WriteAddressFieldComponent, [i1__namespace.NgIf, i1__namespace.NgClass, i2__namespace.DefaultValueAccessor, i2__namespace.NgControlStatus, i2__namespace.FormControlDirective, i2__namespace.SelectControlValueAccessor, i1__namespace.NgForOf, i2__namespace.NgSelectOption, i2__namespace.ɵangular_packages_forms_forms_z, WriteComplexFieldComponent, i2__namespace.NgControlStatusGroup, i2__namespace.FormGroupDirective], [FieldLabelPipe]);
26291
26479
  i0__namespace.ɵɵsetComponentScope(WriteComplexFieldComponent, [i1__namespace.NgIf, i1__namespace.NgForOf, i1__namespace.NgSwitch, i1__namespace.NgSwitchCase, FieldReadComponent, LabelSubstitutorDirective, i2__namespace.NgControlStatusGroup, i2__namespace.FormGroupDirective, FieldWriteComponent], [FieldLabelPipe, IsReadOnlyPipe]);
26292
26480
  i0__namespace.ɵɵsetComponentScope(WriteDocumentFieldComponent, [i1__namespace.NgClass, i1__namespace.NgIf, ReadDocumentFieldComponent], [FieldLabelPipe]);
@@ -36244,6 +36432,8 @@
36244
36432
  exports.QueryCreateComponent = QueryCreateComponent;
36245
36433
  exports.QueryDetailComponent = QueryDetailComponent;
36246
36434
  exports.QueryListComponent = QueryListComponent;
36435
+ exports.QueryListData = QueryListData;
36436
+ exports.QueryListItem = QueryListItem;
36247
36437
  exports.ReadCaseFlagFieldComponent = ReadCaseFlagFieldComponent;
36248
36438
  exports.ReadCaseLinkFieldComponent = ReadCaseLinkFieldComponent;
36249
36439
  exports.ReadCollectionFieldComponent = ReadCollectionFieldComponent;