@hmcts/ccd-case-ui-toolkit 6.16.0-query-management-raise-query-function-v7 → 6.16.0-query-management-CYA-continue-v2

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 (39) hide show
  1. package/bundles/hmcts-ccd-case-ui-toolkit.umd.js +421 -372
  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 +9 -14
  6. package/esm2015/lib/shared/components/palette/query-management/__mocks__/index.js +27 -1
  7. package/esm2015/lib/shared/components/palette/query-management/components/index.js +3 -3
  8. package/esm2015/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.js +137 -0
  9. package/esm2015/lib/shared/components/palette/query-management/components/query-management-error-messages/query-management-error-message.model.js +2 -0
  10. package/esm2015/lib/shared/components/palette/query-management/components/query-write/query-write-add-documents/query-write-add-documents.component.js +15 -9
  11. package/esm2015/lib/shared/components/palette/query-management/components/query-write/query-write-raise-query/query-write-raise-query.component.js +19 -40
  12. package/esm2015/lib/shared/components/palette/query-management/components/query-write/query-write-respond-to-query/query-write-respond-to-query.component.js +20 -18
  13. package/esm2015/lib/shared/components/palette/query-management/index.js +2 -2
  14. package/esm2015/lib/shared/components/palette/query-management/utils/query-management.utils.js +11 -1
  15. package/esm2015/lib/shared/components/palette/query-management/write-query-management-field.component.js +18 -3
  16. package/fesm2015/hmcts-ccd-case-ui-toolkit.js +353 -305
  17. package/fesm2015/hmcts-ccd-case-ui-toolkit.js.map +1 -1
  18. package/lib/shared/components/palette/palette.module.d.ts +3 -3
  19. package/lib/shared/components/palette/palette.module.d.ts.map +1 -1
  20. package/lib/shared/components/palette/query-management/__mocks__/index.d.ts +2 -0
  21. package/lib/shared/components/palette/query-management/__mocks__/index.d.ts.map +1 -1
  22. package/lib/shared/components/palette/query-management/components/index.d.ts +2 -2
  23. package/lib/shared/components/palette/query-management/components/index.d.ts.map +1 -1
  24. package/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.d.ts +16 -0
  25. package/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.d.ts.map +1 -0
  26. package/lib/shared/components/palette/query-management/components/query-management-error-messages/query-management-error-message.model.d.ts +5 -0
  27. package/lib/shared/components/palette/query-management/components/query-management-error-messages/query-management-error-message.model.d.ts.map +1 -0
  28. package/lib/shared/components/palette/query-management/components/query-write/query-write-add-documents/query-write-add-documents.component.d.ts +5 -4
  29. package/lib/shared/components/palette/query-management/components/query-write/query-write-add-documents/query-write-add-documents.component.d.ts.map +1 -1
  30. package/lib/shared/components/palette/query-management/index.d.ts +1 -1
  31. package/lib/shared/components/palette/query-management/index.d.ts.map +1 -1
  32. package/lib/shared/components/palette/query-management/utils/query-management.utils.d.ts +5 -0
  33. package/lib/shared/components/palette/query-management/utils/query-management.utils.d.ts.map +1 -1
  34. package/lib/shared/components/palette/query-management/write-query-management-field.component.d.ts +5 -1
  35. package/lib/shared/components/palette/query-management/write-query-management-field.component.d.ts.map +1 -1
  36. package/package.json +1 -1
  37. package/esm2015/lib/shared/components/palette/query-management/components/query-write/query-write-date-input/query-write-date-input.component.js +0 -125
  38. package/lib/shared/components/palette/query-management/components/query-write/query-write-date-input/query-write-date-input.component.d.ts +0 -20
  39. package/lib/shared/components/palette/query-management/components/query-write/query-write-date-input/query-write-date-input.component.d.ts.map +0 -1
@@ -20252,99 +20252,31 @@
20252
20252
  ]
20253
20253
  }
20254
20254
  ];
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 = {}));
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
+ });
20348
20280
 
20349
20281
  var MarkdownComponent = /** @class */ (function () {
20350
20282
  function MarkdownComponent() {
@@ -20466,87 +20398,190 @@
20466
20398
  }], function () { return [{ type: i1__namespace$1.ActivatedRoute }]; }, null);
20467
20399
  })();
20468
20400
 
20469
- var QueryCreateComponent = /** @class */ (function () {
20470
- function QueryCreateComponent() {
20401
+ var QueryManagementUtils = /** @class */ (function () {
20402
+ function QueryManagementUtils() {
20471
20403
  }
20472
- QueryCreateComponent.prototype.ngOnInit = function () {
20404
+ QueryManagementUtils.extractCaseQueriesFromCaseField = function () {
20473
20405
  };
20474
- return QueryCreateComponent;
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
+ };
20415
+ };
20416
+ return QueryManagementUtils;
20475
20417
  }());
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 });
20418
+ QueryManagementUtils.ɵfac = function QueryManagementUtils_Factory(t) { return new (t || QueryManagementUtils)(); };
20419
+ QueryManagementUtilsprov = i0__namespace.ɵɵdefineInjectable({ token: QueryManagementUtils, factory: QueryManagementUtils.ɵfac });
20478
20420
  (function () {
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);
20421
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(QueryManagementUtils, [{
20422
+ type: i0.Injectable
20423
+ }], null, null);
20486
20424
  })();
20487
20425
 
20488
- function QueryDetailsComponent_ng_container_0_Template(rf, ctx) {
20426
+ function QueryCheckYourAnswersComponent_ccd_read_collection_field_31_Template(rf, ctx) {
20489
20427
  if (rf & 1) {
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();
20428
+ i0__namespace.ɵɵelement(0, "ccd-read-collection-field", 14);
20506
20429
  }
20507
20430
  if (rf & 2) {
20508
20431
  var ctx_r0 = i0__namespace.ɵɵnextContext();
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);
20432
+ i0__namespace.ɵɵproperty("caseField", ctx_r0.caseField);
20515
20433
  }
20516
20434
  }
