@rh-support/troubleshoot 2.6.90 → 2.6.93

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 (46) hide show
  1. package/lib/esm/components/AccountInfo/OwnerSelector.d.ts.map +1 -1
  2. package/lib/esm/components/AccountInfo/OwnerSelector.js +1 -0
  3. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
  4. package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +51 -406
  5. package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
  6. package/lib/esm/components/CaseEditView/Case.js +3 -2
  7. package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.d.ts +1 -0
  8. package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.d.ts.map +1 -1
  9. package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.js +3 -3
  10. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.d.ts.map +1 -1
  11. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +18 -2
  12. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.d.ts.map +1 -1
  13. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +7 -4
  14. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
  15. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +14 -2
  16. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseChat.d.ts.map +1 -1
  17. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseChat.js +6 -0
  18. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
  19. package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +0 -1
  20. package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
  21. package/lib/esm/components/CaseInformation/SupportLevel.js +6 -1
  22. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts.map +1 -1
  23. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.js +20 -12
  24. package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts.map +1 -1
  25. package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +7 -2
  26. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts +1 -0
  27. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
  28. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +10 -6
  29. package/lib/esm/components/TroubleshootSection/AskRedHat.d.ts.map +1 -1
  30. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  31. package/lib/esm/components/shared/useIsSectionValid.js +7 -8
  32. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  33. package/lib/esm/components/wizardLayout/WizardNavigation.js +8 -4
  34. package/lib/esm/reducers/CaseConstNTypes.d.ts +1 -13
  35. package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
  36. package/lib/esm/reducers/CaseConstNTypes.js +0 -12
  37. package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
  38. package/lib/esm/reducers/CaseHelpers.js +2 -1
  39. package/lib/esm/reducers/CaseReducer.d.ts +1 -0
  40. package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
  41. package/lib/esm/reducers/CaseReducer.js +1 -1
  42. package/lib/esm/reducers/RouteReducer.d.ts +2 -2
  43. package/lib/esm/reducers/RouteReducer.d.ts.map +1 -1
  44. package/lib/esm/reducers/RouteReducer.js +1 -1
  45. package/lib/esm/scss/_pf-overrides.scss +31 -202
  46. package/package.json +5 -5
