@hmcts/ccd-case-ui-toolkit 6.16.0-query-management-CYA-continue → 6.16.0-query-management-document-uploader-v4

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 (35) hide show
  1. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js +168 -369
  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 +8 -6
  6. package/esm2015/lib/shared/components/palette/query-management/__mocks__/index.js +1 -27
  7. package/esm2015/lib/shared/components/palette/query-management/components/index.js +2 -3
  8. package/esm2015/lib/shared/components/palette/query-management/components/query-write/query-write-add-documents/query-write-add-documents.component.js +9 -15
  9. package/esm2015/lib/shared/components/palette/query-management/components/query-write/query-write-raise-query/query-write-raise-query.component.js +2 -2
  10. package/esm2015/lib/shared/components/palette/query-management/index.js +2 -2
  11. package/esm2015/lib/shared/components/palette/query-management/utils/query-management.utils.js +1 -11
  12. package/esm2015/lib/shared/components/palette/query-management/write-query-management-field.component.js +3 -18
  13. package/fesm2015/hmcts-ccd-case-ui-toolkit.js +124 -314
  14. package/fesm2015/hmcts-ccd-case-ui-toolkit.js.map +1 -1
  15. package/lib/shared/components/palette/palette.module.d.ts +30 -31
  16. package/lib/shared/components/palette/palette.module.d.ts.map +1 -1
  17. package/lib/shared/components/palette/query-management/__mocks__/index.d.ts +0 -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/index.d.ts +1 -2
  20. package/lib/shared/components/palette/query-management/components/index.d.ts.map +1 -1
  21. package/lib/shared/components/palette/query-management/components/query-write/query-write-add-documents/query-write-add-documents.component.d.ts +4 -5
  22. package/lib/shared/components/palette/query-management/components/query-write/query-write-add-documents/query-write-add-documents.component.d.ts.map +1 -1
  23. package/lib/shared/components/palette/query-management/index.d.ts +1 -1
  24. package/lib/shared/components/palette/query-management/index.d.ts.map +1 -1
  25. package/lib/shared/components/palette/query-management/utils/query-management.utils.d.ts +0 -5
  26. package/lib/shared/components/palette/query-management/utils/query-management.utils.d.ts.map +1 -1
  27. package/lib/shared/components/palette/query-management/write-query-management-field.component.d.ts +1 -5
  28. package/lib/shared/components/palette/query-management/write-query-management-field.component.d.ts.map +1 -1
  29. package/package.json +1 -1
  30. package/esm2015/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.js +0 -137
  31. package/esm2015/lib/shared/components/palette/query-management/components/query-management-error-messages/query-management-error-message.model.js +0 -2
  32. package/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.d.ts +0 -16
  33. package/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.d.ts.map +0 -1
  34. package/lib/shared/components/palette/query-management/components/query-management-error-messages/query-management-error-message.model.d.ts +0 -5
  35. package/lib/shared/components/palette/query-management/components/query-management-error-messages/query-management-error-message.model.d.ts.map +0 -1
@@ -20252,31 +20252,99 @@
20252
20252
  ]
20253
20253
  }
20254
20254
  ];