20517
- var QueryDetailsComponent = /** @class */ (function () {
20518
- function QueryDetailsComponent() {
20435
+ var QueryCheckYourAnswersComponent = /** @class */ (function () {
20436
+ function QueryCheckYourAnswersComponent() {
20519
20437
  this.backClicked = new i0.EventEmitter();
20520
20438
  }
20521
- QueryDetailsComponent.prototype.onBack = function () {
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 () {
20522
20445
  this.backClicked.emit(true);
20523
20446
  };
20524
- return QueryDetailsComponent;
20447
+ return QueryCheckYourAnswersComponent;
20525
20448
  }());
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) {
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) {
20528
20451
  if (rf & 1) {
20529
- i0__namespace.ɵɵtemplate(0, QueryDetailsComponent_ng_container_0_Template, 10, 7, "ng-container", 0);
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();
20530
20522
  }
20531
20523
  if (rf & 2) {
20532
- i0__namespace.ɵɵproperty("ngIf", ctx.query);
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"), " ");
20533
20546
  }
20534
- }, styles: [".query_details_caption[_ngcontent-%COMP%]{background:#f3f2f1;padding:10px;font-size:x-large;font-weight:700}"] });
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 });
20535
20548
  (function () {
20536
- (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(QueryDetailsComponent, [{
20549
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(QueryCheckYourAnswersComponent, [{
20537
20550
  type: i0.Component,
20538
20551
  args: [{
20539
- selector: 'ccd-query-details',
20540
- templateUrl: './query-details.component.html',
20541
- styleUrls: ['./query-details.component.scss']
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
20542
20556
  }]
20543
- }], null, { query: [{
20557
+ }], null, { formGroup: [{
20558
+ type: i0.Input
20559
+ }], queryItem: [{
20544
20560
  type: i0.Input
20545
20561
  }], backClicked: [{
20546
20562
  type: i0.Output
20547
20563
  }] });
20548
20564
  })();
20549
20565
 
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
+
20550
20585
  function QueryDetailsTableComponent_ng_container_0_tr_35_Template(rf, ctx) {
20551
20586
  if (rf & 1) {
20552
20587
  i0__namespace.ɵɵelementStart(0, "tr", 3);
@@ -20682,30 +20717,92 @@
20682
20717
  i0__namespace.ɵɵproperty("ngForOf", ctx_r0.queryItem.attachments);
20683
20718
  }
20684
20719
  }
20685
- var QueryDetailsTableComponent = /** @class */ (function () {
20686
- function QueryDetailsTableComponent() {
20720
+ var QueryDetailsTableComponent = /** @class */ (function () {
20721
+ function QueryDetailsTableComponent() {
20722
+ }
20723
+ return QueryDetailsTableComponent;
20724
+ }());
20725
+ QueryDetailsTableComponent.ɵfac = function QueryDetailsTableComponent_Factory(t) { return new (t || QueryDetailsTableComponent)(); };
20726
+ QueryDetailsTableComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: QueryDetailsTableComponent, selectors: [["ccd-query-details-table"]], inputs: { queryItem: "queryItem" }, decls: 1, vars: 1, consts: [[4, "ngIf"], [1, "govuk-table", "query-details-table"], [1, "govuk-table__body"], [1, "govuk-table__row"], ["scope", "row", 1, "govuk-table__header"], [1, "govuk-table__cell"], ["class", "govuk-table__row", 4, "ngIf"], [4, "ngFor", "ngForOf"], ["target", "_blank", 3, "href"]], template: function QueryDetailsTableComponent_Template(rf, ctx) {
20727
+ if (rf & 1) {
20728
+ i0__namespace.ɵɵtemplate(0, QueryDetailsTableComponent_ng_container_0_Template, 42, 31, "ng-container", 0);
20729
+ }
20730
+ if (rf & 2) {
20731
+ i0__namespace.ɵɵproperty("ngIf", ctx.queryItem);
20732
+ }
20733
+ }, directives: [i5__namespace.NgIf, i5__namespace.NgForOf], pipes: [i1__namespace.RpxTranslatePipe, i5__namespace.DatePipe], styles: [".query-details-table[_ngcontent-%COMP%] .govuk-table__header[_ngcontent-%COMP%]{width:330px}"] });
20734
+ (function () {
20735
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(QueryDetailsTableComponent, [{
20736
+ type: i0.Component,
20737
+ args: [{
20738
+ selector: 'ccd-query-details-table',
20739
+ templateUrl: './query-details-table.component.html',
20740
+ styleUrls: ['./query-details-table.component.scss']
20741
+ }]
20742
+ }], null, { queryItem: [{
20743
+ type: i0.Input
20744
+ }] });
20745
+ })();
20746
+
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();
20687
20779
  }
20688
- return QueryDetailsTableComponent;
20780
+ QueryDetailsComponent.prototype.onBack = function () {
20781
+ this.backClicked.emit(true);
20782
+ };
20783
+ return QueryDetailsComponent;
20689
20784
  }());
20690
- QueryDetailsTableComponent.ɵfac = function QueryDetailsTableComponent_Factory(t) { return new (t || QueryDetailsTableComponent)(); };
20691
- QueryDetailsTableComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: QueryDetailsTableComponent, selectors: [["ccd-query-details-table"]], inputs: { queryItem: "queryItem" }, decls: 1, vars: 1, consts: [[4, "ngIf"], [1, "govuk-table", "query-details-table"], [1, "govuk-table__body"], [1, "govuk-table__row"], ["scope", "row", 1, "govuk-table__header"], [1, "govuk-table__cell"], ["class", "govuk-table__row", 4, "ngIf"], [4, "ngFor", "ngForOf"], ["target", "_blank", 3, "href"]], template: function QueryDetailsTableComponent_Template(rf, ctx) {
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) {
20692
20787
  if (rf & 1) {
20693
- i0__namespace.ɵɵtemplate(0, QueryDetailsTableComponent_ng_container_0_Template, 42, 31, "ng-container", 0);
20788
+ i0__namespace.ɵɵtemplate(0, QueryDetailsComponent_ng_container_0_Template, 10, 7, "ng-container", 0);
20694
20789
  }
20695
20790
  if (rf & 2) {
20696
- i0__namespace.ɵɵproperty("ngIf", ctx.queryItem);
20791
+ i0__namespace.ɵɵproperty("ngIf", ctx.query);
20697
20792
  }
20698
- }, directives: [i5__namespace.NgIf, i5__namespace.NgForOf], pipes: [i1__namespace.RpxTranslatePipe, i5__namespace.DatePipe], styles: [".query-details-table[_ngcontent-%COMP%] .govuk-table__header[_ngcontent-%COMP%]{width:330px}"] });
20793
+ }, styles: [".query_details_caption[_ngcontent-%COMP%]{background:#f3f2f1;padding:10px;font-size:x-large;font-weight:700}"] });
20699
20794
  (function () {
20700
- (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(QueryDetailsTableComponent, [{
20795
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(QueryDetailsComponent, [{
20701
20796
  type: i0.Component,
20702
20797
  args: [{
20703
- selector: 'ccd-query-details-table',
20704
- templateUrl: './query-details-table.component.html',
20705
- styleUrls: ['./query-details-table.component.scss']
20798
+ selector: 'ccd-query-details',
20799
+ templateUrl: './query-details.component.html',
20800
+ styleUrls: ['./query-details.component.scss']
20706
20801
  }]
20707
- }], null, { queryItem: [{
20802
+ }], null, { query: [{
20708
20803
  type: i0.Input
20804
+ }], backClicked: [{
20805
+ type: i0.Output
20709
20806
  }] });
20710
20807
  })();
20711
20808
 
@@ -20716,6 +20813,99 @@
20716
20813
  SortOrder[SortOrder["UNSORTED"] = 2] = "UNSORTED";
20717
20814
  })(SortOrder || (SortOrder = {}));
20718
20815
 
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
+
20719
20909
  function QueryListComponent_ng_container_0_th_7_Template(rf, ctx) {
20720
20910
  if (rf & 1) {
20721
20911
  var _r5_1 = i0__namespace.ɵɵgetCurrentView();
@@ -20900,142 +21090,18 @@
20900
21090
  }] });
20901
21091
  })();
20902
21092
 
