@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
|
@@ -7,12 +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, MenuToggle, Select, SelectList, SelectOption, Spinner, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities, } from '@patternfly/react-core';
|
|
11
12
|
import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
|
|
12
13
|
import { AlertMessage, AlertType, SingleSelectDropdown, ToastNotification, useSelectKeyboardNavigator, } from '@rh-support/components';
|
|
13
14
|
import { fetchProducts, GlobalMetadataDispatchContext, GlobalMetadataStateContext, useCanEditCase, } from '@rh-support/react-context';
|
|
14
|
-
import {
|
|
15
|
-
import filter from 'lodash/filter';
|
|
15
|
+
import { haventLoadedMetadata, toOption } from '@rh-support/utils';
|
|
16
16
|
import isEmpty from 'lodash/isEmpty';
|
|
17
17
|
import isEqual from 'lodash/isEqual';
|
|
18
18
|
import isUndefined from 'lodash/isUndefined';
|
|
@@ -21,7 +21,7 @@ import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
|
21
21
|
import { Trans, useTranslation } from 'react-i18next';
|
|
22
22
|
import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
|
|
23
23
|
import { useCaseUpdateErrorMessage } from '../../../../hooks/useCaseUpdateErrorMessage';
|
|
24
|
-
import {
|
|
24
|
+
import { getVersionsDetails, updateCaseDetails } from '../../../../reducers/CaseReducer';
|
|
25
25
|
import { getProductObj } from '../../../shared/utils';
|
|
26
26
|
import { PDFContext } from '../../PDFContainer';
|
|
27
27
|
function ProductNVersion(props) {
|
|
@@ -32,21 +32,21 @@ function ProductNVersion(props) {
|
|
|
32
32
|
const [isVersionUpdating, setIsVersionUpdating] = useState(false);
|
|
33
33
|
const [isOpen, setIsOpen] = useState(false);
|
|
34
34
|
const textInputRef = useRef();
|
|
35
|
-
const { product, version, caseNumber,
|
|
35
|
+
const { product, version, caseNumber, versionsDetails, isCaseUpdating } = useCaseSelector((state) => ({
|
|
36
36
|
product: state.caseDetails.product,
|
|
37
37
|
version: state.caseDetails.version,
|
|
38
|
-
contactSSOName: state.caseDetails.contactSSOName,
|
|
39
38
|
caseNumber: state.caseDetails.caseNumber,
|
|
40
39
|
versionsDetails: state.versionsDetails,
|
|
40
|
+
isCaseUpdating: state.isCaseUpdating,
|
|
41
41
|
}), isEqual);
|
|
42
42
|
const caseDispatch = useCaseDispatch();
|
|
43
43
|
const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
|
|
44
|
+
const apolloClient = useApolloClient();
|
|
44
45
|
const { globalMetadataState: { allProducts }, } = useContext(GlobalMetadataStateContext);
|
|
45
46
|
const [isProductInvalid, setIsProductInvalid] = useState(false);
|
|
46
47
|
const [isVersionInvalid, setIsVersionInvalid] = useState(false);
|
|
47
48
|
const [selectedProductLocal, setSelectedProductLocal] = useState(product);
|
|
48
49
|
const [selectedVersionLocal, setSelectedVersionLocal] = useState(version);
|
|
49
|
-
const [isSEProductApiIsDown, setIsSEProductApiIsDown] = useState(false);
|
|
50
50
|
const [inputValue, setInputValue] = useState(product);
|
|
51
51
|
const [shouldFilter, setShouldFilter] = useState(false);
|
|
52
52
|
const onToggleClick = () => {
|
|
@@ -111,19 +111,11 @@ function ProductNVersion(props) {
|
|
|
111
111
|
}
|
|
112
112
|
setIsProductUpdating(true);
|
|
113
113
|
setIsVersionUpdating(true);
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
yield fetchCaseEntitlements(caseDispatch, contactSSOName, selectedProduct, undefined, true, caseNumber);
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
yield updateCaseDetails(caseDispatch, caseNumber, {
|
|
123
|
-
product: selectedProduct,
|
|
124
|
-
version: selectedVersion,
|
|
125
|
-
});
|
|
126
|
-
}
|
|
114
|
+
// TODO: migrate to GraphQL - entitlements now resolved from SFDCProductJSON__c via productServiceLevel
|
|
115
|
+
yield updateCaseDetails(caseDispatch, caseNumber, {
|
|
116
|
+
product: selectedProduct,
|
|
117
|
+
version: selectedVersion,
|
|
118
|
+
});
|
|
127
119
|
setIsProductUpdating(false);
|
|
128
120
|
setIsVersionUpdating(false);
|
|
129
121
|
if (onlyVersionChanged) {
|
|
@@ -149,60 +141,29 @@ function ProductNVersion(props) {
|
|
|
149
141
|
});
|
|
150
142
|
// To check if version in invalid
|
|
151
143
|
const checkIfVersionIsInvalid = isVersionInvalid && isEmpty(selectedVersionLocal);
|
|
152
|
-
// when user changes selected product, we need to get the versions
|
|
153
144
|
useEffect(() => {
|
|
154
145
|
if (!selectedProductLocal)
|
|
155
146
|
return;
|
|
156
|
-
const getVersions = () => __awaiter(this, void 0, void 0, function* () {
|
|
157
|
-
try {
|
|
158
|
-
yield getVersionsDetails(caseDispatch, selectedProductLocal);
|
|
159
|
-
}
|
|
160
|
-
catch (e) {
|
|
161
|
-
console.log(e);
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
// call sfdc version api to get version flags that we only get from sfdc api
|
|
165
|
-
// flags are used in severity components
|
|
166
|
-
getVersions();
|
|
167
|
-
// populate versions with SE product api versions
|
|
168
147
|
const productObj = getProductObj(allProducts.data.productsResult, selectedProductLocal);
|
|
169
|
-
if (productObj.
|
|
170
|
-
|
|
171
|
-
? productObj.versions.sort()
|
|
172
|
-
: productObj.versions;
|
|
173
|
-
setVersions(productVersions);
|
|
174
|
-
if (productVersions.length === 1 && !selectedVersionLocal) {
|
|
175
|
-
setSelectedVersionLocal(productVersions[0]);
|
|
176
|
-
updateProductVerstion(selectedProductLocal, productVersions[0]);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
else {
|
|
180
|
-
setIsSEProductApiIsDown(true);
|
|
148
|
+
if (productObj.productId) {
|
|
149
|
+
getVersionsDetails(caseDispatch, apolloClient, productObj.productId, productObj.name || selectedProductLocal);
|
|
181
150
|
}
|
|
182
151
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
183
152
|
}, [selectedProductLocal, caseDispatch, allProducts.data]);
|
|
184
|
-
// observe when fetched versions are available
|
|
185
153
|
useEffect(() => {
|
|
186
|
-
|
|
154
|
+
var _a;
|
|
155
|
+
if (versionsDetails.isFetching || !((_a = versionsDetails.data) === null || _a === void 0 ? void 0 : _a.length))
|
|
187
156
|
return;
|
|
188
157
|
const fetchedVersions = versionsDetails.data.map(({ name }) => name);
|
|
158
|
+
setVersions(fetchedVersions);
|
|
189
159
|
if (fetchedVersions.length === 1 && !selectedVersionLocal) {
|
|
190
|
-
setVersions(fetchedVersions);
|
|
191
160
|
setSelectedVersionLocal(fetchedVersions[0]);
|
|
192
161
|
updateProductVerstion(selectedProductLocal, fetchedVersions[0]);
|
|
193
|
-
return;
|
|
194
162
|
}
|
|
195
|
-
const productObj = getProductObj(allProducts.data.productsResult, selectedProductLocal);
|
|
196
|
-
const sfdcVersions = getUniqueSortedVersions(fetchedVersions);
|
|
197
|
-
const versionsForSelectedProduct = productObj.versions ? productObj.versions : sfdcVersions;
|
|
198
|
-
const productVersions = (productObj === null || productObj === void 0 ? void 0 : productObj.hasComponentsInsteadOfVersions)
|
|
199
|
-
? versionsForSelectedProduct.sort()
|
|
200
|
-
: versionsForSelectedProduct;
|
|
201
|
-
setVersions(productVersions);
|
|
202
163
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
203
164
|
}, [versionsDetails.data]);
|
|
204
165
|
const computeDropdownList = () => {
|
|
205
|
-
const list =
|
|
166
|
+
const list = allProducts.data.productsResult;
|
|
206
167
|
if (!list)
|
|
207
168
|
return [];
|
|
208
169
|
const options = shouldFilter && !isUndefined(inputValue) && !isEmpty(inputValue === null || inputValue === void 0 ? void 0 : inputValue.trim())
|
|
@@ -232,10 +193,10 @@ function ProductNVersion(props) {
|
|
|
232
193
|
};
|
|
233
194
|
useEffect(() => {
|
|
234
195
|
if (haventLoadedMetadata(allProducts, (data) => isEmpty(data.productsResult))) {
|
|
235
|
-
fetchProducts(dispatchToGlobalMetadataReducer,
|
|
196
|
+
fetchProducts(dispatchToGlobalMetadataReducer, apolloClient);
|
|
236
197
|
}
|
|
237
198
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
238
|
-
}, [allProducts, dispatchToGlobalMetadataReducer,
|
|
199
|
+
}, [allProducts, dispatchToGlobalMetadataReducer, apolloClient]);
|
|
239
200
|
return (React.createElement(React.Fragment, null,
|
|
240
201
|
React.createElement(AlertMessage, { show: !allProducts.isFetching && allProducts.isError, title: t('There was an error loading products.'), variant: AlertType.DANGER }),
|
|
241
202
|
isEmpty(selectedVersionLocal) && (selectedVersionLocal === null || selectedVersionLocal === void 0 ? void 0 : selectedVersionLocal.length) < 2 && (React.createElement(Alert, { isInline: true, className: "pf-v6-u-mb-md", variant: AlertVariant.danger, title: React.createElement(Trans, null, "Please clear the errors to change the product on your case") })),
|
|
@@ -251,6 +212,7 @@ function ProductNVersion(props) {
|
|
|
251
212
|
React.createElement(Trans, null, "Version")),
|
|
252
213
|
React.createElement(SingleSelectDropdown, { className: "open-case-version", id: "version-dropdown", placeholder: t(`Select a version`), selected: getVersionSelectedDropdownOption, options: getVersionDropdownOptions, isInvalid: checkIfVersionIsInvalid, isDisabled: isVersionUpdating ||
|
|
253
214
|
(allProducts.isFetching && !allProducts.isError) ||
|
|
254
|
-
isEmpty(selectedProductLocal)
|
|
215
|
+
isEmpty(selectedProductLocal) ||
|
|
216
|
+
isCaseUpdating, onSelect: onVersionChange, isLoading: isVersionUpdating || versionsDetails.isFetching, dataTrackingId: "case-details-version-selector", isScrollable: true }))))));
|
|
255
217
|
}
|
|
256
218
|
export default ProductNVersion;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseDiscussion.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,YAAY,EAA0B,MAAM,yCAAyC,CAAC;AAkB1G,OAAO,KAAoE,MAAM,OAAO,CAAC;AAyCzF,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,YAAY,EAAE,CAAC;IAC7B,SAAS,EAAE,SAAS,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;IAC/C,eAAe,EAAE,OAAO,CAAC;CAC5B;AAOD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"CaseDiscussion.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,YAAY,EAA0B,MAAM,yCAAyC,CAAC;AAkB1G,OAAO,KAAoE,MAAM,OAAO,CAAC;AAyCzF,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,YAAY,EAAE,CAAC;IAC7B,SAAS,EAAE,SAAS,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;IAC/C,eAAe,EAAE,OAAO,CAAC;CAC5B;AAOD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,MAAM,qBA4oBnD"}
|
|
@@ -175,6 +175,7 @@ export default function CaseDiscussion(props) {
|
|
|
175
175
|
dtmTrackEventCaseStepEncountered('comment', caseNumber, product, version);
|
|
176
176
|
});
|
|
177
177
|
const onAttachmentAdded = () => __awaiter(this, void 0, void 0, function* () {
|
|
178
|
+
ToastNotification.addSuccessMessage(t('Attachment(s) uploaded successfully'));
|
|
178
179
|
yield updateDiscussionStateAttachments(dispatchDiscussion, caseNumber, allDiscussions, sort, loggedInUsersAccount.data.secureSupport, discussionFiltersListState, dispatchCaseDetailsHydraAttachments);
|
|
179
180
|
});
|
|
180
181
|
const onReply = (commentText, commentCreator, isPublic) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostComment.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/PostComment.tsx"],"names":[],"mappings":"AA8BA,OAAO,KAAwE,MAAM,OAAO,CAAC;AAQ7F,OAAO,EAAkB,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAsB5F,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,WAAW,EAAE,CAAC;CACjC;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"PostComment.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/PostComment.tsx"],"names":[],"mappings":"AA8BA,OAAO,KAAwE,MAAM,OAAO,CAAC;AAQ7F,OAAO,EAAkB,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAsB5F,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,WAAW,EAAE,CAAC;CACjC;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,qBA+iBxC"}
|
|
@@ -188,7 +188,8 @@ export function PostComment(props) {
|
|
|
188
188
|
if (commentText) {
|
|
189
189
|
try {
|
|
190
190
|
setIsProcessing(true);
|
|
191
|
-
|
|
191
|
+
const newCommentText = commentText.replace(/(^|\n)(-\s.+)(\n(?![-\s]))/g, '$1$2\n\n');
|
|
192
|
+
yield request({ caseNumber, commentBody: newCommentText, isPublic, contentType: commentType });
|
|
192
193
|
checkForCaseStatusToggleOnAttachOrComment(caseDispatch, loggedInUserRights.data.isInternal(), status);
|
|
193
194
|
!isPublic && setIsPublic(true);
|
|
194
195
|
addUserToNotifyList();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerifyCaseStatusModal.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAa3E,UAAU,MAAM;IACZ,SAAS,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"VerifyCaseStatusModal.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAa3E,UAAU,MAAM;IACZ,SAAS,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,qBA8IlD"}
|
|
@@ -7,10 +7,10 @@ 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 { Button, ButtonVariant, Modal, ModalBody, ModalFooter, ModalHeader, ModalVariant, } from '@patternfly/react-core';
|
|
11
12
|
import { SingleSelectDropdown, ToastNotification } from '@rh-support/components';
|
|
12
13
|
import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
|
|
13
|
-
import { ability, resourceActions, resources } from '@rh-support/user-permissions';
|
|
14
14
|
import isEqual from 'lodash/isEqual';
|
|
15
15
|
import React, { useContext, useEffect, useReducer, useState } from 'react';
|
|
16
16
|
import { Trans, useTranslation } from 'react-i18next';
|
|
@@ -22,7 +22,6 @@ export function VerifyCaseStatusModal(props) {
|
|
|
22
22
|
const { t } = useTranslation();
|
|
23
23
|
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
24
24
|
const [caseOverviewState, caseOverviewDispatch] = useReducer(caseOverviewReducer, initialCaseViewState);
|
|
25
|
-
const canManageCase = ability.can(resourceActions.UPDATE, resources.CASE_DETAILS);
|
|
26
25
|
const caseState = useCaseSelector((state) => ({
|
|
27
26
|
caseDetails: {
|
|
28
27
|
product: state.caseDetails.product,
|
|
@@ -45,10 +44,12 @@ export function VerifyCaseStatusModal(props) {
|
|
|
45
44
|
selectedAccountDetails: state.selectedAccountDetails,
|
|
46
45
|
}), isEqual);
|
|
47
46
|
const { status } = caseState.caseDetails;
|
|
48
|
-
const { globalMetadataState: {
|
|
47
|
+
const { globalMetadataState: { loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
|
|
48
|
+
const apolloClient = useApolloClient();
|
|
49
|
+
const canManageCase = loggedInUserRights.data.canManageCases();
|
|
49
50
|
useEffect(() => {
|
|
50
|
-
fetchAllStatuses(caseOverviewDispatch,
|
|
51
|
-
}, [caseOverviewDispatch,
|
|
51
|
+
fetchAllStatuses(caseOverviewDispatch, apolloClient);
|
|
52
|
+
}, [caseOverviewDispatch, apolloClient]);
|
|
52
53
|
const { isCaseUpdating } = caseState;
|
|
53
54
|
const canEditCase = useCanEditCase();
|
|
54
55
|
const caseDispatch = useCaseDispatch();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseHistory.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseHistory/CaseHistory.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"CaseHistory.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseHistory/CaseHistory.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,QAAA,MAAM,WAAW,GAAI,OAAO,MAAM,sBAMjC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -17,13 +17,15 @@
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.right-node {
|
|
20
|
-
white-space: nowrap;
|
|
21
20
|
overflow: hidden;
|
|
22
21
|
text-overflow: ellipsis;
|
|
23
22
|
width: 100%;
|
|
24
23
|
}
|
|
24
|
+
|
|
25
25
|
.content-date-right-history {
|
|
26
|
-
|
|
26
|
+
display: -webkit-box;
|
|
27
|
+
-webkit-line-clamp: 2;
|
|
28
|
+
-webkit-box-orient: vertical;
|
|
27
29
|
overflow: hidden;
|
|
28
30
|
text-overflow: ellipsis;
|
|
29
31
|
}
|
|
@@ -162,7 +164,6 @@
|
|
|
162
164
|
text-align: right;
|
|
163
165
|
line-height: 30px;
|
|
164
166
|
white-space: nowrap;
|
|
165
|
-
overflow: hidden;
|
|
166
167
|
}
|
|
167
168
|
|
|
168
169
|
.content-date-right-history {
|
|
@@ -319,41 +320,20 @@ ul#case-history-paginated-timeline {
|
|
|
319
320
|
}
|
|
320
321
|
}
|
|
321
322
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
margin: 0;
|
|
326
|
-
border-radius: 2px;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
@media screen and (max-width: 768px) {
|
|
330
|
-
.timeline::after {
|
|
331
|
-
left: 20px;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
.timeline-node {
|
|
335
|
-
flex-direction: column;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
.left-node,
|
|
339
|
-
.right-node {
|
|
340
|
-
max-width: 100%;
|
|
341
|
-
padding: 0;
|
|
323
|
+
@media screen and (max-width: 850px) {
|
|
324
|
+
.contentTimeline {
|
|
325
|
+
padding: 16px 8px;
|
|
342
326
|
}
|
|
343
327
|
|
|
344
|
-
.
|
|
345
|
-
|
|
346
|
-
left: 0%;
|
|
347
|
-
transform: translateX(-50%);
|
|
328
|
+
.content-date-left-history {
|
|
329
|
+
font-size: 15px;
|
|
348
330
|
}
|
|
349
331
|
|
|
350
|
-
.
|
|
351
|
-
|
|
352
|
-
border-width: 10px 10px 10px 0;
|
|
353
|
-
border-color: transparent white transparent transparent;
|
|
332
|
+
.content-time-left-history {
|
|
333
|
+
font-size: 13px;
|
|
354
334
|
}
|
|
355
335
|
|
|
356
|
-
.
|
|
357
|
-
|
|
336
|
+
.content-date-right-history {
|
|
337
|
+
font-size: 14px;
|
|
358
338
|
}
|
|
359
339
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseHistory/Timeline.tsx"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAwBxB,OAAO,KAAsC,MAAM,OAAO,CAAC;AA8W3D,QAAA,MAAM,QAAQ,GAAI;;CAAc,
|
|
1
|
+
{"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseHistory/Timeline.tsx"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAwBxB,OAAO,KAAsC,MAAM,OAAO,CAAC;AA8W3D,QAAA,MAAM,QAAQ,GAAI;;CAAc,sBAmV/B,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -458,7 +458,7 @@ const Timeline = ({ caseNumber }) => {
|
|
|
458
458
|
React.createElement("div", { className: "timelineMenu" },
|
|
459
459
|
React.createElement(SearchInput, { placeholder: t('Search for a user, action, or keyword'), value: searchValue, onChange: handleSearchChange, onClear: handleClear, className: "case-history-timeline-search" }),
|
|
460
460
|
React.createElement("div", { className: "case-history-timeline-datepicker" },
|
|
461
|
-
React.createElement(DatePicker, { value: dateValue, onChange: (_event, value) => handleDateChange(value), validators: [futureDateValidator] }),
|
|
461
|
+
React.createElement(DatePicker, { value: dateValue, invalidFormatText: t('Invalid date format.'), onChange: (_event, value) => handleDateChange(value), validators: [futureDateValidator] }),
|
|
462
462
|
React.createElement(Button, { className: "pf-v6-u-ml-xs", onClick: () => setDateValue(''), isDisabled: isEmpty(dateValue) },
|
|
463
463
|
React.createElement(Trans, null, "Reset")))),
|
|
464
464
|
React.createElement("div", { className: "timeline-controls" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseSummary.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseSummary/CaseSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAuB3B,OAAO,KAA0C,MAAM,OAAO,CAAC;AAO/D,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"CaseSummary.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseSummary/CaseSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAuB3B,OAAO,KAA0C,MAAM,OAAO,CAAC;AAO/D,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,sBA0LxC,CAAC"}
|
|
@@ -29,9 +29,9 @@ export const CaseSummary = (props) => {
|
|
|
29
29
|
const [caseSummaryData, setCaseSummaryData] = useState(getApiResourceObject(null, true));
|
|
30
30
|
const [caseSummaryState, setCaseSummaryState] = useState();
|
|
31
31
|
const [errorMessage, setErrorMessage] = useState('');
|
|
32
|
-
const {
|
|
33
|
-
caseLanguage: state.caseDetails.caseLanguage,
|
|
32
|
+
const { caseComments, caseLanguage } = useCaseSelector((state) => ({
|
|
34
33
|
caseComments: state.caseDetails.comments,
|
|
34
|
+
caseLanguage: state.caseDetails.caseLanguage,
|
|
35
35
|
}), isEqual);
|
|
36
36
|
const { globalMetadataState: { loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
|
|
37
37
|
const isInternal = (_b = (_a = loggedInUserRights === null || loggedInUserRights === void 0 ? void 0 : loggedInUserRights.data) === null || _a === void 0 ? void 0 : _a.isInternal) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
@@ -43,7 +43,7 @@ export const CaseSummary = (props) => {
|
|
|
43
43
|
setIsFeedbackModalOpen(true);
|
|
44
44
|
};
|
|
45
45
|
useEffect(() => {
|
|
46
|
-
if (caseLanguage
|
|
46
|
+
if (caseLanguage === 'ru') {
|
|
47
47
|
setCaseSummaryState(CaseSummaryStates.CASE_LANGUAGE_NOT_SUPPORTED);
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
@@ -94,7 +94,8 @@ export const CaseSummary = (props) => {
|
|
|
94
94
|
return (React.createElement("section", { className: "card card-white" },
|
|
95
95
|
React.createElement(Alert, { variant: AlertVariant.info, title: "Careful! This case summary uses AI. Check for mistakes.", isInline: true, actionLinks: React.createElement(AlertActionLink, { onClick: (e) => triggerAppFeedbackItem(e), href: "#", "data-tracking-id": "send-feedback-button" },
|
|
96
96
|
React.createElement(Trans, null, "Send Feedback")) },
|
|
97
|
-
React.createElement("p", null,
|
|
97
|
+
React.createElement("p", null,
|
|
98
|
+
React.createElement(Trans, null, "This AI-generated summary recaps your support case information. It might not be up-to-date and might contain errors. We\u2019d love your feedback to help us improve this feature."))),
|
|
98
99
|
caseSummaryState === CaseSummaryStates.NEW_CASE ? (React.createElement(EmptyState, { headingLevel: "h2", icon: CubesIcon, titleText: React.createElement(Trans, null, "Unable to generate case summary"), variant: EmptyStateVariant.lg },
|
|
99
100
|
React.createElement(EmptyStateBody, null,
|
|
100
101
|
React.createElement("p", { className: "push-top-narrow" },
|
|
@@ -25,7 +25,7 @@ export function CaseSummaryErrorMessage(props) {
|
|
|
25
25
|
'The AI is either currently unavailable or is processing case details or try reloading the page.';
|
|
26
26
|
break;
|
|
27
27
|
case 'case_language_not_supported':
|
|
28
|
-
message = `The AI case summary is available in
|
|
28
|
+
message = `The AI case summary is not available in this language. We're working on adding more languages soon.`;
|
|
29
29
|
break;
|
|
30
30
|
case 'input_comments_too_large':
|
|
31
31
|
message = `${shared} overall input comments text is too large.`;
|
|
@@ -112,6 +112,6 @@ const RelatedTasks = () => {
|
|
|
112
112
|
React.createElement(Td, { dataLabel: columnNames.title }, item.title)))))),
|
|
113
113
|
React.createElement("div", { className: "push-top" },
|
|
114
114
|
React.createElement(Pagination, { itemCount: filteredData.length, perPage: itemsPerPage, page: currentPage, onSetPage: (_, page) => setCurrentPage(page), onPerPageSelect: (_, perPage) => setItemsPerPage(perPage) })))) : (React.createElement("div", null,
|
|
115
|
-
React.createElement(EmptyState, { headingLevel: "h4", icon: CubesIcon, titleText: t("There aren't any related tasks
|
|
115
|
+
React.createElement(EmptyState, { headingLevel: "h4", icon: CubesIcon, titleText: t("There aren't any related tasks"), variant: EmptyStateVariant.full })))));
|
|
116
116
|
};
|
|
117
117
|
export default RelatedTasks;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseGroup.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAuD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CaseGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseGroup.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAiB5E,UAAU,MAAM;IACZ,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB;AAWD,iBAAS,SAAS,CAAC,KAAK,EAAE,MAAM,qBAkW/B;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -20,7 +20,7 @@ import { Trans, useTranslation } from 'react-i18next';
|
|
|
20
20
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
21
21
|
import { RouteContext } from '../../context/RouteContext';
|
|
22
22
|
import { useCaseUpdateErrorMessage } from '../../hooks/useCaseUpdateErrorMessage';
|
|
23
|
-
import { setCaseDetails, setSelectedCaseGroupUsers, updateCaseDetails } from '../../reducers/CaseReducer';
|
|
23
|
+
import { fetchCaseGroupsForAccount, fetchCaseGroupsForSSO, setCaseDetails, setSelectedCaseGroupUsers, updateCaseDetails, } from '../../reducers/CaseReducer';
|
|
24
24
|
import { PDFContext } from '../CaseEditView/PDFContainer';
|
|
25
25
|
import { CaseValuesToWatch } from '../shared/Constants';
|
|
26
26
|
import { getChangedValueTooltip } from '../shared/utils';
|
|
@@ -168,6 +168,16 @@ function CaseGroup(props) {
|
|
|
168
168
|
}
|
|
169
169
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
170
170
|
}, [ownersCaseGroups, caseNumber, isGroupMandatory]);
|
|
171
|
+
useEffect(() => {
|
|
172
|
+
if (loggedInUserRights.data.isInternal() && accountNumber) {
|
|
173
|
+
// For internal users, use account number
|
|
174
|
+
fetchCaseGroupsForAccount(caseDispatch, accountNumber);
|
|
175
|
+
}
|
|
176
|
+
else if (contactSSOName) {
|
|
177
|
+
// For external users, use SSO username
|
|
178
|
+
fetchCaseGroupsForSSO(caseDispatch, contactSSOName);
|
|
179
|
+
}
|
|
180
|
+
}, [accountNumber, caseDispatch, contactSSOName, loggedInUserRights.data]);
|
|
171
181
|
const onCaseGroupClear = () => __awaiter(this, void 0, void 0, function* () {
|
|
172
182
|
var _a;
|
|
173
183
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseInformation.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseInformation.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaseInformation.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseInformation.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAQvD,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,qBAoHpD"}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
+
import { useApolloClient } from '@apollo/client/react';
|
|
1
2
|
import { AlertMessage, AlertType, LoadingIndicator } from '@rh-support/components';
|
|
2
3
|
import { fetchCaseSeverities, fetchCaseTypes, fetchLanguageMetadata, GlobalMetadataDispatchContext, GlobalMetadataStateContext, } from '@rh-support/react-context';
|
|
3
|
-
import {
|
|
4
|
+
import { haventLoadedMetadata } from '@rh-support/utils';
|
|
4
5
|
import isEmpty from 'lodash/isEmpty';
|
|
5
6
|
import isEqual from 'lodash/isEqual';
|
|
6
7
|
import React, { useContext, useEffect } from 'react';
|
|
7
8
|
import { Trans, useTranslation } from 'react-i18next';
|
|
8
9
|
import { useCaseSelector } from '../../context/CaseContext';
|
|
9
10
|
import { OpenShiftClusterId } from '../CaseManagement/OpenShiftClusterId';
|
|
10
|
-
import { Hostname } from '../ImproveCase/Hostname';
|
|
11
|
+
// import { Hostname } from '../ImproveCase/Hostname';
|
|
11
12
|
import KtQuestions from '../ImproveCase/KtQuestions';
|
|
12
13
|
import ClusterRecommendations from '../Recommendations/ClusterRecommendations';
|
|
13
14
|
export default function CaseInformation(props) {
|
|
14
15
|
const { t } = useTranslation();
|
|
15
|
-
const { globalMetadataState: { allCaseTypes, allCaseSeverities, caseLanguages, loggedInUser, loggedInUserJwtToken, loggedInUsersAccount, }, } = useContext(GlobalMetadataStateContext);
|
|
16
|
+
const { globalMetadataState: { allCaseTypes, allCaseSeverities, caseLanguages, loggedInUser, loggedInUserJwtToken, loggedInUsersAccount, loggedInUserRights, }, } = useContext(GlobalMetadataStateContext);
|
|
16
17
|
const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
|
|
18
|
+
const apolloClient = useApolloClient();
|
|
17
19
|
const { contactSSOName, selectedAccountDetails, ownersCaseGroups, hasInvalidEntitlements } = useCaseSelector((state) => ({
|
|
18
20
|
contactSSOName: state.caseDetails.contactSSOName,
|
|
19
21
|
ownersCaseGroups: state.ownersCaseGroups,
|
|
@@ -38,13 +40,13 @@ export default function CaseInformation(props) {
|
|
|
38
40
|
}
|
|
39
41
|
const allPromisses = [];
|
|
40
42
|
if (haventLoadedMetadata(allCaseTypes)) {
|
|
41
|
-
allPromisses.push(fetchCaseTypes(dispatchToGlobalMetadataReducer,
|
|
43
|
+
allPromisses.push(fetchCaseTypes(dispatchToGlobalMetadataReducer, apolloClient));
|
|
42
44
|
}
|
|
43
45
|
if (haventLoadedMetadata(allCaseSeverities)) {
|
|
44
|
-
allPromisses.push(fetchCaseSeverities(dispatchToGlobalMetadataReducer,
|
|
46
|
+
allPromisses.push(fetchCaseSeverities(dispatchToGlobalMetadataReducer, apolloClient));
|
|
45
47
|
}
|
|
46
48
|
if (haventLoadedMetadata(caseLanguages)) {
|
|
47
|
-
allPromisses.push(fetchLanguageMetadata(dispatchToGlobalMetadataReducer));
|
|
49
|
+
allPromisses.push(fetchLanguageMetadata(dispatchToGlobalMetadataReducer, apolloClient));
|
|
48
50
|
}
|
|
49
51
|
Promise.all(allPromisses);
|
|
50
52
|
}, [
|
|
@@ -56,11 +58,12 @@ export default function CaseInformation(props) {
|
|
|
56
58
|
loggedInUserJwtToken,
|
|
57
59
|
selectedAccountDetails,
|
|
58
60
|
loggedInUsersAccount.data.secureSupport,
|
|
61
|
+
apolloClient,
|
|
59
62
|
]);
|
|
60
63
|
return (React.createElement(React.Fragment, null,
|
|
61
64
|
React.createElement(LoadingIndicator, { show: isMetadataLoading(), size: "lg" }),
|
|
62
65
|
React.createElement(AlertMessage, { variant: AlertType.DANGER, className: "pf-v6-u-mt-lg", title: t("Sorry, we're having a problem gathering your information."), show: isMetadataLoadingError() }),
|
|
63
|
-
React.createElement(AlertMessage, { show: !
|
|
66
|
+
React.createElement(AlertMessage, { show: !loggedInUserRights.data.canManageCases(), variant: AlertType.DANGER, className: "pf-v6-u-mt-lg" },
|
|
64
67
|
React.createElement(Trans, { i18nKey: "i18ManageCaseContactCustomerService" },
|
|
65
68
|
"You need additional access to manage cases.\u00A0 Please contact",
|
|
66
69
|
' ',
|
|
@@ -75,9 +78,8 @@ export default function CaseInformation(props) {
|
|
|
75
78
|
!hasInvalidEntitlements &&
|
|
76
79
|
!isMetadataLoading() &&
|
|
77
80
|
!isMetadataLoadingError() &&
|
|
78
|
-
|
|
81
|
+
loggedInUserRights.data.canManageCases() && (React.createElement(React.Fragment, null,
|
|
79
82
|
React.createElement("form", null,
|
|
80
|
-
React.createElement(Hostname, null),
|
|
81
83
|
React.createElement(OpenShiftClusterId, null),
|
|
82
84
|
React.createElement(ClusterRecommendations, { className: "push-bottom" }),
|
|
83
85
|
React.createElement(KtQuestions, null))))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/ContactPhoneNumber.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContactPhoneNumber.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/ContactPhoneNumber.tsx"],"names":[],"mappings":"AAQA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAuC/D,wBAAgB,kBAAkB,sBAwVjC"}
|