@rh-support/troubleshoot 0.2.17 → 0.2.21

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.
Files changed (63) hide show
  1. package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
  2. package/lib/esm/components/CaseEditView/Case.js +1 -1
  3. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.d.ts.map +1 -1
  4. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +1 -1
  5. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
  6. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +0 -1
  7. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.d.ts.map +1 -1
  8. package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +2 -2
  9. package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts.map +1 -1
  10. package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +14 -15
  11. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
  12. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +7 -3
  13. package/lib/esm/components/CaseManagement/SendNotifications/AddCustomEmailToAccountModal.d.ts.map +1 -1
  14. package/lib/esm/components/CaseManagement/SendNotifications/AddCustomEmailToAccountModal.js +4 -2
  15. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  16. package/lib/esm/components/ProductSelector/AllProductsSelector.js +2 -33
  17. package/lib/esm/components/Recommendations/EARules/EARuleInfoInline.d.ts.map +1 -1
  18. package/lib/esm/components/Recommendations/EARules/EARuleInfoInline.js +4 -3
  19. package/lib/esm/components/Recommendations/RecommendationFeedbackModal.d.ts +2 -1
  20. package/lib/esm/components/Recommendations/RecommendationFeedbackModal.d.ts.map +1 -1
  21. package/lib/esm/components/Recommendations/RecommendationFeedbackModal.js +2 -3
  22. package/lib/esm/components/Recommendations/RulesModal.d.ts.map +1 -1
  23. package/lib/esm/components/Recommendations/RulesModal.js +44 -7
  24. package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
  25. package/lib/esm/components/SessionRestore/SessionRestore.js +5 -1
  26. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
  27. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +27 -2
  28. package/lib/esm/hooks/useUserPreference.d.ts +1 -1
  29. package/lib/esm/hooks/useUserPreference.d.ts.map +1 -1
  30. package/lib/esm/hooks/useUserPreference.js +12 -3
  31. package/lib/esm/i18n/template-de.d.ts +6 -2
  32. package/lib/esm/i18n/template-de.d.ts.map +1 -1
  33. package/lib/esm/i18n/template-de.js +10 -2
  34. package/lib/esm/i18n/template-es.d.ts +6 -2
  35. package/lib/esm/i18n/template-es.d.ts.map +1 -1
  36. package/lib/esm/i18n/template-es.js +10 -2
  37. package/lib/esm/i18n/template-fr.d.ts +6 -2
  38. package/lib/esm/i18n/template-fr.d.ts.map +1 -1
  39. package/lib/esm/i18n/template-fr.js +10 -2
  40. package/lib/esm/i18n/template-it.d.ts +6 -2
  41. package/lib/esm/i18n/template-it.d.ts.map +1 -1
  42. package/lib/esm/i18n/template-it.js +10 -2
  43. package/lib/esm/i18n/template-jp.d.ts +6 -2
  44. package/lib/esm/i18n/template-jp.d.ts.map +1 -1
  45. package/lib/esm/i18n/template-jp.js +10 -2
  46. package/lib/esm/i18n/template-ko.d.ts +6 -2
  47. package/lib/esm/i18n/template-ko.d.ts.map +1 -1
  48. package/lib/esm/i18n/template-ko.js +10 -2
  49. package/lib/esm/i18n/template-pt.d.ts +6 -2
  50. package/lib/esm/i18n/template-pt.d.ts.map +1 -1
  51. package/lib/esm/i18n/template-pt.js +10 -2
  52. package/lib/esm/i18n/template-ru.d.ts +6 -2
  53. package/lib/esm/i18n/template-ru.d.ts.map +1 -1
  54. package/lib/esm/i18n/template-ru.js +10 -2
  55. package/lib/esm/i18n/template-zh.d.ts +6 -2
  56. package/lib/esm/i18n/template-zh.d.ts.map +1 -1
  57. package/lib/esm/i18n/template-zh.js +10 -2
  58. package/lib/esm/reducers/CaseConstNTypes.d.ts +3 -1
  59. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  60. package/lib/esm/reducers/CaseConstNTypes.js +3 -1
  61. package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
  62. package/lib/esm/reducers/CaseHelpers.js +7 -4
  63. package/package.json +9 -9
@@ -1 +1 @@
1
- {"version":3,"file":"Case.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/Case.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAS,mBAAmB,EAAiD,MAAM,kBAAkB,CAAC;AAmB7G,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,EAAE,MAAM,eAsLzC"}
1
+ {"version":3,"file":"Case.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/Case.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAS,mBAAmB,EAAiD,MAAM,kBAAkB,CAAC;AAmB7G,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,EAAE,MAAM,eAiLzC"}
@@ -34,7 +34,7 @@ export default function Case(props) {
34
34
  const canSeeExternalTracker = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_EXTERNAL_TRACKER);
35
35
  const canSeeAttachments = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_SEE_ATTACHMENTS);
36
36
  const canSeeRMEs = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_RMES);