20903
- var QueryWriteDateInputComponent = /** @class */ (function () {
20904
- function QueryWriteDateInputComponent() {
20905
- this.disabled = false;
20906
- }
20907
- QueryWriteDateInputComponent.prototype.writeValue = function (date) {
20908
- if (date instanceof Date && !isNaN(date.getTime())) {
20909
- this.day = date.getDate();
20910
- this.month = date.getMonth() + 1; // Months are zero-based
20911
- this.year = date.getFullYear();
20912
- }
20913
- else {
20914
- this.day = null;
20915
- this.month = null;
20916
- this.year = null;
20917
- }
20918
- };
20919
- QueryWriteDateInputComponent.prototype.registerOnChange = function (fn) {
20920
- this.onChange = fn;
20921
- };
20922
- QueryWriteDateInputComponent.prototype.registerOnTouched = function (fn) {
20923
- this.onTouched = fn;
20924
- };
20925
- QueryWriteDateInputComponent.prototype.setDisabledState = function (isDisabled) {
20926
- this.disabled = isDisabled;
20927
- };
20928
- QueryWriteDateInputComponent.prototype.updateDate = function () {
20929
- var updatedValue = this.onChange && this.isValidDateInput() ?
20930
- new Date(this.year, this.month - 1, this.day)
20931
- : null;
20932
- this.onChange(updatedValue);
20933
- this.onTouched();
20934
- };
20935
- QueryWriteDateInputComponent.prototype.isValidDateInput = function () {
20936
- var isValidDay = this.day >= 1 && this.day <= 31;
20937
- var isValidMonth = this.month >= 1 && this.month <= 12;
20938
- var isValidYear = this.year >= 0;
20939
- return isValidDay && isValidMonth && isValidYear;
20940
- };
20941
- return QueryWriteDateInputComponent;
20942
- }());
20943
- QueryWriteDateInputComponent.ɵfac = function QueryWriteDateInputComponent_Factory(t) { return new (t || QueryWriteDateInputComponent)(); };
20944
- QueryWriteDateInputComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: QueryWriteDateInputComponent, selectors: [["ccd-query-write-date-input"]], inputs: { formControlName: "formControlName" }, features: [i0__namespace.ɵɵProvidersFeature([
20945
- {
20946
- provide: i3.NG_VALUE_ACCESSOR,
20947
- useExisting: i0.forwardRef(function () { return QueryWriteDateInputComponent; }),
20948
- multi: true
20949
- }
20950
- ])], decls: 19, vars: 24, consts: [[1, "govuk-date-input", 3, "id"], [1, "govuk-date-input__item"], [1, "govuk-form-group"], [1, "govuk-label", "govuk-date-input__label", 3, "for"], ["type", "text", "inputmode", "numeric", 1, "govuk-input", "govuk-date-input__input", "govuk-input--width-2", 3, "id", "name", "ngModel", "disabled", "ngModelChange", "input"], ["id", "formControlName + '-year'", "type", "text", "inputmode", "numeric", 1, "govuk-input", "govuk-date-input__input", "govuk-input--width-4", 3, "name", "ngModel", "disabled", "ngModelChange", "input"]], template: function QueryWriteDateInputComponent_Template(rf, ctx) {
20951
- if (rf & 1) {
20952
- i0__namespace.ɵɵelementStart(0, "div", 0);
20953
- i0__namespace.ɵɵelementStart(1, "div", 1);
20954
- i0__namespace.ɵɵelementStart(2, "div", 2);
20955
- i0__namespace.ɵɵelementStart(3, "label", 3);
20956
- i0__namespace.ɵɵtext(4);
20957
- i0__namespace.ɵɵpipe(5, "rpxTranslate");
20958
- i0__namespace.ɵɵelementEnd();
20959
- i0__namespace.ɵɵelementStart(6, "input", 4);
20960
- i0__namespace.ɵɵlistener("ngModelChange", function QueryWriteDateInputComponent_Template_input_ngModelChange_6_listener($event) { return ctx.day = $event; })("input", function QueryWriteDateInputComponent_Template_input_input_6_listener() { return ctx.updateDate(); });
20961
- i0__namespace.ɵɵelementEnd();
20962
- i0__namespace.ɵɵelementEnd();
20963
- i0__namespace.ɵɵelementEnd();
20964
- i0__namespace.ɵɵelementStart(7, "div", 1);
20965
- i0__namespace.ɵɵelementStart(8, "div", 2);
20966
- i0__namespace.ɵɵelementStart(9, "label", 3);
20967
- i0__namespace.ɵɵtext(10);
20968
- i0__namespace.ɵɵpipe(11, "rpxTranslate");
20969
- i0__namespace.ɵɵelementEnd();
20970
- i0__namespace.ɵɵelementStart(12, "input", 4);
20971
- i0__namespace.ɵɵlistener("ngModelChange", function QueryWriteDateInputComponent_Template_input_ngModelChange_12_listener($event) { return ctx.month = $event; })("input", function QueryWriteDateInputComponent_Template_input_input_12_listener() { return ctx.updateDate(); });
20972
- i0__namespace.ɵɵelementEnd();
20973
- i0__namespace.ɵɵelementEnd();
20974
- i0__namespace.ɵɵelementEnd();
20975
- i0__namespace.ɵɵelementStart(13, "div", 1);
20976
- i0__namespace.ɵɵelementStart(14, "div", 2);
20977
- i0__namespace.ɵɵelementStart(15, "label", 3);
20978
- i0__namespace.ɵɵtext(16);
20979
- i0__namespace.ɵɵpipe(17, "rpxTranslate");
20980
- i0__namespace.ɵɵelementEnd();
20981
- i0__namespace.ɵɵelementStart(18, "input", 5);
20982
- i0__namespace.ɵɵlistener("ngModelChange", function QueryWriteDateInputComponent_Template_input_ngModelChange_18_listener($event) { return ctx.year = $event; })("input", function QueryWriteDateInputComponent_Template_input_input_18_listener() { return ctx.updateDate(); });
20983
- i0__namespace.ɵɵelementEnd();
20984
- i0__namespace.ɵɵelementEnd();
20985
- i0__namespace.ɵɵelementEnd();
20986
- i0__namespace.ɵɵelementEnd();
20987
- }
20988
- if (rf & 2) {
20989
- i0__namespace.ɵɵproperty("id", ctx.formControlName);
20990
- i0__namespace.ɵɵadvance(3);
20991
- i0__namespace.ɵɵproperty("for", ctx.formControlName + "-day");
20992
- i0__namespace.ɵɵadvance(1);
20993
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(5, 18, "Day"), " ");
20994
- i0__namespace.ɵɵadvance(2);
20995
- i0__namespace.ɵɵproperty("id", ctx.formControlName + "-day")("name", ctx.formControlName + "-day")("ngModel", ctx.day)("disabled", ctx.disabled);
20996
- i0__namespace.ɵɵadvance(3);
20997
- i0__namespace.ɵɵproperty("for", ctx.formControlName + "-month");
20998
- i0__namespace.ɵɵadvance(1);
20999
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(11, 20, "Month"), " ");
21000
- i0__namespace.ɵɵadvance(2);
21001
- i0__namespace.ɵɵproperty("id", ctx.formControlName + "-month")("name", ctx.formControlName + "-month")("ngModel", ctx.month)("disabled", ctx.disabled);
21002
- i0__namespace.ɵɵadvance(3);
21003
- i0__namespace.ɵɵproperty("for", ctx.formControlName + "-year");
21004
- i0__namespace.ɵɵadvance(1);
21005
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(17, 22, "Year"), " ");
21006
- i0__namespace.ɵɵadvance(2);
21007
- i0__namespace.ɵɵproperty("name", ctx.formControlName + "-year")("ngModel", ctx.year)("disabled", ctx.disabled);
21008
- }
21009
- }, directives: [i3__namespace.DefaultValueAccessor, i3__namespace.NgControlStatus, i3__namespace.NgModel], pipes: [i1__namespace.RpxTranslatePipe], encapsulation: 2 });
21010
- (function () {
21011
- (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(QueryWriteDateInputComponent, [{
21012
- type: i0.Component,
21013
- args: [{
21014
- selector: 'ccd-query-write-date-input',
21015
- templateUrl: './query-write-date-input.component.html',
21016
- providers: [
21017
- {
21018
- provide: i3.NG_VALUE_ACCESSOR,
21019
- useExisting: i0.forwardRef(function () { return QueryWriteDateInputComponent; }),
21020
- multi: true
21021
- }
21022
- ]
21023
- }]
21024
- }], null, { formControlName: [{
21025
- type: i0.Input
21026
- }] });
21027
- })();
21028
-
21029
21093
  var QueryWriteAddDocumentsComponent = /** @class */ (function () {
21030
21094
  function QueryWriteAddDocumentsComponent() {
21031
21095
  this.documentFormGroup = new i3.FormGroup({});
21032
21096
  this.documentCollectionUpdate = new i0.EventEmitter();
21097
+ }
21098
+ QueryWriteAddDocumentsComponent.prototype.ngOnInit = function () {
21099
+ var _a;
21033
21100
  // This field is mocked to allow the document component to be used in isolation
21034
21101
  this.mockDocumentCaseField = Object.assign(new CaseField(), {
21035
21102
  id: QueryWriteAddDocumentsComponent.DOCUMENTS_FORM_CONTROL_NAME,
21036
- label: 'Add document',
21103
+ label: 'Add document (optional)',
21037
21104
  hint_text: 'Attach a document to this message',
21038
- display_context: 'OPTIONAL',
21039
21105
  display_context_parameter: '#COLLECTION(allowInsert,allowUpdate)',
21040
21106
  field_type: Object.assign(new FieldType(), {
21041
21107
  id: 'queryDocuments',
@@ -21057,12 +21123,13 @@
21057
21123
  })
21058
21124
  }),
21059
21125
  });
21060
- }
21126
+ this.mockDocumentCaseField.value = (_a = this.formGroup.get('attachments')) === null || _a === void 0 ? void 0 : _a.value.map(QueryManagementUtils.documentToCollectionFormDocument);
21127
+ };
21061
21128
  QueryWriteAddDocumentsComponent.prototype.ngAfterViewInit = function () {
21062
21129
  var _this = this;
21063
- var formControl = this.documentFormGroup.get(QueryWriteAddDocumentsComponent.DOCUMENTS_FORM_CONTROL_NAME);
21064
- if (formControl) {
21065
- this.documentFormControlSubscription = formControl.valueChanges
21130
+ var documentFormControl = this.documentFormGroup.get(QueryWriteAddDocumentsComponent.DOCUMENTS_FORM_CONTROL_NAME);
21131
+ if (documentFormControl) {
21132
+ this.documentFormControlSubscription = documentFormControl.valueChanges
21066
21133
  .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); }))
