@hmcts/ccd-case-ui-toolkit 7.2.37 → 7.2.38-3453

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/esm2022/lib/app.config.mjs +2 -1
  2. package/esm2022/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.mjs +5 -2
  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 +77 -24
  7. package/esm2022/lib/shared/components/palette/query-management/services/query-management.service.mjs +2 -2
  8. package/esm2022/lib/shared/components/palette/query-management/utils/query-management.utils.mjs +12 -4
  9. package/esm2022/lib/shared/utils.mjs +1 -1
  10. package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs +179 -40
  11. package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
  12. package/lib/app.config.d.ts +2 -0
  13. package/lib/app.config.d.ts.map +1 -1
  14. package/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.d.ts +2 -1
  15. package/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.d.ts.map +1 -1
  16. package/lib/shared/components/palette/query-management/components/query-details/query-details.component.d.ts +15 -3
  17. package/lib/shared/components/palette/query-management/components/query-details/query-details.component.d.ts.map +1 -1
  18. package/lib/shared/components/palette/query-management/models/case-queries-collection.model.d.ts +1 -0
  19. package/lib/shared/components/palette/query-management/models/case-queries-collection.model.d.ts.map +1 -1
  20. package/lib/shared/components/palette/query-management/models/query-list/query-list-item/query-list-item.model.d.ts +1 -0
  21. package/lib/shared/components/palette/query-management/models/query-list/query-list-item/query-list-item.model.d.ts.map +1 -1
  22. package/lib/shared/components/palette/query-management/read-query-management-field.component.d.ts +15 -3
  23. package/lib/shared/components/palette/query-management/read-query-management-field.component.d.ts.map +1 -1
  24. package/lib/shared/components/palette/query-management/utils/query-management.utils.d.ts +1 -1
  25. package/lib/shared/components/palette/query-management/utils/query-management.utils.d.ts.map +1 -1
  26. package/lib/shared/utils.d.ts +1 -1
  27. package/package.json +1 -1
