@rh-support/troubleshoot 2.0.7 → 2.0.9

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 (115) hide show
  1. package/lib/esm/components/AccountInfo/AccountSelector.d.ts.map +1 -1
  2. package/lib/esm/components/AccountInfo/AccountSelector.js +5 -44
  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 +3 -5
  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/CaseSolutions/CaseSolutions.d.ts.map +1 -1
  9. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +36 -38
  10. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts +1 -2
  11. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts.map +1 -1
  12. package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.js +3 -4
  13. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +1 -1
  14. package/lib/esm/components/CaseEditView/ShareCase/PartnerShare.d.ts.map +1 -1
  15. package/lib/esm/components/CaseEditView/ShareCase/PartnerShare.js +1 -6
  16. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
  17. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +2 -1
  18. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.js +1 -1
  19. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/useCustomEmails.js +1 -1
  20. package/lib/esm/components/CaseInformation/CaseGroup.js +2 -2
  21. package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
  22. package/lib/esm/components/CaseInformation/CaseInformation.js +8 -1
  23. package/lib/esm/components/CaseInformation/Description.d.ts.map +1 -1
  24. package/lib/esm/components/CaseInformation/Description.js +2 -4
  25. package/lib/esm/components/CaseInformation/OpenCaseIssue.js +2 -2
  26. package/lib/esm/components/CaseInformation/Severity.js +1 -1
  27. package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
  28. package/lib/esm/components/CaseManagement/CaseManagement.js +9 -2
  29. package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts +1 -5
  30. package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts.map +1 -1
  31. package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +7 -7
  32. package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.d.ts.map +1 -1
  33. package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.js +1 -4
  34. package/lib/esm/components/IdeaInformation/IdeaInformtion.d.ts.map +1 -1
  35. package/lib/esm/components/IdeaInformation/IdeaInformtion.js +8 -1
  36. package/lib/esm/components/ImproveCase/KtQuestions.js +2 -2
  37. package/lib/esm/components/Issue/Issue.d.ts.map +1 -1
  38. package/lib/esm/components/Issue/Issue.js +2 -1
  39. package/lib/esm/components/OpenCase/OpenCase.d.ts.map +1 -1
  40. package/lib/esm/components/OpenCase/OpenCase.js +9 -2
  41. package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +10 -10
  42. package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
  43. package/lib/esm/components/ProductSelector/AllProductsSelector.js +1 -1
  44. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts +1 -1
  45. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
  46. package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +3 -3
  47. package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts +1 -1
  48. package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
  49. package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +3 -3
  50. package/lib/esm/components/ProductSelector/ProductSelector.js +2 -1
  51. package/lib/esm/components/ProductSelector/ProductSelectorLoader.d.ts +2 -1
  52. package/lib/esm/components/ProductSelector/ProductSelectorLoader.d.ts.map +1 -1
  53. package/lib/esm/components/ProductSelector/ProductSelectorLoader.js +19 -12
  54. package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +3 -3
  55. package/lib/esm/components/Recommendations/ClusterRecommendationToast.d.ts.map +1 -1
  56. package/lib/esm/components/Recommendations/ClusterRecommendationToast.js +1 -2
  57. package/lib/esm/components/Recommendations/ClusterRecommendations.js +1 -1
  58. package/lib/esm/components/SessionRestore/RestoreLastSessionModal.js +1 -1
  59. package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
  60. package/lib/esm/components/SessionRestore/SessionRestore.js +9 -4
  61. package/lib/esm/components/SubmitCase/ResubmitToast.js +1 -1
  62. package/lib/esm/components/SubmitCase/SubmitCase.js +1 -1
  63. package/lib/esm/components/Suggestions/TopContent.js +1 -1
  64. package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +2 -2
  65. package/lib/esm/components/shared/useIsSectionValid.d.ts +1 -1
  66. package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
  67. package/lib/esm/components/shared/useIsSectionValid.js +24 -5
  68. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
  69. package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +80 -40
  70. package/lib/esm/components/wizardLayout/MainSection.d.ts +3 -5
  71. package/lib/esm/components/wizardLayout/MainSection.d.ts.map +1 -1
  72. package/lib/esm/components/wizardLayout/MainSection.js +4 -4
  73. package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
  74. package/lib/esm/components/wizardLayout/WizardAside.js +10 -3
  75. package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
  76. package/lib/esm/components/wizardLayout/WizardLayout.js +42 -31
  77. package/lib/esm/components/wizardLayout/WizardMain.d.ts +3 -2
  78. package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
  79. package/lib/esm/components/wizardLayout/WizardMain.js +163 -43
  80. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts +3 -7
  81. package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
  82. package/lib/esm/components/wizardLayout/WizardNavigation.js +90 -46
  83. package/lib/esm/components/wizardLayout/WizardProgress.d.ts +13 -0
  84. package/lib/esm/components/wizardLayout/WizardProgress.d.ts.map +1 -0
  85. package/lib/esm/components/wizardLayout/WizardProgress.js +108 -0
  86. package/lib/esm/components/wizardLayout/index.d.ts.map +1 -1
  87. package/lib/esm/components/wizardLayout/index.js +10 -2
  88. package/lib/esm/context/AppMetadataContext.d.ts +11 -0
  89. package/lib/esm/context/AppMetadataContext.d.ts.map +1 -0
  90. package/lib/esm/context/AppMetadataContext.js +13 -0
  91. package/lib/esm/context/RootTroubleshootProvider.d.ts.map +1 -1
  92. package/lib/esm/context/RootTroubleshootProvider.js +9 -7
  93. package/lib/esm/css/app.css +450 -0
  94. package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
  95. package/lib/esm/hooks/useResetCaseCreate.js +4 -0
  96. package/lib/esm/reducers/AppMetadataReducer.d.ts +28 -0
  97. package/lib/esm/reducers/AppMetadataReducer.d.ts.map +1 -0
  98. package/lib/esm/reducers/AppMetadataReducer.js +28 -0
  99. package/lib/esm/reducers/RouteConstNTypes.d.ts +1 -21
  100. package/lib/esm/reducers/RouteConstNTypes.d.ts.map +1 -1
  101. package/lib/esm/reducers/RouteConstNTypes.js +0 -43
  102. package/lib/esm/reducers/RouteReducer.d.ts +47 -13
  103. package/lib/esm/reducers/RouteReducer.d.ts.map +1 -1
  104. package/lib/esm/reducers/RouteReducer.js +165 -36
  105. package/lib/esm/scss/_main.scss +786 -106
  106. package/lib/esm/utils/routeUtils.d.ts +9 -3
  107. package/lib/esm/utils/routeUtils.d.ts.map +1 -1
  108. package/lib/esm/utils/routeUtils.js +41 -14
  109. package/package.json +25 -14
  110. package/lib/esm/components/CaseEditView/CaseSolutions/HandpickedItem.d.ts +0 -12
  111. package/lib/esm/components/CaseEditView/CaseSolutions/HandpickedItem.d.ts.map +0 -1
  112. package/lib/esm/components/CaseEditView/CaseSolutions/HandpickedItem.js +0 -14
  113. package/lib/esm/hooks/useWizard.d.ts +0 -4
  114. package/lib/esm/hooks/useWizard.d.ts.map +0 -1
  115. package/lib/esm/hooks/useWizard.js +0 -128