21067
21134
  .subscribe();
21068
21135
  }
@@ -21075,7 +21142,7 @@
21075
21142
  }());
21076
21143
  QueryWriteAddDocumentsComponent.DOCUMENTS_FORM_CONTROL_NAME = 'documentCollection';
21077
21144
  QueryWriteAddDocumentsComponent.ɵfac = function QueryWriteAddDocumentsComponent_Factory(t) { return new (t || QueryWriteAddDocumentsComponent)(); };
21078
- 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) {
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) {
21079
21146
  if (rf & 1) {
21080
21147
  i0__namespace.ɵɵelement(0, "ccd-write-collection-field", 0);
21081
21148
  }
@@ -21090,15 +21157,17 @@
21090
21157
  selector: 'ccd-query-write-add-documents',
21091
21158
  templateUrl: './query-write-add-documents.component.html'
21092
21159
  }]
21093
- }], function () { return []; }, { documentCollectionUpdate: [{
21160
+ }], null, { formGroup: [{
21161
+ type: i0.Input
21162
+ }], documentCollectionUpdate: [{
21094
21163
  type: i0.Output
21095
21164
  }] });
21096
21165
  })();
21097
21166
 
21098
21167
  function QueryWriteRaiseQueryComponent_p_22_Template(rf, ctx) {
21099
21168
  if (rf & 1) {
21100
- i0__namespace.ɵɵelementStart(0, "p", 28);
21101
- i0__namespace.ɵɵelementStart(1, "span", 29);
21169
+ i0__namespace.ɵɵelementStart(0, "p", 27);
21170
+ i0__namespace.ɵɵelementStart(1, "span", 28);
21102
21171
  i0__namespace.ɵɵtext(2);
21103
21172
  i0__namespace.ɵɵpipe(3, "rpxTranslate");
21104
21173
  i0__namespace.ɵɵelementEnd();
@@ -21115,8 +21184,8 @@
21115
21184
  }
21116
21185
  function QueryWriteRaiseQueryComponent_p_32_Template(rf, ctx) {
21117
21186
  if (rf & 1) {
21118
- i0__namespace.ɵɵelementStart(0, "p", 30);
21119
- i0__namespace.ɵɵelementStart(1, "span", 29);
21187
+ i0__namespace.ɵɵelementStart(0, "p", 29);
21188
+ i0__namespace.ɵɵelementStart(1, "span", 28);
21120
21189
  i0__namespace.ɵɵtext(2);
21121
21190
  i0__namespace.ɵɵpipe(3, "rpxTranslate");
21122
21191
  i0__namespace.ɵɵelementEnd();
@@ -21133,8 +21202,8 @@
21133
21202
  }
21134
21203
  function QueryWriteRaiseQueryComponent_p_42_Template(rf, ctx) {
21135
21204
  if (rf & 1) {
21136
- i0__namespace.ɵɵelementStart(0, "p", 31);
21137
- i0__namespace.ɵɵelementStart(1, "span", 29);
21205
+ i0__namespace.ɵɵelementStart(0, "p", 30);
21206
+ i0__namespace.ɵɵelementStart(1, "span", 28);
21138
21207
  i0__namespace.ɵɵtext(2);
21139
21208
  i0__namespace.ɵɵpipe(3, "rpxTranslate");
21140
21209
  i0__namespace.ɵɵelementEnd();
@@ -21149,34 +21218,13 @@
21149
21218
  i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(5, 4, "Enter a query body"), " ");
21150
21219
  }
21151
21220
  }
21152
- function QueryWriteRaiseQueryComponent_ng_container_62_Template(rf, ctx) {
21153
- if (rf & 1) {
21154
- i0__namespace.ɵɵelementContainerStart(0);
21155
- i0__namespace.ɵɵelementStart(1, "div", 32);
21156
- i0__namespace.ɵɵelementStart(2, "fieldset", 33);
21157
- i0__namespace.ɵɵelementStart(3, "legend");
21158
- i0__namespace.ɵɵelementStart(4, "label", 34);
21159
- i0__namespace.ɵɵtext(5);
21160
- i0__namespace.ɵɵpipe(6, "rpxTranslate");
21161
- i0__namespace.ɵɵelementEnd();
21162
- i0__namespace.ɵɵelementEnd();
21163
- i0__namespace.ɵɵelement(7, "ccd-query-write-date-input", 35);
21164
- i0__namespace.ɵɵelementEnd();
21165
- i0__namespace.ɵɵelementEnd();
21166
- i0__namespace.ɵɵelementContainerEnd();
21167
- }
21168
- if (rf & 2) {
21169
- i0__namespace.ɵɵadvance(5);
21170
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(6, 1, "Hearing date"), " ");
21171
- }
21172
- }
21173
21221
  var QueryWriteRaiseQueryComponent = /** @class */ (function () {
21174
21222
  function QueryWriteRaiseQueryComponent() {
21175
21223
  }
21176
21224
  return QueryWriteRaiseQueryComponent;
21177
21225
  }());
