@hmcts/ccd-case-ui-toolkit 7.2.27-close-message → 7.2.27-multiple-followup

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 (26) hide show
  1. package/esm2022/lib/app.config.mjs +2 -1
  2. package/esm2022/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.mjs +6 -3
  3. package/esm2022/lib/shared/components/palette/query-management/components/query-details/query-details.component.mjs +55 -8
  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 +43 -7
  6. package/esm2022/lib/shared/components/palette/query-management/read-query-management-field.component.mjs +78 -25
  7. package/esm2022/lib/shared/components/palette/query-management/utils/query-management.utils.mjs +12 -4
  8. package/esm2022/lib/shared/utils.mjs +1 -1
  9. package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs +180 -41
  10. package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
  11. package/lib/app.config.d.ts +2 -0
  12. package/lib/app.config.d.ts.map +1 -1
  13. package/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.d.ts +2 -1
  14. package/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.d.ts.map +1 -1
  15. package/lib/shared/components/palette/query-management/components/query-details/query-details.component.d.ts +15 -3
  16. package/lib/shared/components/palette/query-management/components/query-details/query-details.component.d.ts.map +1 -1
  17. package/lib/shared/components/palette/query-management/models/case-queries-collection.model.d.ts +1 -0
  18. package/lib/shared/components/palette/query-management/models/case-queries-collection.model.d.ts.map +1 -1
  19. package/lib/shared/components/palette/query-management/models/query-list/query-list-item/query-list-item.model.d.ts +1 -0
  20. package/lib/shared/components/palette/query-management/models/query-list/query-list-item/query-list-item.model.d.ts.map +1 -1
  21. package/lib/shared/components/palette/query-management/read-query-management-field.component.d.ts +15 -3
  22. package/lib/shared/components/palette/query-management/read-query-management-field.component.d.ts.map +1 -1
  23. package/lib/shared/components/palette/query-management/utils/query-management.utils.d.ts +1 -1
  24. package/lib/shared/components/palette/query-management/utils/query-management.utils.d.ts.map +1 -1
  25. package/lib/shared/utils.d.ts +1 -1
  26. package/package.json +1 -1
@@ -1326,6 +1326,7 @@ class CaseEditorConfig {
1326
1326
  icp_enabled;
1327
1327
  icp_jurisdictions;
1328
1328
  events_to_hide;
1329
+ enable_service_specific_multi_followups;
1329
1330
  }
1330
1331
 
