@rh-support/troubleshoot 2.6.299 → 2.6.300

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 (178) hide show
  1. package/lib/esm/components/AccountInfo/AccountSelector.d.ts.map +1 -1
  2. package/lib/esm/components/AccountInfo/AccountSelector.js +40 -28
  3. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
  4. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +19 -46
  5. package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
  6. package/lib/esm/components/CaseEditView/Case.js +17 -49
  7. package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
  8. package/lib/esm/components/CaseEditView/CaseDetailsAside.js +8 -25
  9. package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
  10. package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +17 -31
  11. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts +2 -1
  12. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts.map +1 -1
  13. package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.js +6 -8
  14. package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
  15. package/lib/esm/components/CaseEditView/CaseOverview/index.js +28 -39
  16. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts +3 -1
  17. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts.map +1 -1
  18. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +4 -3
  19. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.d.ts.map +1 -1
  20. package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.js +7 -4
  21. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
  22. package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +36 -13
  23. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
  24. package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +33 -11
  25. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
  26. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +34 -38
  27. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
  28. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +9 -9
  29. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
  30. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +59 -19
  31. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.d.ts.map +1 -1
  32. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +9 -16
  33. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts +2 -4
  34. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
  35. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +148 -110
  36. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts +2 -6
  37. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
  38. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +241 -147
  39. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
  40. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +3 -5
  41. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts.map +1 -1
  42. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.js +1 -3
  43. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +4 -4
  44. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts +3 -35
  45. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
  46. package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +224 -63
  47. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.d.ts.map +1 -1
  48. package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +2 -7
  49. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.d.ts.map +1 -1
  50. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +9 -7
  51. package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
  52. package/lib/esm/components/CaseInformation/CaseInformation.js +5 -7
  53. package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
  54. package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +24 -37
  55. package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
  56. package/lib/esm/components/CaseInformation/SupportLevel.js +55 -32
  57. package/lib/esm/components/CaseManagement/CaseLanguageSelector.js +2 -2
  58. package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
  59. package/lib/esm/components/CaseManagement/CaseManagement.js +9 -4
  60. package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
  61. package/lib/esm/components/CaseManagement/Cep.js +7 -4
  62. package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
  63. package/lib/esm/components/IdeaInformation/IdeaInformation.js +12 -11
  64. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
  65. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +2 -4
  66. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +1 -0
  67. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  68. package/lib/esm/components/ProductSelector/AllProductsSelector.js +15 -3
  69. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
  70. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +37 -13
  71. package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
  72. package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +50 -30
  73. package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
  74. package/lib/esm/components/ProductSelector/ProductSelector.js +3 -1
  75. package/lib/esm/components/Review/Review.d.ts.map +1 -1
  76. package/lib/esm/components/Review/Review.js +18 -16
  77. package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
  78. package/lib/esm/components/SessionRestore/SessionRestore.js +1 -3
  79. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
  80. package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +8 -5
  81. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  82. package/lib/esm/components/shared/useIsSectionValid.js +64 -50
  83. package/lib/esm/components/shared/usePostComment.d.ts.map +1 -1
  84. package/lib/esm/components/shared/usePostComment.js +10 -6
  85. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
  86. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +24 -105
  87. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  88. package/lib/esm/components/wizardLayout/WizardLayout.js +7 -6
  89. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  90. package/lib/esm/components/wizardLayout/WizardNavigation.js +10 -10
  91. package/lib/esm/context/CaseContext.d.ts.map +1 -1
  92. package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
  93. package/lib/esm/hooks/useResetCaseCreate.js +11 -18
  94. package/lib/esm/reducers/CaseConstNTypes.d.ts +3 -86
  95. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  96. package/lib/esm/reducers/CaseConstNTypes.js +1 -5
  97. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts +1 -3
  98. package/lib/esm/reducers/CaseDetailsPageReducer.d.ts.map +1 -1
  99. package/lib/esm/reducers/CaseDetailsPageReducer.js +5 -22
  100. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts +2 -0
  101. package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts.map +1 -1
  102. package/lib/esm/reducers/CaseDiscussionTabReducer.js +28 -1
  103. package/lib/esm/reducers/CaseHelpers.d.ts +1 -2
  104. package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
  105. package/lib/esm/reducers/CaseHelpers.js +2 -34
  106. package/lib/esm/reducers/CaseOverviewReducer.d.ts +1 -3
  107. package/lib/esm/reducers/CaseOverviewReducer.d.ts.map +1 -1
  108. package/lib/esm/reducers/CaseOverviewReducer.js +5 -7
  109. package/lib/esm/reducers/CaseReducer.d.ts +8 -27
  110. package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
  111. package/lib/esm/reducers/CaseReducer.js +33 -127
  112. package/package.json +6 -6
  113. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts +0 -3
  114. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts.map +0 -1
  115. package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.js +0 -22
  116. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts +0 -15
  117. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts.map +0 -1
  118. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.js +0 -19
  119. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts +0 -17
  120. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts.map +0 -1
  121. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.js +0 -49
  122. package/lib/esm/graphql/index.d.ts +0 -4
  123. package/lib/esm/graphql/index.d.ts.map +0 -1
  124. package/lib/esm/graphql/index.js +0 -3
  125. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts +0 -2
  126. package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts.map +0 -1
  127. package/lib/esm/graphql/mutations/createRMECaseEscalation.js +0 -24
  128. package/lib/esm/graphql/mutations/index.d.ts +0 -2
  129. package/lib/esm/graphql/mutations/index.d.ts.map +0 -1
  130. package/lib/esm/graphql/mutations/index.js +0 -1
  131. package/lib/esm/graphql/queries/getEscalationDetails.d.ts +0 -2
  132. package/lib/esm/graphql/queries/getEscalationDetails.d.ts.map +0 -1
  133. package/lib/esm/graphql/queries/getEscalationDetails.js +0 -24
  134. package/lib/esm/graphql/queries/getParentId.d.ts +0 -2
  135. package/lib/esm/graphql/queries/getParentId.d.ts.map +0 -1
  136. package/lib/esm/graphql/queries/getParentId.js +0 -16
  137. package/lib/esm/graphql/queries/index.d.ts +0 -3
  138. package/lib/esm/graphql/queries/index.d.ts.map +0 -1
  139. package/lib/esm/graphql/queries/index.js +0 -2
  140. package/lib/esm/graphql/schemas/escalation.d.ts +0 -84
  141. package/lib/esm/graphql/schemas/escalation.d.ts.map +0 -1
  142. package/lib/esm/graphql/schemas/escalation.js +0 -1
  143. package/lib/esm/graphql/schemas/index.d.ts +0 -2
  144. package/lib/esm/graphql/schemas/index.d.ts.map +0 -1
  145. package/lib/esm/graphql/schemas/index.js +0 -1
  146. package/lib/esm/hooks/useCaseComments/caseCommentMutation.d.ts +0 -4
  147. package/lib/esm/hooks/useCaseComments/caseCommentMutation.d.ts.map +0 -1
  148. package/lib/esm/hooks/useCaseComments/caseCommentMutation.js +0 -12
  149. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts +0 -4
  150. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts.map +0 -1
  151. package/lib/esm/hooks/useCaseComments/caseCommentsQuery.js +0 -55
  152. package/lib/esm/hooks/useCaseComments/index.d.ts +0 -7
  153. package/lib/esm/hooks/useCaseComments/index.d.ts.map +0 -1
  154. package/lib/esm/hooks/useCaseComments/index.js +0 -5
  155. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts +0 -25
  156. package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts.map +0 -1
  157. package/lib/esm/hooks/useCaseComments/mapCaseComment.js +0 -66
  158. package/lib/esm/hooks/useCaseComments/types.d.ts +0 -80
  159. package/lib/esm/hooks/useCaseComments/types.d.ts.map +0 -1
  160. package/lib/esm/hooks/useCaseComments/types.js +0 -1
  161. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts +0 -16
  162. package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts.map +0 -1
  163. package/lib/esm/hooks/useCaseComments/useCaseComments.js +0 -25
  164. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts +0 -19
  165. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts.map +0 -1
  166. package/lib/esm/hooks/useCaseComments/useCreateCaseComment.js +0 -33
  167. package/lib/esm/hooks/useCaseHistory.d.ts +0 -26
  168. package/lib/esm/hooks/useCaseHistory.d.ts.map +0 -1
  169. package/lib/esm/hooks/useCaseHistory.js +0 -98
  170. package/lib/esm/models/caseHistory.d.ts +0 -80
  171. package/lib/esm/models/caseHistory.d.ts.map +0 -1
  172. package/lib/esm/models/caseHistory.js +0 -1
  173. package/lib/esm/utils/TimelineUtils.d.ts +0 -41
  174. package/lib/esm/utils/TimelineUtils.d.ts.map +0 -1
  175. package/lib/esm/utils/TimelineUtils.js +0 -134
  176. package/lib/esm/utils/caseHistoryUtils.d.ts +0 -66
  177. package/lib/esm/utils/caseHistoryUtils.d.ts.map +0 -1
  178. package/lib/esm/utils/caseHistoryUtils.js +0 -165
