@hmcts/ccd-case-ui-toolkit 7.2.13-simplify-cdam-logic-rc2 → 7.2.14-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 (35) hide show
  1. package/esm2022/lib/app.config.mjs +3 -1
  2. package/esm2022/lib/shared/components/palette/document/write-document-field.component.mjs +7 -6
  3. package/esm2022/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.mjs +6 -3
  4. package/esm2022/lib/shared/components/palette/query-management/components/query-details/query-details.component.mjs +38 -8
  5. package/esm2022/lib/shared/components/palette/query-management/enums/query-item-response-status.enum.mjs +2 -1
  6. package/esm2022/lib/shared/components/palette/query-management/models/case-queries-collection.model.mjs +1 -1
  7. package/esm2022/lib/shared/components/palette/query-management/models/query-list/query-list-item/query-list-item.model.mjs +22 -2
  8. package/esm2022/lib/shared/components/palette/query-management/read-query-management-field.component.mjs +64 -22
  9. package/esm2022/lib/shared/components/palette/query-management/utils/query-management.utils.mjs +12 -3
  10. package/esm2022/lib/shared/services/document-management/document-management.service.mjs +4 -19
  11. package/esm2022/lib/shared/utils.mjs +1 -1
  12. package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs +139 -55
  13. package/fesm2022/hmcts-ccd-case-ui-toolkit.mjs.map +1 -1
  14. package/lib/app.config.d.ts +3 -0
  15. package/lib/app.config.d.ts.map +1 -1
  16. package/lib/shared/components/palette/document/write-document-field.component.d.ts +1 -0
  17. package/lib/shared/components/palette/document/write-document-field.component.d.ts.map +1 -1
  18. package/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.d.ts +2 -1
  19. package/lib/shared/components/palette/query-management/components/query-check-your-answers/query-check-your-answers.component.d.ts.map +1 -1
  20. package/lib/shared/components/palette/query-management/components/query-details/query-details.component.d.ts +8 -1
  21. package/lib/shared/components/palette/query-management/components/query-details/query-details.component.d.ts.map +1 -1
  22. package/lib/shared/components/palette/query-management/enums/query-item-response-status.enum.d.ts +2 -1
  23. package/lib/shared/components/palette/query-management/enums/query-item-response-status.enum.d.ts.map +1 -1
  24. package/lib/shared/components/palette/query-management/models/case-queries-collection.model.d.ts +2 -0
  25. package/lib/shared/components/palette/query-management/models/case-queries-collection.model.d.ts.map +1 -1
  26. package/lib/shared/components/palette/query-management/models/query-list/query-list-item/query-list-item.model.d.ts +2 -0
  27. package/lib/shared/components/palette/query-management/models/query-list/query-list-item/query-list-item.model.d.ts.map +1 -1
  28. package/lib/shared/components/palette/query-management/read-query-management-field.component.d.ts +11 -1
  29. package/lib/shared/components/palette/query-management/read-query-management-field.component.d.ts.map +1 -1
  30. package/lib/shared/components/palette/query-management/utils/query-management.utils.d.ts +1 -1
  31. package/lib/shared/components/palette/query-management/utils/query-management.utils.d.ts.map +1 -1
  32. package/lib/shared/services/document-management/document-management.service.d.ts +0 -1
  33. package/lib/shared/services/document-management/document-management.service.d.ts.map +1 -1
  34. package/lib/shared/utils.d.ts +1 -1
  35. 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 {
@@ -7270,27 +7272,12 @@ class DocumentManagementService {
7270
7272
  return documentBinaryUrl.replace(remoteDocumentManagementPattern, this.getDocStoreUrl());
7271
7273
  }
7272
7274
  getDocStoreUrl() {
7273
- if (this.isDocumentSecureModeEnabled()) {
7274
- return this.appConfig.getDocumentManagementUrlV2();
7275
- }
7276
- return this.appConfig.getDocumentManagementUrl();
7277
- }
7278
- // return false == document should not use CDAM
7279
- // return true == document should use CDAM
7280
- isDocumentSecureModeEnabled() {
7281
7275
  const documentSecureModeCaseTypeExclusions = this.appConfig.getCdamExclusionList()?.split(',');
7282
7276
  const isDocumentOnExclusionList = documentSecureModeCaseTypeExclusions?.includes(this.caseTypeId);
7283
7277
  const documentSecureModeEnabled = this.appConfig.getDocumentSecureMode();
7284
- // if the documentSecureModeEnabled is false, return false
7285
- if (!documentSecureModeEnabled) {
7286
- return false;
7287
- }
7288
- // if the documentSecureModeEnabled is true, and the case is not in the exclusion list, return true
7289
- if (documentSecureModeEnabled && !isDocumentOnExclusionList) {
7290
- return true;
7291
- }
7292
- // if documentSecureModeEnabled is true, and case is in the exclusion list, return false
7293
- return false;
7278
+ return (documentSecureModeEnabled && !isDocumentOnExclusionList)
7279
+ ? this.appConfig.getDocumentManagementUrlV2()
7280
+ : this.appConfig.getDocumentManagementUrl();
7294
7281
  }
7295
7282
  static ɵfac = function DocumentManagementService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DocumentManagementService)(i0.ɵɵinject(HttpService), i0.ɵɵinject(AbstractAppConfig), i0.ɵɵinject(CaseNotifier), i0.ɵɵinject(JurisdictionService)); };
