@rh-support/troubleshoot 1.1.5 → 1.1.7

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,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"}
1
+ {"version":3,"file":"AlertToastWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/AlertToastWrapper.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAc,EAAE,EAAE,EAAmC,MAAM,OAAO,CAAC;AAUnE,UAAU,MAAM;IACZ,qBAAqB,EAAE,CAAC,cAAc,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5D;AAED,QAAA,MAAM,iBAAiB,EAAE,EAAE,CAAC,MAAM,CA8BjC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -2,16 +2,24 @@
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, useState } from 'react';
5
+ import React, { useContext, useEffect, useState } from 'react';
6
+ import { isUploadedAndAnalyzed } from '../../components/shared/fileUpload/reducer/AttachmentHelper';
6
7
  import { RouteContext } from '../../context/RouteContext';
7
8
  import { hideSideBarClusterIdRuleToast } from '../../reducers/RouteConstNTypes';
9
+ import { AttachmentStateContext } from '../shared/fileUpload';
8
10
  import { ResubmitToast } from '../SubmitCase/ResubmitToast';
9
11
  import ClusterRecommendationToast from './ClusterRecommendationToast';
10
12
  import CriticalSolutionsToast from './CriticalSolutionsToast';
11
13
  const AlertToastWrapper = ({ submitCaseAndNavigate }) => {
12
14
  const { routeState: { activeSection }, } = useContext(RouteContext);
13
- const hideClusterIdReportModal = hideSideBarClusterIdRuleToast.includes(activeSection);
14
15
  const [isCriticalSolutionsVisible, setIsCriticalSolutionsVisible] = useState(true);
16
+ const { attachmentState } = useContext(AttachmentStateContext);
17
+ useEffect(() => {
18
+ const isEveryFileFinished = attachmentState.caseFiles.selectedLocalFiles.every((file) => isUploadedAndAnalyzed(file));
19
+ isEveryFileFinished && setIsCriticalSolutionsVisible(true);
20
+ // eslint-disable-next-line react-hooks/exhaustive-deps
21
+ }, [attachmentState.caseFiles.selectedLocalFiles]);
22
+ const hideClusterIdReportModal = hideSideBarClusterIdRuleToast.includes(activeSection);
15
23
  const userClosed = () => {
16
24
  setIsCriticalSolutionsVisible(false);
17
25
  };
@@ -37,7 +37,7 @@ const ClusterRecommendationToast = () => {
37
37
  const hasCluster = isClusterIdEnabledForProduct(product, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult);
38
38
  if (!isToastVisible || !hasCluster)
39
39
  return null;
40
- return (React.createElement(Alert, { isLiveRegion: true, variant: "success", title: React.createElement(Trans, null, "Cluster recommendation has been triggered"), "data-tracking-id": "toast-view-cluster-sol", actionLinks: React.createElement(Button, { isInline: true, variant: "link", onClick: onViewRecommendations },
41
- React.createElement(Trans, null, "View recommendations")), actionClose: React.createElement(AlertActionCloseButton, { variantLabel: "success alert", onClose: () => setToastVisibility(false) }) }));
40
+ return (React.createElement(Alert, { isLiveRegion: true, variant: "success", title: React.createElement(Trans, null, "File recommendations are ready to view."), "data-tracking-id": "toast-view-cluster-sol", actionLinks: React.createElement(Button, { isInline: true, variant: "link", onClick: onViewRecommendations },
41
+ React.createElement(Trans, null, "Troubleshooting specefic for your uploaded files")), actionClose: React.createElement(AlertActionCloseButton, { variantLabel: "success alert", onClose: () => setToastVisibility(false) }) }));
42
42
  };
43
43
  export default ClusterRecommendationToast;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
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": "7fcba84fa328794d586b747de2800e470c9c263b"
148
+ "gitHead": "2c503a6a85dc3fa5ff92a5a992cf6d262b4b33ff"
149
149
  }