21178
21226
  QueryWriteRaiseQueryComponent.ɵfac = function QueryWriteRaiseQueryComponent_Factory(t) { return new (t || QueryWriteRaiseQueryComponent)(); };
21179
- QueryWriteRaiseQueryComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: QueryWriteRaiseQueryComponent, selectors: [["ccd-query-write-raise-query"]], inputs: { formGroup: "formGroup" }, decls: 63, vars: 61, consts: [[1, "govuk-!-margin-bottom-6"], [1, "govuk-caption-l"], [1, "govuk-heading-l", "govuk-!-margin-bottom-4"], [1, "govuk-!-margin-bottom-4"], [3, "formGroup"], [1, "govuk-form-group"], [1, "govuk-label-wrapper"], ["for", "query-raise-fullName", 1, "govuk-label", "govuk-label--m", "govuk-!-font-weight-bold"], ["id", "query-raise-fullName-hint", 1, "govuk-hint"], ["id", "query-raise-fullName-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "query-raise-fullName", "name", "query-raise-fullName", "type", "text", 1, "govuk-input", 3, "formControlName"], ["for", "query-raise-subject", 1, "govuk-label", "govuk-label--m", "govuk-!-font-weight-bold"], ["id", "query-raise-subject-hint", 1, "govuk-hint"], ["id", "query-raise-subject-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "query-raise-subject", "name", "query-raise-subject", "type", "text", 1, "govuk-input", 3, "formControlName"], ["for", "query-raise-body", 1, "govuk-label", "govuk-label--m", "govuk-!-font-weight-bold"], ["id", "query-raise-body-hint", 1, "govuk-hint"], ["id", "query-raise-body-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "query-raise-body", "name", "query-body", "rows", "5", "aria-describedby", "query-body-hint query-body-error", 1, "govuk-textarea", 3, "formControlName"], [1, "govuk-fieldset"], [1, "govuk-label", "govuk-label--m", "govuk-!-font-weight-bold"], ["data-module", "govuk-radios", 1, "govuk-radios", "govuk-radios--inline"], [1, "govuk-radios__item"], ["id", "query-raise-isHearingRelated-yes", "name", "query-raise-isHearingRelated-yes", "type", "radio", 1, "govuk-radios__input", 3, "checked", "value"], ["for", "query-raise-isHearingRelated-yes", 1, "govuk-label", "govuk-radios__label"], ["id", "query-raise-isHearingRelated-no", "name", "query-raise-isHearingRelated-no", "type", "radio", 1, "govuk-radios__input", 3, "checked", "value"], ["for", "query-raise-isHearingRelated-no", 1, "govuk-label", "govuk-radios__label"], [4, "ngIf"], ["id", "query-raise-fullName-error", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "query-raise-subject-error", 1, "govuk-error-message"], ["id", "query-raise-body-error", 1, "govuk-error-message"], [1, "govuk-!-margin-top-1"], ["role", "group", 1, "govuk-fieldset"], [1, "govuk-label", "govuk-label--s"], ["formControlName", "hearingDate"]], template: function QueryWriteRaiseQueryComponent_Template(rf, ctx) {
21227
+ QueryWriteRaiseQueryComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: QueryWriteRaiseQueryComponent, selectors: [["ccd-query-write-raise-query"]], inputs: { formGroup: "formGroup" }, decls: 62, vars: 60, consts: [[1, "govuk-!-margin-bottom-6"], [1, "govuk-caption-l"], [1, "govuk-heading-l", "govuk-!-margin-bottom-4"], [1, "govuk-!-margin-bottom-4"], [3, "formGroup"], [1, "govuk-form-group"], [1, "govuk-label-wrapper"], ["for", "query-raise-fullName", 1, "govuk-label", "govuk-label--m", "govuk-!-font-weight-bold"], ["id", "query-raise-fullName-hint", 1, "govuk-hint"], ["id", "query-raise-fullName-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "query-raise-fullName", "name", "query-raise-fullName", "type", "text", 1, "govuk-input", 3, "formControlName"], ["for", "query-raise-subject", 1, "govuk-label", "govuk-label--m", "govuk-!-font-weight-bold"], ["id", "query-raise-subject-hint", 1, "govuk-hint"], ["id", "query-raise-subject-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "query-raise-subject", "name", "query-raise-subject", "type", "text", 1, "govuk-input", 3, "formControlName"], ["for", "query-raise-body", 1, "govuk-label", "govuk-label--m", "govuk-!-font-weight-bold"], ["id", "query-raise-body-hint", 1, "govuk-hint"], ["id", "query-raise-body-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "query-raise-body", "name", "query-body", "rows", "5", "aria-describedby", "query-body-hint query-body-error", 1, "govuk-textarea", 3, "formControlName"], [1, "govuk-fieldset"], [1, "govuk-label", "govuk-label--m", "govuk-!-font-weight-bold"], ["data-module", "govuk-radios", 1, "govuk-radios", "govuk-radios--inline"], [1, "govuk-radios__item"], ["id", "query-raise-isHearingRelated-yes", "name", "query-raise-isHearingRelated-yes", "type", "radio", 1, "govuk-radios__input", 3, "checked", "value"], ["for", "query-raise-isHearingRelated-yes", 1, "govuk-label", "govuk-radios__label"], ["id", "query-raise-isHearingRelated-no", "name", "query-raise-isHearingRelated-no", "type", "radio", 1, "govuk-radios__input", 3, "checked", "value"], ["for", "query-raise-isHearingRelated-no", 1, "govuk-label", "govuk-radios__label"], ["id", "query-raise-fullName-error", 1, "govuk-error-message"], [1, "govuk-visually-hidden"], ["id", "query-raise-subject-error", 1, "govuk-error-message"], ["id", "query-raise-body-error", 1, "govuk-error-message"]], template: function QueryWriteRaiseQueryComponent_Template(rf, ctx) {
21180
21228
  if (rf & 1) {
21181
21229
  i0__namespace.ɵɵelementStart(0, "div");
21182
21230
  i0__namespace.ɵɵelementStart(1, "div", 0);
@@ -21265,7 +21313,6 @@
21265
21313
  i0__namespace.ɵɵelementEnd();
21266
21314
  i0__namespace.ɵɵelementEnd();
21267
21315
  i0__namespace.ɵɵelementEnd();
21268
- i0__namespace.ɵɵtemplate(62, QueryWriteRaiseQueryComponent_ng_container_62_Template, 8, 3, "ng-container", 27);
21269
21316
  i0__namespace.ɵɵelementEnd();
21270
21317
  i0__namespace.ɵɵelementEnd();
21271
21318
  i0__namespace.ɵɵelementEnd();
@@ -21283,17 +21330,17 @@
21283
21330
  var tmp_18_0 = null;
21284
21331
  var tmp_19_0 = null;
21285
21332
  i0__namespace.ɵɵadvance(3);
21286
- i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind1(4, 35, "Raise a query"));
21333
+ i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind1(4, 34, "Raise a query"));
21287
21334
  i0__namespace.ɵɵadvance(3);
21288
- i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind1(7, 37, "Enter query details"));
21335
+ i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind1(7, 36, "Enter query details"));
21289
21336
  i0__namespace.ɵɵadvance(6);
21290
21337
  i0__namespace.ɵɵproperty("formGroup", ctx.formGroup);
21291
21338
  i0__namespace.ɵɵadvance(2);
21292
21339
  i0__namespace.ɵɵclassProp("govuk-form-group--error", (tmp_3_0 = ctx.formGroup.get("fullName")) == null ? null : tmp_3_0.errors == null ? null : tmp_3_0.errors.length);
21293
21340
  i0__namespace.ɵɵadvance(3);
21294
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(18, 39, "Full name"), " ");
21341
+ i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(18, 38, "Full name"), " ");
21295
21342
  i0__namespace.ɵɵadvance(3);