@@ -7,13 +7,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- // TODO: Re-enable after GraphQL migration of chats, external trackers, attachments
11
- // import { ICaseChat, IExternalTrackerUpdate } from '@cee-eng/hydrajs/@types/api/public/case';
12
- // import { IAttachment } from '@cee-eng/hydrajs/@types/models/attachment';
10
+ import { caseAttachments } from '@cee-eng/hydrajs';
13
11
  import { MenuToggle, Select, SelectList, SelectOption } from '@patternfly/react-core';
14
- import { AlertMessage, AlertType, ErrorBoundary, LoadingIndicator } from '@rh-support/components';
12
+ import { AlertMessage, AlertType, ErrorBoundary, LoadingIndicator, ToastNotification } from '@rh-support/components';
15
13
  import { useGlobalStateContext } from '@rh-support/react-context';
16
- import { dtmTrackEventCaseStepEncountered, getUrlParsedParams, scrollIntoView } from '@rh-support/utils';
14
+ import { AbilityContext, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
15
+ import { dtmTrackEventCaseStepEncountered, getDropdownBtnPlaceholder, getUrlParsedParams, scrollIntoView, } from '@rh-support/utils';
17
16
  import cloneDeep from 'lodash/cloneDeep';
18
17
  import filter from 'lodash/filter';
19
18
  import findIndex from 'lodash/findIndex';
@@ -25,27 +24,18 @@ import { Trans, useTranslation } from 'react-i18next';
25
24
  import { useLocation } from 'react-router-dom';
26
25
  import { AutoSizer, CellMeasurer, CellMeasurerCache, List, WindowScroller } from 'react-virtualized';
27
26
  import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
27
+ import { useCaseDetailsPageDispatchContext, useCaseDetailsPageStateContext, } from '../../../../context/CaseDetailsPageContext';
28
28
  import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext, } from '../../../../context/CaseDiscussionTabContext';
