@hmcts/ccd-case-ui-toolkit 7.2.22 → 7.2.23-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 +3 -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 +13 -2
  6. package/esm2022/lib/shared/components/palette/query-management/read-query-management-field.component.mjs +77 -24
  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 +150 -35
  10. package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
  11. package/lib/app.config.d.ts +3 -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,8 @@ class CaseEditorConfig {
1326
1326
  icp_enabled;
1327
1327
  icp_jurisdictions;
1328
1328
  events_to_hide;
1329
+ enable_service_specific_multi_followups;
1330
+ multiple_follow_up_enabled;
1329
1331
  }
1330
1332
 
1331
1333
  class HttpError {
@@ -20904,6 +20906,7 @@ class QueryListItem {
20904
20906
  createdBy;
20905
20907
  parentId;
20906
20908
  isClosed;
20909
+ messageType;
20907
20910
  children = [];
20908
20911
  messageIndexInParent = null;
20909
20912
  get lastSubmittedMessage() {
@@ -20968,11 +20971,20 @@ class QueryListItem {
20968
20971
  if (item.isClosed === 'Yes') {
20969
20972
  return true;
20970
20973
  }
20971
- return item.children?.some(child => isThreadClosed(child)) || false;
20974
+ return item.children?.some((child) => isThreadClosed(child)) || false;
20972
20975
  };
20973
20976
  if (isThreadClosed(this)) {
20974
20977
  return QueryItemResponseStatus.CLOSED;
20975
20978
  }
20979
+ const lastMessageType = this.children?.length
20980
+ ? this.children[this.children.length - 1]?.messageType
20981
+ : undefined;
20982
+ if (lastMessageType && lastMessageType === QueryCreateContext.RESPOND) {
20983
+ return QueryItemResponseStatus.RESPONDED;
20984
+ }
20985
+ else if (lastMessageType && lastMessageType === QueryCreateContext.FOLLOWUP) {
20986
+ return QueryItemResponseStatus.AWAITING;
20987
+ }
20976
20988
  if (this.messageIndexInParent !== null) {
20977
20989
  return this.messageIndexInParent % 2 === 0
20978
20990
  ? QueryItemResponseStatus.RESPONDED
@@ -21061,16 +21073,22 @@ class QueryManagementUtils {
21061
21073
  isHearingRelated,
21062
21074
  hearingDate,
21063
21075
  createdOn: new Date(),
21064
- createdBy: currentUserId
21076
+ createdBy: currentUserId,
21077
+ messageType: QueryCreateContext.FOLLOWUP // Default to value new queries will be FOLLOWUP
21065
21078
  };
21066
21079
  }
21067
- static getRespondOrFollowupQueryData(formGroup, queryItem, currentUserDetails) {
21080
+ static getRespondOrFollowupQueryData(formGroup, queryItem, currentUserDetails, messageTypeParam) {
21068
21081
  const currentUserId = currentUserDetails?.uid || currentUserDetails?.id;
21069
21082
  const currentUserName = currentUserDetails?.name || `${currentUserDetails?.forename} ${currentUserDetails?.surname}`;
21070
21083
  const body = formGroup.get('body').value;
21071
21084
  const attachments = formGroup.get('attachments').value;
21072
21085
  const formDocument = attachments.map((document) => this.documentToCollectionFormDocument(document));
21073
21086
  const isClosed = formGroup.get('closeQuery').value ? 'Yes' : 'No';
21087
+ const messageType = messageTypeParam === QueryCreateContext.RESPOND
21088
+ ? QueryCreateContext.RESPOND
21089
+ : messageTypeParam === QueryCreateContext.FOLLOWUP
21090
+ ? QueryCreateContext.FOLLOWUP
21091
+ : undefined;
21074
21092
  return {
21075
21093
  id: v4(),
21076
21094
  subject: queryItem.subject,
@@ -21082,7 +21100,8 @@ class QueryManagementUtils {
21082
21100
  createdOn: new Date(),
21083
21101
  createdBy: currentUserId,
21084
21102
  parentId: queryItem.id,
21085
- isClosed
21103
+ isClosed,
21104
+ messageType
21086
21105
  };
21087
21106
  }
21088
21107
  static isObject(elem) {
@@ -21441,6 +21460,7 @@ class QueryCheckYourAnswersComponent {
21441
21460
  queryItem;
21442
21461
  queryCreateContext;
21443
21462
  eventData = null;
21463
+ multipleFollowUpFeature;
21444
21464
  backClicked = new EventEmitter();
21445
21465
  querySubmitted = new EventEmitter();
21446
21466
  callbackConfirmationMessage = new EventEmitter();
@@ -21613,7 +21633,7 @@ class QueryCheckYourAnswersComponent {
21613
21633
  const currentUserDetails = JSON.parse(this.sessionStorageService.getItem(USER_DETAILS));
21614
21634
  const caseMessage = this.queryCreateContext === QueryCreateContext.NEW_QUERY
21615
21635
  ? QueryManagementUtils.getNewQueryData(this.formGroup, currentUserDetails)
21616
- : QueryManagementUtils.getRespondOrFollowupQueryData(this.formGroup, this.queryItem, currentUserDetails);
21636
+ : QueryManagementUtils.getRespondOrFollowupQueryData(this.formGroup, this.queryItem, currentUserDetails, this.queryCreateContext);
21617
21637
  const messageId = this.route.snapshot.params.dataid; // Get the message ID from route params (if present)
21618
21638
  const isNewQuery = this.queryCreateContext === QueryCreateContext.NEW_QUERY; // Check if this is a new query
21619
21639
  // Check if the field ID has been set dynamically
@@ -21773,7 +21793,7 @@ class QueryCheckYourAnswersComponent {
21773
21793
  return !!(error?.callbackErrors?.length);
21774
21794
  }
21775
21795
  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)); };
21776
- 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) {
21796
+ 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) {
21777
21797
  i0.ɵɵtemplate(0, QueryCheckYourAnswersComponent_div_0_Template, 36, 25, "div", 2);
21778
21798
  } if (rf & 2) {
21779
21799
  i0.ɵɵproperty("ngIf", ctx.readyToSubmit);
@@ -21790,6 +21810,8 @@ class QueryCheckYourAnswersComponent {
21790
21810
  type: Input
21791
21811
  }], eventData: [{
21792
21812
  type: Input
21813
+ }], multipleFollowUpFeature: [{
21814
+ type: Input
21793
21815
  }], backClicked: [{
21794
21816
  type: Output
21795
21817
  }], querySubmitted: [{
@@ -22009,10 +22031,12 @@ function QueryDetailsComponent_ng_container_0_ng_container_44_ng_container_1_Tem
22009
22031
  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);
22010
22032
  i0.ɵɵelementContainerEnd();
22011
22033
  } if (rf & 2) {
22034
+ const child_r3 = ctx.$implicit;
22012
22035
  const i_r4 = ctx.index;
22013
22036
  const followUpMessage_r5 = i0.ɵɵreference(3);
22037
+ const ctx_r1 = i0.ɵɵnextContext(3);
22014
22038
  i0.ɵɵadvance();
22015
- i0.ɵɵproperty("ngIf", i_r4 % 2 === 0)("ngIfElse", followUpMessage_r5);
22039
+ 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);
22016
22040
  } }
22017
22041
  function QueryDetailsComponent_ng_container_0_ng_container_44_Template(rf, ctx) { if (rf & 1) {
22018
22042
  i0.ɵɵelementContainerStart(0);
@@ -22116,6 +22140,8 @@ class QueryDetailsComponent {
22116
22140
  sessionStorageService;
22117
22141
  route;
22118
22142
  router;
22143
+ abstractConfig;
22144
+ caseNotifier;
22119
22145
  query;
22120
22146
  caseId;
22121
22147
  queryResponseStatus;
@@ -22125,10 +22151,18 @@ class QueryDetailsComponent {
22125
22151
  static QUERY_ITEM_RESPOND = '3';
22126
22152
  static QUERY_ITEM_FOLLOW_UP = '4';
22127
22153
  queryItemId;
22128
- constructor(sessionStorageService, route, router) {
22154
+ followUpQuery = QueryCreateContext.FOLLOWUP;
22155
+ respondToQuery = QueryCreateContext.RESPOND;
22156
+ enableServiceSpecificMultiFollowups;
22157
+ currentJurisdictionId;
22158
+ isMultipleFollowUpEnabled = false;
22159
+ caseSubscription;
22160
+ constructor(sessionStorageService, route, router, abstractConfig, caseNotifier) {
22129
22161
  this.sessionStorageService = sessionStorageService;
22130
22162
  this.route = route;
22131
22163
  this.router = router;
22164
+ this.abstractConfig = abstractConfig;
22165
+ this.caseNotifier = caseNotifier;
22132
22166
  }
22133
22167
  onBack() {
22134
22168
  this.backClicked.emit(true);
@@ -22136,10 +22170,23 @@ class QueryDetailsComponent {
22136
22170
  isInternalUser() {
22137
22171
  return isInternalUser(this.sessionStorageService);
22138
22172
  }
22173
+ ngOnInit() {
22174
+ this.enableServiceSpecificMultiFollowups = this.abstractConfig.getEnableServiceSpecificMultiFollowups() || [];
22175
+ this.caseSubscription = this.caseNotifier.caseView.subscribe((caseView) => {
22176
+ if (caseView?.case_type?.jurisdiction?.id) {
22177
+ this.currentJurisdictionId = caseView.case_type.jurisdiction.id;
22178
+ this.isMultipleFollowUpEnabled = this.enableServiceSpecificMultiFollowups.includes(this.currentJurisdictionId);
22179
+ this.hasRespondedToQuery();
22180
+ }
22181
+ });
22182
+ }
22139
22183
  ngOnChanges() {
22140
22184
  this.toggleLinkVisibility();
22141
22185
  this.hasRespondedToQuery();
22142
22186
  }
22187
+ ngOnDestroy() {
22188
+ this.caseSubscription?.unsubscribe();
22189
+ }
22143
22190
  toggleLinkVisibility() {
22144
22191
  this.queryItemId = this.route.snapshot.params.qid;
22145
22192
  if (this.queryItemId === QueryDetailsComponent.QUERY_ITEM_RESPOND || this.queryItemId === QueryDetailsComponent.QUERY_ITEM_FOLLOW_UP) {
@@ -22152,6 +22199,24 @@ class QueryDetailsComponent {
22152
22199
  this.hasResponded.emit(true);
22153
22200
  return true;
22154
22201
  }
22202
+ const lastChild = this.query?.children?.[this.query.children.length - 1];
22203
+ const lastMessageType = this.query?.children?.length
22204
+ ? this.query.children[this.query.children.length - 1]?.messageType
22205
+ : this.query?.messageType;
22206
+ const isFollowUp = lastMessageType === this.followUpQuery;
22207
+ const isRespond = lastChild?.messageType === this.respondToQuery;
22208
+ if (this.queryResponseStatus === QueryItemResponseStatus.CLOSED) {
22209
+ this.hasResponded.emit(true);
22210
+ return true;
22211
+ }
22212
+ if (isFollowUp && this.isMultipleFollowUpEnabled) {
22213
+ this.hasResponded.emit(false);
22214
+ return false;
22215
+ }
22216
+ if (isRespond) {
22217
+ this.hasResponded.emit(false);
22218
+ return false;
22219
+ }
22155
22220
  if (this.isInternalUser()) {
22156
22221
  if (isAwaiting) {
22157
22222
  this.hasResponded.emit(false);
@@ -22167,7 +22232,7 @@ class QueryDetailsComponent {
22167
22232
  this.hasResponded.emit(false);
22168
22233
  return false;
22169
22234
  }
22170
- static ɵfac = function QueryDetailsComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || QueryDetailsComponent)(i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(i1$1.Router)); };
22235
+ 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)); };
22171
22236
  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) {
22172
22237
  i0.ɵɵtemplate(0, QueryDetailsComponent_ng_container_0_Template, 45, 41, "ng-container", 1);
22173
22238
  } if (rf & 2) {
@@ -22176,8 +22241,8 @@ class QueryDetailsComponent {
22176
22241
  }
22177
22242
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(QueryDetailsComponent, [{
22178
22243
  type: Component,
22179
- 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"] }]
22180
- }], () => [{ type: SessionStorageService }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }], { query: [{
22244
+ 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"] }]
22245
+ }], () => [{ type: SessionStorageService }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: AbstractAppConfig }, { type: CaseNotifier }], { query: [{
22181
22246
  type: Input
22182
22247
  }], caseId: [{
22183
22248
  type: Input
@@ -22188,7 +22253,7 @@ class QueryDetailsComponent {
22188
22253
  }], hasResponded: [{
22189
22254
  type: Output
22190
22255
  }] }); })();
22191
- (() => { (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 }); })();
22256
+ (() => { (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 }); })();
22192
22257
 
22193
22258
  class QueryEventCompletionComponent {
22194
22259
  eventCompletionParams;
@@ -23187,7 +23252,7 @@ class CloseQueryComponent {
23187
23252
  const _c0$B = (a0, a1) => ["/query-management", "query", a0, "4", a1];
23188
23253
  function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_Template(rf, ctx) { if (rf & 1) {
23189
23254
  const _r1 = i0.ɵɵgetCurrentView();
23190
- i0.ɵɵelementStart(0, "div", 5)(1, "ccd-query-list", 6);
23255
+ i0.ɵɵelementStart(0, "div", 6)(1, "ccd-query-list", 7);
23191
23256
  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)); });
23192
23257
  i0.ɵɵelementEnd()();
23193
23258
  } if (rf & 2) {
@@ -23197,7 +23262,7 @@ function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_T
23197
23262
  } }
23198
23263
  function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_Template(rf, ctx) { if (rf & 1) {
23199
23264
  i0.ɵɵelementContainerStart(0);
23200
- i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_Template, 2, 1, "div", 4);
23265
+ i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_Template, 2, 1, "div", 5);
23201
23266
  i0.ɵɵelementContainerEnd();
23202
23267
  } if (rf & 2) {
23203
23268
  const ctx_r1 = i0.ɵɵnextContext(2);
@@ -23206,7 +23271,7 @@ function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_Templat
23206
23271
  } }