7296
7283
  static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: DocumentManagementService, factory: DocumentManagementService.ɵfac });
@@ -15148,11 +15135,11 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
15148
15135
  jurisdictionSubs;
15149
15136
  uploadedDocument;
15150
15137
  dialogConfig;
15138
+ secureModeOn;
15151
15139
  jurisdictionId;
15152
15140
  caseTypeId;
15153
15141
  caseTypeExclusions;
15154
- // Should the file upload use CDAM
15155
- fileSecureModeOn = false;
15142
+ fileSecureModeOn = true;
15156
15143
  constructor(appConfig, caseNotifier, documentManagement, dialog, fileUploadStateService, jurisdictionService) {
15157
15144
  super();
15158
15145
  this.appConfig = appConfig;
@@ -15163,6 +15150,8 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
15163
15150
  this.jurisdictionService = jurisdictionService;
15164
15151
  }
15165
15152
  ngOnInit() {
15153
+ this.secureModeOn = this.appConfig.getDocumentSecureMode();
15154
+ this.caseTypeExclusions = this.appConfig.getCdamExclusionList();
15166
15155
  // Wait for both observables to emit at least once
15167
15156
  this.caseNotifierSubscription = combineLatest([
15168
15157
  this.caseNotifier.caseView.pipe(take(1)),
@@ -15187,9 +15176,8 @@ class WriteDocumentFieldComponent extends AbstractFieldWriteComponent {
15187
15176
  this.caseTypeId = parts[parts.indexOf('case-create') + 2];
15188
15177
  }
15189
15178
  }
15190
- // use the documentManagement service to check if the document upload should use CDAM
15191
- if (this.documentManagement.isDocumentSecureModeEnabled()) {
15192
- this.fileSecureModeOn = true;
15179
+ if (this.secureModeOn && this.caseTypeExclusions.split(',').includes(this.caseTypeId)) {
15180
+ this.fileSecureModeOn = false;
15193
15181
  }
15194
15182
  this.dialogConfig = initDialog();
15195
15183
  let document = this.caseField.value || { document_url: null, document_binary_url: null, document_filename: null };
@@ -20597,6 +20585,7 @@ var QueryItemResponseStatus;
20597
20585
  QueryItemResponseStatus["NEW"] = "New";
20598
20586
  QueryItemResponseStatus["RESPONDED"] = "Responded";
20599
20587
  QueryItemResponseStatus["AWAITING"] = "Awaiting Response";
20588
+ QueryItemResponseStatus["CLOSED"] = "Closed";
20600
20589
  })(QueryItemResponseStatus || (QueryItemResponseStatus = {}));
20601
20590
 
20602
20591
  var RespondToQueryErrorMessages;
@@ -20897,6 +20886,8 @@ class QueryListItem {
20897
20886
  createdOn;
20898
20887
  createdBy;
20899
20888
  parentId;
20889
+ isClosed;
20890
+ messageType;
20900
20891
  children = [];
20901
20892
  messageIndexInParent = null;
20902
20893
  get lastSubmittedMessage() {
@@ -20957,7 +20948,24 @@ class QueryListItem {
20957
20948
  return new Date(this.children[index].createdOn);
20958
20949
  }
20959
20950
  get responseStatus() {
20960
- // Child logic (position-based)
20951
+ const isThreadClosed = (item) => {
20952
+ if (item.isClosed === 'Yes') {
20953
+ return true;
20954
+ }
20955
+ return item.children?.some((child) => isThreadClosed(child)) || false;
20956
+ };
20957
+ if (isThreadClosed(this)) {
20958
+ return QueryItemResponseStatus.CLOSED;
20959
+ }
20960
+ const lastMessageType = this.children?.length
20961
+ ? this.children[this.children.length - 1]?.messageType
20962
+ : undefined;
20963
+ if (lastMessageType && lastMessageType === QueryCreateContext.RESPOND) {
20964
+ return QueryItemResponseStatus.RESPONDED;
20965
+ }
20966
+ else if (lastMessageType && lastMessageType === QueryCreateContext.FOLLOWUP) {
20967
+ return QueryItemResponseStatus.AWAITING;
20968
+ }
20961
20969
  if (this.messageIndexInParent !== null) {
20962
20970
  return this.messageIndexInParent % 2 === 0
20963
20971
  ? QueryItemResponseStatus.RESPONDED
@@ -21049,12 +21057,18 @@ class QueryManagementUtils {
21049
21057
  createdBy: currentUserId
21050
21058
  };
21051
21059
  }
21052
- static getRespondOrFollowupQueryData(formGroup, queryItem, currentUserDetails) {
21060
+ static getRespondOrFollowupQueryData(formGroup, queryItem, currentUserDetails, messageTypeParam) {
21053
21061
  const currentUserId = currentUserDetails?.uid || currentUserDetails?.id;
21054
21062
  const currentUserName = currentUserDetails?.name || `${currentUserDetails?.forename} ${currentUserDetails?.surname}`;
21055
21063
  const body = formGroup.get('body').value;
21056
21064
  const attachments = formGroup.get('attachments').value;
21057
21065
  const formDocument = attachments.map((document) => this.documentToCollectionFormDocument(document));
21066
+ const isClosed = formGroup.get('closeQuery').value ? 'Yes' : 'No';
21067
+ const messageType = messageTypeParam === QueryCreateContext.RESPOND
21068
+ ? QueryCreateContext.RESPOND
21069
+ : messageTypeParam === QueryCreateContext.FOLLOWUP
21070
+ ? QueryCreateContext.FOLLOWUP
21071
+ : undefined;
21058
21072
  return {
21059
21073
  id: v4(),
21060
21074
  subject: queryItem.subject,
@@ -21065,7 +21079,9 @@ class QueryManagementUtils {
21065
21079
  hearingDate: queryItem.hearingDate,
21066
21080
  createdOn: new Date(),
21067
21081
  createdBy: currentUserId,
21068
- parentId: queryItem.id
21082
+ parentId: queryItem.id,
21083
+ isClosed,
21084
+ messageType
21069
21085
  };
21070
21086
  }
21071
21087
  static isObject(elem) {
@@ -21357,6 +21373,7 @@ class QueryCheckYourAnswersComponent {
21357
21373
  queryItem;
21358
21374
  queryCreateContext;
21359
21375
  eventData = null;
21376
+ multipleFollowUpFeature;
21360
21377
  backClicked = new EventEmitter();
21361
21378
  querySubmitted = new EventEmitter();
21362
21379
  callbackConfirmationMessage = new EventEmitter();
@@ -21515,7 +21532,7 @@ class QueryCheckYourAnswersComponent {
21515
21532
  const currentUserDetails = JSON.parse(this.sessionStorageService.getItem(USER_DETAILS));
21516
21533
  const caseMessage = this.queryCreateContext === QueryCreateContext.NEW_QUERY
21517
21534
  ? QueryManagementUtils.getNewQueryData(this.formGroup, currentUserDetails)
21518
- : QueryManagementUtils.getRespondOrFollowupQueryData(this.formGroup, this.queryItem, currentUserDetails);
21535
+ : QueryManagementUtils.getRespondOrFollowupQueryData(this.formGroup, this.queryItem, currentUserDetails, this.queryCreateContext);
21519
21536
  const messageId = this.route.snapshot.params.dataid; // Get the message ID from route params (if present)
21520
21537
  const isNewQuery = this.queryCreateContext === QueryCreateContext.NEW_QUERY; // Check if this is a new query
21521
21538
  // Check if the field ID has been set dynamically
@@ -21672,7 +21689,7 @@ class QueryCheckYourAnswersComponent {
21672
21689
  }
21673
21690
  }
21674
21691
  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)); };
21675
- 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"], [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"], [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) {
21692
+ 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"], [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"], [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) {
21676
21693
  i0.ɵɵtemplate(0, QueryCheckYourAnswersComponent_div_0_Template, 33, 22, "div", 2);
21677
21694
  } if (rf & 2) {
21678
21695
  i0.ɵɵproperty("ngIf", ctx.readyToSubmit);
@@ -21689,6 +21706,8 @@ class QueryCheckYourAnswersComponent {
21689
21706
  type: Input
21690
21707
  }], eventData: [{
21691
21708
  type: Input
21709
+ }], multipleFollowUpFeature: [{
21710
+ type: Input
21692
21711
  }], backClicked: [{
21693
21712
  type: Output
21694
21713
  }], querySubmitted: [{
@@ -21906,10 +21925,12 @@ function QueryDetailsComponent_ng_container_0_ng_container_44_ng_container_1_Tem
21906
21925
  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);
21907
21926
  i0.ɵɵelementContainerEnd();
21908
21927
  } if (rf & 2) {
21928
+ const child_r3 = ctx.$implicit;
21909
21929
  const i_r4 = ctx.index;
21910
21930
  const followUpMessage_r5 = i0.ɵɵreference(3);
21931
+ const ctx_r1 = i0.ɵɵnextContext(3);
21911
21932
  i0.ɵɵadvance();
21912
- i0.ɵɵproperty("ngIf", i_r4 % 2 === 0)("ngIfElse", followUpMessage_r5);
21933
+ 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);
21913
21934
  } }
21914
21935
  function QueryDetailsComponent_ng_container_0_ng_container_44_Template(rf, ctx) { if (rf & 1) {
21915
21936
  i0.ɵɵelementContainerStart(0);
@@ -22013,6 +22034,8 @@ class QueryDetailsComponent {
22013
22034
  sessionStorageService;
22014
22035
  route;
22015
22036
  router;
22037
+ abstractConfig;
22038
+ caseNotifier;
22016
22039
  query;
22017
22040
  caseId;
22018
22041
  queryResponseStatus;
@@ -22022,10 +22045,15 @@ class QueryDetailsComponent {
22022
22045
  static QUERY_ITEM_RESPOND = '3';
22023
22046
  static QUERY_ITEM_FOLLOW_UP = '4';
22024
22047
  queryItemId;
22025
- constructor(sessionStorageService, route, router) {
22048
+ followUpQuery = QueryCreateContext.FOLLOWUP;
22049
+ respondToQuery = QueryCreateContext.RESPOND;
22050
+ enableServiceSpecificMultiFollowups;
22051
+ constructor(sessionStorageService, route, router, abstractConfig, caseNotifier) {
22026
22052
  this.sessionStorageService = sessionStorageService;
22027
22053
  this.route = route;
22028
22054
  this.router = router;
22055
+ this.abstractConfig = abstractConfig;
22056
+ this.caseNotifier = caseNotifier;
22029
22057
  }
22030
22058
  onBack() {
22031
22059
  this.backClicked.emit(true);
@@ -22045,6 +22073,23 @@ class QueryDetailsComponent {
22045
22073
  }
22046
22074
  hasRespondedToQuery() {
22047
22075
  const isAwaiting = this.queryResponseStatus === undefined || this.queryResponseStatus === QueryItemResponseStatus.AWAITING;
22076
+ const lastChild = this.query?.children?.[this.query.children.length - 1];
22077
+ const isFollowUp = lastChild?.messageType === this.followUpQuery;
22078
+ const isRespond = lastChild?.messageType === this.respondToQuery;
22079
+ this.enableServiceSpecificMultiFollowups = this.abstractConfig.getEnableServiceSpecificMultiFollowups() || [];
22080
+ const isMultipleFollowUpEnabled = this.enableServiceSpecificMultiFollowups.some((jurisdiction) => jurisdiction === this.caseNotifier?.cachedCaseView?.case_type?.jurisdiction.id);
22081
+ if (this.queryResponseStatus === QueryItemResponseStatus.CLOSED) {
22082
+ this.hasResponded.emit(true);
22083
+ return true;
22084
+ }
22085
+ if (isFollowUp && isMultipleFollowUpEnabled) {
22086
+ this.hasResponded.emit(false);
22087
+ return false;
22088
+ }
22089
+ if (isRespond) {
22090
+ this.hasResponded.emit(false);
22091
+ return false;
22092
+ }
22048
22093
  if (this.isInternalUser()) {
22049
22094
  if (isAwaiting) {
22050
22095
  this.hasResponded.emit(false);
@@ -22060,7 +22105,7 @@ class QueryDetailsComponent {
22060
22105
  this.hasResponded.emit(false);
22061
22106
  return false;
22062
22107
  }
22063
- static ɵfac = function QueryDetailsComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || QueryDetailsComponent)(i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(i1$1.Router)); };
22108
+ 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)); };
22064
22109
  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) {
22065
22110
  i0.ɵɵtemplate(0, QueryDetailsComponent_ng_container_0_Template, 45, 41, "ng-container", 1);
22066
22111
  } if (rf & 2) {
@@ -22069,8 +22114,8 @@ class QueryDetailsComponent {
22069
22114
  }
22070
22115
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(QueryDetailsComponent, [{
22071
22116
  type: Component,
22072
- args: [{ selector: 'ccd-query-details', template: "<ng-container *ngIf=\"query\">\n <p *ngIf=\"showItem\">\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"] }]
22073
- }], () => [{ type: SessionStorageService }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }], { query: [{
22117
+ args: [{ selector: 'ccd-query-details', template: "<ng-container *ngIf=\"query\">\n <p *ngIf=\"showItem\">\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"] }]
22118
+ }], () => [{ type: SessionStorageService }, { type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: AbstractAppConfig }, { type: CaseNotifier }], { query: [{
22074
22119
  type: Input
22075
22120
  }], caseId: [{
22076
22121
  type: Input
@@ -22081,7 +22126,7 @@ class QueryDetailsComponent {
22081
22126
  }], hasResponded: [{
22082
22127
  type: Output
22083
22128
  }] }); })();
22084
- (() => { (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 }); })();
22129
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryDetailsComponent, { className: "QueryDetailsComponent", filePath: "lib/shared/components/palette/query-management/components/query-details/query-details.component.ts", lineNumber: 16 }); })();
22085
22130
 