@@ -1326,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 {
@@ -20794,6 +20795,7 @@ class QueryListItem {
20794
20795
  createdBy;
20795
20796
  parentId;
20796
20797
  isClosed;
20798
+ messageType;
20797
20799
  children = [];
20798
20800
  messageIndexInParent = null;
20799
20801
  get lastSubmittedMessage() {
@@ -20820,14 +20822,34 @@ class QueryListItem {
20820
20822
  }
20821
20823
  get lastSubmittedDate() {
20822
20824
  const childrenCount = this.children.length;
20823
- if (childrenCount <= 1) {
20825
+ const lastChild = this.children[childrenCount - 1];
20826
+ // 1. Check for legacy: <= 1 child with no messageType
20827
+ const allChildrenLackMessageType = this.children.every((child) => !child.messageType);
20828
+ if (childrenCount <= 1 && allChildrenLackMessageType) {
20824
20829
  return new Date(this.lastSubmittedMessage.createdOn);
20825
20830
  }
20826
- let index;
20827
- if (childrenCount > 1) {
20828
- index = childrenCount % 2 === 0 ? childrenCount - 1 : childrenCount - 2;
20831
+ // 2. Check if any RESPOND exists
20832
+ const hasRespond = this.children.some((child) => child.messageType === QueryCreateContext.RESPOND);
20833
+ // 3. Check if all children are FOLLOWUPs and none are RESPONDs
20834
+ const onlyFollowUps = this.children.every((child) => child.messageType === QueryCreateContext.FOLLOWUP);
20835
+ if (onlyFollowUps && !hasRespond) {
20836
+ return new Date(lastChild.createdOn);
20829
20837
  }
20830
- return new Date(this.children[index].createdOn);
20838
+ // 4. If RESPOND exists, get latest FOLLOWUP
20839
+ // If no RESPOND, but there is at least one FOLLOWUP, return the last FOLLOWUP
20840
+ const lastFollowUp = [...this.children]
20841
+ .reverse()
20842
+ .find((child) => child.messageType === QueryCreateContext.FOLLOWUP);
20843
+ if (lastFollowUp) {
20844
+ return new Date(lastFollowUp.createdOn);
20845
+ }
20846
+ // 5. Legacy fallback: no messageType at all
20847
+ if (allChildrenLackMessageType) {
20848
+ const index = childrenCount % 2 === 0 ? childrenCount - 1 : childrenCount - 2;
20849
+ return new Date(this.children[index]?.createdOn);
20850
+ }
20851
+ // 6. Final fallback: return last child's date
20852
+ return new Date(this.lastSubmittedMessage.createdOn);
20831
20853
  }
20832
20854
  get lastResponseBy() {
20833
20855
  return this.children?.length > 0 ? this.lastSubmittedMessage.name : '';
@@ -20837,6 +20859,11 @@ class QueryListItem {
20837
20859
  if (childrenCount === 0) {
20838
20860
  return null;
20839
20861
  }
20862
+ const lastChild = this.children[childrenCount - 1];
20863
+ if (lastChild?.messageType === QueryCreateContext.FOLLOWUP &&
20864
+ !this.children.some((child) => child.messageType === QueryCreateContext.RESPOND)) {
20865
+ return null;
20866
+ }
20840
20867
  let index;
20841
20868
  if (childrenCount === 1) {
20842
20869
  index = 0;
@@ -20851,11 +20878,20 @@ class QueryListItem {
20851
20878
  if (item.isClosed === 'Yes') {
20852
20879
  return true;
20853
20880
  }
20854
- return item.children?.some(child => isThreadClosed(child)) || false;
20881
+ return item.children?.some((child) => isThreadClosed(child)) || false;
20855
20882
  };
20856
20883
  if (isThreadClosed(this)) {
20857
20884
  return QueryItemResponseStatus.CLOSED;
20858
20885
  }
20886
+ const lastMessageType = this.children?.length
20887
+ ? this.children[this.children.length - 1]?.messageType
20888
+ : undefined;
20889
+ if (lastMessageType && lastMessageType === QueryCreateContext.RESPOND) {
20890
+ return QueryItemResponseStatus.RESPONDED;
20891
+ }
20892
+ else if (lastMessageType && lastMessageType === QueryCreateContext.FOLLOWUP) {
20893
+ return QueryItemResponseStatus.AWAITING;
20894
+ }
20859
20895
  if (this.messageIndexInParent !== null) {
20860
20896
  return this.messageIndexInParent % 2 === 0
20861
20897
  ? QueryItemResponseStatus.RESPONDED
@@ -20944,16 +20980,22 @@ class QueryManagementUtils {
20944
20980
  isHearingRelated,
20945
20981
  hearingDate,
20946
20982
  createdOn: new Date(),
20947
- createdBy: currentUserId
20983
+ createdBy: currentUserId,
20984
+ messageType: QueryCreateContext.FOLLOWUP // Default to value new queries will be FOLLOWUP
20948
20985
  };
20949
20986
  }
20950
- static getRespondOrFollowupQueryData(formGroup, queryItem, currentUserDetails) {
20987
+ static getRespondOrFollowupQueryData(formGroup, queryItem, currentUserDetails, messageTypeParam) {
20951
20988
  const currentUserId = currentUserDetails?.uid || currentUserDetails?.id;
20952
20989
  const currentUserName = currentUserDetails?.name || `${currentUserDetails?.forename} ${currentUserDetails?.surname}`;
20953
20990
  const body = formGroup.get('body').value.trim();
20954
20991
  const attachments = formGroup.get('attachments').value;
20955
20992
  const formDocument = attachments.map((document) => this.documentToCollectionFormDocument(document));
20956
20993
  const isClosed = formGroup.get('closeQuery').value ? 'Yes' : 'No';
20994
+ const messageType = messageTypeParam === QueryCreateContext.RESPOND
20995
+ ? QueryCreateContext.RESPOND
20996
+ : messageTypeParam === QueryCreateContext.FOLLOWUP
20997
+ ? QueryCreateContext.FOLLOWUP
20998
+ : undefined;
20957
20999
  return {
20958
21000
  id: v4(),
20959
21001
  subject: queryItem.subject.trim(),
@@ -20965,7 +21007,8 @@ class QueryManagementUtils {
20965
21007
  createdOn: new Date(),
20966
21008
  createdBy: currentUserId,
20967
21009
  parentId: queryItem.id,
20968
- isClosed
21010
+ isClosed,
21011
+ messageType
20969
21012
  };
20970
21013
  }
20971
21014
  static isObject(elem) {
@@ -21013,7 +21056,7 @@ class QueryManagementService {
21013
21056
  }
21014
21057
  const caseMessage = queryCreateContext === QueryCreateContext.NEW_QUERY
21015
21058
  ? QueryManagementUtils.getNewQueryData(formGroup, currentUserDetails)
21016
- : QueryManagementUtils.getRespondOrFollowupQueryData(formGroup, queryItem, currentUserDetails);
21059
+ : QueryManagementUtils.getRespondOrFollowupQueryData(formGroup, queryItem, currentUserDetails, queryCreateContext);
21017
21060
  const isNewQuery = queryCreateContext === QueryCreateContext.NEW_QUERY; // Check if this is a new query
21018
21061
  // Check if the field ID has been set dynamically
21019
21062
  if (!this.fieldId) {
@@ -21752,6 +21795,7 @@ class QueryCheckYourAnswersComponent {
21752
21795
  queryItem;
21753
21796
  queryCreateContext;
21754
21797
  eventData = null;
21798
+ multipleFollowUpFeature;
21755
21799
  qmCaseQueriesCollectionData;
21756
21800
  backClicked = new EventEmitter();
21757
21801
  querySubmitted = new EventEmitter();
@@ -21945,7 +21989,7 @@ class QueryCheckYourAnswersComponent {
21945
21989
  this.queryManagementService.setCaseQueriesCollectionData(this.eventData, this.queryCreateContext, this.caseDetails, this.messageId);
21946
21990
  }
21947
21991
  static ɵfac = function QueryCheckYourAnswersComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || QueryCheckYourAnswersComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(i1$1.Router), i0.ɵɵdirectiveInject(CasesService), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(WorkAllocationService), i0.ɵɵdirectiveInject(QualifyingQuestionService), i0.ɵɵdirectiveInject(QueryManagementService), i0.ɵɵdirectiveInject(ErrorNotifierService), i0.ɵɵdirectiveInject(AlertService)); };
21948
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QueryCheckYourAnswersComponent, selectors: [["ccd-query-check-your-answers"]], inputs: { formGroup: "formGroup", queryItem: "queryItem", queryCreateContext: "queryCreateContext", eventData: "eventData", qmCaseQueriesCollectionData: "qmCaseQueriesCollectionData" }, outputs: { backClicked: "backClicked", querySubmitted: "querySubmitted", callbackConfirmationMessage: "callbackConfirmationMessage" }, decls: 1, vars: 1, consts: [["defaultCheckYourAnswersTitle", ""], ["isHearingRelatedFalse", ""], ["class", "govuk-grid-row", 4, "ngIf"], [1, "govuk-grid-row"], [1, "govuk-grid-column-two-thirds-from-desktop"], ["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], ["class", "error-summary", "role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 4, "ngIf"], [3, "callbackErrorsSubject"], [4, "ngIf"], [1, "govuk-heading-l"], [4, "ngIf", "ngIfElse"], [1, "govuk-!-margin-bottom-4"], [3, "caseDetails"], ["class", "govuk-summary-list govuk-!-margin-bottom-0", 4, "ngIf"], [1, "govuk-summary-list", "govuk-!-margin-bottom-0"], [1, "govuk-summary-list__row"], [1, "govuk-summary-list__key"], [1, "govuk-summary-list__value"], [1, "govuk-summary-list__actions"], ["href", "javascript:void(0)", 1, "govuk-link", 3, "click"], ["data-module", "govuk-button", 1, "govuk-button", "govuk-button--secondary", "govuk-!-margin-right-3", 3, "click"], ["data-module", "govuk-button", "type", "submit", 1, "govuk-button", 3, "click"], [3, "eventCompletionParams"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [4, "ngFor", "ngForOf"], ["href", "javascript:void(0)", 1, "validation-error", 3, "id"], ["role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 1, "error-summary"], ["id", "event_error-summary-heading", 1, "heading-h3", "error-summary-heading"], ["class", "error-summary-list", 4, "ngIf"], [1, "error-summary-list"], ["class", "ccd-error-summary-li", 4, "ngFor", "ngForOf"], [1, "ccd-error-summary-li"], [1, "govuk-caption-l"], ["href", "javascript:void(0)", "class", "govuk-link", 3, "click", 4, "ngIf"], ["class", "govuk-summary-list__row", 4, "ngIf"], [1, "govuk-summary-list__value", "govuk-summary-list__value--documentAttached"], [3, "attachments", 4, "ngIf"], [3, "attachments"]], template: function QueryCheckYourAnswersComponent_Template(rf, ctx) { if (rf & 1) {
21992
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QueryCheckYourAnswersComponent, selectors: [["ccd-query-check-your-answers"]], inputs: { formGroup: "formGroup", queryItem: "queryItem", queryCreateContext: "queryCreateContext", eventData: "eventData", multipleFollowUpFeature: "multipleFollowUpFeature", qmCaseQueriesCollectionData: "qmCaseQueriesCollectionData" }, outputs: { backClicked: "backClicked", querySubmitted: "querySubmitted", callbackConfirmationMessage: "callbackConfirmationMessage" }, decls: 1, vars: 1, consts: [["defaultCheckYourAnswersTitle", ""], ["isHearingRelatedFalse", ""], ["class", "govuk-grid-row", 4, "ngIf"], [1, "govuk-grid-row"], [1, "govuk-grid-column-two-thirds-from-desktop"], ["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], ["class", "error-summary", "role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 4, "ngIf"], [3, "callbackErrorsSubject"], [4, "ngIf"], [1, "govuk-heading-l"], [4, "ngIf", "ngIfElse"], [1, "govuk-!-margin-bottom-4"], [3, "caseDetails"], ["class", "govuk-summary-list govuk-!-margin-bottom-0", 4, "ngIf"], [1, "govuk-summary-list", "govuk-!-margin-bottom-0"], [1, "govuk-summary-list__row"], [1, "govuk-summary-list__key"], [1, "govuk-summary-list__value"], [1, "govuk-summary-list__actions"], ["href", "javascript:void(0)", 1, "govuk-link", 3, "click"], ["data-module", "govuk-button", 1, "govuk-button", "govuk-button--secondary", "govuk-!-margin-right-3", 3, "click"], ["data-module", "govuk-button", "type", "submit", 1, "govuk-button", 3, "click"], [3, "eventCompletionParams"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], [4, "ngFor", "ngForOf"], ["href", "javascript:void(0)", 1, "validation-error", 3, "id"], ["role", "group", "aria-labelledby", "edit-case-event_error-summary-heading", "tabindex", "-1", 1, "error-summary"], ["id", "event_error-summary-heading", 1, "heading-h3", "error-summary-heading"], ["class", "error-summary-list", 4, "ngIf"], [1, "error-summary-list"], ["class", "ccd-error-summary-li", 4, "ngFor", "ngForOf"], [1, "ccd-error-summary-li"], [1, "govuk-caption-l"], ["href", "javascript:void(0)", "class", "govuk-link", 3, "click", 4, "ngIf"], ["class", "govuk-summary-list__row", 4, "ngIf"], [1, "govuk-summary-list__value", "govuk-summary-list__value--documentAttached"], [3, "attachments", 4, "ngIf"], [3, "attachments"]], template: function QueryCheckYourAnswersComponent_Template(rf, ctx) { if (rf & 1) {
21949
21993
  i0.ɵɵtemplate(0, QueryCheckYourAnswersComponent_div_0_Template, 36, 25, "div", 2);
21950
21994
  } if (rf & 2) {
21951
21995
  i0.ɵɵproperty("ngIf", ctx.readyToSubmit);
@@ -21962,6 +22006,8 @@ class QueryCheckYourAnswersComponent {
21962
22006
  type: Input
21963
22007
  }], eventData: [{
21964
22008
  type: Input
22009
+ }], multipleFollowUpFeature: [{
22010
+ type: Input
21965
22011
  }], qmCaseQueriesCollectionData: [{
21966
22012
  type: Input
21967
22013
  }], backClicked: [{
@@ -22183,10 +22229,12 @@ function QueryDetailsComponent_ng_container_0_ng_container_44_ng_container_1_Tem
22183
22229
  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);
22184
22230
  i0.ɵɵelementContainerEnd();
22185
22231
  } if (rf & 2) {
22232
+ const child_r3 = ctx.$implicit;
22186
22233
  const i_r4 = ctx.index;
22187
22234
  const followUpMessage_r5 = i0.ɵɵreference(3);
22235
+ const ctx_r1 = i0.ɵɵnextContext(3);
22188
22236
  i0.ɵɵadvance();
22189
- i0.ɵɵproperty("ngIf", i_r4 % 2 === 0)("ngIfElse", followUpMessage_r5);
22237
+ 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);
22190
22238
  } }
22191
22239
  function QueryDetailsComponent_ng_container_0_ng_container_44_Template(rf, ctx) { if (rf & 1) {
22192
22240
  i0.ɵɵelementContainerStart(0);
@@ -22290,6 +22338,8 @@ class QueryDetailsComponent {
22290
22338
  sessionStorageService;
22291
22339
  route;
22292
22340
  router;
22341
+ abstractConfig;
22342
+ caseNotifier;
22293
22343
  query;
22294
22344
  caseId;
22295
22345
  queryResponseStatus;
@@ -22299,10 +22349,18 @@ class QueryDetailsComponent {
22299
22349
  static QUERY_ITEM_RESPOND = '3';
22300
22350
  static QUERY_ITEM_FOLLOW_UP = '4';
22301
22351
  queryItemId;
22302
- constructor(sessionStorageService, route, router) {
22352
+ followUpQuery = QueryCreateContext.FOLLOWUP;
22353
+ respondToQuery = QueryCreateContext.RESPOND;
22354
+ enableServiceSpecificMultiFollowups;
22355
+ currentJurisdictionId;
22356
+ isMultipleFollowUpEnabled = false;
22357
+ caseSubscription;
22358
+ constructor(sessionStorageService, route, router, abstractConfig, caseNotifier) {
22303
22359
  this.sessionStorageService = sessionStorageService;
22304
22360
  this.route = route;
22305
22361
  this.router = router;
22362
+ this.abstractConfig = abstractConfig;
22363
+ this.caseNotifier = caseNotifier;
22306
22364
  }
22307
22365
  onBack() {
22308
22366
  this.backClicked.emit(true);
@@ -22310,10 +22368,23 @@ class QueryDetailsComponent {
22310
22368
  isInternalUser() {
22311
22369
  return isInternalUser(this.sessionStorageService);
22312
22370
  }
22371
+ ngOnInit() {
22372
+ this.enableServiceSpecificMultiFollowups = this.abstractConfig.getEnableServiceSpecificMultiFollowups() || [];
22373
+ this.caseSubscription = this.caseNotifier.caseView.subscribe((caseView) => {
22374
+ if (caseView?.case_type?.jurisdiction?.id) {
22375
+ this.currentJurisdictionId = caseView.case_type.jurisdiction.id;
22376
+ this.isMultipleFollowUpEnabled = this.enableServiceSpecificMultiFollowups.includes(this.currentJurisdictionId);
22377
+ this.hasRespondedToQuery();
22378
+ }
22379
+ });
22380
+ }
22313
22381
  ngOnChanges() {
22314
22382
  this.toggleLinkVisibility();
22315
22383
  this.hasRespondedToQuery();
22316
22384
  }
22385
+ ngOnDestroy() {
22386
+ this.caseSubscription?.unsubscribe();
22387
+ }
22317
22388
  toggleLinkVisibility() {
22318
22389
  this.queryItemId = this.route.snapshot.params.qid;
22319
22390
  if (this.queryItemId === QueryDetailsComponent.QUERY_ITEM_RESPOND || this.queryItemId === QueryDetailsComponent.QUERY_ITEM_FOLLOW_UP) {
@@ -22326,6 +22397,24 @@ class QueryDetailsComponent {
22326
22397
  this.hasResponded.emit(true);
22327
22398
  return true;
22328
22399
  }
22400
+ const lastChild = this.query?.children?.[this.query.children.length - 1];
22401
+ const lastMessageType = this.query?.children?.length
22402
+ ? this.query.children[this.query.children.length - 1]?.messageType
22403
+ : this.query?.messageType;
22404
+ const isFollowUp = lastMessageType === this.followUpQuery;
22405
+ const isRespond = lastChild?.messageType === this.respondToQuery;
22406
+ if (this.queryResponseStatus === QueryItemResponseStatus.CLOSED) {
22407
+ this.hasResponded.emit(true);
22408
+ return true;
22409
+ }
22410
+ if (isFollowUp && this.isMultipleFollowUpEnabled) {
22411
+ this.hasResponded.emit(false);
22412
+ return false;
22413
+ }
22414
+ if (isRespond) {
22415
+ this.hasResponded.emit(false);
22416
+ return false;
22417
+ }
22329
22418
  if (this.isInternalUser()) {
22330
22419
  if (isAwaiting) {
22331
22420
  this.hasResponded.emit(false);
@@ -22341,7 +22430,7 @@ class QueryDetailsComponent {
22341
22430
  this.hasResponded.emit(false);
22342
22431
  return false;
22343
22432
  }
22344
- static ɵfac = function QueryDetailsComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || QueryDetailsComponent)(i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(i1$1.Router)); };
22433
+ 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)); };
22345
22434
  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) {
22346
22435
  i0.ɵɵtemplate(0, QueryDetailsComponent_ng_container_0_Template, 45, 41, "ng-container", 1);
22347
22436
  } if (rf & 2) {
@@ -22350,8 +22439,8 @@ class QueryDetailsComponent {
22350
22439
  }
22351
22440
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(QueryDetailsComponent, [{
22352
22441
  type: Component,
22353
- 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"] }]
22354
- }], () => [{ type: SessionStorageService }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }], { query: [{
22442
+ 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"] }]
22443
+ }], () => [{ type: SessionStorageService }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: AbstractAppConfig }, { type: CaseNotifier }], { query: [{
22355
22444
  type: Input
22356
22445
  }], caseId: [{
22357
22446
  type: Input
@@ -22362,7 +22451,7 @@ class QueryDetailsComponent {
22362
22451
  }], hasResponded: [{
22363
22452
  type: Output
22364
22453
  }] }); })();
22365
- (() => { (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 }); })();
22454
+ (() => { (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 }); })();
22366
22455
 
22367
22456
  class QueryEventCompletionComponent {
22368
22457
  eventCompletionParams;
@@ -23438,7 +23527,7 @@ class CloseQueryComponent {
23438
23527
  const _c0$B = (a0, a1) => ["/query-management", "query", a0, "4", a1];
23439
23528
  function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_Template(rf, ctx) { if (rf & 1) {
23440
23529
  const _r1 = i0.ɵɵgetCurrentView();
23441
- i0.ɵɵelementStart(0, "div", 5)(1, "ccd-query-list", 6);
23530
+ i0.ɵɵelementStart(0, "div", 6)(1, "ccd-query-list", 7);
23442
23531
  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)); });
23443
23532
  i0.ɵɵelementEnd()();
23444
23533
  } if (rf & 2) {
@@ -23448,7 +23537,7 @@ function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_T
23448
23537
  } }
23449
23538
  function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_Template(rf, ctx) { if (rf & 1) {
23450
23539
  i0.ɵɵelementContainerStart(0);
23451
- i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_Template, 2, 1, "div", 4);
23540
+ i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_Template, 2, 1, "div", 5);
23452
23541
  i0.ɵɵelementContainerEnd();
23453
23542
  } if (rf & 2) {
23454
23543
  const ctx_r1 = i0.ɵɵnextContext(2);
@@ -23457,7 +23546,7 @@ function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_Templat
23457
23546
  } }
23458
23547
  function ReadQueryManagementFieldComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
23459
23548
  i0.ɵɵelementContainerStart(0);
23460
- i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_Template, 2, 1, "ng-container", 3);
23549
+ i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_Template, 2, 1, "ng-container", 4);
23461
23550
  i0.ɵɵelementContainerEnd();
23462
23551
  } if (rf & 2) {
23463
23552
  const ctx_r1 = i0.ɵɵnextContext();
@@ -23466,7 +23555,7 @@ function ReadQueryManagementFieldComponent_ng_container_0_Template(rf, ctx) { if
23466
23555
  } }
23467
23556
  function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
23468
23557
  i0.ɵɵelementContainerStart(0);
23469
- i0.ɵɵelementStart(1, "button", 9);
23558
+ i0.ɵɵelementStart(1, "button", 10);
23470
23559
  i0.ɵɵtext(2);
23471
23560
  i0.ɵɵpipe(3, "rpxTranslate");
23472
23561
  i0.ɵɵelementEnd();
@@ -23478,8 +23567,22 @@ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_conta
23478
23567
  i0.ɵɵadvance();
23479
23568
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 2, "Ask a follow-up question"), " ");
23480
23569
  } }
23481
- function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_Template(rf, ctx) { if (rf & 1) {
23482
- i0.ɵɵelementStart(0, "div")(1, "p", 10);
23570
+ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_ng_container_0_Template(rf, ctx) { if (rf & 1) {
23571
+ i0.ɵɵelementContainerStart(0);
23572
+ i0.ɵɵelementStart(1, "button", 10);
23573
+ i0.ɵɵtext(2);
23574
+ i0.ɵɵpipe(3, "rpxTranslate");
23575
+ i0.ɵɵelementEnd();
23576
+ i0.ɵɵelementContainerEnd();
23577
+ } if (rf & 2) {
23578
+ const ctx_r1 = i0.ɵɵnextContext(4);
23579
+ i0.ɵɵadvance();
23580
+ i0.ɵɵproperty("routerLink", i0.ɵɵpureFunction2(4, _c0$B, ctx_r1.caseId, ctx_r1.query.id));
23581
+ i0.ɵɵadvance();
23582
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 2, "Ask a follow-up question"), " ");
23583
+ } }
23584
+ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_ng_template_1_Template(rf, ctx) { if (rf & 1) {
23585
+ i0.ɵɵelementStart(0, "div")(1, "p", 11);
23483
23586
  i0.ɵɵtext(2);
23484
23587
  i0.ɵɵpipe(3, "rpxTranslate");
23485
23588
  i0.ɵɵelementEnd();
@@ -23493,25 +23596,32 @@ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_templ
23493
23596
  i0.ɵɵadvance(3);
23494
23597
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(6, 4, "Our team will read your query and respond. Do not submit the same query more than once."));
23495
23598
  } }
23599
+ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_Template(rf, ctx) { if (rf & 1) {
23600
+ 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);
23601
+ } if (rf & 2) {
23602
+ const queryIsInReview_r5 = i0.ɵɵreference(2);
23603
+ const ctx_r1 = i0.ɵɵnextContext(3);
23604
+ 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);
23605
+ } }
23496
23606
  function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
23497
23607
  i0.ɵɵelementContainerStart(0);
23498
- 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);
23608
+ 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);
23499
23609
  i0.ɵɵelementContainerEnd();