1331
1332
  class HttpError {
@@ -20912,6 +20913,7 @@ class QueryListItem {
20912
20913
  createdBy;
20913
20914
  parentId;
20914
20915
  isClosed;
20916
+ messageType;
20915
20917
  children = [];
20916
20918
  messageIndexInParent = null;
20917
20919
  get lastSubmittedMessage() {
@@ -20938,14 +20940,34 @@ class QueryListItem {
20938
20940
  }
20939
20941
  get lastSubmittedDate() {
20940
20942
  const childrenCount = this.children.length;
20941
- if (childrenCount <= 1) {
20943
+ const lastChild = this.children[childrenCount - 1];
20944
+ // 1. Check for legacy: <= 1 child with no messageType
20945
+ const allChildrenLackMessageType = this.children.every((child) => !child.messageType);
20946
+ if (childrenCount <= 1 && allChildrenLackMessageType) {
20942
20947
  return new Date(this.lastSubmittedMessage.createdOn);
20943
20948
  }
20944
- let index;
20945
- if (childrenCount > 1) {
20946
- index = childrenCount % 2 === 0 ? childrenCount - 1 : childrenCount - 2;
20949
+ // 2. Check if any RESPOND exists
20950
+ const hasRespond = this.children.some((child) => child.messageType === QueryCreateContext.RESPOND);
20951
+ // 3. Check if all children are FOLLOWUPs and none are RESPONDs
20952
+ const onlyFollowUps = this.children.every((child) => child.messageType === QueryCreateContext.FOLLOWUP);
20953
+ if (onlyFollowUps && !hasRespond) {
20954
+ return new Date(lastChild.createdOn);
20947
20955
  }
20948
- return new Date(this.children[index].createdOn);
20956
+ // 4. If RESPOND exists, get latest FOLLOWUP
20957
+ // If no RESPOND, but there is at least one FOLLOWUP, return the last FOLLOWUP
20958
+ const lastFollowUp = [...this.children]
20959
+ .reverse()
20960
+ .find((child) => child.messageType === QueryCreateContext.FOLLOWUP);
20961
+ if (lastFollowUp) {
20962
+ return new Date(lastFollowUp.createdOn);
20963
+ }
20964
+ // 5. Legacy fallback: no messageType at all
20965
+ if (allChildrenLackMessageType) {
20966
+ const index = childrenCount % 2 === 0 ? childrenCount - 1 : childrenCount - 2;
20967
+ return new Date(this.children[index]?.createdOn);
20968
+ }
20969
+ // 6. Final fallback: return last child's date
20970
+ return new Date(this.lastSubmittedMessage.createdOn);
20949
20971
  }
20950
20972
  get lastResponseBy() {
20951
20973
  return this.children?.length > 0 ? this.lastSubmittedMessage.name : '';
@@ -20955,6 +20977,11 @@ class QueryListItem {
20955
20977
  if (childrenCount === 0) {
20956
20978
  return null;
20957
20979
  }
20980
+ const lastChild = this.children[childrenCount - 1];
20981
+ if (lastChild?.messageType === QueryCreateContext.FOLLOWUP &&
20982
+ !this.children.some((child) => child.messageType === QueryCreateContext.RESPOND)) {
20983
+ return null;
20984
+ }
20958
20985
  let index;
20959
20986
  if (childrenCount === 1) {
20960
20987
  index = 0;
@@ -20969,11 +20996,20 @@ class QueryListItem {
20969
20996
  if (item.isClosed === 'Yes') {
20970
20997
  return true;
20971
20998
  }
20972
- return item.children?.some(child => isThreadClosed(child)) || false;
20999
+ return item.children?.some((child) => isThreadClosed(child)) || false;
20973
21000
  };
20974
21001
  if (isThreadClosed(this)) {
20975
21002
  return QueryItemResponseStatus.CLOSED;
20976
21003
  }
21004
+ const lastMessageType = this.children?.length
21005
+ ? this.children[this.children.length - 1]?.messageType
21006
+ : undefined;
21007
+ if (lastMessageType && lastMessageType === QueryCreateContext.RESPOND) {
21008
+ return QueryItemResponseStatus.RESPONDED;
21009
+ }
21010
+ else if (lastMessageType && lastMessageType === QueryCreateContext.FOLLOWUP) {
21011
+ return QueryItemResponseStatus.AWAITING;
21012
+ }
20977
21013
  if (this.messageIndexInParent !== null) {
20978
21014
  return this.messageIndexInParent % 2 === 0
20979
21015
  ? QueryItemResponseStatus.RESPONDED
@@ -21062,16 +21098,22 @@ class QueryManagementUtils {
21062
21098
  isHearingRelated,
21063
21099
  hearingDate,
21064
21100
  createdOn: new Date(),
21065
- createdBy: currentUserId
21101
+ createdBy: currentUserId,
21102
+ messageType: QueryCreateContext.FOLLOWUP // Default to value new queries will be FOLLOWUP
21066
21103
  };
21067
21104
  }
21068
- static getRespondOrFollowupQueryData(formGroup, queryItem, currentUserDetails) {
21105
+ static getRespondOrFollowupQueryData(formGroup, queryItem, currentUserDetails, messageTypeParam) {
21069
21106
  const currentUserId = currentUserDetails?.uid || currentUserDetails?.id;
21070
21107
  const currentUserName = currentUserDetails?.name || `${currentUserDetails?.forename} ${currentUserDetails?.surname}`;
21071
21108
  const body = formGroup.get('body').value;
21072
21109
  const attachments = formGroup.get('attachments').value;
21073
21110
  const formDocument = attachments.map((document) => this.documentToCollectionFormDocument(document));
21074
21111
  const isClosed = formGroup.get('closeQuery').value ? 'Yes' : 'No';
21112
+ const messageType = messageTypeParam === QueryCreateContext.RESPOND
21113
+ ? QueryCreateContext.RESPOND
21114
+ : messageTypeParam === QueryCreateContext.FOLLOWUP
21115
+ ? QueryCreateContext.FOLLOWUP
21116
+ : undefined;
21075
21117
  return {
21076
21118
  id: v4(),
21077
21119
  subject: queryItem.subject,
@@ -21083,7 +21125,8 @@ class QueryManagementUtils {
21083
21125
  createdOn: new Date(),
21084
21126
  createdBy: currentUserId,
21085
21127
  parentId: queryItem.id,
21086
- isClosed
21128
+ isClosed,
21129
+ messageType
21087
21130
  };
21088
21131
  }
21089
21132
  static isObject(elem) {
@@ -21442,6 +21485,7 @@ class QueryCheckYourAnswersComponent {
21442
21485
  queryItem;
21443
21486
  queryCreateContext;
21444
21487
  eventData = null;
21488
+ multipleFollowUpFeature;
21445
21489
  backClicked = new EventEmitter();
21446
21490
  querySubmitted = new EventEmitter();
21447
21491
  callbackConfirmationMessage = new EventEmitter();
@@ -21614,7 +21658,7 @@ class QueryCheckYourAnswersComponent {
21614
21658
  const currentUserDetails = JSON.parse(this.sessionStorageService.getItem(USER_DETAILS));
21615
21659
  const caseMessage = this.queryCreateContext === QueryCreateContext.NEW_QUERY
21616
21660
  ? QueryManagementUtils.getNewQueryData(this.formGroup, currentUserDetails)
21617
- : QueryManagementUtils.getRespondOrFollowupQueryData(this.formGroup, this.queryItem, currentUserDetails);
21661
+ : QueryManagementUtils.getRespondOrFollowupQueryData(this.formGroup, this.queryItem, currentUserDetails, this.queryCreateContext);
21618
21662
  const messageId = this.route.snapshot.params.dataid; // Get the message ID from route params (if present)
21619
21663
  const isNewQuery = this.queryCreateContext === QueryCreateContext.NEW_QUERY; // Check if this is a new query
21620
21664
  // Check if the field ID has been set dynamically
@@ -21774,7 +21818,7 @@ class QueryCheckYourAnswersComponent {
21774
21818
  return !!(error?.callbackErrors?.length);
21775
21819
  }
21776
21820
  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(SessionStorageService), i0.ɵɵdirectiveInject(QualifyingQuestionService)); };
21777
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QueryCheckYourAnswersComponent, selectors: [["ccd-query-check-your-answers"]], inputs: { formGroup: "formGroup", queryItem: "queryItem", queryCreateContext: "queryCreateContext", eventData: "eventData" }, 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) {
21821
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QueryCheckYourAnswersComponent, selectors: [["ccd-query-check-your-answers"]], inputs: { formGroup: "formGroup", queryItem: "queryItem", queryCreateContext: "queryCreateContext", eventData: "eventData", multipleFollowUpFeature: "multipleFollowUpFeature" }, 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) {
21778
21822
  i0.ɵɵtemplate(0, QueryCheckYourAnswersComponent_div_0_Template, 36, 25, "div", 2);
21779
21823
  } if (rf & 2) {
21780
21824
  i0.ɵɵproperty("ngIf", ctx.readyToSubmit);
@@ -21791,6 +21835,8 @@ class QueryCheckYourAnswersComponent {
21791
21835
  type: Input
21792
21836
  }], eventData: [{
21793
21837
  type: Input
21838
+ }], multipleFollowUpFeature: [{
21839
+ type: Input
21794
21840
  }], backClicked: [{
21795
21841
  type: Output
21796
21842
  }], querySubmitted: [{
@@ -22010,10 +22056,12 @@ function QueryDetailsComponent_ng_container_0_ng_container_44_ng_container_1_Tem
22010
22056
  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);
22011
22057
  i0.ɵɵelementContainerEnd();
22012
22058
  } if (rf & 2) {
22059
+ const child_r3 = ctx.$implicit;
22013
22060
  const i_r4 = ctx.index;
22014
22061
  const followUpMessage_r5 = i0.ɵɵreference(3);
22062
+ const ctx_r1 = i0.ɵɵnextContext(3);
22015
22063
  i0.ɵɵadvance();
22016
- i0.ɵɵproperty("ngIf", i_r4 % 2 === 0)("ngIfElse", followUpMessage_r5);
22064
+ 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);
22017
22065
  } }
22018
22066
  function QueryDetailsComponent_ng_container_0_ng_container_44_Template(rf, ctx) { if (rf & 1) {
22019
22067
  i0.ɵɵelementContainerStart(0);
@@ -22117,6 +22165,8 @@ class QueryDetailsComponent {
22117
22165
  sessionStorageService;
22118
22166
  route;
22119
22167
  router;
22168
+ abstractConfig;
22169
+ caseNotifier;
22120
22170
  query;
22121
22171
  caseId;
22122
22172
  queryResponseStatus;
@@ -22126,10 +22176,18 @@ class QueryDetailsComponent {
22126
22176
  static QUERY_ITEM_RESPOND = '3';
22127
22177
  static QUERY_ITEM_FOLLOW_UP = '4';
22128
22178
  queryItemId;
22129
- constructor(sessionStorageService, route, router) {
22179
+ followUpQuery = QueryCreateContext.FOLLOWUP;
22180
+ respondToQuery = QueryCreateContext.RESPOND;
22181
+ enableServiceSpecificMultiFollowups;
22182
+ currentJurisdictionId;
22183
+ isMultipleFollowUpEnabled = false;
22184
+ caseSubscription;
22185
+ constructor(sessionStorageService, route, router, abstractConfig, caseNotifier) {
22130
22186
  this.sessionStorageService = sessionStorageService;
22131
22187
  this.route = route;
22132
22188
  this.router = router;
22189
+ this.abstractConfig = abstractConfig;
22190
+ this.caseNotifier = caseNotifier;
22133
22191
  }
22134
22192
  onBack() {
22135
22193
  this.backClicked.emit(true);
@@ -22137,10 +22195,23 @@ class QueryDetailsComponent {
22137
22195
  isInternalUser() {
22138
22196
  return isInternalUser(this.sessionStorageService);
22139
22197
  }
22198
+ ngOnInit() {
22199
+ this.enableServiceSpecificMultiFollowups = this.abstractConfig.getEnableServiceSpecificMultiFollowups() || [];
22200
+ this.caseSubscription = this.caseNotifier.caseView.subscribe((caseView) => {
22201
+ if (caseView?.case_type?.jurisdiction?.id) {
22202
+ this.currentJurisdictionId = caseView.case_type.jurisdiction.id;
22203
+ this.isMultipleFollowUpEnabled = this.enableServiceSpecificMultiFollowups.includes(this.currentJurisdictionId);
22204
+ this.hasRespondedToQuery();
22205
+ }
22206
+ });
22207
+ }
22140
22208
  ngOnChanges() {
22141
22209
  this.toggleLinkVisibility();
22142
22210
  this.hasRespondedToQuery();
22143
22211
  }
22212
+ ngOnDestroy() {
22213
+ this.caseSubscription?.unsubscribe();
22214
+ }
22144
22215
  toggleLinkVisibility() {
22145
22216
  this.queryItemId = this.route.snapshot.params.qid;
22146
22217
  if (this.queryItemId === QueryDetailsComponent.QUERY_ITEM_RESPOND || this.queryItemId === QueryDetailsComponent.QUERY_ITEM_FOLLOW_UP) {
@@ -22153,6 +22224,24 @@ class QueryDetailsComponent {
22153
22224
  this.hasResponded.emit(true);
22154
22225
  return true;
22155
22226
  }
22227
+ const lastChild = this.query?.children?.[this.query.children.length - 1];
22228
+ const lastMessageType = this.query?.children?.length
22229
+ ? this.query.children[this.query.children.length - 1]?.messageType
22230
+ : this.query?.messageType;
22231
+ const isFollowUp = lastMessageType === this.followUpQuery;
22232
+ const isRespond = lastChild?.messageType === this.respondToQuery;
22233
+ if (this.queryResponseStatus === QueryItemResponseStatus.CLOSED) {
22234
+ this.hasResponded.emit(true);
22235
+ return true;
22236
+ }
22237
+ if (isFollowUp && this.isMultipleFollowUpEnabled) {
22238
+ this.hasResponded.emit(false);
22239
+ return false;
22240
+ }
22241
+ if (isRespond) {
22242
+ this.hasResponded.emit(false);
22243
+ return false;
22244
+ }
22156
22245
  if (this.isInternalUser()) {
22157
22246
  if (isAwaiting) {
22158
22247
  this.hasResponded.emit(false);
@@ -22168,7 +22257,7 @@ class QueryDetailsComponent {
22168
22257
  this.hasResponded.emit(false);
22169
22258
  return false;
22170
22259
  }
22171
- static ɵfac = function QueryDetailsComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || QueryDetailsComponent)(i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(i1$1.Router)); };
22260
+ 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)); };
22172
22261
  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) {
22173
22262
  i0.ɵɵtemplate(0, QueryDetailsComponent_ng_container_0_Template, 45, 41, "ng-container", 1);
22174
22263
  } if (rf & 2) {
@@ -22177,8 +22266,8 @@ class QueryDetailsComponent {
22177
22266
  }
22178
22267
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(QueryDetailsComponent, [{
22179
22268
  type: Component,
22180
- 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"] }]
22181
- }], () => [{ type: SessionStorageService }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }], { query: [{
22269
+ 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"] }]
22270
+ }], () => [{ type: SessionStorageService }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: AbstractAppConfig }, { type: CaseNotifier }], { query: [{
22182
22271
  type: Input
22183
22272
  }], caseId: [{
22184
22273
  type: Input
@@ -22189,7 +22278,7 @@ class QueryDetailsComponent {
22189
22278
  }], hasResponded: [{
22190
22279
  type: Output
22191
22280
  }] }); })();
22192
- (() => { (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 }); })();
22281
+ (() => { (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 }); })();
22193
22282
 
22194
22283
  class QueryEventCompletionComponent {
22195
22284
  eventCompletionParams;
@@ -23188,7 +23277,7 @@ class CloseQueryComponent {
23188
23277
  const _c0$B = (a0, a1) => ["/query-management", "query", a0, "4", a1];
23189
23278
  function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_Template(rf, ctx) { if (rf & 1) {
23190
23279
  const _r1 = i0.ɵɵgetCurrentView();
23191
- i0.ɵɵelementStart(0, "div", 5)(1, "ccd-query-list", 6);
23280
+ i0.ɵɵelementStart(0, "div", 6)(1, "ccd-query-list", 7);
23192
23281
  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)); });
23193
23282
  i0.ɵɵelementEnd()();
23194
23283
  } if (rf & 2) {
@@ -23198,7 +23287,7 @@ function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_T
23198
23287
  } }
23199
23288
  function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_Template(rf, ctx) { if (rf & 1) {
23200
23289
  i0.ɵɵelementContainerStart(0);
23201
- i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_Template, 2, 1, "div", 4);
23290
+ i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_Template, 2, 1, "div", 5);
23202
23291
  i0.ɵɵelementContainerEnd();
23203
23292
  } if (rf & 2) {
23204
23293
  const ctx_r1 = i0.ɵɵnextContext(2);
@@ -23207,7 +23296,7 @@ function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_Templat
23207
23296
  } }
23208
23297
  function ReadQueryManagementFieldComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
23209
23298
  i0.ɵɵelementContainerStart(0);
23210
- i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_Template, 2, 1, "ng-container", 3);
23299
+ i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_Template, 2, 1, "ng-container", 4);
23211
23300
  i0.ɵɵelementContainerEnd();
23212
23301
  } if (rf & 2) {
23213
23302
  const ctx_r1 = i0.ɵɵnextContext();
@@ -23216,7 +23305,7 @@ function ReadQueryManagementFieldComponent_ng_container_0_Template(rf, ctx) { if
23216
23305
  } }
23217
23306
  function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
23218
23307
  i0.ɵɵelementContainerStart(0);
23219
- i0.ɵɵelementStart(1, "button", 9);
23308
+ i0.ɵɵelementStart(1, "button", 10);
23220
23309
  i0.ɵɵtext(2);
23221
23310
  i0.ɵɵpipe(3, "rpxTranslate");
23222
23311
  i0.ɵɵelementEnd();
@@ -23228,8 +23317,22 @@ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_conta
23228
23317
  i0.ɵɵadvance();
23229
23318
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 2, "Ask a follow-up question"), " ");
23230
23319
  } }