22086
22131
  class QueryEventCompletionComponent {
22087
22132
  eventCompletionParams;
@@ -23006,7 +23051,7 @@ class QueryConfirmationComponent {
23006
23051
  const _c0$B = (a0, a1) => ["/query-management", "query", a0, "4", a1];
23007
23052
  function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_Template(rf, ctx) { if (rf & 1) {
23008
23053
  const _r1 = i0.ɵɵgetCurrentView();
23009
- i0.ɵɵelementStart(0, "div", 5)(1, "ccd-query-list", 6);
23054
+ i0.ɵɵelementStart(0, "div", 6)(1, "ccd-query-list", 7);
23010
23055
  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)); });
23011
23056
  i0.ɵɵelementEnd()();
23012
23057
  } if (rf & 2) {
@@ -23016,7 +23061,7 @@ function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_T
23016
23061
  } }
23017
23062
  function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_Template(rf, ctx) { if (rf & 1) {
23018
23063
  i0.ɵɵelementContainerStart(0);
23019
- i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_Template, 2, 1, "div", 4);
23064
+ i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_div_1_Template, 2, 1, "div", 5);
23020
23065
  i0.ɵɵelementContainerEnd();
23021
23066
  } if (rf & 2) {
23022
23067
  const ctx_r1 = i0.ɵɵnextContext(2);
@@ -23025,7 +23070,7 @@ function ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_Templat
23025
23070
  } }