23500
23610
  } if (rf & 2) {
23501
- const queryIsInReview_r5 = i0.ɵɵreference(3);
23611
+ const sequentialQuery_r6 = i0.ɵɵreference(3);
23502
23612
  const ctx_r1 = i0.ɵɵnextContext(2);
23503
23613
  i0.ɵɵadvance();
23504
- 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);
23614
+ 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);
23505
23615
  } }
23506
23616
  function ReadQueryManagementFieldComponent_ng_template_1_ng_container_2_Template(rf, ctx) { if (rf & 1) {
23507
23617
  i0.ɵɵelementContainerStart(0);
23508
- i0.ɵɵelementStart(1, "div", 11)(2, "span", 12);
23618
+ i0.ɵɵelementStart(1, "div", 12)(2, "span", 13);
23509
23619
  i0.ɵɵtext(3, "!");
23510
23620
  i0.ɵɵelementEnd();
23511
- i0.ɵɵelementStart(4, "strong", 13)(5, "span", 14);
23621
+ i0.ɵɵelementStart(4, "strong", 14)(5, "span", 15);
23512
23622
  i0.ɵɵtext(6, "Warning");
23513
23623
  i0.ɵɵelementEnd();
23514
- i0.ɵɵelementStart(7, "p", 15);
23624
+ i0.ɵɵelementStart(7, "p", 16);
23515
23625
  i0.ɵɵtext(8);
23516
23626
  i0.ɵɵpipe(9, "rpxTranslate");
23517
23627
  i0.ɵɵelementEnd()()();
@@ -23522,10 +23632,10 @@ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_2_Template
23522
23632
  } }