23231
- function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_Template(rf, ctx) { if (rf & 1) {
23232
- i0.ɵɵelementStart(0, "div")(1, "p", 10);
23320
+ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_ng_container_0_Template(rf, ctx) { if (rf & 1) {
23321
+ i0.ɵɵelementContainerStart(0);
23322
+ i0.ɵɵelementStart(1, "button", 10);
23323
+ i0.ɵɵtext(2);
23324
+ i0.ɵɵpipe(3, "rpxTranslate");
23325
+ i0.ɵɵelementEnd();
23326
+ i0.ɵɵelementContainerEnd();
23327
+ } if (rf & 2) {
23328
+ const ctx_r1 = i0.ɵɵnextContext(4);
23329
+ i0.ɵɵadvance();
23330
+ i0.ɵɵproperty("routerLink", i0.ɵɵpureFunction2(4, _c0$B, ctx_r1.caseId, ctx_r1.query.id));
23331
+ i0.ɵɵadvance();
23332
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 2, "Ask a follow-up question"), " ");
23333
+ } }
23334
+ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_ng_template_1_Template(rf, ctx) { if (rf & 1) {
23335
+ i0.ɵɵelementStart(0, "div")(1, "p", 11);
23233
23336
  i0.ɵɵtext(2);
23234
23337
  i0.ɵɵpipe(3, "rpxTranslate");
23235
23338
  i0.ɵɵelementEnd();
@@ -23243,25 +23346,32 @@ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_templ
23243
23346
  i0.ɵɵadvance(3);
23244
23347
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(6, 4, "Our team will read your query and respond. Do not submit the same query more than once."));
23245
23348
  } }
