@hmcts/ccd-case-ui-toolkit 7.2.35-multiple-followup → 7.2.35

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 (27) hide show
  1. package/esm2022/lib/app.config.mjs +1 -2
  2. package/esm2022/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.mjs +2 -5
  3. package/esm2022/lib/shared/components/palette/query-management/components/query-details/query-details.component.mjs +8 -55
  4. package/esm2022/lib/shared/components/palette/query-management/models/case-queries-collection.model.mjs +1 -1
  5. package/esm2022/lib/shared/components/palette/query-management/models/query-list/query-list-item/query-list-item.model.mjs +7 -43
  6. package/esm2022/lib/shared/components/palette/query-management/read-query-management-field.component.mjs +24 -77
  7. package/esm2022/lib/shared/components/palette/query-management/services/query-management.service.mjs +2 -2
  8. package/esm2022/lib/shared/components/palette/query-management/utils/query-management.utils.mjs +4 -12
  9. package/esm2022/lib/shared/utils.mjs +1 -1
  10. package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs +40 -179
  11. package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
  12. package/lib/app.config.d.ts +0 -2
  13. package/lib/app.config.d.ts.map +1 -1
  14. package/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.d.ts +1 -2
  15. package/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.d.ts.map +1 -1
  16. package/lib/shared/components/palette/query-management/components/query-details/query-details.component.d.ts +3 -15
  17. package/lib/shared/components/palette/query-management/components/query-details/query-details.component.d.ts.map +1 -1
  18. package/lib/shared/components/palette/query-management/models/case-queries-collection.model.d.ts +0 -1
  19. package/lib/shared/components/palette/query-management/models/case-queries-collection.model.d.ts.map +1 -1
  20. package/lib/shared/components/palette/query-management/models/query-list/query-list-item/query-list-item.model.d.ts +0 -1
  21. package/lib/shared/components/palette/query-management/models/query-list/query-list-item/query-list-item.model.d.ts.map +1 -1
  22. package/lib/shared/components/palette/query-management/read-query-management-field.component.d.ts +3 -15
  23. package/lib/shared/components/palette/query-management/read-query-management-field.component.d.ts.map +1 -1
  24. package/lib/shared/components/palette/query-management/utils/query-management.utils.d.ts +1 -1
  25. package/lib/shared/components/palette/query-management/utils/query-management.utils.d.ts.map +1 -1
  26. package/lib/shared/utils.d.ts +1 -1
  27. package/package.json +1 -1
@@ -1326,7 +1326,6 @@ class CaseEditorConfig {
1326
1326
  icp_enabled;
1327
1327
  icp_jurisdictions;
1328
1328
  events_to_hide;
1329
- enable_service_specific_multi_followups;
1330
1329
  }
1331
1330
 
