@rh-support/troubleshoot 2.6.270 → 2.6.273
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 +28 -40
- package/lib/esm/components/AccountInfo/css/accountSelector.css +3 -2
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.js +5 -2
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +3 -1
- package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Case.js +9 -5
- package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseOwnerInfo.js +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseType.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseType.js +2 -4
- package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.js +8 -6
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +38 -34
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +2 -4
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenShiftPopover.js +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +21 -59
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +1 -0
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +2 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +6 -5
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts +0 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.js +0 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +13 -33
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +5 -4
- package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummaryErrorMessage.js +1 -1
- package/lib/esm/components/CaseEditView/Tabs/RelatedTasks/RelatedTasks.js +1 -1
- package/lib/esm/components/CaseInformation/CaseGroup.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseGroup.js +11 -1
- package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseInformation.js +11 -9
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +37 -24
- package/lib/esm/components/CaseInformation/Description.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Description.js +17 -1
- package/lib/esm/components/CaseInformation/Severity.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Severity.js +1 -1
- package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/SupportLevel.js +33 -56
- package/lib/esm/components/CaseManagement/CaseLanguageSelector.js +2 -2
- package/lib/esm/components/CaseManagement/CaseManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/CaseManagement.js +4 -7
- package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.js +5 -4
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +1 -1
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +12 -6
- package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/SendNotifications/NonOrgCaseNotifyeesSelector.js +2 -1
- package/lib/esm/components/Cve/CvePanel.d.ts.map +1 -1
- package/lib/esm/components/Cve/CvePanel.js +16 -8
- package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
- package/lib/esm/components/IdeaInformation/IdeaInformation.js +14 -14
- package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
- package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +4 -2
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +0 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.js +3 -14
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +14 -42
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +19 -53
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.js +1 -3
- package/lib/esm/components/Recommendations/ClusterRecommendationItems.d.ts +2 -0
- package/lib/esm/components/Recommendations/ClusterRecommendationItems.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendationItems.js +16 -13
- package/lib/esm/components/Recommendations/ClusterRecommendations.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendations.js +1 -4
- package/lib/esm/components/Recommendations/EARules/EARule.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/EARules/EARule.js +3 -1
- package/lib/esm/components/Recommendations/InsightsResults.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/InsightsResults.js +4 -0
- package/lib/esm/components/RemoteRider/RemoteRiderAcceptanceModal.d.ts.map +1 -1
- package/lib/esm/components/Review/Review.d.ts.map +1 -1
- package/lib/esm/components/Review/Review.js +18 -11
- package/lib/esm/components/SessionRestore/SessionRestore.d.ts +2 -0
- package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
- package/lib/esm/components/SessionRestore/SessionRestore.js +23 -4
- package/lib/esm/components/TroubleshootSection/AskRedHat.d.ts +3 -1
- package/lib/esm/components/TroubleshootSection/AskRedHat.d.ts.map +1 -1
- package/lib/esm/components/TroubleshootSection/AskRedHat.js +8 -10
- package/lib/esm/components/TroubleshootSection/ResponseActions.d.ts.map +1 -1
- package/lib/esm/components/TroubleshootSection/ResponseActions.js +5 -3
- package/lib/esm/components/TroubleshootSection/TroubleshootSection.js +1 -1
- package/lib/esm/components/TroubleshootSection/UserFeedback.d.ts.map +1 -1
- package/lib/esm/components/TroubleshootSection/UserFeedback.js +10 -8
- package/lib/esm/components/TroubleshootSection/UserFeedbackComplete.d.ts.map +1 -1
- package/lib/esm/components/TroubleshootSection/UserFeedbackComplete.js +5 -1
- package/lib/esm/components/shared/fileUpload/WidgetFileUploader.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/WidgetFileUploader.js +2 -1
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +55 -69
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +34 -9
- package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardLayout.js +6 -7
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +10 -9
- package/lib/esm/constants/caseDetailsConstants.d.ts +10 -10
- package/lib/esm/constants/caseDetailsConstants.d.ts.map +1 -1
- package/lib/esm/constants/caseDetailsConstants.js +27 -11
- package/lib/esm/hooks/useARHResponse.d.ts.map +1 -1
- package/lib/esm/hooks/useARHResponse.js +4 -1
- package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
- package/lib/esm/hooks/useResetCaseCreate.js +13 -11
- package/lib/esm/i18n/template-de.d.ts +6 -0
- package/lib/esm/i18n/template-de.d.ts.map +1 -1
- package/lib/esm/i18n/template-de.js +6 -0
- package/lib/esm/i18n/template-es.d.ts +6 -0
- package/lib/esm/i18n/template-es.d.ts.map +1 -1
- package/lib/esm/i18n/template-es.js +6 -0
- package/lib/esm/i18n/template-fr.d.ts +6 -0
- package/lib/esm/i18n/template-fr.d.ts.map +1 -1
- package/lib/esm/i18n/template-fr.js +6 -0
- package/lib/esm/i18n/template-it.d.ts +6 -0
- package/lib/esm/i18n/template-it.d.ts.map +1 -1
- package/lib/esm/i18n/template-it.js +6 -0
- package/lib/esm/i18n/template-jp.d.ts +6 -0
- package/lib/esm/i18n/template-jp.d.ts.map +1 -1
- package/lib/esm/i18n/template-jp.js +6 -0
- package/lib/esm/i18n/template-ko.d.ts +6 -0
- package/lib/esm/i18n/template-ko.d.ts.map +1 -1
- package/lib/esm/i18n/template-ko.js +6 -0
- package/lib/esm/i18n/template-pt.d.ts +6 -0
- package/lib/esm/i18n/template-pt.d.ts.map +1 -1
- package/lib/esm/i18n/template-pt.js +6 -0
- package/lib/esm/i18n/template-ru.d.ts +6 -0
- package/lib/esm/i18n/template-ru.d.ts.map +1 -1
- package/lib/esm/i18n/template-ru.js +6 -0
- package/lib/esm/i18n/template-zh.d.ts +6 -0
- package/lib/esm/i18n/template-zh.d.ts.map +1 -1
- package/lib/esm/i18n/template-zh.js +6 -0
- package/lib/esm/reducers/CaseConstNTypes.d.ts +23 -0
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +9 -4
- package/lib/esm/reducers/CaseDiscussionTabReducer.js +1 -1
- package/lib/esm/reducers/CaseHelpers.d.ts +10 -7
- package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/CaseHelpers.js +58 -11
- package/lib/esm/reducers/CaseOverviewReducer.d.ts +3 -1
- package/lib/esm/reducers/CaseOverviewReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseOverviewReducer.js +7 -5
- package/lib/esm/reducers/CaseReducer.d.ts +16 -5
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +96 -24
- package/lib/esm/reducers/RulesReducer.d.ts +11 -4
- package/lib/esm/reducers/RulesReducer.d.ts.map +1 -1
- package/lib/esm/reducers/RulesReducer.js +6 -1
- package/lib/esm/reducers/SessionRestoreReducer.d.ts.map +1 -1
- package/lib/esm/reducers/SessionRestoreReducer.js +7 -4
- package/lib/esm/reducers/TopContentReducer.js +1 -1
- package/lib/esm/scss/_pf-overrides.scss +28 -2
- package/package.json +8 -10
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.css +0 -0
|
@@ -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,EAAE,MAAM,0BAA0B,CAAC;AAK5D,OAAO,KAA0C,MAAM,OAAO,CAAC;AAS/D,UAAU,MAAO,SAAQ,gBAAgB;CAAG;AAE5C,eAAO,MAAM,YAAY,EAAE,MAG1B,CAAC;AAEF,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"AccountSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/AccountInfo/AccountSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAC;AAOnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAK5D,OAAO,KAA0C,MAAM,OAAO,CAAC;AAS/D,UAAU,MAAO,SAAQ,gBAAgB;CAAG;AAE5C,eAAO,MAAM,YAAY,EAAE,MAG1B,CAAC;AAEF,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,qBAmKrC;kBAnKQ,eAAe;;;AAuKxB,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import './css/accountSelector.css';
|
|
11
|
-
import {
|
|
11
|
+
import { useApolloClient } from '@apollo/client/react';
|
|
12
12
|
import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
|
|
13
13
|
import { AlertMessage, AlertType } from '@rh-support/components';
|
|
14
14
|
import { AccountSelectorInternal, GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
@@ -30,12 +30,14 @@ export const defaultProps = {
|
|
|
30
30
|
function AccountSelector(props) {
|
|
31
31
|
var _a;
|
|
32
32
|
const [showNotEntitledMessage, setShowNotEntitledMessage] = useState(false);
|
|
33
|
-
const { accountNumber, selectedAccountDetails } = useCaseSelector((state) => ({
|
|
33
|
+
const { accountNumber, selectedAccountDetails, hasInvalidEntitlements } = useCaseSelector((state) => ({
|
|
34
34
|
accountNumber: state.caseDetails.accountNumberRef,
|
|
35
35
|
selectedAccountDetails: state.selectedAccountDetails,
|
|
36
|
+
hasInvalidEntitlements: state.hasInvalidEntitlements,
|
|
36
37
|
}), isEqual);
|
|
37
38
|
const isSelectedAccountSubscriptionAbused = ((_a = selectedAccountDetails === null || selectedAccountDetails === void 0 ? void 0 : selectedAccountDetails.data) === null || _a === void 0 ? void 0 : _a.subscriptionAbuse) || false;
|
|
38
39
|
const caseDispatch = useCaseDispatch();
|
|
40
|
+
const apolloClient = useApolloClient();
|
|
39
41
|
const routeDispatch = useRouteDispatchContext();
|
|
40
42
|
const { globalMetadataState: { bookmarkedGroupAccounts, loggedInUserRights, managedAccounts, loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
|
|
41
43
|
const { t } = useTranslation();
|
|
@@ -43,7 +45,7 @@ function AccountSelector(props) {
|
|
|
43
45
|
const ability = useContext(AbilityContext);
|
|
44
46
|
const canAccessManagedAccounts = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.MANAGED_ACCOUNTS);
|
|
45
47
|
const canBookmarkAccounts = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.BOOKMARK_ACCOUNTS);
|
|
46
|
-
const canUseFindMyAccount = loggedInUserRights.data.isAccountDifferentFromLoggedInAccount(accountNumber);
|
|
48
|
+
// const canUseFindMyAccount = loggedInUserRights.data.isAccountDifferentFromLoggedInAccount(accountNumber!);
|
|
47
49
|
// Account Change Handler
|
|
48
50
|
const onAccountChange = (account) => __awaiter(this, void 0, void 0, function* () {
|
|
49
51
|
if (selectedAccountDetails.data.accountNumber === account.accountNumber)
|
|
@@ -52,7 +54,7 @@ function AccountSelector(props) {
|
|
|
52
54
|
clearSelectedAccount(caseDispatch);
|
|
53
55
|
return;
|
|
54
56
|
}
|
|
55
|
-
setCaseAccountNumber(caseDispatch, account.accountNumber, loggedInUserRights.data.isAccountSameAsLoggedInAccount(account.accountNumber), loggedInUsersAccount.data);
|
|
57
|
+
setCaseAccountNumber(caseDispatch, account.accountNumber, loggedInUserRights.data.isAccountSameAsLoggedInAccount(account.accountNumber), loggedInUsersAccount.data, apolloClient);
|
|
56
58
|
});
|
|
57
59
|
const onInternalAccountSelect = (accounts) => {
|
|
58
60
|
if (!isArray(accounts))
|
|
@@ -64,48 +66,36 @@ function AccountSelector(props) {
|
|
|
64
66
|
selection.accountNum &&
|
|
65
67
|
onAccountChange({ accountNumber: selection.accountNum, name: selection.name });
|
|
66
68
|
};
|
|
67
|
-
const onFindMyAccountClick = (event) => {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
};
|
|
69
|
+
// const onFindMyAccountClick = (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
|
|
70
|
+
// !isEmpty(loggedInUserRights.data) &&
|
|
71
|
+
// onAccountChange({
|
|
72
|
+
// accountNumber: loggedInUserRights.data.getAccountNumber(),
|
|
73
|
+
// name: loggedInUserRights.data.getAccountName(),
|
|
74
|
+
// });
|
|
75
|
+
// };
|
|
74
76
|
const selectedAccount = {
|
|
75
77
|
name: selectedAccountDetails.data.name,
|
|
76
78
|
accountNumber: selectedAccountDetails.data.accountNumber,
|
|
77
79
|
subscriptionAbuse: selectedAccountDetails.data.subscriptionAbuse,
|
|
78
80
|
};
|
|
79
|
-
// When internal user wants to open a case for a customer but customer account doesn't have entitlement, we show an error
|
|
80
81
|
useEffect(() => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
82
|
+
if (!loggedInUserRights.data.isInternal() || !selectedAccountDetails.data.accountNumber) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (selectedAccountDetails.data.accountNumber === loggedInUsersAccount.data.accountNumber) {
|
|
86
|
+
setNoValidEntitlement(routeDispatch, false);
|
|
88
87
|
setShowNotEntitledMessage(false);
|
|
89
|
-
|
|
90
|
-
const res = yield accounts.getAccountEntitlementByInternalUser(selectedAccountDetails.data.accountNumber);
|
|
91
|
-
if (isEmpty(res)) {
|
|
92
|
-
setShowNotEntitledMessage(true);
|
|
93
|
-
setNoValidEntitlement(routeDispatch, true);
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
setShowNotEntitledMessage(false);
|
|
97
|
-
setNoValidEntitlement(routeDispatch, false);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
catch (e) {
|
|
101
|
-
console.log(e);
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
if (loggedInUserRights.data.isInternal() && selectedAccountDetails.data.accountNumber) {
|
|
105
|
-
getAccountEntitlement();
|
|
88
|
+
return;
|
|
106
89
|
}
|
|
90
|
+
setShowNotEntitledMessage(hasInvalidEntitlements);
|
|
91
|
+
setNoValidEntitlement(routeDispatch, hasInvalidEntitlements);
|
|
107
92
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
108
|
-
}, [
|
|
93
|
+
}, [
|
|
94
|
+
selectedAccountDetails.data.accountNumber,
|
|
95
|
+
loggedInUserRights.data,
|
|
96
|
+
loggedInUsersAccount.data,
|
|
97
|
+
hasInvalidEntitlements,
|
|
98
|
+
]);
|
|
109
99
|
if (isEmpty(loggedInUserRights.data))
|
|
110
100
|
return React.createElement(React.Fragment, null);
|
|
111
101
|
return (React.createElement("div", { id: props.id, className: `form-group ${props.className}` },
|
|
@@ -114,9 +104,7 @@ function AccountSelector(props) {
|
|
|
114
104
|
React.createElement("label", { htmlFor: "account-selector" },
|
|
115
105
|
React.createElement(Trans, null, "Account"),
|
|
116
106
|
' ',
|
|
117
|
-
React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
|
|
118
|
-
canUseFindMyAccount && (React.createElement("button", { role: "link", className: "btn btn-link btn-app find-my-account pf-v6-u-ml-auto", onClick: onFindMyAccountClick, disabled: selectedAccountDetails.isFetching, "data-tracking-id": "get-support-find-my-account", type: "button" },
|
|
119
|
-
React.createElement(Trans, null, "Find my account")))),
|
|
107
|
+
React.createElement("span", { className: "form-required", "aria-hidden": true }, "*"))),
|
|
120
108
|
React.createElement("div", { className: "account-selector-wrapper" },
|
|
121
109
|
React.createElement(AccountSelectorInternal, { selectedAccounts: [selectedAccount], canBookmarkAccount: canBookmarkAccounts, bookmarkedAccounts: bookmarkedGroupAccounts.data, id: "account-or-bookmark-selector", className: "account-selector", name: "account-or-bookmark-selector", placeholder: t(`Search for an account ${loggedInUserRights.data.isExternal() ? 'or select a bookmark' : ''} `), onSelect: onInternalAccountSelect, disabled: loggedInUserRights.data.isExternal() || selectedAccountDetails.isFetching, isInValid: isSelectedAccountSubscriptionAbused, restrictedOnSubscriptionAbuse: true })),
|
|
122
110
|
canAccessManagedAccounts && !isEmpty(managedAccounts.data) && (React.createElement(ManagedAccountsDropdown, { className: "managed-account-selector pf-v6-u-mt-xl", onManagedAccountChange: onManagedAccountChange, managedAccounts: managedAccounts, selectedAccountNumber: accountNumber, disabled: selectedAccountDetails.isFetching })),
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
width: 100%;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
-
.get-support-owner-wapper input
|
|
5
|
+
.get-support-owner-wapper input,
|
|
6
|
+
.margin-top.managed-account-selector .pf-c-select {
|
|
6
7
|
min-height: 36px;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
|
-
.margin-top.managed-account-selector {
|
|
10
|
+
.margin-top.managed-account-selector .pf-c-select {
|
|
10
11
|
.pf-m-disabled {
|
|
11
12
|
background-color: var(--pf-v5-global--disabled-color--300) !important;
|
|
12
13
|
}
|
package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActiveCustomerEscalation.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAM/D,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,wBAAwB,+
|
|
1
|
+
{"version":3,"file":"ActiveCustomerEscalation.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAM/D,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,wBAAwB,+EA+InC,CAAC"}
|
package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/ActiveCustomerEscalation.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { Button, ButtonVariant, Card, CardBody, CardHeader, List, ListItem, Popover } from '@patternfly/react-core';
|
|
2
2
|
import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
|
|
3
|
-
import { useCanEditCase } from '@rh-support/react-context';
|
|
3
|
+
import { useCanEditCase, useGlobalStateContext } from '@rh-support/react-context';
|
|
4
4
|
import { Can, resourceActions, resources } from '@rh-support/user-permissions';
|
|
5
5
|
import React, { forwardRef, useState } from 'react';
|
|
6
6
|
import { Trans, useTranslation } from 'react-i18next';
|
|
7
7
|
import { useCaseDetailsPageStateContext } from '../../../context/CaseDetailsPageContext';
|
|
8
8
|
import { RequestEscalationModal } from './RequestEscalationModal';
|
|
9
9
|
export const ActiveCustomerEscalation = forwardRef((props, ref) => {
|
|
10
|
+
var _a;
|
|
10
11
|
const { t } = useTranslation();
|
|
11
12
|
const { caseDetailsPageState: { caseEscalations }, } = useCaseDetailsPageStateContext();
|
|
13
|
+
const { globalMetadataState: { loggedInUserRights }, } = useGlobalStateContext();
|
|
14
|
+
const isInternal = (_a = loggedInUserRights.data) === null || _a === void 0 ? void 0 : _a.isInternal();
|
|
12
15
|
const canEditCase = useCanEditCase();
|
|
13
16
|
const isCreateRMEVisible = (caseEscalations.data || []).length === 0 || caseEscalations.data.every((item) => item.status === 'Closed');
|
|
14
17
|
const commonElements = (React.createElement(React.Fragment, null,
|
|
@@ -59,5 +62,5 @@ export const ActiveCustomerEscalation = forwardRef((props, ref) => {
|
|
|
59
62
|
React.createElement(Button, { variant: ButtonVariant.secondary, onClick: toggleModal, "data-tracking-id": "request-rme-trigger", "aria-label": t('Request an escalation') }, t('Request an escalation'))))));
|
|
60
63
|
return (React.createElement(React.Fragment, null,
|
|
61
64
|
React.createElement(RequestEscalationModal, { caseNumber: props.caseNumber, severity: props.caseSeverity, caseStatus: props.caseStatus, show: openRequestEscalationModal, onClose: toggleModal }),
|
|
62
|
-
React.createElement(Can, { do: resourceActions.CREATE, on: resources.ICE_ESCALATION, passThrough: true }, (canCreateICE) => canCreateICE ? isInternalElements : isCreateRMEVisible ? isNotInternalElements :
|
|
65
|
+
React.createElement(Can, { do: resourceActions.CREATE, on: resources.ICE_ESCALATION, passThrough: true }, (canCreateICE) => canCreateICE || isInternal ? isInternalElements : isCreateRMEVisible ? isNotInternalElements : null)));
|
|
63
66
|
});
|
package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestEscalationModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RequestEscalationModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.tsx"],"names":[],"mappings":"AAkCA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAkBnD,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAID,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,qBAoXnD"}
|
|
@@ -7,6 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
+
import { useApolloClient } from '@apollo/client/react';
|
|
10
11
|
import { escalations, publicApi } from '@cee-eng/hydrajs';
|
|
11
12
|
import { Button, Form, FormGroup, FormHelperText, Grid, GridItem, HelperText, HelperTextItem, Modal, ModalBody, ModalFooter, ModalHeader, Popover, TextArea, TextInput, Title, ValidatedOptions, } from '@patternfly/react-core';
|
|
12
13
|
import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
|
|
@@ -27,6 +28,7 @@ const customerGEOKeys = Object.keys(CustomerGEOs);
|
|
|
27
28
|
export function RequestEscalationModal(props) {
|
|
28
29
|
const { globalMetadataState: { loggedInUser, loggedInUserRights }, } = useGlobalStateContext();
|
|
29
30
|
const { t } = useTranslation();
|
|
31
|
+
const apolloClient = useApolloClient();
|
|
30
32
|
const [categories, setCategories] = useState([]);
|
|
31
33
|
const initialState = {
|
|
32
34
|
subject: '',
|
|
@@ -68,7 +70,7 @@ export function RequestEscalationModal(props) {
|
|
|
68
70
|
updateDiscussionStateComments(dispatchDiscussion, caseDispatch, props.caseNumber, allDiscussions, sort, caseFeedbacksHydra.data, discussionFiltersListState);
|
|
69
71
|
yield updateCaseRequest(props.caseNumber, { customerEscalation: true });
|
|
70
72
|
checkForCaseStatusToggleOnAttachOrComment(caseDispatch, loggedInUserRights.data.isInternal(), props.caseStatus);
|
|
71
|
-
yield fetchCaseDetails(caseDispatch, props.caseNumber, loggedInUserRights.data, loggedInUser.data);
|
|
73
|
+
yield fetchCaseDetails(caseDispatch, props.caseNumber, loggedInUserRights.data, loggedInUser.data, apolloClient);
|
|
72
74
|
escalationNum &&
|
|
73
75
|
ToastNotification.addSuccessMessage(t('Your escalation request has been successfully submitted.'));
|
|
74
76
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Case.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/Case.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Case.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseEditView/Case.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAS,mBAAmB,EAAiD,MAAM,kBAAkB,CAAC;AAmB7G,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,EAAE,MAAM,qBA0PzC"}
|
|
@@ -7,6 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
+
import { useApolloClient } from '@apollo/client/react';
|
|
10
11
|
import { CoverSpinner, ErrorBoundary, OverviewContentLoader, ToastNotification, useDocumentTitle, usePrevious, } from '@rh-support/components';
|
|
11
12
|
import { GlobalMetadataStateContext, HostnameAwarenessModal } from '@rh-support/react-context';
|
|
12
13
|
import { AbilityContext, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
@@ -30,10 +31,11 @@ import { PDFContext } from './PDFContainer';
|
|
|
30
31
|
export default function Case(props) {
|
|
31
32
|
const { globalMetadataState: { loggedInUserRights, loggedInUsersAccount, loggedInUser }, } = useContext(GlobalMetadataStateContext);
|
|
32
33
|
const caseDetailsPageDispatch = useCaseDetailsPageDispatchContext();
|
|
34
|
+
const apolloClient = useApolloClient();
|
|
33
35
|
const { t } = useTranslation();
|
|
34
36
|
// The `path` lets us build <Route> paths that are
|
|
35
37
|
// relative to the parent route, while the `url` lets
|
|
36
|
-
//
|
|
38
|
+
//us build relative links.
|
|
37
39
|
const { path, url } = useRouteMatch();
|
|
38
40
|
const { caseNumber } = useParams();
|
|
39
41
|
const queryParams = getUrlParsedParams(useLocation().search);
|
|
@@ -107,7 +109,7 @@ export default function Case(props) {
|
|
|
107
109
|
caseDispatch(action);
|
|
108
110
|
}
|
|
109
111
|
};
|
|
110
|
-
yield fetchCaseDetails(safeDispatch, targetCaseNumber, loggedInUserRights.data, loggedInUser.data);
|
|
112
|
+
yield fetchCaseDetails(safeDispatch, targetCaseNumber, loggedInUserRights.data, loggedInUser.data, apolloClient);
|
|
111
113
|
if (currentCaseRef.current !== targetCaseNumber)
|
|
112
114
|
return;
|
|
113
115
|
if (canSeeRMEs) {
|
|
@@ -130,7 +132,9 @@ export default function Case(props) {
|
|
|
130
132
|
console.error('Error fetching case details:', error);
|
|
131
133
|
}
|
|
132
134
|
});
|
|
133
|
-
|
|
135
|
+
if (canManageCase) {
|
|
136
|
+
safeFetchCaseDetails();
|
|
137
|
+
}
|
|
134
138
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
135
139
|
}, [
|
|
136
140
|
caseNumber,
|
|
@@ -144,10 +148,10 @@ export default function Case(props) {
|
|
|
144
148
|
return (React.createElement(React.Fragment, null,
|
|
145
149
|
isExportingPDF && React.createElement(CoverSpinner, null),
|
|
146
150
|
React.createElement("div", { id: "rh-support-case" },
|
|
147
|
-
React.createElement("div", { className: "support-grid-case-details support-case" }, isFetchingCaseDetails && !isFetchingCaseDetailsError
|
|
151
|
+
React.createElement("div", { className: "support-grid-case-details support-case" }, isFetchingCaseDetails && !isFetchingCaseDetailsError ? (React.createElement(OverviewContentLoader, null)) : (React.createElement(React.Fragment, null,
|
|
148
152
|
React.createElement("article", { className: "grid-main" },
|
|
149
153
|
React.createElement("section", { className: "grid-main-section" },
|
|
150
|
-
(isFetchingCaseDetailsError || !canReadCase) && (React.createElement(CaseDetailsErrorMessage, { isError: isFetchingCaseDetailsError, errorDetails: caseDetailsError, canReadCase: canReadCase, canManageCase: canManageCase, caseNumber: caseNumber, isInlineError: true })),
|
|
154
|
+
(isFetchingCaseDetailsError || !canReadCase || !canManageCase) && (React.createElement(CaseDetailsErrorMessage, { isError: isFetchingCaseDetailsError, errorDetails: caseDetailsError, canReadCase: canReadCase, canManageCase: canManageCase, caseNumber: caseNumber, isInlineError: true })),
|
|
151
155
|
canReadCase &&
|
|
152
156
|
(!isFetchingCaseDetails || !isEmpty(product)) &&
|
|
153
157
|
!isFetchingCaseDetailsError && (React.createElement(React.Fragment, null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseOwnerInfo.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/CaseOwnerInfo.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAI5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAqB,MAAM,OAAO,CAAC;AAK1C,UAAU,MAAM;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,mBAAmB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;CACzD;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"CaseOwnerInfo.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/CaseOwnerInfo.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAC;AAI5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAqB,MAAM,OAAO,CAAC;AAK1C,UAAU,MAAM;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,mBAAmB,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;CACzD;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,MAAM,qBAqElD"}
|
|
@@ -46,5 +46,5 @@ export default function CaseOwnerInfo(props) {
|
|
|
46
46
|
React.createElement(Trans, null, "Office location")),
|
|
47
47
|
": ",
|
|
48
48
|
props.caseDetailsHydra.data.caseOwner.officeLocation)) },
|
|
49
|
-
React.createElement(QuestionCircleIcon, { className: "pf-v6-u-ml-xs icon-size", "aria-label": "Support Level Info" })))))));
|
|
49
|
+
React.createElement(QuestionCircleIcon, { color: "#5e40be", className: "pf-v6-u-ml-xs icon-size", "aria-label": "Support Level Info" })))))));
|
|
50
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseType.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/CaseType.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAAoC,MAAM,OAAO,CAAC;AAOzD,UAAU,MAAO,SAAQ,gBAAgB;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,GAAG,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACrB;AAOD,iBAAS,QAAQ,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"CaseType.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/CaseType.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAAoC,MAAM,OAAO,CAAC;AAOzD,UAAU,MAAO,SAAQ,gBAAgB;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,GAAG,CAAC;IACd,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACrB;AAOD,iBAAS,QAAQ,CAAC,KAAK,EAAE,MAAM,qBAmF9B;kBAnFQ,QAAQ;;;AAsFjB,eAAe,QAAQ,CAAC"}
|
|
@@ -25,7 +25,6 @@ function CaseType(props) {
|
|
|
25
25
|
const [isCaseTypeInValid, setIsCaseTypeInValid] = useState(false);
|
|
26
26
|
const { isExportingPDF } = useContext(PDFContext);
|
|
27
27
|
const [isOpen, setIsOpen] = useState(false);
|
|
28
|
-
const [selected, setSelected] = useState(props.selectedType);
|
|
29
28
|
const onToggleClick = () => {
|
|
30
29
|
setIsOpen(!isOpen);
|
|
31
30
|
};
|
|
@@ -33,7 +32,7 @@ function CaseType(props) {
|
|
|
33
32
|
React.createElement(Flex, { justifyContent: { default: 'justifyContentSpaceBetween' } },
|
|
34
33
|
React.createElement(FlexItem, null,
|
|
35
34
|
" ",
|
|
36
|
-
|
|
35
|
+
props.selectedType || t(`Select a category`)),
|
|
37
36
|
React.createElement(FlexItem, null, props.isFetching ? React.createElement(Spinner, { size: "md" }) : ''))));
|
|
38
37
|
const validateCaseType = (selectedItem) => {
|
|
39
38
|
setIsCaseTypeInValid(isEmpty(selectedItem));
|
|
@@ -46,7 +45,6 @@ function CaseType(props) {
|
|
|
46
45
|
setIsOpen(false);
|
|
47
46
|
yield props.onTypeChange(switchedCaseType);
|
|
48
47
|
setLocalTypeChange(true);
|
|
49
|
-
setSelected(option);
|
|
50
48
|
validateCaseType(option);
|
|
51
49
|
});
|
|
52
50
|
// value changed logic to show a non local type change
|
|
@@ -57,7 +55,7 @@ function CaseType(props) {
|
|
|
57
55
|
React.createElement(Trans, null, "Support type"),
|
|
58
56
|
React.createElement(ValueChangedIcon, { afterLocalChange: afterLocalChange, isLocalChange: localTypeChange, value: props.selectedType, getTooltipContent: getChangedValueTooltip(() => CaseValuesToWatch.type) }),
|
|
59
57
|
React.createElement("span", { className: `form-required ${isExportingPDF ? 'hide-in-pdf' : ''}`, "aria-hidden": true }, "*")),
|
|
60
|
-
React.createElement(Select, { "data-tracking-id": "case-details-type-selector", isOpen: isOpen, selected:
|
|
58
|
+
React.createElement(Select, { "data-tracking-id": "case-details-type-selector", isOpen: isOpen, selected: props.selectedType, onSelect: (event, val) => onCaseTypeChange(val), onOpenChange: (isOpen) => setIsOpen(isOpen), toggle: toggle, popperProps: { direction: 'down', enableFlip: false }, shouldFocusFirstItemOnOpen: false, shouldFocusToggleOnSelect: true },
|
|
61
59
|
React.createElement(SelectList, null, (props.allTypes || []).map((option) => (React.createElement(SelectOption, { value: option, key: option }, option)))))));
|
|
62
60
|
}
|
|
63
61
|
CaseType.defaultProps = defaultProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/index.tsx"],"names":[],"mappings":"AAgCA,OAAO,KAAkD,MAAM,OAAO,CAAC;AA4BvE,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,qBA2fjD"}
|
|
@@ -7,11 +7,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
+
import { useApolloClient } from '@apollo/client/react';
|
|
10
11
|
import { Alert, AlertVariant, Button, ButtonVariant, ExpandableSection, Label, ModalVariant, } from '@patternfly/react-core';
|
|
11
12
|
import ExternalLinkAltIcon from '@patternfly/react-icons/dist/js/icons/external-link-alt-icon';
|
|
12
13
|
import LockIcon from '@patternfly/react-icons/dist/js/icons/lock-icon';
|
|
13
14
|
import { ToastNotification, useConfirmation } from '@rh-support/components';
|
|
14
|
-
import { CloseCaseModal,
|
|
15
|
+
import { CloseCaseModal, fetchCaseSeveritiesHydra, fetchCaseTypesHydra, GlobalMetadataDispatchContext, GlobalMetadataStateContext, useCanEditCase, } from '@rh-support/react-context';
|
|
15
16
|
import { AbilityContext, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
16
17
|
import { dtmTrackEventCaseStepEncountered, haventLoadedMetadata, isOpenShiftOnlineProduct, PreviousCaseTypes, toNewCaseTypeMapper, toNewCaseTypeSwitcher, } from '@rh-support/utils';
|
|
17
18
|
import isEqual from 'lodash/isEqual';
|
|
@@ -39,7 +40,6 @@ export default function CaseOverview(props) {
|
|
|
39
40
|
const ability = useContext(AbilityContext);
|
|
40
41
|
const { t } = useTranslation();
|
|
41
42
|
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
42
|
-
const canManageCase = ability.can(resourceActions.UPDATE, resources.CASE_DETAILS);
|
|
43
43
|
const canSeeCaseOwnerInfo = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_OWNER);
|
|
44
44
|
const canSeeInactivityWarning = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_ACTIVITY_WARNING);
|
|
45
45
|
const caseOverviewState = useContext(CaseOverviewStateContext);
|
|
@@ -75,7 +75,9 @@ export default function CaseOverview(props) {
|
|
|
75
75
|
const canEditCase = useCanEditCase();
|
|
76
76
|
const caseDispatch = useCaseDispatch();
|
|
77
77
|
const globalMetadataDispatchContext = useContext(GlobalMetadataDispatchContext);
|
|
78
|
+
const apolloClient = useApolloClient();
|
|
78
79
|
const { globalMetadataState: { allCaseTypes, allCaseSeverities, viewAsCustomer, loggedInUsersAccount, loggedInUserRights, }, } = useContext(GlobalMetadataStateContext);
|
|
80
|
+
const canManageCase = loggedInUserRights.data.canManageCases();
|
|
79
81
|
const switchedCaseType = toNewCaseTypeSwitcher(caseType);
|
|
80
82
|
const updatingUser = loggedInUsersAccount.data.name;
|
|
81
83
|
const canSeeManagedByPartnerFlag = contactIsPartner &&
|
|
@@ -89,13 +91,13 @@ export default function CaseOverview(props) {
|
|
|
89
91
|
}
|
|
90
92
|
}
|
|
91
93
|
if (haventLoadedMetadata(allCaseSeverities)) {
|
|
92
|
-
|
|
94
|
+
fetchCaseSeveritiesHydra(globalMetadataDispatchContext, loggedInUsersAccount.data.secureSupport);
|
|
93
95
|
}
|
|
94
96
|
if (haventLoadedMetadata(allCaseTypes)) {
|
|
95
|
-
|
|
97
|
+
fetchCaseTypesHydra(globalMetadataDispatchContext, loggedInUsersAccount.data.secureSupport);
|
|
96
98
|
}
|
|
97
99
|
if (haventLoadedMetadata(caseOverviewState.allCaseStatuses)) {
|
|
98
|
-
fetchAllStatuses(caseOverviewDispatch,
|
|
100
|
+
fetchAllStatuses(caseOverviewDispatch, apolloClient);
|
|
99
101
|
}
|
|
100
102
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
101
103
|
}, [
|
|
@@ -297,7 +299,7 @@ export default function CaseOverview(props) {
|
|
|
297
299
|
React.createElement("div", { className: "form-wrapper" },
|
|
298
300
|
React.createElement(CaseStatus, { selectedStatus: status, onStatusChange: onStatusChange, isDisabled: !canManageCase || caseOverviewState.allCaseStatuses.isFetching, allStatuses: caseOverviewState.allCaseStatuses.data, isFetching: caseOverviewState.caseStatusUpdating && isCaseUpdating, hasError: caseOverviewState.allCaseStatuses.isError })),
|
|
299
301
|
React.createElement("div", { className: "form-wrapper" },
|
|
300
|
-
React.createElement(CaseType, { selectedType: switchedCaseType, onTypeChange: onTypeChange, isDisabled: !canManageCase || allCaseTypes.isFetching, allTypes: newCaseTypesArray, isFetching: caseOverviewState.caseTypeUpdating && isCaseUpdating, hasError: allCaseTypes.isError })),
|
|
302
|
+
React.createElement(CaseType, { selectedType: switchedCaseType, onTypeChange: onTypeChange, isDisabled: !canManageCase || allCaseTypes.isFetching || isCaseUpdating, allTypes: newCaseTypesArray, isFetching: caseOverviewState.caseTypeUpdating && isCaseUpdating, hasError: allCaseTypes.isError })),
|
|
301
303
|
React.createElement("div", { className: "form-wrapper" },
|
|
302
304
|
React.createElement(Severity, { onSeverityChange: onSeverityChange, isDisabled: !canManageCase, isFetching: caseOverviewState.caseSeverityUpdating && isCaseUpdating })))),
|
|
303
305
|
React.createElement(ExpandableSection, { className: "case-details-main", toggleText: t('Case information'), isExpanded: isDetailsExpanded, onToggle: onToggleDetails },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaseContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAwC/D,wBAAgB,sBAAsB,sBAyXrC"}
|
|
@@ -7,6 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
+
import { useApolloClient } from '@apollo/client/react';
|
|
10
11
|
import { contacts } from '@cee-eng/hydrajs';
|
|
11
12
|
import { InputGroupText, ValidatedOptions } from '@patternfly/react-core';
|
|
12
13
|
import CheckIcon from '@patternfly/react-icons/dist/js/icons/check-icon';
|
|
@@ -14,6 +15,7 @@ import PencilAltIcon from '@patternfly/react-icons/dist/js/icons/pencil-alt-icon
|
|
|
14
15
|
import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
|
|
15
16
|
import { getPhoneObj, PhoneInput, ToastNotification } from '@rh-support/components';
|
|
16
17
|
import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
|
|
18
|
+
import { GET_ACCOUNT_CONTACTS } from '@rh-support/utils';
|
|
17
19
|
import isEmpty from 'lodash/isEmpty';
|
|
18
20
|
import isEqual from 'lodash/isEqual';
|
|
19
21
|
import React, { useContext, useEffect, useState } from 'react';
|
|
@@ -26,13 +28,34 @@ import { setCaseState, updateCaseDetails } from '../../../../reducers/CaseReduce
|
|
|
26
28
|
import { ContactPhoneNumberPopOver } from '../../../CaseInformation/ContactPhoneNumberPopOver';
|
|
27
29
|
import { removeAllChars, trimAndReplacePlus } from '../../../shared/utils';
|
|
28
30
|
import { PDFContext } from '../../PDFContainer';
|
|
31
|
+
function fetchContactBySSO(apolloClient, accountNumber, ssoUsername) {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
34
|
+
const { data } = yield apolloClient.query({
|
|
35
|
+
query: GET_ACCOUNT_CONTACTS,
|
|
36
|
+
variables: {
|
|
37
|
+
accountNumber: { eq: accountNumber },
|
|
38
|
+
contactsWhere: { SSOUserName__c: { eq: ssoUsername } },
|
|
39
|
+
first: 1,
|
|
40
|
+
},
|
|
41
|
+
fetchPolicy: 'network-only',
|
|
42
|
+
});
|
|
43
|
+
const response = data;
|
|
44
|
+
const contactNode = (_j = (_h = (_g = (_f = (_e = (_d = (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.salesforce_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.SalesforceSupportAccount) === null || _c === void 0 ? void 0 : _c.edges) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.node) === null || _f === void 0 ? void 0 : _f.Contacts) === null || _g === void 0 ? void 0 : _g.edges) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.node;
|
|
45
|
+
return {
|
|
46
|
+
phone: (_l = (_k = contactNode === null || contactNode === void 0 ? void 0 : contactNode.Phone) === null || _k === void 0 ? void 0 : _k.value) !== null && _l !== void 0 ? _l : '',
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
}
|
|
29
50
|
export function CaseContactPhoneNumber() {
|
|
30
51
|
var _a;
|
|
31
|
-
const
|
|
52
|
+
const apolloClient = useApolloClient();
|
|
53
|
+
const { phoneCountryCode = '', phoneAreaCodePrefixLineNumber = '', caseNumber, contactSSOName, accountNumberRef, suppliedPhoneNumberVerified, isCaseOwnerUpdating, hasLoggedInUserConfirmedPhoneNumber, isCasePhoneUpdating, } = useCaseSelector((state) => ({
|
|
32
54
|
phoneCountryCode: state.caseDetails.phoneCountryCode || '',
|
|
33
55
|
phoneAreaCodePrefixLineNumber: state.caseDetails.phoneAreaCodePrefixLineNumber || '',
|
|
34
56
|
caseNumber: state.caseDetails.caseNumber,
|
|
35
57
|
contactSSOName: state.caseDetails.contactSSOName,
|
|
58
|
+
accountNumberRef: state.caseDetails.accountNumberRef,
|
|
36
59
|
suppliedPhoneNumberVerified: state.caseDetails.suppliedPhoneNumberVerified,
|
|
37
60
|
isCaseOwnerUpdating: state.isCaseOwnerUpdating,
|
|
38
61
|
hasLoggedInUserConfirmedPhoneNumber: state.hasLoggedInUserConfirmedPhoneNumber,
|
|
@@ -180,29 +203,17 @@ export function CaseContactPhoneNumber() {
|
|
|
180
203
|
if (contactSSOName === loggedInUser.data.ssoUsername) {
|
|
181
204
|
try {
|
|
182
205
|
setIsFetchingSSO(true);
|
|
183
|
-
const loggedInUserContact = yield (
|
|
206
|
+
const loggedInUserContact = yield fetchContactBySSO(apolloClient, accountNumberRef, contactSSOName);
|
|
184
207
|
setIsFetchingSSO(false);
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
const phoneLine = getPhoneObj(loggedInUserContact.phone).phoneLine || '';
|
|
197
|
-
const countryCode = getPhoneObj(loggedInUserContact.phone).countryCode;
|
|
198
|
-
_phoneAreaCodePrefixLineNumber = phoneLine;
|
|
199
|
-
_phoneCountryCode = countryCode;
|
|
200
|
-
_suppliedPhoneNumberVerified =
|
|
201
|
-
isEqual(hasLoggedInUserConfirmedPhoneNumber, 'True') ||
|
|
202
|
-
isEqual(hasLoggedInUserConfirmedPhoneNumber, 'Deferred')
|
|
203
|
-
? hasLoggedInUserConfirmedPhoneNumber
|
|
204
|
-
: 'False';
|
|
205
|
-
}
|
|
208
|
+
const phoneLine = getPhoneObj(loggedInUserContact.phone).phoneLine || '';
|
|
209
|
+
const countryCode = getPhoneObj(loggedInUserContact.phone).countryCode;
|
|
210
|
+
_phoneAreaCodePrefixLineNumber = phoneLine;
|
|
211
|
+
_phoneCountryCode = countryCode;
|
|
212
|
+
_suppliedPhoneNumberVerified =
|
|
213
|
+
isEqual(hasLoggedInUserConfirmedPhoneNumber, 'True') ||
|
|
214
|
+
isEqual(hasLoggedInUserConfirmedPhoneNumber, 'Deferred')
|
|
215
|
+
? hasLoggedInUserConfirmedPhoneNumber
|
|
216
|
+
: 'False';
|
|
206
217
|
}
|
|
207
218
|
catch (_a) {
|
|
208
219
|
_phoneAreaCodePrefixLineNumber = '';
|
|
@@ -216,18 +227,11 @@ export function CaseContactPhoneNumber() {
|
|
|
216
227
|
// user is openning case for others (use is partner or red hatter)
|
|
217
228
|
try {
|
|
218
229
|
setIsFetchingSSO(true);
|
|
219
|
-
const selectedContact = yield
|
|
230
|
+
const selectedContact = yield fetchContactBySSO(apolloClient, accountNumberRef, contactSSOName);
|
|
220
231
|
setIsFetchingSSO(false);
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
_suppliedPhoneNumberVerified = 'Deferred';
|
|
225
|
-
}
|
|
226
|
-
else {
|
|
227
|
-
_phoneAreaCodePrefixLineNumber = getPhoneObj(selectedContact.phone).phoneLine || '';
|
|
228
|
-
_phoneCountryCode = getPhoneObj(selectedContact.phone).countryCode || '';
|
|
229
|
-
_suppliedPhoneNumberVerified = 'Deferred';
|
|
230
|
-
}
|
|
232
|
+
_phoneAreaCodePrefixLineNumber = getPhoneObj(selectedContact.phone).phoneLine || '';
|
|
233
|
+
_phoneCountryCode = getPhoneObj(selectedContact.phone).countryCode || '';
|
|
234
|
+
_suppliedPhoneNumberVerified = 'Deferred';
|
|
231
235
|
}
|
|
232
236
|
catch (e) {
|
|
233
237
|
_phoneAreaCodePrefixLineNumber = '';
|
|
@@ -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,kBAAkB,CAAC;AAkBvD,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,kBAAkB,CAAC;AAkBvD,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,qBAoE1D"}
|
|
@@ -4,9 +4,9 @@ import isEqual from 'lodash/isEqual';
|
|
|
4
4
|
import React, { useContext, useState } from 'react';
|
|
5
5
|
import { useCaseSelector } from '../../../../context/CaseContext';
|
|
6
6
|
import { OwnerSelector } from '../../../AccountInfo/OwnerSelector';
|
|
7
|
-
import CaseGroup from '../../../CaseInformation/CaseGroup';
|
|
7
|
+
// import CaseGroup from '../../../CaseInformation/CaseGroup';
|
|
8
8
|
import Fts from '../../../CaseInformation/Fts';
|
|
9
|
-
import { Cep } from '../../../CaseManagement/Cep';
|
|
9
|
+
// import { Cep } from '../../../CaseManagement/Cep';
|
|
10
10
|
import { RHAssociatesSelector } from '../../../CaseManagement/RHAssociatesSelector';
|
|
11
11
|
import CaseContactSelector from '../../../CaseManagement/SendNotifications/CaseContactSelector';
|
|
12
12
|
import { PartnerCaseHelper } from '../../ShareCase/PartnerCaseHelper';
|
|
@@ -41,12 +41,10 @@ export default function CaseDetailsManagement(props) {
|
|
|
41
41
|
React.createElement(CaseContactPhoneNumberAlert, { isConfirm: true }),
|
|
42
42
|
canSeeInternalStatus && React.createElement(CaseInternalStatus, null),
|
|
43
43
|
canSeeSBRGroups && React.createElement(CaseSbrGroups, null),
|
|
44
|
-
React.createElement(CaseGroup, null),
|
|
45
44
|
React.createElement(CaseReferenceNumber, null),
|
|
46
45
|
canSeeEmailNotifications && React.createElement(CaseContactSelector, null),
|
|
47
46
|
React.createElement(RHAssociatesSelector, null),
|
|
48
47
|
React.createElement(Fts, { inlineEditable: true }),
|
|
49
|
-
React.createElement(Cep, null),
|
|
50
48
|
React.createElement(SFDCUrl, null),
|
|
51
49
|
React.createElement(ShareWithPartner, { routeProps: props.routeProps, isUpdatingPartner: isUpdatingPartner, accountNumber: accountNumber })))));
|
|
52
50
|
}
|
|
@@ -4,5 +4,5 @@ import React from 'react';
|
|
|
4
4
|
import { Trans } from 'react-i18next';
|
|
5
5
|
export default function CaseOpenShiftPopover() {
|
|
6
6
|
return (React.createElement(Popover, { "aria-label": "Cluster Id Info", position: PopoverPosition.auto, bodyContent: React.createElement(Trans, null, "Cluster IDs give us the ability to use connected customer tools and services to debug your cluster in conjunction with this support case."), closeBtnAriaLabel: "Close" },
|
|
7
|
-
React.createElement(QuestionCircleIcon, { className: "pf-v6-u-ml-xs" })));
|
|
7
|
+
React.createElement(QuestionCircleIcon, { color: "#5e40be", className: "pf-v6-u-ml-xs" })));
|
|
8
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductVersion.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/ProductVersion.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ProductVersion.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/ProductVersion.tsx"],"names":[],"mappings":"AAoCA,OAAO,KAAkD,MAAM,OAAO,CAAC;AASvE,UAAU,MAAM;IACZ,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACvC;AAED,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,qBAgUrC;AAED,eAAe,eAAe,CAAC"}
|