23349
+ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_Template(rf, ctx) { if (rf & 1) {
23350
+ 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);
23351
+ } if (rf & 2) {
23352
+ const queryIsInReview_r5 = i0.ɵɵreference(2);
23353
+ const ctx_r1 = i0.ɵɵnextContext(3);
23354
+ 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);
23355
+ } }
23246
23356
  function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
23247
23357
  i0.ɵɵelementContainerStart(0);
23248
- 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);
23358
+ 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);
23249
23359
  i0.ɵɵelementContainerEnd();
23250
23360
  } if (rf & 2) {
23251
- const queryIsInReview_r5 = i0.ɵɵreference(3);
23361
+ const sequentialQuery_r6 = i0.ɵɵreference(3);
23252
23362
  const ctx_r1 = i0.ɵɵnextContext(2);
23253
23363
  i0.ɵɵadvance();
23254
- 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);
23364
+ 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);
23255
23365
  } }
23256
23366
  function ReadQueryManagementFieldComponent_ng_template_1_ng_container_2_Template(rf, ctx) { if (rf & 1) {
23257
23367
  i0.ɵɵelementContainerStart(0);
23258
- i0.ɵɵelementStart(1, "div", 11)(2, "span", 12);
23368
+ i0.ɵɵelementStart(1, "div", 12)(2, "span", 13);
23259
23369
  i0.ɵɵtext(3, "!");
23260
23370
  i0.ɵɵelementEnd();
23261
- i0.ɵɵelementStart(4, "strong", 13)(5, "span", 14);
23371
+ i0.ɵɵelementStart(4, "strong", 14)(5, "span", 15);
23262
23372
  i0.ɵɵtext(6, "Warning");
23263
23373
  i0.ɵɵelementEnd();
23264
- i0.ɵɵelementStart(7, "p", 15);
23374
+ i0.ɵɵelementStart(7, "p", 16);
23265
23375
  i0.ɵɵtext(8);
23266
23376
  i0.ɵɵpipe(9, "rpxTranslate");
23267
23377
  i0.ɵɵelementEnd()()();
@@ -23272,35 +23382,52 @@ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_2_Template
23272
23382
  } }
