@rh-support/troubleshoot 1.1.0 → 1.1.1

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":"AlertToastWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/AlertToastWrapper.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAc,EAAE,EAAE,EAAc,MAAM,OAAO,CAAC;AAO9C,UAAU,MAAM;IACZ,qBAAqB,EAAE,CAAC,cAAc,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5D;AAED,QAAA,MAAM,iBAAiB,EAAE,EAAE,CAAC,MAAM,CAajC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"AlertToastWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/AlertToastWrapper.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAc,EAAE,EAAE,EAAwB,MAAM,OAAO,CAAC;AAOxD,UAAU,MAAM;IACZ,qBAAqB,EAAE,CAAC,cAAc,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5D;AAED,QAAA,MAAM,iBAAiB,EAAE,EAAE,CAAC,MAAM,CAmBjC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -2,18 +2,21 @@
2
2
  * We need to wrap Critical solution toast notification and Cluster recommendation toast notification so they don't get overlapped.
3
3
  */
4
4
  import { AlertGroup } from '@patternfly/react-core';
5
- import React, { useContext } from 'react';
5
+ import React, { useContext, useState } from 'react';
6
6
  import { RouteContext } from '../../context/RouteContext';
7
- import { hideSideBarClusterIdRuleToast, showSideBarCriticalSolutionsToast } from '../../reducers/RouteConstNTypes';
7
+ import { hideSideBarClusterIdRuleToast } from '../../reducers/RouteConstNTypes';
8
8
  import { ResubmitToast } from '../SubmitCase/ResubmitToast';
9
9
  import ClusterRecommendationToast from './ClusterRecommendationToast';
10
10
  import CriticalSolutionsToast from './CriticalSolutionsToast';
11
11
  const AlertToastWrapper = ({ submitCaseAndNavigate }) => {
12
12
  const { routeState: { activeSection }, } = useContext(RouteContext);
13
13
  const hideClusterIdReportModal = hideSideBarClusterIdRuleToast.includes(activeSection);
14
- const showClusterRecommendation = showSideBarCriticalSolutionsToast.includes(activeSection);
14
+ const [isCriticalSolutionsVisible, setIsCriticalSolutionsVisible] = useState(true);
15
+ const userClosed = () => {
16
+ setIsCriticalSolutionsVisible(false);
17
+ };
15
18
  return (React.createElement(AlertGroup, { isToast: true },
16
- showClusterRecommendation && React.createElement(CriticalSolutionsToast, null),
19
+ isCriticalSolutionsVisible && React.createElement(CriticalSolutionsToast, { userClosed: userClosed }),
17
20
  !hideClusterIdReportModal && React.createElement(ClusterRecommendationToast, null),
18
21
  React.createElement(ResubmitToast, { submitCaseAndNavigate: submitCaseAndNavigate })));
19
22
  };
@@ -1 +1 @@
1
- {"version":3,"file":"AsideResults.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/AsideResults.tsx"],"names":[],"mappings":"AAiCA,wBAAgB,YAAY,gBAiM3B"}
1
+ {"version":3,"file":"AsideResults.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/AsideResults.tsx"],"names":[],"mappings":"AAiCA,wBAAgB,YAAY,gBAkM3B"}
@@ -124,7 +124,7 @@ export function AsideResults() {
124
124
  return;
125
125
  createOrUpdateSessionResources(sessionRestoreDispatch, activeSessionId, sessionResourceTracking, SessionResourceSource.RECOMMENDATIONS_ASIDE, getSessResFromRecs(recommendationState.sideRecommendation, SessionResourceVisibility.PRESENTED), JSON.stringify(payload));
126
126
  // eslint-disable-next-line react-hooks/exhaustive-deps
127
- }, [recommendationState.sideRecommendation, activeSessionId]);
127
+ }, [recommendationState.sideRecommendation, activeSessionId, activeSection]);
128
128
  const isIdea = caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT;
129
129
  if (!canShowSideRecommendations())
130
130
  return React.createElement(React.Fragment, null);
@@ -1,5 +1,6 @@
1
1
  import { FC } from 'react';
2
2
  interface IProps {
3
+ userClosed: () => void;
3
4
  }
4
5
  declare const CriticalSolutionsToast: FC<IProps>;
5
6
  export default CriticalSolutionsToast;