@@ -1 +1 @@
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
+ {"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,27 +1,14 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
1
  import './css/accountSelector.css';
11
- import { accounts } from '@cee-eng/hydrajs';
12
2
  import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
13
- import { AlertMessage, AlertType } from '@rh-support/components';
14
3
  import { AccountSelectorInternal, GlobalMetadataStateContext } from '@rh-support/react-context';
15
4
  import { AbilityContext, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
16
5
  import isArray from 'lodash/isArray';
17
6
  import isEmpty from 'lodash/isEmpty';
18
7
  import isEqual from 'lodash/isEqual';
19
- import React, { useContext, useEffect, useState } from 'react';
8
+ import React, { useContext } from 'react';
20
9
  import { Trans, useTranslation } from 'react-i18next';
21
10
  import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
22
- import { useRouteDispatchContext } from '../../context/RouteContext';
23
11
  import { clearSelectedAccount, setCaseAccountNumber } from '../../reducers/CaseReducer';
24
- import { setNoValidEntitlement } from '../../reducers/RouteReducer';
25
12
  import { ManagedAccountsDropdown } from './ManagedAccountsDropdown';
26
13
  export const defaultProps = {
27
14
  id: '',
@@ -29,14 +16,12 @@ export const defaultProps = {
29
16
  };
30
17
  function AccountSelector(props) {
31
18
  var _a;
32
- const [showNotEntitledMessage, setShowNotEntitledMessage] = useState(false);
33
19
  const { accountNumber, selectedAccountDetails } = useCaseSelector((state) => ({
34
20
  accountNumber: state.caseDetails.accountNumberRef,
35
21
  selectedAccountDetails: state.selectedAccountDetails,
36
22
  }), isEqual);
37
23
  const isSelectedAccountSubscriptionAbused = ((_a = selectedAccountDetails === null || selectedAccountDetails === void 0 ? void 0 : selectedAccountDetails.data) === null || _a === void 0 ? void 0 : _a.subscriptionAbuse) || false;
38
24
  const caseDispatch = useCaseDispatch();
39
- const routeDispatch = useRouteDispatchContext();
40
25
  const { globalMetadataState: { bookmarkedGroupAccounts, loggedInUserRights, managedAccounts, loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
41
26
  const { t } = useTranslation();
42
27
  /** Various Abilities */
@@ -45,7 +30,7 @@ function AccountSelector(props) {
45
30
  const canBookmarkAccounts = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.BOOKMARK_ACCOUNTS);
46
31
  const canUseFindMyAccount = loggedInUserRights.data.isAccountDifferentFromLoggedInAccount(accountNumber);
47
32
  // Account Change Handler
48
- const onAccountChange = (account) => __awaiter(this, void 0, void 0, function* () {
33
+ const onAccountChange = (account) => {
49
34
  if (selectedAccountDetails.data.accountNumber === account.accountNumber)
50
35
  return;
51
36
  if (isEmpty(account === null || account === void 0 ? void 0 : account.accountNumber)) {
@@ -53,7 +38,7 @@ function AccountSelector(props) {
53
38
  return;
54
39
  }
55
40
  setCaseAccountNumber(caseDispatch, account.accountNumber, loggedInUserRights.data.isAccountSameAsLoggedInAccount(account.accountNumber), loggedInUsersAccount.data);
56
- });
41
+ };
57
42
  const onInternalAccountSelect = (accounts) => {
58
43
  if (!isArray(accounts))
59
44
  return;
@@ -71,38 +56,14 @@ function AccountSelector(props) {
71
56
  name: loggedInUserRights.data.getAccountName(),
72
57
  });
73
58
  };
59
+ if (isEmpty(loggedInUserRights.data))
60
+ return React.createElement(React.Fragment, null);
74
61
  const selectedAccount = {
75
62
  name: selectedAccountDetails.data.name,
76
63
  accountNumber: selectedAccountDetails.data.accountNumber,
77
64
  subscriptionAbuse: selectedAccountDetails.data.subscriptionAbuse,
78
65
  };
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);
104
66
  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" }),
106
67
  React.createElement("div", { className: "account-selector-label-wrapper pf-u-display-flex" },
107
68
  React.createElement("label", { htmlFor: "account-selector" },
108
69
  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: { isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
38
+ const { routeState: { showValidationErrorAlert }, } = 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: isNextBtnClickedToShowValidationError && 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: showValidationErrorAlert && 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":"AA8BA,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAMD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,eAiU7C"}
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"}
@@ -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/isEmpty';
21
+ import { isEmpty } from 'lodash';
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,7 +28,6 @@ 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';
32
31
  import { RemoteSessionAgreement } from './RequestRemoteSession';
33
32
  export function CaseDetailsAside(props) {
34
33
  var _a;
@@ -75,7 +74,6 @@ export function CaseDetailsAside(props) {
75
74
  const { getOriginalCaseView, updateOriginalCaseView } = useUserPreferences();
76
75
  const [viewAsInternalPref, setViewAsInternalPref] = useState();
77
76
  const [isDefaultBoxChecked, setIsDefaultBoxChecked] = useState(true);
78
- const { isExportingPDF } = useContext(PDFContext);
79
77
  useEffect(() => {
80
78
  const userPreferredCaseView = () => __awaiter(this, void 0, void 0, function* () {
81
79
  try {
@@ -163,8 +161,8 @@ export function CaseDetailsAside(props) {
163
161
  return t('View internal information available to Red Hat associates only.');
164
162
  }
165
163
  };
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' : ''}` },
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" },
168
166
  React.createElement(Button, { variant: "link", isInline: true, title: t('Collapse sidebar') },
169
167
  React.createElement("span", null,
170
168
  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,eA0ejD"}
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"}
@@ -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 ${isExportingPDF ? 'hide-in-pdf' : ''}`, isDisabled: !canManageCase || (caseOverviewState.caseStatusUpdating && isCaseUpdating) }, (caseOverviewState.caseStatusUpdating &&
239
+ React.createElement(Button, Object.assign({ className: "pf-u-ml-md", 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
@@ -1 +1 @@
1
- {"version":3,"file":"CaseSolutions.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseSolutions/CaseSolutions.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAgE3E,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB,EAAE,OAAO,CAAC;CACnC;AAUD,eAAO,MAAM,aAAa,+EAkZxB,CAAC"}
1
+ {"version":3,"file":"CaseSolutions.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseSolutions/CaseSolutions.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAsD,MAAM,OAAO,CAAC;AA+D3E,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB,EAAE,OAAO,CAAC;CACnC;AAUD,eAAO,MAAM,aAAa,+EAoYxB,CAAC"}
@@ -34,7 +34,6 @@ import { useCaseUpdateErrorMessage } from '../../../hooks/useCaseUpdateErrorMess
34
34
  import { updateCaseDetails } from '../../../reducers/CaseReducer';
35
35
  import { fetchRecommendations } from '../../../reducers/RecommendationsReducer';
36
36
  import { CaseSolutionsItem } from './CaseSolutionsItem';
37
- import { HandpickedItem } from './HandpickedItem';
38
37
  // some of the pinned and hadpicked titles are set to 'Red Hat Knowledge Base'
39
38
  // this workaround is added till backend fix
40
39
  const titleFix = (recommendations, allDocs) => __awaiter(void 0, void 0, void 0, function* () {
@@ -95,8 +94,7 @@ export const CaseSolutions = forwardRef((props, ref) => {
95
94
  const recommendationsDispatch = useRecommendationDispatchContext();
96
95
  const { caseNumber, isSecureSupportAccount } = props;
97
96
  const [isPinLoading, setIsPinLoading] = useState({});
98
- const [handPickedOpen, setHandPickedOpen] = useState(false);
99
- const [pinnedOpen, setPinnedOpen] = useState(false);
97
+ const [expanded, setExpanded] = useState('sol-handpicked');
100
98
  const [recommendations, setRecommendations] = useState([]);
101
99
  const [topRecommendations, setTopRecommendations] = useState([]);
102
100
  const ability = useContext(AbilityContext);
@@ -207,49 +205,49 @@ export const CaseSolutions = forwardRef((props, ref) => {
207
205
  }
208
206
  }, [allDocs, isFetchingCaseDetails, isLoadingRecommendations, recomendationsObj]);
209
207
  const renderTopRecommendations = (recommendation, index, type) => (React.createElement(React.Fragment, null,
210
- canPinUnpin && (React.createElement(CaseSolutionsItem, { showPin: true, type: type, pinTitle: recommendation.isPinned ? t('Unpin') : t('Pin'), isPinLoading: isPinLoading, index: index, recommendation: recommendation, onPinClicked: updateRecommendations(recommendation, recommendation.isPinned, undefined) })),
211
- canLinkUnlink && (React.createElement(CaseSolutionsItem, { showLink: true, type: type, pinTitle: recommendation.isLinked ? t('Unlink') : t('Link'), isPinLoading: isPinLoading, index: index, recommendation: recommendation, onPinClicked: updateRecommendations(recommendation, undefined, recommendation.isLinked) }))));
208
+ canPinUnpin && (React.createElement(CaseSolutionsItem, { showPin: true, type: type, pinTitle: recommendation.isPinned ? 'Unpin' : 'Pin', isPinLoading: isPinLoading, index: index, recommendation: recommendation, onPinClicked: updateRecommendations(recommendation, recommendation.isPinned, undefined) })),
209
+ canLinkUnlink && (React.createElement(CaseSolutionsItem, { showLink: true, type: type, pinTitle: recommendation.isLinked ? 'Unlink' : 'Link', isPinLoading: isPinLoading, index: index, recommendation: recommendation, onPinClicked: updateRecommendations(recommendation, undefined, recommendation.isLinked) }))));
212
210
  // customer logged in: we show pins and perform pin/unpin
213
- const renderPinsByCustomer = (recommendation, index, type) => (React.createElement(CaseSolutionsItem, { showPin: true, isPinned: true, type: type, pinTitle: recommendation.isPinned ? t('Unpin') : t('Pin'), isPinLoading: isPinLoading, index: index, recommendation: recommendation, onPinClicked: updateRecommendations(recommendation, recommendation.isPinned, undefined) }));
211
+ const renderPinsByCustomer = (recommendation, index, type) => (React.createElement(CaseSolutionsItem, { showPin: true, type: type, pinTitle: recommendation.isPinned ? 'Unpin' : 'Pin', isPinLoading: isPinLoading, index: index, recommendation: recommendation, onPinClicked: updateRecommendations(recommendation, recommendation.isPinned, undefined) }));
214
212
  // customer logged in: we show links but perform pin/unpin
215
- const renderHandpickedCustomerView = (recommendation, index, type) => (React.createElement(HandpickedItem, { type: type, pinTitle: recommendation.isPinnedAndLinked ? t('Unpin') : t('Pin'), isPinLoading: isPinLoading, index: index, recommendation: recommendation, onPinClicked: updateRecommendations(recommendation, recommendation.isPinned, undefined) }));
213
+ const renderHandpickedCustomerView = (recommendation, index, type) => (React.createElement(CaseSolutionsItem, { showPin: true, type: type, pinTitle: recommendation.isPinnedAndLinked ? 'Unpin' : 'Pin', isPinLoading: isPinLoading, index: index, recommendation: recommendation, onPinClicked: updateRecommendations(recommendation, recommendation.isPinned, undefined) }));
216
214
  // redhatter logged in: we show pins but perform link/unlink
217
- const renderPinnedByCustomerRedhatterView = (recommendation, index, type) => (React.createElement(CaseSolutionsItem, { showLink: true, type: type, pinTitle: recommendation.isPinnedAndLinked ? t('Unpin') : t('Pin'), isPinLoading: isPinLoading, index: index, recommendation: recommendation, onPinClicked: updateRecommendations(recommendation, undefined, recommendation.isLinked) }));
215
+ const renderPinnedByCustomerRedhatterView = (recommendation, index, type) => (React.createElement(CaseSolutionsItem, { showLink: true, type: type, pinTitle: recommendation.isPinnedAndLinked ? 'Unpin' : 'Pin', isPinLoading: isPinLoading, index: index, recommendation: recommendation, onPinClicked: updateRecommendations(recommendation, undefined, recommendation.isLinked) }));
218
216
  // redhatter logged in: we show links and perform link/unlink
219
- const renderHandPickedByRedHatter = (recommendation, index, type) => (React.createElement("div", { className: "pf-u-ml-lg" },
220
- React.createElement(CaseSolutionsItem, { showLink: true, type: type, pinTitle: recommendation.isLinked ? t('Unlink') : t('Link'), isPinLoading: isPinLoading, index: index, recommendation: recommendation, onPinClicked: updateRecommendations(recommendation, undefined, recommendation.isLinked) })));
221
- const linkedRecommendations = recommendations.filter((r) => r.isLinked);
222
- const pinnedRecommendations = recommendations.filter((r) => r.isPinned);
217
+ const renderHandPickedByRedHatter = (recommendation, index, type) => (React.createElement(CaseSolutionsItem, { showLink: true, type: type, pinTitle: recommendation.isLinked ? 'Unlink' : 'Link', isPinLoading: isPinLoading, index: index, recommendation: recommendation, onPinClicked: updateRecommendations(recommendation, undefined, recommendation.isLinked) }));
218
+ const setExpandedSection = (id) => {
219
+ expanded === id ? setExpanded('') : setExpanded(id);
220
+ };
223
221
  return (React.createElement(React.Fragment, null,
224
- React.createElement(Accordion, { isBordered: true, asDefinitionList: false, className: "card card-white case-details-aside-solutions" },
225
- React.createElement(AccordionItem, null,
226
- React.createElement(AccordionToggle, { id: "sol-handpicked", isExpanded: handPickedOpen, onClick: () => setHandPickedOpen((pre) => !pre) },
227
- React.createElement("span", null, canLinkUnlink ? React.createElement(Trans, null, "Handpicked by you") : React.createElement(Trans, null, "Handpicked for this case")),
228
- React.createElement("span", { className: "badge-item pf-u-font-size-sm pf-u-mx-sm" }, linkedRecommendations.length)),
229
- React.createElement(AccordionContent, { isHidden: !handPickedOpen }, !hasLink ? (React.createElement(Trans, null, "If a Red Hat engineer finds an article or solution that can help with your case, they'll pin it here.")) : (React.createElement(PaginatedList, { id: "case-details-handpicked-recommendations", listItems: linkedRecommendations.map((rec, index) => canLinkUnlink
230
- ? renderHandPickedByRedHatter(rec, index, 'handpicked-recommendations')
231
- : renderHandpickedCustomerView(rec, index, 'handpicked-recommendations')), perPage: 5, className: "list-icons list-icons-flush", isFetching: !!isLoadingRecommendations, perPageOptions: [
232
- { title: '5', value: 5 },
233
- { title: '10', value: 10 },
234
- ] })))),
235
- React.createElement(AccordionItem, null,
236
- React.createElement(AccordionToggle, { id: "sol-pinned", isExpanded: pinnedOpen, onClick: () => setPinnedOpen((pre) => !pre) },
237
- React.createElement("span", null, canLinkUnlink ? (React.createElement(Trans, null, "Pinned by customer")) : (React.createElement(Trans, null, "My pinned recommendations"))),
238
- React.createElement("span", { className: "badge-item pf-u-font-size-sm pf-u-mx-sm" }, pinnedRecommendations.length)),
239
- React.createElement(AccordionContent, { isHidden: !pinnedOpen }, !hasPin ? (React.createElement(Trans, null, "When you save a recommended article or solution, you'll see it here. Saved items display only in this case and are not saved for later.")) : (React.createElement(PaginatedList, { id: "case-details-pinned-recommendations", listItems: pinnedRecommendations.map((rec, index) => canLinkUnlink
240
- ? renderPinnedByCustomerRedhatterView(rec, index, 'pinned-recommendations')
241
- : renderPinsByCustomer(rec, index, 'pinned-recommendations')), perPage: 5, className: "list-icons list-icons-flush", isFetching: !!isLoadingRecommendations, perPageOptions: [
242
- { title: '5', value: 5 },
243
- { title: '10', value: 10 },
244
- ] }))))),
245
222
  topRecommendations.length > 0 && (React.createElement("div", { className: "card card-white card-support recommendations", ref: ref },
246
223
  React.createElement("h3", { className: "card-heading" },
247
- React.createElement(Trans, null, "Knowledgebase recommendations")),
224
+ React.createElement(Trans, null, "Top recommendations")),
248
225
  React.createElement("div", { className: "card-body" },
249
- React.createElement(PaginatedList, { id: "case-details-top-recommendations", className: "list-icons list-icons-flush", listItems: topRecommendations
250
- .filter((r) => !pinnedRecommendations.some((pr) => pr.resourceId === r.resourceId))
251
- .map((rec, index) => renderTopRecommendations(rec, index, 'top-recommendations')), perPage: 5, isFetching: !!isLoadingRecommendations, perPageOptions: [
226
+ React.createElement(PaginatedList, { id: "case-details-top-recommendations", className: "list-icons list-icons-flush", listItems: topRecommendations.map((rec, index) => renderTopRecommendations(rec, index, 'top-recommendations')), perPage: 5, isFetching: !!isLoadingRecommendations, perPageOptions: [
252
227
  { title: '5', value: 5 },
253
228
  { title: '10', value: 10 },
254
- ] }))))));
229
+ ] })))),
230
+ (hasPin || hasLink) && (React.createElement(Accordion, { asDefinitionList: false, className: "card card-white case-details-aside-solutions" },
231
+ hasLink && (React.createElement(AccordionItem, null,
232
+ React.createElement(AccordionToggle, { id: "sol-handpicked", isExpanded: expanded === 'sol-handpicked', onClick: () => setExpandedSection('sol-handpicked') }, canLinkUnlink ? React.createElement(Trans, null, "Handpicked by you") : React.createElement(Trans, null, "Handpicked for you")),
233
+ React.createElement(AccordionContent, { isHidden: expanded !== 'sol-handpicked' },
234
+ React.createElement(PaginatedList, { id: "case-details-handpicked-recommendations", listItems: recommendations
235
+ .filter((r) => r.isLinked)
236
+ .map((rec, index) => canLinkUnlink
237
+ ? renderHandPickedByRedHatter(rec, index, 'handpicked-recommendations')
238
+ : renderHandpickedCustomerView(rec, index, 'handpicked-recommendations')), perPage: 5, className: "list-icons list-icons-flush", isFetching: !!isLoadingRecommendations, perPageOptions: [
239
+ { title: '5', value: 5 },
240
+ { title: '10', value: 10 },
241
+ ] })))),
242
+ hasPin && (React.createElement(AccordionItem, null,
243
+ React.createElement(AccordionToggle, { id: "sol-pinned", isExpanded: expanded === 'sol-pinned', onClick: () => setExpandedSection('sol-pinned') }, canLinkUnlink ? React.createElement(Trans, null, "Pinned by customer") : React.createElement(Trans, null, "Your pins")),
244
+ React.createElement(AccordionContent, { isHidden: expanded !== 'sol-pinned' },
245
+ React.createElement(PaginatedList, { id: "case-details-pinned-recommendations", listItems: recommendations
246
+ .filter((r) => r.isPinned)
247
+ .map((rec, index) => canLinkUnlink
248
+ ? renderPinnedByCustomerRedhatterView(rec, index, 'pinned-recommendations')
249
+ : renderPinsByCustomer(rec, index, 'pinned-recommendations')), perPage: 5, className: "list-icons list-icons-flush", isFetching: !!isLoadingRecommendations, perPageOptions: [
250
+ { title: '5', value: 5 },
251
+ { title: '10', value: 10 },
252
+ ] }))))))));
255
253
  });
@@ -1,7 +1,6 @@
1
1
  import { ICaseResourceLink } from '@cee-eng/hydrajs/@types/api/public/case';
2
2
  interface IProps {
3
3
  showPin?: boolean;
4
- isPinned?: boolean;
5
4
  showLink?: boolean;
6
5
  pinTitle: string;
7
6
  index: number;
@@ -10,7 +9,7 @@ interface IProps {
10
9
  onPinClicked: () => void;
11
10
  type: string;
12
11
  }
13
- export interface ICaseDetailAsideRecommendation extends Partial<ICaseResourceLink> {
12
+ interface ICaseDetailAsideRecommendation extends Partial<ICaseResourceLink> {
14
13
  isPinned?: boolean;
15
14
  isLinked?: boolean;
16
15
  solutionAbstract?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"CaseSolutionsItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseSolutions/CaseSolutionsItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAS5E,UAAU,MAAM;IACZ,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,8BAA8B,CAAC;IAC/C,YAAY,EAAE,GAAG,CAAC;IAClB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,8BAA+B,SAAQ,OAAO,CAAC,iBAAiB,CAAC;IAC9E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,eAgD9C"}
1
+ {"version":3,"file":"CaseSolutionsItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseSolutions/CaseSolutionsItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAQ5E,UAAU,MAAM;IACZ,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,8BAA8B,CAAC;IAC/C,YAAY,EAAE,GAAG,CAAC;IAClB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,8BAA+B,SAAQ,OAAO,CAAC,iBAAiB,CAAC;IACvE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,eAwC9C"}
@@ -1,7 +1,6 @@
1
1
  import { Button } from '@patternfly/react-core';
2
2
  import LinkIcon from '@patternfly/react-icons/dist/js/icons/link-icon';
3
- import OutlinedStarIcon from '@patternfly/react-icons/dist/js/icons/outlined-star-icon';
4
- import StarIcon from '@patternfly/react-icons/dist/js/icons/star-icon';
3
+ import ThumbTackIcon from '@patternfly/react-icons/dist/js/icons/thumb-tack-icon';
5
4
  import { LoadingIndicator } from '@rh-support/components';
6
5
  import { cleanupMarkDown, decodeMarkTag, truncate } from '@rh-support/utils';
7
6
  import React from 'react';
@@ -9,11 +8,11 @@ export function CaseSolutionsItem(props) {
9
8
  const maxTitleLength = 150;
10
9
  const maxAbstractLength = 150;
11
10
  const isLoading = !!props.isPinLoading[props.recommendation.resourceId];
12
- return (React.createElement("div", null,
11
+ return (React.createElement(React.Fragment, null,
13
12
  React.createElement("div", { className: "recommendation-header" },
14
13
  React.createElement(Button, { title: props.pinTitle, onClick: props.onPinClicked, "data-tracking-id": `case-resource-${props.pinTitle}`, variant: "plain", className: "list-icon" },
15
14
  isLoading && React.createElement(LoadingIndicator, { show: isLoading, size: "xs" }),
16
- !isLoading && props.showPin && (React.createElement(React.Fragment, null, props.isPinned ? (React.createElement(StarIcon, { className: "pinned-resource" })) : (React.createElement(OutlinedStarIcon, { className: "pinned-resource" })))),
15
+ !isLoading && props.showPin && React.createElement(ThumbTackIcon, { className: "pinned-resource" }),
17
16
  !isLoading && props.showLink && React.createElement(LinkIcon, null)),
18
17
  React.createElement("a", { href: props.recommendation.resourceViewURI, "data-tracking-id": `case-resource-${props.type}-link-${props.index}`, target: "_blank", rel: "noopener noreferrer", dangerouslySetInnerHTML: {
19
18
  __html: truncate(decodeMarkTag(props.recommendation.title || ''), maxTitleLength),
@@ -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/isEmpty';
13
+ import { isEmpty } from 'lodash';
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":"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"}
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"}
@@ -11,13 +11,8 @@ 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 from 'lodash/filter';
15
- import find from 'lodash/find';
16
- import get from 'lodash/get';
17
- import isEmpty from 'lodash/isEmpty';
14
+ import { filter, find, get, isEmpty, map, merge } from 'lodash';
18
15
  import isEqual from 'lodash/isEqual';
19
- import map from 'lodash/map';
20
- import merge from 'lodash/merge';
21
16
  import React, { useContext, useEffect, useState } from 'react';
22
17
  import { Typeahead } from 'react-bootstrap-typeahead';
23
18
  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,eA+D1D"}
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"}
@@ -28,10 +28,11 @@ 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();
31
32
  return (React.createElement(React.Fragment, null,
32
33
  React.createElement(PartnerCaseHelper, { setIsUpdatingPartners: setIsUpdatingPartner, caseNumber: props.caseNumber, routeProps: props.routeProps }),
33
34
  React.createElement("section", { className: "card card-white" },
34
- React.createElement("form", null,
35
+ React.createElement("form", { onSubmit: handleFormSubmit },
35
36
  React.createElement(Flex, { direction: { default: 'column', '2xl': 'row' } },
36
37
  React.createElement(FlexItem, { flex: { default: 'flex_1' } },
37
38
  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/isEqual';
6
+ import { isEqual } from 'lodash';
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/findIndex';
15
+ import { findIndex } from 'lodash';
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: { isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
45
+ const { routeState: { showValidationErrorAlert }, } = 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 && isNextBtnClickedToShowValidationError && isCaseGroupInvalid;
166
+ const showEmptyValidationError = !caseNumber && showValidationErrorAlert && 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;AASvD,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,eAyGpD"}
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"}
@@ -5,6 +5,7 @@ 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';
8
9
  import { useCaseSelector } from '../../context/CaseContext';
9
10
  import { OpenShiftClusterId } from '../CaseManagement/OpenShiftClusterId';
10
11
  import { Hostname } from '../ImproveCase/Hostname';
@@ -13,6 +14,7 @@ import ClusterRecommendations from '../Recommendations/ClusterRecommendations';
13
14
  import Description from './Description';
14
15
  export default function CaseInformation(props) {
15
16
  const { t } = useTranslation();
17
+ const { appMetadataState: { nextButtonRef }, } = useContext(AppMetadataStateContext);
16
18
  const { globalMetadataState: { allCaseTypes, allCaseSeverities, caseLanguages, loggedInUser, loggedInUserJwtToken, loggedInUsersAccount, }, } = useContext(GlobalMetadataStateContext);
17
19
  const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
18
20
  const { contactSSOName, selectedAccountDetails, ownersCaseGroups, hasInvalidEntitlements } = useCaseSelector((state) => ({
@@ -31,6 +33,11 @@ export default function CaseInformation(props) {
31
33
  (selectedAccountDetails.data.requireCGroupOnCreate && ownersCaseGroups.isError) ||
32
34
  allCaseSeverities.isError);
33
35
  };
36
+ const handleFormSubmit = (e) => {
37
+ e.preventDefault();
38
+ // simulating click
39
+ nextButtonRef.current.click();
40
+ };
34
41
  // Loading metadata (if needed) on component mount after fetching account info.
35
42
  // This will be fetched here in caseCreation mode as Issue section will be skipped.
36
43
  useEffect(() => {
@@ -77,7 +84,7 @@ export default function CaseInformation(props) {
77
84
  !isMetadataLoading() &&
78
85
  !isMetadataLoadingError() &&
79
86
  canManageCase(loggedInUserJwtToken) && (React.createElement(React.Fragment, null,
80
- React.createElement("form", null,
87
+ React.createElement("form", { onSubmit: handleFormSubmit },
81
88
  React.createElement(Hostname, null),
82
89
  React.createElement(OpenShiftClusterId, null),
83
90
  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,eAwGhD"}
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"}
@@ -30,7 +30,7 @@ export default function Description(props) {
30
30
  const onCaseDetailsChange = (caseDetails) => {
31
31
  setCaseDetails(caseDispatch, caseDetails);
32
32
  };
33
- const { routeState: { isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
33
+ const { routeState: { showValidationErrorAlert }, } = 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,9 +45,7 @@ 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) || (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') }),
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') }),
51
49
  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
52
50
  ? `Description cannot be more than ${CASE_DEATILS_ISSUE_LIMIT} characters`
53
51
  : ''}`),
@@ -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: { isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
27
+ const { routeState: { showValidationErrorAlert }, } = 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 || (isNextBtnClickedToShowValidationError && !summary)
56
+ : 'get-support-summary', className: `form-control${isSummaryInValid || hasLargeSummary || (showValidationErrorAlert && !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';
6
7
  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":"AAiBA,MAAM,WAAW,MAAM;CAAG;AAC1B,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,MAAM,eA4BnD"}
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,5 +1,6 @@
1
1
  import { Flex, FlexItem } from '@patternfly/react-core';
2
- import React from 'react';
2
+ import React, { useContext } from 'react';
3
+ import { AppMetadataStateContext } from '../../context/AppMetadataContext';
3
4
  import { useCaseDispatch } from '../../context/CaseContext';
4
5
  import { setCaseDetails } from '../../reducers/CaseReducer';
5
6
  import CaseGroup from '../CaseInformation/CaseGroup';
@@ -15,10 +16,16 @@ import { RHAssociatesSelector } from './RHAssociatesSelector';
15
16
  import CaseContactSelector from './SendNotifications/CaseContactSelector';
16
17
  export default function CaseManagement(props) {
17
18
  const caseDispatch = useCaseDispatch();
19
+ const { appMetadataState: { nextButtonRef }, } = useContext(AppMetadataStateContext);
20
+ const handleFormSubmit = (e) => {
21
+ e.preventDefault();
22
+ // simulating click
23
+ nextButtonRef.current.click();
24
+ };
18
25
  const onSeverityChange = (payload) => {
19
26
  setCaseDetails(caseDispatch, payload);
20
27
  };
21
- return (React.createElement("form", null,
28
+ return (React.createElement("form", { onSubmit: handleFormSubmit },
22
29
  React.createElement(SupportLevel, null),
23
30
  React.createElement(Flex, { direction: { default: 'column', '2xl': 'row' } },
24
31
  React.createElement(FlexItem, { flex: { default: 'flex_1' } },
@@ -2,9 +2,5 @@ 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
- interface IProps {
6
- className?: string;
7
- }
8
- export declare function OpenShiftClusterId(props: IProps): JSX.Element;
9
- export {};
5
+ export declare function OpenShiftClusterId(): JSX.Element;
10
6
  //# sourceMappingURL=OpenShiftClusterId.d.ts.map