21296
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(21, 41, "Your full name must be included here"), " ");
21343
+ i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(21, 40, "Your full name must be included here"), " ");
21297
21344
  i0__namespace.ɵɵadvance(2);
21298
21345
  i0__namespace.ɵɵproperty("ngIf", (tmp_6_0 = ctx.formGroup.get("body")) == null ? null : tmp_6_0.errors == null ? null : tmp_6_0.errors.length);
21299
21346
  i0__namespace.ɵɵadvance(1);
@@ -21302,9 +21349,9 @@
21302
21349
  i0__namespace.ɵɵadvance(1);
21303
21350
  i0__namespace.ɵɵclassProp("govuk-form-group--error", (tmp_9_0 = ctx.formGroup.get("subject")) == null ? null : tmp_9_0.errors == null ? null : tmp_9_0.errors.length);
21304
21351
  i0__namespace.ɵɵadvance(3);
21305
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(28, 43, "Query subject"), " ");
21352
+ i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(28, 42, "Query subject"), " ");
21306
21353
  i0__namespace.ɵɵadvance(3);
21307
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(31, 45, "The subject should be a summary of your query"), " ");
21354
+ i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(31, 44, "The subject should be a summary of your query"), " ");
21308
21355
  i0__namespace.ɵɵadvance(2);
21309
21356
  i0__namespace.ɵɵproperty("ngIf", (tmp_12_0 = ctx.formGroup.get("body")) == null ? null : tmp_12_0.errors == null ? null : tmp_12_0.errors.length);
21310
21357
  i0__namespace.ɵɵadvance(1);
@@ -21313,26 +21360,24 @@
21313
21360
  i0__namespace.ɵɵadvance(1);
21314
21361
  i0__namespace.ɵɵclassProp("govuk-form-group--error", (tmp_15_0 = ctx.formGroup.get("body")) == null ? null : tmp_15_0.errors == null ? null : tmp_15_0.errors.length);
21315
21362
  i0__namespace.ɵɵadvance(3);
21316
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(38, 47, "Query body"), " ");
21363
+ i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(38, 46, "Query body"), " ");
21317
21364
  i0__namespace.ɵɵadvance(3);
21318
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(41, 49, "Include as many details as possible so case workers can respond to your query"), " ");
21365
+ i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(41, 48, "Include as many details as possible so case workers can respond to your query"), " ");
21319
21366
  i0__namespace.ɵɵadvance(2);
21320
21367
  i0__namespace.ɵɵproperty("ngIf", (tmp_18_0 = ctx.formGroup.get("body")) == null ? null : tmp_18_0.errors == null ? null : tmp_18_0.errors.length);
21321
21368
  i0__namespace.ɵɵadvance(1);
21322
21369
  i0__namespace.ɵɵclassProp("govuk-textarea--error", (tmp_19_0 = ctx.formGroup.get("body")) == null ? null : tmp_19_0.errors == null ? null : tmp_19_0.errors.length);
21323
21370
  i0__namespace.ɵɵproperty("formControlName", "body");
21324
21371
  i0__namespace.ɵɵadvance(6);
21325
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(50, 51, "Is the query hearing related?"), " ");
21372
+ i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(50, 50, "Is the query hearing related?"), " ");
21326
21373
  i0__namespace.ɵɵadvance(4);
21327
21374
  i0__namespace.ɵɵproperty("checked", ctx.formGroup.get("isHearingRelated").value === true)("value", true);
21328
21375
  i0__namespace.ɵɵadvance(2);
21329
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind3(56, 53, "Is the query hearing related?", null, "Yes"), " ");
21376
+ i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind3(56, 52, "Is the query hearing related?", null, "Yes"), " ");
21330
21377
  i0__namespace.ɵɵadvance(3);
21331
21378
  i0__namespace.ɵɵproperty("checked", ctx.formGroup.get("isHearingRelated").value === false)("value", false);
21332
21379
  i0__namespace.ɵɵadvance(2);
21333
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind3(61, 57, "Is the query hearing related?", null, "No"), " ");
21334
- i0__namespace.ɵɵadvance(2);
21335
- i0__namespace.ɵɵproperty("ngIf", ctx.formGroup.get("isHearingRelated").value);
21380
+ i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind3(61, 56, "Is the query hearing related?", null, "No"), " ");
21336
21381
  }
21337
21382
  }, encapsulation: 2 });
21338
21383
  (function () {
@@ -21347,7 +21392,7 @@
21347
21392
  }] });
21348
21393
  })();
21349
21394
 
