@rh-support/troubleshoot 2.6.6 → 2.6.8

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.
@@ -1 +1 @@
1
- {"version":3,"file":"CaseDetailsTabs.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsTabs.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAa,MAAM,kBAAkB,CAAC;AA0BlE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,mBAAmB,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CACnD;AACD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,qBA4Q5C"}
1
+ {"version":3,"file":"CaseDetailsTabs.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsTabs.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAE,mBAAmB,EAAa,MAAM,kBAAkB,CAAC;AA0BlE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,mBAAmB,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CACnD;AACD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,qBAoS5C"}
@@ -1,4 +1,6 @@
1
- import { Label, Tab, TabContent, Tabs, TabsComponent, TabTitleText, Text, TextContent, TextVariants, } from '@patternfly/react-core';
1
+ import { Label, Popover, Tab, TabContent, Tabs, TabsComponent, TabTitleText, Text, TextContent, TextVariants, } from '@patternfly/react-core';
2
+ import ExternalLinkAltIcon from '@patternfly/react-icons/dist/js/icons/external-link-alt-icon';
3
+ import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
2
4
  import { ErrorBoundary, LoadingIndicator } from '@rh-support/components';
3
5
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
4
6
  import { ability, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
@@ -143,12 +145,21 @@ export function CaseDetailsTabs(props) {
143
145
  ? false
144
146
  : true;
145
147
  return (React.createElement("div", { className: "case-details-tabs", role: "region", ref: props.tabdRef },
146
- React.createElement(Tabs, { className: isExportingPDF ? 'hide-in-pdf' : '', activeKey: getActiveTabKey(), component: TabsComponent.nav, onSelect: handleTabClick, "aria-label": t('Case details tabs') }, tabsToRender.map((tab, index) => (React.createElement(Tab, { eventKey: index, tabContentRef: tab.ref, tabContentId: `pf-tab-${index}-${tab.title.split(' ')[0]}-tabpanel`, key: tab.title, href: `#${props.basePath}/${tab.routePath}`, "data-tracking-id": tab['data-tracking-id'], title: React.createElement(TabTitleText, { className: tab.title === CaseDetailsTabsEnum.GENERATE_AI_CASE_SUMMARY
148
+ React.createElement(Tabs, { className: isExportingPDF ? 'hide-in-pdf' : '', activeKey: getActiveTabKey(), component: TabsComponent.nav, onSelect: handleTabClick, "aria-label": t('Case details tabs') }, tabsToRender.map((tab, index) => (React.createElement(Tab, { eventKey: index, tabContentRef: tab.ref, tabContentId: `pf-tab-${index}-${tab.title.split(' ')[0]}-tabpanel`, key: tab.title, href: `#${props.basePath}/${tab.routePath}`, "data-tracking-id": tab['data-tracking-id'], title: React.createElement(TabTitleText, { className: tab.title === CaseDetailsTabsEnum.GENERATE_AI_CASE_SUMMARY ||
149
+ tab.title === CaseDetailsTabsEnum.HISTORY
147
150
  ? 'tab-title-with-badge'
148
151
  : undefined },
149
152
  React.createElement(Trans, null, tab.title),
150
153
  tab.title === CaseDetailsTabsEnum.GENERATE_AI_CASE_SUMMARY && (React.createElement("div", { className: "gradient-border-badge" },
151
- React.createElement(Label, { className: "preview-label" }, "Preview")))) })))),
154
+ React.createElement(Label, { className: "preview-label" }, "Preview"))),
155
+ tab.title === CaseDetailsTabsEnum.HISTORY && (React.createElement(Popover, { "aria-label": "Track support case evolution with case history", triggerAction: "hover", bodyContent: React.createElement(React.Fragment, null,
156
+ React.createElement("p", null, "Track support case evolution with case history"),
157
+ React.createElement("a", { href: "https://access.redhat.com/articles/7120652", target: "_blank", rel: "noreferrer" },
158
+ "Case history article",
159
+ ' ',
160
+ React.createElement("span", { style: { marginLeft: '0.25rem' } },
161
+ React.createElement(ExternalLinkAltIcon, null)))) },
162
+ React.createElement(InfoCircleIcon, { color: "gray" })))) })))),
152
163
  React.createElement("div", { className: "case-details-tabs-content pf-v5-u-pt-xl" }, tabsToRender.map((tab, index) => {
153
164
  return index === getActiveTabKey() && !isExportingPDF ? (React.createElement(TabContent, { eventKey: index, key: tab.key, id: `pf-tab-${index}-${tab.title.split(' ')[0]}-tabpanel`, ref: tab.ref, "aria-label": tab.title, hidden: isExportingPDF ? !isTabVisibleInPdfExport(tab) : index !== getActiveTabKey() },
154
165
  React.createElement(ErrorBoundary, { errorMsgInfo: {
@@ -1 +1 @@
1
- {"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseHistory/Timeline.tsx"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AA2BxB,OAAO,KAAsC,MAAM,OAAO,CAAC;AAgT3D,QAAA,MAAM,QAAQ;;uBAmUb,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseHistory/Timeline.tsx"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AA2BxB,OAAO,KAAsC,MAAM,OAAO,CAAC;AAwT3D,QAAA,MAAM,QAAQ;;uBA4Ub,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -22,7 +22,7 @@ import { Trans, useTranslation } from 'react-i18next';
22
22
  const TimelineEvent = ({ date, text, side, user, useAvatar }) => {
23
23
  if (side === 'left') {
24
24
  if (useAvatar) {
25
- // we only want to render the main date if the user changes, otherwise stay with just the time
25
+ // we render the main date if the user changes or if the date changes
26
26
  return (React.createElement("div", { className: `${side}-node ${user}`, role: "complementary", "aria-label": `${user}'s timeline Event Time` },
27
27
  React.createElement("div", { className: `contentTimeline content-${side}-history content-${side}-${user}` },
28
28
  React.createElement("h2", { className: `content-date-${side}-history` }, date),
@@ -187,18 +187,19 @@ const applyReplacements = (item) => {
187
187
  newText = formatBooleanChange(fieldName, item.newValue);
188
188
  if (typeof newText === 'string')
189
189
  newText = newText.replace(/Problem Statement/g, 'Title');
190
+ if (typeof newText === 'string')
191
+ newText = newText.replace(/Case Type/g, 'Support Type');
190
192
  return newText;
191
193
  };
192
194
  // function to change the apiResponse
193
195
  const transformApiResponseToTimelineData = (apiResponse) => {
194
196
  let previousUser = null;
197
+ let previousDate = null;
195
198
  const timelineEvents = apiResponse.historyItems
196
199
  // Filter out 'Case Group' and 'OwnerId' changes because we don't have decode of value
197
200
  .filter((item) => item.fieldName !== 'FolderId__c' && item.fieldName !== 'OwnerId')
198
201
  .map((item, index) => {
199
202
  const currentUser = item.createdByUserName;
200
- const useAvatar = index === 0 || (!!previousUser && currentUser !== previousUser);
201
- previousUser = currentUser;
202
203
  let eventDate;
203
204
  if (typeof item.createdDate === 'string' && item.createdDate.includes('T')) {
204
205
  eventDate = parse(item.createdDate, "yyyy-MM-dd'T'HH:mm:ss'Z'", new Date());
@@ -206,6 +207,12 @@ const transformApiResponseToTimelineData = (apiResponse) => {
206
207
  else {
207
208
  eventDate = fromUnixTime(item.createdDate / 1000);
208
209
  }
210
+ const currentDate = format(eventDate, 'MMMM d, yyyy');
211
+ const useAvatar = index === 0 ||
212
+ (!!previousUser && currentUser !== previousUser) ||
213
+ (!!previousDate && currentDate !== previousDate);
214
+ previousUser = currentUser;
215
+ previousDate = currentDate;
209
216
  const user = item.createdByCustomer !== undefined
210
217
  ? item.createdByCustomer
211
218
  ? 'customer'
@@ -214,7 +221,7 @@ const transformApiResponseToTimelineData = (apiResponse) => {
214
221
  ? 'internal'
215
222
  : 'customer';
216
223
  const leftEvent = {
217
- date: format(eventDate, 'MMMM d, yyyy'),
224
+ date: currentDate,
218
225
  text: format(eventDate, 'h:mm a zzz'),
219
226
  };
220
227
  let outputText = item.outputText;
@@ -287,10 +294,15 @@ const Timeline = ({ caseNumber }) => {
287
294
  };
288
295
  const applyAvatarLogic = (events) => {
289
296
  let previousUser = null;
297
+ let previousDate = null;
290
298
  return events.map((event, index) => {
291
299
  const currentUser = event.right.date.split(' ')[0];
292
- const useAvatar = index === 0 || (!!previousUser && currentUser !== previousUser);
300
+ const currentDate = event.left.date;
301
+ const useAvatar = index === 0 ||
302
+ (!!previousUser && currentUser !== previousUser) ||
303
+ (!!previousDate && currentDate !== previousDate);
293
304
  previousUser = currentUser;
305
+ previousDate = currentDate;
294
306
  return Object.assign(Object.assign({}, event), { right: Object.assign(Object.assign({}, event.right), { useAvatar: useAvatar }) });
295
307
  });
296
308
  };
@@ -395,6 +407,8 @@ const Timeline = ({ caseNumber }) => {
395
407
  return isSameDay(eventDate, selectedDate);
396
408
  });
397
409
  }
410
+ // Reapply avatar logic to filtered events to ensure dates show properly
411
+ finalFilteredEvents = applyAvatarLogic(finalFilteredEvents);
398
412
  setFilteredEvents(finalFilteredEvents);
399
413
  setPage(1);
400
414
  }, [searchValue, dateValue, timelineEvents]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.6.6",
3
+ "version": "2.6.8",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -134,5 +134,5 @@
134
134
  "defaults and supports es6-module",
135
135
  "maintained node versions"
136
136
  ],
137
- "gitHead": "1b833d4c1dfeea406f617d1b448972d280954a28"
137
+ "gitHead": "821e51261a013b8dc5cf6e3ff4428d09301babad"
138
138
  }