29
- import { clearReplyComment, discussionSortOrderConst, DiscussionType, setCommentText, setDiscussions, setSort,
30
- // TODO: Re-enable after GraphQL migration
31
- // setFilter,
32
- // updateAttachment,
33
- // updateAttacmentsAfterRemoval,
34
- // updateCommentStateFeedback,
35
- // updateDiscussionStateAttachments,
36
- } from '../../../../reducers/CaseDiscussionTabReducer';
29
+ import { clearReplyComment, discussionSortOrderConst, DiscussionType, setCommentText, setDiscussions, setFilter, setSort, updateAttachment, updateAttacmentsAfterRemoval, updateCommentStateFeedback, updateDiscussionStateAttachments, updateDiscussionStateComments, } from '../../../../reducers/CaseDiscussionTabReducer';
37
30
  import { setCaseState } from '../../../../reducers/CaseReducer';
38
- // TODO: Re-enable after GraphQL migration of attachments
39
- // import { AttachmentContextProvider } from '../../../shared/fileUpload/reducer/AttachmentReducerContext';
31
+ import { AttachmentContextProvider } from '../../../shared/fileUpload/reducer/AttachmentReducerContext';
40
32
  import { PDFContext } from '../../PDFContainer';
41
- // TODO: Re-enable after GraphQL migration
42
- // import CaseAttachment from './CaseAttachment';
43
- // import CaseChat from './CaseChat';
33
+ import CaseAttachment from './CaseAttachment';
34
+ import CaseChat from './CaseChat';
44
35
  import CaseComments from './CaseComments';
45
- // import CaseExternalTrackerUpdate from './CaseExternalTrackerUpdate';
36
+ import CaseExternalTrackerUpdate from './CaseExternalTrackerUpdate';
46
37
  import { CommentSearch } from './CommentSearch';
47
38
  import { PostComment } from './PostComment';
48
- /** Threshold above which comments render in a virtualized (windowed) list for performance. */
49
39
  const VC_MINIMUM_COMMENT = 150;