20255
- var caseFieldMockData = Object.assign(new CaseField(), {
20256
- id: '',
20257
- label: '',
20258
- hint_text: '',
20259
- field_type: Object.assign(new FieldType(), {
20260
- id: 'QueryDocuments',
20261
- type: 'QueryDocuments',
20262
- min: null,
20263
- max: null,
20264
- regular_expression: null,
20265
- fixed_list_items: [],
20266
- complex_fields: [],
20267
- collection_field_type: Object.assign(new FieldType(), {
20268
- id: 'Document',
20269
- type: 'Document',
20270
- min: null,
20271
- max: null,
20272
- regular_expression: null,
20273
- fixed_list_items: [],
20274
- complex_fields: [],
20275
- collection_field_type: null
20276
- })
20277
- }),
20278
- display_context_parameter: '#COLLECTION(allowInsert,allowUpdate)'
20279
- });
20255
+
20256
+ var QueryListItem = /** @class */ (function () {
20257
+ function QueryListItem() {
20258
+ this.children = [];
20259
+ }
20260
+ Object.defineProperty(QueryListItem.prototype, "lastSubmittedMessage", {
20261
+ get: function () {
20262
+ var getLastSubmittedMessage = function (item) {
20263
+ var e_1, _b;
20264
+ var lastSubmittedMessage = item;
20265
+ if (item.children && item.children.length > 0) {
20266
+ try {
20267
+ for (var _c = __values(item.children), _d = _c.next(); !_d.done; _d = _c.next()) {
20268
+ var child = _d.value;
20269
+ var childLastSubmittedMessage = getLastSubmittedMessage(child);
20270
+ if (childLastSubmittedMessage.createdOn > lastSubmittedMessage.createdOn) {
20271
+ lastSubmittedMessage = childLastSubmittedMessage;
20272
+ }
20273
+ }
20274
+ }
20275
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
20276
+ finally {
20277
+ try {
20278
+ if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
20279
+ }
20280
+ finally { if (e_1) throw e_1.error; }
20281
+ }
20282
+ }
20283
+ return lastSubmittedMessage;
20284
+ };
20285
+ return getLastSubmittedMessage(this);
20286
+ },
20287
+ enumerable: false,
20288
+ configurable: true
20289
+ });
20290
+ Object.defineProperty(QueryListItem.prototype, "lastSubmittedBy", {
20291
+ get: function () {
20292
+ return this.lastSubmittedMessage.name;
20293
+ },
20294
+ enumerable: false,
20295
+ configurable: true
20296
+ });
20297
+ Object.defineProperty(QueryListItem.prototype, "lastSubmittedDate", {
20298
+ get: function () {
20299
+ return new Date(this.lastSubmittedMessage.createdOn);
20300
+ },
20301
+ enumerable: false,
20302
+ configurable: true
20303
+ });
20304
+ Object.defineProperty(QueryListItem.prototype, "lastResponseBy", {
20305
+ get: function () {
20306
+ var _a;
20307
+ return ((_a = this.children) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.lastSubmittedMessage.name : '';
20308
+ },
20309
+ enumerable: false,
20310
+ configurable: true
20311
+ });
20312
+ Object.defineProperty(QueryListItem.prototype, "lastResponseDate", {
20313
+ get: function () {
20314
+ var _a;
20315
+ return ((_a = this.children) === null || _a === void 0 ? void 0 : _a.length) > 0 ? new Date(this.lastSubmittedMessage.createdOn) : null;
20316
+ },
20317
+ enumerable: false,
20318
+ configurable: true
20319
+ });
20320
+ return QueryListItem;
20321
+ }());
20322
+
20323
+ var QueryListData = /** @class */ (function () {
20324
+ function QueryListData(partyMessagesGroup) {
20325
+ var _this = this;
20326
+ this.partyName = partyMessagesGroup.partyName;
20327
+ this.roleOnCase = partyMessagesGroup.roleOnCase;
20328
+ // get the parent messages (messages without parentId) and add the children to them
20329
+ var parentMessages = partyMessagesGroup.partyMessages.filter(function (message) { return !message.parentId; });
20330
+ this.partyMessages = parentMessages.map(function (message) { return _this.buildQueryListItem(message, partyMessagesGroup.partyMessages); });
20331
+ }
20332
+ QueryListData.prototype.buildQueryListItem = function (message, allMessages) {
20333
+ var _this = this;
20334
+ var queryListItem = new QueryListItem();
20335
+ Object.assign(queryListItem, Object.assign(Object.assign({}, message), { children: allMessages
20336
+ .filter(function (childMessage) { return childMessage.parentId === message.id; })
20337
+ .map(function (childMessage) { return _this.buildQueryListItem(childMessage, allMessages); }) }));
20338
+ return queryListItem;
20339
+ };
20340
+ return QueryListData;
20341
+ }());
20342
+
20343
+ exports.QueryListResponseStatus = void 0;
20344
+ (function (QueryListResponseStatus) {
20345
+ QueryListResponseStatus["NEW"] = "New";
20346
+ QueryListResponseStatus["RESPONDED"] = "Responded";
20347
+ })(exports.QueryListResponseStatus || (exports.QueryListResponseStatus = {}));
20280
20348
 
20281
20349
  var MarkdownComponent = /** @class */ (function () {
20282
20350
  function MarkdownComponent() {
@@ -20398,190 +20466,87 @@
20398
20466
  }], function () { return [{ type: i1__namespace$1.ActivatedRoute }]; }, null);
20399
20467
  })();
20400
20468
 