23026
23071
  function ReadQueryManagementFieldComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
23027
23072
  i0.ɵɵelementContainerStart(0);
23028
- i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_Template, 2, 1, "ng-container", 3);
23073
+ i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_container_0_ng_container_1_Template, 2, 1, "ng-container", 4);
23029
23074
  i0.ɵɵelementContainerEnd();
23030
23075
  } if (rf & 2) {
23031
23076
  const ctx_r1 = i0.ɵɵnextContext();
@@ -23034,7 +23079,7 @@ function ReadQueryManagementFieldComponent_ng_container_0_Template(rf, ctx) { if
23034
23079
  } }
23035
23080
  function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
23036
23081
  i0.ɵɵelementContainerStart(0);
23037
- i0.ɵɵelementStart(1, "button", 9);
23082
+ i0.ɵɵelementStart(1, "button", 10);
23038
23083
  i0.ɵɵtext(2);
23039
23084
  i0.ɵɵpipe(3, "rpxTranslate");
23040
23085
  i0.ɵɵelementEnd();
@@ -23046,8 +23091,22 @@ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_conta
23046
23091
  i0.ɵɵadvance();
23047
23092
  i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 2, "Ask a follow-up question"), " ");
23048
23093
  } }
23049
- function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_Template(rf, ctx) { if (rf & 1) {
23050
- i0.ɵɵelementStart(0, "div")(1, "p", 10);
23094
+ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_ng_container_0_Template(rf, ctx) { if (rf & 1) {
23095
+ i0.ɵɵelementContainerStart(0);
23096
+ i0.ɵɵelementStart(1, "button", 10);
23097
+ i0.ɵɵtext(2);
23098
+ i0.ɵɵpipe(3, "rpxTranslate");
23099
+ i0.ɵɵelementEnd();
23100
+ i0.ɵɵelementContainerEnd();
23101
+ } if (rf & 2) {
23102
+ const ctx_r1 = i0.ɵɵnextContext(4);
23103
+ i0.ɵɵadvance();
23104
+ i0.ɵɵproperty("routerLink", i0.ɵɵpureFunction2(4, _c0$B, ctx_r1.caseId, ctx_r1.query.id));
23105
+ i0.ɵɵadvance();
23106
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 2, "Ask a follow-up question"), " ");
23107
+ } }
23108
+ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_ng_template_1_Template(rf, ctx) { if (rf & 1) {
23109
+ i0.ɵɵelementStart(0, "div")(1, "p", 11);
23051
23110
  i0.ɵɵtext(2);
23052
23111
  i0.ɵɵpipe(3, "rpxTranslate");
23053
23112
  i0.ɵɵelementEnd();
@@ -23061,43 +23120,61 @@ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_templ
23061
23120
  i0.ɵɵadvance(3);
23062
23121
  i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(6, 4, "Our team will read your query and respond. Do not submit the same query more than once."));
23063
23122
  } }