1332
1331
  class HttpError {
@@ -20667,7 +20666,6 @@ class QueryListItem {
20667
20666
  createdBy;
20668
20667
  parentId;
20669
20668
  isClosed;
20670
- messageType;
20671
20669
  children = [];
20672
20670
  messageIndexInParent = null;
20673
20671
  get lastSubmittedMessage() {
@@ -20694,34 +20692,14 @@ class QueryListItem {
20694
20692
  }
20695
20693
  get lastSubmittedDate() {
20696
20694
  const childrenCount = this.children.length;
20697
- const lastChild = this.children[childrenCount - 1];
20698
- // 1. Check for legacy: <= 1 child with no messageType
20699
- const allChildrenLackMessageType = this.children.every((child) => !child.messageType);
20700
- if (childrenCount <= 1 && allChildrenLackMessageType) {
20695
+ if (childrenCount <= 1) {
20701
20696
  return new Date(this.lastSubmittedMessage.createdOn);
20702
20697
  }
20703
- // 2. Check if any RESPOND exists
20704
- const hasRespond = this.children.some((child) => child.messageType === QueryCreateContext.RESPOND);
20705
- // 3. Check if all children are FOLLOWUPs and none are RESPONDs
20706
- const onlyFollowUps = this.children.every((child) => child.messageType === QueryCreateContext.FOLLOWUP);
20707
- if (onlyFollowUps && !hasRespond) {
20708
- return new Date(lastChild.createdOn);
20709
- }
20710
- // 4. If RESPOND exists, get latest FOLLOWUP
20711
- // If no RESPOND, but there is at least one FOLLOWUP, return the last FOLLOWUP
20712
- const lastFollowUp = [...this.children]
20713
- .reverse()
20714
- .find((child) => child.messageType === QueryCreateContext.FOLLOWUP);
20715
- if (lastFollowUp) {
20716
- return new Date(lastFollowUp.createdOn);
20717
- }
20718
- // 5. Legacy fallback: no messageType at all
20719
- if (allChildrenLackMessageType) {
20720
- const index = childrenCount % 2 === 0 ? childrenCount - 1 : childrenCount - 2;
20721
- return new Date(this.children[index]?.createdOn);
20698
+ let index;
20699
+ if (childrenCount > 1) {
20700
+ index = childrenCount % 2 === 0 ? childrenCount - 1 : childrenCount - 2;
20722
20701
  }
20723
- // 6. Final fallback: return last child's date
20724
- return new Date(this.lastSubmittedMessage.createdOn);
20702
+ return new Date(this.children[index].createdOn);
20725
20703
  }
20726
20704
  get lastResponseBy() {
20727
20705
  return this.children?.length > 0 ? this.lastSubmittedMessage.name : '';
@@ -20731,11 +20709,6 @@ class QueryListItem {
20731
20709
  if (childrenCount === 0) {
20732
20710
  return null;
20733
20711
  }
20734
- const lastChild = this.children[childrenCount - 1];
20735
- if (lastChild?.messageType === QueryCreateContext.FOLLOWUP &&
20736
- !this.children.some((child) => child.messageType === QueryCreateContext.RESPOND)) {
20737
- return null;
20738
- }
20739
20712
  let index;
20740
20713
  if (childrenCount === 1) {
20741
20714
  index = 0;
@@ -20750,20 +20723,11 @@ class QueryListItem {
20750
20723
  if (item.isClosed === 'Yes') {
20751
20724
  return true;
20752
20725
  }
20753
- return item.children?.some((child) => isThreadClosed(child)) || false;
20726
+ return item.children?.some(child => isThreadClosed(child)) || false;
20754
20727
  };
20755
20728
  if (isThreadClosed(this)) {
20756
20729
  return QueryItemResponseStatus.CLOSED;
20757
20730
  }
20758
- const lastMessageType = this.children?.length
20759
- ? this.children[this.children.length - 1]?.messageType
20760
- : undefined;
20761
- if (lastMessageType && lastMessageType === QueryCreateContext.RESPOND) {
20762
- return QueryItemResponseStatus.RESPONDED;
20763
- }
20764
- else if (lastMessageType && lastMessageType === QueryCreateContext.FOLLOWUP) {
20765
- return QueryItemResponseStatus.AWAITING;
20766
- }
20767
20731
  if (this.messageIndexInParent !== null) {
20768
20732
  return this.messageIndexInParent % 2 === 0
20769
20733
  ? QueryItemResponseStatus.RESPONDED
@@ -20852,22 +20816,16 @@ class QueryManagementUtils {
20852
20816
  isHearingRelated,
20853
20817
  hearingDate,
20854
20818
  createdOn: new Date(),
20855
- createdBy: currentUserId,
20856
- messageType: QueryCreateContext.FOLLOWUP // Default to value new queries will be FOLLOWUP
20819
+ createdBy: currentUserId
20857
20820
  };
20858
20821
  }
20859
- static getRespondOrFollowupQueryData(formGroup, queryItem, currentUserDetails, messageTypeParam) {
20822
+ static getRespondOrFollowupQueryData(formGroup, queryItem, currentUserDetails) {
20860
20823
  const currentUserId = currentUserDetails?.uid || currentUserDetails?.id;
20861
20824
  const currentUserName = currentUserDetails?.name || `${currentUserDetails?.forename} ${currentUserDetails?.surname}`;
20862
20825
  const body = formGroup.get('body').value.trim();
20863
20826
  const attachments = formGroup.get('attachments').value;
20864
20827
  const formDocument = attachments.map((document) => this.documentToCollectionFormDocument(document));
20865
20828
  const isClosed = formGroup.get('closeQuery').value ? 'Yes' : 'No';
20866
- const messageType = messageTypeParam === QueryCreateContext.RESPOND
20867
- ? QueryCreateContext.RESPOND
20868
- : messageTypeParam === QueryCreateContext.FOLLOWUP
20869
- ? QueryCreateContext.FOLLOWUP
20870
- : undefined;
20871
20829
  return {
20872
20830
  id: v4(),
20873
20831
  subject: queryItem.subject.trim(),
@@ -20879,8 +20837,7 @@ class QueryManagementUtils {
20879
20837
  createdOn: new Date(),
20880
20838
  createdBy: currentUserId,
20881
20839
  parentId: queryItem.id,
20882
- isClosed,
20883
- messageType
20840
+ isClosed
20884
20841
  };
20885
20842
  }
20886
20843
  static isObject(elem) {
@@ -20928,7 +20885,7 @@ class QueryManagementService {
20928
20885
  }
20929
20886
  const caseMessage = queryCreateContext === QueryCreateContext.NEW_QUERY
20930
20887
  ? QueryManagementUtils.getNewQueryData(formGroup, currentUserDetails)
20931
- : QueryManagementUtils.getRespondOrFollowupQueryData(formGroup, queryItem, currentUserDetails, queryCreateContext);
20888
+ : QueryManagementUtils.getRespondOrFollowupQueryData(formGroup, queryItem, currentUserDetails);
20932
20889
  const isNewQuery = queryCreateContext === QueryCreateContext.NEW_QUERY; // Check if this is a new query
20933
20890
  // Check if the field ID has been set dynamically
20934
20891
  if (!this.fieldId) {
@@ -21667,7 +21624,6 @@ class QueryCheckYourAnswersComponent {
21667
21624
  queryItem;
21668
21625
  queryCreateContext;
21669
21626
  eventData = null;
21670
- multipleFollowUpFeature;
21671
21627
  qmCaseQueriesCollectionData;
21672
21628
  backClicked = new EventEmitter();
21673
21629
  querySubmitted = new EventEmitter();
@@ -21861,7 +21817,7 @@ class QueryCheckYourAnswersComponent {
21861
21817
  this.queryManagementService.setCaseQueriesCollectionData(this.eventData, this.queryCreateContext, this.caseDetails, this.messageId);
21862
21818
  }
21863
21819
  static ɵfac = function QueryCheckYourAnswersComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || QueryCheckYourAnswersComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(WorkAllocationService), i0.ɵɵdirectiveInject(QualifyingQuestionService), i0.ɵɵdirectiveInject(QueryManagementService), i0.ɵɵdirectiveInject(ErrorNotifierService), i0.ɵɵdirectiveInject(AlertService)); };
21864
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QueryCheckYourAnswersComponent, selectors: [["ccd-query-check-your-answers"]], inputs: { formGroup: "formGroup", queryItem: "queryItem", queryCreateContext: "queryCreateContext", eventData: "eventData", multipleFollowUpFeature: "multipleFollowUpFeature", qmCaseQueriesCollectionData: "qmCaseQueriesCollectionData" }, outputs: { backClicked: "backClicked", querySubmitted: "querySubmitted", callbackConfirmationMessage: "callbackConfirmationMessage" }, decls: 1, vars: 1, consts: [["defaultCheckYourAnswersTitle", ""], ["isHearingRelatedFalse", ""], ["class", "govuk-grid-row", 4, "ngIf"], [1, "govuk-grid-row"], [1, "govuk-grid-column-two-thirds-from-desktop"], ["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], ["class", "error-summary", "role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 4, "ngIf"], [3, "callbackErrorsSubject"], [4, "ngIf"], [1, "govuk-heading-l"], [4, "ngIf", "ngIfElse"], [1, "govuk-!-margin-bottom-4"], [3, "caseDetails"], ["class", "govuk-summary-list govuk-!-margin-bottom-0", 4, "ngIf"], [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"], ["data-module", "govuk-button", 1, "govuk-button", "govuk-button--secondary", "govuk-!-margin-right-3", 3, "click"], ["data-module", "govuk-button", "type", "submit", 1, "govuk-button", 3, "click"], [3, "eventCompletionParams"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [4, "ngFor", "ngForOf"], ["href", "javascript:void(0)", 1, "validation-error", 3, "id"], ["role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 1, "error-summary"], ["id", "event_error-summary-heading", 1, "heading-h3", "error-summary-heading"], ["class", "error-summary-list", 4, "ngIf"], [1, "error-summary-list"], ["class", "ccd-error-summary-li", 4, "ngFor", "ngForOf"], [1, "ccd-error-summary-li"], [1, "govuk-caption-l"], ["href", "javascript:void(0)", "class", "govuk-link", 3, "click", 4, "ngIf"], ["class", "govuk-summary-list__row", 4, "ngIf"], [1, "govuk-summary-list__value", "govuk-summary-list__value--documentAttached"], [3, "attachments", 4, "ngIf"], [3, "attachments"]], template: function QueryCheckYourAnswersComponent_Template(rf, ctx) { if (rf & 1) {
21820
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QueryCheckYourAnswersComponent, selectors: [["ccd-query-check-your-answers"]], inputs: { formGroup: "formGroup", queryItem: "queryItem", queryCreateContext: "queryCreateContext", eventData: "eventData", qmCaseQueriesCollectionData: "qmCaseQueriesCollectionData" }, outputs: { backClicked: "backClicked", querySubmitted: "querySubmitted", callbackConfirmationMessage: "callbackConfirmationMessage" }, decls: 1, vars: 1, consts: [["defaultCheckYourAnswersTitle", ""], ["isHearingRelatedFalse", ""], ["class", "govuk-grid-row", 4, "ngIf"], [1, "govuk-grid-row"], [1, "govuk-grid-column-two-thirds-from-desktop"], ["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], ["class", "error-summary", "role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 4, "ngIf"], [3, "callbackErrorsSubject"], [4, "ngIf"], [1, "govuk-heading-l"], [4, "ngIf", "ngIfElse"], [1, "govuk-!-margin-bottom-4"], [3, "caseDetails"], ["class", "govuk-summary-list govuk-!-margin-bottom-0", 4, "ngIf"], [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"], ["data-module", "govuk-button", 1, "govuk-button", "govuk-button--secondary", "govuk-!-margin-right-3", 3, "click"], ["data-module", "govuk-button", "type", "submit", 1, "govuk-button", 3, "click"], [3, "eventCompletionParams"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [4, "ngFor", "ngForOf"], ["href", "javascript:void(0)", 1, "validation-error", 3, "id"], ["role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 1, "error-summary"], ["id", "event_error-summary-heading", 1, "heading-h3", "error-summary-heading"], ["class", "error-summary-list", 4, "ngIf"], [1, "error-summary-list"], ["class", "ccd-error-summary-li", 4, "ngFor", "ngForOf"], [1, "ccd-error-summary-li"], [1, "govuk-caption-l"], ["href", "javascript:void(0)", "class", "govuk-link", 3, "click", 4, "ngIf"], ["class", "govuk-summary-list__row", 4, "ngIf"], [1, "govuk-summary-list__value", "govuk-summary-list__value--documentAttached"], [3, "attachments", 4, "ngIf"], [3, "attachments"]], template: function QueryCheckYourAnswersComponent_Template(rf, ctx) { if (rf & 1) {
21865
21821
  i0.ɵɵtemplate(0, QueryCheckYourAnswersComponent_div_0_Template, 36, 25, "div", 2);
21866
21822
  } if (rf & 2) {
21867
21823
  i0.ɵɵproperty("ngIf", ctx.readyToSubmit);
@@ -21878,8 +21834,6 @@ class QueryCheckYourAnswersComponent {
21878
21834
  type: Input
21879
21835
  }], eventData: [{
21880
21836
  type: Input
21881
- }], multipleFollowUpFeature: [{
21882
- type: Input
21883
21837
  }], qmCaseQueriesCollectionData: [{
21884
21838
  type: Input
21885
21839
  }], backClicked: [{
@@ -22101,12 +22055,10 @@ function QueryDetailsComponent_ng_container_0_ng_container_44_ng_container_1_Tem
22101
22055
  i0.ɵɵtemplate(1, QueryDetailsComponent_ng_container_0_ng_container_44_ng_container_1_ng_container_1_Template, 23, 19, "ng-container", 15)(2, QueryDetailsComponent_ng_container_0_ng_container_44_ng_container_1_ng_template_2_Template, 27, 22, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
22102
22056
  i0.ɵɵelementContainerEnd();
22103
22057
  } if (rf & 2) {
22104
- const child_r3 = ctx.$implicit;
22105
22058
  const i_r4 = ctx.index;
22106
22059
  const followUpMessage_r5 = i0.ɵɵreference(3);
22107
- const ctx_r1 = i0.ɵɵnextContext(3);
22108
22060
  i0.ɵɵadvance();
22109
- i0.ɵɵproperty("ngIf", i_r4 % 2 === 0 && !(child_r3 == null ? null : child_r3.messageType) || child_r3 && (child_r3 == null ? null : child_r3.messageType) === ctx_r1.respondToQuery)("ngIfElse", followUpMessage_r5);
22061
+ i0.ɵɵproperty("ngIf", i_r4 % 2 === 0)("ngIfElse", followUpMessage_r5);
22110
22062
  } }
22111
22063
  function QueryDetailsComponent_ng_container_0_ng_container_44_Template(rf, ctx) { if (rf & 1) {
22112
22064
  i0.ɵɵelementContainerStart(0);
@@ -22210,8 +22162,6 @@ class QueryDetailsComponent {
22210
22162
  sessionStorageService;
22211
22163
  route;
22212
22164
  router;
22213
- abstractConfig;
22214
- caseNotifier;
22215
22165
  query;
22216
22166
  caseId;
22217
22167
  queryResponseStatus;
@@ -22221,18 +22171,10 @@ class QueryDetailsComponent {
22221
22171
  static QUERY_ITEM_RESPOND = '3';
22222
22172
  static QUERY_ITEM_FOLLOW_UP = '4';
22223
22173
  queryItemId;
22224
- followUpQuery = QueryCreateContext.FOLLOWUP;
22225
- respondToQuery = QueryCreateContext.RESPOND;
22226
- enableServiceSpecificMultiFollowups;
22227
- currentJurisdictionId;
22228
- isMultipleFollowUpEnabled = false;
22229
- caseSubscription;
22230
- constructor(sessionStorageService, route, router, abstractConfig, caseNotifier) {
22174
+ constructor(sessionStorageService, route, router) {
22231
22175
  this.sessionStorageService = sessionStorageService;
22232
22176
  this.route = route;
22233
22177
  this.router = router;
22234
- this.abstractConfig = abstractConfig;
22235
- this.caseNotifier = caseNotifier;
22236
22178
  }
22237
22179
  onBack() {
22238
22180
  this.backClicked.emit(true);
@@ -22240,23 +22182,10 @@ class QueryDetailsComponent {
22240
22182
  isInternalUser() {
22241
22183
  return isInternalUser(this.sessionStorageService);
22242
22184
  }
22243
- ngOnInit() {
22244
- this.enableServiceSpecificMultiFollowups = this.abstractConfig.getEnableServiceSpecificMultiFollowups() || [];
22245
- this.caseSubscription = this.caseNotifier.caseView.subscribe((caseView) => {
22246
- if (caseView?.case_type?.jurisdiction?.id) {
22247
- this.currentJurisdictionId = caseView.case_type.jurisdiction.id;
22248
- this.isMultipleFollowUpEnabled = this.enableServiceSpecificMultiFollowups.includes(this.currentJurisdictionId);
22249
- this.hasRespondedToQuery();
22250
- }
22251
- });
22252
- }
22253
22185
  ngOnChanges() {
22254
22186
  this.toggleLinkVisibility();
22255
22187
  this.hasRespondedToQuery();
22256
22188
  }
22257
- ngOnDestroy() {
22258
- this.caseSubscription?.unsubscribe();
22259
- }
22260
22189
  toggleLinkVisibility() {
22261
22190
  this.queryItemId = this.route.snapshot.params.qid;
22262
22191
  if (this.queryItemId === QueryDetailsComponent.QUERY_ITEM_RESPOND || this.queryItemId === QueryDetailsComponent.QUERY_ITEM_FOLLOW_UP) {
@@ -22269,24 +22198,6 @@ class QueryDetailsComponent {
22269
22198
  this.hasResponded.emit(true);
22270
22199
  return true;
22271
22200
  }
22272
- const lastChild = this.query?.children?.[this.query.children.length - 1];
22273
- const lastMessageType = this.query?.children?.length
22274
- ? this.query.children[this.query.children.length - 1]?.messageType
22275
- : this.query?.messageType;
22276
- const isFollowUp = lastMessageType === this.followUpQuery;
22277
- const isRespond = lastChild?.messageType === this.respondToQuery;
22278
- if (this.queryResponseStatus === QueryItemResponseStatus.CLOSED) {
22279
- this.hasResponded.emit(true);
22280
- return true;
22281
- }
22282
- if (isFollowUp && this.isMultipleFollowUpEnabled) {
22283
- this.hasResponded.emit(false);
22284
- return false;
22285
- }
22286
- if (isRespond) {
22287
- this.hasResponded.emit(false);
22288
- return false;
22289
- }
22290
22201
  if (this.isInternalUser()) {
22291
22202
  if (isAwaiting) {
22292
22203
  this.hasResponded.emit(false);
@@ -22302,7 +22213,7 @@ class QueryDetailsComponent {
22302
22213
  this.hasResponded.emit(false);
22303
22214
  return false;
22304
22215
  }
22305
- static ɵfac = function QueryDetailsComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || QueryDetailsComponent)(i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(AbstractAppConfig), i0.ɵɵdirectiveInject(CaseNotifier)); };
22216
+ static ɵfac = function QueryDetailsComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || QueryDetailsComponent)(i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(i1$1.Router)); };
22306
22217
  static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QueryDetailsComponent, selectors: [["ccd-query-details"]], inputs: { query: "query", caseId: "caseId", queryResponseStatus: "queryResponseStatus" }, outputs: { backClicked: "backClicked", hasResponded: "hasResponded" }, features: [i0.ɵɵNgOnChangesFeature], decls: 1, vars: 1, consts: [["followUpMessage", ""], [4, "ngIf"], [1, "govuk-table", "query-details-table"], [1, "govuk-table__caption", "govuk-table__caption--l"], [1, "govuk-table__body"], [1, "govuk-table__row"], ["scope", "row", 1, "govuk-table__header"], [1, "govuk-table__cell"], ["class", "govuk-table__row govuk-table__row--isHearingRelated", 4, "ngIf"], ["class", "govuk-table__row", 4, "ngIf"], ["href", "javascript:void(0)", 1, "govuk-link", 3, "click"], [1, "govuk-table__row", "govuk-table__row--isHearingRelated"], [3, "attachments", 4, "ngIf"], [3, "attachments"], [4, "ngFor", "ngForOf"], [4, "ngIf", "ngIfElse"]], template: function QueryDetailsComponent_Template(rf, ctx) { if (rf & 1) {
22307
22218
  i0.ɵɵtemplate(0, QueryDetailsComponent_ng_container_0_Template, 45, 41, "ng-container", 1);
22308
22219
  } if (rf & 2) {
@@ -22311,8 +22222,8 @@ class QueryDetailsComponent {
22311
22222
  }
22312
22223
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(QueryDetailsComponent, [{
22313
22224
  type: Component,
22314
- args: [{ selector: 'ccd-query-details', template: "<ng-container *ngIf=\"query\">\n <p *ngIf=\"showItem\">\n <br />\n <a class=\"govuk-link\" href=\"javascript:void(0)\" (click)=\"onBack()\">{{ 'Back to query list' | rpxTranslate }}</a>\n </p>\n <div>\n <table class=\"govuk-table query-details-table\" [attr.aria-describedby]=\"'Details of the query' | rpxTranslate\">\n <caption class=\"govuk-table__caption govuk-table__caption--l\">\n <div>{{ 'Query details' | rpxTranslate }}</div>\n </caption>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last submitted by' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.lastSubmittedBy }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Submission date' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.createdOn | date: 'dd MMMM YYYY HH:mm' }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Query subject' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.subject }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Query body' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.body }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\" [class.govuk-table__header--no-border]=\"query.isHearingRelated\">\n {{ 'Is the query hearing related?' | rpxTranslate }}\n </th>\n <td class=\"govuk-table__cell\" [class.govuk-table__cell--no-border]=\"query.isHearingRelated\">\n {{ 'Is the query hearing related?' | rpxTranslate: null : (query.isHearingRelated) }}</td>\n </tr>\n <tr class=\"govuk-table__row govuk-table__row--isHearingRelated\" *ngIf=\"query.isHearingRelated === 'Yes'\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'What is the date of the hearing?' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.hearingDate | date: 'dd MMM yyyy' }}</td>\n </tr>\n <tr class=\"govuk-table__row\" *ngIf=\"query.attachments.length > 0\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Attachments' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">\n <ccd-query-attachments-read\n *ngIf=\"query.attachments\"\n [attachments]=\"query.attachments\"\n >\n </ccd-query-attachments-read>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <ng-container *ngIf=\"query.children?.length > 0\">\n <ng-container *ngFor=\"let child of query.children; let i = index;\">\n <ng-container *ngIf=\"(i % 2 === 0 && !child?.messageType) || (child && child?.messageType === respondToQuery); else followUpMessage\">\n <table class=\"govuk-table query-details-table\" [attr.aria-describedby]=\"'Response of the query' | rpxTranslate\">\n <caption class=\"govuk-table__caption govuk-table__caption--l\">\n <div>{{ 'Response' | rpxTranslate }}</div>\n </caption>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last response date' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.createdOn | date: 'dd MMMM YYYY HH:mm' }}</td>\n </tr>\n\n <tr *ngIf=\"isInternalUser()\" class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Caseworker name' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.name }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Response detail' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.body }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\" *ngIf=\"child.attachments.length > 0\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Attachments' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">\n <ccd-query-attachments-read\n *ngIf=\"child.attachments\"\n [attachments]=\"child.attachments\"\n >\n </ccd-query-attachments-read>\n </td>\n </tr>\n </tbody>\n </table>\n </ng-container>\n\n <ng-template #followUpMessage>\n <!-- <div class=\"query_details_caption\">{{ 'Follow-up' | rpxTranslate }}</div> -->\n <table class=\"govuk-table query-details-table\"\n [attr.aria-describedby]=\"'Follow-up of the response' | rpxTranslate\">\n <caption class=\"govuk-table__caption govuk-table__caption--l\">\n <div>{{ 'Follow up query' | rpxTranslate }}</div>\n </caption>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last submission date' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.createdOn | date: 'dd MMMM YYYY HH:mm'}}</td>\n </tr>\n\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last submitted by' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.name }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Query detail' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.body }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\" *ngIf=\"child.attachments.length > 0\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Attachments' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">\n <ccd-query-attachments-read\n *ngIf=\"child.attachments\"\n [attachments]=\"child.attachments\"\n >\n </ccd-query-attachments-read>\n </td>\n </tr>\n </tbody>\n </table>\n </ng-template>\n </ng-container>\n </ng-container>\n</ng-container>\n", styles: [".query-details-table .govuk-table__header{width:330px}\n"] }]
22315
- }], () => [{ type: SessionStorageService }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: AbstractAppConfig }, { type: CaseNotifier }], { query: [{
22225
+ args: [{ selector: 'ccd-query-details', template: "<ng-container *ngIf=\"query\">\n <p *ngIf=\"showItem\">\n <br />\n <a class=\"govuk-link\" href=\"javascript:void(0)\" (click)=\"onBack()\">{{ 'Back to query list' | rpxTranslate }}</a>\n </p>\n <div>\n <table class=\"govuk-table query-details-table\" [attr.aria-describedby]=\"'Details of the query' | rpxTranslate\">\n <caption class=\"govuk-table__caption govuk-table__caption--l\">\n <div>{{ 'Query details' | rpxTranslate }}</div>\n </caption>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last submitted by' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.lastSubmittedBy }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Submission date' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.createdOn | date: 'dd MMMM YYYY HH:mm' }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Query subject' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.subject }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Query body' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.body }}</td>\n </tr>\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\" [class.govuk-table__header--no-border]=\"query.isHearingRelated\">\n {{ 'Is the query hearing related?' | rpxTranslate }}\n </th>\n <td class=\"govuk-table__cell\" [class.govuk-table__cell--no-border]=\"query.isHearingRelated\">\n {{ 'Is the query hearing related?' | rpxTranslate: null : (query.isHearingRelated) }}</td>\n </tr>\n <tr class=\"govuk-table__row govuk-table__row--isHearingRelated\" *ngIf=\"query.isHearingRelated === 'Yes'\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'What is the date of the hearing?' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ query.hearingDate | date: 'dd MMM yyyy' }}</td>\n </tr>\n <tr class=\"govuk-table__row\" *ngIf=\"query.attachments.length > 0\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Attachments' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">\n <ccd-query-attachments-read\n *ngIf=\"query.attachments\"\n [attachments]=\"query.attachments\"\n >\n </ccd-query-attachments-read>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <ng-container *ngIf=\"query.children?.length > 0\">\n <ng-container *ngFor=\"let child of query.children; let i = index;\">\n <ng-container *ngIf=\"i % 2 === 0; else followUpMessage\">\n <table class=\"govuk-table query-details-table\" [attr.aria-describedby]=\"'Response of the query' | rpxTranslate\">\n <caption class=\"govuk-table__caption govuk-table__caption--l\">\n <div>{{ 'Response' | rpxTranslate }}</div>\n </caption>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last response date' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.createdOn | date: 'dd MMMM YYYY HH:mm' }}</td>\n </tr>\n\n <tr *ngIf=\"isInternalUser()\" class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Caseworker name' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.name }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Response detail' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.body }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\" *ngIf=\"child.attachments.length > 0\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Attachments' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">\n <ccd-query-attachments-read\n *ngIf=\"child.attachments\"\n [attachments]=\"child.attachments\"\n >\n </ccd-query-attachments-read>\n </td>\n </tr>\n </tbody>\n </table>\n </ng-container>\n\n <ng-template #followUpMessage>\n <!-- <div class=\"query_details_caption\">{{ 'Follow-up' | rpxTranslate }}</div> -->\n <table class=\"govuk-table query-details-table\"\n [attr.aria-describedby]=\"'Follow-up of the response' | rpxTranslate\">\n <caption class=\"govuk-table__caption govuk-table__caption--l\">\n <div>{{ 'Follow up query' | rpxTranslate }}</div>\n </caption>\n <tbody class=\"govuk-table__body\">\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last submission date' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.createdOn | date: 'dd MMMM YYYY HH:mm'}}</td>\n </tr>\n\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Last submitted by' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.name }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Query detail' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">{{ child.body }}</td>\n </tr>\n\n <tr class=\"govuk-table__row\" *ngIf=\"child.attachments.length > 0\">\n <th scope=\"row\" class=\"govuk-table__header\">{{ 'Attachments' | rpxTranslate }}</th>\n <td class=\"govuk-table__cell\">\n <ccd-query-attachments-read\n *ngIf=\"child.attachments\"\n [attachments]=\"child.attachments\"\n >\n </ccd-query-attachments-read>\n </td>\n </tr>\n </tbody>\n </table>\n </ng-template>\n </ng-container>\n </ng-container>\n</ng-container>\n", styles: [".query-details-table .govuk-table__header{width:330px}\n"] }]
22226
+ }], () => [{ type: SessionStorageService }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }], { query: [{
22316
22227
  type: Input
22317
22228
  }], caseId: [{
22318
22229
  type: Input
@@ -22323,7 +22234,7 @@ class QueryDetailsComponent {
22323
22234
  }], hasResponded: [{
22324
22235
  type: Output
22325
22236
  }] }); })();
22326
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryDetailsComponent, { className: "QueryDetailsComponent", filePath: "lib/shared/components/palette/query-management/components/query-details/query-details.component.ts", lineNumber: 17 }); })();
22237
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryDetailsComponent, { className: "QueryDetailsComponent", filePath: "lib/shared/components/palette/query-management/components/query-details/query-details.component.ts", lineNumber: 14 }); })();
22327
22238
 
22328
22239
  class QueryEventCompletionComponent {
22329
22240
  eventCompletionParams;
@@ -23399,7 +23310,7 @@ class CloseQueryComponent {
23399
23310
  const _c0$B = (a0, a1) => ["/query-management", "query", a0, "4", a1];
23400
23311
  function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_Template(rf, ctx) { if (rf & 1) {
23401
23312
  const _r1 = i0.ɵɵgetCurrentView();
23402
- i0.ɵɵelementStart(0, "div", 6)(1, "ccd-query-list", 7);
23313
+ i0.ɵɵelementStart(0, "div", 5)(1, "ccd-query-list", 6);
23403
23314
  i0.ɵɵlistener("selectedQuery", function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_Template_ccd_query_list_selectedQuery_1_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.setQuery($event)); });
23404
23315
  i0.ɵɵelementEnd()();
23405
23316
  } if (rf & 2) {
@@ -23409,7 +23320,7 @@ function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_T
23409
23320
  } }
23410
23321
  function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_Template(rf, ctx) { if (rf & 1) {
23411
23322
  i0.ɵɵelementContainerStart(0);
23412
- i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_Template, 2, 1, "div", 5);
23323
+ i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_Template, 2, 1, "div", 4);
23413
23324
  i0.ɵɵelementContainerEnd();
23414
23325
  } if (rf & 2) {
23415
23326
  const ctx_r1 = i0.ɵɵnextContext(2);
@@ -23418,7 +23329,7 @@ function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_Templat
23418
23329
  } }
23419
23330
  function ReadQueryManagementFieldComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
23420
23331
  i0.ɵɵelementContainerStart(0);
23421
- i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_Template, 2, 1, "ng-container", 4);
23332
+ i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_Template, 2, 1, "ng-container", 3);
23422
23333
  i0.ɵɵelementContainerEnd();
23423
23334
  } if (rf & 2) {
23424
23335
  const ctx_r1 = i0.ɵɵnextContext();
@@ -23427,7 +23338,7 @@ function ReadQueryManagementFieldComponent_ng_container_0_Template(rf, ctx) { if
23427
23338
  } }
23428
23339
  function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
23429
23340
  i0.ɵɵelementContainerStart(0);
23430
- i0.ɵɵelementStart(1, "button", 10);
23341
+ i0.ɵɵelementStart(1, "button", 9);
23431
23342
  i0.ɵɵtext(2);
23432
23343
  i0.ɵɵpipe(3, "rpxTranslate");
23433
23344
  i0.ɵɵelementEnd();
@@ -23439,22 +23350,8 @@ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_conta
23439
23350
  i0.ɵɵadvance();
23440
23351
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 2, "Ask a follow-up question"), " ");
23441
23352
  } }
23442
- function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_ng_container_0_Template(rf, ctx) { if (rf & 1) {
23443
- i0.ɵɵelementContainerStart(0);
23444
- i0.ɵɵelementStart(1, "button", 10);
23445
- i0.ɵɵtext(2);
23446
- i0.ɵɵpipe(3, "rpxTranslate");
23447
- i0.ɵɵelementEnd();
23448
- i0.ɵɵelementContainerEnd();
23449
- } if (rf & 2) {
23450
- const ctx_r1 = i0.ɵɵnextContext(4);
23451
- i0.ɵɵadvance();
23452
- i0.ɵɵproperty("routerLink", i0.ɵɵpureFunction2(4, _c0$B, ctx_r1.caseId, ctx_r1.query.id));
23453
- i0.ɵɵadvance();
23454
- i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 2, "Ask a follow-up question"), " ");
23455
- } }
23456
- function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_ng_template_1_Template(rf, ctx) { if (rf & 1) {
23457
- i0.ɵɵelementStart(0, "div")(1, "p", 11);
23353
+ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_Template(rf, ctx) { if (rf & 1) {
23354
+ i0.ɵɵelementStart(0, "div")(1, "p", 10);
23458
23355
  i0.ɵɵtext(2);
23459
23356
  i0.ɵɵpipe(3, "rpxTranslate");
23460
23357
  i0.ɵɵelementEnd();
@@ -23468,32 +23365,25 @@ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_templ
23468
23365
  i0.ɵɵadvance(3);
23469
23366
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(6, 4, "Our team will read your query and respond. Do not submit the same query more than once."));
23470
23367
  } }
23471
- function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_Template(rf, ctx) { if (rf & 1) {
23472
- i0.ɵɵtemplate(0, ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_ng_container_0_Template, 4, 7, "ng-container", 3)(1, ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_ng_template_1_Template, 7, 6, "ng-template", null, 2, i0.ɵɵtemplateRefExtractor);
23473
- } if (rf & 2) {
23474
- const queryIsInReview_r5 = i0.ɵɵreference(2);
23475
- const ctx_r1 = i0.ɵɵnextContext(3);
23476
- i0.ɵɵproperty("ngIf", (ctx_r1.query == null ? null : ctx_r1.query.children == null ? null : ctx_r1.query.children.length) > 0 && (ctx_r1.query == null ? null : ctx_r1.query.children == null ? null : ctx_r1.query.children.length) % 2 === 1)("ngIfElse", queryIsInReview_r5);
23477
- } }
23478
23368
  function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
23479
23369
  i0.ɵɵelementContainerStart(0);
23480
- i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_container_1_Template, 4, 7, "ng-container", 3)(2, ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_Template, 3, 2, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor);
23370
+ i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_container_1_Template, 4, 7, "ng-container", 2)(2, ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_Template, 7, 6, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor);
23481
23371
  i0.ɵɵelementContainerEnd();
23482
23372
  } if (rf & 2) {
23483
- const sequentialQuery_r6 = i0.ɵɵreference(3);
23373
+ const queryIsInReview_r5 = i0.ɵɵreference(3);
23484
23374
  const ctx_r1 = i0.ɵɵnextContext(2);
23485
23375
  i0.ɵɵadvance();
23486
- i0.ɵɵproperty("ngIf", ctx_r1.messageType && ctx_r1.messageType === ctx_r1.followUpQuery && ctx_r1.isMultipleFollowUpEnabled || ctx_r1.messageType && ctx_r1.messageType === ctx_r1.respondToQuery)("ngIfElse", sequentialQuery_r6);
23376
+ i0.ɵɵproperty("ngIf", (ctx_r1.query == null ? null : ctx_r1.query.children == null ? null : ctx_r1.query.children.length) > 0 && (ctx_r1.query == null ? null : ctx_r1.query.children == null ? null : ctx_r1.query.children.length) % 2 === 1)("ngIfElse", queryIsInReview_r5);
23487
23377
  } }
23488
23378
  function ReadQueryManagementFieldComponent_ng_template_1_ng_container_2_Template(rf, ctx) { if (rf & 1) {
23489
23379
  i0.ɵɵelementContainerStart(0);
23490
- i0.ɵɵelementStart(1, "div", 12)(2, "span", 13);
23380
+ i0.ɵɵelementStart(1, "div", 11)(2, "span", 12);
23491
23381
  i0.ɵɵtext(3, "!");
23492
23382
  i0.ɵɵelementEnd();
23493
- i0.ɵɵelementStart(4, "strong", 14)(5, "span", 15);
23383
+ i0.ɵɵelementStart(4, "strong", 13)(5, "span", 14);
23494
23384
  i0.ɵɵtext(6, "Warning");
23495
23385
  i0.ɵɵelementEnd();
23496
- i0.ɵɵelementStart(7, "p", 16);
23386
+ i0.ɵɵelementStart(7, "p", 15);
23497
23387
  i0.ɵɵtext(8);
23498
23388
  i0.ɵɵpipe(9, "rpxTranslate");
23499
23389
  i0.ɵɵelementEnd()()();
@@ -23504,10 +23394,10 @@ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_2_Template
23504
23394
  } }
23505
23395
  function ReadQueryManagementFieldComponent_ng_template_1_Template(rf, ctx) { if (rf & 1) {
23506
23396
  const _r4 = i0.ɵɵgetCurrentView();
23507
- i0.ɵɵelementStart(0, "ccd-query-details", 8);
23397
+ i0.ɵɵelementStart(0, "ccd-query-details", 7);
23508
23398
  i0.ɵɵlistener("backClicked", function ReadQueryManagementFieldComponent_ng_template_1_Template_ccd_query_details_backClicked_0_listener() { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.showQueryList = true); });
23509
23399
  i0.ɵɵelementEnd();
23510
- i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_Template, 4, 2, "ng-container", 9)(2, ReadQueryManagementFieldComponent_ng_template_1_ng_container_2_Template, 10, 3, "ng-container", 9);
23400
+ i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_Template, 4, 2, "ng-container", 8)(2, ReadQueryManagementFieldComponent_ng_template_1_ng_container_2_Template, 10, 3, "ng-container", 8);
23511
23401
  } if (rf & 2) {
23512
23402
  const ctx_r1 = i0.ɵɵnextContext();
23513
23403
  i0.ɵɵproperty("query", ctx_r1.query)("caseId", ctx_r1.caseId);
@@ -23520,36 +23410,19 @@ class ReadQueryManagementFieldComponent extends AbstractFieldReadComponent {
23520
23410
  route;
23521
23411
  sessionStorageService;
23522
23412
  caseNotifier;
23523
- abstractConfig;
23524
23413
  caseQueriesCollections;
23525
23414
  query;
23526
23415
  showQueryList = true;
23527
23416
  caseId;
23528
- messageType;
23529
- followUpQuery = QueryCreateContext.FOLLOWUP;
23530
- respondToQuery = QueryCreateContext.RESPOND;
23531
23417
  isQueryClosed = false;
23532
- value;
23533
- isMultipleFollowUpEnabled = false;
23534
- currentJurisdictionId;
23535
- enableServiceSpecificMultiFollowups = [];
23536
- caseSubscription;
23537
- constructor(route, sessionStorageService, caseNotifier, abstractConfig) {
23418
+ constructor(route, sessionStorageService, caseNotifier) {
23538
23419
  super();
23539
23420
  this.route = route;
23540
23421
  this.sessionStorageService = sessionStorageService;
23541
23422
  this.caseNotifier = caseNotifier;
23542
- this.abstractConfig = abstractConfig;
23543
23423
  }
23544
23424
  ngOnInit() {
23545
23425
  this.caseId = this.route.snapshot.params.cid;
23546
- this.enableServiceSpecificMultiFollowups = this.abstractConfig.getEnableServiceSpecificMultiFollowups() || [];
23547
- this.caseSubscription = this.caseNotifier.caseView.subscribe((caseDetails) => {
23548
- if (caseDetails?.case_type?.jurisdiction?.id) {
23549
- this.currentJurisdictionId = caseDetails.case_type.jurisdiction.id;
23550
- this.isMultipleFollowUpEnabled = this.enableServiceSpecificMultiFollowups.includes(this.currentJurisdictionId);
23551
- }
23552
- });
23553
23426
  if (this.context === PaletteContext.DEFAULT) {
23554
23427
  // EUI-8303 Using mock data until CCD is ready with the API and data contract
23555
23428
  // this.caseQueriesCollections = caseMessagesMockData;
@@ -23575,13 +23448,9 @@ class ReadQueryManagementFieldComponent extends AbstractFieldReadComponent {
23575
23448
  // QueryManagementUtils.extractCaseQueriesFromCaseField();
23576
23449
  }
23577
23450
  }
23578
- ngOnDestroy() {
23579
- this.caseSubscription?.unsubscribe();
23580
- }
23581
23451
  setQuery(query) {
23582
23452
  this.showQueryList = false;
23583
23453
  this.query = query;
23584
- this.messageType = this.getMessageType(query);
23585
23454
  this.isQueryClosed = this.query?.children?.some((queryItem) => queryItem?.isClosed === 'Yes');
23586
23455
  }
23587
23456
  backToQueryListPage() {
@@ -23591,27 +23460,19 @@ class ReadQueryManagementFieldComponent extends AbstractFieldReadComponent {
23591
23460
  isInternalUser() {
23592
23461
  return isInternalUser(this.sessionStorageService);
23593
23462
  }
23594
- getMessageType(query) {
23595
- if (!query) {
23596
- return undefined;
23597
- }
23598
- return query.children?.length
23599
- ? query.children[query.children.length - 1]?.messageType
23600
- : query?.messageType;
23601
- }
23602
- static ɵfac = function ReadQueryManagementFieldComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ReadQueryManagementFieldComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(AbstractAppConfig)); };
23603
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ReadQueryManagementFieldComponent, selectors: [["ccd-read-query-management-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 3, vars: 2, consts: [["singleQueryDetails", ""], ["sequentialQuery", ""], ["queryIsInReview", ""], [4, "ngIf", "ngIfElse"], [4, "ngFor", "ngForOf"], ["class", "govuk-!-margin-top-8 govuk-!-margin-bottom-8", 4, "ngIf"], [1, "govuk-!-margin-top-8", "govuk-!-margin-bottom-8"], [3, "selectedQuery", "caseQueriesCollection"], [3, "backClicked", "query", "caseId"], [4, "ngIf"], ["id", "ask-follow-up-question", "data-module", "govuk-button", 1, "govuk-button", 3, "routerLink"], [1, "govuk-!-font-weight-bold"], [1, "govuk-warning-text"], ["aria-hidden", "true", 1, "govuk-warning-text__icon"], [1, "govuk-warning-text__text"], [1, "govuk-visually-hidden"], [1, "qm-service-message", "govuk-!-font-weight-bold"]], template: function ReadQueryManagementFieldComponent_Template(rf, ctx) { if (rf & 1) {
23604
- i0.ɵɵtemplate(0, ReadQueryManagementFieldComponent_ng_container_0_Template, 2, 1, "ng-container", 3)(1, ReadQueryManagementFieldComponent_ng_template_1_Template, 3, 4, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
23463
+ static ɵfac = function ReadQueryManagementFieldComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ReadQueryManagementFieldComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(CaseNotifier)); };
23464
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ReadQueryManagementFieldComponent, selectors: [["ccd-read-query-management-field"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 3, vars: 2, consts: [["singleQueryDetails", ""], ["queryIsInReview", ""], [4, "ngIf", "ngIfElse"], [4, "ngFor", "ngForOf"], ["class", "govuk-!-margin-top-8 govuk-!-margin-bottom-8", 4, "ngIf"], [1, "govuk-!-margin-top-8", "govuk-!-margin-bottom-8"], [3, "selectedQuery", "caseQueriesCollection"], [3, "backClicked", "query", "caseId"], [4, "ngIf"], ["id", "ask-follow-up-question", "data-module", "govuk-button", 1, "govuk-button", 3, "routerLink"], [1, "govuk-!-font-weight-bold"], [1, "govuk-warning-text"], ["aria-hidden", "true", 1, "govuk-warning-text__icon"], [1, "govuk-warning-text__text"], [1, "govuk-visually-hidden"], [1, "qm-service-message", "govuk-!-font-weight-bold"]], template: function ReadQueryManagementFieldComponent_Template(rf, ctx) { if (rf & 1) {
23465
+ i0.ɵɵtemplate(0, ReadQueryManagementFieldComponent_ng_container_0_Template, 2, 1, "ng-container", 2)(1, ReadQueryManagementFieldComponent_ng_template_1_Template, 3, 4, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
23605
23466
  } if (rf & 2) {
23606
- const singleQueryDetails_r7 = i0.ɵɵreference(2);
23607
- i0.ɵɵproperty("ngIf", ctx.showQueryList)("ngIfElse", singleQueryDetails_r7);
23467
+ const singleQueryDetails_r6 = i0.ɵɵreference(2);
23468
+ i0.ɵɵproperty("ngIf", ctx.showQueryList)("ngIfElse", singleQueryDetails_r6);
23608
23469
  } }, encapsulation: 2 });
23609
23470
  }
23610
23471
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ReadQueryManagementFieldComponent, [{
23611
23472
  type: Component,
23612
- args: [{ selector: 'ccd-read-query-management-field', template: "<ng-container *ngIf=\"showQueryList; else singleQueryDetails\">\n <ng-container *ngFor=\"let caseQueriesCollection of caseQueriesCollections\">\n <div *ngIf=\"showQueryList\" class=\"govuk-!-margin-top-8 govuk-!-margin-bottom-8\">\n <ccd-query-list (selectedQuery)=\"setQuery($event)\" [caseQueriesCollection]=\"caseQueriesCollection\"></ccd-query-list>\n </div>\n </ng-container>\n</ng-container>\n\n<ng-template #singleQueryDetails>\n <ccd-query-details\n [query]=\"query\"\n (backClicked)=\"showQueryList = true\"\n [caseId]=\"caseId\"\n ></ccd-query-details>\n\n <ng-container *ngIf=\"!isInternalUser() && !isQueryClosed\">\n <ng-container *ngIf=\"(messageType && messageType === followUpQuery && isMultipleFollowUpEnabled) || (messageType && messageType === respondToQuery); else sequentialQuery\">\n <button id=\"ask-follow-up-question\" class=\"govuk-button\" data-module=\"govuk-button\"\n [routerLink]=\"['/query-management', 'query', caseId, '4', query.id]\">\n {{ 'Ask a follow-up question' | rpxTranslate }}\n </button>\n </ng-container>\n <ng-template #sequentialQuery>\n <ng-container *ngIf=\"query?.children?.length > 0 && query?.children?.length % 2 === 1; else queryIsInReview\">\n <button id=\"ask-follow-up-question\" class=\"govuk-button\" data-module=\"govuk-button\"\n [routerLink]=\"['/query-management', 'query', caseId, '4', query.id]\">\n {{ 'Ask a follow-up question' | rpxTranslate }}\n </button>\n </ng-container>\n\n <ng-template #queryIsInReview>\n <div>\n <p class=\"govuk-!-font-weight-bold\">{{ 'Your query is under review' | rpxTranslate }}</p>\n <p>{{ 'Our team will read your query and respond. Do not submit the same query more than once.' | rpxTranslate }}</p>\n </div>\n </ng-template>\n </ng-template>\n\n </ng-container>\n <ng-container *ngIf=\"isQueryClosed\">\n <div class=\"govuk-warning-text\">\n <span aria-hidden=\"true\" class=\"govuk-warning-text__icon\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-visually-hidden\">Warning</span>\n <p class=\"qm-service-message govuk-!-font-weight-bold\">{{ 'This query has been closed by HMCTS staff.' | rpxTranslate }}</p>\n </strong>\n </div>\n </ng-container>\n</ng-template>\n" }]
23613
- }], () => [{ type: i1$1.ActivatedRoute }, { type: SessionStorageService }, { type: CaseNotifier }, { type: AbstractAppConfig }], null); })();
23614
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadQueryManagementFieldComponent, { className: "ReadQueryManagementFieldComponent", filePath: "lib/shared/components/palette/query-management/read-query-management-field.component.ts", lineNumber: 18 }); })();
23473
+ args: [{ selector: 'ccd-read-query-management-field', template: "<ng-container *ngIf=\"showQueryList; else singleQueryDetails\">\n <ng-container *ngFor=\"let caseQueriesCollection of caseQueriesCollections\">\n <div *ngIf=\"showQueryList\" class=\"govuk-!-margin-top-8 govuk-!-margin-bottom-8\">\n <ccd-query-list (selectedQuery)=\"setQuery($event)\" [caseQueriesCollection]=\"caseQueriesCollection\"></ccd-query-list>\n </div>\n </ng-container>\n</ng-container>\n\n<ng-template #singleQueryDetails>\n <ccd-query-details\n [query]=\"query\"\n (backClicked)=\"showQueryList = true\"\n [caseId]=\"caseId\"\n ></ccd-query-details>\n\n <ng-container *ngIf=\"!isInternalUser() && !isQueryClosed\">\n <ng-container *ngIf=\"query?.children?.length > 0 && query?.children?.length % 2 === 1; else queryIsInReview\">\n <button id=\"ask-follow-up-question\" class=\"govuk-button\" data-module=\"govuk-button\"\n [routerLink]=\"['/query-management', 'query', caseId, '4', query.id]\">\n {{ 'Ask a follow-up question' | rpxTranslate }}\n </button>\n </ng-container>\n\n <ng-template #queryIsInReview>\n <div>\n <p class=\"govuk-!-font-weight-bold\">{{ 'Your query is under review' | rpxTranslate }}</p>\n <p>{{ 'Our team will read your query and respond. Do not submit the same query more than once.' | rpxTranslate }}</p>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"isQueryClosed\">\n <div class=\"govuk-warning-text\">\n <span aria-hidden=\"true\" class=\"govuk-warning-text__icon\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-visually-hidden\">Warning</span>\n <p class=\"qm-service-message govuk-!-font-weight-bold\">{{ 'This query has been closed by HMCTS staff.' | rpxTranslate }}</p>\n </strong>\n </div>\n </ng-container>\n</ng-template>\n" }]
23474
+ }], () => [{ type: i1$1.ActivatedRoute }, { type: SessionStorageService }, { type: CaseNotifier }], null); })();
23475
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadQueryManagementFieldComponent, { className: "ReadQueryManagementFieldComponent", filePath: "lib/shared/components/palette/query-management/read-query-management-field.component.ts", lineNumber: 15 }); })();
23615
23476
 
23616
23477
  class ReadTextAreaFieldComponent extends AbstractFieldReadComponent {
23617
23478
  static ɵfac = /*@__PURE__*/ (() => { let ɵReadTextAreaFieldComponent_BaseFactory; return function ReadTextAreaFieldComponent_Factory(__ngFactoryType__) { return (ɵReadTextAreaFieldComponent_BaseFactory || (ɵReadTextAreaFieldComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ReadTextAreaFieldComponent)))(__ngFactoryType__ || ReadTextAreaFieldComponent); }; })();