20401
- var QueryManagementUtils = /** @class */ (function () {
20402
- function QueryManagementUtils() {
20469
+ var QueryCreateComponent = /** @class */ (function () {
20470
+ function QueryCreateComponent() {
20403
20471
  }
20404
- QueryManagementUtils.extractCaseQueriesFromCaseField = function () {
20405
- };
20406
- QueryManagementUtils.documentToCollectionFormDocument = function (document) {
20407
- return {
20408
- id: null,
20409
- value: {
20410
- document_filename: document.originalDocumentName,
20411
- document_url: document._links.self.href,
20412
- document_binary_url: document._links.binary.href
20413
- }
20414
- };
20472
+ QueryCreateComponent.prototype.ngOnInit = function () {
20415
20473
  };
20416
- return QueryManagementUtils;
20474
+ return QueryCreateComponent;
20417
20475
  }());
20418
- QueryManagementUtils.ɵfac = function QueryManagementUtils_Factory(t) { return new (t || QueryManagementUtils)(); };
20419
- QueryManagementUtilsprov = i0__namespace.ɵɵdefineInjectable({ token: QueryManagementUtils, factory: QueryManagementUtils.ɵfac });
20476
+ QueryCreateComponent.ɵfac = function QueryCreateComponent_Factory(t) { return new (t || QueryCreateComponent)(); };
20477
+ QueryCreateComponentcmp = i0__namespace.ɵɵdefineComponent({ type: QueryCreateComponent, selectors: [["ccd-query-create"]], decls: 0, vars: 0, template: function QueryCreateComponent_Template(rf, ctx) { }, encapsulation: 2 });
20420
20478
  (function () {
20421
- (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(QueryManagementUtils, [{
20422
- type: i0.Injectable
20423
- }], null, null);
20479
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(QueryCreateComponent, [{
20480
+ type: i0.Component,
20481
+ args: [{
20482
+ selector: 'ccd-query-create',
20483
+ templateUrl: './query-create.component.html',
20484
+ }]
20485
+ }], function () { return []; }, null);
20424
20486
  })();
20425
20487
 
20426
- function QueryCheckYourAnswersComponent_ccd_read_collection_field_31_Template(rf, ctx) {
20488
+ function QueryDetailsComponent_ng_container_0_Template(rf, ctx) {
20427
20489
  if (rf & 1) {
20428
- i0__namespace.ɵɵelement(0, "ccd-read-collection-field", 14);
20490
+ var _r2_1 = i0__namespace.ɵɵgetCurrentView();
20491
+ i0__namespace.ɵɵelementContainerStart(0);
20492
+ i0__namespace.ɵɵelementStart(1, "p");
20493
+ i0__namespace.ɵɵelement(2, "br");
20494
+ i0__namespace.ɵɵelementStart(3, "a", 1);
20495
+ i0__namespace.ɵɵlistener("click", function QueryDetailsComponent_ng_container_0_Template_a_click_3_listener() { i0__namespace.ɵɵrestoreView(_r2_1); var ctx_r1 = i0__namespace.ɵɵnextContext(); return ctx_r1.onBack(); });
20496
+ i0__namespace.ɵɵtext(4);
20497
+ i0__namespace.ɵɵpipe(5, "rpxTranslate");
20498
+ i0__namespace.ɵɵelementEnd();
20499
+ i0__namespace.ɵɵelementEnd();
20500
+ i0__namespace.ɵɵelementStart(6, "div", 2);
20501
+ i0__namespace.ɵɵtext(7);
20502
+ i0__namespace.ɵɵpipe(8, "rpxTranslate");
20503
+ i0__namespace.ɵɵelementEnd();
20504
+ i0__namespace.ɵɵelement(9, "ccd-query-details-table", 3);
20505
+ i0__namespace.ɵɵelementContainerEnd();
20429
20506
  }
20430
20507
  if (rf & 2) {
20431
20508
  var ctx_r0 = i0__namespace.ɵɵnextContext();
20432
- i0__namespace.ɵɵproperty("caseField", ctx_r0.caseField);
20509
+ i0__namespace.ɵɵadvance(4);
20510
+ i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind1(5, 3, "Back to queries"));
20511
+ i0__namespace.ɵɵadvance(3);
20512
+ i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind1(8, 5, "Query details"));
20513
+ i0__namespace.ɵɵadvance(2);
20514
+ i0__namespace.ɵɵproperty("queryItem", ctx_r0.query);
20433
20515
  }
20434
20516
  }
20435
- var QueryCheckYourAnswersComponent = /** @class */ (function () {
20436
- function QueryCheckYourAnswersComponent() {
20517
+ var QueryDetailsComponent = /** @class */ (function () {
20518
+ function QueryDetailsComponent() {
20437
20519
  this.backClicked = new i0.EventEmitter();
20438
20520
  }
20439
- QueryCheckYourAnswersComponent.prototype.ngOnInit = function () {
20440
- this.caseField = caseFieldMockData;
20441
- this.caseField.value = this.formGroup.get('attachments').value
20442
- .map(QueryManagementUtils.documentToCollectionFormDocument);
20443
- };
20444
- QueryCheckYourAnswersComponent.prototype.goBack = function () {
20521
+ QueryDetailsComponent.prototype.onBack = function () {
20445
20522
  this.backClicked.emit(true);
20446
20523
  };
20447
- return QueryCheckYourAnswersComponent;
20524
+ return QueryDetailsComponent;
20448
20525
  }());
20449
- QueryCheckYourAnswersComponent.ɵfac = function QueryCheckYourAnswersComponent_Factory(t) { return new (t || QueryCheckYourAnswersComponent)(); };
20450
- QueryCheckYourAnswersComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: QueryCheckYourAnswersComponent, selectors: [["ccd-query-check-your-answers"]], inputs: { formGroup: "formGroup", queryItem: "queryItem" }, outputs: { backClicked: "backClicked" }, decls: 44, vars: 27, consts: [[1, "govuk-grid-row"], [1, "govuk-grid-column-two-thirds-from-desktop"], [1, "govuk-heading-l"], [1, "govuk-!-margin-bottom-4"], [1, "govuk-summary-list", "govuk-!-margin-bottom-0"], [1, "govuk-summary-list__row"], [1, "govuk-summary-list__key"], [1, "govuk-summary-list__value"], [1, "govuk-summary-list__actions"], ["href", "javascript:void(0)", 1, "govuk-link", 3, "click"], [1, "govuk-summary-list__value", "govuk-summary-list__value--documentAttached"], [3, "caseField", 4, "ngIf"], ["data-module", "govuk-button", 1, "govuk-button", "govuk-button--secondary", "govuk-!-margin-right-3", 3, "click"], ["data-module", "govuk-button", 1, "govuk-button"], [3, "caseField"]], template: function QueryCheckYourAnswersComponent_Template(rf, ctx) {
20526
+ QueryDetailsComponent.ɵfac = function QueryDetailsComponent_Factory(t) { return new (t || QueryDetailsComponent)(); };
20527
+ QueryDetailsComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: QueryDetailsComponent, selectors: [["ccd-query-details"]], inputs: { query: "query" }, outputs: { backClicked: "backClicked" }, decls: 1, vars: 1, consts: [[4, "ngIf"], ["href", "javascript:void(0)", 1, "govuk-link", 3, "click"], [1, "query_details_caption"], [3, "queryItem"]], template: function QueryDetailsComponent_Template(rf, ctx) {
20451
20528
  if (rf & 1) {
20452
- i0__namespace.ɵɵelementStart(0, "div", 0);
20453
- i0__namespace.ɵɵelementStart(1, "div", 1);
20454
- i0__namespace.ɵɵelementStart(2, "h1", 2);
20455
- i0__namespace.ɵɵtext(3);
20456
- i0__namespace.ɵɵpipe(4, "rpxTranslate");
20457
- i0__namespace.ɵɵelementEnd();
20458
- i0__namespace.ɵɵelementStart(5, "div", 3);
20459
- i0__namespace.ɵɵelement(6, "ccd-query-case-details-header");
20460
- i0__namespace.ɵɵelementEnd();
20461
- i0__namespace.ɵɵelementStart(7, "dl", 4);
20462
- i0__namespace.ɵɵelementStart(8, "div", 5);
20463
- i0__namespace.ɵɵelementStart(9, "dt", 6);
20464
- i0__namespace.ɵɵtext(10);
20465
- i0__namespace.ɵɵpipe(11, "rpxTranslate");
20466
- i0__namespace.ɵɵelementEnd();
20467
- i0__namespace.ɵɵelementStart(12, "dd", 7);
20468
- i0__namespace.ɵɵtext(13);
20469
- i0__namespace.ɵɵelementEnd();
20470
- i0__namespace.ɵɵelementEnd();
20471
- i0__namespace.ɵɵelementEnd();
20472
- i0__namespace.ɵɵelementStart(14, "dl", 4);
20473
- i0__namespace.ɵɵelementStart(15, "div", 5);
20474
- i0__namespace.ɵɵelementStart(16, "dt", 6);
20475
- i0__namespace.ɵɵtext(17);
20476
- i0__namespace.ɵɵpipe(18, "rpxTranslate");
20477
- i0__namespace.ɵɵelementEnd();
20478
- i0__namespace.ɵɵelementStart(19, "dd", 7);
20479
- i0__namespace.ɵɵtext(20);
20480
- i0__namespace.ɵɵelementEnd();
20481
- i0__namespace.ɵɵelementStart(21, "dd", 8);
20482
- i0__namespace.ɵɵelementStart(22, "a", 9);
20483
- i0__namespace.ɵɵlistener("click", function QueryCheckYourAnswersComponent_Template_a_click_22_listener() { return ctx.goBack(); });
20484
- i0__namespace.ɵɵtext(23);
20485
- i0__namespace.ɵɵpipe(24, "rpxTranslate");
20486
- i0__namespace.ɵɵelementEnd();
20487
- i0__namespace.ɵɵelementEnd();
20488
- i0__namespace.ɵɵelementEnd();
20489
- i0__namespace.ɵɵelementEnd();
20490
- i0__namespace.ɵɵelementStart(25, "dl", 4);
20491
- i0__namespace.ɵɵelementStart(26, "div", 5);
20492
- i0__namespace.ɵɵelementStart(27, "dt", 6);
20493
- i0__namespace.ɵɵtext(28);
20494
- i0__namespace.ɵɵpipe(29, "rpxTranslate");
20495
- i0__namespace.ɵɵelementEnd();
20496
- i0__namespace.ɵɵelementStart(30, "dd", 10);
20497
- i0__namespace.ɵɵtemplate(31, QueryCheckYourAnswersComponent_ccd_read_collection_field_31_Template, 1, 1, "ccd-read-collection-field", 11);
20498
- i0__namespace.ɵɵelementEnd();
20499
- i0__namespace.ɵɵelementStart(32, "dd", 8);
20500
- i0__namespace.ɵɵelementStart(33, "a", 9);
20501
- i0__namespace.ɵɵlistener("click", function QueryCheckYourAnswersComponent_Template_a_click_33_listener() { return ctx.goBack(); });
20502
- i0__namespace.ɵɵtext(34);
20503
- i0__namespace.ɵɵpipe(35, "rpxTranslate");
20504
- i0__namespace.ɵɵelementEnd();
20505
- i0__namespace.ɵɵelementEnd();
20506
- i0__namespace.ɵɵelementEnd();
20507
- i0__namespace.ɵɵelementEnd();
20508
- i0__namespace.ɵɵelement(36, "br");
20509
- i0__namespace.ɵɵelementStart(37, "div");
20510
- i0__namespace.ɵɵelementStart(38, "button", 12);
20511
- i0__namespace.ɵɵlistener("click", function QueryCheckYourAnswersComponent_Template_button_click_38_listener() { return ctx.goBack(); });
20512
- i0__namespace.ɵɵtext(39);
20513
- i0__namespace.ɵɵpipe(40, "rpxTranslate");
20514
- i0__namespace.ɵɵelementEnd();
20515
- i0__namespace.ɵɵelementStart(41, "button", 13);
20516
- i0__namespace.ɵɵtext(42);
20517
- i0__namespace.ɵɵpipe(43, "rpxTranslate");
20518
- i0__namespace.ɵɵelementEnd();
20519
- i0__namespace.ɵɵelementEnd();
20520
- i0__namespace.ɵɵelementEnd();
20521
- i0__namespace.ɵɵelementEnd();
20529
+ i0__namespace.ɵɵtemplate(0, QueryDetailsComponent_ng_container_0_Template, 10, 7, "ng-container", 0);
20522
20530
  }
20523
20531
  if (rf & 2) {
20524
- i0__namespace.ɵɵadvance(3);
20525
- i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind1(4, 11, "Review query response details"));
20526
- i0__namespace.ɵɵadvance(7);
20527
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(11, 13, "Submitted query"), " ");
20528
- i0__namespace.ɵɵadvance(3);
20529
- i0__namespace.ɵɵtextInterpolate1(" ", ctx.queryItem.subject, " ");
20530
- i0__namespace.ɵɵadvance(4);
20531
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(18, 15, "Response message"), " ");
20532
- i0__namespace.ɵɵadvance(3);
20533
- i0__namespace.ɵɵtextInterpolate1(" ", ctx.formGroup.controls["body"].value, " ");
20534
- i0__namespace.ɵɵadvance(3);
20535
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(24, 17, "Change"), " ");
20536
- i0__namespace.ɵɵadvance(5);
20537
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(29, 19, "Document attached"), " ");
20538
- i0__namespace.ɵɵadvance(3);
20539
- i0__namespace.ɵɵproperty("ngIf", ctx.caseField);
20540
- i0__namespace.ɵɵadvance(3);
20541
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(35, 21, "Change"), " ");
20542
- i0__namespace.ɵɵadvance(5);
20543
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(40, 23, "Previous"), " ");
20544
- i0__namespace.ɵɵadvance(3);
20545
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(43, 25, "Submit"), " ");
20532
+ i0__namespace.ɵɵproperty("ngIf", ctx.query);
20546
20533
  }
20547
- }, styles: ["ccd-query-check-your-answers .collection-field-table tr>td{border-bottom:none;padding-bottom:0}ccd-query-check-your-answers .govuk-summary-list__value--documentAttached{vertical-align:middle}"], encapsulation: 2 });
20534
+ }, styles: [".query_details_caption[_ngcontent-%COMP%]{background:#f3f2f1;padding:10px;font-size:x-large;font-weight:700}"] });
20548
20535
  (function () {
20549
- (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(QueryCheckYourAnswersComponent, [{
20536
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(QueryDetailsComponent, [{
20550
20537
  type: i0.Component,
20551
20538
  args: [{
20552
- selector: 'ccd-query-check-your-answers',
20553
- templateUrl: './query-check-your-answers.component.html',
20554
- styleUrls: ['./query-check-your-answers.component.scss'],
20555
- encapsulation: i0.ViewEncapsulation.None
20539
+ selector: 'ccd-query-details',
20540
+ templateUrl: './query-details.component.html',
20541
+ styleUrls: ['./query-details.component.scss']
20556
20542
  }]
20557
- }], null, { formGroup: [{
20558
- type: i0.Input
20559
- }], queryItem: [{
20543
+ }], null, { query: [{
20560
20544
  type: i0.Input
20561
20545
  }], backClicked: [{
20562
20546
  type: i0.Output
20563
20547
  }] });
20564
20548
  })();
20565
20549
 
20566
- var QueryCreateComponent = /** @class */ (function () {
20567
- function QueryCreateComponent() {
20568
- }
20569
- QueryCreateComponent.prototype.ngOnInit = function () {
20570
- };
20571
- return QueryCreateComponent;
20572
- }());
20573
- QueryCreateComponent.ɵfac = function QueryCreateComponent_Factory(t) { return new (t || QueryCreateComponent)(); };
20574
- QueryCreateComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: QueryCreateComponent, selectors: [["ccd-query-create"]], decls: 0, vars: 0, template: function QueryCreateComponent_Template(rf, ctx) { }, encapsulation: 2 });
20575
- (function () {
20576
- (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(QueryCreateComponent, [{
20577
- type: i0.Component,
20578
- args: [{
20579
- selector: 'ccd-query-create',
20580
- templateUrl: './query-create.component.html',
20581
- }]
20582
- }], function () { return []; }, null);
20583
- })();
20584
-
20585
20550
  function QueryDetailsTableComponent_ng_container_0_tr_35_Template(rf, ctx) {
20586
20551
  if (rf & 1) {
20587
20552
  i0__namespace.ɵɵelementStart(0, "tr", 3);
@@ -20744,68 +20709,6 @@
20744
20709
  }] });
20745
20710
  })();