23123
+ function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_ng_template_2_Template(rf, ctx) { if (rf & 1) {
23124
+ 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);
23125
+ } if (rf & 2) {
23126
+ const queryIsInReview_r5 = i0.ɵɵreference(2);
23127
+ const ctx_r1 = i0.ɵɵnextContext(3);
23128
+ 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);
23129
+ } }
23064
23130
  function ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
23065
23131
  i0.ɵɵelementContainerStart(0);
23066
- 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);
23132
+ 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);
23067
23133
  i0.ɵɵelementContainerEnd();
23068
23134
  } if (rf & 2) {
23069
- const queryIsInReview_r5 = i0.ɵɵreference(3);
23135
+ const sequentialQuery_r6 = i0.ɵɵreference(3);
23070
23136
  const ctx_r1 = i0.ɵɵnextContext(2);
23071
23137
  i0.ɵɵadvance();
23072
- 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);
23138
+ 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);
23073
23139
  } }
23074
23140
  function ReadQueryManagementFieldComponent_ng_template_1_Template(rf, ctx) { if (rf & 1) {
23075
23141
  const _r4 = i0.ɵɵgetCurrentView();
23076
- i0.ɵɵelementStart(0, "ccd-query-details", 7);
23142
+ i0.ɵɵelementStart(0, "ccd-query-details", 8);
23077
23143
  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); });