23273
23383
  function ReadQueryManagementFieldComponent_ng_template_1_Template(rf, ctx) { if (rf & 1) {
23274
23384
  const _r4 = i0.ɵɵgetCurrentView();
23275
- i0.ɵɵelementStart(0, "ccd-query-details", 7);
23385
+ i0.ɵɵelementStart(0, "ccd-query-details", 8);
23276
23386
  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); });
23277
23387
  i0.ɵɵelementEnd();
23278
- 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);
23388
+ 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);
23279
23389
  } if (rf & 2) {
23280
23390
  const ctx_r1 = i0.ɵɵnextContext();
23281
23391
  i0.ɵɵproperty("query", ctx_r1.query)("caseId", ctx_r1.caseId);
23282
23392
  i0.ɵɵadvance();
23283
23393
  i0.ɵɵproperty("ngIf", !ctx_r1.isInternalUser() && !ctx_r1.isQueryClosed);
23284
23394
  i0.ɵɵadvance();
23285
- i0.ɵɵproperty("ngIf", ctx_r1.isQueryClosed);
23395
+ i0.ɵɵproperty("ngIf", !ctx_r1.isInternalUser() && ctx_r1.isQueryClosed);
23286
23396
  } }
23287
23397
  class ReadQueryManagementFieldComponent extends AbstractFieldReadComponent {
23288
23398
  route;
23289
23399
  sessionStorageService;
23290
23400
  caseNotifier;
23401
+ abstractConfig;
23291
23402
  caseQueriesCollections;
23292
23403
  query;
23293
23404
  showQueryList = true;
23294
23405
  caseId;
23406
+ messageType;
23407
+ followUpQuery = QueryCreateContext.FOLLOWUP;
23408
+ respondToQuery = QueryCreateContext.RESPOND;
23295
23409
  isQueryClosed = false;
23296
- constructor(route, sessionStorageService, caseNotifier) {
23410
+ value;
23411
+ isMultipleFollowUpEnabled = false;
23412
+ currentJurisdictionId;
23413
+ enableServiceSpecificMultiFollowups = [];
23414
+ caseSubscription;
23415
+ constructor(route, sessionStorageService, caseNotifier, abstractConfig) {
23297
23416
  super();
23298
23417
  this.route = route;
23299
23418
  this.sessionStorageService = sessionStorageService;
23300
23419
  this.caseNotifier = caseNotifier;
23420
+ this.abstractConfig = abstractConfig;
23301
23421
  }
23302
23422
  ngOnInit() {
23303
23423
  this.caseId = this.route.snapshot.params.cid;
23424
+ this.enableServiceSpecificMultiFollowups = this.abstractConfig.getEnableServiceSpecificMultiFollowups() || [];
23425
+ this.caseSubscription = this.caseNotifier.caseView.subscribe((caseDetails) => {
23426
+ if (caseDetails?.case_type?.jurisdiction?.id) {
23427
+ this.currentJurisdictionId = caseDetails.case_type.jurisdiction.id;
23428
+ this.isMultipleFollowUpEnabled = this.enableServiceSpecificMultiFollowups.includes(this.currentJurisdictionId);
23429
+ }
23430
+ });
23304
23431
  if (this.context === PaletteContext.DEFAULT) {
23305
23432
  // EUI-8303 Using mock data until CCD is ready with the API and data contract
23306
23433
  // this.caseQueriesCollections = caseMessagesMockData;
@@ -23326,9 +23453,13 @@ class ReadQueryManagementFieldComponent extends AbstractFieldReadComponent {
23326
23453
  // QueryManagementUtils.extractCaseQueriesFromCaseField();
23327
23454
  }
23328
23455
  }
23456
+ ngOnDestroy() {
23457
+ this.caseSubscription?.unsubscribe();
23458
+ }
23329
23459
  setQuery(query) {
23330
23460
  this.showQueryList = false;
23331
23461
  this.query = query;
23462
+ this.messageType = this.getMessageType(query);
23332
23463
  this.isQueryClosed = this.query?.children?.some((queryItem) => queryItem?.isClosed === 'Yes');
23333
23464
  }
23334
23465
  backToQueryListPage() {
@@ -23338,19 +23469,27 @@ class ReadQueryManagementFieldComponent extends AbstractFieldReadComponent {
23338
23469
  isInternalUser() {
23339
23470
  return isInternalUser(this.sessionStorageService);
23340
23471
  }
23341
- static ɵfac = function ReadQueryManagementFieldComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ReadQueryManagementFieldComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(CaseNotifier)); };
23342
- 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) {
23343
- 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);
23472
+ getMessageType(query) {
23473
+ if (!query) {
23474
+ return undefined;
23475
+ }
23476
+ return query.children?.length
23477
+ ? query.children[query.children.length - 1]?.messageType
23478
+ : query?.messageType;
23479
+ }
23480
+ static ɵfac = function ReadQueryManagementFieldComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ReadQueryManagementFieldComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(AbstractAppConfig)); };
23481
+ 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) {
23482
+ 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);
23344
23483
  } if (rf & 2) {
23345
- const singleQueryDetails_r6 = i0.ɵɵreference(2);
23346
- i0.ɵɵproperty("ngIf", ctx.showQueryList)("ngIfElse", singleQueryDetails_r6);
23484
+ const singleQueryDetails_r7 = i0.ɵɵreference(2);
23485
+ i0.ɵɵproperty("ngIf", ctx.showQueryList)("ngIfElse", singleQueryDetails_r7);
23347
23486
  } }, encapsulation: 2 });
