@rh-support/troubleshoot 0.2.82 → 0.2.83

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":"ClusterRecommendationsModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/ClusterRecommendationsModal.tsx"],"names":[],"mappings":"AAgBA,UAAU,MAAM;CAAG;AAEnB,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,eA8ExD"}
1
+ {"version":3,"file":"ClusterRecommendationsModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/ClusterRecommendationsModal.tsx"],"names":[],"mappings":"AAiBA,UAAU,MAAM;CAAG;AAEnB,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,eAwFxD"}
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import { pcm } from '@cee-eng/hydrajs';
11
11
  import { Button, Modal } from '@patternfly/react-core';
12
12
  import { useFetch } from '@rh-support/components';
13
+ import { GlobalMetadataStateContext } from '@rh-support/react-context';
13
14
  import { getResTypeFromUrl } from '@rh-support/utils';
14
15
  import React, { useContext, useState } from 'react';
15
16
  import { useTranslation } from 'react-i18next';
@@ -24,6 +25,8 @@ export function ClusterRecommendationsModal(props) {
24
25
  const { request: resolveSessionRequest, isFetching } = useFetch(pcm.preCase.session.resolveSession);
25
26
  const { SessionResourceSource } = pcm.preCase.session;
26
27
  const [isModalVisible, setIsModalVisible] = useState(false);
28
+ const { globalMetadataState: { loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
29
+ const isSecureSupportAccount = loggedInUsersAccount.data.secureSupport;
27
30
  const { clusterRecommendationsState: { clusterRecommendations, isClusterRecommendationsModalOpen }, } = useContext(ClusterRecommendationsContext);
28
31
  const clusterRecommendationsDispatch = useContext(ClusterRecommendationsDispatchContext);
29
32
  const handleSolvedIssue = () => __awaiter(this, void 0, void 0, function* () {
@@ -51,7 +54,12 @@ export function ClusterRecommendationsModal(props) {
51
54
  return (React.createElement(React.Fragment, null,
52
55
  React.createElement(RecommendationFeedbackModal, { isModalOpen: isModalVisible, handleModalToggle: onModalToggle, modalContent: t(`Great, we're glad that resolved your issue`) }),
53
56
  React.createElement(Modal, { className: "critical-solutions-modal", title: t('Cluster recommendations'), description: t('Recommendations have been triggered for your cluster.'), "data-tracking-id": "cluster-recommendations-modal-body", onClose: onModalClose, isOpen: isClusterRecommendationsModalOpen, actions: [
54
- React.createElement(Button, { isDisabled: isFetching, isLoading: isFetching, onClick: handleSolvedIssue, key: "solved-my-issue", variant: "primary", "data-tracking-id": "cluster-recommendations-solutions-modal" }, t('I solved my issue')),
57
+ // for secure support users, we don't have session api, so we need to hide this button
58
+ ...(!isSecureSupportAccount
59
+ ? [
60
+ React.createElement(Button, { isDisabled: isFetching, isLoading: isFetching, onClick: handleSolvedIssue, key: "solved-my-issue", variant: "primary", "data-tracking-id": "cluster-recommendations-solutions-modal" }, t('I solved my issue')),
61
+ ]
62
+ : []),
55
63
  React.createElement(Button, { onClick: onModalClose, key: "confirm", variant: "secondary", "data-tracking-id": "cancel-cluster-recommendations-modal" }, t('Cancel')),
56
64
  ] },
57
65
  React.createElement(ClusterRecommendationItems, { clusterRecommendations: clusterRecommendations.data }))));
@@ -1 +1 @@
1
- {"version":3,"file":"EARuleInfoInline.d.ts","sourceRoot":"","sources":["../../../../../src/components/Recommendations/EARules/EARuleInfoInline.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAAkD,MAAM,gCAAgC,CAAC;AAM/G,UAAU,MAAM;IACZ,OAAO,EAAE,aAAa,EAAE,CAAC;CAC5B;AACD,wBAAgB,gBAAgB,CAAC,EAAE,OAAY,EAAE,EAAE,MAAM,eAyHxD"}
1
+ {"version":3,"file":"EARuleInfoInline.d.ts","sourceRoot":"","sources":["../../../../../src/components/Recommendations/EARules/EARuleInfoInline.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,aAAa,EAAkD,MAAM,gCAAgC,CAAC;AAM/G,UAAU,MAAM;IACZ,OAAO,EAAE,aAAa,EAAE,CAAC;CAC5B;AACD,wBAAgB,gBAAgB,CAAC,EAAE,OAAY,EAAE,EAAE,MAAM,eAiIxD"}
@@ -13,6 +13,7 @@ import CheckCircleIcon from '@patternfly/react-icons/dist/js/icons/check-circle-
13
13
  import CloseIcon from '@patternfly/react-icons/dist/js/icons/close-icon';
14
14
  import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
15
15
  import { PaginationCompact, useFetch } from '@rh-support/components';
16
+ import { GlobalMetadataStateContext } from '@rh-support/react-context';
16
17
  import { getResTypeFromUrl, getStyleVariantColor, StyleVariants } from '@rh-support/utils';
17
18
  import some from 'lodash/some';
18
19
  import React, { useContext, useEffect, useState } from 'react';
@@ -30,6 +31,8 @@ export function EARuleInfoInline({ eaRules = [] }) {
30
31
  const { request: resolveSessionRequest, isFetching } = useFetch(pcm.preCase.session.resolveSession);
31
32
  const { sessionRestore: { activeSessionId, sessionResourceTracking }, } = useContext(SessionRestoreStateContext);
32
33
  const [isModalVisible, setIsModalVisible] = useState(false);
34
+ const { globalMetadataState: { loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
35
+ const isSecureSupportAccount = loggedInUsersAccount.data.secureSupport;
33
36
  const validEARulesLength = eaRules.length;
34
37
  const isAnyRuleResolved = some(eaRules, (item) => item.resolved);
35
38
  // if user ignores a rule on last page, we need to handle the scenario
@@ -65,6 +68,14 @@ export function EARuleInfoInline({ eaRules = [] }) {
65
68
  const onModalToggle = () => {
66
69
  setIsModalVisible((visible) => !visible);
67
70
  };
71
+ // for secure support users, we don't have session api, so we need to hide this section
72
+ const resolvedMyIssue = () => visibleRule.resolved ? (React.createElement("span", { style: {
73
+ color: getStyleVariantColor(StyleVariants.SUCCESS),
74
+ lineHeight: 2.4,
75
+ } },
76
+ React.createElement(CheckCircleIcon, null),
77
+ " ",
78
+ React.createElement(Trans, null, "Resolved"))) : isAnyRuleResolved ? null : (React.createElement(Button, { isDisabled: isFetching, isLoading: isFetching, className: "se-recommended ts-known-vuln", variant: ButtonVariant.link, isInline: true, "data-tracking-id": "se-recommended-asa-resolve", type: "button", onClick: onResolveClick }, isFetching ? null : React.createElement(Trans, null, "This resolved my issue")));
68
79
  if (validEARulesLength < 1)
69
80
  return null;
70
81
  const visibleRule = eaRules[currentPage > validEARulesLength ? validEARulesLength - 1 : currentPage - 1];
@@ -83,12 +94,6 @@ export function EARuleInfoInline({ eaRules = [] }) {
83
94
  React.createElement(EARuleDescription, null)),
84
95
  React.createElement("div", { className: "pf-c-alert__action-group pf-u-display-flex" },
85
96
  React.createElement(EARuleArticle, { className: "pf-u-align-self-center pf-u-mr-sm", linkTitle: "View details" }),
86
- visibleRule.resolved ? (React.createElement("span", { style: {
87
- color: getStyleVariantColor(StyleVariants.SUCCESS),
88
- lineHeight: 2.4,
89
- } },
90
- React.createElement(CheckCircleIcon, null),
91
- " ",
92
- React.createElement(Trans, null, "Resolved"))) : isAnyRuleResolved ? null : (React.createElement(Button, { isDisabled: isFetching, isLoading: isFetching, className: "se-recommended ts-known-vuln", variant: ButtonVariant.link, isInline: true, "data-tracking-id": "se-recommended-asa-resolve", type: "button", onClick: onResolveClick }, isFetching ? null : React.createElement(Trans, null, "This resolved my issue"))),
97
+ !isSecureSupportAccount && resolvedMyIssue(),
93
98
  validEARulesLength > 1 && (React.createElement(PaginationCompact, { maxPage: validEARulesLength, onPageChange: onPaginationChange, dataTrackingId: 'se-recommended-asa-widget' })))))));
94
99
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RulesModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/RulesModal.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAG5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAG7D,UAAU,MAAM;IACZ,cAAc,EAAE,wBAAwB,EAAE,CAAC;IAC3C,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,GAAG,CAAC;CAC5B;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,eAgI/C"}
1
+ {"version":3,"file":"RulesModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/RulesModal.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAG5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAG7D,UAAU,MAAM;IACZ,cAAc,EAAE,wBAAwB,EAAE,CAAC;IAC3C,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,GAAG,CAAC;CAC5B;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,eAmI/C"}
@@ -81,6 +81,9 @@ export function InsightResultModal(props) {
81
81
  return (React.createElement(React.Fragment, null,
82
82
  React.createElement(RecommendationFeedbackModal, { isModalOpen: isModalVisible, handleModalToggle: onModalToggle, modalContent: t(`Great, we're glad that resolved your issue`) }),
83
83
  React.createElement(Modal, { className: "critical-solutions-modal", title: t('Critical solutions for your system'), description: t('Solutions have been triggered for you based on file upload or common issues that currently have high visibility.'), "data-tracking-id": "critical-solutions-modal-body", onClose: props.onModalToggle, isOpen: props.isOpen, actions: [
84
+ // at this moment, for secure support users, we don't show insight rules
85
+ // in future if we show the rules, we need to hide this button because
86
+ // we don't have session api for secure support users
84
87
  React.createElement(Button, { isDisabled: isFetching, isLoading: isFetching, onClick: handleSolvedIssue, key: "solved-my-issue", variant: "primary", "data-tracking-id": "solved-my-issue-critical-solutions-modal" }, t('I solved my issue')),
85
88
  React.createElement(Button, { onClick: props.onModalToggle, key: "confirm", variant: "secondary", "data-tracking-id": "cancel-critical-solutions-modal" }, t('Cancel')),
86
89
  ] },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "0.2.82",
3
+ "version": "0.2.83",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -26,7 +26,7 @@
26
26
  "lib/**/*"
27
27
  ],
28
28
  "peerDependencies": {
29
- "@cee-eng/hydrajs": "4.7.20",
29
+ "@cee-eng/hydrajs": "4.7.22",
30
30
  "@cee-eng/ui-toolkit": "1.1.6",
31
31
  "@patternfly/patternfly": "4.176.2",
32
32
  "@patternfly/pfe-accordion": "1.12.3",
@@ -63,7 +63,7 @@
63
63
  "react-virtualized": "^9.21.2"
64
64
  },
65
65
  "dependencies": {
66
- "@cee-eng/hydrajs": "4.7.20",
66
+ "@cee-eng/hydrajs": "4.7.22",
67
67
  "@cee-eng/ui-toolkit": "1.1.6",
68
68
  "@patternfly/patternfly": "4.176.2",
69
69
  "@patternfly/pfe-accordion": "1.12.3",
@@ -73,12 +73,12 @@
73
73
  "@patternfly/react-core": "4.194.0",
74
74
  "@progress/kendo-drawing": "^1.6.0",
75
75
  "@progress/kendo-react-pdf": "^3.12.0",
76
- "@rh-support/api": "0.3.10",
77
- "@rh-support/components": "1.1.51",
78
- "@rh-support/react-context": "0.2.51",
76
+ "@rh-support/api": "0.3.13",
77
+ "@rh-support/components": "1.1.52",
78
+ "@rh-support/react-context": "0.2.52",
79
79
  "@rh-support/types": "0.2.0",
80
- "@rh-support/user-permissions": "0.2.41",
81
- "@rh-support/utils": "0.2.31",
80
+ "@rh-support/user-permissions": "0.2.42",
81
+ "@rh-support/utils": "0.2.32",
82
82
  "@types/react-redux": "^7.1.12",
83
83
  "@types/redux": "^3.6.0",
84
84
  "@webcomponents/webcomponentsjs": "^2.2.10",
@@ -143,5 +143,5 @@
143
143
  "not ie <= 11",
144
144
  "not op_mini all"
145
145
  ],
146
- "gitHead": "ded962055f61a00447aa7aff04d8ec7425429d0d"
146
+ "gitHead": "3d97efe5cebb4e398f73d61326cad31e087aa63f"
147
147
  }