@rh-support/troubleshoot 2.0.9 → 2.1.5

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 (107) hide show
  1. package/lib/esm/components/AccountInfo/AccountSelector.d.ts.map +1 -1
  2. package/lib/esm/components/AccountInfo/AccountSelector.js +44 -5
  3. package/lib/esm/components/AccountInfo/OwnerSelector.js +2 -2
  4. package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
  5. package/lib/esm/components/CaseEditView/CaseDetailsAside.js +5 -3
  6. package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
  7. package/lib/esm/components/CaseEditView/CaseOverview/index.js +1 -1
  8. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +1 -1
  9. package/lib/esm/components/CaseEditView/ShareCase/PartnerShare.d.ts.map +1 -1
  10. package/lib/esm/components/CaseEditView/ShareCase/PartnerShare.js +6 -1
  11. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
  12. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +1 -2
  13. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.js +1 -1
  14. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/useCustomEmails.js +1 -1
  15. package/lib/esm/components/CaseInformation/CaseGroup.js +2 -2
  16. package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
  17. package/lib/esm/components/CaseInformation/CaseInformation.js +1 -8
  18. package/lib/esm/components/CaseInformation/Description.d.ts.map +1 -1
  19. package/lib/esm/components/CaseInformation/Description.js +4 -2
  20. package/lib/esm/components/CaseInformation/OpenCaseIssue.js +2 -2
  21. package/lib/esm/components/CaseInformation/Severity.js +1 -1
  22. package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
  23. package/lib/esm/components/CaseManagement/CaseManagement.js +2 -9
  24. package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts +5 -1
  25. package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts.map +1 -1
  26. package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +7 -7
  27. package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.d.ts.map +1 -1
  28. package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.js +4 -1
  29. package/lib/esm/components/IdeaInformation/IdeaInformtion.d.ts.map +1 -1
  30. package/lib/esm/components/IdeaInformation/IdeaInformtion.js +1 -8
  31. package/lib/esm/components/ImproveCase/KtQuestions.js +2 -2
  32. package/lib/esm/components/Issue/Issue.d.ts.map +1 -1
  33. package/lib/esm/components/Issue/Issue.js +1 -2
  34. package/lib/esm/components/OpenCase/OpenCase.d.ts.map +1 -1
  35. package/lib/esm/components/OpenCase/OpenCase.js +2 -9
  36. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +2 -2
  37. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  38. package/lib/esm/components/ProductSelector/AllProductsSelector.js +1 -1
  39. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts +1 -1
  40. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
  41. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +3 -3
  42. package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts +1 -1
  43. package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
  44. package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +3 -3
  45. package/lib/esm/components/ProductSelector/ProductSelector.js +1 -2
  46. package/lib/esm/components/ProductSelector/ProductSelectorLoader.d.ts +1 -2
  47. package/lib/esm/components/ProductSelector/ProductSelectorLoader.d.ts.map +1 -1
  48. package/lib/esm/components/ProductSelector/ProductSelectorLoader.js +12 -19
  49. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +3 -3
  50. package/lib/esm/components/Recommendations/ClusterRecommendationToast.d.ts.map +1 -1
  51. package/lib/esm/components/Recommendations/ClusterRecommendationToast.js +2 -1
  52. package/lib/esm/components/Recommendations/ClusterRecommendations.js +1 -1
  53. package/lib/esm/components/SessionRestore/RestoreLastSessionModal.js +1 -1
  54. package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
  55. package/lib/esm/components/SessionRestore/SessionRestore.js +4 -9
  56. package/lib/esm/components/SubmitCase/ResubmitToast.js +1 -1
  57. package/lib/esm/components/SubmitCase/SubmitCase.js +1 -1
  58. package/lib/esm/components/Suggestions/TopContent.js +1 -1
  59. package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +2 -2
  60. package/lib/esm/components/shared/useIsSectionValid.d.ts +1 -1
  61. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  62. package/lib/esm/components/shared/useIsSectionValid.js +5 -24
  63. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
  64. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +40 -80
  65. package/lib/esm/components/wizardLayout/MainSection.d.ts +5 -3
  66. package/lib/esm/components/wizardLayout/MainSection.d.ts.map +1 -1
  67. package/lib/esm/components/wizardLayout/MainSection.js +4 -4
  68. package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
  69. package/lib/esm/components/wizardLayout/WizardAside.js +3 -10
  70. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  71. package/lib/esm/components/wizardLayout/WizardLayout.js +31 -42
  72. package/lib/esm/components/wizardLayout/WizardMain.d.ts +2 -3
  73. package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
  74. package/lib/esm/components/wizardLayout/WizardMain.js +43 -163
  75. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts +7 -3
  76. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  77. package/lib/esm/components/wizardLayout/WizardNavigation.js +46 -90
  78. package/lib/esm/components/wizardLayout/index.d.ts.map +1 -1
  79. package/lib/esm/components/wizardLayout/index.js +2 -10
  80. package/lib/esm/context/RootTroubleshootProvider.d.ts.map +1 -1
  81. package/lib/esm/context/RootTroubleshootProvider.js +7 -9
  82. package/lib/esm/css/app.css +0 -450
  83. package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
  84. package/lib/esm/hooks/useResetCaseCreate.js +0 -4
  85. package/lib/esm/hooks/useWizard.d.ts +4 -0
  86. package/lib/esm/hooks/useWizard.d.ts.map +1 -0
  87. package/lib/esm/hooks/useWizard.js +128 -0
  88. package/lib/esm/reducers/RouteConstNTypes.d.ts +21 -1
  89. package/lib/esm/reducers/RouteConstNTypes.d.ts.map +1 -1
  90. package/lib/esm/reducers/RouteConstNTypes.js +43 -0
  91. package/lib/esm/reducers/RouteReducer.d.ts +13 -47
  92. package/lib/esm/reducers/RouteReducer.d.ts.map +1 -1
  93. package/lib/esm/reducers/RouteReducer.js +36 -165
  94. package/lib/esm/scss/_main.scss +67 -786
  95. package/lib/esm/utils/routeUtils.d.ts +3 -9
  96. package/lib/esm/utils/routeUtils.d.ts.map +1 -1
  97. package/lib/esm/utils/routeUtils.js +14 -41
  98. package/package.json +14 -25
  99. package/lib/esm/components/wizardLayout/WizardProgress.d.ts +0 -13
  100. package/lib/esm/components/wizardLayout/WizardProgress.d.ts.map +0 -1
  101. package/lib/esm/components/wizardLayout/WizardProgress.js +0 -108
  102. package/lib/esm/context/AppMetadataContext.d.ts +0 -11
  103. package/lib/esm/context/AppMetadataContext.d.ts.map +0 -1
  104. package/lib/esm/context/AppMetadataContext.js +0 -13
  105. package/lib/esm/reducers/AppMetadataReducer.d.ts +0 -28
  106. package/lib/esm/reducers/AppMetadataReducer.d.ts.map +0 -1
  107. package/lib/esm/reducers/AppMetadataReducer.js +0 -28