50
40
  let cellMeasureCache = new CellMeasurerCache({
51
41
  fixedWidth: true,
@@ -53,20 +43,30 @@ let cellMeasureCache = new CellMeasurerCache({
53
43
  });
54
44
  export default function CaseDiscussion(props) {
55
45
  const { t } = useTranslation();
56
- const { isPostingRemoteRequestCommentCompleted, product, version } = useCaseSelector((state) => ({
46
+ const { isPostingRemoteRequestCommentCompleted, screenSessionRequested, product, version } = useCaseSelector((state) => ({
57
47
  isPostingRemoteRequestCommentCompleted: state.isPostingRemoteRequestCommentCompleted,
48
+ screenSessionRequested: state.caseDetails.screenSessionRequested,
58
49
  product: state.caseDetails.product,
59
50
  version: state.caseDetails.version,
60
51
  }), isEqual);
61
52
  const urlSearchParams = getUrlParsedParams(useLocation().search);
62
- const discussionIdFromUrl = urlSearchParams === null || urlSearchParams === void 0 ? void 0 : urlSearchParams.commentId;
53
+ const discussionIdFromUrl = ((urlSearchParams === null || urlSearchParams === void 0 ? void 0 : urlSearchParams.commentId) ||
54
+ (urlSearchParams === null || urlSearchParams === void 0 ? void 0 : urlSearchParams.externalTrackerId) ||
55
+ (urlSearchParams === null || urlSearchParams === void 0 ? void 0 : urlSearchParams.attachmentId) ||
56
+ (urlSearchParams === null || urlSearchParams === void 0 ? void 0 : urlSearchParams.chatId));
63
57
  const activeDiscussionElementRef = useRef(null);
64
- const { sort, allDiscussions, replyCommentText, replyCommentCreator } = useCaseDiscussionTabStateContext();
65
- const { globalMetadataState: { navBarRef }, } = useGlobalStateContext();
58
+ const { sort, discussionFiltersListState, allDiscussions, replyCommentText, replyCommentCreator } = useCaseDiscussionTabStateContext();
59
+ const { globalMetadataState: { loggedInUsersAccount, navBarRef }, } = useGlobalStateContext();
66
60
  const dispatchDiscussion = useCaseDiscussionTabDispatchContext();
67
61
  const caseDispatch = useCaseDispatch();
62
+ const { caseDetailsPageState: { caseFeedbacksHydra, caseAttachmentHydra, caseExternalTrackersUpdate }, } = useCaseDetailsPageStateContext();
63
+ const dispatchCaseDetailsHydraAttachments = useCaseDetailsPageDispatchContext();
68
64
  const { caseNumber } = props;
69
65
  const activeElementId = useRef(null);
66
+ const ability = useContext(AbilityContext);
67
+ const canSeeExternalTracker = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_EXTERNAL_TRACKER);
68
+ const canSeeChat = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_CHAT);
69
+ const canSeeAttachments = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_SEE_ATTACHMENTS);
70
70
  const listRef = React.useRef(null);
71
71
  const windowScrollerRef = React.useRef(null);
72
72
  const commentRef = React.useRef(null);
@@ -78,7 +78,10 @@ export default function CaseDiscussion(props) {
78
78
  const [isJumpToCommentClicked, setJumpToCommentClicked] = useState(false);
79
79
  const [canUpdateScrollTop, setCanUpdateScrollTop] = useState(true);
80
80
  const [replyingToPrivateComment, setReplyingToPrivateComment] = useState(null);
81
+ // used for tracking comment section width changes
81
82
  const [discussionSectionWidth, setDiscussionSectionWidth] = useState(null);
83
+ const [isOpen, setIsOpen] = useState(false);
84
+ const [selectedFilterItems, setSelectedFilterItems] = useState([]);
82
85
  const [isSortOpen, setIsSortOpen] = useState(false);
83
86
  const [sortSelected, setSortSelected] = useState('Select a value');
84
87
  if (props.isDiscussionTab) {
@@ -87,10 +90,18 @@ export default function CaseDiscussion(props) {
87
90
  defaultHeight: 100,
88
91
  });
89
92
  }
93
+ const computeFilterComment = () => {
94
+ return filter(allDiscussions, (discussion) => {
95
+ const activeFilter = discussionFiltersListState.filter((filter) => filter.value === discussion.discussionType && filter.isSelected);
96
+ return activeFilter.length === 1 ? discussion : null;
97
+ });
98
+ };
90
99
  const shouldRenderRVComponent = !isExportingPDF && allDiscussions.length > VC_MINIMUM_COMMENT;
100
+ // filter comments on the basis of filterBy and search api
101
+ const computeFilteredComments = computeFilterComment();
91
102
  const comuteSearchedComments = searchResult.length === 0
92
- ? cloneDeep(allDiscussions)
93
- : filter([...allDiscussions], (o) => { var _a; return searchResult.indexOf((_a = o === null || o === void 0 ? void 0 : o.item) === null || _a === void 0 ? void 0 : _a.id) !== -1; });
103
+ ? cloneDeep(computeFilteredComments)
104
+ : filter([...computeFilteredComments], (o) => { var _a; return searchResult.indexOf((_a = o === null || o === void 0 ? void 0 : o.item) === null || _a === void 0 ? void 0 : _a.id) !== -1; });
94
105
  const isSearchResultEmpty = !isEmpty(searchCommentText) && (searchResult.length === 0 || comuteSearchedComments.length === 0);
95
106
  const setVRCommentIndex = (cId) => {
96
107
  setCommentIndex(cId < 0 ? 0 : cId);
@@ -109,6 +120,8 @@ export default function CaseDiscussion(props) {
109
120
  if (allDiscussions.length > VC_MINIMUM_COMMENT) {
110
121
  const commentIndex = findIndex([...comuteSearchedComments], (discussion) => discussion.item.id === discussionIdFromUrl);
111
122
  setVRCommentIndex(commentIndex);
123
+ // to fix scrolling to comment index when scrollTop value from window scroller is 0
124
+ // initial list items
112
125
  if (0 <= commentIndex && commentIndex <= 3) {
113
126
  const offset = 80;
114
127
  const scrollTopValue = ((_a = windowScrollerRef === null || windowScrollerRef === void 0 ? void 0 : windowScrollerRef.current) === null || _a === void 0 ? void 0 : _a._positionFromTop) - offset;
@@ -133,24 +146,38 @@ export default function CaseDiscussion(props) {
133
146
  // eslint-disable-next-line react-hooks/exhaustive-deps
134
147
  }, [discussionIdFromUrl, allDiscussions, activeElementId.current]);
135
148
  useEffect(() => {
136
- if (!isExportingPDF) {
137
- setDiscussions(dispatchDiscussion, props.caseComments, [], // TODO: Re-enable chats after GraphQL migration
138
- [], // TODO: Re-enable attachments after GraphQL migration
139
- [], // TODO: Re-enable feedbacks after GraphQL migration
140
- [], // TODO: Re-enable external trackers after GraphQL migration
141
- [], false, false, false);
149
+ if (!caseAttachmentHydra.isFetching && caseAttachmentHydra.isError) {
150
+ ToastNotification.addDangerMessage(t(`There was an error loading attachments.`));
142
151
  }
143
- // eslint-disable-next-line react-hooks/exhaustive-deps
144
- }, [props.caseComments]);
145
- const onCommentAdded = () => __awaiter(this, void 0, void 0, function* () {
146
- try {
147
- yield props.refetchComments();
152
+ if (!caseExternalTrackersUpdate.isFetching && caseExternalTrackersUpdate.isError) {
153
+ ToastNotification.addDangerMessage(t(`There was an error loading external trackers.`));
148
154
  }
149
- catch (e) {
150
- console.error('Failed to refetch comments:', e);
155
+ if (!caseFeedbacksHydra.isFetching && caseFeedbacksHydra.isError) {
156
+ console.log(`There was an error loading feedback.`);
151
157
  }
158
+ // Attachments, feedbacks and external tracker updates apis are called in advance
159
+ if (!isExportingPDF &&
160
+ !caseAttachmentHydra.isFetching &&
161
+ !caseFeedbacksHydra.isFetching &&
162
+ !caseExternalTrackersUpdate.isFetching) {
163
+ setDiscussions(dispatchDiscussion, props.caseComments, props.caseChats, caseAttachmentHydra.data, caseFeedbacksHydra.data, caseExternalTrackersUpdate.data, discussionFiltersListState, canSeeExternalTracker, canSeeChat, canSeeAttachments);
164
+ }
165
+ // eslint-disable-next-line react-hooks/exhaustive-deps
166
+ }, [props.caseComments, caseAttachmentHydra, props.caseChats, caseFeedbacksHydra, caseExternalTrackersUpdate]);
167
+ const onAttachmentRemove = (uuid_removed) => {
168
+ updateAttacmentsAfterRemoval(dispatchDiscussion, uuid_removed, allDiscussions, discussionFiltersListState);
169
+ };
170
+ const onFeedbackUpdate = (comment_id, feedback) => {
171
+ updateCommentStateFeedback(dispatchDiscussion, comment_id, feedback, allDiscussions);
172
+ };
173
+ const onCommentAdded = () => __awaiter(this, void 0, void 0, function* () {
174
+ yield updateDiscussionStateComments(dispatchDiscussion, caseDispatch, caseNumber, allDiscussions, sort, caseFeedbacksHydra.data, discussionFiltersListState);
152
175
  dtmTrackEventCaseStepEncountered('comment', caseNumber, product, version);
153
176
  });
177
+ const onAttachmentAdded = () => __awaiter(this, void 0, void 0, function* () {
178
+ ToastNotification.addSuccessMessage(t('Attachment(s) uploaded successfully'));
179
+ yield updateDiscussionStateAttachments(dispatchDiscussion, caseNumber, allDiscussions, sort, loggedInUsersAccount.data.secureSupport, discussionFiltersListState, dispatchCaseDetailsHydraAttachments);
180
+ });
154
181
  const onReply = (commentText, commentCreator, isPublic) => {
155
182
  var _a;
156
183
  setReplyingToPrivateComment(!isPublic);
@@ -164,11 +191,11 @@ export default function CaseDiscussion(props) {
164
191
  clearReplyComment(dispatchDiscussion);
165
192
  setReplyingToPrivateComment(null);
166
193
  };
167
- /** Strips special chars to prevent regex injection, then HTML-escapes via DOM round-trip to prevent XSS. */
168
194
  const sanitizedSearchInput = (value) => {
169
195
  if (!value)
170
196
  return '';
171
197
  const sanitizedValue = value.replace(/[^a-zA-Z0-9]/g, '');
198
+ // To escape HTML-like characters (e.g., <, >, &) in sanitizedValue
172
199
  const div = document.createElement('div');
173
200
  div.textContent = sanitizedValue;
174
201
  return div.innerHTML;
@@ -182,10 +209,10 @@ export default function CaseDiscussion(props) {
182
209
  isCommentSearchCleared && setIsCommentSearchCleared(false);
183
210
  };
184
211
  const highlightSearchResults = (searchTerm) => {
185
- // Delay allows the DOM (especially virtualized rows) to finish rendering before mark.js can highlight matches.
186
212
  setTimeout(() => {
213
+ // to mark attachment link button text
187
214
  if (!isEmpty(sanitizedSearchInput(searchTerm))) {
188
- const sanitizedSearchTerm = sanitizedSearchInput(searchTerm);
215
+ const sanitizedSearchTerm = sanitizedSearchInput(searchTerm); // Sanitize the search term
189
216
  document.querySelectorAll('button.attachment-download-btn').forEach((button) => {
190
217
  var _a, _b;
191
218
  if ((_a = button === null || button === void 0 ? void 0 : button.textContent) === null || _a === void 0 ? void 0 : _a.includes(sanitizedSearchTerm)) {
@@ -199,6 +226,9 @@ export default function CaseDiscussion(props) {
199
226
  done: () => {
200
227
  if (isEmpty(searchTerm))
201
228
  return;
229
+ // removed { separateWordSearch: false }
230
+ // so the search term is split into individual words, and each word is matched separately.
231
+ // Search Term: "frontend developer" Matches: Text containing "frontend" or "developer".
202
232
  markInstance.mark(searchTerm);
203
233
  },
204
234
  });
@@ -210,52 +240,34 @@ export default function CaseDiscussion(props) {
210
240
  highlightSearchResults('');
211
241
  setSearchResult([]);
212
242
  if (cId === discussionIdFromUrl) {
243
+ // reason to reset activeElementId if comment id is same in the url on click jump to comment button
244
+ // we need to re compute filtered comments after clear search results.
245
+ // it will call useEffect and will set virtual comment Index(setVRCommentIndex())
213
246
  activeElementId.current = '';
214
247
  }
215
248
  };
216
- // TODO: Re-enable after GraphQL migration of attachments
217
- // const onAttachmentRemove = (uuid_removed) => {
218
- // updateAttacmentsAfterRemoval(dispatchDiscussion, uuid_removed, allDiscussions, discussionFiltersListState);
219
- // };
220
- // TODO: Re-enable after GraphQL migration of attachments
221
- // const onAttachmentAdded = async () => {
222
- // ToastNotification.addSuccessMessage(t('Attachment(s) uploaded successfully'));
223
- // await updateDiscussionStateAttachments(
224
- // dispatchDiscussion,
225
- // caseNumber,
226
- // allDiscussions,
227
- // sort,
228
- // loggedInUsersAccount.data.secureSupport,
229
- // discussionFiltersListState,
230
- // dispatchCaseDetailsHydraAttachments
231
- // );
232
- // };
233
- // TODO: Re-enable after GraphQL migration of attachments
234
- // const onMetadataUpdate = (attachmentId: string, updatedAttachment) => {
235
- // updateAttachment(dispatchDiscussion, attachmentId, updatedAttachment, allDiscussions);
236
- // };
237
- // TODO: Re-enable after GraphQL migration of attachments
238
- // const downloadAttachment = async ({ caseNumber, uuid, name }) => {
239
- // const tempToastId = ToastNotification.addInfoMessage(t('Starting file download'));
240
- // try {
241
- // await caseAttachments.downloadAttachmentS3(
242
- // caseNumber,
243
- // uuid,
244
- // name,
245
- // false,
246
- // loggedInUsersAccount.data.secureSupport
247
- // );
248
- // } catch (e) {
249
- // ToastNotification.addDangerMessage(
250
- // t(`Could not download {{filename}}: {{error}}`, {
251
- // filename: name,
252
- // error: e?.message,
253
- // })
254
- // );
255
- // } finally {
256
- // tempToastId && ToastNotification.clearToast(tempToastId);
257
- // }
258
- // };
249
+ const onMetadataUpdate = (attachmentId, updatedAttachment) => {
250
+ updateAttachment(dispatchDiscussion, attachmentId, updatedAttachment, allDiscussions);
251
+ };
252
+ const downloadAttachment = (_a) => __awaiter(this, [_a], void 0, function* ({ caseNumber, uuid, name }) {
253
+ const tempToastId = ToastNotification.addInfoMessage(t('Starting file download'));
254
+ try {
255
+ yield caseAttachments.downloadAttachmentS3(caseNumber, uuid, name, false, loggedInUsersAccount.data.secureSupport);
256
+ }
257
+ catch (e) {
258
+ ToastNotification.addDangerMessage(t(`Could not download {{filename}}: {{error}}`, {
259
+ filename: name,
260
+ error: e === null || e === void 0 ? void 0 : e.message,
261
+ }));
262
+ }
263
+ finally {
264
+ tempToastId && ToastNotification.clearToast(tempToastId);
265
+ }
266
+ });
267
+ /**
268
+ * We need to clear the cell measurer cache if user resizes the window or discussion section width is changed
269
+ * so that the height of the rows are re-calculated
270
+ */
259
271
  useEffect(() => {
260
272
  if (discussionSectionWidth && shouldRenderRVComponent) {
261
273
  cellMeasureCache && cellMeasureCache.clearAll();
@@ -270,6 +282,7 @@ export default function CaseDiscussion(props) {
270
282
  return (React.createElement(WindowScroller, { ref: windowScrollerRef, onScroll: handleScroll }, ({ height, registerChild, onChildScroll, isScrolling, scrollTop }) => {
271
283
  return (React.createElement("div", { ref: commentRef, "data-tracking-id": "vr-case-comments" },
272
284
  React.createElement(AutoSizer, { disableHeight: true }, ({ width }) => {
285
+ // setTimeout to update state in the next tick and avoid bad setState warnings
273
286
  discussionSectionWidth !== width &&
274
287
  setTimeout(() => setDiscussionSectionWidth(width), 0);
275
288
  return (React.createElement("div", { ref: registerChild },
@@ -282,18 +295,17 @@ export default function CaseDiscussion(props) {
282
295
  const renderCaseCommentElement = (discussion) => {
283
296
  if (isEmpty(discussion) || isEmpty(discussion.item))
284
297
  return null;
285
- return (React.createElement("div", { "data-tracking-id": "discussion-elements", key: discussion.item.id }, discussion.discussionType === DiscussionType.COMMENT && (React.createElement(CaseComments, { caseNumber: caseNumber, ref: discussionIdFromUrl === discussion.item.id ? activeDiscussionElementRef : null, comment: discussion.item, onFeedBackUpdate: () => { }, feedback: discussion.feedback, accountNumber: props.accountNumber, onReply: onReply, showJumpToComment: !isEmpty(searchCommentText), onJumpToComment: onJumpToComment, downloadAttachment: () => { } }))));
298
+ return (React.createElement("div", { "data-tracking-id": "discussion-elements", key: discussion.item.id },
299
+ discussion.discussionType === DiscussionType.COMMENT && (React.createElement(CaseComments, { caseNumber: caseNumber, ref: discussionIdFromUrl === discussion.item.id ? activeDiscussionElementRef : null, comment: discussion.item, onFeedBackUpdate: onFeedbackUpdate, feedback: discussion.feedback, accountNumber: props.accountNumber, onReply: onReply, showJumpToComment: !isEmpty(searchCommentText), onJumpToComment: onJumpToComment, downloadAttachment: downloadAttachment })),
300
+ discussion.discussionType === DiscussionType.ATTACHMENT && (React.createElement(CaseAttachment, { attachment: discussion.item, onAttachmentRemove: onAttachmentRemove, onMetadataUpdate: onMetadataUpdate, showJumpToComment: !isEmpty(searchCommentText), onJumpToComment: onJumpToComment, downloadAttachment: downloadAttachment, ref: discussionIdFromUrl === discussion.item.id ? activeDiscussionElementRef : null })),
301
+ discussion.discussionType === DiscussionType.CHAT && (React.createElement(CaseChat, { caseNumber: caseNumber, ref: discussionIdFromUrl === discussion.item.id ? activeDiscussionElementRef : null, chat: discussion.item, showJumpToComment: !isEmpty(searchCommentText), onJumpToComment: onJumpToComment })),
302
+ discussion.discussionType === DiscussionType.EXTERNAL_TRACKER && (React.createElement(CaseExternalTrackerUpdate, { caseNumber: caseNumber, ref: discussionIdFromUrl === discussion.item.id ? activeDiscussionElementRef : null, trackerUpdate: discussion.item, showJumpToComment: !isEmpty(searchCommentText), onJumpToComment: onJumpToComment }))));
286
303
  };
287
- const rowRenderer = ({ index, parent, key, style, }) => {
304
+ const rowRenderer = ({ index, parent, key, style }) => {
288
305
  const discussion = comuteSearchedComments[index];
289
306
  return (React.createElement(CellMeasurer, { key: key, cache: cellMeasureCache, parent: parent, columnIndex: 0, rowIndex: index },
290
307
  React.createElement("div", { className: "comment-virtualized-row", key: key, style: style }, renderCaseCommentElement(discussion))));
291
308
  };
292
- /**
293
- * One-shot scroll override used after search/filter changes.
294
- * Resets the virtualized list to the top, then yields control back to
295
- * WindowScroller's default onChildScroll for subsequent scroll events.
296
- */
297
309
  const customChildScroll = ({ scrollTop }) => {
298
310
  var _a;
299
311
  if (!canUpdateScrollTop) {
@@ -306,25 +318,23 @@ export default function CaseDiscussion(props) {
306
318
  };
307
319
  const handleScroll = ({ scrollTop }) => {
308
320
  var _a, _b, _c, _d, _e, _f;
321
+ // here we are doing couple of things
322
+ // 1. check scroll position on the first comment, 2. set scrollposition as par window top
323
+ // 3. if user click on jump to comment button then select row as per commentid and adding css class.
309
324
  isCommentSearchCleared && setIsCommentSearchCleared(false);
310
325
  if (listRef && commentRef) {
311
- // Skip one scroll cycle after a search/filter reset to let customChildScroll re-sync
312
326
  if (!canUpdateScrollTop) {
313
327
  setCanUpdateScrollTop(true);
314
328
  return;
315
329
  }
316
330
  const commentTop = (_b = (_a = commentRef === null || commentRef === void 0 ? void 0 : commentRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) === null || _b === void 0 ? void 0 : _b.top;
317
- // Re-apply search highlights on scroll since virtualized rows re-mount
318
331
  !isEmpty(searchCommentText) && highlightSearchResults(searchCommentText);
319
- // Normal browsing or comment section visible above viewport — sync list position
320
332
  if (isEmpty(discussionIdFromUrl) || commentTop > 0) {
321
333
  (_c = listRef === null || listRef === void 0 ? void 0 : listRef.current) === null || _c === void 0 ? void 0 : _c.scrollToPosition(commentTop > 0 ? 0 : Math.abs(commentTop));
322
334
  }
323
335
  else if (commentTop < 0 && !isEmpty(discussionIdFromUrl) && !isJumpToCommentClicked) {
324
- // Deep-link navigation: let WindowScroller drive the list scroll position
325
336
  (_d = listRef === null || listRef === void 0 ? void 0 : listRef.current) === null || _d === void 0 ? void 0 : _d.scrollToPosition(scrollTop);
326
337
  }
327
- // After a "jump to comment" click, scroll the virtualized list to the target row
328
338
  if (isJumpToCommentClicked) {
329
339
  (_e = listRef === null || listRef === void 0 ? void 0 : listRef.current) === null || _e === void 0 ? void 0 : _e.scrollToRow(commentIndex);
330
340
  (_f = windowScrollerRef === null || windowScrollerRef === void 0 ? void 0 : windowScrollerRef.current) === null || _f === void 0 ? void 0 : _f.updatePosition();
@@ -332,6 +342,7 @@ export default function CaseDiscussion(props) {
332
342
  }
333
343
  }
334
344
  };
345
+ const list = discussionFiltersListState.filter((filter) => filter.canSee);
335
346
  useEffect(() => {
336
347
  if (isPostingRemoteRequestCommentCompleted) {
337
348
  onCommentAdded();
@@ -339,32 +350,59 @@ export default function CaseDiscussion(props) {
339
350
  }
340
351
  // eslint-disable-next-line react-hooks/exhaustive-deps
341
352
  }, [isPostingRemoteRequestCommentCompleted]);
353
+ const onToggleClick = (e) => {
354
+ e.stopPropagation();
355
+ setIsOpen(!isOpen);
356
+ };
342
357
  const onSortToggleClick = (e) => {
343
358
  e.stopPropagation();
344
359
  setIsSortOpen(!isSortOpen);
345
360
  };
346
- const onSortSelect = (_event, value) => {
347
- const selectedSort = discussionSortOrderConst.find((option) => option.name === value);
348
- if (selectedSort) {
349
- setSort(dispatchDiscussion, selectedSort, allDiscussions);
350
- setSortSelected(selectedSort.name);
351
- }
361
+ const onFilterSelect = (_event, prevOption) => {
362
+ const isFilterSelected = !prevOption.isSelected; // to get updated state of changed filter
363
+ const prevSelectedFilters = list.filter((option) => option.isSelected && option.value !== prevOption.value); // to get previously selected filters
364
+ const prevSelectedFiltersValue = prevSelectedFilters.map((option) => option.value);
365
+ const newSelectedFilters = isFilterSelected // has all the selected values of filter with the updated selected filter state
366
+ ? [...prevSelectedFiltersValue, prevOption.value]
367
+ : prevSelectedFiltersValue;
368
+ setFilter(dispatchDiscussion, newSelectedFilters, discussionFiltersListState);
369
+ shouldRenderRVComponent && setCanUpdateScrollTop(false);
370
+ setSelectedFilterItems(prevSelectedFiltersValue);
371
+ };
372
+ const toggle = (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, onClick: onToggleClick, isExpanded: isOpen, isFullWidth: true }, getDropdownBtnPlaceholder(t('Select a filter'), list.filter((i) => i.isSelected).map((i) => i.filterLabel), ' ', list.length, t('All comments'))));
373
+ const onSortSelect = (_event, selectedSort) => {
374
+ setSort(dispatchDiscussion, selectedSort, allDiscussions);
375
+ setSortSelected(selectedSort.value);
352
376
  setIsSortOpen(false);
353
377
  };
354
378
  const onSortToggle = (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, onClick: onSortToggleClick, isExpanded: isSortOpen, isFullWidth: true }, sort.name));
355
379
  return (React.createElement(React.Fragment, null,
356
380
  React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading post comment section') } },
357
- React.createElement(PostComment, { caseNumber: caseNumber, allDiscussions: allDiscussions, onCommentAdded: onCommentAdded, commentText: replyCommentText, onCommentClear: resetReplyComment, commentCreator: replyCommentCreator, defaultIsPublic: replyingToPrivateComment === null ? replyingToPrivateComment : !replyingToPrivateComment })),
358
- props.commentsLoading && allDiscussions.length === 0 && React.createElement(LoadingIndicator, { size: "sm" }),
359
- props.commentsError && allDiscussions.length === 0 && (React.createElement(AlertMessage, { variant: AlertType.DANGER, show: true, title: t('Failed to load comments. Try refreshing.') })),
360
- !props.commentsLoading && !props.commentsError && allDiscussions.length === 0 && (React.createElement(Trans, null, "No comments")),
361
- allDiscussions.length !== 0 && (React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading comments. Try refreshing.') } },
381
+ React.createElement(AttachmentContextProvider, null,
382
+ React.createElement(PostComment, { caseNumber: caseNumber, allDiscussions: allDiscussions, onCommentAdded: onCommentAdded, onAttachmentAdded: onAttachmentAdded, commentText: replyCommentText, onCommentClear: resetReplyComment, commentCreator: replyCommentCreator, defaultIsPublic: replyingToPrivateComment === null ? replyingToPrivateComment : !replyingToPrivateComment }))),
383
+ React.createElement(LoadingIndicator, { className: "text-center", isInline: true, show: caseAttachmentHydra.isFetching ||
384
+ caseExternalTrackersUpdate.isFetching ||
385
+ caseFeedbacksHydra.isFetching ||
386
+ (screenSessionRequested && allDiscussions.length === 0) }),
387
+ !caseAttachmentHydra.isFetching &&
388
+ !caseFeedbacksHydra.isFetching &&
389
+ !caseExternalTrackersUpdate.isFetching &&
390
+ !screenSessionRequested &&
391
+ allDiscussions.length === 0 && React.createElement(Trans, null, "No comments"),
392
+ !caseAttachmentHydra.isFetching &&
393
+ !caseFeedbacksHydra.isFetching &&
394
+ !caseExternalTrackersUpdate.isFetching &&
395
+ allDiscussions.length !== 0 && (React.createElement(ErrorBoundary, { errorMsgInfo: { message: t('There was an error loading comments. Try refreshing.') } },
362
396
  React.createElement("div", { className: `pfe-l-grid pfe-m-all-6-col pfe-m-gutters push-bottom ${isExportingPDF ? 'hide-in-pdf' : ''}` },
363
- React.createElement("div", { className: "pfe-m-12-col" }, allDiscussions.length > 20 && (React.createElement(CommentSearch, { caseDiscussions: allDiscussions || [], onCommentSearch: onCaseCommentSearch, isCommentSearchCleared: isCommentSearchCleared }))),
397
+ React.createElement("div", { className: "pfe-m-12-col" }, allDiscussions.length > 20 && (React.createElement(CommentSearch, { caseDiscussions: computeFilteredComments || [], onCommentSearch: onCaseCommentSearch, isCommentSearchCleared: isCommentSearchCleared }))),
398
+ React.createElement("span", { className: "push-top-narrow" },
399
+ React.createElement("label", { htmlFor: "case-list-comments-dropdown", className: "pf-v6-u-mb-sm" }, t('Filter by')),
400
+ React.createElement(Select, { "data-tracking-id": "discussions-filter-comments-dropdown", id: "case-list-comments-dropdown", role: "menu", isOpen: isOpen, selected: selectedFilterItems, onSelect: onFilterSelect, onOpenChange: (isOpen) => setIsOpen(isOpen), toggle: toggle, popperProps: { direction: 'down', enableFlip: false }, zIndex: 9 },
401
+ React.createElement(SelectList, null, list.map((option) => (React.createElement(SelectOption, { hasCheckbox: true, value: option, isSelected: option.isSelected, isDisabled: option.isDisabled }, option.filterLabel)))))),
364
402
  React.createElement("span", { className: "push-top-narrow" },
365
403
  React.createElement("label", { htmlFor: "se-discussion-sort", className: "pf-v6-u-mb-sm" }, t('Sort by')),
366
404
  React.createElement(Select, { id: "se-discussion-sort", "data-tracking-id": "discussions-sort-dropdown", isOpen: isSortOpen, selected: sortSelected, onSelect: onSortSelect, onOpenChange: (isSortOpen) => setIsSortOpen(isSortOpen), toggle: onSortToggle, shouldFocusToggleOnSelect: true, popperProps: { direction: 'down', enableFlip: false }, zIndex: 9 },
367
- React.createElement(SelectList, null, discussionSortOrderConst.map((option) => (React.createElement(SelectOption, { value: option.name, isSelected: isEqual(sort.name, option.name) }, option.name))))))),
405
+ React.createElement(SelectList, null, discussionSortOrderConst.map((option) => (React.createElement(SelectOption, { value: option, isSelected: isEqual(sort.name, option.name) }, option.name))))))),
368
406
  React.createElement("div", { className: "support-comment-section" }, !shouldRenderRVComponent &&
369
407
  !isSearchResultEmpty &&
370
408
  comuteSearchedComments.map((discussion, index) => {
@@ -5,13 +5,9 @@ interface IProps {
5
5
  commentText?: string;
6
6
  commentCreator?: string;
7
7
  onCommentAdded?: () => Promise<void>;
8
+ onAttachmentAdded?: () => void;
9
+ onAttachmentRemove?: (uuid: string) => void;
8
10
  onCommentClear?: () => void;
9
- /**
10
- * Controls the initial visibility toggle state.
11
- * - `true` / `false` — sets comment visibility to public/private.
12
- * - `null` — resets to the default (public).
13
- * - `undefined` — same as omitting the prop.
14
- */
15
11
  defaultIsPublic?: boolean;
16
12
  allDiscussions: IDiscussion[];
17
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PostComment.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/PostComment.tsx"],"names":[],"mappings":"AAQA,OAAO,KAA+D,MAAM,OAAO,CAAC;AAMpF,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAqB5E,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAIrC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,WAAW,EAAE,CAAC;CACjC;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,qBA4VxC"}
1
+ {"version":3,"file":"PostComment.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/PostComment.tsx"],"names":[],"mappings":"AA8BA,OAAO,KAAwE,MAAM,OAAO,CAAC;AAQ7F,OAAO,EAAkB,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAsB5F,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,WAAW,EAAE,CAAC;CACjC;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,qBA+iBxC"}