23348
23487
  }
23349
23488
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ReadQueryManagementFieldComponent, [{
23350
23489
  type: Component,
23351
- 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 court staff.' | rpxTranslate }}</p>\n </strong>\n </div>\n </ng-container>\n</ng-template>\n" }]
23352
- }], () => [{ type: i1$1.ActivatedRoute }, { type: SessionStorageService }, { type: CaseNotifier }], null); })();
23353
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadQueryManagementFieldComponent, { className: "ReadQueryManagementFieldComponent", filePath: "lib/shared/components/palette/query-management/read-query-management-field.component.ts", lineNumber: 15 }); })();
23490
+ 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=\"!isInternalUser() && 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 court staff.' | rpxTranslate }}</p>\n </strong>\n </div>\n </ng-container>\n</ng-template>\n" }]
23491
+ }], () => [{ type: i1$1.ActivatedRoute }, { type: SessionStorageService }, { type: CaseNotifier }, { type: AbstractAppConfig }], null); })();
23492
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadQueryManagementFieldComponent, { className: "ReadQueryManagementFieldComponent", filePath: "lib/shared/components/palette/query-management/read-query-management-field.component.ts", lineNumber: 18 }); })();
23354
23493
 
23355
23494
  class ReadTextAreaFieldComponent extends AbstractFieldReadComponent {
23356
23495
  static ɵfac = /*@__PURE__*/ (() => { let ɵReadTextAreaFieldComponent_BaseFactory; return function ReadTextAreaFieldComponent_Factory(__ngFactoryType__) { return (ɵReadTextAreaFieldComponent_BaseFactory || (ɵReadTextAreaFieldComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ReadTextAreaFieldComponent)))(__ngFactoryType__ || ReadTextAreaFieldComponent); }; })();