37
- const { product, isFetchingCaseDetails, isFetchingCaseDetailsError, caseDetailsError, selectedAccountDetails, } = useCaseSelector((state) => ({
37
+ const { product, isFetchingCaseDetails, isFetchingCaseDetailsError, caseDetailsError, selectedAccountDetails } = useCaseSelector((state) => ({
38
38
  product: state.caseDetails.product,
39
39
  isFetchingCaseDetails: state.isFetchingCaseDetails,
40
40
  isFetchingCaseDetailsError: state.isFetchingCaseDetailsError,
@@ -1 +1 @@
1
- {"version":3,"file":"CaseOpenshiftClusterId.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.tsx"],"names":[],"mappings":"AAgBA,wBAAgB,sBAAsB,gBA8GrC"}
1
+ {"version":3,"file":"CaseOpenshiftClusterId.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.tsx"],"names":[],"mappings":"AAaA,wBAAgB,sBAAsB,gBA8GrC"}
@@ -14,7 +14,7 @@ import React, { useContext, useEffect, useState } from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useCaseDispatch, useCaseSelector } from '../../../../../context/CaseContext';
16
16
  import { updateCaseDetails } from '../../../../../reducers/CaseReducer';
17
- import { getIsClusterIdInvalid, isClusterIdEnabledForProduct, } from '../../../../../utils/caseOpenshiftClusterIdUtils';
17
+ import { getIsClusterIdInvalid, isClusterIdEnabledForProduct } from '../../../../../utils/caseOpenshiftClusterIdUtils';
18
18
  import { CaseOpenshiftDropdownV4, fetchClusterIdDetails } from './CaseOpenshiftDropdownV4';
19
19
  export function CaseOpenshiftClusterId() {
20
20
  const { openshiftClusterID, caseNumber, product } = useCaseSelector((state) => ({
@@ -1 +1 @@
1
- {"version":3,"file":"PostComment.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/PostComment.tsx"],"names":[],"mappings":"AAoCA,OAAO,EAAkB,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAoB5F,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,WAAW,EAAE,CAAC;CACjC;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,eAiaxC"}
1
+ {"version":3,"file":"PostComment.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/PostComment.tsx"],"names":[],"mappings":"AAoCA,OAAO,EAAkB,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAoB5F,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,WAAW,EAAE,CAAC;CACjC;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,eAgaxC"}
@@ -105,7 +105,6 @@ export function PostComment(props) {
105
105
  props.onCommentClear && props.onCommentClear();
106
106
  });
107
107
  const resetAttachmentSection = () => {
108
- resetIsPublic();
109
108
  resetAttachment(dispatchToAttachmentReducer);
110
109
  };
111
110
  const onCancelClick = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"RMEEscalationList.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAqB,MAAM,2CAA2C,CAAC;AAwB/F,UAAU,MAAM;IACZ,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACtB;AAOD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,EAAE,MAAM,eAiMtD"}
1
+ {"version":3,"file":"RMEEscalationList.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAqB,MAAM,2CAA2C,CAAC;AAwB/F,UAAU,MAAM;IACZ,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACtB;AAOD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,EAAE,MAAM,eAgMtD"}
@@ -116,9 +116,9 @@ export default function RMEEscalationList(props) {
116
116
  }
117
117
  else {
118
118
  return (React.createElement(React.Fragment, null,
119
- React.createElement(Button, { className: "pf-u-ml-sm", variant: ButtonVariant.secondary, onClick: () => requestUpdateRMEEscalation(escalation.name), "data-tracking-id": "case-details-rme-req-update" },
119
+ React.createElement(Button, { variant: ButtonVariant.secondary, onClick: () => requestUpdateRMEEscalation(escalation.name), "data-tracking-id": "case-details-rme-req-update" },
120
120
  React.createElement(Trans, null, "Request Update")),
121
- React.createElement(Button, { variant: ButtonVariant.secondary, className: "pf-u-mt-sm pf-u-ml-sm", onClick: () => requestClosureRMEEscalation(escalation.name), "data-tracking-id": "case-details-rme-req-closure" },
121
+ React.createElement(Button, { variant: ButtonVariant.secondary, className: "pf-u-mt-sm", onClick: () => requestClosureRMEEscalation(escalation.name), "data-tracking-id": "case-details-rme-req-closure" },
122
122
  React.createElement(Trans, null, "Request Closure"))));
123
123
  }
124
124
  };
@@ -1 +1 @@
1
- {"version":3,"file":"OpenShiftClusterId.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenShiftClusterId.tsx"],"names":[],"mappings":"AAkBA,eAAO,MAAM,oBAAoB,mBAShC,CAAC;AAqBF,wBAAgB,kBAAkB,gBAuPjC"}
1
+ {"version":3,"file":"OpenShiftClusterId.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenShiftClusterId.tsx"],"names":[],"mappings":"AAkBA,eAAO,MAAM,oBAAoB,mBAShC,CAAC;AAqBF,wBAAgB,kBAAkB,gBAsPjC"}
@@ -63,9 +63,8 @@ export function OpenShiftClusterId() {
63
63
  const [v3Selected, setV3Selected] = useState(false);
64
64
  const [dontKnowSelected, setDontKnowSelected] = useState(false);
65
65
  const [selectedReason, setSelectedReason] = useState('');
66
- const productFromUrl = queryParams === null || queryParams === void 0 ? void 0 : queryParams.product;
67
- const clusterDataReset = () => {
68
- setSelectedReason('');
66
+ const resetClusterData = () => {
67
+ clusterStateReset();
69
68
  setCaseDetails(caseDispatch, {
70
69
  openshiftClusterID: '',
71
70
  noClusterIdReasonExplanation: '',
@@ -73,8 +72,8 @@ export function OpenShiftClusterId() {
73
72
  });
74
73
  setCaseState(caseDispatch, { v3ClusterName: '' });
75
74
  };
76
- const clusterReset = () => {
77
- clusterDataReset();
75
+ const clusterStateReset = () => {
76
+ setSelectedReason('');
78
77
  setDontKnowSelected(false);
79
78
  setV3Selected(false);
80
79
  };
@@ -103,9 +102,6 @@ export function OpenShiftClusterId() {
103
102
  });
104
103
  useEffect(() => {
105
104
  var _a;
106
- if (productFromUrl !== product) {
107
- setSelectedReason('');
108
- }
109
105
  const isClusterVisible = () => __awaiter(this, void 0, void 0, function* () {
110
106
  var _b;
111
107
  const hasCluster = yield isClusterIdEnabledForProduct(product, (_b = allProducts.data) === null || _b === void 0 ? void 0 : _b.productsResult);
@@ -129,6 +125,11 @@ export function OpenShiftClusterId() {
129
125
  }
130
126
  // eslint-disable-next-line react-hooks/exhaustive-deps
131
127
  }, [product, version, pcmConfig, allProducts.data]);
128
+ // On preview page user may change product and version we need to reset internal state
129
+ // context api state will be reset on parent component each time user changes product and version
130
+ useEffect(() => {
131
+ clusterStateReset();
132
+ }, [product, version]);
132
133
  /**
133
134
  * Hook to make sure that if cluster id comes from session or someother source
134
135
  * we also fetch the details for the cluster id so that we can have fields like cluster version while creating the case
@@ -138,21 +139,19 @@ export function OpenShiftClusterId() {
138
139
  setClusterVersion(openshiftClusterID);
139
140
  }
140
141
  // when user click on back and continue button, need to show v3 text box or reasons dropdown
141
- if (v3ClusterName) {
142
+ if (!isEmpty(v3ClusterName)) {
142
143
  setV3Selected(true);
143
144
  setSelectedReason('v3-cluster');
144
145
  }
145
- if (noClusterIdReason) {
146
+ if (!isEmpty(noClusterIdReason)) {
146
147
  setDontKnowSelected(true);
147
148
  setSelectedReason('dont-have-id');
148
149
  }
149
150
  // eslint-disable-next-line react-hooks/exhaustive-deps
150
- }, []);
151
+ }, [v3ClusterName, noClusterIdReason]);
151
152
  const onClusterIdStateUpdate = (selectedCluster) => {
152
153
  const selectedId = selectedCluster.external_id;
153
- setDontKnowSelected(false);
154
- setV3Selected(false);
155
- clusterDataReset();
154
+ resetClusterData();
156
155
  if (selectedId === 'dont-have-id') {
157
156
  setDontKnowSelected(true);
158
157
  setSelectedReason(selectedId);
@@ -194,7 +193,7 @@ export function OpenShiftClusterId() {
194
193
  return null;
195
194
  return (React.createElement(React.Fragment, null,
196
195
  !isOpenShiftV3 && (React.createElement(OpenshiftDropdownV4, { openshiftClusterIDState: openshiftClusterID || selectedReason, onClusterIdStateUpdate: onClusterIdStateUpdate, isClusterIdInvalid: showValidationErrorAlert &&
197
- ((isEmpty(openshiftClusterID) && isEmpty(selectedReason)) || isClusterIdInvalid), clusterIdDropdownFormInstructions: clusterIdDropdownFormInstructions(), onClusterClear: clusterReset, isV4: majorVersion === '4' })),
196
+ ((isEmpty(openshiftClusterID) && isEmpty(selectedReason)) || isClusterIdInvalid), clusterIdDropdownFormInstructions: clusterIdDropdownFormInstructions(), onClusterClear: resetClusterData, isV4: majorVersion === '4' })),
198
197
  dontKnowSelected && !isOpenShiftV3 && (React.createElement(NoClusterIDReasonSelector, { noClusterIdReasonExplanation: noClusterIdReasonExplanation, noClusterIdReason: noClusterIdReason, onReasonInputBoxChanged: onReasonExplanationInputBoxChanged, onReasonChange: onReasonChange, isInValid: isInVaidNoClusterIdReason, isCustomer: isCustomer })),
199
198
  (v3Selected || isOpenShiftV3) && (React.createElement(OpenShiftV3Inputbox, { v3ClusterName: v3ClusterName, onReasonInputBoxChanged: v3ClusterNameInputBoxChanged, isInValid: isEmpty(v3ClusterName) && showValidationErrorAlert, v3Selected: v3Selected }))));
200
199
  }
@@ -1 +1 @@
1
- {"version":3,"file":"OpenshiftDropdownV4.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenshiftDropdownV4.tsx"],"names":[],"mappings":"AACA,OAAO,EAAsB,QAAQ,EAAqB,MAAM,iBAAiB,CAAC;AAElF,OAAO,EAAE,gBAAgB,EAAuB,MAAM,0BAA0B,CAAC;AAUjF,UAAU,MAAO,SAAQ,gBAAgB;IACrC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7E,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iCAAiC,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAChD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC;CACjB;AAaD,QAAA,MAAM,qBAAqB,cAAqB,MAAM,sBASrD,CAAC;AAeF,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,eAwOzC;kBAxOQ,mBAAmB;;;AA2O5B,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,CAAC"}
1
+ {"version":3,"file":"OpenshiftDropdownV4.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenshiftDropdownV4.tsx"],"names":[],"mappings":"AACA,OAAO,EAAsB,QAAQ,EAAqB,MAAM,iBAAiB,CAAC;AAElF,OAAO,EAAE,gBAAgB,EAAuB,MAAM,0BAA0B,CAAC;AAUjF,UAAU,MAAO,SAAQ,gBAAgB;IACrC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7E,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iCAAiC,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAChD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC;CACjB;AAaD,QAAA,MAAM,qBAAqB,cAAqB,MAAM,sBASrD,CAAC;AAeF,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,eA6OzC;kBA7OQ,mBAAmB;;;AAgP5B,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,CAAC"}
@@ -75,8 +75,9 @@ function OpenshiftDropdownV4(props) {
75
75
  const onToggle = (isOpen) => setIsOpen(isOpen);
76
76
  const onViewMoreClick = () => __awaiter(this, void 0, void 0, function* () {
77
77
  const fetchedClusters = yield fetchAccountClusters();
78
- setClustersSelectOptions(getClusterOptions([...clustersRawResponse, ...fetchedClusters.items]));
79
- setClustersRawResponse([...clustersRawResponse, ...fetchedClusters.items]);
78
+ const clusterResponse = [...clustersRawResponse, ...fetchedClusters.items];
79
+ setClustersRawResponse(clusterResponse);
80
+ setClustersSelectOptions(getClusterOptions(clusterResponse));
80
81
  });
81
82
  const onSelect = (event, selectedCluster) => __awaiter(this, void 0, void 0, function* () {
82
83
  setInputVal('');
@@ -115,7 +116,7 @@ function OpenshiftDropdownV4(props) {
115
116
  ];
116
117
  };
117
118
  const fetchAccountClusters = (search = '') => __awaiter(this, void 0, void 0, function* () {
118
- const page = clustersRawResponse.length / PER_PAGE + 1;
119
+ const page = Math.floor(clustersRawResponse.length / PER_PAGE) + 1;
119
120
  try {
120
121
  if (abortControllerRef.current !== undefined) {
121
122
  // Cancel the previous request
@@ -147,6 +148,9 @@ function OpenshiftDropdownV4(props) {
147
148
  return { items: [], totalResult: 0, page: 0 };
148
149
  }
149
150
  });
151
+ // need to get clusters on load
152
+ // added observing props.isV4 because re-render
153
+ // is needed when user on overview page changing version
150
154
  useEffect(() => {
151
155
  let isUnmounted = false;
152
156
  const fetchClusters = () => __awaiter(this, void 0, void 0, function* () {
@@ -1 +1 @@
1
- {"version":3,"file":"AddCustomEmailToAccountModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/AddCustomEmailToAccountModal.tsx"],"names":[],"mappings":"AAOA,UAAU,MAAM;IACZ,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AACD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,eA+GpD"}
1
+ {"version":3,"file":"AddCustomEmailToAccountModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/AddCustomEmailToAccountModal.tsx"],"names":[],"mappings":"AAOA,UAAU,MAAM;IACZ,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AACD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,eAiHpD"}
@@ -35,13 +35,15 @@ export function AddCustomEmailToAccount(props) {
35
35
  const onFirstNameChange = (firstName) => setFirstName(firstName);
36
36
  const onLastNameChange = (lastName) => setLastName(lastName);
37
37
  const handleClose = () => {
38
+ if (isFetching)
39
+ return;
38
40
  setIsSaveButtonClicked(false);
39
41
  props.onClose && props.onClose();
40
42
  };
41
- return (React.createElement(Modal, { variant: ModalVariant.medium, title: t('Add a notification email to your account'), isOpen: true, onClose: handleClose, actions: [
43
+ return (React.createElement(Modal, { variant: ModalVariant.medium, title: t('Add a notification email to your account'), isOpen: true, onClose: handleClose, onEscapePress: handleClose, actions: [
42
44
  React.createElement(Button, { spinnerAriaValueText: isFetching ? t('Adding') : undefined, isLoading: isFetching, key: "confirm", variant: "primary", onClick: onAdd, isDisabled: isFetching || (isSaveButtonClicked && isEmpty(firstName)) },
43
45
  React.createElement(Trans, null, "Add to account")),
44
- React.createElement(Button, { key: "cancel", variant: "link", onClick: handleClose },
46
+ React.createElement(Button, { key: "cancel", variant: "link", onClick: handleClose, isDisabled: isFetching },
45
47
  React.createElement(Trans, null, "Cancel")),
46
48
  ] },
47
49
  React.createElement("p", { className: "pf-u-mb-lg" },
@@ -1 +1 @@
1
- {"version":3,"file":"AllProductsSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/AllProductsSelector.tsx"],"names":[],"mappings":"AASA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAKnD,OAAO,EAAqB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAMrF,UAAU,MAAM;IACZ,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,qBAAqB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAClC;AAgBD;;;;;;;GAOG;AACH,QAAA,MAAM,mBAAmB,4EAiMvB,CAAC;AAGH,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"AllProductsSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/AllProductsSelector.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAKnD,OAAO,EAAqB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAKrF,UAAU,MAAM;IACZ,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,qBAAqB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAClC;AAgBD;;;;;;;GAOG;AACH,QAAA,MAAM,mBAAmB,4EAoKvB,CAAC;AAGH,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -1,7 +1,6 @@
1
1
  import { Modal, ModalVariant } from '@patternfly/react-core';
2
2
  import { AlertMessage, AlertType, LoadingIndicator } from '@rh-support/components';
3
3
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
4
- import { getVersion } from '@rh-support/utils';
5
4
  import filter from 'lodash/filter';
6
5
  import find from 'lodash/find';
7
6
  import isEmpty from 'lodash/isEmpty';
@@ -10,8 +9,7 @@ import React, { forwardRef, useContext, useEffect, useState } from 'react';
10
9
  import { Trans, useTranslation } from 'react-i18next';
11
10
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
12
11
  import { TCStateContext } from '../../context/TopContentContext';
13
- import { getVersionsDetails, setCaseDetails, setCaseState } from '../../reducers/CaseReducer';
14
- import { isClusterIdEnabledForProduct } from '../../utils/caseOpenshiftClusterIdUtils';
12
+ import { getVersionsDetails, setCaseDetails } from '../../reducers/CaseReducer';
15
13
  import RouteUtils from '../../utils/routeUtils';
16
14
  import Suggestions from '../Suggestions/Suggestions';
17
15
  import { ProductVersionDropdownSelector } from './ProductVersionDropdownSelector';
@@ -110,38 +108,9 @@ const AllProductsSelector = forwardRef((props, ref) => {
110
108
  if (!isEmpty(selectedProduct.product)) {
111
109
  props.showTCAfterButtonClicked ? setProductChanged(true) : setShowModal(true);
112
110
  }
113
- // reset openshift cluster states
114
- setCaseDetails(caseDispatch, {
115
- openshiftClusterID: '',
116
- openshiftClusterVersion: '',
117
- noClusterIdReason: '',
118
- noClusterIdReasonExplanation: '',
119
- });
120
- setCaseState(caseDispatch, { v3ClusterName: '' });
121
111
  }
122
112
  function onVersionChange(selectedVersion) {
123
- var _a;
124
- // we need to reset openshift cluster states only when major version is different
125
- const oldMajorVersion = (version && getVersion(version).major) || '';
126
- const newMajorVersion = getVersion(selectedVersion).major || '';
127
- const hasCluster = isClusterIdEnabledForProduct(product, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult);
128
- if (hasCluster && oldMajorVersion !== newMajorVersion) {
129
- setCaseDetails(caseDispatch, {
130
- product: localProduct,
131
- version: selectedVersion,
132
- openshiftClusterID: '',
133
- openshiftClusterVersion: '',
134
- noClusterIdReason: '',
135
- noClusterIdReasonExplanation: '',
136
- });
137
- setCaseState(caseDispatch, { v3ClusterName: '' });
138
- }
139
- else {
140
- setCaseDetails(caseDispatch, {
141
- product: localProduct,
142
- version: selectedVersion,
143
- });
144
- }
113
+ setCaseDetails(caseDispatch, { product: localProduct, version: selectedVersion });
145
114
  const newParams = {
146
115
  version: selectedVersion,
147
116
  };
@@ -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,eAkHxD"}
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,eAuHxD"}
@@ -16,7 +16,7 @@ import { PaginationCompact, useFetch } from '@rh-support/components';
16
16
  import { getStyleVariantColor, StyleVariants } from '@rh-support/utils';
17
17
  import some from 'lodash/some';
18
18
  import React, { useContext, useEffect, useState } from 'react';
19
- import { Trans } from 'react-i18next';
19
+ import { Trans, useTranslation } from 'react-i18next';
20
20
  import { RulesDispatchContext } from '../../../context/RulesContext';
21
21
  import { SessionRestoreStateContext } from '../../../context/SessionRestoreContext';
22
22
  import { markEARuleResolved, setEARulesVisibilityChange } from '../../../reducers/RulesReducer';
@@ -24,6 +24,7 @@ import { RecommendationFeedbackModal } from '../RecommendationFeedbackModal';
24
24
  import { EARule, EARuleArticle, EARuleDescription, EARuleTitle } from './EARule';
25
25
  const { SessionResourceSource } = pcm.preCase.session;
26
26
  export function EARuleInfoInline({ eaRules = [] }) {
27
+ const { t } = useTranslation();
27
28
  const [currentPage, setCurrentPage] = useState(1);
28
29
  const rulesDispatch = useContext(RulesDispatchContext);
29
30
  const { request: resolveSessionRequest, isFetching } = useFetch(pcm.preCase.session.resolveSession);
@@ -66,7 +67,7 @@ export function EARuleInfoInline({ eaRules = [] }) {
66
67
  return null;
67
68
  const visibleRule = eaRules[currentPage > validEARulesLength ? validEARulesLength - 1 : currentPage - 1];
68
69
  return (React.createElement(React.Fragment, null,
69
- React.createElement(RecommendationFeedbackModal, { isModalOpen: isModalVisible, handleModalToggle: onModalToggle }),
70
+ React.createElement(RecommendationFeedbackModal, { isModalOpen: isModalVisible, handleModalToggle: onModalToggle, modalContent: t(`Great, we're glad that resolved your issue`) }),
70
71
  React.createElement(EARule, { rule: visibleRule },
71
72
  React.createElement("div", { className: "pf-c-alert pf-m-info pf-m-inline pf-u-mb-md", "aria-label": "Success alert" },
72
73
  React.createElement("div", { className: "pf-c-alert__icon" },
@@ -79,7 +80,7 @@ export function EARuleInfoInline({ eaRules = [] }) {
79
80
  React.createElement("div", { className: "pf-c-alert__description" },
80
81
  React.createElement(EARuleDescription, null)),
81
82
  React.createElement("div", { className: "pf-c-alert__action-group pf-u-display-flex" },
82
- React.createElement(EARuleArticle, { className: "pf-u-align-self-center pf-u-mr-sm", linkTitle: "View Details" }),
83
+ React.createElement(EARuleArticle, { className: "pf-u-align-self-center pf-u-mr-sm", linkTitle: "View details" }),
83
84
  visibleRule.resolved ? (React.createElement("span", { style: {
84
85
  color: getStyleVariantColor(StyleVariants.SUCCESS),
85
86
  lineHeight: 2.4,
@@ -1,7 +1,8 @@
1
1
  interface IProps {
2
2
  isModalOpen: boolean;
3
3
  handleModalToggle: () => void;
4
+ modalContent: string;
4
5
  }
5
- export declare function RecommendationFeedbackModal({ isModalOpen, handleModalToggle }: IProps): JSX.Element;
6
+ export declare function RecommendationFeedbackModal({ isModalOpen, handleModalToggle, modalContent }: IProps): JSX.Element;
6
7
  export {};
7
8
  //# sourceMappingURL=RecommendationFeedbackModal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RecommendationFeedbackModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/RecommendationFeedbackModal.tsx"],"names":[],"mappings":"AAKA,UAAU,MAAM;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,MAAM,IAAI,CAAC;CACjC;AACD,wBAAgB,2BAA2B,CAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,EAAE,MAAM,eAiCrF"}
1
+ {"version":3,"file":"RecommendationFeedbackModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/RecommendationFeedbackModal.tsx"],"names":[],"mappings":"AAKA,UAAU,MAAM;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;CACxB;AACD,wBAAgB,2BAA2B,CAAC,EAAE,WAAW,EAAE,iBAAiB,EAAE,YAAY,EAAE,EAAE,MAAM,eA+BnG"}
@@ -2,13 +2,12 @@ import { Button, Modal, ModalVariant } from '@patternfly/react-core';
2
2
  import React from 'react';
3
3
  import { Trans } from 'react-i18next';
4
4
  import { Link } from 'react-router-dom';
5
- export function RecommendationFeedbackModal({ isModalOpen, handleModalToggle }) {
5
+ export function RecommendationFeedbackModal({ isModalOpen, handleModalToggle, modalContent }) {
6
6
  return (React.createElement(Modal, { variant: ModalVariant.small, id: "resolved-feedback-modal", "aria-describedby": "rec-feedback-modal", "aria-label": "Feedback modal", isOpen: isModalOpen, onClose: handleModalToggle, actions: [
7
7
  React.createElement(Link, { "data-tracking-id": "resolved-feedback-cases", key: "view", className: "pf-c-button pf-m-primary", to: "/case/list" },
8
8
  React.createElement(Trans, null, "View your cases")),
9
9
  React.createElement(Button, { "data-tracking-id": "resolved-feedback-continue", key: "continue", variant: "link", onClick: handleModalToggle },
10
10
  React.createElement(Trans, null, "Continue")),
11
11
  ] },
12
- React.createElement("h1", { id: "rec-feedback-modal" },
13
- React.createElement(Trans, null, "Thank you for providing feedback"))));
12
+ React.createElement("h1", { id: "rec-feedback-modal" }, modalContent)));
14
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RulesModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/RulesModal.tsx"],"names":[],"mappings":"AAIA,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,eAsF/C"}
1
+ {"version":3,"file":"RulesModal.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/RulesModal.tsx"],"names":[],"mappings":"AAOA,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,eA8H/C"}
@@ -1,9 +1,22 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { pcm } from '@cee-eng/hydrajs';
1
11
  import { Accordion, Button, Modal } from '@patternfly/react-core';
12
+ import { useFetch } from '@rh-support/components';
2
13
  import React, { useContext, useEffect, useState } from 'react';
3
14
  import { useTranslation } from 'react-i18next';
15
+ import { SessionRestoreStateContext } from '../../context/SessionRestoreContext';
4
16
  import { AttachmentStateContext } from '../shared/fileUpload/reducer/AttachmentReducerContext';
5
17
  import { EARuleInfoAccordion } from './EARules/EARuleInfoAccordion';
6
18
  import { InsightsRuleInfo } from './InsightsRuleInfo';
19
+ import { RecommendationFeedbackModal } from './RecommendationFeedbackModal';
7
20
  export function InsightResultModal(props) {
8
21
  const { t } = useTranslation();
9
22
  const potentialDuplicate = {};
@@ -20,6 +33,27 @@ export function InsightResultModal(props) {
20
33
  });
21
34
  const { attachmentState: { caseFiles: { selectedLocalFiles }, }, } = useContext(AttachmentStateContext);
22
35
  const [canShowNewTag, setCanShowNewTag] = useState(false);
36
+ const { SessionResourceSource } = pcm.preCase.session;
37
+ const { request: resolveSessionRequest, isFetching } = useFetch(pcm.preCase.session.resolveSession);
38
+ const { sessionRestore: { activeSessionId, sessionResourceTracking }, } = useContext(SessionRestoreStateContext);
39
+ const [isModalVisible, setIsModalVisible] = useState(false);
40
+ const handleSolvedIssue = () => __awaiter(this, void 0, void 0, function* () {
41
+ var _a, _b;
42
+ try {
43
+ yield resolveSessionRequest(activeSessionId, {
44
+ sessionId: activeSessionId,
45
+ sessionResourceOriginId: (_b = (_a = sessionResourceTracking[SessionResourceSource.INSIGHTS]) === null || _a === void 0 ? void 0 : _a.resourceOriginId) !== null && _b !== void 0 ? _b : '',
46
+ type: SessionResourceSource.INSIGHTS,
47
+ url: '',
48
+ });
49
+ props.onModalToggle();
50
+ setIsModalVisible(true);
51
+ }
52
+ catch (e) { }
53
+ });
54
+ const onModalToggle = () => {
55
+ setIsModalVisible((visible) => !visible);
56
+ };
23
57
  useEffect(() => {
24
58
  let total = props.EARule.length;
25
59
  let trueValues = 0;
@@ -41,11 +75,14 @@ export function InsightResultModal(props) {
41
75
  });
42
76
  setCanShowNewTag(!(total === trueValues));
43
77
  }, [selectedLocalFiles, props.EARule]);
44
- return (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: [
45
- React.createElement(Button, { onClick: props.onModalToggle, key: "confirm", variant: "secondary", "data-tracking-id": "cancel-critical-solutions-modal" }, t('Cancel')),
46
- ] },
47
- React.createElement(Accordion, { className: "push-top-narrow", headingLevel: "h2", asDefinitionList: false },
48
- props.insightResults.map((doc) => (React.createElement(InsightsRuleInfo, { duplicateKeys: duplicateKeys, showNewTag: canShowNewTag, key: doc.id + doc.attachmentId, doc: doc }))),
49
- props.EARule.length > 0 &&
50
- props.EARule.map((rule, index) => (React.createElement(EARuleInfoAccordion, { showNewTag: canShowNewTag, key: `${index}_eaRule`, rule: rule }))))));
78
+ return (React.createElement(React.Fragment, null,
79
+ React.createElement(RecommendationFeedbackModal, { isModalOpen: isModalVisible, handleModalToggle: onModalToggle, modalContent: t(`Great, we're glad that resolved your issue`) }),
80
+ 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: [
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
+ React.createElement(Button, { onClick: props.onModalToggle, key: "confirm", variant: "secondary", "data-tracking-id": "cancel-critical-solutions-modal" }, t('Cancel')),
83
+ ] },
84
+ React.createElement(Accordion, { className: "push-top-narrow", headingLevel: "h2", asDefinitionList: false },
85
+ props.insightResults.map((doc) => (React.createElement(InsightsRuleInfo, { duplicateKeys: duplicateKeys, showNewTag: canShowNewTag, key: doc.id + doc.attachmentId, doc: doc }))),
86
+ props.EARule.length > 0 &&
87
+ props.EARule.map((rule, index) => (React.createElement(EARuleInfoAccordion, { showNewTag: canShowNewTag, key: `${index}_eaRule`, rule: rule })))))));
51
88
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SessionRestore.d.ts","sourceRoot":"","sources":["../../../../src/components/SessionRestore/SessionRestore.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAQvD,OAAO,EAGH,eAAe,EAElB,MAAM,iCAAiC,CAAC;AAgBzC,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,eAgU3C"}
1
+ {"version":3,"file":"SessionRestore.d.ts","sourceRoot":"","sources":["../../../../src/components/SessionRestore/SessionRestore.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAQvD,OAAO,EAGH,eAAe,EAElB,MAAM,iCAAiC,CAAC;AAgBzC,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,eAqU3C"}
@@ -21,7 +21,7 @@ import { RouteContext, useRouteDispatchContext } from '../../context/RouteContex
21
21
  import { SessionRestoreDispatchContext, SessionRestoreStateContext } from '../../context/SessionRestoreContext';
22
22
  import { CaseReducerConstants, SESSION_REFERRER_URL_LIMIT } from '../../reducers/CaseConstNTypes';
23
23
  import { getSessionDetailsFromCase } from '../../reducers/CaseHelpers';
24
- import { setCaseAccountNumber, setCaseOwner, updateCaseWithSession } from '../../reducers/CaseReducer';
24
+ import { setCaseAccountNumber, setCaseOwner, setCaseState, updateCaseWithSession } from '../../reducers/CaseReducer';
25
25
  import { AppRouteSections, sessionRestoreCardSections, } from '../../reducers/RouteConstNTypes';
26
26
  import { getDefaultSection, RouteReducerConstants } from '../../reducers/RouteReducer';
27
27
  import { createSession, getRelevantSessionFromSessions, loadPreviousSessions, markAllSessionsUnresolved, updateActiveSessionId, updateSession, } from '../../reducers/SessionRestoreReducer';
@@ -192,6 +192,10 @@ export function SessionRestore(props) {
192
192
  sessionDetails.accountNumber = caseDetails.accountNumberRef;
193
193
  sessionDetails.contactSsoUsername = caseDetails.contactSSOName;
194
194
  }
195
+ //set OpenShift v3 cluster name
196
+ const reg = new RegExp('Cluster Name: (.*) ');
197
+ const v3ClusterName = reg.exec(sessionDetails.description) ? reg.exec(sessionDetails.description)[1] : '';
198
+ setCaseState(caseDispatch, { v3ClusterName });
195
199
  yield updateCaseWithSession(caseDispatch, sessionItem, loggedInUserRights.data.getAccountNumber(), loggedInUserRights.data.getHydraContactFromLoggedInUser(), loggedInUsersAccount.data);
196
200
  restoreFilesFromSession(dispatchToAttachmentReducer, sessionItem.session.id);
197
201
  // navigate to beginning section if submit case.
@@ -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;AAUvD,OAAO,EAAqB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAMrF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,eAyUtD"}
1
+ {"version":3,"file":"GlobalTroubleshootEffects.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/GlobalTroubleshootEffects.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAUvD,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,eAoWtD"}
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import { useDebounce, usePrevious } from '@rh-support/components';
11
11
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
12
12
  import { ability, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
13
- import { getUrlParsedParams, getVersionIfOnlyVersion, isOnlyVersion } from '@rh-support/utils';
13
+ import { getUrlParsedParams, getVersion, getVersionIfOnlyVersion, isOnlyVersion } from '@rh-support/utils';
14
14
  import findIndex from 'lodash/findIndex';
15
15
  import includes from 'lodash/includes';
16
16
  import isEmpty from 'lodash/isEmpty';
@@ -23,10 +23,11 @@ import { TCDispatchContext, TCStateContext } from '../../context/TopContentConte
23
23
  import { useResetCaseCreate } from '../../hooks/useResetCaseCreate';
24
24
  import { initialCaseState } from '../../reducers/CaseConstNTypes';
25
25
  import { getDescriptionWOQues } from '../../reducers/CaseHelpers';
26
- import { setCaseAccountNumber, setCaseDetails, setCaseOwner } from '../../reducers/CaseReducer';
26
+ import { setCaseAccountNumber, setCaseDetails, setCaseOwner, setCaseState } from '../../reducers/CaseReducer';
27
27
  import { getDefaultSection, getRouteSequence, RouteReducerConstants } from '../../reducers/RouteReducer';
28
28
  import { fetchEdmundAbbottRules } from '../../reducers/RulesReducer';
29
29
  import { fetchTopContent } from '../../reducers/TopContentReducer';
30
+ import { isClusterIdEnabledForProduct } from '../../utils/caseOpenshiftClusterIdUtils';
30
31
  import RouteUtils from '../../utils/routeUtils';
31
32
  export function GlobalTroubleshootEffects(props) {
32
33
  const [initDefaultSection, setInitDefaultSection] = useState(false);
@@ -273,5 +274,29 @@ export function GlobalTroubleshootEffects(props) {
273
274
  }
274
275
  // eslint-disable-next-line react-hooks/exhaustive-deps
275
276
  }, [loggedInUsersAccount.data]);
277
+ /**
278
+ * When user change product/version need to reset clusterID states
279
+ */
280
+ const previousVersion = usePrevious(version);
281
+ useEffect(() => {
282
+ var _a;
283
+ if (isEmpty(product) || isEmpty(version))
284
+ return;
285
+ // we need to reset openshift cluster states only when major version is different
286
+ const oldMajorVersion = previousVersion && getVersion(previousVersion).major;
287
+ const newMajorVersion = getVersion(version).major;
288
+ const hasCluster = isClusterIdEnabledForProduct(product, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult);
289
+ const isDifferentMajorClusterVersion = hasCluster && oldMajorVersion !== newMajorVersion;
290
+ if (isDifferentMajorClusterVersion) {
291
+ setCaseDetails(caseDispatch, {
292
+ openshiftClusterID: '',
293
+ openshiftClusterVersion: '',
294
+ noClusterIdReason: '',
295
+ noClusterIdReasonExplanation: '',
296
+ });
297
+ setCaseState(caseDispatch, { v3ClusterName: '' });
298
+ }
299
+ // eslint-disable-next-line react-hooks/exhaustive-deps
300
+ }, [product, version, allProducts.data.productsResult, caseDispatch]);
276
301
  return React.createElement(React.Fragment, null);
277
302
  }
@@ -1,6 +1,6 @@
1
1
  import { EditorMode } from '@rh-support/components';
2
2
  export declare function useUserPreference(): {
3
- updateCommentType: (value: EditorMode) => void;
3
+ updateCommentType: (value: EditorMode) => Promise<void>;
4
4
  getCommentTypeFromPreference: () => any;
5
5
  hydraUserPreferences: import("@rh-support/types/shared").IApiResponseDetails<import("@cee-eng/hydrajs/@types/models/general").IPreference[]>;
6
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useUserPreference.d.ts","sourceRoot":"","sources":["../../../src/hooks/useUserPreference.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AASpD,wBAAgB,iBAAiB;+BAgBK,UAAU;;;EAmB/C"}
1
+ {"version":3,"file":"useUserPreference.d.ts","sourceRoot":"","sources":["../../../src/hooks/useUserPreference.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AASpD,wBAAgB,iBAAiB;+BAgBW,UAAU;;;EAmBrD"}
@@ -1,3 +1,12 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
1
10
  import { GlobalMetadataDispatchContext, GlobalMetadataStateContext, updateUserPreferences, UserPreferencesKeys, } from '@rh-support/react-context';
2
11
  import { useContext } from 'react';
3
12
  export function useUserPreference() {
@@ -11,11 +20,11 @@ export function useUserPreference() {
11
20
  const item = hydraUserPreferences.data.find((pref) => pref.key === key);
12
21
  return item ? item.value : null;
13
22
  };
14
- const updateCommentType = (value) => {
23
+ const updateCommentType = (value) => __awaiter(this, void 0, void 0, function* () {
15
24
  if (doesKeyExistWithSameValue(UserPreferencesKeys.commentType, value))
16
25
  return;
17
- updateUserPreferences(globalMetadataDispatch, loggedInUser.data.ssoUsername, [{ key: UserPreferencesKeys.commentType, value }], 'add', true);
18
- };
26
+ yield updateUserPreferences(globalMetadataDispatch, loggedInUser.data.ssoUsername, [{ key: UserPreferencesKeys.commentType, value }], 'add', true);
27
+ });
19
28
  const getCommentTypeFromPreference = () => {
20
29
  return getKeyValue(UserPreferencesKeys.commentType);
21
30
  };
@@ -39,7 +39,7 @@ declare const _default: {
39
39
  'All fields optional.': string;
40
40
  'Where are you experiencing the behavior? What environment?': string;
41
41
  'When does the behavior occur? Frequency? Repeatedly? At certain times?': string;
42
- 'What information can you provide around timeframes and the business impact?': string;
42
+ 'What is the business impact? Please also provide timeframe information.?': string;
43
43
  'Cumulative case description cannot be more than {{limit}} characters': string;
44
44
  'Drag a file here or browse to upload': string;
45
45
  'Select File': string;
@@ -704,7 +704,7 @@ declare const _default: {
704
704
  'Critical solutions have been triggered': string;
705
705
  'Critical solutions for your system': string;
706
706
  'Solutions have been triggered for you based on file upload or common issues that currently have high visibility.': string;
707
- 'View Details': string;
707
+ 'View details': string;
708
708
  Skip: string;
709
709
  'This resolved my issue': string;
710
710
  'Select the option that best fits your reason for creating a case': string;
@@ -727,6 +727,10 @@ declare const _default: {
727
727
  'Please select a version to edit': string;
728
728
  'Add a new section': string;
729
729
  'Arrange Section': string;
730
+ 'Please address the errors to proceed': string;
731
+ 'Include someone from your account to inform about the status of this case.': string;
732
+ "Yes, I'm, sure": string;
733
+ ' and ongoing response time is': string;
730
734
  };
731
735
  export default _default;
732
736
  //# sourceMappingURL=template-de.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"template-de.d.ts","sourceRoot":"","sources":["../../../src/i18n/template-de.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAy0BE"}
1
+ {"version":3,"file":"template-de.d.ts","sourceRoot":"","sources":["../../../src/i18n/template-de.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAm1BE"}