23207
23272
  function ReadQueryManagementFieldComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
23208
23273
  i0.ɵɵelementContainerStart(0);
23209
- i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_Template, 2, 1, "ng-container", 3);
23274
+ i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_Template, 2, 1, "ng-container", 4);
23210
23275
  i0.ɵɵelementContainerEnd();
23211
23276
  } if (rf & 2) {
23212
23277
  const ctx_r1 = i0.ɵɵnextContext();
@@ -23215,7 +23280,7 @@ function ReadQueryManagementFieldComponent_ng_container_0_Template(rf, ctx) { if
23215
23280
  } }
23216
23281
  function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
23217
23282
  i0.ɵɵelementContainerStart(0);
23218
- i0.ɵɵelementStart(1, "button", 9);
23283
+ i0.ɵɵelementStart(1, "button", 10);
23219
23284
  i0.ɵɵtext(2);
23220
23285
  i0.ɵɵpipe(3, "rpxTranslate");
23221
23286
  i0.ɵɵelementEnd();
@@ -23227,8 +23292,22 @@ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_conta
23227
23292
  i0.ɵɵadvance();
23228
23293
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 2, "Ask a follow-up question"), " ");
23229
23294
  } }
23230
- function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_Template(rf, ctx) { if (rf & 1) {
23231
- i0.ɵɵelementStart(0, "div")(1, "p", 10);
23295
+ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_ng_container_0_Template(rf, ctx) { if (rf & 1) {
23296
+ i0.ɵɵelementContainerStart(0);
23297
+ i0.ɵɵelementStart(1, "button", 10);
23298
+ i0.ɵɵtext(2);
23299
+ i0.ɵɵpipe(3, "rpxTranslate");
23300
+ i0.ɵɵelementEnd();
23301
+ i0.ɵɵelementContainerEnd();
23302
+ } if (rf & 2) {
23303
+ const ctx_r1 = i0.ɵɵnextContext(4);
23304
+ i0.ɵɵadvance();
23305
+ i0.ɵɵproperty("routerLink", i0.ɵɵpureFunction2(4, _c0$B, ctx_r1.caseId, ctx_r1.query.id));
23306
+ i0.ɵɵadvance();
23307
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 2, "Ask a follow-up question"), " ");
23308
+ } }
23309
+ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_ng_template_1_Template(rf, ctx) { if (rf & 1) {
23310
+ i0.ɵɵelementStart(0, "div")(1, "p", 11);
23232
23311
  i0.ɵɵtext(2);
23233
23312
  i0.ɵɵpipe(3, "rpxTranslate");
23234
23313
  i0.ɵɵelementEnd();
@@ -23242,25 +23321,32 @@ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_templ
23242
23321
  i0.ɵɵadvance(3);
23243
23322
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(6, 4, "Our team will read your query and respond. Do not submit the same query more than once."));
23244
23323
  } }