23523
23633
  function ReadQueryManagementFieldComponent_ng_template_1_Template(rf, ctx) { if (rf & 1) {
23524
23634
  const _r4 = i0.ɵɵgetCurrentView();
23525
- i0.ɵɵelementStart(0, "ccd-query-details", 7);
23635
+ i0.ɵɵelementStart(0, "ccd-query-details", 8);
23526
23636
  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); });
23527
23637
  i0.ɵɵelementEnd();
23528
- 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);
23638
+ 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);
23529
23639
  } if (rf & 2) {
23530
23640
  const ctx_r1 = i0.ɵɵnextContext();
23531
23641
  i0.ɵɵproperty("query", ctx_r1.query)("caseId", ctx_r1.caseId);
@@ -23538,19 +23648,36 @@ class ReadQueryManagementFieldComponent extends AbstractFieldReadComponent {
23538
23648
  route;
23539
23649
  sessionStorageService;
23540
23650
  caseNotifier;
23651
+ abstractConfig;
23541
23652
  caseQueriesCollections;
23542
23653
  query;
23543
23654
  showQueryList = true;
23544
23655
  caseId;
23656
+ messageType;
23657
+ followUpQuery = QueryCreateContext.FOLLOWUP;
23658
+ respondToQuery = QueryCreateContext.RESPOND;
23545
23659
  isQueryClosed = false;
23546
- constructor(route, sessionStorageService, caseNotifier) {
23660
+ value;
23661
+ isMultipleFollowUpEnabled = false;
23662
+ currentJurisdictionId;
23663
+ enableServiceSpecificMultiFollowups = [];
23664
+ caseSubscription;
23665
+ constructor(route, sessionStorageService, caseNotifier, abstractConfig) {
23547
23666
  super();
23548
23667
  this.route = route;
23549
23668
  this.sessionStorageService = sessionStorageService;
23550
23669
  this.caseNotifier = caseNotifier;
23670
+ this.abstractConfig = abstractConfig;
23551
23671
  }
23552
23672
  ngOnInit() {
23553
23673
  this.caseId = this.route.snapshot.params.cid;
23674
+ this.enableServiceSpecificMultiFollowups = this.abstractConfig.getEnableServiceSpecificMultiFollowups() || [];
23675
+ this.caseSubscription = this.caseNotifier.caseView.subscribe((caseDetails) => {
23676
+ if (caseDetails?.case_type?.jurisdiction?.id) {
23677
+ this.currentJurisdictionId = caseDetails.case_type.jurisdiction.id;
23678
+ this.isMultipleFollowUpEnabled = this.enableServiceSpecificMultiFollowups.includes(this.currentJurisdictionId);
23679
+ }
23680
+ });
23554
23681
  if (this.context === PaletteContext.DEFAULT) {
23555
23682
  // EUI-8303 Using mock data until CCD is ready with the API and data contract
23556
23683
  // this.caseQueriesCollections = caseMessagesMockData;
@@ -23576,9 +23703,13 @@ class ReadQueryManagementFieldComponent extends AbstractFieldReadComponent {
23576
23703
  // QueryManagementUtils.extractCaseQueriesFromCaseField();
23577
23704
  }
23578
23705
  }
23706
+ ngOnDestroy() {
23707
+ this.caseSubscription?.unsubscribe();
23708
+ }
23579
23709
  setQuery(query) {
23580
23710
  this.showQueryList = false;
23581
23711
  this.query = query;
23712
+ this.messageType = this.getMessageType(query);
23582
23713
  this.isQueryClosed = this.query?.children?.some((queryItem) => queryItem?.isClosed === 'Yes');
23583
23714
  }
23584
23715
  backToQueryListPage() {
@@ -23588,19 +23719,27 @@ class ReadQueryManagementFieldComponent extends AbstractFieldReadComponent {
23588
23719
  isInternalUser() {
23589
23720
  return isInternalUser(this.sessionStorageService);
23590
23721
  }
23591
- static ɵfac = function ReadQueryManagementFieldComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ReadQueryManagementFieldComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(CaseNotifier)); };
23592
- 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) {
23593
- 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);
23722
+ getMessageType(query) {
23723
+ if (!query) {
23724
+ return undefined;
23725
+ }
23726
+ return query.children?.length
23727
+ ? query.children[query.children.length - 1]?.messageType
23728
+ : query?.messageType;
23729
+ }
23730
+ static ɵfac = function ReadQueryManagementFieldComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ReadQueryManagementFieldComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(AbstractAppConfig)); };
23731
+ 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) {
23732
+ 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);
23594
23733
  } if (rf & 2) {
23595
- const singleQueryDetails_r6 = i0.ɵɵreference(2);
23596
- i0.ɵɵproperty("ngIf", ctx.showQueryList)("ngIfElse", singleQueryDetails_r6);
23734
+ const singleQueryDetails_r7 = i0.ɵɵreference(2);
23735
+ i0.ɵɵproperty("ngIf", ctx.showQueryList)("ngIfElse", singleQueryDetails_r7);
23597
23736
  } }, encapsulation: 2 });