20746
20711
 
20747
- function QueryDetailsComponent_ng_container_0_Template(rf, ctx) {
20748
- if (rf & 1) {
20749
- var _r2_1 = i0__namespace.ɵɵgetCurrentView();
20750
- i0__namespace.ɵɵelementContainerStart(0);
20751
- i0__namespace.ɵɵelementStart(1, "p");
20752
- i0__namespace.ɵɵelement(2, "br");
20753
- i0__namespace.ɵɵelementStart(3, "a", 1);
20754
- i0__namespace.ɵɵlistener("click", function QueryDetailsComponent_ng_container_0_Template_a_click_3_listener() { i0__namespace.ɵɵrestoreView(_r2_1); var ctx_r1 = i0__namespace.ɵɵnextContext(); return ctx_r1.onBack(); });
20755
- i0__namespace.ɵɵtext(4);
20756
- i0__namespace.ɵɵpipe(5, "rpxTranslate");
20757
- i0__namespace.ɵɵelementEnd();
20758
- i0__namespace.ɵɵelementEnd();
20759
- i0__namespace.ɵɵelementStart(6, "div", 2);
20760
- i0__namespace.ɵɵtext(7);
20761
- i0__namespace.ɵɵpipe(8, "rpxTranslate");
20762
- i0__namespace.ɵɵelementEnd();
20763
- i0__namespace.ɵɵelement(9, "ccd-query-details-table", 3);
20764
- i0__namespace.ɵɵelementContainerEnd();
20765
- }
20766
- if (rf & 2) {
20767
- var ctx_r0 = i0__namespace.ɵɵnextContext();
20768
- i0__namespace.ɵɵadvance(4);
20769
- i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind1(5, 3, "Back to queries"));
20770
- i0__namespace.ɵɵadvance(3);
20771
- i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind1(8, 5, "Query details"));
20772
- i0__namespace.ɵɵadvance(2);
20773
- i0__namespace.ɵɵproperty("queryItem", ctx_r0.query);
20774
- }
20775
- }
20776
- var QueryDetailsComponent = /** @class */ (function () {
20777
- function QueryDetailsComponent() {
20778
- this.backClicked = new i0.EventEmitter();
20779
- }
20780
- QueryDetailsComponent.prototype.onBack = function () {
20781
- this.backClicked.emit(true);
20782
- };
20783
- return QueryDetailsComponent;
20784
- }());
20785
- QueryDetailsComponent.ɵfac = function QueryDetailsComponent_Factory(t) { return new (t || QueryDetailsComponent)(); };
20786
- QueryDetailsComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: QueryDetailsComponent, selectors: [["ccd-query-details"]], inputs: { query: "query" }, outputs: { backClicked: "backClicked" }, decls: 1, vars: 1, consts: [[4, "ngIf"], ["href", "javascript:void(0)", 1, "govuk-link", 3, "click"], [1, "query_details_caption"], [3, "queryItem"]], template: function QueryDetailsComponent_Template(rf, ctx) {
20787
- if (rf & 1) {
20788
- i0__namespace.ɵɵtemplate(0, QueryDetailsComponent_ng_container_0_Template, 10, 7, "ng-container", 0);
20789
- }
20790
- if (rf & 2) {
20791
- i0__namespace.ɵɵproperty("ngIf", ctx.query);
20792
- }
20793
- }, styles: [".query_details_caption[_ngcontent-%COMP%]{background:#f3f2f1;padding:10px;font-size:x-large;font-weight:700}"] });
20794
- (function () {
20795
- (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(QueryDetailsComponent, [{
20796
- type: i0.Component,
20797
- args: [{
20798
- selector: 'ccd-query-details',
20799
- templateUrl: './query-details.component.html',
20800
- styleUrls: ['./query-details.component.scss']
20801
- }]
20802
- }], null, { query: [{
20803
- type: i0.Input
20804
- }], backClicked: [{
20805
- type: i0.Output
20806
- }] });
20807
- })();
20808
-
20809
20712
  var SortOrder;
20810
20713
  (function (SortOrder) {
20811
20714
  SortOrder[SortOrder["ASCENDING"] = 0] = "ASCENDING";
@@ -20813,99 +20716,6 @@
20813
20716
  SortOrder[SortOrder["UNSORTED"] = 2] = "UNSORTED";
20814
20717
  })(SortOrder || (SortOrder = {}));
20815
20718
 
20816
- var QueryListItem = /** @class */ (function () {
20817
- function QueryListItem() {
20818
- this.children = [];
20819
- }
20820
- Object.defineProperty(QueryListItem.prototype, "lastSubmittedMessage", {
20821
- get: function () {
20822
- var getLastSubmittedMessage = function (item) {
20823
- var e_1, _b;
20824
- var lastSubmittedMessage = item;
20825
- if (item.children && item.children.length > 0) {
20826
- try {
20827
- for (var _c = __values(item.children), _d = _c.next(); !_d.done; _d = _c.next()) {
20828
- var child = _d.value;
20829
- var childLastSubmittedMessage = getLastSubmittedMessage(child);
20830
- if (childLastSubmittedMessage.createdOn > lastSubmittedMessage.createdOn) {
20831
- lastSubmittedMessage = childLastSubmittedMessage;
20832
- }
20833
- }
20834
- }
20835
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
20836
- finally {
20837
- try {
20838
- if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
20839
- }
20840
- finally { if (e_1) throw e_1.error; }
20841
- }
20842
- }
20843
- return lastSubmittedMessage;
20844
- };
20845
- return getLastSubmittedMessage(this);
20846
- },
20847
- enumerable: false,
20848
- configurable: true
20849
- });
20850
- Object.defineProperty(QueryListItem.prototype, "lastSubmittedBy", {
20851
- get: function () {
20852
- return this.lastSubmittedMessage.name;
20853
- },
20854
- enumerable: false,
20855
- configurable: true
20856
- });
20857
- Object.defineProperty(QueryListItem.prototype, "lastSubmittedDate", {
20858
- get: function () {
20859
- return new Date(this.lastSubmittedMessage.createdOn);
20860
- },
20861
- enumerable: false,
20862
- configurable: true
20863
- });
20864
- Object.defineProperty(QueryListItem.prototype, "lastResponseBy", {
20865
- get: function () {
20866
- var _a;
20867
- return ((_a = this.children) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.lastSubmittedMessage.name : '';
20868
- },
20869
- enumerable: false,
20870
- configurable: true
20871
- });
20872
- Object.defineProperty(QueryListItem.prototype, "lastResponseDate", {
20873
- get: function () {
20874
- var _a;
20875
- return ((_a = this.children) === null || _a === void 0 ? void 0 : _a.length) > 0 ? new Date(this.lastSubmittedMessage.createdOn) : null;
20876
- },
20877
- enumerable: false,
20878
- configurable: true
20879
- });
20880
- return QueryListItem;
20881
- }());
20882
-
20883
- var QueryListData = /** @class */ (function () {
20884
- function QueryListData(partyMessagesGroup) {
20885
- var _this = this;
20886
- this.partyName = partyMessagesGroup.partyName;
20887
- this.roleOnCase = partyMessagesGroup.roleOnCase;
20888
- // get the parent messages (messages without parentId) and add the children to them
20889
- var parentMessages = partyMessagesGroup.partyMessages.filter(function (message) { return !message.parentId; });
20890
- this.partyMessages = parentMessages.map(function (message) { return _this.buildQueryListItem(message, partyMessagesGroup.partyMessages); });
20891
- }
20892
- QueryListData.prototype.buildQueryListItem = function (message, allMessages) {
20893
- var _this = this;
20894
- var queryListItem = new QueryListItem();
20895
- Object.assign(queryListItem, Object.assign(Object.assign({}, message), { children: allMessages
20896
- .filter(function (childMessage) { return childMessage.parentId === message.id; })
20897
- .map(function (childMessage) { return _this.buildQueryListItem(childMessage, allMessages); }) }));
20898
- return queryListItem;
20899
- };
20900
- return QueryListData;
20901
- }());
20902
-
20903
- exports.QueryListResponseStatus = void 0;
20904
- (function (QueryListResponseStatus) {
20905
- QueryListResponseStatus["NEW"] = "New";
20906
- QueryListResponseStatus["RESPONDED"] = "Responded";
20907
- })(exports.QueryListResponseStatus || (exports.QueryListResponseStatus = {}));
20908
-
20909
20719
  function QueryListComponent_ng_container_0_th_7_Template(rf, ctx) {
20910
20720
  if (rf & 1) {
20911
20721
  var _r5_1 = i0__namespace.ɵɵgetCurrentView();
@@ -21094,14 +20904,12 @@
21094
20904
  function QueryWriteAddDocumentsComponent() {
21095
20905
  this.documentFormGroup = new i3.FormGroup({});
21096
20906
  this.documentCollectionUpdate = new i0.EventEmitter();
21097
- }
21098
- QueryWriteAddDocumentsComponent.prototype.ngOnInit = function () {
21099
- var _a;
21100
20907
  // This field is mocked to allow the document component to be used in isolation
21101
20908
  this.mockDocumentCaseField = Object.assign(new CaseField(), {
21102
20909
  id: QueryWriteAddDocumentsComponent.DOCUMENTS_FORM_CONTROL_NAME,
21103
- label: 'Add document (optional)',
20910
+ label: 'Add document',
21104
20911
  hint_text: 'Attach a document to this message',
20912
+ display_context: 'OPTIONAL',
21105
20913
  display_context_parameter: '#COLLECTION(allowInsert,allowUpdate)',
21106
20914
  field_type: Object.assign(new FieldType(), {
21107
20915
  id: 'queryDocuments',
@@ -21123,13 +20931,12 @@
21123
20931
  })
21124
20932
  }),
21125
20933
  });
21126
- this.mockDocumentCaseField.value = (_a = this.formGroup.get('attachments')) === null || _a === void 0 ? void 0 : _a.value.map(QueryManagementUtils.documentToCollectionFormDocument);
21127
- };
20934
+ }
21128
20935
  QueryWriteAddDocumentsComponent.prototype.ngAfterViewInit = function () {
21129
20936
  var _this = this;
21130
- var documentFormControl = this.documentFormGroup.get(QueryWriteAddDocumentsComponent.DOCUMENTS_FORM_CONTROL_NAME);
21131
- if (documentFormControl) {
21132
- this.documentFormControlSubscription = documentFormControl.valueChanges
20937
+ var formControl = this.documentFormGroup.get(QueryWriteAddDocumentsComponent.DOCUMENTS_FORM_CONTROL_NAME);
20938
+ if (formControl) {
20939
+ this.documentFormControlSubscription = formControl.valueChanges
21133
20940
  .pipe(operators.map(function (documents) { return (documents.filter(function (document) { var _a; return !!((_a = document === null || document === void 0 ? void 0 : document.value) === null || _a === void 0 ? void 0 : _a.document_url); })); }), operators.map(function (documents) { return documents.map(function (document) { return document === null || document === void 0 ? void 0 : document.value; }); }), operators.tap(function (documents) { return _this.documentCollectionUpdate.emit(documents); }))
21134
20941
  .subscribe();
21135
20942
  }
@@ -21142,7 +20949,7 @@
21142
20949
  }());
21143
20950
  QueryWriteAddDocumentsComponent.DOCUMENTS_FORM_CONTROL_NAME = 'documentCollection';
21144
20951
  QueryWriteAddDocumentsComponent.ɵfac = function QueryWriteAddDocumentsComponent_Factory(t) { return new (t || QueryWriteAddDocumentsComponent)(); };
21145
- QueryWriteAddDocumentsComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: QueryWriteAddDocumentsComponent, selectors: [["ccd-query-write-add-documents"]], inputs: { formGroup: "formGroup" }, outputs: { documentCollectionUpdate: "documentCollectionUpdate" }, decls: 1, vars: 2, consts: [[3, "formGroup", "caseField"]], template: function QueryWriteAddDocumentsComponent_Template(rf, ctx) {
20952
+ QueryWriteAddDocumentsComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: QueryWriteAddDocumentsComponent, selectors: [["ccd-query-write-add-documents"]], outputs: { documentCollectionUpdate: "documentCollectionUpdate" }, decls: 1, vars: 2, consts: [[3, "formGroup", "caseField"]], template: function QueryWriteAddDocumentsComponent_Template(rf, ctx) {
21146
20953
  if (rf & 1) {
21147
20954
  i0__namespace.ɵɵelement(0, "ccd-write-collection-field", 0);
21148
20955
  }
@@ -21157,9 +20964,7 @@
21157
20964
  selector: 'ccd-query-write-add-documents',
21158
20965
  templateUrl: './query-write-add-documents.component.html'
21159
20966
  }]
21160
- }], null, { formGroup: [{
21161
- type: i0.Input
21162
- }], documentCollectionUpdate: [{
20967
+ }], function () { return []; }, { documentCollectionUpdate: [{
21163
20968
  type: i0.Output
21164
20969
  }] });
