@rh-support/troubleshoot 2.0.5 → 2.0.7
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.
- package/lib/esm/components/AccountInfo/AccountSelector.d.ts.map +1 -1
- package/lib/esm/components/AccountInfo/AccountSelector.js +44 -5
- package/lib/esm/components/AccountInfo/OwnerSelector.js +2 -2
- package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsAside.js +5 -3
- package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.js +1 -1
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutions.js +38 -36
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts +2 -1
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseSolutions/CaseSolutionsItem.js +4 -3
- package/lib/esm/components/CaseEditView/CaseSolutions/HandpickedItem.d.ts +12 -0
- package/lib/esm/components/CaseEditView/CaseSolutions/HandpickedItem.d.ts.map +1 -0
- package/lib/esm/components/CaseEditView/CaseSolutions/HandpickedItem.js +14 -0
- package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +1 -1
- package/lib/esm/components/CaseEditView/ShareCase/PartnerShare.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ShareCase/PartnerShare.js +6 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +1 -2
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseInformation.js +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/useCustomEmails.js +1 -1
- package/lib/esm/components/CaseInformation/CaseGroup.js +2 -2
- package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseInformation.js +1 -8
- package/lib/esm/components/CaseInformation/Description.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Description.js +4 -2
- package/lib/esm/components/CaseInformation/OpenCaseIssue.js +2 -2
- package/lib/esm/components/CaseInformation/Severity.js +1 -1
- package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/CaseManagement.js +2 -9
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts +5 -1
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +7 -7
- package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/SendNotifications/CaseContactSelector.js +4 -1
- package/lib/esm/components/IdeaInformation/IdeaInformtion.d.ts.map +1 -1
- package/lib/esm/components/IdeaInformation/IdeaInformtion.js +1 -8
- package/lib/esm/components/ImproveCase/KtQuestions.js +2 -2
- package/lib/esm/components/Issue/Issue.d.ts.map +1 -1
- package/lib/esm/components/Issue/Issue.js +1 -2
- package/lib/esm/components/OpenCase/OpenCase.d.ts.map +1 -1
- package/lib/esm/components/OpenCase/OpenCase.js +2 -9
- package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +2 -2
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.js +1 -1
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts +1 -1
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +3 -3
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts +1 -1
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +3 -3
- package/lib/esm/components/ProductSelector/ProductSelector.js +1 -2
- package/lib/esm/components/ProductSelector/ProductSelectorLoader.d.ts +1 -2
- package/lib/esm/components/ProductSelector/ProductSelectorLoader.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductSelectorLoader.js +12 -19
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +3 -3
- package/lib/esm/components/Recommendations/AlertToastWrapper.js +4 -5
- package/lib/esm/components/Recommendations/ClusterRecommendationToast.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendationToast.js +2 -1
- package/lib/esm/components/Recommendations/ClusterRecommendations.js +1 -1
- package/lib/esm/components/Recommendations/CriticalSolutionsToast.d.ts.map +1 -1
- package/lib/esm/components/SessionRestore/RestoreLastSessionModal.js +1 -1
- package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
- package/lib/esm/components/SessionRestore/SessionRestore.js +4 -9
- package/lib/esm/components/SubmitCase/ResubmitToast.js +1 -1
- package/lib/esm/components/SubmitCase/SubmitCase.d.ts.map +1 -1
- package/lib/esm/components/SubmitCase/SubmitCase.js +8 -5
- package/lib/esm/components/Suggestions/TopContent.js +1 -1
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.d.ts.map +1 -1
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +4 -3
- package/lib/esm/components/shared/useIsSectionValid.d.ts +1 -1
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +5 -24
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +40 -80
- package/lib/esm/components/wizardLayout/MainSection.d.ts +5 -3
- package/lib/esm/components/wizardLayout/MainSection.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/MainSection.js +4 -4
- package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardAside.js +3 -10
- package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardLayout.js +31 -42
- package/lib/esm/components/wizardLayout/WizardMain.d.ts +2 -3
- package/lib/esm/components/wizardLayout/WizardMain.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardMain.js +43 -163
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts +7 -3
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +46 -90
- package/lib/esm/components/wizardLayout/index.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/index.js +2 -10
- package/lib/esm/context/RootTroubleshootProvider.d.ts.map +1 -1
- package/lib/esm/context/RootTroubleshootProvider.js +7 -9
- package/lib/esm/css/app.css +0 -450
- package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
- package/lib/esm/hooks/useResetCaseCreate.js +0 -4
- package/lib/esm/hooks/useWizard.d.ts +4 -0
- package/lib/esm/hooks/useWizard.d.ts.map +1 -0
- package/lib/esm/hooks/useWizard.js +128 -0
- package/lib/esm/reducers/RouteConstNTypes.d.ts +21 -1
- package/lib/esm/reducers/RouteConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/RouteConstNTypes.js +43 -0
- package/lib/esm/reducers/RouteReducer.d.ts +13 -47
- package/lib/esm/reducers/RouteReducer.d.ts.map +1 -1
- package/lib/esm/reducers/RouteReducer.js +36 -165
- package/lib/esm/scss/_main.scss +112 -791
- package/lib/esm/utils/routeUtils.d.ts +3 -9
- package/lib/esm/utils/routeUtils.d.ts.map +1 -1
- package/lib/esm/utils/routeUtils.js +14 -41
- package/package.json +14 -25
- package/lib/esm/components/wizardLayout/WizardProgress.d.ts +0 -13
- package/lib/esm/components/wizardLayout/WizardProgress.d.ts.map +0 -1
- package/lib/esm/components/wizardLayout/WizardProgress.js +0 -108
- package/lib/esm/context/AppMetadataContext.d.ts +0 -11
- package/lib/esm/context/AppMetadataContext.d.ts.map +0 -1
- package/lib/esm/context/AppMetadataContext.js +0 -13
- package/lib/esm/reducers/AppMetadataReducer.d.ts +0 -28
- package/lib/esm/reducers/AppMetadataReducer.d.ts.map +0 -1
- 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;
|
|
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: {
|
|
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:
|
|
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":"
|
|
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
|
|
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:
|
|
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,
|
|
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:
|
|
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
|
|
@@ -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;
|
|
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"}
|
|
@@ -34,6 +34,7 @@ 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';
|
|
37
38
|
// some of the pinned and hadpicked titles are set to 'Red Hat Knowledge Base'
|
|
38
39
|
// this workaround is added till backend fix
|
|
39
40
|
const titleFix = (recommendations, allDocs) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -94,7 +95,8 @@ export const CaseSolutions = forwardRef((props, ref) => {
|
|
|
94
95
|
const recommendationsDispatch = useRecommendationDispatchContext();
|
|
95
96
|
const { caseNumber, isSecureSupportAccount } = props;
|
|
96
97
|
const [isPinLoading, setIsPinLoading] = useState({});
|
|
97
|
-
const [
|
|
98
|
+
const [handPickedOpen, setHandPickedOpen] = useState(false);
|
|
99
|
+
const [pinnedOpen, setPinnedOpen] = useState(false);
|
|
98
100
|
const [recommendations, setRecommendations] = useState([]);
|
|
99
101
|
const [topRecommendations, setTopRecommendations] = useState([]);
|
|
100
102
|
const ability = useContext(AbilityContext);
|
|
@@ -205,49 +207,49 @@ export const CaseSolutions = forwardRef((props, ref) => {
|
|
|
205
207
|
}
|
|
206
208
|
}, [allDocs, isFetchingCaseDetails, isLoadingRecommendations, recomendationsObj]);
|
|
207
209
|
const renderTopRecommendations = (recommendation, index, type) => (React.createElement(React.Fragment, null,
|
|
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) }))));
|
|
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) }))));
|
|
210
212
|
// customer logged in: we show pins and perform pin/unpin
|
|
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) }));
|
|
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) }));
|
|
212
214
|
// customer logged in: we show links but perform pin/unpin
|
|
213
|
-
const renderHandpickedCustomerView = (recommendation, index, type) => (React.createElement(
|
|
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) }));
|
|
214
216
|
// redhatter logged in: we show pins but perform link/unlink
|
|
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) }));
|
|
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) }));
|
|
216
218
|
// redhatter logged in: we show links and perform link/unlink
|
|
217
|
-
const renderHandPickedByRedHatter = (recommendation, index, type) => (React.createElement(
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
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);
|
|
221
223
|
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
|
+
] }))))),
|
|
222
245
|
topRecommendations.length > 0 && (React.createElement("div", { className: "card card-white card-support recommendations", ref: ref },
|
|
223
246
|
React.createElement("h3", { className: "card-heading" },
|
|
224
|
-
React.createElement(Trans, null, "
|
|
247
|
+
React.createElement(Trans, null, "Knowledgebase recommendations")),
|
|
225
248
|
React.createElement("div", { className: "card-body" },
|
|
226
|
-
React.createElement(PaginatedList, { id: "case-details-top-recommendations", className: "list-icons list-icons-flush", listItems: topRecommendations
|
|
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: [
|
|
227
252
|
{ title: '5', value: 5 },
|
|
228
253
|
{ title: '10', value: 10 },
|
|
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
|
-
] }))))))));
|
|
254
|
+
] }))))));
|
|
253
255
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ICaseResourceLink } from '@cee-eng/hydrajs/@types/api/public/case';
|
|
2
2
|
interface IProps {
|
|
3
3
|
showPin?: boolean;
|
|
4
|
+
isPinned?: boolean;
|
|
4
5
|
showLink?: boolean;
|
|
5
6
|
pinTitle: string;
|
|
6
7
|
index: number;
|
|
@@ -9,7 +10,7 @@ interface IProps {
|
|
|
9
10
|
onPinClicked: () => void;
|
|
10
11
|
type: string;
|
|
11
12
|
}
|
|
12
|
-
interface ICaseDetailAsideRecommendation extends Partial<ICaseResourceLink> {
|
|
13
|
+
export interface ICaseDetailAsideRecommendation extends Partial<ICaseResourceLink> {
|
|
13
14
|
isPinned?: boolean;
|
|
14
15
|
isLinked?: boolean;
|
|
15
16
|
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;
|
|
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,6 +1,7 @@
|
|
|
1
1
|
import { Button } from '@patternfly/react-core';
|
|
2
2
|
import LinkIcon from '@patternfly/react-icons/dist/js/icons/link-icon';
|
|
3
|
-
import
|
|
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';
|
|
4
5
|
import { LoadingIndicator } from '@rh-support/components';
|
|
5
6
|
import { cleanupMarkDown, decodeMarkTag, truncate } from '@rh-support/utils';
|
|
6
7
|
import React from 'react';
|
|
@@ -8,11 +9,11 @@ export function CaseSolutionsItem(props) {
|
|
|
8
9
|
const maxTitleLength = 150;
|
|
9
10
|
const maxAbstractLength = 150;
|
|
10
11
|
const isLoading = !!props.isPinLoading[props.recommendation.resourceId];
|
|
11
|
-
return (React.createElement(
|
|
12
|
+
return (React.createElement("div", null,
|
|
12
13
|
React.createElement("div", { className: "recommendation-header" },
|
|
13
14
|
React.createElement(Button, { title: props.pinTitle, onClick: props.onPinClicked, "data-tracking-id": `case-resource-${props.pinTitle}`, variant: "plain", className: "list-icon" },
|
|
14
15
|
isLoading && React.createElement(LoadingIndicator, { show: isLoading, size: "xs" }),
|
|
15
|
-
!isLoading && props.showPin && React.createElement(
|
|
16
|
+
!isLoading && props.showPin && (React.createElement(React.Fragment, null, props.isPinned ? (React.createElement(StarIcon, { className: "pinned-resource" })) : (React.createElement(OutlinedStarIcon, { className: "pinned-resource" })))),
|
|
16
17
|
!isLoading && props.showLink && React.createElement(LinkIcon, null)),
|
|
17
18
|
React.createElement("a", { href: props.recommendation.resourceViewURI, "data-tracking-id": `case-resource-${props.type}-link-${props.index}`, target: "_blank", rel: "noopener noreferrer", dangerouslySetInnerHTML: {
|
|
18
19
|
__html: truncate(decodeMarkTag(props.recommendation.title || ''), maxTitleLength),
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ICaseDetailAsideRecommendation } from './CaseSolutionsItem';
|
|
2
|
+
interface IProps {
|
|
3
|
+
pinTitle: string;
|
|
4
|
+
index: number;
|
|
5
|
+
recommendation: ICaseDetailAsideRecommendation;
|
|
6
|
+
isPinLoading: any;
|
|
7
|
+
onPinClicked: () => void;
|
|
8
|
+
type: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function HandpickedItem(props: IProps): JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=HandpickedItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HandpickedItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseSolutions/HandpickedItem.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAC;AAErE,UAAU,MAAM;IACZ,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,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,eA4B3C"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { cleanupMarkDown, decodeMarkTag, truncate } from '@rh-support/utils';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export function HandpickedItem(props) {
|
|
4
|
+
const maxAbstractLength = 150;
|
|
5
|
+
const maxTitleLength = 150;
|
|
6
|
+
return (React.createElement("div", { className: "pf-u-mx-sm" },
|
|
7
|
+
React.createElement("div", { className: "recommendation-header" },
|
|
8
|
+
React.createElement("a", { href: props.recommendation.resourceViewURI, "data-tracking-id": `case-resource-${props.type}-link-${props.index}`, target: "_blank", rel: "noopener noreferrer", dangerouslySetInnerHTML: {
|
|
9
|
+
__html: truncate(decodeMarkTag(props.recommendation.title || ''), maxTitleLength),
|
|
10
|
+
} })),
|
|
11
|
+
React.createElement("div", { className: "result-body", dangerouslySetInnerHTML: {
|
|
12
|
+
__html: truncate(cleanupMarkDown(decodeMarkTag(props.recommendation.solutionAbstract || '')), maxAbstractLength),
|
|
13
|
+
} })));
|
|
14
|
+
}
|
|
@@ -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
|
|
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":"
|
|
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
|
|
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,
|
|
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",
|
|
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
|
|
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
|
|
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: {
|
|
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 &&
|
|
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;
|
|
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",
|
|
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,
|
|
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: {
|
|
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) || (
|
|
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: {
|
|
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 || (
|
|
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":"
|
|
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"}
|