@rh-support/troubleshoot 0.2.47 → 0.2.49

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":"CaseComments.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AA6BvE,OAAO,KAA+B,MAAM,OAAO,CAAC;AAOpD,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAClF,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,kBAAkB,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAChH;AAED,QAAA,MAAM,YAAY,4EA8ShB,CAAC;AAEH,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"CaseComments.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseComments.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AA6BvE,OAAO,KAA+B,MAAM,OAAO,CAAC;AAOpD,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACzD,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAClF,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,kBAAkB,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAChH;AAED,QAAA,MAAM,YAAY,4EAiThB,CAAC;AAEH,eAAe,YAAY,CAAC"}
@@ -147,8 +147,9 @@ const CaseComments = React.forwardRef((props, ref) => {
147
147
  const parseCommentHtml = (commentText, contentType) => {
148
148
  let text = commentText;
149
149
  if (contentType === EditorMode.PLAIN) {
150
+ text = HTMLEntityChecker(commentText);
150
151
  // fix issue something like this <h1>ajhdjaj<d</h1>
151
- text = htmlEntitiesEncode(commentText);
152
+ text = htmlEntitiesEncode(text);
152
153
  text = encodeAngularBrackets(text);
153
154
  text = linkifyLinks(text);
154
155
  text = linkifyWithCaseIDs(text);
@@ -160,6 +161,7 @@ const CaseComments = React.forwardRef((props, ref) => {
160
161
  /* Purpose of this method is to break the default HTML Entity rendering on the UI when in plaintext mode.
161
162
  This is achieved by directly swapping the '&' in any html entity to `&amp` in e.g. &euro swaps to &ampeuro
162
163
  so it is rendered -> &euro on the UI instead of '€' */
164
+ //PCM-10968
163
165
  const HTMLEntityChecker = (comment) => {
164
166
  if (comment.includes('&')) {
165
167
  return comment.replace(/&/g, '&amp;');
@@ -170,13 +172,13 @@ const CaseComments = React.forwardRef((props, ref) => {
170
172
  const computeCommentText = (comment) => {
171
173
  const parseComment = parseCommentHtml(comment.commentBody, comment.contentType);
172
174
  if (!isEmpty(comment.commentBody) && comment.contentType === EditorMode.MARKDOWN) {
173
- return (React.createElement("div", { className: "push-top-narrow comment-markdown-text", dangerouslySetInnerHTML: commentMarkdown(parseComment) }));
175
+ return (React.createElement("div", { className: "push-top-narrow comment-markdown-text", dangerouslySetInnerHTML: commentMarkdown(comment.commentBody) }));
174
176
  }
175
177
  else if (!isEmpty(comment.commentBody) && comment.contentType === EditorMode.PLAIN) {
176
- return (React.createElement("pre", { className: "push-top-narrow comment-plaintext reset-pre-text", dangerouslySetInnerHTML: commentText(HTMLEntityChecker(parseComment)) }));
178
+ return (React.createElement("pre", { className: "push-top-narrow comment-plaintext reset-pre-text", dangerouslySetInnerHTML: commentText(parseComment) }));
177
179
  }
178
180
  else {
179
- return (React.createElement("pre", { className: "push-top-narrow comment-plaintext reset-pre-text", dangerouslySetInnerHTML: commentText(HTMLEntityChecker(comment.commentBody)) }));
181
+ return (React.createElement("pre", { className: "push-top-narrow comment-plaintext reset-pre-text", dangerouslySetInnerHTML: commentText(parseComment) }));
180
182
  }
181
183
  };
182
184
  if (!((_a = props.comment) === null || _a === void 0 ? void 0 : _a.isPublic) && !canSeePrivateComments)
@@ -1 +1 @@
1
- {"version":3,"file":"ClusterRecommendationToast.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/ClusterRecommendationToast.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,EAAE,EAAmC,MAAM,OAAO,CAAC;AAUnE,UAAU,MAAM;CAAG;AAEnB,QAAA,MAAM,0BAA0B,EAAE,EAAE,CAAC,MAAM,CA+C1C,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
1
+ {"version":3,"file":"ClusterRecommendationToast.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/ClusterRecommendationToast.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,EAAE,EAAmC,MAAM,OAAO,CAAC;AAUnE,UAAU,MAAM;CAAG;AAEnB,QAAA,MAAM,0BAA0B,EAAE,EAAE,CAAC,MAAM,CAmD1C,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
@@ -30,6 +30,10 @@ const ClusterRecommendationToast = () => {
30
30
  setToastVisibility(true);
31
31
  // eslint-disable-next-line react-hooks/exhaustive-deps
32
32
  }, [clusterRecommendations.data]);
33
+ useEffect(() => {
34
+ if (!openshiftClusterID)
35
+ setToastVisibility(false);
36
+ }, [openshiftClusterID]);
33
37
  const hasCluster = isClusterIdEnabledForProduct(product, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult);
34
38
  if (!isToastVisible || !hasCluster)
35
39
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"ClusterRecommendations.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/ClusterRecommendations.tsx"],"names":[],"mappings":"AAYA,MAAM,CAAC,OAAO,UAAU,qBAAqB,gBAmC5C"}
1
+ {"version":3,"file":"ClusterRecommendations.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/ClusterRecommendations.tsx"],"names":[],"mappings":"AAgBA,MAAM,CAAC,OAAO,UAAU,qBAAqB,gBAmD5C"}
@@ -1,18 +1,33 @@
1
1
  import { Button } from '@patternfly/react-core';
2
+ import { GlobalMetadataStateContext } from '@rh-support/react-context';
3
+ import { isEqual } from 'lodash';
2
4
  import React, { useContext } from 'react';
3
5
  import { Trans } from 'react-i18next';
6
+ import { useCaseSelector } from '../../context/CaseContext';
4
7
  import { ClusterRecommendationsContext, ClusterRecommendationsDispatchContext, } from '../../context/ClusterRecommendationsContext';
5
8
  import { toggleClusterRecommendationModal } from '../../reducers/ClusterRecommendationsReducer';
9
+ import { isClusterIdEnabledForProduct } from '../../utils/caseOpenshiftClusterIdUtils';
6
10
  import { ClusterRecommendationItems } from './ClusterRecommendationItems';
7
11
  import { ClusterRecommendationsModal } from './ClusterRecommendationsModal';
8
12
  export default function ClusteRecommendations() {
13
+ var _a;
9
14
  const { clusterRecommendationsState: { clusterRecommendations, isClusterRecommendationsModalOpen }, } = useContext(ClusterRecommendationsContext);
10
15
  const clusterRecommendationsDispatch = useContext(ClusterRecommendationsDispatchContext);
16
+ const { openshiftClusterID, product } = useCaseSelector((state) => ({
17
+ openshiftClusterID: state.caseDetails.openshiftClusterID,
18
+ product: state.caseDetails.product,
19
+ }), isEqual);
20
+ const { globalMetadataState: { allProducts }, } = useContext(GlobalMetadataStateContext);
11
21
  const NUMBER_OF_RULES_TO_DISPLAY = 3;
12
22
  const onViewMoreRecommendation = () => {
13
23
  toggleClusterRecommendationModal(clusterRecommendationsDispatch, !isClusterRecommendationsModalOpen);
14
24
  };
15
- if (clusterRecommendations.data.length === 0 || clusterRecommendations.isError || clusterRecommendations.isFetching)
25
+ const hasCluster = isClusterIdEnabledForProduct(product, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult);
26
+ if (clusterRecommendations.data.length === 0 ||
27
+ clusterRecommendations.isError ||
28
+ clusterRecommendations.isFetching ||
29
+ !hasCluster ||
30
+ !openshiftClusterID)
16
31
  return React.createElement(React.Fragment, null);
17
32
  return (React.createElement(React.Fragment, null,
18
33
  React.createElement("div", { className: "card card-white card-support top-recommendations" },
@@ -81,7 +81,7 @@ export function InsightResultModal(props) {
81
81
  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')),
82
82
  React.createElement(Button, { onClick: props.onModalToggle, key: "confirm", variant: "secondary", "data-tracking-id": "cancel-critical-solutions-modal" }, t('Cancel')),
83
83
  ] },
84
- React.createElement(Accordion, { className: "push-top-narrow", headingLevel: "h2", asDefinitionList: false },
84
+ React.createElement(Accordion, { className: "push-top-narrow", headingLevel: "h2", asDefinitionList: false, isBordered: true },
85
85
  props.insightResults.map((doc) => (React.createElement(InsightsRuleInfo, { duplicateKeys: duplicateKeys, showNewTag: canShowNewTag, key: doc.id + doc.attachmentId, doc: doc }))),
86
86
  props.EARule.length > 0 &&
87
87
  props.EARule.map((rule, index) => (React.createElement(EARuleInfoAccordion, { showNewTag: canShowNewTag, key: `${index}_eaRule`, rule: rule })))))));
@@ -1 +1 @@
1
- {"version":3,"file":"GlobalTroubleshootEffects.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/GlobalTroubleshootEffects.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAWvD,OAAO,EAAqB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAOrF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,eAgXtD"}
1
+ {"version":3,"file":"GlobalTroubleshootEffects.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/GlobalTroubleshootEffects.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAWvD,OAAO,EAAqB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAOrF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,eAkXtD"}
@@ -293,8 +293,10 @@ export function GlobalTroubleshootEffects(props) {
293
293
  const oldMajorVersion = previousVersion && getVersion(previousVersion).major;
294
294
  const newMajorVersion = getVersion(version).major;
295
295
  const hasCluster = isClusterIdEnabledForProduct(product, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult);
296
- const isDifferentMajorClusterVersion = hasCluster && oldMajorVersion !== newMajorVersion;
297
- if (isDifferentMajorClusterVersion) {
296
+ // Need to check `hasCluster` is empty as when product is changing from shift product to non-shift
297
+ // product new product will don't have any cluster
298
+ const isClusterInfoShouldBeReset = !hasCluster || (hasCluster && oldMajorVersion !== newMajorVersion);
299
+ if (isClusterInfoShouldBeReset) {
298
300
  setCaseDetails(caseDispatch, {
299
301
  openshiftClusterID: '',
300
302
  openshiftClusterVersion: '',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "0.2.47",
3
+ "version": "0.2.49",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -26,13 +26,13 @@
26
26
  "lib/**/*"
27
27
  ],
28
28
  "peerDependencies": {
29
- "@cee-eng/hydrajs": "4.7.3",
29
+ "@cee-eng/hydrajs": "4.7.20",
30
30
  "@cee-eng/ui-toolkit": "1.1.6",
31
- "@patternfly/patternfly": "4.102.2",
32
- "@patternfly/pfe-accordion": "1.1.0",
33
- "@patternfly/pfe-collapse": "1.1.0",
34
- "@patternfly/pfe-tabs": "1.1.0",
35
- "@patternfly/react-core": "4.128.2",
31
+ "@patternfly/patternfly": "4.176.2",
32
+ "@patternfly/pfe-accordion": "1.12.3",
33
+ "@patternfly/pfe-collapse": "1.12.3",
34
+ "@patternfly/pfe-tabs": "1.12.3",
35
+ "@patternfly/react-core": "4.194.0",
36
36
  "@rh-support/api": "0.3.9",
37
37
  "@rh-support/components": "^0.1.3",
38
38
  "@rh-support/react-context": "^0.1.3",
@@ -63,21 +63,22 @@
63
63
  "react-virtualized": "^9.21.2"
64
64
  },
65
65
  "dependencies": {
66
- "@cee-eng/hydrajs": "4.7.3",
66
+ "@cee-eng/hydrajs": "4.7.20",
67
67
  "@cee-eng/ui-toolkit": "1.1.6",
68
- "@patternfly/patternfly": "4.102.2",
69
- "@patternfly/pfe-accordion": "1.1.0",
70
- "@patternfly/pfe-collapse": "1.1.0",
71
- "@patternfly/pfe-tabs": "1.1.0",
72
- "@patternfly/react-core": "4.128.2",
68
+ "@patternfly/patternfly": "4.176.2",
69
+ "@patternfly/pfe-accordion": "1.12.3",
70
+ "@patternfly/pfe-collapse": "1.12.3",
71
+ "@patternfly/pfe-icon": "^1.12.3",
72
+ "@patternfly/pfe-tabs": "1.12.3",
73
+ "@patternfly/react-core": "4.194.0",
73
74
  "@progress/kendo-drawing": "^1.6.0",
74
75
  "@progress/kendo-react-pdf": "^3.12.0",
75
- "@rh-support/api": "0.3.9",
76
- "@rh-support/components": "1.1.23",
77
- "@rh-support/react-context": "0.2.26",
76
+ "@rh-support/api": "0.3.10",
77
+ "@rh-support/components": "1.1.24",
78
+ "@rh-support/react-context": "0.2.27",
78
79
  "@rh-support/types": "0.2.0",
79
- "@rh-support/user-permissions": "0.2.17",
80
- "@rh-support/utils": "0.2.15",
80
+ "@rh-support/user-permissions": "0.2.18",
81
+ "@rh-support/utils": "0.2.16",
81
82
  "@types/react-redux": "^7.1.12",
82
83
  "@types/redux": "^3.6.0",
83
84
  "@webcomponents/webcomponentsjs": "^2.2.10",
@@ -142,5 +143,5 @@
142
143
  "not ie <= 11",
143
144
  "not op_mini all"
144
145
  ],
145
- "gitHead": "83f945a320bb7f76cb312a66f064a301485dcee0"
146
+ "gitHead": "b2165709013e4bfb0d0279915ee378bf8defb414"
146
147
  }