23078
23144
  i0.ɵɵelementEnd();
23079
- i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_Template, 4, 2, "ng-container", 8);
23145
+ i0.ɵɵtemplate(1, ReadQueryManagementFieldComponent_ng_template_1_ng_container_1_Template, 4, 2, "ng-container", 9);
23080
23146
  } if (rf & 2) {
23081
23147
  const ctx_r1 = i0.ɵɵnextContext();
23082
23148
  i0.ɵɵproperty("query", ctx_r1.query)("caseId", ctx_r1.caseId);
23083
23149
  i0.ɵɵadvance();
23084
- i0.ɵɵproperty("ngIf", !ctx_r1.isInternalUser());
23150
+ i0.ɵɵproperty("ngIf", !ctx_r1.isInternalUser() && !ctx_r1.isQueryClosed);
23085
23151
  } }
23086
23152
  class ReadQueryManagementFieldComponent extends AbstractFieldReadComponent {
23087
23153
  route;
23088
23154
  sessionStorageService;
23089
23155
  caseNotifier;
23156
+ abstractConfig;
23090
23157
  caseQueriesCollections;
23091
23158
  query;
23092
23159
  showQueryList = true;
23093
23160
  caseId;
23094
- constructor(route, sessionStorageService, caseNotifier) {
23161
+ messageType;
23162
+ followUpQuery = QueryCreateContext.FOLLOWUP;
23163
+ respondToQuery = QueryCreateContext.RESPOND;
23164
+ isQueryClosed = false;
23165
+ value;
23166
+ isMultipleFollowUpEnabled;
23167
+ enableServiceSpecificMultiFollowups;
23168
+ constructor(route, sessionStorageService, caseNotifier, abstractConfig) {
23095
23169
  super();
23096
23170
  this.route = route;
23097
23171
  this.sessionStorageService = sessionStorageService;
23098
23172
  this.caseNotifier = caseNotifier;
23173
+ this.abstractConfig = abstractConfig;
23099
23174
  }
23100
23175
  ngOnInit() {
23176
+ this.enableServiceSpecificMultiFollowups = this.abstractConfig.getEnableServiceSpecificMultiFollowups() || [];
23177
+ this.isMultipleFollowUpEnabled = this.enableServiceSpecificMultiFollowups.some((jurisdiction) => jurisdiction === this.caseNotifier?.cachedCaseView?.case_type?.jurisdiction.id);
23101
23178
  this.caseId = this.route.snapshot.params.cid;
23102
23179
  if (this.context === PaletteContext.DEFAULT) {
23103
23180
  // EUI-8303 Using mock data until CCD is ready with the API and data contract
@@ -23127,6 +23204,8 @@ class ReadQueryManagementFieldComponent extends AbstractFieldReadComponent {
23127
23204
  setQuery(query) {
23128
23205
  this.showQueryList = false;
23129
23206
  this.query = query;
23207
+ this.messageType = this.getMessageType(query);
23208
+ this.isQueryClosed = this.query?.children?.some((queryItem) => queryItem?.isClosed === 'Yes');
23130
23209
  }
23131
23210
  backToQueryListPage() {
23132
23211
  this.showQueryList = true;
@@ -23135,19 +23214,24 @@ class ReadQueryManagementFieldComponent extends AbstractFieldReadComponent {
23135
23214
  isInternalUser() {
23136
23215
  return isInternalUser(this.sessionStorageService);
23137
23216
  }
23138
- static ɵfac = function ReadQueryManagementFieldComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ReadQueryManagementFieldComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(CaseNotifier)); };
23139
- 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"]], template: function ReadQueryManagementFieldComponent_Template(rf, ctx) { if (rf & 1) {
23140
- i0.ɵɵtemplate(0, ReadQueryManagementFieldComponent_ng_container_0_Template, 2, 1, "ng-container", 2)(1, ReadQueryManagementFieldComponent_ng_template_1_Template, 2, 3, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
23217
+ getMessageType(query) {
23218
+ return query?.children?.length
23219
+ ? query.children[query.children.length - 1]?.messageType
23220
+ : undefined;
23221
+ }
23222
+ static ɵfac = function ReadQueryManagementFieldComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ReadQueryManagementFieldComponent)(i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(SessionStorageService), i0.ɵɵdirectiveInject(CaseNotifier), i0.ɵɵdirectiveInject(AbstractAppConfig)); };
23223
+ 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"]], template: function ReadQueryManagementFieldComponent_Template(rf, ctx) { if (rf & 1) {
23224
+ i0.ɵɵtemplate(0, ReadQueryManagementFieldComponent_ng_container_0_Template, 2, 1, "ng-container", 3)(1, ReadQueryManagementFieldComponent_ng_template_1_Template, 2, 3, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
23141
23225
  } if (rf & 2) {
23142
- const singleQueryDetails_r6 = i0.ɵɵreference(2);
23143
- i0.ɵɵproperty("ngIf", ctx.showQueryList)("ngIfElse", singleQueryDetails_r6);
23226
+ const singleQueryDetails_r7 = i0.ɵɵreference(2);
23227
+ i0.ɵɵproperty("ngIf", ctx.showQueryList)("ngIfElse", singleQueryDetails_r7);
23144
23228
  } }, encapsulation: 2 });
23145
23229
  }