23324
+ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_Template(rf, ctx) { if (rf & 1) {
23325
+ 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);
23326
+ } if (rf & 2) {
23327
+ const queryIsInReview_r5 = i0.ɵɵreference(2);
23328
+ const ctx_r1 = i0.ɵɵnextContext(3);
23329
+ 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);
23330
+ } }
23245
23331
  function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
23246
23332
  i0.ɵɵelementContainerStart(0);
23247
- 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);
23333
+ 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);
23248
23334
  i0.ɵɵelementContainerEnd();
23249
23335
  } if (rf & 2) {
23250
- const queryIsInReview_r5 = i0.ɵɵreference(3);
23336
+ const sequentialQuery_r6 = i0.ɵɵreference(3);
23251
23337
  const ctx_r1 = i0.ɵɵnextContext(2);
23252
23338
  i0.ɵɵadvance();
23253
- 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);
23339
+ 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);
23254
23340
  } }
23255
23341
  function ReadQueryManagementFieldComponent_ng_template_1_ng_container_2_Template(rf, ctx) { if (rf & 1) {
23256
23342
  i0.ɵɵelementContainerStart(0);
23257
- i0.ɵɵelementStart(1, "div", 11)(2, "span", 12);
23343
+ i0.ɵɵelementStart(1, "div", 12)(2, "span", 13);
23258
23344
  i0.ɵɵtext(3, "!");
23259
23345
  i0.ɵɵelementEnd();
23260
- i0.ɵɵelementStart(4, "strong", 13)(5, "span", 14);
23346
+ i0.ɵɵelementStart(4, "strong", 14)(5, "span", 15);
23261
23347
  i0.ɵɵtext(6, "Warning");
23262
23348
  i0.ɵɵelementEnd();
23263
- i0.ɵɵelementStart(7, "p", 15);
23349
+ i0.ɵɵelementStart(7, "p", 16);
23264
23350
  i0.ɵɵtext(8);
23265
23351
  i0.ɵɵpipe(9, "rpxTranslate");
23266
23352
  i0.ɵɵelementEnd()()();
@@ -23271,10 +23357,10 @@ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_2_Template
23271
23357
  } }