21165
20970
  })();
@@ -21215,7 +21020,7 @@
21215
21020
  i0__namespace.ɵɵadvance(2);
21216
21021
  i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind1(3, 2, "Error:"));
21217
21022
  i0__namespace.ɵɵadvance(2);
21218
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(5, 4, "Enter a body"), " ");
21023
+ i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(5, 4, "Enter a query body"), " ");
21219
21024
  }
21220
21025
  }
21221
21026
  var QueryWriteRaiseQueryComponent = /** @class */ (function () {
@@ -21507,6 +21312,21 @@
21507
21312
  }] });
21508
21313
  })();
21509
21314
 
21315
+ var QueryManagementUtils = /** @class */ (function () {
21316
+ function QueryManagementUtils() {
21317
+ }
21318
+ QueryManagementUtils.extractCaseQueriesFromCaseField = function () {
21319
+ };
21320
+ return QueryManagementUtils;
21321
+ }());
21322
+ QueryManagementUtils.ɵfac = function QueryManagementUtils_Factory(t) { return new (t || QueryManagementUtils)(); };
21323
+ QueryManagementUtils.ɵprov = i0__namespace.ɵɵdefineInjectable({ token: QueryManagementUtils, factory: QueryManagementUtils.ɵfac });
21324
+ (function () {
21325
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(QueryManagementUtils, [{
21326
+ type: i0.Injectable
21327
+ }], null, null);
21328
+ })();
21329
+
21510
21330
  function ReadQueryManagementFieldComponent_ng_container_1_div_1_Template(rf, ctx) {
21511
21331
  if (rf & 1) {
21512
21332
  var _r5_1 = i0__namespace.ɵɵgetCurrentView();
@@ -21624,24 +21444,9 @@
21624
21444
  __extends(WriteQueryManagementFieldComponent, _super);
21625
21445
  function WriteQueryManagementFieldComponent() {
21626
21446
  var _this = _super.call(this) || this;
21627
- _this.responseFormGroup = new i3.FormGroup({
21628
- response: new i3.FormControl('', [i3.Validators.required]),
21629
- documents: new i3.FormControl([])
21630
- });
21631
- _this.errorMessages = [];
21632
- _this.submitted = false;
21447
+ _this.formGroup = new i3.FormGroup({});
21633
21448
  return _this;
21634
21449
  }
21635
- WriteQueryManagementFieldComponent.prototype.submitForm = function () {
21636
- this.submitted = true;
21637
- this.errorMessages = [];
21638
- window.scrollTo(0, 0);
21639
- if (!this.responseFormGroup.valid) {
21640
- if (this.responseFormGroup.controls.response.hasError('required')) {
21641
- this.errorMessages.push({ controlName: 'response', message: 'Add a response before continue' });
21642
- }
21643
- }
21644
- };
21645
21450
  return WriteQueryManagementFieldComponent;
21646
21451
  }(AbstractFieldReadComponent));