23146
23230
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ReadQueryManagementFieldComponent, [{
23147
23231
  type: Component,
23148
- 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()\">\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-template>\n" }]
23149
- }], () => [{ type: i1$1.ActivatedRoute }, { type: SessionStorageService }, { type: CaseNotifier }], null); })();
23150
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadQueryManagementFieldComponent, { className: "ReadQueryManagementFieldComponent", filePath: "lib/shared/components/palette/query-management/read-query-management-field.component.ts", lineNumber: 15 }); })();
23232
+ 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-template>\n" }]
23233
+ }], () => [{ type: i1$1.ActivatedRoute }, { type: SessionStorageService }, { type: CaseNotifier }, { type: AbstractAppConfig }], null); })();
23234
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ReadQueryManagementFieldComponent, { className: "ReadQueryManagementFieldComponent", filePath: "lib/shared/components/palette/query-management/read-query-management-field.component.ts", lineNumber: 17 }); })();
23151
23235
 
23152
23236
  class ReadTextAreaFieldComponent extends AbstractFieldReadComponent {
23153
23237
  static ɵfac = /*@__PURE__*/ (() => { let ɵReadTextAreaFieldComponent_BaseFactory; return function ReadTextAreaFieldComponent_Factory(__ngFactoryType__) { return (ɵReadTextAreaFieldComponent_BaseFactory || (ɵReadTextAreaFieldComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ReadTextAreaFieldComponent)))(__ngFactoryType__ || ReadTextAreaFieldComponent); }; })();