23598
23737
  }
23599
23738
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ReadQueryManagementFieldComponent, [{
23600
23739
  type: Component,
23601
- args: [{ selector: 'ccd-read-query-management-field', template: "<ng-container *ngIf=\"showQueryList; else singleQueryDetails\">\n <ng-container *ngFor=\"let caseQueriesCollection of caseQueriesCollections\">\n <div *ngIf=\"showQueryList\" class=\"govuk-!-margin-top-8 govuk-!-margin-bottom-8\">\n <ccd-query-list (selectedQuery)=\"setQuery($event)\" [caseQueriesCollection]=\"caseQueriesCollection\"></ccd-query-list>\n </div>\n </ng-container>\n</ng-container>\n\n<ng-template #singleQueryDetails>\n <ccd-query-details\n [query]=\"query\"\n (backClicked)=\"showQueryList = true\"\n [caseId]=\"caseId\"\n ></ccd-query-details>\n\n <ng-container *ngIf=\"!isInternalUser() && !isQueryClosed\">\n <ng-container *ngIf=\"query?.children?.length > 0 && query?.children?.length % 2 === 1; else queryIsInReview\">\n <button id=\"ask-follow-up-question\" class=\"govuk-button\" data-module=\"govuk-button\"\n [routerLink]=\"['/query-management', 'query', caseId, '4', query.id]\">\n {{ 'Ask a follow-up question' | rpxTranslate }}\n </button>\n </ng-container>\n\n <ng-template #queryIsInReview>\n <div>\n <p class=\"govuk-!-font-weight-bold\">{{ 'Your query is under review' | rpxTranslate }}</p>\n <p>{{ 'Our team will read your query and respond. Do not submit the same query more than once.' | rpxTranslate }}</p>\n </div>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"isQueryClosed\">\n <div class=\"govuk-warning-text\">\n <span aria-hidden=\"true\" class=\"govuk-warning-text__icon\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-visually-hidden\">Warning</span>\n <p class=\"qm-service-message govuk-!-font-weight-bold\">{{ 'This query has been closed by HMCTS staff.' | rpxTranslate }}</p>\n </strong>\n </div>\n </ng-container>\n</ng-template>\n" }]
23602
- }], () => [{ type: i1$1.ActivatedRoute }, { type: SessionStorageService }, { type: CaseNotifier }], null); })();
23603
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadQueryManagementFieldComponent, { className: "ReadQueryManagementFieldComponent", filePath: "lib/shared/components/palette/query-management/read-query-management-field.component.ts", lineNumber: 15 }); })();
23740
+ args: [{ selector: 'ccd-read-query-management-field', template: "<ng-container *ngIf=\"showQueryList; else singleQueryDetails\">\n <ng-container *ngFor=\"let caseQueriesCollection of caseQueriesCollections\">\n <div *ngIf=\"showQueryList\" class=\"govuk-!-margin-top-8 govuk-!-margin-bottom-8\">\n <ccd-query-list (selectedQuery)=\"setQuery($event)\" [caseQueriesCollection]=\"caseQueriesCollection\"></ccd-query-list>\n </div>\n </ng-container>\n</ng-container>\n\n<ng-template #singleQueryDetails>\n <ccd-query-details\n [query]=\"query\"\n (backClicked)=\"showQueryList = true\"\n [caseId]=\"caseId\"\n ></ccd-query-details>\n\n <ng-container *ngIf=\"!isInternalUser() && !isQueryClosed\">\n <ng-container *ngIf=\"(messageType && messageType === followUpQuery && isMultipleFollowUpEnabled) || (messageType && messageType === respondToQuery); else sequentialQuery\">\n <button id=\"ask-follow-up-question\" class=\"govuk-button\" data-module=\"govuk-button\"\n [routerLink]=\"['/query-management', 'query', caseId, '4', query.id]\">\n {{ 'Ask a follow-up question' | rpxTranslate }}\n </button>\n </ng-container>\n <ng-template #sequentialQuery>\n <ng-container *ngIf=\"query?.children?.length > 0 && query?.children?.length % 2 === 1; else queryIsInReview\">\n <button id=\"ask-follow-up-question\" class=\"govuk-button\" data-module=\"govuk-button\"\n [routerLink]=\"['/query-management', 'query', caseId, '4', query.id]\">\n {{ 'Ask a follow-up question' | rpxTranslate }}\n </button>\n </ng-container>\n\n <ng-template #queryIsInReview>\n <div>\n <p class=\"govuk-!-font-weight-bold\">{{ 'Your query is under review' | rpxTranslate }}</p>\n <p>{{ 'Our team will read your query and respond. Do not submit the same query more than once.' | rpxTranslate }}</p>\n </div>\n </ng-template>\n </ng-template>\n\n </ng-container>\n <ng-container *ngIf=\"isQueryClosed\">\n <div class=\"govuk-warning-text\">\n <span aria-hidden=\"true\" class=\"govuk-warning-text__icon\">!</span>\n <strong class=\"govuk-warning-text__text\">\n <span class=\"govuk-visually-hidden\">Warning</span>\n <p class=\"qm-service-message govuk-!-font-weight-bold\">{{ 'This query has been closed by HMCTS staff.' | rpxTranslate }}</p>\n </strong>\n </div>\n </ng-container>\n</ng-template>\n" }]
23741
+ }], () => [{ type: i1$1.ActivatedRoute }, { type: SessionStorageService }, { type: CaseNotifier }, { type: AbstractAppConfig }], null); })();
23742
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadQueryManagementFieldComponent, { className: "ReadQueryManagementFieldComponent", filePath: "lib/shared/components/palette/query-management/read-query-management-field.component.ts", lineNumber: 18 }); })();
23604
23743
 
23605
23744
  class ReadTextAreaFieldComponent extends AbstractFieldReadComponent {
23606
23745
  static ɵfac = /*@__PURE__*/ (() => { let ɵReadTextAreaFieldComponent_BaseFactory; return function ReadTextAreaFieldComponent_Factory(__ngFactoryType__) { return (ɵReadTextAreaFieldComponent_BaseFactory || (ɵReadTextAreaFieldComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ReadTextAreaFieldComponent)))(__ngFactoryType__ || ReadTextAreaFieldComponent); }; })();