21647
21452
  WriteQueryManagementFieldComponent.ɵfac = function WriteQueryManagementFieldComponent_Factory(t) { return new (t || WriteQueryManagementFieldComponent)(); };
@@ -29417,7 +29222,6 @@
29417
29222
  QueryWriteRespondToQueryComponent,
29418
29223
  QueryWriteRaiseQueryComponent,
29419
29224
  QueryCaseDetailsHeaderComponent,
29420
- QueryCheckYourAnswersComponent,
29421
29225
  QueryWriteAddDocumentsComponent,
29422
29226
  ];
29423
29227
  var PaletteModule = /** @class */ (function () {
@@ -29604,7 +29408,6 @@
29604
29408
  QueryWriteRespondToQueryComponent,
29605
29409
  QueryWriteRaiseQueryComponent,
29606
29410
  QueryCaseDetailsHeaderComponent,
29607
- QueryCheckYourAnswersComponent,
29608
29411
  QueryWriteAddDocumentsComponent], imports: [i5.CommonModule,
29609
29412
  i1$1.RouterModule,
29610
29413
  i3.FormsModule,
@@ -29752,7 +29555,6 @@
29752
29555
  QueryWriteRespondToQueryComponent,
29753
29556
  QueryWriteRaiseQueryComponent,
29754
29557
  QueryCaseDetailsHeaderComponent,
29755
- QueryCheckYourAnswersComponent,
29756
29558
  QueryWriteAddDocumentsComponent] });
