@rh-support/troubleshoot 2.5.29 → 2.5.30

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":"CaseSolutions.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseSolutions/CaseSolutions.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAuE3E,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB,EAAE,OAAO,CAAC;CACnC;AAUD,eAAO,MAAM,aAAa,+EAkhBxB,CAAC"}
1
+ {"version":3,"file":"CaseSolutions.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseSolutions/CaseSolutions.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAuE3E,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB,EAAE,OAAO,CAAC;CACnC;AAUD,eAAO,MAAM,aAAa,+EA4gBxB,CAAC"}
@@ -292,7 +292,7 @@ export const CaseSolutions = forwardRef((props, ref) => {
292
292
  React.createElement(Trans, null, "We're glad to hear this article was helpful. Would you like to close this case or keep it open? You can still view the case after it closes.")));
293
293
  return (React.createElement(React.Fragment, null,
294
294
  closeCaseModal,
295
- linkedRecommendations.length !== 0 && pinnedRecommendations.length !== 0 && (React.createElement(Accordion, { isBordered: true, asDefinitionList: false, className: "card card-white case-details-aside-solutions" },
295
+ React.createElement(Accordion, { isBordered: true, asDefinitionList: false, className: "card card-white case-details-aside-solutions" },
296
296
  linkedRecommendations.length !== 0 && (React.createElement(AccordionItem, null,
297
297
  React.createElement(AccordionToggle, { id: "sol-handpicked", isExpanded: handPickedOpen, onClick: () => setHandPickedOpen((pre) => !pre) },
298
298
  React.createElement("span", null, canLinkUnlink ? (React.createElement(Trans, null, "Handpicked by you")) : (React.createElement(Trans, null, "Handpicked for this case"))),
@@ -312,7 +312,7 @@ export const CaseSolutions = forwardRef((props, ref) => {
312
312
  : renderPinsByCustomer(rec, index, 'pinned-recommendations')), perPage: 5, className: "list-icons list-icons-flush", isFetching: !!isLoadingRecommendations, perPageOptions: [
313
313
  { title: '5', value: 5 },
314
314
  { title: '10', value: 10 },
315
- ] }))))))),
315
+ ] })))))),
316
316
  topRecommendations.length > 0 && (React.createElement("div", { className: "card card-white card-support recommendations", ref: ref },
317
317
  React.createElement("h3", { className: "card-heading case-detail-panel-card-heading card-header-bg" },
318
318
  React.createElement(Trans, null, "Knowledgebase recommendations")),
@@ -1 +1 @@
1
- {"version":3,"file":"SessionRestore.d.ts","sourceRoot":"","sources":["../../../../src/components/SessionRestore/SessionRestore.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAkD,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAQvD,OAAO,EAGH,eAAe,EAElB,MAAM,iCAAiC,CAAC;AAiBzC,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,qBA+V3C"}
1
+ {"version":3,"file":"SessionRestore.d.ts","sourceRoot":"","sources":["../../../../src/components/SessionRestore/SessionRestore.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAkD,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAQvD,OAAO,EAGH,eAAe,EAElB,MAAM,iCAAiC,CAAC;AAkBzC,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,qBAiW3C"}
@@ -25,6 +25,7 @@ import { getSessionDetailsFromCase } from '../../reducers/CaseHelpers';
25
25
  import { setCaseAccountNumber, setCaseOwner, setCaseState, updateCaseWithSession } from '../../reducers/CaseReducer';
26
26
  import { AppRouteSections, sessionRestoreCardSections, } from '../../reducers/RouteConstNTypes';
27
27
  import { createSession, getIndividualSessionById, getRelevantSessionFromSessions, loadPreviousSessions, markAllSessionsUnresolved, updateActiveSessionId, updateSession, } from '../../reducers/SessionRestoreReducer';
28
+ import { useMetadata } from '../../utils/metadataUtil';
28
29
  import RouteUtils from '../../utils/routeUtils';
29
30
  import { resetAttachment } from '../shared/fileUpload';
30
31
  import { restoreFilesFromSession } from '../shared/fileUpload/reducer/AttachmentHelper';
@@ -53,6 +54,7 @@ export function SessionRestore(props) {
53
54
  const [previousSessions, setPreviousSessions] = useState([]);
54
55
  const previousActiveSessionId = usePrevious(sessionRestore.activeSessionId);
55
56
  const isFirstMountRef = useRef(true);
57
+ const { getMetadata } = useMetadata();
56
58
  /**
57
59
  * Fetching previous sessions on load
58
60
  */
@@ -153,6 +155,7 @@ export function SessionRestore(props) {
153
155
  userAgent: userAgentAB,
154
156
  originatingSystem: originatingSystem,
155
157
  caseCreationError: caseCreation500ErrorStatus,
158
+ metadata: JSON.stringify(getMetadata()),
156
159
  };
157
160
  // PCM-12337 - Moved the session patch call to submit case function in CaseReducer.ts
158
161
  const newSessionDetails = getSessionDetailsFromCase(caseDetails, selectedNotificationContacts);
@@ -1 +1 @@
1
- {"version":3,"file":"WidgetFileSelector.d.ts","sourceRoot":"","sources":["../../../../../../src/components/shared/fileUpload/fileSelectors/WidgetFileSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAAqB,MAAM,OAAO,CAAC;AAS1C,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB;IAC9D,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE;QACb,IAAI,EAAE,OAAO,CAAC;QACd,QAAQ,EAAE,MAAM,EAAE,CAAC;KACtB,CAAC;CACL;AAED,iBAAS,kBAAkB,CAAC,EACxB,EAAO,EACP,SAAc,EACd,WAAW,EACX,SAAiB,EACjB,MAAc,EACd,cAA8C,GACjD,EAAE,wBAAwB,qBAsF1B;AAED,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"WidgetFileSelector.d.ts","sourceRoot":"","sources":["../../../../../../src/components/shared/fileUpload/fileSelectors/WidgetFileSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAAqB,MAAM,OAAO,CAAC;AAS1C,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB;IAC9D,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE;QACb,IAAI,EAAE,OAAO,CAAC;QACd,QAAQ,EAAE,MAAM,EAAE,CAAC;KACtB,CAAC;CACL;AAED,iBAAS,kBAAkB,CAAC,EACxB,EAAO,EACP,SAAc,EACd,WAAW,EACX,SAAiB,EACjB,MAAc,EACd,cAA8C,GACjD,EAAE,wBAAwB,qBAuF1B;AAED,eAAe,kBAAkB,CAAC"}
@@ -12,7 +12,7 @@ function WidgetFileSelector({ id = '', className = '', isSessionId, isPrivate =
12
12
  const { caseDetails } = useCaseSelector((state) => ({
13
13
  caseDetails: state.caseDetails,
14
14
  }), isEqual);
15
- const { routeState: { activeSection, isCaseCreate }, } = useContext(RouteContext);
15
+ const { routeState: { activeStepName, isCaseCreate }, } = useContext(RouteContext);
16
16
  const MAX_SIZE = isIdea ? 5242880 : undefined;
17
17
  // Attachment Reducer Related
18
18
  const dispatchToAttachmentReducer = useContext(AttachmentDispatchContext);
@@ -31,7 +31,7 @@ function WidgetFileSelector({ id = '', className = '', isSessionId, isPrivate =
31
31
  // so that user can attach the same file twice
32
32
  inputRef.current.value = null;
33
33
  // Call a dtm track even whenever the file uploader is clicked
34
- dtmTrackEventUploadFileToAnalyze(isCaseCreate, activeSection, caseDetails.caseType, caseDetails.product, caseDetails.version);
34
+ dtmTrackEventUploadFileToAnalyze(isCaseCreate, activeStepName, caseDetails.caseType, caseDetails.summary, caseDetails.product, caseDetails.version);
35
35
  };
36
36
  return (React.createElement(React.Fragment, null,
37
37
  React.createElement("label", Object.assign({ className: "file-diag-dragndrop", htmlFor: "file-diag-selector" }, getRootProps({ onClick: onLabelClick }), { "data-tracking-id": "file-selector-widget-main" }),
@@ -1 +1 @@
1
- {"version":3,"file":"WizardLayout.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardLayout.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,EAAuC,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAavG,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,qBA4MzC"}
1
+ {"version":3,"file":"WizardLayout.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardLayout.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,EAAuC,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAcvG,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,qBA+MzC"}
@@ -22,6 +22,7 @@ import { RouteContext } from '../../context/RouteContext';
22
22
  import { SessionRestoreDispatchContext, SessionRestoreStateContext } from '../../context/SessionRestoreContext';
23
23
  import { setABTestVariation, submitCase } from '../../reducers/CaseReducer';
24
24
  import { AppRouteSections } from '../../reducers/RouteConstNTypes';
25
+ import { useMetadata } from '../../utils/metadataUtil';
25
26
  import RouteUtils from '../../utils/routeUtils';
26
27
  import PreCaseConfirmationModals, { PreCaseConfirmationModalsEnum, } from '../ConfirmationModals/PreCaseConfirmationModals';
27
28
  import AlertToastWrapper from '../Recommendations/AlertToastWrapper';
@@ -33,6 +34,7 @@ import WizardAside from './WizardAside';
33
34
  import WizardMain from './WizardMain';
34
35
  export function WizardLayout(props) {
35
36
  const { routeState: { activeSection, isCaseCreate }, } = useContext(RouteContext);
37
+ const { getMetadata } = useMetadata();
36
38
  const { caseCreationError, contactSSOName, caseType, product, caseState, ABTestVariation } = useCaseSelector((state) => ({
37
39
  caseState: state,
38
40
  caseCreationError: state.caseCreationError,
@@ -88,6 +90,7 @@ export function WizardLayout(props) {
88
90
  if (checkForConfirmationModalsOnReview())
89
91
  return;
90
92
  const sessionItem = previousSessions.data[activeSessionId];
93
+ sessionItem.session.metadata = JSON.stringify(getMetadata());
91
94
  const errorMessageCaseSubmit500 = (React.createElement(Trans, null,
92
95
  React.createElement("p", null,
93
96
  "Try submitting again after a minute. Please ",
@@ -52,12 +52,12 @@ function WizardMain(props) {
52
52
  RouteUtils.navigateToSection(props.routeProps, props.routeProps.location.pathname.replace(regex, ''), false);
53
53
  };
54
54
  const onSubmit = () => {
55
- setActiveSectionChanged(dispatchToRouteReducer, AppRouteSections.SUBMIT_CASE);
55
+ setActiveSectionChanged(dispatchToRouteReducer, AppRouteSections.SUBMIT_CASE, 'Submit');
56
56
  props.submitCaseAndNavigate(false);
57
57
  return;
58
58
  };
59
59
  const onCurrentStepChanged = (step) => {
60
- setActiveSectionChanged(dispatchToRouteReducer, step.id);
60
+ setActiveSectionChanged(dispatchToRouteReducer, step.id, step.name);
61
61
  updateisNextBtnClickedToShowValidationError(dispatchToRouteReducer, false);
62
62
  };
63
63
  const CustomFooter = (React.createElement(WizardFooter, null,
@@ -1 +1 @@
1
- {"version":3,"file":"WizardNavigation.d.ts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":"","sources":["../../../../src/components/wizardLayout/WizardNavigation.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAOvD,OAAO,EAAoB,eAAe,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAM3G,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC3C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,mBAAmB,EAAE,CAAC,gCAAgC,EAAE,OAAO,KAAK,IAAI,CAAC;IACzE,gBAAgB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,0BAA0B,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IAC5E,kCAAkC,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACpF,qCAAqC,CAAC,EAAE,OAAO,CAAC;IAChD,gCAAgC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACjF,aAAa,CAAC,EAAE,GAAG,CAAC;IACpB,oBAAoB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;CACxE;AAGD,iBAAS,gBAAgB,CAAC,KAAK,EAAE,MAAM,qBAqUtC;kBArUQ,gBAAgB;;;AAuUzB,eAAe,gBAAgB,CAAC"}
@@ -70,7 +70,7 @@ function WizardNavigation(props) {
70
70
  const isCreatingCase = RouteUtils.getQueryParams(props.routeProps).caseCreate === 'true';
71
71
  dtmTrackEventCaseCreationStepEncountered(isCreatingCase,
72
72
  // @ts-ignore
73
- props.activeStep.id, (_a = caseState.caseDetails) === null || _a === void 0 ? void 0 : _a.caseNumber, (_b = caseState.caseDetails) === null || _b === void 0 ? void 0 : _b.caseType, caseState.caseDetails.summary, caseState.caseDetails.product, caseState.caseDetails.version);
73
+ props.activeStep.name, (_a = caseState.caseDetails) === null || _a === void 0 ? void 0 : _a.caseNumber, (_b = caseState.caseDetails) === null || _b === void 0 ? void 0 : _b.caseType, caseState.caseDetails.summary, caseState.caseDetails.product, caseState.caseDetails.version);
74
74
  if (props.activeStep.id === AppRouteSections.TROUBLESHOOT) {
75
75
  window.scrollTo({
76
76
  top: 0,
@@ -150,7 +150,6 @@ function WizardNavigation(props) {
150
150
  navBarRef,
151
151
  timeout: 0,
152
152
  onlyIfNotInViewport: true,
153
- offset: 120,
154
153
  });
155
154
  setHasUserScrolled(true);
156
155
  props.setUserScrolledLabel(true);
@@ -184,7 +184,7 @@ export const submitCase = (dispatch_1, sessionRestoreDispatch_1, caseDetails_1,
184
184
  }
185
185
  // For updating the sessions and posting cep details after case creation
186
186
  postCaseCreationProcessing(isSecureSupport, dispatch, sessionRestoreDispatch, sessionItem, caseNumber, caseDetails);
187
- dtmTrackEventCaseCreationStepEncountered(isCreatingCaseFlow, 'submit', caseNumber, (_b = caseDetails.caseDetails) === null || _b === void 0 ? void 0 : _b.caseType, caseDetails.caseDetails.summary, caseDetails.caseDetails.product, caseDetails.caseDetails.version);
187
+ dtmTrackEventCaseCreationStepEncountered(isCreatingCaseFlow, 'Submit', caseNumber, (_b = caseDetails.caseDetails) === null || _b === void 0 ? void 0 : _b.caseType, caseDetails.caseDetails.summary, caseDetails.caseDetails.product, caseDetails.caseDetails.version);
188
188
  dispatch({ type: CaseReducerConstants.caseCreated, payload: { caseNoOfCreatedCase: caseNumber } });
189
189
  }
190
190
  catch (error) {
@@ -2,6 +2,7 @@ import { IAction } from '@rh-support/types/shared';
2
2
  import { AppRouteSections } from './RouteConstNTypes';
3
3
  export interface IRouteState {
4
4
  activeSection: AppRouteSections | undefined;
5
+ activeStepName: string | undefined;
5
6
  isCaseCreate: boolean;
6
7
  isSearchIntent: boolean;
7
8
  isNextBtnClickedToShowValidationError: boolean;
@@ -24,7 +25,7 @@ export declare const initialRouteReducerState: IRouteState;
24
25
  export declare const routeReducer: (pState: IRouteState, action: IActionType) => IRouteState;
25
26
  export declare const setNoValidEntitlement: (dispatch: RouteReducerDispatchType, noValidEntitlement: boolean) => void;
26
27
  export declare const setRouteFlags: (dispatch: RouteReducerDispatchType, isCaseCreate: boolean, isSearchIntent: boolean) => void;
27
- export declare const setActiveSectionChanged: (dispatch: RouteReducerDispatchType, activeSection: AppRouteSections) => void;
28
+ export declare const setActiveSectionChanged: (dispatch: RouteReducerDispatchType, activeSection: AppRouteSections, activeStepName: string) => void;
28
29
  export declare const updateisNextBtnClickedToShowValidationError: (dispatch: RouteReducerDispatchType, isNextBtnClickedToShowValidationError: boolean) => void;
29
30
  export {};
30
31
  //# sourceMappingURL=RouteReducer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RouteReducer.d.ts","sourceRoot":"","sources":["../../../src/reducers/RouteReducer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAGnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,MAAM,WAAW,WAAW;IACxB,aAAa,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAC5C,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,qCAAqC,EAAE,OAAO,CAAC;IAC/C,kBAAkB,EAAE,OAAO,CAAC;CAC/B;AAGD,oBAAY,qBAAqB;IAC7B,oBAAoB,yBAAyB;IAC7C,aAAa,kBAAkB;IAC/B,wCAAwC,6CAA6C;IACrF,qBAAqB,0BAA0B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C7C,aAAa,kBAAkB;IAC/B,wCAAwC,6CAA6C;IACrF,qBAAqB,0BAA0B;CAClD;AAED,MAAM,WAAW,iBAAkB,SAAQ,WAAW;IAClD,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACnB;AACD,KAAK,WAAW,GAAG,OAAO,CAAC,qBAAqB,EAAE,iBAAiB,CAAC,CAAC;AACrE,MAAM,MAAM,wBAAwB,GAAG,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;AAEpE,wBAAgB,cAAc,CAAC,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAE9E;AAGD,eAAO,MAAM,wBAAwB,EAAE,WAOtC,CAAC;AAEF,eAAO,MAAM,YAAY,WAAY,WAAW,UAAU,WAAW,KAAG,WA6BvE,CAAC;AAEF,eAAO,MAAM,qBAAqB,aAAc,wBAAwB,sBAAsB,OAAO,SAEpG,CAAC;AAEF,eAAO,MAAM,aAAa,aAAc,wBAAwB,gBAAgB,OAAO,kBAAkB,OAAO,SAK/G,CAAC;AAEF,eAAO,MAAM,uBAAuB,aACtB,wBAAwB,iBACnB,gBAAgB,kBACf,MAAM,SAMzB,CAAC;AAEF,eAAO,MAAM,2CAA2C,aAC1C,wBAAwB,yCACK,OAAO,SAMjD,CAAC"}
@@ -13,25 +13,26 @@ export function isSearchIntent(isCaseCreate, summary) {
13
13
  // Reducer
14
14
  export const initialRouteReducerState = {
15
15
  activeSection: undefined,
16
+ activeStepName: undefined,
16
17
  isCaseCreate: false,
17
18
  isSearchIntent: false,
18
19
  isNextBtnClickedToShowValidationError: false,
19
20
  noValidEntitlement: false,
20
21
  };
21
22
  export const routeReducer = (pState, action) => {
22
- var _a, _b, _c, _d, _e;
23
+ var _a, _b, _c, _d, _e, _f;
23
24
  switch (action.type) {
24
25
  case RouteReducerConstants.activeSectionChanged: {
25
- return Object.assign(Object.assign({}, pState), { activeSection: (_a = action.payload) === null || _a === void 0 ? void 0 : _a.activeSection });
26
+ return Object.assign(Object.assign({}, pState), { activeSection: (_a = action.payload) === null || _a === void 0 ? void 0 : _a.activeSection, activeStepName: (_b = action.payload) === null || _b === void 0 ? void 0 : _b.activeStepName });
26
27
  }
27
28
  case RouteReducerConstants.setRouteFlags: {
28
- return Object.assign(Object.assign({}, pState), { isCaseCreate: (_b = action.payload) === null || _b === void 0 ? void 0 : _b.isCaseCreate, isSearchIntent: (_c = action.payload) === null || _c === void 0 ? void 0 : _c.isSearchIntent });
29
+ return Object.assign(Object.assign({}, pState), { isCaseCreate: (_c = action.payload) === null || _c === void 0 ? void 0 : _c.isCaseCreate, isSearchIntent: (_d = action.payload) === null || _d === void 0 ? void 0 : _d.isSearchIntent });
29
30
  }
30
31
  case RouteReducerConstants.setisNextBtnClickedToShowValidationError: {
31
- return Object.assign(Object.assign({}, pState), { isNextBtnClickedToShowValidationError: (_d = action.payload) === null || _d === void 0 ? void 0 : _d.isNextBtnClickedToShowValidationError });
32
+ return Object.assign(Object.assign({}, pState), { isNextBtnClickedToShowValidationError: (_e = action.payload) === null || _e === void 0 ? void 0 : _e.isNextBtnClickedToShowValidationError });
32
33
  }
33
34
  case RouteReducerConstants.setNoValidEntitlement: {
34
- return Object.assign(Object.assign({}, pState), { noValidEntitlement: (_e = action.payload) === null || _e === void 0 ? void 0 : _e.noValidEntitlement });
35
+ return Object.assign(Object.assign({}, pState), { noValidEntitlement: (_f = action.payload) === null || _f === void 0 ? void 0 : _f.noValidEntitlement });
35
36
  }
36
37
  default: {
37
38
  return pState;
@@ -47,10 +48,10 @@ export const setRouteFlags = (dispatch, isCaseCreate, isSearchIntent) => {
47
48
  payload: { isCaseCreate: isCaseCreate, isSearchIntent: isSearchIntent },
48
49
  });
49
50
  };
50
- export const setActiveSectionChanged = (dispatch, activeSection) => {
51
+ export const setActiveSectionChanged = (dispatch, activeSection, activeStepName) => {
51
52
  dispatch({
52
53
  type: RouteReducerConstants.activeSectionChanged,
53
- payload: { activeSection },
54
+ payload: { activeSection, activeStepName },
54
55
  });
55
56
  };
56
57
  export const updateisNextBtnClickedToShowValidationError = (dispatch, isNextBtnClickedToShowValidationError) => {
@@ -1062,6 +1062,10 @@ svg.pf-v5-u-ml-xs.icon-size {
1062
1062
  max-width: min-content;
1063
1063
  }
1064
1064
 
1065
+ .review-form {
1066
+ background-color: #e0e0e0 !important;
1067
+ }
1068
+
1065
1069
  #DeepPurpleColorAILabel {
1066
1070
  background-color: #6600cc !important; //deep purple override because not available in PF yet
1067
1071
  position: relative;
@@ -0,0 +1,26 @@
1
+ interface IUserMetadata {
2
+ screenResolution: {
3
+ width: number;
4
+ height: number;
5
+ };
6
+ interactionTiming: Array<{
7
+ componentId?: string;
8
+ interactionTime?: number;
9
+ totalTimeSpent?: number;
10
+ }>;
11
+ customMetadata?: Record<string, any>;
12
+ }
13
+ export declare function useMetadata(): {
14
+ getMetadata: () => IUserMetadata;
15
+ getScreenResolution: () => {
16
+ width: number;
17
+ height: number;
18
+ };
19
+ getInteractionTiming: () => {
20
+ componentId?: string;
21
+ interactionTime?: number;
22
+ totalTimeSpent?: number;
23
+ }[];
24
+ };
25
+ export {};
26
+ //# sourceMappingURL=metadataUtil.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadataUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/metadataUtil.tsx"],"names":[],"mappings":"AAKA,UAAU,aAAa;IACnB,gBAAgB,EAAE;QACd,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,iBAAiB,EAAE,KAAK,CAAC;QACrB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,cAAc,CAAC,EAAE,MAAM,CAAC;KAC3B,CAAC,CAAC;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACxC;AAED,wBAAgB,WAAW;;;eAXZ,MAAM;gBACL,MAAM;;;sBAGA,MAAM;0BACF,MAAM;yBACP,MAAM;;EAgF9B"}
@@ -0,0 +1,62 @@
1
+ import { useContext, useEffect, useRef } from 'react';
2
+ import { RouteContext } from '../context/RouteContext';
3
+ import { AppRouteSections } from '../reducers/RouteConstNTypes';
4
+ export function useMetadata() {
5
+ const { routeState: { activeSection }, } = useContext(RouteContext);
6
+ // Ref to store metadata object
7
+ const metadataRef = useRef({
8
+ screenResolution: {
9
+ width: window.screen.width,
10
+ height: window.screen.height,
11
+ },
12
+ interactionTiming: [],
13
+ });
14
+ const lastChangeTimeRef = useRef(null);
15
+ const previousActiveSectionRef = useRef(null);
16
+ // Updates interaction timing whenever activeSection changes.
17
+ useEffect(() => {
18
+ if (!Object.values(AppRouteSections).includes(activeSection)) {
19
+ return;
20
+ }
21
+ setInteractionTiming();
22
+ setScreenResolution();
23
+ // eslint-disable-next-line react-hooks/exhaustive-deps
24
+ }, [activeSection]);
25
+ // Sets interaction timing based on the current and previous active sections.
26
+ const setInteractionTiming = () => {
27
+ const currentTime = new Date().getTime();
28
+ if (lastChangeTimeRef.current !== null && previousActiveSectionRef.current !== null) {
29
+ const interval = (currentTime - lastChangeTimeRef.current) / 1000;
30
+ const newInterval = {
31
+ componentId: previousActiveSectionRef.current,
32
+ interactionTime: interval,
33
+ };
34
+ metadataRef.current.interactionTiming.push(newInterval);
35
+ }
36
+ if (activeSection === AppRouteSections.SUBMIT_CASE) {
37
+ const totalTimeSpent = metadataRef.current.interactionTiming.reduce((acc, timing) => {
38
+ return acc + (timing.interactionTime || 0);
39
+ }, 0);
40
+ metadataRef.current.interactionTiming.push({
41
+ totalTimeSpent,
42
+ });
43
+ }
44
+ lastChangeTimeRef.current = currentTime;
45
+ previousActiveSectionRef.current = activeSection !== null && activeSection !== void 0 ? activeSection : null;
46
+ };
47
+ // Updates screen resolution in the metadata.
48
+ const setScreenResolution = () => {
49
+ metadataRef.current.screenResolution = {
50
+ width: window.screen.width,
51
+ height: window.screen.height,
52
+ };
53
+ };
54
+ const getMetadata = () => metadataRef.current;
55
+ const getScreenResolution = () => metadataRef.current.screenResolution;
56
+ const getInteractionTiming = () => metadataRef.current.interactionTiming;
57
+ return {
58
+ getMetadata,
59
+ getScreenResolution,
60
+ getInteractionTiming,
61
+ };
62
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "2.5.29",
3
+ "version": "2.5.30",
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": "56a481aa8f2d7994ac501a77fd986e14e41058d4"
137
+ "gitHead": "bb66a0d88ad5fc09388220681cfc12e063221838"
138
138
  }