@rh-support/troubleshoot 1.1.6 → 1.1.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":"ClusterRecommendationToast.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/ClusterRecommendationToast.tsx"],"names":[],"mappings":"AAGA,OAAc,EAAE,EAAE,EAAmC,MAAM,OAAO,CAAC;AAUnE,UAAU,MAAM;CAAG;AAEnB,QAAA,MAAM,0BAA0B,EAAE,EAAE,CAAC,MAAM,CAoD1C,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
1
+ {"version":3,"file":"ClusterRecommendationToast.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/ClusterRecommendationToast.tsx"],"names":[],"mappings":"AAGA,OAAc,EAAE,EAAE,EAAmC,MAAM,OAAO,CAAC;AAMnE,UAAU,MAAM;CAAG;AAEnB,QAAA,MAAM,0BAA0B,EAAE,EAAE,CAAC,MAAM,CAgD1C,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
@@ -1,26 +1,20 @@
1
- import { Alert, AlertActionCloseButton, Button } from '@patternfly/react-core';
1
+ import { Alert, AlertActionCloseButton } from '@patternfly/react-core';
2
2
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
3
3
  import { isEmpty, isEqual } from 'lodash';
4
4
  import React, { useContext, useEffect, useState } from 'react';
5
5
  import { Trans } from 'react-i18next';
6
6
  import { useCaseSelector } from '../../context/CaseContext';
7
- import { ClusterRecommendationsContext, ClusterRecommendationsDispatchContext, } from '../../context/ClusterRecommendationsContext';
8
- import { toggleClusterRecommendationModal } from '../../reducers/ClusterRecommendationsReducer';
7
+ import { ClusterRecommendationsContext } from '../../context/ClusterRecommendationsContext';
9
8
  import { getIsClusterIdInvalid, isClusterIdEnabledForProduct } from '../../utils/caseOpenshiftClusterIdUtils';
10
9
  const ClusterRecommendationToast = () => {
11
10
  var _a;
12
- const { clusterRecommendationsState: { clusterRecommendations, isClusterRecommendationsModalOpen }, } = useContext(ClusterRecommendationsContext);
13
- const clusterRecommendationsDispatch = useContext(ClusterRecommendationsDispatchContext);
11
+ const { clusterRecommendationsState: { clusterRecommendations }, } = useContext(ClusterRecommendationsContext);
14
12
  const [isToastVisible, setToastVisibility] = useState(false);
15
13
  const { openshiftClusterID, product } = useCaseSelector((state) => ({
16
14
  openshiftClusterID: state.caseDetails.openshiftClusterID,
17
15
  product: state.caseDetails.product,
18
16
  }), isEqual);
19
17
  const { globalMetadataState: { allProducts }, } = useContext(GlobalMetadataStateContext);
20
- const onViewRecommendations = () => {
21
- setToastVisibility(false);
22
- toggleClusterRecommendationModal(clusterRecommendationsDispatch, !isClusterRecommendationsModalOpen);
23
- };
24
18
  // To open popover we check for cluster id and clusterRecommendations array length
25
19
  useEffect(() => {
26
20
  if (!isEmpty(openshiftClusterID) && clusterRecommendations.data.length)
@@ -37,7 +31,7 @@ const ClusterRecommendationToast = () => {
37
31
  const hasCluster = isClusterIdEnabledForProduct(product, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult);
38
32
  if (!isToastVisible || !hasCluster)
39
33
  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) }) }));
34
+ return (React.createElement(Alert, { isLiveRegion: true, variant: "success", title: React.createElement(Trans, null, "Cluster recommendations are ready to view"), "data-tracking-id": "toast-view-cluster-sol", children: React.createElement("p", null,
35
+ React.createElement(Trans, null, "Troubleshooting specific for your selected cluster.")), actionClose: React.createElement(AlertActionCloseButton, { variantLabel: "success alert", onClose: () => setToastVisibility(false) }) }));
42
36
  };
43
37
  export default ClusterRecommendationToast;
@@ -31,11 +31,11 @@ function WidgetFileSelectorImage({ id = '', className = '', isSessionId, isPriva
31
31
  React.createElement(Trans, null, "Files must be less than 5 MB."))),
32
32
  ' ',
33
33
  React.createElement("p", { className: "pf-u-danger-color-200" }, rejectedFiles.map((rejectedFile) => {
34
- const isImage = /image\/*/.test(rejectedFile.type);
34
+ const isImage = /image\/(png|gif|jpe?g)/.test(rejectedFile.type);
35
35
  return !isImage ? (React.createElement("div", null,
36
36
  rejectedFile.name,
37
37
  " ",
38
- React.createElement(Trans, null, "is not an image"))) : rejectedFile.size > MAX_SIZE ? (React.createElement("div", null,
38
+ React.createElement(Trans, null, "is not an allowed file type or an image "))) : rejectedFile.size > MAX_SIZE ? (React.createElement("div", null,
39
39
  rejectedFile.name,
40
40
  " ",
41
41
  React.createElement(Trans, null, "exceeded max size limit of"),
@@ -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;AAErG,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,oBAAyD,CAAC;AAE7G,eAAO,MAAM,qCAAqC,oBAAgE,CAAC;AAEnH,eAAO,MAAM,6BAA6B,oBAAiC,CAAC;AAE5E,eAAO,MAAM,wBAAwB,EAAE,gBAAgB,EAKtD,CAAC"}
@@ -30,13 +30,9 @@ export const showSideBarEARuleWidgetSections = [
30
30
  AppRouteSections.MANAGEMENT,
31
31
  AppRouteSections.GET_SUPPORT,
32
32
  ];
33
- export const showSideBarClusterIdRuleWidgetSections = [
34
- AppRouteSections.MANAGEMENT,
35
- AppRouteSections.REVIEW,
36
- AppRouteSections.SUBMIT_CASE,
37
- ];
33
+ export const showSideBarClusterIdRuleWidgetSections = [AppRouteSections.MANAGEMENT, AppRouteSections.REVIEW];
38
34
  export const showSideBarFileRecommendationSections = [AppRouteSections.DESCRIBE_MORE, AppRouteSections.MANAGEMENT];
39
- export const hideSideBarClusterIdRuleToast = [AppRouteSections.REVIEW, AppRouteSections.SUBMIT_CASE];
35
+ export const hideSideBarClusterIdRuleToast = [AppRouteSections.SUBMIT_CASE];
40
36
  export const hiddengetSupportSections = [
41
37
  AppRouteSections.TROUBLESHOOT,
42
38
  AppRouteSections.DESCRIBE_MORE,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -74,7 +74,7 @@
74
74
  "@progress/kendo-drawing": "^1.6.0",
75
75
  "@progress/kendo-react-pdf": "^3.12.0",
76
76
  "@rh-support/components": "1.3.1",
77
- "@rh-support/react-context": "1.1.2",
77
+ "@rh-support/react-context": "1.1.3",
78
78
  "@rh-support/types": "0.2.1-beta.58",
79
79
  "@rh-support/user-permissions": "1.1.0",
80
80
  "@rh-support/utils": "1.0.10-beta.58",
@@ -145,5 +145,5 @@
145
145
  "not ie <= 11",
146
146
  "not op_mini all"
147
147
  ],
148
- "gitHead": "8c85bdb8941ddb7070c5356a3c89c1c676c147fb"
148
+ "gitHead": "f0ba37c79bcb3c80d8da82267ceadd5691b5a809"
149
149
  }