21350
- function QueryWriteRespondToQueryComponent_p_26_Template(rf, ctx) {
21395
+ function QueryWriteRespondToQueryComponent_p_27_Template(rf, ctx) {
21351
21396
  if (rf & 1) {
21352
21397
  i0__namespace.ɵɵelementStart(0, "p", 15);
21353
21398
  i0__namespace.ɵɵelementStart(1, "span", 16);
@@ -21371,7 +21416,7 @@
21371
21416
  return QueryWriteRespondToQueryComponent;
21372
21417
  }());
21373
21418
  QueryWriteRespondToQueryComponent.ɵfac = function QueryWriteRespondToQueryComponent_Factory(t) { return new (t || QueryWriteRespondToQueryComponent)(); };
21374
- QueryWriteRespondToQueryComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: QueryWriteRespondToQueryComponent, selectors: [["ccd-query-write-respond-to-query"]], inputs: { queryItem: "queryItem", formGroup: "formGroup" }, decls: 29, vars: 23, consts: [[1, "govuk-!-margin-bottom-2"], ["href", "javascript:void(0)", 1, "govuk-back-link", "govuk-!-margin-top-0"], [1, "govuk-!-margin-bottom-6"], [1, "govuk-caption-l"], [1, "govuk-heading-l", "govuk-!-margin-bottom-0"], [1, "govuk-!-margin-bottom-4"], [3, "queryItem"], [1, "query-respond"], [1, "govuk-heading-m"], [3, "formGroup"], [1, "govuk-form-group", "body-textarea"], [1, "govuk-label-wrapper"], ["for", "query-body", 1, "govuk-label", "govuk-!-font-weight-bold"], ["id", "query-body-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "query-body", "name", "query-body", "rows", "5", "aria-describedby", "query-body-hint query-body-error", 1, "govuk-textarea", 3, "formControlName"], ["id", "query-body-error", 1, "govuk-error-message"], [1, "govuk-visually-hidden"]], template: function QueryWriteRespondToQueryComponent_Template(rf, ctx) {
21419
+ QueryWriteRespondToQueryComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: QueryWriteRespondToQueryComponent, selectors: [["ccd-query-write-respond-to-query"]], inputs: { queryItem: "queryItem", formGroup: "formGroup" }, decls: 30, vars: 23, consts: [[1, "govuk-!-margin-bottom-2"], ["href", "javascript:void(0)", 1, "govuk-back-link", "govuk-!-margin-top-0"], [1, "govuk-!-margin-bottom-6"], [1, "govuk-caption-l"], [1, "govuk-heading-l", "govuk-!-margin-bottom-0"], [1, "govuk-!-margin-bottom-4"], [3, "queryItem"], [1, "query-respond"], [1, "govuk-heading-m"], [3, "formGroup"], [1, "govuk-form-group", "body-textarea"], [1, "govuk-label-wrapper"], ["for", "query-body", 1, "govuk-label", "govuk-!-font-weight-bold"], ["id", "query-body-error", "class", "govuk-error-message", 4, "ngIf"], ["id", "query-body", "name", "query-body", "rows", "5", "aria-describedby", "query-body-hint query-body-error", 1, "govuk-textarea", 3, "formControlName"], ["id", "query-body-error", 1, "govuk-error-message"], [1, "govuk-visually-hidden"]], template: function QueryWriteRespondToQueryComponent_Template(rf, ctx) {
21375
21420
  if (rf & 1) {
21376
21421
  i0__namespace.ɵɵelementStart(0, "div", 0);
21377
21422
  i0__namespace.ɵɵelementStart(1, "a", 1);
@@ -21398,21 +21443,23 @@
21398
21443
  i0__namespace.ɵɵelementEnd();
21399
21444
  i0__namespace.ɵɵelementEnd();
21400
21445
  i0__namespace.ɵɵelementStart(16, "div", 7);
21401
- i0__namespace.ɵɵelementStart(17, "h1", 8);
21402
- i0__namespace.ɵɵtext(18);
21403
- i0__namespace.ɵɵpipe(19, "rpxTranslate");
21446
+ i0__namespace.ɵɵelementStart(17, "div", 5);
21447
+ i0__namespace.ɵɵelementStart(18, "h1", 8);
21448
+ i0__namespace.ɵɵtext(19);
21449
+ i0__namespace.ɵɵpipe(20, "rpxTranslate");
21450
+ i0__namespace.ɵɵelementEnd();
21451
+ i0__namespace.ɵɵelementStart(21, "div", 9);
21452
+ i0__namespace.ɵɵelementStart(22, "div", 10);
21453
+ i0__namespace.ɵɵelementStart(23, "div", 11);
21454
+ i0__namespace.ɵɵelementStart(24, "label", 12);
21455
+ i0__namespace.ɵɵtext(25);
21456
+ i0__namespace.ɵɵpipe(26, "rpxTranslate");
21404
21457
  i0__namespace.ɵɵelementEnd();
21405
- i0__namespace.ɵɵelementStart(20, "div", 9);
21406
- i0__namespace.ɵɵelementStart(21, "div", 10);
21407
- i0__namespace.ɵɵelementStart(22, "div", 11);
21408
- i0__namespace.ɵɵelementStart(23, "label", 12);
21409
- i0__namespace.ɵɵtext(24);
21410
- i0__namespace.ɵɵpipe(25, "rpxTranslate");
21411
21458
  i0__namespace.ɵɵelementEnd();
21459
+ i0__namespace.ɵɵtemplate(27, QueryWriteRespondToQueryComponent_p_27_Template, 6, 6, "p", 13);
21460
+ i0__namespace.ɵɵelementStart(28, "textarea", 14);
21461
+ i0__namespace.ɵɵtext(29, " ");
21412
21462
  i0__namespace.ɵɵelementEnd();
21413
- i0__namespace.ɵɵtemplate(26, QueryWriteRespondToQueryComponent_p_26_Template, 6, 6, "p", 13);
21414
- i0__namespace.ɵɵelementStart(27, "textarea", 14);
21415
- i0__namespace.ɵɵtext(28, " ");
21416
21463
  i0__namespace.ɵɵelementEnd();
21417
21464
  i0__namespace.ɵɵelementEnd();
21418
21465
  i0__namespace.ɵɵelementEnd();
@@ -21430,14 +21477,14 @@
21430
21477
  i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind1(11, 17, "Query details"));
21431
21478
  i0__namespace.ɵɵadvance(5);
21432
21479
  i0__namespace.ɵɵproperty("queryItem", ctx.queryItem);
21433
- i0__namespace.ɵɵadvance(3);
21434
- i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind1(19, 19, "Respond to a query"));
21480
+ i0__namespace.ɵɵadvance(4);
21481
+ i0__namespace.ɵɵtextInterpolate(i0__namespace.ɵɵpipeBind1(20, 19, "Respond to a query"));
21435
21482
  i0__namespace.ɵɵadvance(2);
21436
21483
  i0__namespace.ɵɵproperty("formGroup", ctx.formGroup);
21437
21484
  i0__namespace.ɵɵadvance(1);
21438
21485
  i0__namespace.ɵɵclassProp("govuk-form-group--error", (tmp_6_0 = ctx.formGroup.get("body")) == null ? null : tmp_6_0.errors == null ? null : tmp_6_0.errors.length);
21439
21486
  i0__namespace.ɵɵadvance(3);
21440
- i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(25, 21, "Response message"), " ");
21487
+ i0__namespace.ɵɵtextInterpolate1(" ", i0__namespace.ɵɵpipeBind1(26, 21, "Response message"), " ");
21441
21488
  i0__namespace.ɵɵadvance(2);
21442
21489
  i0__namespace.ɵɵproperty("ngIf", (tmp_8_0 = ctx.formGroup.get("body")) == null ? null : tmp_8_0.errors == null ? null : tmp_8_0.errors.length);
21443
21490
  i0__namespace.ɵɵadvance(1);
@@ -21460,21 +21507,6 @@
21460
21507
  }] });