23272
23358
  function ReadQueryManagementFieldComponent_ng_template_1_Template(rf, ctx) { if (rf & 1) {
23273
23359
  const _r4 = i0.ɵɵgetCurrentView();
23274
- i0.ɵɵelementStart(0, "ccd-query-details", 7);
23360
+ i0.ɵɵelementStart(0, "ccd-query-details", 8);
23275
23361
  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); });
23276
23362
  i0.ɵɵelementEnd();
23277
- 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);
23363
+ 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);
23278
23364
  } if (rf & 2) {
23279
23365
  const ctx_r1 = i0.ɵɵnextContext();
23280
23366
  i0.ɵɵproperty("query", ctx_r1.query)("caseId", ctx_r1.caseId);
@@ -23287,19 +23373,36 @@ class ReadQueryManagementFieldComponent extends AbstractFieldReadComponent {
23287
23373
  route;
23288
23374
  sessionStorageService;
23289
23375
  caseNotifier;
23376
+ abstractConfig;
23290
23377
  caseQueriesCollections;
23291
23378
  query;
23292
23379
  showQueryList = true;
23293
23380
  caseId;
23381
+ messageType;
23382
+ followUpQuery = QueryCreateContext.FOLLOWUP;
23383
+ respondToQuery = QueryCreateContext.RESPOND;
23294
23384
  isQueryClosed = false;
23295
- constructor(route, sessionStorageService, caseNotifier) {
23385
+ value;
23386
+ isMultipleFollowUpEnabled = false;
23387
+ currentJurisdictionId;
23388
+ enableServiceSpecificMultiFollowups = [];
23389
+ caseSubscription;
23390
+ constructor(route, sessionStorageService, caseNotifier, abstractConfig) {
23296
23391
  super();
23297
23392
  this.route = route;
23298
23393
  this.sessionStorageService = sessionStorageService;
23299
23394
  this.caseNotifier = caseNotifier;
23395
+ this.abstractConfig = abstractConfig;
23300
23396
  }
23301
23397
  ngOnInit() {
23302
23398
  this.caseId = this.route.snapshot.params.cid;
23399
+ this.enableServiceSpecificMultiFollowups = this.abstractConfig.getEnableServiceSpecificMultiFollowups() || [];
23400
+ this.caseSubscription = this.caseNotifier.caseView.subscribe((caseDetails) => {
23401
+ if (caseDetails?.case_type?.jurisdiction?.id) {
23402
+ this.currentJurisdictionId = caseDetails.case_type.jurisdiction.id;
23403
+ this.isMultipleFollowUpEnabled = this.enableServiceSpecificMultiFollowups.includes(this.currentJurisdictionId);
23404
+ }
23405
+ });
23303
23406
  if (this.context === PaletteContext.DEFAULT) {
23304
23407
  // EUI-8303 Using mock data until CCD is ready with the API and data contract
23305
23408
  // this.caseQueriesCollections = caseMessagesMockData;
@@ -23325,9 +23428,13 @@ class ReadQueryManagementFieldComponent extends AbstractFieldReadComponent {
23325
23428
  // QueryManagementUtils.extractCaseQueriesFromCaseField();
23326
23429
  }
23327
23430
  }
23431
+ ngOnDestroy() {
23432
+ this.caseSubscription?.unsubscribe();
23433
+ }
23328
23434
  setQuery(query) {
23329
23435
  this.showQueryList = false;
23330
23436
  this.query = query;
23437
+ this.messageType = this.getMessageType(query);
23331
23438
  this.isQueryClosed = this.query?.children?.some((queryItem) => queryItem?.isClosed === 'Yes');
23332
23439
  }
23333
23440
  backToQueryListPage() {
@@ -23337,19 +23444,27 @@ class ReadQueryManagementFieldComponent extends AbstractFieldReadComponent {
23337
23444
  isInternalUser() {
23338
23445
  return isInternalUser(this.sessionStorageService);
23339
23446
  }
23340
- static ɵfac = function ReadQueryManagementFieldComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ReadQueryManagementFieldComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(CaseNotifier)); };
23341
- 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) {
23342
- 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);
23447
+ getMessageType(query) {
23448
+ if (!query) {
23449
+ return undefined;
23450
+ }
23451
+ return query.children?.length
23452
+ ? query.children[query.children.length - 1]?.messageType
23453
+ : query?.messageType;
23454
+ }
23455
+ static ɵfac = function ReadQueryManagementFieldComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ReadQueryManagementFieldComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(AbstractAppConfig)); };
23456
+ 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) {
23457
+ 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);
23343
23458
  } if (rf & 2) {
23344
- const singleQueryDetails_r6 = i0.ɵɵreference(2);
23345
- i0.ɵɵproperty("ngIf", ctx.showQueryList)("ngIfElse", singleQueryDetails_r6);
23459
+ const singleQueryDetails_r7 = i0.ɵɵreference(2);
23460
+ i0.ɵɵproperty("ngIf", ctx.showQueryList)("ngIfElse", singleQueryDetails_r7);
23346
23461
  } }, encapsulation: 2 });