@@ -1 +1 @@
1
- {"version":3,"file":"AccountSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/AccountSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AAKnC,OAAO,EAAE,gBAAgB,EAAW,MAAM,0BAA0B,CAAC;AAYrE,UAAU,MAAO,SAAQ,gBAAgB;CAAG;AAE5C,eAAO,MAAM,YAAY,EAAE,MAG1B,CAAC;AAEF,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,eA6HrC;kBA7HQ,eAAe;;;AAiIxB,OAAO,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"AccountSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/AccountSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AAOnC,OAAO,EAAE,gBAAgB,EAAW,MAAM,0BAA0B,CAAC;AAcrE,UAAU,MAAO,SAAQ,gBAAgB;CAAG;AAE5C,eAAO,MAAM,YAAY,EAAE,MAG1B,CAAC;AAEF,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,eAsKrC;kBAtKQ,eAAe;;;AA0KxB,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -1,14 +1,27 @@
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 './css/accountSelector.css';
11
+ import { accounts } from '@cee-eng/hydrajs';
2
12
  import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
13
+ import { AlertMessage, AlertType } from '@rh-support/components';
3
14
  import { AccountSelectorInternal, GlobalMetadataStateContext } from '@rh-support/react-context';
4
15
  import { AbilityContext, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
5
16
  import isArray from 'lodash/isArray';
6
17
  import isEmpty from 'lodash/isEmpty';
7
18
  import isEqual from 'lodash/isEqual';
8
- import React, { useContext } from 'react';
19
+ import React, { useContext, useEffect, useState } from 'react';
9
20
  import { Trans, useTranslation } from 'react-i18next';
10
21
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
22
+ import { useRouteDispatchContext } from '../../context/RouteContext';
11
23
  import { clearSelectedAccount, setCaseAccountNumber } from '../../reducers/CaseReducer';
24
+ import { setNoValidEntitlement } from '../../reducers/RouteReducer';
12
25
  import { ManagedAccountsDropdown } from './ManagedAccountsDropdown';
13
26
  export const defaultProps = {
14
27
  id: '',
@@ -16,12 +29,14 @@ export const defaultProps = {
16
29
  };
17
30
  function AccountSelector(props) {
18
31
  var _a;
32
+ const [showNotEntitledMessage, setShowNotEntitledMessage] = useState(false);
19
33
  const { accountNumber, selectedAccountDetails } = useCaseSelector((state) => ({
20
34
  accountNumber: state.caseDetails.accountNumberRef,
21
35
  selectedAccountDetails: state.selectedAccountDetails,
22
36
  }), isEqual);
23
37
  const isSelectedAccountSubscriptionAbused = ((_a = selectedAccountDetails === null || selectedAccountDetails === void 0 ? void 0 : selectedAccountDetails.data) === null || _a === void 0 ? void 0 : _a.subscriptionAbuse) || false;
24
38
  const caseDispatch = useCaseDispatch();
39
+ const routeDispatch = useRouteDispatchContext();
25
40
  const { globalMetadataState: { bookmarkedGroupAccounts, loggedInUserRights, managedAccounts, loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
26
41
  const { t } = useTranslation();
27
42
  /** Various Abilities */
@@ -30,7 +45,7 @@ function AccountSelector(props) {
30
45
  const canBookmarkAccounts = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.BOOKMARK_ACCOUNTS);
31
46
  const canUseFindMyAccount = loggedInUserRights.data.isAccountDifferentFromLoggedInAccount(accountNumber);
32
47
  // Account Change Handler
33
- const onAccountChange = (account) => {
48
+ const onAccountChange = (account) => __awaiter(this, void 0, void 0, function* () {
34
49
  if (selectedAccountDetails.data.accountNumber === account.accountNumber)
35
50
  return;
36
51
  if (isEmpty(account === null || account === void 0 ? void 0 : account.accountNumber)) {
@@ -38,7 +53,7 @@ function AccountSelector(props) {
38
53
  return;
39
54
  }
40
55
  setCaseAccountNumber(caseDispatch, account.accountNumber, loggedInUserRights.data.isAccountSameAsLoggedInAccount(account.accountNumber), loggedInUsersAccount.data);
41
- };
56
+ });
42
57
  const onInternalAccountSelect = (accounts) => {
43
58
  if (!isArray(accounts))
44
59
  return;
@@ -56,14 +71,38 @@ function AccountSelector(props) {
56
71
  name: loggedInUserRights.data.getAccountName(),
57
72
  });
58
73
  };
59
- if (isEmpty(loggedInUserRights.data))
60
- return React.createElement(React.Fragment, null);
61
74
  const selectedAccount = {
62
75
  name: selectedAccountDetails.data.name,
63
76
  accountNumber: selectedAccountDetails.data.accountNumber,
64
77
  subscriptionAbuse: selectedAccountDetails.data.subscriptionAbuse,
65
78
  };
79
+ // When internal user wants to open a case for a customer but
80
+ // customer account doesn't have entitlement, we show an error
81
+ useEffect(() => {
82
+ const getAccountEntitlement = () => __awaiter(this, void 0, void 0, function* () {
83
+ setShowNotEntitledMessage(false);
84
+ try {
85
+ const res = yield accounts.getAccountEntitlementByInternalUser(selectedAccountDetails.data.accountNumber);
86
+ if (isEmpty(res)) {
87
+ setShowNotEntitledMessage(true);
88
+ setNoValidEntitlement(routeDispatch, true);
89
+ }
90
+ }
91
+ catch (e) {
92
+ console.log(e);
93
+ }
94
+ });
95
+ if (loggedInUserRights.data.isInternal() &&
96
+ selectedAccountDetails.data.accountNumber &&
97
+ selectedAccountDetails.data.accountNumber !== loggedInUsersAccount.data.accountNumber) {
98
+ getAccountEntitlement();
99
+ }
100
+ // eslint-disable-next-line react-hooks/exhaustive-deps
101
+ }, [selectedAccountDetails.data.accountNumber, loggedInUserRights.data, loggedInUsersAccount.data]);
102
+ if (isEmpty(loggedInUserRights.data))
103
+ return React.createElement(React.Fragment, null);
66
104
  return (React.createElement("div", { id: props.id, className: `form-group ${props.className}` },
105
+ React.createElement(AlertMessage, { show: showNotEntitledMessage, variant: AlertType.DANGER, isInline: true, title: "The selected account dosn't have entitlement", className: "pf-u-mb-lg" }),
67
106
  React.createElement("div", { className: "account-selector-label-wrapper pf-u-display-flex" },
68
107
  React.createElement("label", { htmlFor: "account-selector" },
69
108
  React.createElement(Trans, null, "Account"),
@@ -35,7 +35,7 @@ function OwnerSelector(props) {
35
35
  selectedCaseGroupUsers: state.selectedCaseGroupUsers,
36
36
  isCaseOwnerUpdating: state.isCaseOwnerUpdating,
37
37
  }), isEqual);
38
- const { routeState: { showValidationErrorAlert }, } = useContext(RouteContext);
38
+ const { routeState: { isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
39
39
  const caseDispatch = useCaseDispatch();
40
40
  const { globalMetadataState: { loggedInUserRights, loggedInUser }, } = useContext(GlobalMetadataStateContext);
41
41
  const previousAccountNumber = usePrevious(accountNumber);
@@ -212,6 +212,6 @@ function OwnerSelector(props) {
212
212
  React.createElement(Trans, null, "Owner"),
213
213
  React.createElement(ValueChangedIcon, { afterLocalChange: afterLocalChange, comparator: ownerComparator, isLocalChange: localOwnerChange, value: selectedOwner.data, getTooltipContent: getChangedValueTooltip(() => CaseValuesToWatch.owner, (v) => v.fullNameCustom) }),
214
214
  React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
215
- showUsersWithSelectedGroupAccess ? (React.createElement(Typeahead, { id: "get-support-owner", className: "react-select-custom", clearButton: true, isLoading: selectedCaseGroupUsers.isFetching || isCaseOwnerUpdating, options: usersWithGroupAccess, selected: !isEmpty(selectedOwner.data) ? [selectedOwner.data] : [], onChange: onCustomerContactSelect, labelKey: getHydraContactLabel, placeholder: t(`Search by name or username`), disabled: selectedCaseGroupUsers.isFetching || isCaseOwnerUpdating, renderMenuItemChildren: renderMenuItemChildren, "data-tracking-id": "get-support-owner" })) : (React.createElement(CaseContactsSelectorExternal, { loggedInUserRights: loggedInUserRights.data, selectedAccountNumber: accountNumber, selected: !isEmpty(selectedOwner.data) ? [selectedOwner.data] : [], onChange: onCustomerContactSelect, placeholder: t(`Search by name or username`), clearButton: true, id: "get-support-owner", name: "get-support-owner", className: "react-select-custom", isUpdating: isCaseOwnerUpdating, isInvalid: showValidationErrorAlert && isEmpty(selectedOwner.data) }))));
215
+ showUsersWithSelectedGroupAccess ? (React.createElement(Typeahead, { id: "get-support-owner", className: "react-select-custom", clearButton: true, isLoading: selectedCaseGroupUsers.isFetching || isCaseOwnerUpdating, options: usersWithGroupAccess, selected: !isEmpty(selectedOwner.data) ? [selectedOwner.data] : [], onChange: onCustomerContactSelect, labelKey: getHydraContactLabel, placeholder: t(`Search by name or username`), disabled: selectedCaseGroupUsers.isFetching || isCaseOwnerUpdating, renderMenuItemChildren: renderMenuItemChildren, "data-tracking-id": "get-support-owner" })) : (React.createElement(CaseContactsSelectorExternal, { loggedInUserRights: loggedInUserRights.data, selectedAccountNumber: accountNumber, selected: !isEmpty(selectedOwner.data) ? [selectedOwner.data] : [], onChange: onCustomerContactSelect, placeholder: t(`Search by name or username`), clearButton: true, id: "get-support-owner", name: "get-support-owner", className: "react-select-custom", isUpdating: isCaseOwnerUpdating, isInvalid: isNextBtnClickedToShowValidationError && isEmpty(selectedOwner.data) }))));
216
216
  }
217
217
  export { OwnerSelector };
@@ -1 +1 @@
1
- {"version":3,"file":"CaseDetailsAside.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsAside.tsx"],"names":[],"mappings":"AA6BA,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAMD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,eA+T7C"}
1
+ {"version":3,"file":"CaseDetailsAside.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/CaseDetailsAside.tsx"],"names":[],"mappings":"AA8BA,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAMD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,eAiU7C"}
@@ -18,7 +18,7 @@ import { ErrorBoundary, ToastNotification, useBreakpoint, useForceUpdate } from
18
18
  import { GlobalMetadataDispatchContext, toggleViewAsCustomerFlag, useGlobalStateContext, useUserPreferences, } from '@rh-support/react-context';
19
19
  import { ability, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
20
20
  import { scrollIntoView } from '@rh-support/utils';
21
- import { isEmpty } from 'lodash';
21
+ import isEmpty from 'lodash/isEmpty';
22
22
  import isEqual from 'lodash/isEqual';
23
23
  import React, { useContext, useEffect, useRef, useState } from 'react';
24
24
  import { Trans, useTranslation } from 'react-i18next';
@@ -28,6 +28,7 @@ import { useCaseDetailsPageStateContext } from '../../context/CaseDetailsPageCon
28
28
  import { useRecommendationStateContext } from '../../context/RecommendationContext';
29
29
  import { ActiveCustomerEscalation } from './ActiveCustomerEscalation';
30
30
  import { CaseSolutions } from './CaseSolutions';
31
+ import { PDFContext } from './PDFContainer';
31
32
  import { RemoteSessionAgreement } from './RequestRemoteSession';
32
33
  export function CaseDetailsAside(props) {
33
34
  var _a;
@@ -74,6 +75,7 @@ export function CaseDetailsAside(props) {
74
75
  const { getOriginalCaseView, updateOriginalCaseView } = useUserPreferences();
75
76
  const [viewAsInternalPref, setViewAsInternalPref] = useState();
76
77
  const [isDefaultBoxChecked, setIsDefaultBoxChecked] = useState(true);
78
+ const { isExportingPDF } = useContext(PDFContext);
77
79
  useEffect(() => {
78
80
  const userPreferredCaseView = () => __awaiter(this, void 0, void 0, function* () {
79
81
  try {
@@ -161,8 +163,8 @@ export function CaseDetailsAside(props) {
161
163
  return t('View internal information available to Red Hat associates only.');
162
164
  }
163
165
  };
164
- return (React.createElement("aside", { className: `grid-aside ${isSideBarExpanded ? '' : 'sidebar-collapsed'}` },
165
- React.createElement("pfe-collapse-toggle", { "aria-controls": "case-details-aside-content", onClick: onToggleAside }, isSideBarExpanded ? (React.createElement("div", { className: "sidebar-header" },
166
+ return (React.createElement("aside", { className: `grid-aside ${isSideBarExpanded ? '' : 'sidebar-collapsed'} ` },
167
+ React.createElement("pfe-collapse-toggle", { "aria-controls": "case-details-aside-content", onClick: onToggleAside }, isSideBarExpanded ? (React.createElement("div", { className: `sidebar-header ${isExportingPDF ? 'hide-in-pdf' : ''}` },
166
168
  React.createElement(Button, { variant: "link", isInline: true, title: t('Collapse sidebar') },
167
169
  React.createElement("span", null,
168
170
  React.createElement(Trans, null, "Collapse")),
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/index.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAA8D,MAAM,OAAO,CAAC;AA6BnF,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CACnD;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,MAAM,eAyejD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/index.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAA8D,MAAM,OAAO,CAAC;AA6BnF,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CACnD;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,MAAM,eA0ejD"}
@@ -236,7 +236,7 @@ export default function CaseOverview(props) {
236
236
  props.caseNumber),
237
237
  React.createElement("div", null,
238
238
  exportPDFButton(props.caseNumber),
239
- React.createElement(Button, Object.assign({ className: "pf-u-ml-md", isDisabled: !canManageCase || (caseOverviewState.caseStatusUpdating && isCaseUpdating) }, (caseOverviewState.caseStatusUpdating &&
239
+ React.createElement(Button, Object.assign({ className: `pf-u-ml-md ${isExportingPDF ? 'hide-in-pdf' : ''}`, isDisabled: !canManageCase || (caseOverviewState.caseStatusUpdating && isCaseUpdating) }, (caseOverviewState.caseStatusUpdating &&
240
240
  isCaseUpdating && {
241
241
  isLoading: true,
242
242
  }), { onClick: () => (isCaseInOpenState ? onCaseClose() : onCaseReopen()), variant: isCaseInOpenState ? ButtonVariant.secondary : ButtonVariant.tertiary, "data-tracking-id": isCaseInOpenState
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import { Button, ButtonVariant, Form, FormGroup, Modal, ModalVariant, Select, SelectOption, TextArea, } from '@patternfly/react-core';
11
11
  import ExclamationCircleIcon from '@patternfly/react-icons/dist/js/icons/exclamation-circle-icon';
12
12
  import { formatDateTime } from '@rh-support/utils';
13
- import { isEmpty } from 'lodash';
13
+ import isEmpty from 'lodash/isEmpty';
14
14
  import React, { useState } from 'react';
15
15
  import { Trans, useTranslation } from 'react-i18next';
16
16
  import { CaseStatusEnum } from '../../../constants/caseDetailsConstants';
@@ -1 +1 @@
1
- {"version":3,"file":"PartnerShare.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/ShareCase/PartnerShare.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAKvD,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;IAChC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,eAwH7C"}
1
+ {"version":3,"file":"PartnerShare.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/ShareCase/PartnerShare.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAKvD,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;IAChC,iBAAiB,EAAE,OAAO,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,eAwH7C"}
@@ -11,8 +11,13 @@ import { accounts, kase } from '@cee-eng/hydrajs';
11
11
  import { ToastNotification } from '@rh-support/components';
12
12
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
13
13
  import { ability, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
14
- import { filter, find, get, isEmpty, map, merge } from 'lodash';
14
+ import filter from 'lodash/filter';
15
+ import find from 'lodash/find';
16
+ import get from 'lodash/get';
17
+ import isEmpty from 'lodash/isEmpty';
15
18
  import isEqual from 'lodash/isEqual';
19
+ import map from 'lodash/map';
20
+ import merge from 'lodash/merge';
16
21
  import React, { useContext, useEffect, useState } from 'react';
17
22
  import { Typeahead } from 'react-bootstrap-typeahead';
18
23
  import { Trans, useTranslation } from 'react-i18next';
@@ -1 +1 @@
1
- {"version":3,"file":"CaseDetailsManagement.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAiBnD,UAAU,MAAO,SAAQ,gBAAgB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,mBAAmB,CAAC;IAChC,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CAClD;AAED,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,KAAK,EAAE,MAAM,eAiE1D"}
1
+ {"version":3,"file":"CaseDetailsManagement.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAiBnD,UAAU,MAAO,SAAQ,gBAAgB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,mBAAmB,CAAC;IAChC,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CAClD;AAED,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,KAAK,EAAE,MAAM,eA+D1D"}
@@ -28,11 +28,10 @@ export default function CaseDetailsManagement(props) {
28
28
  const canSeeEmailNotifications = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_SEND_NOTIFICATIONS);
29
29
  const canSeeInternalStatus = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_INTERNAL_STATUS);
30
30
  const canSeeSBRGroups = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_SBR_GROUP);
31
- const handleFormSubmit = (e) => e.preventDefault();
32
31
  return (React.createElement(React.Fragment, null,
33
32
  React.createElement(PartnerCaseHelper, { setIsUpdatingPartners: setIsUpdatingPartner, caseNumber: props.caseNumber, routeProps: props.routeProps }),
34
33
  React.createElement("section", { className: "card card-white" },
35
- React.createElement("form", { onSubmit: handleFormSubmit },
34
+ React.createElement("form", null,
36
35
  React.createElement(Flex, { direction: { default: 'column', '2xl': 'row' } },
37
36
  React.createElement(FlexItem, { flex: { default: 'flex_1' } },
38
37
  React.createElement(OwnerSelector, null)),
@@ -3,7 +3,7 @@ import { MoreOrLess } from '@rh-support/components';
3
3
  import { useGlobalStateContext } from '@rh-support/react-context';
4
4
  import { ability, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
5
5
  import { PreviousCaseTypes } from '@rh-support/utils';
6
- import { isEqual } from 'lodash';
6
+ import isEqual from 'lodash/isEqual';
7
7
  import React from 'react';
8
8
  import { Trans } from 'react-i18next';
9
9
  import { useCaseSelector } from '../../../../context/CaseContext';
@@ -12,7 +12,7 @@ import { PromisifyModal, ToastNotification, useFetch } from '@rh-support/compone
12
12
  import { fetchAccountCustomEmails, GlobalMetadataDispatchContext, GlobalMetadataStateContext, } from '@rh-support/react-context';
13
13
  import { ability, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
14
14
  import { haventLoadedMetadata, isEmailValid } from '@rh-support/utils';
15
- import { findIndex } from 'lodash';
15
+ import findIndex from 'lodash/findIndex';
16
16
  import isEmpty from 'lodash/isEmpty';
17
17
  import isEqual from 'lodash/isEqual';
18
18
  import React, { useContext, useEffect } from 'react';
@@ -42,7 +42,7 @@ function CaseGroup(props) {
42
42
  isCaseOwnerUpdating: state.isCaseOwnerUpdating,
43
43
  }), isEqual);
44
44
  const caseDispatch = useCaseDispatch();
45
- const { routeState: { showValidationErrorAlert }, } = useContext(RouteContext);
45
+ const { routeState: { isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
46
46
  const isGroupMandatory = selectedAccountDetails.data.requireCGroupOnCreate;
47
47
  const [selectedCaseGroup, setSelectedCaseGroup] = useState(isGroupMandatory ? undefined : emptyCaseGroup);
48
48
  const [isCaseGroupInvalid, setCaseGroupInvalid] = useState(false);
@@ -163,7 +163,7 @@ function CaseGroup(props) {
163
163
  }
164
164
  });
165
165
  const showHelperText = !isSelectedUngroupedInvalid || (!isCaseGroupInvalid && !isGroupMandatory);
166
- const showEmptyValidationError = !caseNumber && showValidationErrorAlert && isCaseGroupInvalid;
166
+ const showEmptyValidationError = !caseNumber && isNextBtnClickedToShowValidationError && isCaseGroupInvalid;
167
167
  return (React.createElement("div", { className: "form-group" },
168
168
  React.createElement("label", { htmlFor: "get-support-group" },
169
169
  React.createElement(Trans, null, "Group"),
@@ -1 +1 @@
1
- {"version":3,"file":"CaseInformation.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseInformation.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAUvD,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,eAiHpD"}
1
+ {"version":3,"file":"CaseInformation.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseInformation.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AASvD,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,eAyGpD"}
@@ -5,7 +5,6 @@ import isEmpty from 'lodash/isEmpty';
5
5
  import isEqual from 'lodash/isEqual';
6
6
  import React, { useContext, useEffect } from 'react';
7
7
  import { Trans, useTranslation } from 'react-i18next';
8
- import { AppMetadataStateContext } from '../../context/AppMetadataContext';
9
8
  import { useCaseSelector } from '../../context/CaseContext';
10
9
  import { OpenShiftClusterId } from '../CaseManagement/OpenShiftClusterId';
11
10
  import { Hostname } from '../ImproveCase/Hostname';
@@ -14,7 +13,6 @@ import ClusterRecommendations from '../Recommendations/ClusterRecommendations';
14
13
  import Description from './Description';
15
14
  export default function CaseInformation(props) {
16
15
  const { t } = useTranslation();
17
- const { appMetadataState: { nextButtonRef }, } = useContext(AppMetadataStateContext);
18
16
  const { globalMetadataState: { allCaseTypes, allCaseSeverities, caseLanguages, loggedInUser, loggedInUserJwtToken, loggedInUsersAccount, }, } = useContext(GlobalMetadataStateContext);
19
17
  const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
20
18
  const { contactSSOName, selectedAccountDetails, ownersCaseGroups, hasInvalidEntitlements } = useCaseSelector((state) => ({
@@ -33,11 +31,6 @@ export default function CaseInformation(props) {
33
31
  (selectedAccountDetails.data.requireCGroupOnCreate && ownersCaseGroups.isError) ||
34
32
  allCaseSeverities.isError);
35
33
  };
36
- const handleFormSubmit = (e) => {
37
- e.preventDefault();
38
- // simulating click
39
- nextButtonRef.current.click();
40
- };
41
34
  // Loading metadata (if needed) on component mount after fetching account info.
42
35
  // This will be fetched here in caseCreation mode as Issue section will be skipped.
43
36
  useEffect(() => {
@@ -84,7 +77,7 @@ export default function CaseInformation(props) {
84
77
  !isMetadataLoading() &&
85
78
  !isMetadataLoadingError() &&
86
79
  canManageCase(loggedInUserJwtToken) && (React.createElement(React.Fragment, null,
87
- React.createElement("form", { onSubmit: handleFormSubmit },
80
+ React.createElement("form", null,
88
81
  React.createElement(Hostname, null),
89
82
  React.createElement(OpenShiftClusterId, null),
90
83
  React.createElement(ClusterRecommendations, { className: "push-bottom" }),
@@ -1 +1 @@
1
- {"version":3,"file":"Description.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Description.tsx"],"names":[],"mappings":"AAkBA,UAAU,MAAM;IACZ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,MAAM,eAsGhD"}
1
+ {"version":3,"file":"Description.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Description.tsx"],"names":[],"mappings":"AAkBA,UAAU,MAAM;IACZ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,KAAK,EAAE,MAAM,eAwGhD"}
@@ -30,7 +30,7 @@ export default function Description(props) {
30
30
  const onCaseDetailsChange = (caseDetails) => {
31
31
  setCaseDetails(caseDispatch, caseDetails);
32
32
  };
33
- const { routeState: { showValidationErrorAlert }, } = useContext(RouteContext);
33
+ const { routeState: { isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
34
34
  const onKTQ1IssueChange = (value, e) => {
35
35
  const ktQ1Local = isEmpty(value === null || value === void 0 ? void 0 : value.trim()) ? '' : value;
36
36
  const newDescription = getUpdatedDescription(ktQ1Local, environment, periodicityOfIssue, timeFramesAndUrgency, v3ClusterName);
@@ -45,7 +45,9 @@ export default function Description(props) {
45
45
  return (React.createElement(InlineEdit, { labelContent: React.createElement(React.Fragment, null,
46
46
  props.customTitle ? (props.customTitle) : (React.createElement(Trans, null, "What are you experiencing? What are you expecting to happen?")),
47
47
  isKT1Required && (React.createElement("span", { className: "form-required", "aria-hidden": true }, "*"))), labelProps: { htmlFor: 'get-support-ktQ1-issue' }, content: issue, allowInlineEdit: !!props.inlineEditable, hideSaveCancel: !!props.hideSaveCancel, initialIsEditing: isEmpty(issue), usePreformattedTag: true, saveOnBlur: true },
48
- React.createElement(TextArea, { id: "get-support-ktQ1-issue", name: "get-support-ktQ1-issue", className: `form-control${isDescriptionInvalid(issue) || (showValidationErrorAlert && isEmpty(issue)) ? ' form-invalid' : ''}`, "aria-invalid": (issue === null || issue === void 0 ? void 0 : issue.length) > CASE_DEATILS_ISSUE_LIMIT ? 'true' : 'false', "aria-required": isKT1Required, isRequired: isKT1Required, value: issue, isDisabled: isEmpty(issue) && hasLargeCaseDescription && !setIssueTextAreaFocused, onChange: onKTQ1IssueChange, onFocus: onKTQ1IssueFocusChange, onBlur: onKTQ1IssueFocusChange, "data-tracking-id": "get-support-ktQ1-issue", placeholder: t('Please enter an elaborate description') }),
48
+ React.createElement(TextArea, { id: "get-support-ktQ1-issue", name: "get-support-ktQ1-issue", className: `form-control${isDescriptionInvalid(issue) || (isNextBtnClickedToShowValidationError && isEmpty(issue))
49
+ ? ' form-invalid'
50
+ : ''}`, "aria-invalid": (issue === null || issue === void 0 ? void 0 : issue.length) > CASE_DEATILS_ISSUE_LIMIT ? 'true' : 'false', "aria-required": isKT1Required, isRequired: isKT1Required, value: issue, isDisabled: isEmpty(issue) && hasLargeCaseDescription && !setIssueTextAreaFocused, onChange: onKTQ1IssueChange, onFocus: onKTQ1IssueFocusChange, onBlur: onKTQ1IssueFocusChange, "data-tracking-id": "get-support-ktQ1-issue", placeholder: t('Please enter an elaborate description') }),
49
51
  React.createElement("p", { className: "form-instructions", "data-tracking-id": "large-20k-warning-ktQ1-environment" }, `${(issue === null || issue === void 0 ? void 0 : issue.length) > CASE_DEATILS_ISSUE_LIMIT
50
52
  ? `Description cannot be more than ${CASE_DEATILS_ISSUE_LIMIT} characters`
51
53
  : ''}`),
@@ -24,7 +24,7 @@ function OpenCaseIssue(props) {
24
24
  const caseDispatch = useCaseDispatch();
25
25
  const [isSummaryInValid, setIsSummaryInValid] = useState(false);
26
26
  const [hasLargeSummary, setHasLargeSummary] = useState(false);
27
- const { routeState: { showValidationErrorAlert }, } = useContext(RouteContext);
27
+ const { routeState: { isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
28
28
  const onSummaryBlur = (e) => {
29
29
  var _a;
30
30
  setIsSummaryInValid(isEmpty((_a = e.target.value) === null || _a === void 0 ? void 0 : _a.trim()));
@@ -53,7 +53,7 @@ function OpenCaseIssue(props) {
53
53
  !!props.required && (React.createElement("span", { className: "form-required", "aria-hidden": true }, "*"))), allowInlineEdit: props.inlineEditable, hideSaveCancel: !!props.hideSaveCancel, initialIsEditing: !!props.initialIsEditing, saveOnBlur: true, collapseOnBlur: !!props.collapseOnBlur && !isSummaryInValid, content: summary },
54
54
  React.createElement("input", { type: "text", id: supportType === PreviousCaseTypes.FEATURE_ENHANCEMENT
55
55
  ? 'get-support-title'
56
- : 'get-support-summary', className: `form-control${isSummaryInValid || hasLargeSummary || (showValidationErrorAlert && !summary)
56
+ : 'get-support-summary', className: `form-control${isSummaryInValid || hasLargeSummary || (isNextBtnClickedToShowValidationError && !summary)
57
57
  ? ' form-invalid'
58
58
  : ''}`, "aria-invalid": isSummaryInValid, "aria-required": !!props.required, required: !!props.required, name: supportType === PreviousCaseTypes.FEATURE_ENHANCEMENT
59
59
  ? 'get-support-title'
@@ -3,8 +3,8 @@ import WarningTriangleIcon from '@patternfly/react-icons/dist/js/icons/warning-t
3
3
  import { Dropdown, ValueChangedIcon } from '@rh-support/components';
4
4
  import { GlobalMetadataStateContext } from '@rh-support/react-context';
5
5
  import { autoEnableFtsOnCaseViewEditPage, severitySort, showFtsOnCreateCasePage, toOption, toOptions, } from '@rh-support/utils';
6
- import { findLast } from 'lodash';
7
6
  import find from 'lodash/find';
7
+ import findLast from 'lodash/findLast';
8
8
  import includes from 'lodash/includes';
9
9
  import isEmpty from 'lodash/isEmpty';
10
10
  import isEqual from 'lodash/isEqual';
@@ -1 +1 @@
1
- {"version":3,"file":"CaseManagement.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/CaseManagement.tsx"],"names":[],"mappings":"AAkBA,MAAM,WAAW,MAAM;CAAG;AAC1B,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,MAAM,eAqCnD"}
1
+ {"version":3,"file":"CaseManagement.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/CaseManagement.tsx"],"names":[],"mappings":"AAiBA,MAAM,WAAW,MAAM;CAAG;AAC1B,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,MAAM,eA4BnD"}
@@ -1,6 +1,5 @@
1
1
  import { Flex, FlexItem } from '@patternfly/react-core';
2
- import React, { useContext } from 'react';
3
- import { AppMetadataStateContext } from '../../context/AppMetadataContext';
2
+ import React from 'react';
4
3
  import { useCaseDispatch } from '../../context/CaseContext';
5
4
  import { setCaseDetails } from '../../reducers/CaseReducer';
6
5
  import CaseGroup from '../CaseInformation/CaseGroup';
@@ -16,16 +15,10 @@ import { RHAssociatesSelector } from './RHAssociatesSelector';
16
15
  import CaseContactSelector from './SendNotifications/CaseContactSelector';
17
16
  export default function CaseManagement(props) {
18
17
  const caseDispatch = useCaseDispatch();
19
- const { appMetadataState: { nextButtonRef }, } = useContext(AppMetadataStateContext);
20
- const handleFormSubmit = (e) => {
21
- e.preventDefault();
22
- // simulating click
23
- nextButtonRef.current.click();
24
- };
25
18
  const onSeverityChange = (payload) => {
26
19
  setCaseDetails(caseDispatch, payload);
27
20
  };
28
- return (React.createElement("form", { onSubmit: handleFormSubmit },
21
+ return (React.createElement("form", null,
29
22
  React.createElement(SupportLevel, null),
30
23
  React.createElement(Flex, { direction: { default: 'column', '2xl': 'row' } },
31
24
  React.createElement(FlexItem, { flex: { default: 'flex_1' } },
@@ -2,5 +2,9 @@ export declare const v3Tov4TransitionLink: () => JSX.Element;
2
2
  export declare const discoverV4ClusterIdLink: () => JSX.Element;
3
3
  export declare const discoverV4ClusterIdLinkError: () => JSX.Element;
4
4
  export declare const isInvalidErrorMessage: () => JSX.Element;
5
- export declare function OpenShiftClusterId(): JSX.Element;
5
+ interface IProps {
6
+ className?: string;
7
+ }
8
+ export declare function OpenShiftClusterId(props: IProps): JSX.Element;
9
+ export {};
6
10
  //# sourceMappingURL=OpenShiftClusterId.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenShiftClusterId.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenShiftClusterId.tsx"],"names":[],"mappings":"AA2BA,eAAO,MAAM,oBAAoB,mBAShC,CAAC;AAEF,eAAO,MAAM,uBAAuB,mBAInC,CAAC;AAEF,eAAO,MAAM,4BAA4B,mBAUxC,CAAC;AAEF,eAAO,MAAM,qBAAqB,mBAIjC,CAAC;AAEF,wBAAgB,kBAAkB,gBAyRjC"}
1
+ {"version":3,"file":"OpenShiftClusterId.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenShiftClusterId.tsx"],"names":[],"mappings":"AA2BA,eAAO,MAAM,oBAAoB,mBAShC,CAAC;AAEF,eAAO,MAAM,uBAAuB,mBAInC,CAAC;AAEF,eAAO,MAAM,4BAA4B,mBAUxC,CAAC;AAEF,eAAO,MAAM,qBAAqB,mBAIjC,CAAC;AAEF,UAAU,MAAM;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,eAyR/C"}
@@ -37,7 +37,7 @@ export const isInvalidErrorMessage = () => (React.createElement(React.Fragment,
37
37
  React.createElement(Trans, null,
38
38
  "Cluster Id is not valid. ",
39
39
  discoverV4ClusterIdLink())));
40
- export function OpenShiftClusterId() {
40
+ export function OpenShiftClusterId(props) {
41
41
  const queryParams = getUrlParsedParams(useLocation().search);
42
42
  const { openshiftClusterID, product, version, issue, environment, periodicityOfIssue, timeFramesAndUrgency, noClusterIdReason, noClusterIdReasonExplanation, v3ClusterName, openshiftDisplayName, selectedAccountDetails, } = useCaseSelector((state) => ({
43
43
  openshiftClusterID: state.caseDetails.openshiftClusterID,
@@ -55,7 +55,7 @@ export function OpenShiftClusterId() {
55
55
  }), isEqual);
56
56
  const caseDispatch = useCaseDispatch();
57
57
  const { globalMetadataState: { allProducts, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
58
- const { routeState: { showValidationErrorAlert }, } = useContext(RouteContext);
58
+ const { routeState: { isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
59
59
  const clusterRecommendationsDispatch = useContext(ClusterRecommendationsDispatchContext);
60
60
  const { clusterRecommendationsState: { clusterRecommendationsCache }, } = useContext(ClusterRecommendationsContext);
61
61
  const majorVersion = (version && getVersion(version).major) || '';
@@ -185,7 +185,7 @@ export function OpenShiftClusterId() {
185
185
  ? discoverV4ClusterIdLinkError()
186
186
  : null;
187
187
  const infoMessage = v3Selected ? v3Tov4TransitionLink() : discoverV4ClusterIdLink();
188
- return showValidationErrorAlert && errorMessage ? errorMessage : infoMessage;
188
+ return isNextBtnClickedToShowValidationError && errorMessage ? errorMessage : infoMessage;
189
189
  };
190
190
  const onReasonExplanationInputBoxChanged = (noClusterIdReasonExplanation) => {
191
191
  if (noClusterIdReason === 'Other') {
@@ -203,13 +203,13 @@ export function OpenShiftClusterId() {
203
203
  const onReasonChange = (reason) => {
204
204
  setCaseDetails(caseDispatch, { noClusterIdReason: reason });
205
205
  };
206
- const isInVaidNoClusterIdReason = showValidationErrorAlert &&
206
+ const isInVaidNoClusterIdReason = isNextBtnClickedToShowValidationError &&
207
207
  (isEmpty(noClusterIdReason) || (noClusterIdReason === 'Other' && isEmpty(noClusterIdReasonExplanation.trim())));
208
208
  if (!showClusterId)
209
209
  return null;
210
- return (React.createElement(React.Fragment, null,
211
- !isOpenShiftV3 && (React.createElement(OpenshiftDropdownV4, { openshiftDisplayName: openshiftDisplayName, openshiftClusterIDState: openshiftClusterID || selectedReason, onClusterIdStateUpdate: onClusterIdStateUpdate, isClusterIdInvalid: showValidationErrorAlert &&
210
+ return (React.createElement("div", { className: `${props.className ? props.className : ''}` },
211
+ !isOpenShiftV3 && (React.createElement(OpenshiftDropdownV4, { openshiftDisplayName: openshiftDisplayName, openshiftClusterIDState: openshiftClusterID || selectedReason, onClusterIdStateUpdate: onClusterIdStateUpdate, isClusterIdInvalid: isNextBtnClickedToShowValidationError &&
212
212
  ((isEmpty(openshiftClusterID) && isEmpty(selectedReason)) || isClusterIdInvalid), clusterIdDropdownFormInstructions: clusterIdDropdownFormInstructions(), onClusterClear: resetClusterData, isV3: product !== 'OpenShift Container Platform' })),
213
213
  noClusterIdReasonExplanation !== 'v3-cluster' && dontKnowSelected && !isOpenShiftV3 && (React.createElement(NoClusterIDReasonSelector, { noClusterIdReasonExplanation: noClusterIdReasonExplanation, noClusterIdReason: noClusterIdReason, onReasonInputBoxChanged: onReasonExplanationInputBoxChanged, onReasonChange: onReasonChange, isInValid: isInVaidNoClusterIdReason, isCustomer: isCustomer })),
214
- (v3Selected || isOpenShiftV3) && (React.createElement(OpenShiftV3Inputbox, { v3ClusterName: v3ClusterName, onReasonInputBoxChanged: v3ClusterNameInputBoxChanged, isInValid: isEmpty(v3ClusterName.trim()) && showValidationErrorAlert, v3Selected: v3Selected }))));
214
+ (v3Selected || isOpenShiftV3) && (React.createElement(OpenShiftV3Inputbox, { v3ClusterName: v3ClusterName, onReasonInputBoxChanged: v3ClusterNameInputBoxChanged, isInValid: isEmpty(v3ClusterName.trim()) && isNextBtnClickedToShowValidationError, v3Selected: v3Selected }))));
215
215
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CaseContactSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/CaseContactSelector.tsx"],"names":[],"mappings":"AAoCA,MAAM,WAAW,MAAM;CAAG;AAG1B,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,eA6azC;AAED,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"CaseContactSelector.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseManagement/SendNotifications/CaseContactSelector.tsx"],"names":[],"mappings":"AAuCA,MAAM,WAAW,MAAM;CAAG;AAG1B,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,eA6azC;AAED,eAAe,mBAAmB,CAAC"}
@@ -11,10 +11,13 @@ import { Button, Tooltip, TooltipPosition } from '@patternfly/react-core';
11
11
  import { CaseContactsSelectorExternal, getHydraContactLabel, PromisifyModal, ToastNotification, usePrevious, } from '@rh-support/components';
12
12
  import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
13
13
  import { AbilityContext, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
14
- import { filter, find, map, remove } from 'lodash';
15
14
  import differenceBy from 'lodash/differenceBy';
15
+ import filter from 'lodash/filter';
16
+ import find from 'lodash/find';
16
17
  import isEmpty from 'lodash/isEmpty';
17
18
  import isEqual from 'lodash/isEqual';
19
+ import map from 'lodash/map';
20
+ import remove from 'lodash/remove';
18
21
  import uniqBy from 'lodash/uniqBy';
19
22
  import xor from 'lodash/xor';
20
23
  import React, { useContext, useEffect, useRef, useState } from 'react';
@@ -1 +1 @@
1
- {"version":3,"file":"IdeaInformtion.d.ts","sourceRoot":"","sources":["../../../../src/components/IdeaInformation/IdeaInformtion.tsx"],"names":[],"mappings":"AA+BA,MAAM,CAAC,OAAO,UAAU,eAAe,gBA8ItC"}
1
+ {"version":3,"file":"IdeaInformtion.d.ts","sourceRoot":"","sources":["../../../../src/components/IdeaInformation/IdeaInformtion.tsx"],"names":[],"mappings":"AA8BA,MAAM,CAAC,OAAO,UAAU,eAAe,gBAsItC"}
@@ -6,7 +6,6 @@ import isEmpty from 'lodash/isEmpty';
6
6
  import isEqual from 'lodash/isEqual';
7
7
  import React, { useContext, useEffect } from 'react';
8
8
  import { Trans, useTranslation } from 'react-i18next';
9
- import { AppMetadataStateContext } from '../../context/AppMetadataContext';
10
9
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
11
10
  import { setCaseDetails } from '../../reducers/CaseReducer';
12
11
  import CaseGroup from '../CaseInformation/CaseGroup';
@@ -23,7 +22,6 @@ import CaseContactSelector from '../CaseManagement/SendNotifications/CaseContact
23
22
  import KtQuestions from '../ImproveCase/KtQuestions';
24
23
  export default function IdeaInformation() {
25
24
  const { t } = useTranslation();
26
- const { appMetadataState: { nextButtonRef }, } = useContext(AppMetadataStateContext);
27
25
  const { globalMetadataState: { allCaseTypes, allCaseSeverities, caseLanguages, loggedInUser, loggedInUserJwtToken, loggedInUsersAccount, }, } = useContext(GlobalMetadataStateContext);
28
26
  const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
29
27
  const { contactSSOName, selectedAccountDetails, ownersCaseGroups, hasInvalidEntitlements } = useCaseSelector((state) => ({
@@ -43,11 +41,6 @@ export default function IdeaInformation() {
43
41
  (selectedAccountDetails.data.requireCGroupOnCreate && ownersCaseGroups.isError) ||
44
42
  allCaseSeverities.isError);
45
43
  };
46
- const handleFormSubmit = (e) => {
47
- e.preventDefault();
48
- // simulating click
49
- nextButtonRef.current.click();
50
- };
51
44
  // Loading metadata (if needed) on component mount after fetching account info.
52
45
  // This will be fetched here in caseCreation mode as Issue section will be skipped.
53
46
  useEffect(() => {
@@ -97,7 +90,7 @@ export default function IdeaInformation() {
97
90
  !isMetadataLoading() &&
98
91
  !isMetadataLoadingError() &&
99
92
  canManageCase(loggedInUserJwtToken) && (React.createElement(React.Fragment, null,
100
- React.createElement("form", { onSubmit: handleFormSubmit },
93
+ React.createElement("form", null,
101
94
  React.createElement(Description, { inlineEditable: false, customTitle: t('Please describe your request') }),
102
95
  React.createElement(KtQuestions, { onlyShowKT4: true }),
103
96
  React.createElement(SupportLevel, null),
@@ -49,7 +49,7 @@ function KtQuestions(props) {
49
49
  const onCaseDetailsChange = (caseDetails) => {
50
50
  setCaseDetails(caseDispatch, caseDetails);
51
51
  };
52
- const { routeState: { showValidationErrorAlert }, } = useContext(RouteContext);
52
+ const { routeState: { isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
53
53
  // Troubleshoot Page Question 3
54
54
  const onKtQ2Change = (value, e) => {
55
55
  const ktQ2Local = isEmpty(value === null || value === void 0 ? void 0 : value.trim()) ? '' : value;
@@ -85,7 +85,7 @@ function KtQuestions(props) {
85
85
  ' ',
86
86
  isKT4Required && (React.createElement("span", { className: "form-required", "aria-hidden": true }, "*"))), allowInlineEdit: props.inlineEditable, hideSaveCancel: props.hideSaveCancel, initialIsEditing: isEmpty(timeFramesAndUrgency), usePreformattedTag: true, saveOnBlur: true, content: timeFramesAndUrgency },
87
87
  React.createElement(TextArea, { className: `form-control${invalidateQT4(timeFramesAndUrgency) ||
88
- (showValidationErrorAlert && isEmpty(timeFramesAndUrgency)) ||
88
+ (isNextBtnClickedToShowValidationError && isEmpty(timeFramesAndUrgency)) ||
89
89
  isKTQ4InValid
90
90
  ? ' form-invalid'
91
91
  : ''}`, "aria-invalid": timeFramesAndUrgency && (timeFramesAndUrgency === null || timeFramesAndUrgency === void 0 ? void 0 : timeFramesAndUrgency.length) > CASE_DETAILS_TIMEFRAMESANDURGENCY_LIMIT
@@ -1 +1 @@
1
- {"version":3,"file":"Issue.d.ts","sourceRoot":"","sources":["../../../../src/components/Issue/Issue.tsx"],"names":[],"mappings":"AAmBA,MAAM,CAAC,OAAO,UAAU,KAAK,gBA4F5B"}
1
+ {"version":3,"file":"Issue.d.ts","sourceRoot":"","sources":["../../../../src/components/Issue/Issue.tsx"],"names":[],"mappings":"AAmBA,MAAM,CAAC,OAAO,UAAU,KAAK,gBA0F5B"}
@@ -36,9 +36,8 @@ export default function Issue() {
36
36
  const maxLengtMessage = t('Case description cannot be more than {{limit}} characters', {
37
37
  limit: MODIFIED_DESCRIPTION_LENGTH_LIMIT,
38
38
  });
39
- const handleFormSubmit = (e) => e.preventDefault();
40
39
  return (React.createElement(React.Fragment, null,
41
- React.createElement("form", { onSubmit: handleFormSubmit, className: "push-bottom" },
40
+ React.createElement("form", { className: "push-bottom" },
42
41
  React.createElement(OpenCaseIssue, { inlineEditable: false, hideSaveCancel: true, initialIsEditing: isEmpty(summary), required: true }),
43
42
  React.createElement(MoreOrLess, { maxHeight: 600, appStickyHeaderRef: navBarRef },
44
43
  React.createElement(InlineEdit, { labelProps: { htmlFor: 'issue-section-ktQ1-issue' }, labelContent: React.createElement(React.Fragment, null,
@@ -1 +1 @@
1
- {"version":3,"file":"OpenCase.d.ts","sourceRoot":"","sources":["../../../../src/components/OpenCase/OpenCase.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAKlE,MAAM,WAAW,MAAM;IACnB,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,MAAM,eA0B7C"}
1
+ {"version":3,"file":"OpenCase.d.ts","sourceRoot":"","sources":["../../../../src/components/OpenCase/OpenCase.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAKlE,MAAM,WAAW,MAAM;IACnB,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,MAAM,eAiB7C"}