@@ -1 +1 @@
1
- {"version":3,"file":"CriticalSolutionsToast.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/CriticalSolutionsToast.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,EAAE,EAAmC,MAAM,OAAO,CAAC;AAKnE,UAAU,MAAM;CAAG;AAEnB,QAAA,MAAM,sBAAsB,EAAE,EAAE,CAAC,MAAM,CA+CtC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"CriticalSolutionsToast.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/CriticalSolutionsToast.tsx"],"names":[],"mappings":"AACA,OAAc,EAAE,EAAE,EAAmC,MAAM,OAAO,CAAC;AAKnE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,QAAA,MAAM,sBAAsB,EAAE,EAAE,CAAC,MAAM,CAiDtC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -3,7 +3,7 @@ import React, { useContext, useEffect, useState } from 'react';
3
3
  import { Trans, useTranslation } from 'react-i18next';
4
4
  import { RulesDispatchContext, RulesStateContext } from '../../context/RulesContext';
5
5
  import { RulesReducerConstants } from '../../reducers/RulesReducer';
6
- const CriticalSolutionsToast = () => {
6
+ const CriticalSolutionsToast = (props) => {
7
7
  const { t } = useTranslation();
8
8
  const [showNotification, setShowNotification] = useState(false);
9
9
  const { rulesState } = useContext(RulesStateContext);
@@ -20,6 +20,7 @@ const CriticalSolutionsToast = () => {
20
20
  payload: { triggerRuleNotification: false },
21
21
  });
22
22
  setShowNotification(false);
23
+ props.userClosed();
23
24
  };
24
25
  const setEAModalVisibility = (isVisible) => {
25
26
  rulesDispatch({
@@ -30,10 +31,11 @@ const CriticalSolutionsToast = () => {
30
31
  const viewCriticalSolution = () => {
31
32
  onClose();
32
33
  setEAModalVisibility(true);
34
+ props.userClosed();
33
35
  };
34
36
  if (!showNotification && !rulesState.triggerRuleNotification)
35
37
  return null;
36
- return (React.createElement(Alert, { isLiveRegion: true, variant: "success", title: t('Critical solutions have been triggered'), "data-tracking-id": "toast-view-crit-sol", actionLinks: React.createElement(Button, { isInline: true, variant: "link", onClick: viewCriticalSolution },
37
- React.createElement(Trans, null, "View recommendations")), actionClose: React.createElement(AlertActionCloseButton, { variantLabel: "success alert", onClose: onClose }) }));
38
+ return (React.createElement(Alert, { isLiveRegion: true, variant: "success", title: t('File recommendations are ready to view'), "data-tracking-id": "toast-view-crit-sol", actionLinks: React.createElement(Button, { isInline: true, variant: "link", onClick: viewCriticalSolution },
39
+ React.createElement(Trans, null, "Troubleshooting specific for your uploaded files.")), actionClose: React.createElement(AlertActionCloseButton, { variantLabel: "success alert", onClose: onClose }) }));
38
40
  };
39
41
  export default CriticalSolutionsToast;
@@ -1 +1 @@
1
- {"version":3,"file":"InsightsResults.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/InsightsResults.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAgC,MAAM,0CAA0C,CAAC;AAG7G,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAwB5D,UAAU,MAAO,SAAQ,gBAAgB;IACrC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AASD,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;CAClB;AAED,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,eA8PrC;kBA9PQ,eAAe;;;AAiQxB,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"InsightsResults.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/InsightsResults.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAgC,MAAM,0CAA0C,CAAC;AAG7G,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAwB5D,UAAU,MAAO,SAAQ,gBAAgB;IACrC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B;AASD,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;CAClB;AAED,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,eAuPrC;kBAvPQ,eAAe;;;AA0PxB,eAAe,eAAe,CAAC"}
@@ -19,7 +19,7 @@ var __rest = (this && this.__rest) || function (s, e) {
19
19
  return t;
20
20
  };
21
21
  import { search } from '@cee-eng/hydrajs';
22
- import { Alert, Button } from '@patternfly/react-core';
22
+ import { Alert } from '@patternfly/react-core';
23
23
  import { usePrevious } from '@rh-support/components';
24
24
  import { getSolrParams } from '@rh-support/utils';
25
25
  import difference from 'lodash/difference';
@@ -238,10 +238,8 @@ function InsightsResults(props) {
238
238
  return (React.createElement(InsightResultModal, { EARule: validEARules, onModalToggle: insightsModalToggle, isOpen: isRuleModalVisible, insightResults: allResults, isRenderedMain: true }));
239
239
  }
240
240
  return (React.createElement(React.Fragment, null,
241
- !rulesState.triggerRuleNotification && (React.createElement(Alert, { isInline: true, title: t('Critical solutions have been triggered'), "data-tracking-id": "inline-view-crit-sol", actionLinks: React.createElement(Button, { isInline: true, className: "pf-c-alert__action", variant: "link", onClick: () => {
242
- setEAModalVisibility(true);
243
- } },
244
- React.createElement(Trans, null, "View recommendations")) })),
241
+ !rulesState.triggerRuleNotification && (React.createElement(Alert, { isInline: true, title: t('File recommendations are ready to view'), "data-tracking-id": "inline-view-crit-sol", children: React.createElement("p", null,
242
+ React.createElement(Trans, null, "Troubleshooting specific for your uploaded files.")) })),
245
243
  React.createElement(InsightResultModal, { EARule: validEARules, onModalToggle: insightsModalToggle, isOpen: isRuleModalVisible, insightResults: allResults })));
246
244
  }
247
245
  InsightsResults.defaultProps = defaultProps;
@@ -1 +1 @@
1
- {"version":3,"file":"SubmitCase.d.ts","sourceRoot":"","sources":["../../../../src/components/SubmitCase/SubmitCase.tsx"],"names":[],"mappings":"AA2BA,MAAM,CAAC,OAAO,UAAU,UAAU,gBAiRjC"}
1
+ {"version":3,"file":"SubmitCase.d.ts","sourceRoot":"","sources":["../../../../src/components/SubmitCase/SubmitCase.tsx"],"names":[],"mappings":"AA4BA,MAAM,CAAC,OAAO,UAAU,UAAU,gBAqRjC"}
@@ -16,6 +16,7 @@ import { RulesStateContext } from '../../context/RulesContext';
16
16
  import { TCStateContext } from '../../context/TopContentContext';
17
17
  import { getIrtForSLAAndSeverity, getOrtForSLAAndSeverity } from '../../reducers/CaseHelpers';
18
18
  import RouteUtils from '../../utils/routeUtils';
19
+ import { AsideResults } from '../Recommendations/AsideResults';
19
20
  import ClusterRecommendations from '../Recommendations/ClusterRecommendations';
20
21
  import InsightsResults from '../Recommendations/InsightsResults';
21
22
  import { RemoteRiderBanner } from '../RemoteRider/RemoteRiderBanner';
@@ -135,14 +136,11 @@ export default function SubmitCase() {
135
136
  React.createElement(Button, { className: "pf-u-ml-md", component: (props) => React.createElement(Link, Object.assign({}, props, { to: `/case/${caseNumber}` })), href: getCaseURL(), variant: "primary", "data-tracking-id": "get-support-view-case", isDisabled: viewDisabled }, "View case"))))),
136
137
  !isEmpty(attachmentState.caseFiles.selectedLocalFiles) && (React.createElement(FileUploader, { idToUploadTo: caseNumber, isSessionId: false, isSecureSupport: loggedInUsersAccount.data.secureSupport })),
137
138
  React.createElement("div", null,
138
- (!isEmpty(topContent.data) ||
139
- !rulesState.EARules.rules ||
140
- !clusterRecommendations ||
141
- isIdea) && (React.createElement(Text, { className: "pf-u-mt-2xl pf-u-font-weight-light", component: TextVariants.h2 },
139
+ (!isEmpty(topContent.data) || !rulesState.EARules.rules || !clusterRecommendations) &&
140
+ !isIdea && (React.createElement(Text, { className: "pf-u-mt-2xl pf-u-font-weight-light", component: TextVariants.h2 },
142
141
  React.createElement(Trans, null, "Troubleshoot this case"))),
143
142
  React.createElement("div", { className: isIdea ? 'pf-u-mt-lg' : '' },
144
143
  React.createElement(InsightsResults, { isDisplayOnMain: true })),
145
144
  React.createElement(ClusterRecommendations, { showClusterRecommendationsModal: false }),
146
- !isEmpty(topContent.data) && (React.createElement("div", { className: "pf-u-mt-lg" },
147
- React.createElement(Suggestions, { title: isIdea ? t('Search recommendations') : t('Product recommendations'), showTitleDescription: true, showMax: 6 }))))))));
145
+ React.createElement("div", { className: "pf-u-mt-lg" }, isIdea ? (React.createElement(AsideResults, null)) : (!isEmpty(topContent.data) && (React.createElement(Suggestions, { title: isIdea ? t('Search recommendations') : t('Product recommendations'), showTitleDescription: true, showMax: 6 })))))))));
148
146
  }