23347
23462
  }
23348
23463
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ReadQueryManagementFieldComponent, [{
23349
23464
  type: Component,
23350
- 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=\"!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" }]
23351
- }], () => [{ type: i1$1.ActivatedRoute }, { type: SessionStorageService }, { type: CaseNotifier }], null); })();
23352
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadQueryManagementFieldComponent, { className: "ReadQueryManagementFieldComponent", filePath: "lib/shared/components/palette/query-management/read-query-management-field.component.ts", lineNumber: 15 }); })();
23465
+ 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" }]
23466
+ }], () => [{ type: i1$1.ActivatedRoute }, { type: SessionStorageService }, { type: CaseNotifier }, { type: AbstractAppConfig }], null); })();
23467
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadQueryManagementFieldComponent, { className: "ReadQueryManagementFieldComponent", filePath: "lib/shared/components/palette/query-management/read-query-management-field.component.ts", lineNumber: 18 }); })();
23353
23468
 
23354
23469
  class ReadTextAreaFieldComponent extends AbstractFieldReadComponent {
23355
23470
  static ɵfac = /*@__PURE__*/ (() => { let ɵReadTextAreaFieldComponent_BaseFactory; return function ReadTextAreaFieldComponent_Factory(__ngFactoryType__) { return (ɵReadTextAreaFieldComponent_BaseFactory || (ɵReadTextAreaFieldComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ReadTextAreaFieldComponent)))(__ngFactoryType__ || ReadTextAreaFieldComponent); }; })();