29757
29559
  })();
29758
29560
  (function () {
@@ -29900,7 +29702,6 @@
29900
29702
  i0__namespace.ɵɵsetComponentScope(QueryWriteRespondToQueryComponent, [QueryCaseDetailsHeaderComponent,
29901
29703
  QueryDetailsTableComponent, i3__namespace.NgControlStatusGroup, i3__namespace.FormGroupDirective, i5__namespace.NgIf, i3__namespace.DefaultValueAccessor, i3__namespace.NgControlStatus, i3__namespace.FormControlName], [i1__namespace.RpxTranslatePipe]);
29902
29704
  i0__namespace.ɵɵsetComponentScope(QueryWriteRaiseQueryComponent, [QueryCaseDetailsHeaderComponent, i3__namespace.NgControlStatusGroup, i3__namespace.FormGroupDirective, i5__namespace.NgIf, i3__namespace.DefaultValueAccessor, i3__namespace.NgControlStatus, i3__namespace.FormControlName], [i1__namespace.RpxTranslatePipe]);
29903
- i0__namespace.ɵɵsetComponentScope(QueryCheckYourAnswersComponent, [QueryCaseDetailsHeaderComponent, i5__namespace.NgIf, ReadCollectionFieldComponent], [i1__namespace.RpxTranslatePipe]);
29904
29705
  i0__namespace.ɵɵsetComponentScope(QueryWriteAddDocumentsComponent, [WriteCollectionFieldComponent, i3__namespace.NgControlStatusGroup, i3__namespace.FormGroupDirective], []);
29905
29706
 
29906
29707
  var Confirmation = /** @class */ (function () {
@@ -40518,7 +40319,6 @@
40518
40319
  exports.ProfileNotifier = ProfileNotifier;
40519
40320
  exports.ProfileService = ProfileService;
40520
40321
  exports.QueryCaseDetailsHeaderComponent = QueryCaseDetailsHeaderComponent;
40521
- exports.QueryCheckYourAnswersComponent = QueryCheckYourAnswersComponent;
40522
40322
  exports.QueryCreateComponent = QueryCreateComponent;
40523
40323
  exports.QueryDetailsComponent = QueryDetailsComponent;
40524
40324
  exports.QueryDetailsTableComponent = QueryDetailsTableComponent;
@@ -40638,7 +40438,6 @@
40638
40438
  exports.WriteYesNoFieldComponent = WriteYesNoFieldComponent;
40639
40439
  exports.YesNoService = YesNoService;
40640
40440
  exports.aCaseField = aCaseField;
40641
- exports.caseFieldMockData = caseFieldMockData;
40642
40441
  exports.createACL = createACL;
40643
40442
  exports.createCaseEventTrigger = createCaseEventTrigger;
40644
40443
  exports.createCaseField = createCaseField;