21461
21508
  })();
21462
21509
 
21463
- var QueryManagementUtils = /** @class */ (function () {
21464
- function QueryManagementUtils() {
21465
- }
21466
- QueryManagementUtils.extractCaseQueriesFromCaseField = function () {
21467
- };
21468
- return QueryManagementUtils;
21469
- }());
21470
- QueryManagementUtils.ɵfac = function QueryManagementUtils_Factory(t) { return new (t || QueryManagementUtils)(); };
21471
- QueryManagementUtils.ɵprov = i0__namespace.ɵɵdefineInjectable({ token: QueryManagementUtils, factory: QueryManagementUtils.ɵfac });
21472
- (function () {
21473
- (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(QueryManagementUtils, [{
21474
- type: i0.Injectable
21475
- }], null, null);
21476
- })();
21477
-
21478
21510
  function ReadQueryManagementFieldComponent_ng_container_1_div_1_Template(rf, ctx) {
21479
21511
  if (rf & 1) {
21480
21512
  var _r5_1 = i0__namespace.ɵɵgetCurrentView();
@@ -21592,9 +21624,24 @@
21592
21624
  __extends(WriteQueryManagementFieldComponent, _super);
21593
21625
  function WriteQueryManagementFieldComponent() {
21594
21626
  var _this = _super.call(this) || this;
21595
- _this.formGroup = new i3.FormGroup({});
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;
21596
21633
  return _this;
21597
21634
  }
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
+ };
21598
21645
  return WriteQueryManagementFieldComponent;
21599
21646
  }(AbstractFieldReadComponent));
21600
21647
  WriteQueryManagementFieldComponent.ɵfac = function WriteQueryManagementFieldComponent_Factory(t) { return new (t || WriteQueryManagementFieldComponent)(); };
@@ -29370,8 +29417,8 @@
29370
29417
  QueryWriteRespondToQueryComponent,
29371
29418
  QueryWriteRaiseQueryComponent,
29372
29419
  QueryCaseDetailsHeaderComponent,
29420
+ QueryCheckYourAnswersComponent,
29373
29421
  QueryWriteAddDocumentsComponent,
29374
- QueryWriteDateInputComponent
29375
29422
  ];
29376
29423
  var PaletteModule = /** @class */ (function () {
29377
29424
  function PaletteModule() {
@@ -29557,8 +29604,8 @@
29557
29604
  QueryWriteRespondToQueryComponent,
29558
29605
  QueryWriteRaiseQueryComponent,
29559
29606
  QueryCaseDetailsHeaderComponent,
29560
- QueryWriteAddDocumentsComponent,
29561
- QueryWriteDateInputComponent], imports: [i5.CommonModule,
29607
+ QueryCheckYourAnswersComponent,
29608
+ QueryWriteAddDocumentsComponent], imports: [i5.CommonModule,
29562
29609
  i1$1.RouterModule,
29563
29610
  i3.FormsModule,
29564
29611
  i3.ReactiveFormsModule,
@@ -29705,8 +29752,8 @@
29705
29752
  QueryWriteRespondToQueryComponent,
29706
29753
  QueryWriteRaiseQueryComponent,
29707
29754
  QueryCaseDetailsHeaderComponent,
29708
- QueryWriteAddDocumentsComponent,
29709
- QueryWriteDateInputComponent] });
29755
+ QueryCheckYourAnswersComponent,
29756
+ QueryWriteAddDocumentsComponent] });
29710
29757
  })();
29711
29758
  (function () {
29712
29759
  (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(PaletteModule, [{
@@ -29852,7 +29899,8 @@
29852
29899
  i0__namespace.ɵɵsetComponentScope(QueryDetailsComponent, [i5__namespace.NgIf, QueryDetailsTableComponent], [i1__namespace.RpxTranslatePipe]);
29853
29900
  i0__namespace.ɵɵsetComponentScope(QueryWriteRespondToQueryComponent, [QueryCaseDetailsHeaderComponent,
29854
29901
  QueryDetailsTableComponent, i3__namespace.NgControlStatusGroup, i3__namespace.FormGroupDirective, i5__namespace.NgIf, i3__namespace.DefaultValueAccessor, i3__namespace.NgControlStatus, i3__namespace.FormControlName], [i1__namespace.RpxTranslatePipe]);
29855
- i0__namespace.ɵɵsetComponentScope(QueryWriteRaiseQueryComponent, [QueryCaseDetailsHeaderComponent, i3__namespace.NgControlStatusGroup, i3__namespace.FormGroupDirective, i5__namespace.NgIf, i3__namespace.DefaultValueAccessor, i3__namespace.NgControlStatus, i3__namespace.FormControlName, QueryWriteDateInputComponent], [i1__namespace.RpxTranslatePipe]);
29902
+ 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]);
29856
29904
  i0__namespace.ɵɵsetComponentScope(QueryWriteAddDocumentsComponent, [WriteCollectionFieldComponent, i3__namespace.NgControlStatusGroup, i3__namespace.FormGroupDirective], []);
29857
29905
 
29858
29906
  var Confirmation = /** @class */ (function () {
@@ -40470,6 +40518,7 @@
40470
40518
  exports.ProfileNotifier = ProfileNotifier;
40471
40519
  exports.ProfileService = ProfileService;
40472
40520
  exports.QueryCaseDetailsHeaderComponent = QueryCaseDetailsHeaderComponent;
40521
+ exports.QueryCheckYourAnswersComponent = QueryCheckYourAnswersComponent;
40473
40522
  exports.QueryCreateComponent = QueryCreateComponent;
40474
40523
  exports.QueryDetailsComponent = QueryDetailsComponent;
40475
40524
  exports.QueryDetailsTableComponent = QueryDetailsTableComponent;
@@ -40477,7 +40526,6 @@
40477
40526
  exports.QueryListData = QueryListData;
40478
40527
  exports.QueryListItem = QueryListItem;
40479
40528
  exports.QueryWriteAddDocumentsComponent = QueryWriteAddDocumentsComponent;
40480
- exports.QueryWriteDateInputComponent = QueryWriteDateInputComponent;
40481
40529
  exports.QueryWriteRaiseQueryComponent = QueryWriteRaiseQueryComponent;
40482
40530
  exports.QueryWriteRespondToQueryComponent = QueryWriteRespondToQueryComponent;
40483
40531
  exports.ReadCaseFlagFieldComponent = ReadCaseFlagFieldComponent;
@@ -40590,6 +40638,7 @@
40590
40638
  exports.WriteYesNoFieldComponent = WriteYesNoFieldComponent;
40591
40639
  exports.YesNoService = YesNoService;
40592
40640
  exports.aCaseField = aCaseField;
40641
+ exports.caseFieldMockData = caseFieldMockData;
40593
40642
  exports.createACL = createACL;
40594
40643
  exports.createCaseEventTrigger = createCaseEventTrigger;
40595
40644
  exports.createCaseField = createCaseField;