@@ -39,7 +39,7 @@ function WizardAside(props) {
39
39
  canshowEARuleWidget && React.createElement(EARuleWidget, null),
40
40
  React.createElement(InsightsResults, null),
41
41
  " ",
42
- React.createElement(AsideResults, null),
42
+ !(isIdea && activeSection === 'submit-case') && React.createElement(AsideResults, null),
43
43
  canShowFileRecommendationSectionsWidget && React.createElement(InsightsResults, { isDisplayOnMain: true }),
44
44
  React.createElement(ClusterRecommendations, { showClusterRecommendationsList: canShowClusterIdReportWidget }),
45
45
  canUseSessionManagement && !isCreatingCase && React.createElement(SessionRestore, { routeProps: props.routeProps }),
@@ -25,6 +25,5 @@ export declare const showSideBarEARuleWidgetSections: AppRouteSections[];
25
25
  export declare const showSideBarClusterIdRuleWidgetSections: AppRouteSections[];
26
26
  export declare const showSideBarFileRecommendationSections: AppRouteSections[];
27
27
  export declare const hideSideBarClusterIdRuleToast: AppRouteSections[];
28
- export declare const showSideBarCriticalSolutionsToast: AppRouteSections[];
29
28
  export declare const hiddengetSupportSections: AppRouteSections[];
30
29
  //# sourceMappingURL=RouteConstNTypes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RouteConstNTypes.d.ts","sourceRoot":"","sources":["../../../src/reducers/RouteConstNTypes.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IAIrB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AACD,MAAM,WAAW,eAAe;CAAG;AACnC,oBAAY,gBAAgB;IACxB,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;IAC/B,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,WAAW,gBAAgB;CAC9B;AAED,eAAO,MAAM,0BAA0B,oBAAiC,CAAC;AACzE,eAAO,MAAM,mCAAmC,oBAI/C,CAAC;AACF,eAAO,MAAM,kCAAkC,oBAO9C,CAAC;AAEF,eAAO,MAAM,+BAA+B,oBAM3C,CAAC;AAEF,eAAO,MAAM,sCAAsC,oBAIlD,CAAC;AAEF,eAAO,MAAM,qCAAqC,oBAAgE,CAAC;AAEnH,eAAO,MAAM,6BAA6B,oBAA0D,CAAC;AACrG,eAAO,MAAM,iCAAiC,oBAA+B,CAAC;AAE9E,eAAO,MAAM,wBAAwB,EAAE,gBAAgB,EAKtD,CAAC"}
1
+ {"version":3,"file":"RouteConstNTypes.d.ts","sourceRoot":"","sources":["../../../src/reducers/RouteConstNTypes.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IAIrB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AACD,MAAM,WAAW,eAAe;CAAG;AACnC,oBAAY,gBAAgB;IACxB,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;IAC/B,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,WAAW,gBAAgB;CAC9B;AAED,eAAO,MAAM,0BAA0B,oBAAiC,CAAC;AACzE,eAAO,MAAM,mCAAmC,oBAI/C,CAAC;AACF,eAAO,MAAM,kCAAkC,oBAO9C,CAAC;AAEF,eAAO,MAAM,+BAA+B,oBAM3C,CAAC;AAEF,eAAO,MAAM,sCAAsC,oBAIlD,CAAC;AAEF,eAAO,MAAM,qCAAqC,oBAAgE,CAAC;AAEnH,eAAO,MAAM,6BAA6B,oBAA0D,CAAC;AAErG,eAAO,MAAM,wBAAwB,EAAE,gBAAgB,EAKtD,CAAC"}
@@ -37,7 +37,6 @@ export const showSideBarClusterIdRuleWidgetSections = [
37
37
  ];
38
38
  export const showSideBarFileRecommendationSections = [AppRouteSections.DESCRIBE_MORE, AppRouteSections.MANAGEMENT];
39
39
  export const hideSideBarClusterIdRuleToast = [AppRouteSections.REVIEW, AppRouteSections.SUBMIT_CASE];
40
- export const showSideBarCriticalSolutionsToast = [AppRouteSections.SUMMARIZE];
41
40
  export const hiddengetSupportSections = [
42
41
  AppRouteSections.TROUBLESHOOT,
43
42
  AppRouteSections.DESCRIBE_MORE,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -145,5 +145,5 @@
145
145
  "not ie <= 11",
146
146
  "not op_mini all"
147
147
  ],
148
- "gitHead": "066cf51511a22de63960f75d0d8d05060117d6e6"
148
+ "gitHead": "e1515d822febb9822e84bfb533fd9bc1355b9751"
149
149
  }