@@ -4,6 +4,7 @@ interface IProps {
4
4
  isError: boolean;
5
5
  errorDetails: IAPIError;
6
6
  canReadCase: boolean;
7
+ canManageCase: boolean;
7
8
  caseNumber: string;
8
9
  isInlineError?: boolean;
9
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CaseDetailsErrorMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsErrorMessage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,UAAU,MAAM;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,SAAS,CAAC;IACxB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AAID,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,qBAqEpD"}
1
+ {"version":3,"file":"CaseDetailsErrorMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsErrorMessage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,UAAU,MAAM;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,SAAS,CAAC;IACxB,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;CAC3B;AAID,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,qBA6EpD"}
@@ -9,7 +9,7 @@ export function CaseDetailsErrorMessage(props) {
9
9
  const { globalMetadataState: { loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
10
10
  const { t } = useTranslation();
11
11
  // Initialize Default Props Below
12
- const { isInlineError = false, canReadCase, caseNumber, errorDetails } = props;
12
+ const { isInlineError = false, canReadCase, canManageCase, caseNumber, errorDetails } = props;
13
13
  const invalidCaseGroupErrorTitle = t('This case can only be viewed by a specific group');
14
14
  /* There can be two condition for HTTP 403 error
15
15
  1. Account mismatch.
@@ -44,12 +44,12 @@ export function CaseDetailsErrorMessage(props) {
44
44
  return formattedApiErrorMessage(errorDetails, {
45
45
  '403': { message: errorMessage403 },
46
46
  '404': { message: errorMessage404 },
47
- });
47
+ }, canManageCase);
48
48
  };
49
49
  return (React.createElement(AlertMessage, { variant: AlertType.DANGER, className: "pf-v6-u-mb-lg", show: true,
50
50
  // Here customizing title of alert based on case group error.
51
51
  title: errorMessageTitle(errorDetails, Object.assign({}, (isCaseGroupError && {
52
52
  '403': { title: invalidCaseGroupErrorTitle },
53
- }))), isInline: isInlineError },
53
+ })), canManageCase), isInline: isInlineError },
54
54
  React.createElement(Trans, null, getErrorMessage())));
55
55
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CaseSolutions.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseSolutions/CaseSolutions.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAwE3E,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB,EAAE,OAAO,CAAC;CACnC;AAUD,eAAO,MAAM,aAAa,+EAwhBxB,CAAC"}
1
+ {"version":3,"file":"CaseSolutions.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseSolutions/CaseSolutions.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAuF3E,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB,EAAE,OAAO,CAAC;CACnC;AAUD,eAAO,MAAM,aAAa,+EAuhBxB,CAAC"}
@@ -24,6 +24,7 @@ import { PaginatedList, ToastNotification } from '@rh-support/components';
24
24
  import { useGlobalStateContext } from '@rh-support/react-context';
25
25
  import { AbilityContext, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
26
26
  import { getSolrParams } from '@rh-support/utils';
27
+ import { isEmpty } from 'lodash';
27
28
  import find from 'lodash/find';
28
29
  import isEqual from 'lodash/isEqual';
29
30
  import some from 'lodash/some';
@@ -49,8 +50,8 @@ const titleFix = (recommendations, allDocs) => __awaiter(void 0, void 0, void 0,
49
50
  const ids = [];
50
51
  const recs = [...recommendations];
51
52
  recs.forEach((rec) => {
53
+ const recommendationWithSameID = find(allDocs, (doc) => doc.id === rec.resourceId);
52
54
  if (rec.title === 'Red Hat Knowledge Base') {
53
- const recommendationWithSameID = find(allDocs, (doc) => doc.id === rec.resourceId);
54
55
  if (recommendationWithSameID &&
55
56
  (recommendationWithSameID.publishedTitle || recommendationWithSameID.allTitle)) {
56
57
  rec.title = (recommendationWithSameID === null || recommendationWithSameID === void 0 ? void 0 : recommendationWithSameID.publishedTitle) || (recommendationWithSameID === null || recommendationWithSameID === void 0 ? void 0 : recommendationWithSameID.allTitle);
@@ -63,6 +64,17 @@ const titleFix = (recommendations, allDocs) => __awaiter(void 0, void 0, void 0,
63
64
  ids.push(rec.resourceId);
64
65
  }
65
66
  }
67
+ if (isEmpty(rec === null || rec === void 0 ? void 0 : rec.solutionAbstract)) {
68
+ if (recommendationWithSameID) {
69
+ rec.solutionAbstract =
70
+ (recommendationWithSameID === null || recommendationWithSameID === void 0 ? void 0 : recommendationWithSameID.snippet) ||
71
+ (recommendationWithSameID === null || recommendationWithSameID === void 0 ? void 0 : recommendationWithSameID.publishedAbstract) ||
72
+ (recommendationWithSameID === null || recommendationWithSameID === void 0 ? void 0 : recommendationWithSameID.abstract);
73
+ }
74
+ else if (rec.title !== 'Red Hat Knowledge Base') {
75
+ ids.push(rec.resourceId);
76
+ }
77
+ }
66
78
  });
67
79
  if (ids.length !== 0) {
68
80
  try {
@@ -72,7 +84,11 @@ const titleFix = (recommendations, allDocs) => __awaiter(void 0, void 0, void 0,
72
84
  recs.forEach((rec) => {
73
85
  const matchedDoc = find(docs, (doc) => doc.id === rec.resourceId);
74
86
  rec.title = matchedDoc ? (matchedDoc === null || matchedDoc === void 0 ? void 0 : matchedDoc.publishedTitle) || (matchedDoc === null || matchedDoc === void 0 ? void 0 : matchedDoc.allTitle) : rec.title;
75
- rec.solutionAbstract = (matchedDoc === null || matchedDoc === void 0 ? void 0 : matchedDoc.snippet) || (matchedDoc === null || matchedDoc === void 0 ? void 0 : matchedDoc.publishedAbstract) || (matchedDoc === null || matchedDoc === void 0 ? void 0 : matchedDoc.abstract);
87
+ rec.solutionAbstract =
88
+ (matchedDoc === null || matchedDoc === void 0 ? void 0 : matchedDoc.snippet) ||
89
+ (matchedDoc === null || matchedDoc === void 0 ? void 0 : matchedDoc.publishedAbstract) ||
90
+ (matchedDoc === null || matchedDoc === void 0 ? void 0 : matchedDoc.abstract) ||
91
+ (rec === null || rec === void 0 ? void 0 : rec.solutionAbstract);
76
92
  });
77
93
  }
78
94
  catch (e) {
@@ -1 +1 @@
1
- {"version":3,"file":"CaseOpenshiftClusterId.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAqBvE,wBAAgB,sBAAsB,sBAsSrC"}
1
+ {"version":3,"file":"CaseOpenshiftClusterId.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAqB/D,wBAAgB,sBAAsB,sBA2SrC"}
@@ -13,7 +13,7 @@ import { getVersion } from '@rh-support/utils';
13
13
  import debounce from 'lodash/debounce';
14
14
  import isEmpty from 'lodash/isEmpty';
15
15
  import isEqual from 'lodash/isEqual';
16
- import React, { useContext, useEffect, useRef, useState } from 'react';
16
+ import React, { useContext, useEffect, useState } from 'react';
17
17
  import { useTranslation } from 'react-i18next';
18
18
  import { useCaseDispatch, useCaseSelector } from '../../../../../context/CaseContext';
19
19
  import { useCaseUpdateErrorMessage } from '../../../../../hooks/useCaseUpdateErrorMessage';
@@ -49,7 +49,7 @@ export function CaseOpenshiftClusterId() {
49
49
  const [localOpenshiftClusterIDState, setLocalOpenshiftClusterIDState] = useState(openshiftClusterID);
50
50
  const [isClusterIdUpdating, setIsClusterIdUpdating] = useState(false);
51
51
  const [isReasonUpdating, setIsReasonUpdating] = useState(false);
52
- const displayName = useRef('');
52
+ const [displayName, setDisplayName] = useState('');
53
53
  const previousLocalOpenshiftClusterIDState = usePrevious(localOpenshiftClusterIDState);
54
54
  const previousSelectedReason = usePrevious(selectedReason);
55
55
  const previousProduct = usePrevious(product);
@@ -69,6 +69,9 @@ export function CaseOpenshiftClusterId() {
69
69
  noClusterIdReason: '',
70
70
  });
71
71
  };
72
+ const onDisplayNameChange = (val) => {
73
+ setDisplayName(val);
74
+ };
72
75
  useEffect(() => {
73
76
  var _a;
74
77
  const isClusterVisible = () => __awaiter(this, void 0, void 0, function* () {
@@ -170,7 +173,7 @@ export function CaseOpenshiftClusterId() {
170
173
  setIsClusterIdInValid(isClusterIdInvalid);
171
174
  setDontKnowSelected(false);
172
175
  setSelectedReason('');
173
- displayName.current = selectedCluster.display_name;
176
+ setDisplayName(selectedCluster.display_name || '');
174
177
  if (isClusterIdInvalid)
175
178
  return;
176
179
  const caseDetails = {
@@ -242,7 +245,7 @@ export function CaseOpenshiftClusterId() {
242
245
  }
243
246
  else {
244
247
  return (React.createElement(React.Fragment, null,
245
- React.createElement(OpenshiftDropdownV4, { openshiftDisplayName: displayName.current, openshiftClusterIDState: localOpenshiftClusterIDState || selectedReason, onClusterIdStateUpdate: onClusterIdSave, isClusterIdInvalid: (isEmpty(localOpenshiftClusterIDState) && isEmpty(selectedReason)) || isClusterIdInvalid, clusterIdDropdownFormInstructions: !isExportingPDF ? clusterIdDropdownFormInstructions() : undefined, onClusterClear: resetClusterData, isV3: product !== 'OpenShift Container Platform', isDisabled: isClusterIdUpdating, noClusterIdReasonExplanation: noClusterIdReasonExplanation }),
248
+ React.createElement(OpenshiftDropdownV4, { openshiftDisplayName: displayName, setOpenshiftDisplayName: onDisplayNameChange, openshiftClusterIDState: localOpenshiftClusterIDState || selectedReason, onClusterIdStateUpdate: onClusterIdSave, isClusterIdInvalid: (isEmpty(localOpenshiftClusterIDState) && isEmpty(selectedReason)) || isClusterIdInvalid, clusterIdDropdownFormInstructions: !isExportingPDF ? clusterIdDropdownFormInstructions() : undefined, onClusterClear: resetClusterData, isV3: product !== 'OpenShift Container Platform', isDisabled: isClusterIdUpdating, noClusterIdReasonExplanation: noClusterIdReasonExplanation }),
246
249
  noClusterIdReasonExplanation !== 'v3-cluster' &&
247
250
  (dontKnowSelected || noClusterIdReasonExplanation || noClusterIdReason) && (React.createElement(NoClusterIDReasonSelector, { noClusterIdReasonExplanation: noClusterIdReasonExplanation, noClusterIdReason: noClusterIdReason, onReasonInputBoxChanged: debounceFn, onReasonChange: onReasonChange, isInValid: isInVaidNoClusterIdReason, isCustomer: isCustomer, isDisabled: isReasonUpdating })),
248
251
  React.createElement(LoadingIndicator, { show: isClusterIdUpdating, size: "xs" })));
@@ -1 +1 @@
1
- {"version":3,"file":"ProductVersion.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/ProductVersion.tsx"],"names":[],"mappings":"AAyCA,OAAO,KAAkD,MAAM,OAAO,CAAC;AASvE,UAAU,MAAM;IACZ,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACvC;AAED,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,qBA8VrC;AAED,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"ProductVersion.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/ProductVersion.tsx"],"names":[],"mappings":"AAyCA,OAAO,KAAkD,MAAM,OAAO,CAAC;AASvE,UAAU,MAAM;IACZ,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACvC;AAED,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,qBA0WrC;AAED,eAAe,eAAe,CAAC"}
@@ -21,7 +21,7 @@ import React, { useContext, useEffect, useRef, useState } from 'react';
21
21
  import { Trans, useTranslation } from 'react-i18next';
22
22
  import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
23
23
  import { useCaseUpdateErrorMessage } from '../../../../hooks/useCaseUpdateErrorMessage';
24
- import { getVersionsDetails, updateCaseDetails } from '../../../../reducers/CaseReducer';
24
+ import { fetchCaseEntitlements, getVersionsDetails, updateCaseDetails } from '../../../../reducers/CaseReducer';
25
25
  import { getProductObj } from '../../../shared/utils';
26
26
  import { PDFContext } from '../../PDFContainer';
27
27
  function ProductNVersion(props) {
@@ -111,7 +111,19 @@ function ProductNVersion(props) {
111
111
  }
112
112
  setIsProductUpdating(true);
113
113
  setIsVersionUpdating(true);
114
- yield updateCaseDetails(caseDispatch, caseNumber, { product: selectedProduct, version: selectedVersion });
114
+ if (!onlyVersionChanged && contactSSOName && caseNumber) {
115
+ yield updateCaseDetails(caseDispatch, caseNumber, {
116
+ product: selectedProduct,
117
+ version: selectedVersion,
118
+ });
119
+ yield fetchCaseEntitlements(caseDispatch, contactSSOName, selectedProduct, undefined, true, caseNumber);
120
+ }
121
+ else {
122
+ yield updateCaseDetails(caseDispatch, caseNumber, {
123
+ product: selectedProduct,
124
+ version: selectedVersion,
125
+ });
126
+ }
115
127
  setIsProductUpdating(false);
116
128
  setIsVersionUpdating(false);
117
129
  if (onlyVersionChanged) {
@@ -1 +1 @@
1
- {"version":3,"file":"CaseChat.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseChat.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,SAAS,CAAC;IAChB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAED,QAAA,MAAM,QAAQ,4EAiDZ,CAAC;AACH,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"CaseChat.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseChat.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,SAAS,CAAC;IAChB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AASD,QAAA,MAAM,QAAQ,4EAiDZ,CAAC;AACH,eAAe,QAAQ,CAAC"}
@@ -5,6 +5,12 @@ import { Trans } from 'react-i18next';
5
5
  import { DiscussionType } from '../../../../reducers/CaseDiscussionTabReducer';
6
6
  import { DiscussionItemLink } from './DiscussionItemLink';
7
7
  import { JumpAndCopyLink } from './JumpAndCopyLink';
8
+ DOMPurify.addHook('afterSanitizeAttributes', function (node) {
9
+ if (node.tagName === 'A') {
10
+ node.setAttribute('target', '_blank');
11
+ node.setAttribute('rel', 'noopener noreferrer');
12
+ }
13
+ });
8
14
  const CaseChat = React.forwardRef((props, ref) => {
9
15
  const { caseNumber } = props;
10
16
  const sanetize = (html) => {
@@ -1 +1 @@
1
- {"version":3,"file":"VerifyCaseStatusModal.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAa3E,UAAU,MAAM;IACZ,SAAS,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,qBA4IlD"}
1
+ {"version":3,"file":"VerifyCaseStatusModal.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAa3E,UAAU,MAAM;IACZ,SAAS,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,qBA2IlD"}
@@ -33,7 +33,6 @@ export function VerifyCaseStatusModal(props) {
33
33
  createdById: state.caseDetails.createdById,
34
34
  ownerId: state.caseDetails.ownerId,
35
35
  caseNumber: state.caseDetails.caseNumber,
36
- entitlementSla: state.caseDetails.entitlementSla,
37
36
  cep: state.caseDetails.cep,
38
37
  accountNumber: state.caseDetails.accountNumberRef,
39
38
  firstCaseInactivityWarningSentAt: state.caseDetails.firstCaseInactivityWarningSentAt,
@@ -1 +1 @@
1
- {"version":3,"file":"SupportLevel.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/SupportLevel.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,KAA0C,MAAM,OAAO,CAAC;AAM/D,UAAU,MAAO,SAAQ,gBAAgB;CAAG;AAO5C,iBAAS,YAAY,CAAC,KAAK,EAAE,MAAM,qBAoIlC;kBApIQ,YAAY;;;AAsIrB,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"SupportLevel.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/SupportLevel.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,KAA0C,MAAM,OAAO,CAAC;AAM/D,UAAU,MAAO,SAAQ,gBAAgB;CAAG;AAO5C,iBAAS,YAAY,CAAC,KAAK,EAAE,MAAM,qBAmJlC;kBAnJQ,YAAY;;;AAqJrB,eAAe,YAAY,CAAC"}
@@ -14,13 +14,14 @@ const defaultProps = {
14
14
  className: '',
15
15
  };
16
16
  function SupportLevel(props) {
17
- const { product, caseNumber, severity, entitlementSla, ownersEntitlements, caseType } = useCaseSelector((state) => ({
17
+ const { product, caseNumber, severity, entitlementSla, ownersEntitlements, caseType, openShiftClusterSupportLevel, } = useCaseSelector((state) => ({
18
18
  product: state.caseDetails.product,
19
19
  caseNumber: state.caseDetails.caseNumber,
20
20
  severity: state.caseDetails.severity,
21
21
  entitlementSla: state.caseDetails.entitlementSla,
22
22
  ownersEntitlements: state.ownersEntitlements,
23
23
  caseType: state.caseDetails.caseType,
24
+ openShiftClusterSupportLevel: state.openShiftClusterSupportLevel,
24
25
  }), isEqual);
25
26
  const caseDispatch = useCaseDispatch();
26
27
  const { globalMetadataState: { allProducts }, } = useContext(GlobalMetadataStateContext);
@@ -42,6 +43,8 @@ function SupportLevel(props) {
42
43
  };
43
44
  const getSlaList = () => {
44
45
  var _a, _b;
46
+ if (openShiftClusterSupportLevel)
47
+ return [openShiftClusterSupportLevel];
45
48
  const entitledProduct = ((_b = (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult) !== null && _b !== void 0 ? _b : []).find((entitledProduct) => entitledProduct.product === product);
46
49
  if (entitledProduct && entitledProduct.serviceLevels) {
47
50
  return entitledProduct.serviceLevels.split(';') || [];
@@ -52,6 +55,8 @@ function SupportLevel(props) {
52
55
  };
53
56
  const getSelectedSla = () => {
54
57
  var _a, _b;
58
+ if (openShiftClusterSupportLevel)
59
+ return openShiftClusterSupportLevel;
55
60
  const entitledProduct = ((_b = (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult) !== null && _b !== void 0 ? _b : []).find((entitledProduct) => entitledProduct.product === product);
56
61
  // if sla is empty then it means either first time this component is rendered or product has changed.
57
62
  if (isEmpty(entitlementSla) && entitledProduct && entitledProduct.preferredServiceLevel) {
@@ -1 +1 @@
1
- {"version":3,"file":"NoClusterIDReasonSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/NoClusterIDReasonSelector.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAK/D,UAAU,MAAM;IACZ,uBAAuB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,4BAA4B,EAAE,MAAM,CAAC;IACrC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,QAAA,MAAM,yBAAyB,UAAW,MAAM,sBAqI/C,CAAC;AAEF,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
1
+ {"version":3,"file":"NoClusterIDReasonSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/NoClusterIDReasonSelector.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAM/D,UAAU,MAAM;IACZ,uBAAuB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,4BAA4B,EAAE,MAAM,CAAC;IACrC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,QAAA,MAAM,yBAAyB,UAAW,MAAM,sBA4J/C,CAAC;AAEF,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
@@ -1,4 +1,4 @@
1
- import { TextInputGroup, TextInputGroupMain } from '@patternfly/react-core';
1
+ import { TextInput, TextInputGroup, ValidatedOptions } from '@patternfly/react-core';
2
2
  import ExclamationCircleIcon from '@patternfly/react-icons/dist/js/icons/exclamation-circle-icon';
3
3
  import { LoadingIndicator, SingleSelectDropdown } from '@rh-support/components';
4
4
  import { fetchNoClusterIdReasonsMetadata, GlobalMetadataStateContext, useGlobalDispatchContext, } from '@rh-support/react-context';
@@ -7,11 +7,14 @@ import filter from 'lodash/filter';
7
7
  import map from 'lodash/map';
8
8
  import React, { useContext, useEffect, useState } from 'react';
9
9
  import { Trans, useTranslation } from 'react-i18next';
10
+ import { SESSION_NO_CLUSTER_REASON_LENGTH_LIMIT } from '../../reducers/CaseConstNTypes';
10
11
  import { PDFContext } from '../CaseEditView/PDFContainer';
11
12
  const NoClusterIDReasonSelector = (props) => {
13
+ var _a;
12
14
  const { t } = useTranslation();
13
15
  const [notRegistered, setNotRegistered] = useState(false);
14
16
  const [inputValue, setInputValue] = useState(props.noClusterIdReasonExplanation || '');
17
+ const [hasLargeReasonExplanation, setHasLargeReasonExplanation] = useState(false);
15
18
  const globalDispatch = useGlobalDispatchContext();
16
19
  const { globalMetadataState: { caseNoClusterIdReasons }, } = useContext(GlobalMetadataStateContext);
17
20
  const { isExportingPDF } = useContext(PDFContext);
@@ -35,6 +38,7 @@ const NoClusterIDReasonSelector = (props) => {
35
38
  };
36
39
  const handleInputChange = (_event, value) => {
37
40
  setInputValue(value);
41
+ setHasLargeReasonExplanation(value.length > SESSION_NO_CLUSTER_REASON_LENGTH_LIMIT);
38
42
  props.onReasonInputBoxChanged(value);
39
43
  };
40
44
  const getDropdownOptions = () => {
@@ -64,22 +68,26 @@ const NoClusterIDReasonSelector = (props) => {
64
68
  const registerMyClusterID = () => (React.createElement("a", { className: `show-target ${isExportingPDF ? 'hide-in-pdf' : ''}`, href: "https://console.redhat.com/openshift/register ", target: "_blank", rel: "noopener noreferrer" },
65
69
  React.createElement(Trans, null, "Register my Cluster ID")));
66
70
  return (React.createElement("div", { className: "form-group" },
67
- React.createElement("label", { id: titleId },
68
- React.createElement(Trans, null, "I don't have my Cluster ID, because:"),
69
- React.createElement("span", { className: `form-required ${isExportingPDF ? 'hide-in-pdf' : ''}`, "aria-hidden": true },
70
- ' ',
71
- "*")),
71
+ React.createElement("label", { id: titleId, style: {
72
+ display: 'flex',
73
+ justifyContent: 'space-between',
74
+ alignItems: 'center',
75
+ } },
76
+ React.createElement("div", null,
77
+ React.createElement(Trans, null, "I don't have my Cluster ID, because:"),
78
+ React.createElement("span", { className: `form-required ${isExportingPDF ? 'hide-in-pdf' : ''}`, "aria-hidden": true },
79
+ ' ',
80
+ "*")),
81
+ React.createElement("div", { className: "cluster-ID-counter" }, `${(_a = inputValue === null || inputValue === void 0 ? void 0 : inputValue.length) !== null && _a !== void 0 ? _a : 0} / ${SESSION_NO_CLUSTER_REASON_LENGTH_LIMIT}`)),
72
82
  React.createElement("div", { className: "no-cluster-id-reason-container" },
73
83
  React.createElement("div", { className: props.noClusterIdReason === 'Other' ? 'd-none' : '' },
74
84
  React.createElement(SingleSelectDropdown, { placeholder: t('Select an option or briefly describe your reason'), dataTrackingId: "no-openshift-cluster-id-reason", options: getDropdownOptions(), selected: getSelectedOption(), isDisabled: caseNoClusterIdReasons.isFetching || props.isDisabled, isLoading: caseNoClusterIdReasons.isFetching, isInvalid: props.isInValid, onSelect: handleReasonChange, "aria-labelledby": titleId, "aria-invalid": props.isInValid, "aria-describedby": "validate-reason-helper" })),
75
85
  props.noClusterIdReason === 'Other' && (React.createElement("div", { className: "text-input-wrapper" },
76
86
  React.createElement(TextInputGroup, null,
77
- React.createElement(TextInputGroupMain, { value: inputValue, onChange: handleInputChange, placeholder: t('Briefly describe your reason'), "aria-label": t('Other reason description') }))))),
87
+ React.createElement(TextInput, { value: inputValue, onChange: handleInputChange, placeholder: t('Briefly describe your reason'), "aria-label": t('Other reason description'), validated: hasLargeReasonExplanation ? ValidatedOptions.error : ValidatedOptions.default }))))),
78
88
  React.createElement(LoadingIndicator, { show: caseNoClusterIdReasons.isFetching, size: "xs" }),
79
- React.createElement("p", { id: "validate-reason-helper", className: `form-instructions ${props.isInValid ? 'form-invalid' : ''}` },
80
- React.createElement(React.Fragment, null,
81
- props.isInValid && React.createElement(ExclamationCircleIcon, { color: "#c9190b", className: "pf-v6-u-mr-sm" }),
82
- ' ',
83
- notRegistered ? (registerMyClusterID()) : (React.createElement(Trans, null, "Describing your reason can help us better understand and support your issue."))))));
89
+ React.createElement("p", { id: "validate-reason-helper", className: `form-instructions ${props.isInValid ? 'form-invalid' : ''}` }, notRegistered ? (registerMyClusterID()) : hasLargeReasonExplanation ? (React.createElement("span", { className: "form-instructions form-invalid pf-v6-u-danger-color-100 no-cluster-ID" }, t(`This reason exceeds ${SESSION_NO_CLUSTER_REASON_LENGTH_LIMIT} characters. Try shortening it.`))) : (React.createElement(React.Fragment, null,
90
+ props.isInValid && React.createElement(ExclamationCircleIcon, { color: "#c9190b", className: "pf-v6-u-mr-sm" }),
91
+ React.createElement(Trans, null, "Describing your reason can help us better understand and support your issue."))))));
84
92
  };
85
93
  export { NoClusterIDReasonSelector };
@@ -1 +1 @@
1
- {"version":3,"file":"OpenShiftClusterId.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenShiftClusterId.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAsB/D,eAAO,MAAM,oBAAoB,yBAShC,CAAC;AAEF,eAAO,MAAM,uBAAuB,yBAInC,CAAC;AAEF,eAAO,MAAM,4BAA4B,yBAYxC,CAAC;AAEF,eAAO,MAAM,qBAAqB,yBAIjC,CAAC;AAEF,UAAU,MAAM;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,qBA8S/C"}
1
+ {"version":3,"file":"OpenShiftClusterId.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenShiftClusterId.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAuB/D,eAAO,MAAM,oBAAoB,yBAShC,CAAC;AAEF,eAAO,MAAM,uBAAuB,yBAInC,CAAC;AAEF,eAAO,MAAM,4BAA4B,yBAYxC,CAAC;AAEF,eAAO,MAAM,qBAAqB,yBAIjC,CAAC;AAEF,UAAU,MAAM;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,qBAmT/C"}
@@ -18,6 +18,7 @@ import { useLocation } from 'react-router-dom';
18
18
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
19
19
  import { ClusterRecommendationsContext, ClusterRecommendationsDispatchContext, } from '../../context/ClusterRecommendationsContext';
20
20
  import { RouteContext } from '../../context/RouteContext';
21
+ import { SESSION_NO_CLUSTER_REASON_LENGTH_LIMIT } from '../../reducers/CaseConstNTypes';
21
22
  import { getUpdatedDescription } from '../../reducers/CaseHelpers';
22
23
  import { setCaseDetails, setCaseState } from '../../reducers/CaseReducer';
23
24
  import { fetchClusterRecommendations } from '../../reducers/ClusterRecommendationsReducer';
@@ -74,7 +75,7 @@ export function OpenShiftClusterId(props) {
74
75
  noClusterIdReasonExplanation: '',
75
76
  noClusterIdReason: '',
76
77
  });
77
- setCaseState(caseDispatch, { v3ClusterName: '' });
78
+ setCaseState(caseDispatch, { v3ClusterName: '', openShiftClusterSupportLevel: '' });
78
79
  };
79
80
  const clusterStateReset = () => {
80
81
  setSelectedReason('');
@@ -167,6 +168,7 @@ export function OpenShiftClusterId(props) {
167
168
  if (isEmpty(selectedId))
168
169
  return;
169
170
  resetClusterData();
171
+ setCaseState(caseDispatch, { openShiftClusterSupportLevel: selectedCluster === null || selectedCluster === void 0 ? void 0 : selectedCluster.support_level });
170
172
  if (selectedId === 'dont-have-id') {
171
173
  setDontKnowSelected(true);
172
174
  setSelectedReason(selectedId);
@@ -222,7 +224,10 @@ export function OpenShiftClusterId(props) {
222
224
  setCaseDetails(caseDispatch, { noClusterIdReason: reason });
223
225
  };
224
226
  const isInVaidNoClusterIdReason = isNextBtnClickedToShowValidationError &&
225
- (isEmpty(noClusterIdReason) || (noClusterIdReason === 'Other' && isEmpty(noClusterIdReasonExplanation.trim())));
227
+ (isEmpty(noClusterIdReason) ||
228
+ (noClusterIdReason === 'Other' &&
229
+ (isEmpty(noClusterIdReasonExplanation.trim()) ||
230
+ noClusterIdReasonExplanation.trim().length > SESSION_NO_CLUSTER_REASON_LENGTH_LIMIT)));
226
231
  if (!showClusterId)
227
232
  return null;
228
233
  return (React.createElement("div", { className: `${props.className ? props.className : ''}` },
@@ -11,6 +11,7 @@ interface IProps extends IDClassNameProps {
11
11
  isDisabled?: boolean;
12
12
  noClusterIdReasonExplanation?: string;
13
13
  openshiftDisplayName?: string;
14
+ setOpenshiftDisplayName?: (val: any) => void;
14
15
  }
15
16
  declare function OpenshiftDropdownV4(props: IProps): React.JSX.Element;
16
17
  export { OpenshiftDropdownV4 };
@@ -1 +1 @@
1
- {"version":3,"file":"OpenshiftDropdownV4.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenshiftDropdownV4.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAgB5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,KAA2D,MAAM,OAAO,CAAC;AAOhF,UAAU,MAAO,SAAQ,gBAAgB;IACrC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE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D,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAudzC;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -19,11 +19,12 @@ import { Trans, useTranslation } from 'react-i18next';
19
19
  import { getDisplayNameForCluster } from '../../utils/caseOpenshiftClusterIdUtils';
20
20
  import { PDFContext } from '../CaseEditView/PDFContainer';
21
21
  import CaseOpenShiftPopover from '../CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenShiftPopover';
22
- const createState = (external_cluster_id, display_name, openshift_version) => {
22
+ const createState = (external_cluster_id, display_name, openshift_version, support_level) => {
23
23
  return {
24
24
  display_name,
25
25
  external_cluster_id,
26
26
  openshift_version: openshift_version || '',
27
+ support_level,
27
28
  toString: () => display_name || '',
28
29
  compareTo: function (value) {
29
30
  const displayName = this.toString().toLowerCase();
@@ -39,7 +40,7 @@ function OpenshiftDropdownV4(props) {
39
40
  const abortControllerRef = useRef();
40
41
  const [clustersSelectOptions, setClustersSelectOptions] = useState([]);
41
42
  const [isOpen, setIsOpen] = useState(false);
42
- const [inputVal, setInputVal] = useState('');
43
+ const [inputVal, setInputVal] = useState(props.openshiftDisplayName);
43
44
  const [showArchivedClusters, setShowArchivedClusters] = useState(false);
44
45
  const [isFetchingClusters, setIsFetchingClusters] = useState(false);
45
46
  const [totalResultsNo, setTotalResultsNo] = useState(0);
@@ -149,7 +150,7 @@ function OpenshiftDropdownV4(props) {
149
150
  clusterOptions.push(React.createElement(SelectOption, { isDisabled: true, className: "pf-v6-u-font-weight-bold pf-v6-u-color-400", value: createState(domain, domain), key: domain + index }, domain));
150
151
  clustersResponseGrouped[domain] &&
151
152
  clustersResponseGrouped[domain].forEach((cluster, i) => {
152
- clusterOptions.push(React.createElement(SelectOption, { key: cluster.external_cluster_id, value: createState(cluster.external_cluster_id, getDisplayNameForCluster(cluster) || cluster.external_cluster_id, cluster.openshift_version) }, getDisplayNameForCluster(cluster) || cluster.external_cluster_id));
153
+ clusterOptions.push(React.createElement(SelectOption, { key: cluster.external_cluster_id, value: createState(cluster.external_cluster_id, getDisplayNameForCluster(cluster) || cluster.external_cluster_id, cluster === null || cluster === void 0 ? void 0 : cluster.openshift_version, cluster === null || cluster === void 0 ? void 0 : cluster.support_level), isDisabled: (cluster === null || cluster === void 0 ? void 0 : cluster.support_level) === 'Self-Support' }, getDisplayNameForCluster(cluster) || cluster.external_cluster_id));
153
154
  });
154
155
  clusterOptions.push(React.createElement(Divider, { component: "div", key: index + domain }));
155
156
  });
@@ -174,7 +175,7 @@ function OpenshiftDropdownV4(props) {
174
175
  try {
175
176
  const clustersResponse = yield cloud.getAccountClustersSubscription({
176
177
  search: `external_cluster_id='${clusterId.trim()}'`,
177
- fields: 'external_cluster_id,display_name,status,metrics.openshift_version',
178
+ fields: 'external_cluster_id,display_name,status,metrics.openshift_version,support_level',
178
179
  });
179
180
  setIsFetchingClusters(false);
180
181
  return (((_a = clustersResponse.items.map((item) => {
@@ -183,6 +184,7 @@ function OpenshiftDropdownV4(props) {
183
184
  display_name: item.display_name,
184
185
  external_cluster_id: item.external_cluster_id,
185
186
  openshift_version: ((_b = (_a = item === null || item === void 0 ? void 0 : item.metrics) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.openshift_version) || '',
187
+ support_level: item === null || item === void 0 ? void 0 : item.support_level,
186
188
  });
187
189
  })) === null || _a === void 0 ? void 0 : _a[0]) || {});
188
190
  }
@@ -216,7 +218,7 @@ function OpenshiftDropdownV4(props) {
216
218
  page,
217
219
  size: PER_PAGE,
218
220
  search: `external_cluster_id!='' ${clusterStatus} ${searchPhrase}`,
219
- fields: 'external_cluster_id,display_name,status,metrics.openshift_version,console_url',
221
+ fields: 'external_cluster_id,display_name,status,metrics.openshift_version,console_url,support_level',
220
222
  }, controller.signal);
221
223
  setInCache(`showArchived=${showArchivedClusters}input=${search}p=${page}`, clustersResponse);
222
224
  }
@@ -230,6 +232,7 @@ function OpenshiftDropdownV4(props) {
230
232
  console_url: (item === null || item === void 0 ? void 0 : item.console_url) && (item === null || item === void 0 ? void 0 : item.console_url) !== null
231
233
  ? item.console_url.split('.').slice(4).join('.')
232
234
  : '',
235
+ support_level: item === null || item === void 0 ? void 0 : item.support_level,
233
236
  });
234
237
  });
235
238
  return {
@@ -254,7 +257,8 @@ function OpenshiftDropdownV4(props) {
254
257
  props.openshiftClusterIDState !== 'v3-cluster' &&
255
258
  isEmpty(props.openshiftDisplayName)) {
256
259
  const fetchedCluster = yield fetchAClusterIdDetails(props.openshiftClusterIDState);
257
- props.onClusterIdStateUpdate(Object.assign(Object.assign({}, fetchedCluster), { display_name: getDisplayNameForCluster(fetchedCluster) }));
260
+ props.setOpenshiftDisplayName &&
261
+ props.setOpenshiftDisplayName(getDisplayNameForCluster(fetchedCluster) || props.openshiftClusterIDState);
258
262
  }
259
263
  });
260
264
  getClusterDetails();
@@ -1 +1 @@
1
- {"version":3,"file":"AskRedHat.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/AskRedHat.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAkCvE,UAAU,MAAM;IACZ,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAClC;AAED,eAAO,MAAM,SAAS,0BAA2B,MAAM,sBAydtD,CAAC"}
1
+ {"version":3,"file":"AskRedHat.d.ts","sourceRoot":"","sources":["../../../../src/components/TroubleshootSection/AskRedHat.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAkCvE,UAAU,MAAM;IACZ,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;CAClC;AAED,eAAO,MAAM,SAAS,0BAA2B,MAAM,sBAwdtD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useIsSectionValid.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/useIsSectionValid.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAuB/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAKnE,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,gBAAgB;;;;;EAmU9D"}
1
+ {"version":3,"file":"useIsSectionValid.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/useIsSectionValid.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAuB/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAMnE,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,gBAAgB;;;;;EAmU9D"}
@@ -16,11 +16,12 @@ import React, { useContext, useEffect, useState } from 'react';
16
16
  import { Trans } from 'react-i18next';
17
17
  import { useCaseSelector } from '../../context/CaseContext';
18
18
  import { RecommendationStateContext } from '../../context/RecommendationContext';
19
- import { RouteContext } from '../../context/RouteContext';
19
+ import { RouteContext, useRouteDispatchContext } from '../../context/RouteContext';
20
20
  import { TCStateContext } from '../../context/TopContentContext';
21
21
  import { CASE_DEATILS_ENVIRONMENT_LIMIT, CASE_REFERENCE_NUMBER_LIMIT, CONTACT_INFO_24X7_LIMIT, HOSTNAME_LENGTH_LIMIT, ISSUE_SUMMARY_LENGTH_LIMIT, KTQUESTION_MAX_LIMIT, TITLE_SUMMARY_LENGTH_LIMIT, } from '../../reducers/CaseConstNTypes';
22
22
  import { isCaseInformationSectionValid, isCaseManagementStateValid, isCaseStateValid, isClusterIDValid, isIdeaCaseStateValid, } from '../../reducers/CaseHelpers';
23
23
  import { AppRouteSections } from '../../reducers/RouteConstNTypes';
24
+ import { setNoValidEntitlement } from '../../reducers/RouteReducer';
24
25
  import { AttachmentStateContext } from './fileUpload/reducer/AttachmentReducerContext';
25
26
  export function useIsSectionValid(sectionName) {
26
27
  var _a, _b;
@@ -44,6 +45,7 @@ export function useIsSectionValid(sectionName) {
44
45
  ssoUsername: state.selectedOwner.data.ssoUsername,
45
46
  manageSupportCases: state.selectedOwner.data.manageSupportCases,
46
47
  }), isEqual);
48
+ const routeDispatch = useRouteDispatchContext();
47
49
  const [isEntitlement, setIsEntitlement] = useState(null);
48
50
  useEffect(() => {
49
51
  const fetchContactDetails = () => __awaiter(this, void 0, void 0, function* () {
@@ -52,15 +54,17 @@ export function useIsSectionValid(sectionName) {
52
54
  try {
53
55
  const response = yield contacts.getSFDCContactBySso(ssoUsername);
54
56
  setIsEntitlement((_a = response === null || response === void 0 ? void 0 : response.isEntitled) !== null && _a !== void 0 ? _a : null);
57
+ setNoValidEntitlement(routeDispatch, !(response === null || response === void 0 ? void 0 : response.isEntitled));
55
58
  }
56
59
  catch (error) {
57
60
  console.error('Error fetching contact details:', error);
58
61
  setIsEntitlement(null);
62
+ setNoValidEntitlement(routeDispatch, null);
59
63
  }
60
64
  }
61
65
  });
62
66
  fetchContactDetails();
63
- }, [ssoUsername]);
67
+ }, [ssoUsername, routeDispatch]);
64
68
  //&seSessionId=8e8960ac-680b-443e-bf67-9e13f2acd64e
65
69
  const isATestvariation = ABTestVariation === 'A';
66
70
  const isBTestvariation = ABTestVariation === 'B' || isEmpty(ABTestVariation);
@@ -253,12 +257,7 @@ export function useIsSectionValid(sectionName) {
253
257
  return '';
254
258
  switch (sectionNameLocal) {
255
259
  case AppRouteSections.RESOURCES:
256
- if (isCaseCreate === false) {
257
- return getSupportSectionError();
258
- }
259
- else {
260
- return recommendationSectionError();
261
- }
260
+ return recommendationSectionError();
262
261
  case AppRouteSections.GET_SUPPORT:
263
262
  return getSupportSectionError();
264
263
  default:
@@ -1 +1 @@
1
- {"version":3,"file":"WizardNavigation.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/WizardNavigation.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAQvD,OAAO,EAAoB,eAAe,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAM3G,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB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,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,sBAAsB,CAAC,EAAE,MAAM,IAAI,CAAC;IACpC,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAGD,iBAAS,gBAAgB,CAAC,KAAK,EAAE,MAAM,qBA8XtC;kBA9XQ,gBAAgB;;;AAgYzB,eAAe,gBAAgB,CAAC"}
@@ -36,7 +36,7 @@ function WizardNavigation(props) {
36
36
  const { recommendationState } = useContext(RecommendationStateContext);
37
37
  const { routeState: { activeSection, isNextBtnClickedToShowValidationError, noValidEntitlement, isSearchIntent, isCaseCreate, }, } = useContext(RouteContext);
38
38
  const { globalMetadataState: { loggedInUsersAccount, allProducts, navBarRef }, } = useContext(GlobalMetadataStateContext);
39
- const { caseState, ABTestVariation, issue, summary, product, version, caseType } = useCaseSelector((state) => ({
39
+ const { caseState, ABTestVariation, issue, summary, product, version, caseType, manageSupportCases } = useCaseSelector((state) => ({
40
40
  caseState: state,
41
41
  issue: state.caseDetails.issue,
42
42
  summary: state.caseDetails.summary,
@@ -44,6 +44,7 @@ function WizardNavigation(props) {
44
44
  product: state.caseDetails.product,
45
45
  version: state.caseDetails.version,
46
46
  caseType: state.caseDetails.caseType,
47
+ manageSupportCases: state.selectedOwner.data.manageSupportCases,
47
48
  }), isEqual);
48
49
  const isATestvariation = ABTestVariation === 'A';
49
50
  const isBTestvariation = ABTestVariation === 'B' || isEmpty(ABTestVariation);
@@ -230,7 +231,8 @@ function WizardNavigation(props) {
230
231
  (!isEntitledProductLocal && props.activeStep.nextButtonLabel === 'Get support') ||
231
232
  props.activeStep.nextButtonLabel === 'Troubleshoot' ||
232
233
  (!isSectionValidFn(props.activeStep.id) && isNextBtnClickedToShowValidationError) ||
233
- noValidEntitlement ||
234
+ (noValidEntitlement && props.activeStep.id != AppRouteSections.TROUBLESHOOT) ||
235
+ (!manageSupportCases && props.activeStep.id === AppRouteSections.GET_SUPPORT) ||
234
236
  recommendationState.isLoadingRecommendations;
235
237
  return value;
236
238
  }
@@ -242,7 +244,8 @@ function WizardNavigation(props) {
242
244
  (!isEntitledProductLocal && props.activeStep.nextButtonLabel === 'Get support') ||
243
245
  props.activeStep.nextButtonLabel === 'Troubleshoot' ||
244
246
  (!isSectionValidFn(props.activeStep.id) && isNextBtnClickedToShowValidationError) ||
245
- noValidEntitlement ||
247
+ (noValidEntitlement && props.activeStep.id != AppRouteSections.TROUBLESHOOT) ||
248
+ (!manageSupportCases && props.activeStep.id === AppRouteSections.GET_SUPPORT) ||
246
249
  recommendationState.isLoadingRecommendations;
247
250
  return value;
248
251
  }
@@ -252,7 +255,8 @@ function WizardNavigation(props) {
252
255
  isEmpty(issue) ||
253
256
  (!isEntitledProductLocal && props.activeStep.nextButtonLabel === 'Get support') ||
254
257
  (!isSectionValidFn(props.activeStep.id) && isNextBtnClickedToShowValidationError) ||
255
- noValidEntitlement ||
258
+ (noValidEntitlement && props.activeStep.id != AppRouteSections.TROUBLESHOOT) ||
259
+ (!manageSupportCases && props.activeStep.id === AppRouteSections.GET_SUPPORT) ||
256
260
  recommendationState.isLoadingRecommendations;
257
261
  return value;
258
262
  }