@rh-support/troubleshoot 2.6.312 → 2.6.314
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/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +2 -2
- package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Case.js +4 -3
- package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.js +2 -2
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +2 -2
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +64 -8
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.js +17 -20
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.js +7 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +7 -8
- package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseInformation.js +3 -4
- package/lib/esm/components/CaseInformation/FileDiag.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/FileDiag.js +0 -4
- package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
- package/lib/esm/components/IdeaInformation/IdeaInformation.js +3 -4
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +8 -1
- package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.d.ts +3 -0
- package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.d.ts.map +1 -0
- package/lib/esm/components/ProductSelector/ProductNotEntitledWarning.js +9 -0
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +9 -1
- package/lib/esm/components/Recommendations/AsideResults.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/AsideResults.js +3 -2
- package/lib/esm/components/shared/fileUpload/FileUpload.js +2 -3
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts +1 -0
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.js +17 -8
- package/lib/esm/components/shared/fileUpload/useFileUploader.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/useFileUploader.js +26 -8
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +21 -42
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +19 -12
- package/lib/esm/components/wizardLayout/WizardAside.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardAside.js +2 -4
- package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardLayout.js +4 -36
- package/lib/esm/css/case.css +6 -0
- package/lib/esm/reducers/CaseConstNTypes.d.ts +0 -1
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +0 -1
- package/lib/esm/reducers/CaseReducer.d.ts +3 -1
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +30 -37
- package/package.json +7 -7
- package/lib/esm/components/ProductSelector/ProductNotEntitledModal.d.ts +0 -8
- package/lib/esm/components/ProductSelector/ProductNotEntitledModal.d.ts.map +0 -1
- package/lib/esm/components/ProductSelector/ProductNotEntitledModal.js +0 -11
|
@@ -98,9 +98,9 @@ export function RequestEscalationModal(props) {
|
|
|
98
98
|
caseInput: {
|
|
99
99
|
Subject: formState.subject,
|
|
100
100
|
Description: formState.description,
|
|
101
|
-
Status: '
|
|
101
|
+
Status: 'In Progress',
|
|
102
102
|
Origin: 'Portal ACE',
|
|
103
|
-
Priority: props.severity
|
|
103
|
+
Priority: props.severity || '3 (Medium)',
|
|
104
104
|
Type: 'RME',
|
|
105
105
|
RecordTypeId: '012Ek00000JUtx5IAD',
|
|
106
106
|
ParentId: caseSalesforceId,
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,qBAiQzC"}
|
|
@@ -122,11 +122,12 @@ export default function Case(props) {
|
|
|
122
122
|
const caseDetails = yield fetchCaseDetails(safeDispatch, apolloClient, targetCaseNumber, setCaseAccountNumber);
|
|
123
123
|
if (currentCaseRef.current !== targetCaseNumber)
|
|
124
124
|
return;
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
const caseSalesforceId = typeof (caseDetails === null || caseDetails === void 0 ? void 0 : caseDetails.id) === 'string' ? caseDetails.id : undefined;
|
|
126
|
+
if (canSeeRMEs && caseSalesforceId) {
|
|
127
|
+
fetchCaseEscalations((action) => currentCaseRef.current === targetCaseNumber && caseDetailsPageDispatch(action), caseSalesforceId, apolloClient);
|
|
127
128
|
}
|
|
128
129
|
if (canSeeAttachments) {
|
|
129
|
-
fetchAttachments((action) => currentCaseRef.current === targetCaseNumber && caseDetailsPageDispatch(action), targetCaseNumber, apolloClient,
|
|
130
|
+
fetchAttachments((action) => currentCaseRef.current === targetCaseNumber && caseDetailsPageDispatch(action), targetCaseNumber, apolloClient, caseSalesforceId);
|
|
130
131
|
}
|
|
131
132
|
// TODO: Re-enable after GraphQL migration of external trackers
|
|
132
133
|
// if (canSeeExternalTracker) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/index.tsx"],"names":[],"mappings":"AAmCA,OAAO,KAAkD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/index.tsx"],"names":[],"mappings":"AAmCA,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,qBAkhBjD"}
|
|
@@ -30,7 +30,8 @@ import { usePostComment } from '../../shared/usePostComment';
|
|
|
30
30
|
import { ReopenCaseModal } from '../ConfirmationModals/ReopenCaseModal';
|
|
31
31
|
import { PDFContext } from '../PDFContainer';
|
|
32
32
|
import { CaseInformation } from '../Tabs/CaseDetails/CaseInformation';
|
|
33
|
-
|
|
33
|
+
// TODO: Re-enable once phone number verification flow is fully supported with GraphQL
|
|
34
|
+
// import { CaseContactPhoneNumberAlert } from '../Tabs/CaseDetails/CasePhoneNumberConfirmAlert';
|
|
34
35
|
import Summary from '../Tabs/CaseDetails/Summary';
|
|
35
36
|
import CaseOwnerInfo from './CaseOwnerInfo';
|
|
36
37
|
import CaseStatus from './CaseStatus';
|
|
@@ -254,7 +255,6 @@ export default function CaseOverview(props) {
|
|
|
254
255
|
React.createElement(Trans, null, "Case inactivity warning")),
|
|
255
256
|
React.createElement("p", { className: "pf-v6-u-mb-sm" },
|
|
256
257
|
React.createElement(Trans, null, "The customer has received two warnings regarding inactivity. This case will be closed soon if we don't receive any input."))) })))),
|
|
257
|
-
React.createElement(CaseContactPhoneNumberAlert, { isReview: true, tabRef: props.tabsRef }),
|
|
258
258
|
React.createElement("header", { className: "pf-v6-u-mb-sm pf-v6-u-mt-lg" },
|
|
259
259
|
React.createElement("h2", { className: "case-ID" },
|
|
260
260
|
React.createElement(Trans, null, "Case"),
|
|
@@ -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;
|
|
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;AAoBvD,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,qBA2E1D"}
|
|
@@ -14,7 +14,8 @@ import { PartnerCaseHelper } from '../../ShareCase/PartnerCaseHelper';
|
|
|
14
14
|
import { ShareWithPartner } from '../../ShareCase/PartnerShare';
|
|
15
15
|
import { CaseContactPhoneNumber } from './CaseContactPhoneNumber';
|
|
16
16
|
import CaseInternalStatus from './CaseInternalStatus';
|
|
17
|
-
|
|
17
|
+
// TODO: Re-enable once phone number verification flow is fully supported with GraphQL
|
|
18
|
+
// import { CaseContactPhoneNumberAlert } from './CasePhoneNumberConfirmAlert';
|
|
18
19
|
import CaseReferenceNumber from './CaseReferenceNumber';
|
|
19
20
|
import CaseSbrGroups from './CaseSbrGroups';
|
|
20
21
|
import SFDCUrl from './SFDCUrl';
|
|
@@ -43,7 +44,6 @@ export default function CaseDetailsManagement(props) {
|
|
|
43
44
|
React.createElement(OwnerSelector, null)),
|
|
44
45
|
React.createElement(FlexItem, { flex: { default: 'flex_1' } },
|
|
45
46
|
React.createElement(CaseContactPhoneNumber, null))),
|
|
46
|
-
React.createElement(CaseContactPhoneNumberAlert, { isConfirm: true }),
|
|
47
47
|
canSeeInternalStatus && React.createElement(CaseInternalStatus, null),
|
|
48
48
|
canSeeSBRGroups && React.createElement(CaseSbrGroups, null),
|
|
49
49
|
React.createElement(Flex, { direction: { default: 'column', lg: 'row' } },
|
|
@@ -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":"AA0CA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAUvE,UAAU,MAAM;IACZ,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACvC;AAED,iBAAS,eAAe,CAAC,KAAK,EAAE,MAAM,qBA2ZrC;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -12,7 +12,7 @@ import { Alert, AlertVariant, Button, MenuToggle, Select, SelectList, SelectOpti
|
|
|
12
12
|
import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
|
|
13
13
|
import { AlertMessage, AlertType, SingleSelectDropdown, ToastNotification, useSelectKeyboardNavigator, } from '@rh-support/components';
|
|
14
14
|
import { fetchProducts, GlobalMetadataDispatchContext, GlobalMetadataStateContext, useCanEditCase, } from '@rh-support/react-context';
|
|
15
|
-
import { haventLoadedMetadata, toOption } from '@rh-support/utils';
|
|
15
|
+
import { haventLoadedMetadata, resolveProductServiceLevelsForAccount, 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,8 @@ 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 { getVersionsDetails, updateCaseDetailsGraphQL } from '../../../../reducers/CaseReducer';
|
|
24
|
+
import { getVersionsDetails, setCaseState, updateCaseDetailsGraphQL } from '../../../../reducers/CaseReducer';
|
|
25
|
+
import { ProductNotEntitledWarning } from '../../../ProductSelector/ProductNotEntitledWarning';
|
|
25
26
|
import { getProductObj } from '../../../shared/utils';
|
|
26
27
|
import { PDFContext } from '../../PDFContainer';
|
|
27
28
|
function ProductNVersion(props) {
|
|
@@ -32,13 +33,15 @@ function ProductNVersion(props) {
|
|
|
32
33
|
const [isVersionUpdating, setIsVersionUpdating] = useState(false);
|
|
33
34
|
const [isOpen, setIsOpen] = useState(false);
|
|
34
35
|
const textInputRef = useRef();
|
|
35
|
-
const { product, version, caseNumber, existingCaseDetails, versionsDetails, isCaseUpdating } = useCaseSelector((state) => ({
|
|
36
|
+
const { product, version, caseNumber, existingCaseDetails, versionsDetails, isCaseUpdating, selectedAccountDetails, isProductNotEntitled, } = useCaseSelector((state) => ({
|
|
36
37
|
product: state.caseDetails.product,
|
|
37
38
|
version: state.caseDetails.version,
|
|
38
39
|
caseNumber: state.caseDetails.caseNumber,
|
|
39
40
|
existingCaseDetails: state.caseDetails,
|
|
40
41
|
versionsDetails: state.versionsDetails,
|
|
41
42
|
isCaseUpdating: state.isCaseUpdating,
|
|
43
|
+
selectedAccountDetails: state.selectedAccountDetails,
|
|
44
|
+
isProductNotEntitled: state.isProductNotEntitled,
|
|
42
45
|
}), isEqual);
|
|
43
46
|
const caseDispatch = useCaseDispatch();
|
|
44
47
|
const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
|
|
@@ -105,6 +108,7 @@ function ProductNVersion(props) {
|
|
|
105
108
|
}
|
|
106
109
|
};
|
|
107
110
|
const updateProductVerstion = (selectedProduct, selectedVersion) => __awaiter(this, void 0, void 0, function* () {
|
|
111
|
+
var _a, _b;
|
|
108
112
|
let onlyVersionChanged = false;
|
|
109
113
|
try {
|
|
110
114
|
if (product === selectedProduct) {
|
|
@@ -112,10 +116,31 @@ function ProductNVersion(props) {
|
|
|
112
116
|
}
|
|
113
117
|
setIsProductUpdating(true);
|
|
114
118
|
setIsVersionUpdating(true);
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
const selectedVersionId = (_b = (_a = versionsDetails.data) === null || _a === void 0 ? void 0 : _a.find((v) => v.name === selectedVersion)) === null || _b === void 0 ? void 0 : _b.id;
|
|
120
|
+
const serviceLevels = !onlyVersionChanged
|
|
121
|
+
? resolveProductServiceLevelsForAccount(selectedAccountDetails.data, allProducts.data.productsResult, selectedProduct)
|
|
122
|
+
: undefined;
|
|
123
|
+
yield updateCaseDetailsGraphQL(caseDispatch, apolloClient, caseNumber, Object.assign(Object.assign(Object.assign({ product: selectedProduct, version: selectedVersion }, (selectedVersionId ? { productId: selectedVersionId } : {})), (!onlyVersionChanged && (serviceLevels === null || serviceLevels === void 0 ? void 0 : serviceLevels.defaultEntitlementId)
|
|
124
|
+
? { entitlementId: serviceLevels.defaultEntitlementId }
|
|
125
|
+
: {})), (!onlyVersionChanged && (serviceLevels === null || serviceLevels === void 0 ? void 0 : serviceLevels.entitlementSla)
|
|
126
|
+
? { entitlementSla: serviceLevels.entitlementSla }
|
|
127
|
+
: {})), false, { existingCaseDetails });
|
|
128
|
+
if (!onlyVersionChanged && (serviceLevels === null || serviceLevels === void 0 ? void 0 : serviceLevels.productServiceLevel)) {
|
|
129
|
+
setCaseState(caseDispatch, {
|
|
130
|
+
isProductNotEntitled: false,
|
|
131
|
+
productServiceLevel: serviceLevels.productServiceLevel,
|
|
132
|
+
otherServiceLevels: serviceLevels.otherServiceLevels,
|
|
133
|
+
selectedEntitlementId: serviceLevels.defaultEntitlementId,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
else if (!onlyVersionChanged) {
|
|
137
|
+
setCaseState(caseDispatch, {
|
|
138
|
+
isProductNotEntitled: true,
|
|
139
|
+
productServiceLevel: undefined,
|
|
140
|
+
otherServiceLevels: [],
|
|
141
|
+
selectedEntitlementId: undefined,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
119
144
|
setIsProductUpdating(false);
|
|
120
145
|
setIsVersionUpdating(false);
|
|
121
146
|
if (onlyVersionChanged) {
|
|
@@ -141,6 +166,36 @@ function ProductNVersion(props) {
|
|
|
141
166
|
});
|
|
142
167
|
// To check if version in invalid
|
|
143
168
|
const checkIfVersionIsInvalid = isVersionInvalid && isEmpty(selectedVersionLocal);
|
|
169
|
+
useEffect(() => {
|
|
170
|
+
if (isEmpty(selectedProductLocal)) {
|
|
171
|
+
setCaseState(caseDispatch, {
|
|
172
|
+
isProductNotEntitled: false,
|
|
173
|
+
productServiceLevel: undefined,
|
|
174
|
+
otherServiceLevels: [],
|
|
175
|
+
selectedEntitlementId: undefined,
|
|
176
|
+
});
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
if (selectedAccountDetails.isFetching || isEmpty(selectedAccountDetails.data))
|
|
180
|
+
return;
|
|
181
|
+
const serviceLevels = resolveProductServiceLevelsForAccount(selectedAccountDetails.data, allProducts.data.productsResult, selectedProductLocal);
|
|
182
|
+
if (!serviceLevels || !serviceLevels.productServiceLevel) {
|
|
183
|
+
setCaseState(caseDispatch, {
|
|
184
|
+
isProductNotEntitled: true,
|
|
185
|
+
productServiceLevel: undefined,
|
|
186
|
+
otherServiceLevels: [],
|
|
187
|
+
selectedEntitlementId: undefined,
|
|
188
|
+
});
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
setCaseState(caseDispatch, {
|
|
192
|
+
isProductNotEntitled: false,
|
|
193
|
+
productServiceLevel: serviceLevels.productServiceLevel,
|
|
194
|
+
otherServiceLevels: serviceLevels.otherServiceLevels,
|
|
195
|
+
selectedEntitlementId: serviceLevels.defaultEntitlementId,
|
|
196
|
+
});
|
|
197
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
198
|
+
}, [selectedProductLocal, selectedAccountDetails.data, allProducts.data.productsResult]);
|
|
144
199
|
useEffect(() => {
|
|
145
200
|
if (!selectedProductLocal)
|
|
146
201
|
return;
|
|
@@ -206,7 +261,8 @@ function ProductNVersion(props) {
|
|
|
206
261
|
React.createElement("label", { htmlFor: "case-details-product-selector" },
|
|
207
262
|
React.createElement(Trans, null, "Product")),
|
|
208
263
|
React.createElement(Select, { className: "open-case-product", id: "case-details-product-selector", onChange: onProductChange, "data-tracking-id": "case-details-product-selector", onBlur: () => onOuterClick, isOpen: isOpen, onSelect: (event, value) => onProductChange(value), onOpenChange: () => setIsOpen(false), toggle: toggle, shouldFocusFirstItemOnOpen: false, isScrollable: true, popperProps: { direction: 'down', enableFlip: false } },
|
|
209
|
-
React.createElement(SelectList, { id: "case-details-product-selector-listbox" }, computeDropdownList().map((option, index) => (React.createElement(SelectOption, { key: option.productId, value: option, isFocused: focusedItemIndex === index }, option.name)))))
|
|
264
|
+
React.createElement(SelectList, { id: "case-details-product-selector-listbox" }, computeDropdownList().map((option, index) => (React.createElement(SelectOption, { key: option.productId, value: option, isFocused: focusedItemIndex === index }, option.name))))),
|
|
265
|
+
isProductNotEntitled && !isEmpty(selectedProductLocal) && React.createElement(ProductNotEntitledWarning, null)),
|
|
210
266
|
React.createElement("div", { className: "version-selector-wrapper" },
|
|
211
267
|
React.createElement("label", { htmlFor: "version-dropdown" },
|
|
212
268
|
React.createElement(Trans, null, "Version")),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseAttachment.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAsBxE,OAAO,KAAuC,MAAM,OAAO,CAAC;AAS5D,UAAU,MAAM;IACZ,UAAU,EAAE,WAAW,CAAC;IACxB,kBAAkB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,iBAAiB,EAAE,WAAW,KAAK,IAAI,CAAC;IACzE,eAAe,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,kBAAkB,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAChH;AAED,QAAA,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"CaseAttachment.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CaseAttachment.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAsBxE,OAAO,KAAuC,MAAM,OAAO,CAAC;AAS5D,UAAU,MAAM;IACZ,UAAU,EAAE,WAAW,CAAC;IACxB,kBAAkB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,iBAAiB,EAAE,WAAW,KAAK,IAAI,CAAC;IACzE,eAAe,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,kBAAkB,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAChH;AAED,QAAA,MAAM,cAAc,4EAkSlB,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -106,15 +106,23 @@ const CaseAttachment = React.forwardRef((props, ref) => {
|
|
|
106
106
|
name: fileName,
|
|
107
107
|
});
|
|
108
108
|
};
|
|
109
|
+
// Prefer size (bytes); fall back to sizeKB when GraphQL only populated the KB field.
|
|
110
|
+
const attachmentSizeBytes = props.attachment.size > 0
|
|
111
|
+
? props.attachment.size
|
|
112
|
+
: props.attachment.sizeKB > 0
|
|
113
|
+
? props.attachment.sizeKB * 1024
|
|
114
|
+
: 0;
|
|
115
|
+
const attachmentSizeLabel = attachmentSizeBytes > 0 ? humanizeSize(attachmentSizeBytes) : '';
|
|
116
|
+
const attachmentLinkLabel = attachmentSizeLabel
|
|
117
|
+
? `${props.attachment.fileName} (${attachmentSizeLabel})`
|
|
118
|
+
: props.attachment.fileName;
|
|
109
119
|
const renderAttachmentLink = () => {
|
|
110
120
|
// TODO: Re-enable secure support download gating when needed again
|
|
111
121
|
// if (!loggedInUsersAccount.data.secureSupport) {
|
|
112
122
|
// if (isExportingPDF) {
|
|
113
123
|
// return (
|
|
114
124
|
// <a href={props.attachment.link}>
|
|
115
|
-
// <span>
|
|
116
|
-
// {props.attachment.fileName} ({humanizeSize(props.attachment.size)})
|
|
117
|
-
// </span>
|
|
125
|
+
// <span>{attachmentLinkLabel}</span>
|
|
118
126
|
// </a>
|
|
119
127
|
// );
|
|
120
128
|
// }
|
|
@@ -123,12 +131,11 @@ const CaseAttachment = React.forwardRef((props, ref) => {
|
|
|
123
131
|
// className="attachment-download-btn"
|
|
124
132
|
// title={t('Download {{fileName}}', { fileName: props.attachment.fileName })}
|
|
125
133
|
// variant={ButtonVariant.link}
|
|
134
|
+
// isInline
|
|
126
135
|
// onClick={onAttachmentDownloadClick}
|
|
127
136
|
// data-tracking-id="attachment-download-button"
|
|
128
137
|
// >
|
|
129
|
-
// <span>
|
|
130
|
-
// {props.attachment.fileName} ({humanizeSize(props.attachment.size)})
|
|
131
|
-
// </span>
|
|
138
|
+
// <span>{attachmentLinkLabel}</span>
|
|
132
139
|
// </Button>
|
|
133
140
|
// );
|
|
134
141
|
// }
|
|
@@ -137,25 +144,15 @@ const CaseAttachment = React.forwardRef((props, ref) => {
|
|
|
137
144
|
// position={TooltipPosition.top}
|
|
138
145
|
// content={t(`You don't have appropriate permissions to download the attachment`)}
|
|
139
146
|
// >
|
|
140
|
-
// <strong>
|
|
141
|
-
// {props.attachment.fileName} ({humanizeSize(props.attachment.size)})
|
|
142
|
-
// </strong>
|
|
147
|
+
// <strong>{attachmentLinkLabel}</strong>
|
|
143
148
|
// </Tooltip>
|
|
144
149
|
// );
|
|
145
150
|
if (isExportingPDF) {
|
|
146
151
|
return (React.createElement("a", { href: props.attachment.link },
|
|
147
|
-
React.createElement("span", null,
|
|
148
|
-
props.attachment.fileName,
|
|
149
|
-
" (",
|
|
150
|
-
humanizeSize(props.attachment.size),
|
|
151
|
-
")")));
|
|
152
|
+
React.createElement("span", null, attachmentLinkLabel)));
|
|
152
153
|
}
|
|
153
|
-
return (React.createElement(Button, { className: "attachment-download-btn", title: t('Download {{fileName}}', { fileName: props.attachment.fileName }), variant: ButtonVariant.link, onClick: onAttachmentDownloadClick, "data-tracking-id": "attachment-download-button" },
|
|
154
|
-
React.createElement("span", null,
|
|
155
|
-
props.attachment.fileName,
|
|
156
|
-
" (",
|
|
157
|
-
humanizeSize(props.attachment.size),
|
|
158
|
-
")")));
|
|
154
|
+
return (React.createElement(Button, { className: "attachment-download-btn", title: t('Download {{fileName}}', { fileName: props.attachment.fileName }), variant: ButtonVariant.link, isInline: true, onClick: onAttachmentDownloadClick, "data-tracking-id": "attachment-download-button" },
|
|
155
|
+
React.createElement("span", null, attachmentLinkLabel)));
|
|
159
156
|
};
|
|
160
157
|
const onJumpToComment = (attachmentId) => () => props.showJumpToComment && props.onJumpToComment && props.onJumpToComment(attachmentId);
|
|
161
158
|
if (((_a = props.attachment) === null || _a === void 0 ? void 0 : _a.isPrivate) && !canSeePrivateAttachments)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommentSearch.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.tsx"],"names":[],"mappings":"AASA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAkB,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE5F,UAAU,MAAM;IACZ,eAAe,EAAE,WAAW,EAAE,CAAC;IAC/B,eAAe,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACxE,sBAAsB,EAAE,OAAO,CAAC;CACnC;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"CommentSearch.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/CommentSearch.tsx"],"names":[],"mappings":"AASA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAkB,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE5F,UAAU,MAAM;IACZ,eAAe,EAAE,WAAW,EAAE,CAAC;IAC/B,eAAe,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACxE,sBAAsB,EAAE,OAAO,CAAC;CACnC;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,qBA6G1C"}
|
|
@@ -46,7 +46,13 @@ export function CommentSearch(props) {
|
|
|
46
46
|
}
|
|
47
47
|
else if (discussion.discussionType === DiscussionType.ATTACHMENT) {
|
|
48
48
|
const caseAttachment = discussion.item;
|
|
49
|
-
const
|
|
49
|
+
const attachmentSizeBytes = caseAttachment.size > 0
|
|
50
|
+
? caseAttachment.size
|
|
51
|
+
: caseAttachment.sizeKB > 0
|
|
52
|
+
? caseAttachment.sizeKB * 1024
|
|
53
|
+
: 0;
|
|
54
|
+
const attachmentSizeText = attachmentSizeBytes > 0 ? humanizeSize(attachmentSizeBytes) : '';
|
|
55
|
+
const caseAttachmentText = `delete ${caseAttachment.modifiedBy} ${caseAttachment.description || ''} ${caseAttachment.lastModifiedDate} ${caseAttachment.checksum || ''} Attached file ${caseAttachment.fileName}${attachmentSizeText ? ` ${attachmentSizeText}` : ''} to this case.`;
|
|
50
56
|
searchApi.indexDocument(discussion.item.id, caseAttachmentText || '');
|
|
51
57
|
}
|
|
52
58
|
else if (discussion.discussionType === DiscussionType.CHAT) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostComment.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/PostComment.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PostComment.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDiscussion/PostComment.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA+D,MAAM,OAAO,CAAC;AAMpF,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAmB5E,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;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,WAAW,EAAE,CAAC;CACjC;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,qBA+bxC"}
|
|
@@ -11,7 +11,7 @@ import { Alert, AlertVariant, Button, ButtonVariant, Checkbox } from '@patternfl
|
|
|
11
11
|
import PlusIcon from '@patternfly/react-icons/dist/js/icons/plus-icon';
|
|
12
12
|
import { EditorMode, LoadingIndicator, MarkdownEditor, ToastNotification, usePrevious } from '@rh-support/components';
|
|
13
13
|
import { GlobalMetadataStateContext, useCanEditCase, useUserPreferences } from '@rh-support/react-context';
|
|
14
|
-
import { ability, CaseDiscussionFields,
|
|
14
|
+
import { ability, CaseDiscussionFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
15
15
|
import isEmpty from 'lodash/isEmpty';
|
|
16
16
|
import isEqual from 'lodash/isEqual';
|
|
17
17
|
import React, { useCallback, useContext, useEffect, useRef, useState } from 'react';
|
|
@@ -33,7 +33,6 @@ export function PostComment(props) {
|
|
|
33
33
|
const { t } = useTranslation();
|
|
34
34
|
let { caseNumber } = props;
|
|
35
35
|
const [isTextAreaFocused, setIsTextAreaFocused] = useState(false);
|
|
36
|
-
const canAddAttachments = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.ATTACHMENTS);
|
|
37
36
|
const canPostPrivateComments = ability.can(resourceActions.PATCH, resources.CASE_COMMENTS, CaseDiscussionFields.POST_PRIVATE_COMMENT);
|
|
38
37
|
const { createComment, loading: isPostingComment } = useCreateCaseComment();
|
|
39
38
|
const dispatchToAttachmentReducer = useContext(AttachmentDispatchContext);
|
|
@@ -311,15 +310,15 @@ export function PostComment(props) {
|
|
|
311
310
|
isModalOpen && loggedInUserRights.data.isInternal() && isPublic && (React.createElement(VerifyCaseStatusModal, { onClose: onCancel, onConfirm: onConfirm, isUpdating: isPostingComment, caseNumber: props.caseNumber })),
|
|
312
311
|
React.createElement(Button, { "data-tracking-id": "postcomment-submit-button", type: "button", variant: ButtonVariant.primary, onClick: loggedInUser.data.isInternal && isPublic ? onBtnClick : isNotInternalConfirm, isDisabled: isSubmitDisabled, className: "postcomment-submit" },
|
|
313
312
|
React.createElement(Trans, null, "Submit")),
|
|
314
|
-
|
|
315
|
-
React.createElement(Trans, null, "Cancel"))),
|
|
316
|
-
canAddAttachments && (React.createElement(FileSelectorButton, { isSessionId: false, isDisabled: isFileUploadDisabled, buttonLabel: React.createElement(React.Fragment, null,
|
|
313
|
+
React.createElement(FileSelectorButton, { isSessionId: false, isDisabled: isFileUploadDisabled, buttonLabel: React.createElement(React.Fragment, null,
|
|
317
314
|
React.createElement(PlusIcon, null),
|
|
318
315
|
" ",
|
|
319
|
-
React.createElement(Trans, null, "Attach
|
|
316
|
+
React.createElement(Trans, null, "Attach files")) }),
|
|
317
|
+
React.createElement(Button, { className: "secondary-button-pill", "data-tracking-id": "postcomment-cancel-button", type: "button", variant: ButtonVariant.link, onClick: onCancelClick, isDisabled: isCommentEmpty || isProcessing },
|
|
318
|
+
React.createElement(Trans, null, "Cancel")),
|
|
320
319
|
canPostPrivateComments && (React.createElement("span", { className: "post-comment-checkbox" },
|
|
321
320
|
React.createElement(Checkbox, { label: t('Private'), isChecked: !isPublic && canPostPrivateComments, onChange: handleCheckboxToggle, "aria-label": t('Private'), id: "private-comment", name: "private-comment", "data-tracking-id": "private-comment-checkbox" }))))),
|
|
322
|
-
|
|
321
|
+
React.createElement("div", Object.assign({}, getRootProps(), { className: "post-comment-dropzone" }),
|
|
323
322
|
React.createElement("input", Object.assign({}, getInputProps())),
|
|
324
|
-
React.createElement(FileUpload, { className: `file-upload-section ${hasSomeSelectedFilesLocal ? 'card card-white pf-v6-u-mt-lg pf-v6-u-p-lg' : ''}`, idToUploadTo: caseNumber, caseSalesforceId: caseSalesforceId, onUploadClick: onFileUploadClick, onCaseFileUploaded: onCaseFileUploaded, isSessionId: false, needsAnalyzing: false, autoUploadOnSelect: true, isPrivate: !isPublic, showDescriptionInfoMsg: true }))))
|
|
323
|
+
React.createElement(FileUpload, { className: `file-upload-section ${hasSomeSelectedFilesLocal ? 'card card-white pf-v6-u-mt-lg pf-v6-u-p-lg' : ''}`, idToUploadTo: caseNumber, caseSalesforceId: caseSalesforceId, onUploadClick: onFileUploadClick, onCaseFileUploaded: onCaseFileUploaded, isSessionId: false, needsAnalyzing: false, autoUploadOnSelect: true, isPrivate: !isPublic, showDescriptionInfoMsg: true }))));
|
|
325
324
|
}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,qBAmHpD"}
|
|
@@ -16,11 +16,10 @@ export default function CaseInformation(props) {
|
|
|
16
16
|
const { globalMetadataState: { allCaseTypes, allCaseSeverities, caseLanguages, loggedInUser, loggedInUserJwtToken, loggedInUsersAccount, loggedInUserRights, }, } = useContext(GlobalMetadataStateContext);
|
|
17
17
|
const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
|
|
18
18
|
const apolloClient = useApolloClient();
|
|
19
|
-
const { contactSSOName, selectedAccountDetails, ownersCaseGroups
|
|
19
|
+
const { contactSSOName, selectedAccountDetails, ownersCaseGroups } = useCaseSelector((state) => ({
|
|
20
20
|
contactSSOName: state.caseDetails.contactSSOName,
|
|
21
21
|
ownersCaseGroups: state.ownersCaseGroups,
|
|
22
22
|
selectedAccountDetails: state.selectedAccountDetails,
|
|
23
|
-
hasInvalidEntitlements: false, // TODO: remove this once we have a proper entitlement check
|
|
24
23
|
}), isEqual);
|
|
25
24
|
const isMetadataLoading = () => {
|
|
26
25
|
return !isMetadataLoadingError() && (loggedInUser.isFetching || selectedAccountDetails.isFetching);
|
|
@@ -69,13 +68,13 @@ export default function CaseInformation(props) {
|
|
|
69
68
|
' ',
|
|
70
69
|
React.createElement("a", { href: "/support/contact/customerService" }, "Customer Service"),
|
|
71
70
|
" for assistance.")),
|
|
72
|
-
React.createElement(AlertMessage, { show:
|
|
71
|
+
React.createElement(AlertMessage, { show: !loggedInUserRights.data.isEntitled(), variant: AlertType.DANGER, className: "pf-v6-u-mt-lg", isInline: true },
|
|
73
72
|
React.createElement(Trans, { i18nKey: "i18ValidEntitlementContactCustomerService" },
|
|
74
73
|
"You need a valid entitlement to create a case.\u00A0 Please contact",
|
|
75
74
|
' ',
|
|
76
75
|
React.createElement("a", { href: "/support/contact/customerService" }, "Customer Service"),
|
|
77
76
|
" for assistance.")),
|
|
78
|
-
|
|
77
|
+
loggedInUserRights.data.isEntitled() &&
|
|
79
78
|
!isMetadataLoading() &&
|
|
80
79
|
!isMetadataLoadingError() &&
|
|
81
80
|
loggedInUserRights.data.canManageCases() && (React.createElement(React.Fragment, null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileDiag.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/FileDiag.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FileDiag.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/FileDiag.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAQ/D,UAAU,MAAM;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,qBAqCrC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// TODO: Re-enable when Hydra/GraphQL attachment APIs support secure support again
|
|
2
2
|
// import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
3
|
-
import { ability, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
4
3
|
import { PreviousCaseTypes } from '@rh-support/utils';
|
|
5
4
|
import isEqual from 'lodash/isEqual';
|
|
6
5
|
import React, { useContext, useEffect, useState } from 'react';
|
|
@@ -11,7 +10,6 @@ import FileEARule, { getValidAttachmentRules } from '../ImproveCase/FileEARule';
|
|
|
11
10
|
import { WidgetFileUploader } from '../shared/fileUpload/WidgetFileUploader';
|
|
12
11
|
export function FileDiag(props) {
|
|
13
12
|
const { sessionRestore: { activeSessionId }, } = useContext(SessionRestoreStateContext);
|
|
14
|
-
const canAddAttachments = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.ATTACHMENTS);
|
|
15
13
|
// TODO: Re-enable when Hydra/GraphQL attachment APIs support secure support again
|
|
16
14
|
// const {
|
|
17
15
|
// globalMetadataState: { loggedInUsersAccount },
|
|
@@ -24,8 +22,6 @@ export function FileDiag(props) {
|
|
|
24
22
|
useEffect(() => {
|
|
25
23
|
setIsIdea(caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT);
|
|
26
24
|
}, [caseType]);
|
|
27
|
-
if (!canAddAttachments)
|
|
28
|
-
return null;
|
|
29
25
|
return (React.createElement(WidgetFileUploader, { className: props.className, idToUploadTo: activeSessionId, isPrivate: false, needsAnalyzing: isIdea ? false : true, isSessionId: true,
|
|
30
26
|
// isSecureSupport={loggedInUsersAccount.data.secureSupport!}
|
|
31
27
|
// autoUploadOnSelect={loggedInUsersAccount.data.secureSupport ? false : true}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdeaInformation.d.ts","sourceRoot":"","sources":["../../../../src/components/IdeaInformation/IdeaInformation.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAkBrD,MAAM,CAAC,OAAO,UAAU,eAAe,
|
|
1
|
+
{"version":3,"file":"IdeaInformation.d.ts","sourceRoot":"","sources":["../../../../src/components/IdeaInformation/IdeaInformation.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAkBrD,MAAM,CAAC,OAAO,UAAU,eAAe,sBAoJtC"}
|
|
@@ -26,11 +26,10 @@ export default function IdeaInformation() {
|
|
|
26
26
|
const { globalMetadataState: { allCaseTypes, allCaseSeverities, caseLanguages, loggedInUser, loggedInUserJwtToken, loggedInUsersAccount, loggedInUserRights, }, } = useContext(GlobalMetadataStateContext);
|
|
27
27
|
const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
|
|
28
28
|
const apolloClient = useApolloClient();
|
|
29
|
-
const { contactSSOName, selectedAccountDetails, ownersCaseGroups
|
|
29
|
+
const { contactSSOName, selectedAccountDetails, ownersCaseGroups } = useCaseSelector((state) => ({
|
|
30
30
|
contactSSOName: state.caseDetails.contactSSOName,
|
|
31
31
|
ownersCaseGroups: state.ownersCaseGroups,
|
|
32
32
|
selectedAccountDetails: state.selectedAccountDetails,
|
|
33
|
-
hasInvalidEntitlements: state.hasInvalidEntitlements,
|
|
34
33
|
}), isEqual);
|
|
35
34
|
const caseDispatch = useCaseDispatch();
|
|
36
35
|
const isMetadataLoading = () => {
|
|
@@ -83,13 +82,13 @@ export default function IdeaInformation() {
|
|
|
83
82
|
' ',
|
|
84
83
|
React.createElement("a", { href: "/support/contact/customerService" }, "Customer Service"),
|
|
85
84
|
" for assistance.")),
|
|
86
|
-
React.createElement(AlertMessage, { show:
|
|
85
|
+
React.createElement(AlertMessage, { show: !loggedInUserRights.data.isEntitled(), variant: AlertType.DANGER, className: "pf-v6-u-mb-md", isInline: true },
|
|
87
86
|
React.createElement(Trans, { i18nKey: "i18ValidEntitlementContactCustomerService" },
|
|
88
87
|
"You need a valid entitlement to create a case.\u00A0 Please contact",
|
|
89
88
|
' ',
|
|
90
89
|
React.createElement("a", { href: "/support/contact/customerService" }, "Customer Service"),
|
|
91
90
|
" for assistance.")),
|
|
92
|
-
|
|
91
|
+
loggedInUserRights.data.isEntitled() &&
|
|
93
92
|
!isMetadataLoading() &&
|
|
94
93
|
!isMetadataLoadingError() &&
|
|
95
94
|
loggedInUserRights.data.canManageCases() && (React.createElement(React.Fragment, null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewProductVersionSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/NewProductVersionSelector.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAOxE,UAAU,MAAM;IACZ,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,qCAAqC,EAAE,OAAO,CAAC;CAClD;AAED,eAAO,MAAM,yBAAyB,GAAI,OAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"NewProductVersionSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/NewProductVersionSelector.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAOxE,UAAU,MAAM;IACZ,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,qCAAqC,EAAE,OAAO,CAAC;CAClD;AAED,eAAO,MAAM,yBAAyB,GAAI,OAAO,MAAM,sBAwGtD,CAAC"}
|
|
@@ -32,7 +32,7 @@ export const NewProductVersionSelector = (props) => {
|
|
|
32
32
|
getVersionsDetails(caseDispatch, apolloClient, productObj.productId, productObj.name || product);
|
|
33
33
|
}
|
|
34
34
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
35
|
-
}, [product]);
|
|
35
|
+
}, [product, allProducts.data.productsResult]);
|
|
36
36
|
useEffect(() => {
|
|
37
37
|
var _a;
|
|
38
38
|
if (versionsDetails.isFetching || !((_a = versionsDetails.data) === null || _a === void 0 ? void 0 : _a.length))
|
|
@@ -40,6 +40,13 @@ export const NewProductVersionSelector = (props) => {
|
|
|
40
40
|
if (versionsDetails.data.length === 1) {
|
|
41
41
|
props.onVersionChange(versionsDetails.data[0].name);
|
|
42
42
|
setCaseState(caseDispatch, { selectedVersionId: versionsDetails.data[0].id });
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (version) {
|
|
46
|
+
const versionObj = versionsDetails.data.find((v) => v.name === version);
|
|
47
|
+
if (versionObj === null || versionObj === void 0 ? void 0 : versionObj.id) {
|
|
48
|
+
setCaseState(caseDispatch, { selectedVersionId: versionObj.id });
|
|
49
|
+
}
|
|
43
50
|
}
|
|
44
51
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
45
52
|
}, [versionsDetails.data]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProductNotEntitledWarning.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductNotEntitledWarning.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,wBAAgB,yBAAyB,sBAcxC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FormHelperText, HelperText, HelperTextItem } from '@patternfly/react-core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
export function ProductNotEntitledWarning() {
|
|
5
|
+
const { t } = useTranslation();
|
|
6
|
+
return (React.createElement(FormHelperText, null,
|
|
7
|
+
React.createElement(HelperText, null,
|
|
8
|
+
React.createElement(HelperTextItem, { variant: "warning" }, t('We cannot locate an active support subscription associated with your account for the selected product. You can still proceed, but your case may not receive full support coverage.')))));
|
|
9
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductVersionDropdownSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductVersionDropdownSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductVersionDropdownSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductVersionDropdownSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAAiC,MAAM,OAAO,CAAC;AAStD,UAAU,MAAO,SAAQ,gBAAgB;IACrC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IAChC,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1C,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAOD,QAAA,MAAM,8BAA8B,wEA+DlC,CAAC;AAEH,OAAO,EAAE,8BAA8B,EAAE,CAAC"}
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import { LoadingIndicator } from '@rh-support/components';
|
|
2
|
+
import isEmpty from 'lodash/isEmpty';
|
|
3
|
+
import isEqual from 'lodash/isEqual';
|
|
2
4
|
import React, { forwardRef, useContext } from 'react';
|
|
3
5
|
import { Trans } from 'react-i18next';
|
|
6
|
+
import { useCaseSelector } from '../../context/CaseContext';
|
|
4
7
|
import { RouteContext } from '../../context/RouteContext';
|
|
5
8
|
import { NewProductDropdownSelector } from './NewProductDropdownSelector';
|
|
6
9
|
import { NewProductVersionSelector } from './NewProductVersionSelector';
|
|
10
|
+
import { ProductNotEntitledWarning } from './ProductNotEntitledWarning';
|
|
7
11
|
const defaultProps = {
|
|
8
12
|
disabled: false,
|
|
9
13
|
htmlForId: '',
|
|
10
14
|
};
|
|
11
15
|
const ProductVersionDropdownSelector = forwardRef((props, ref) => {
|
|
12
16
|
const { routeState: { isCaseCreate, isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
|
|
17
|
+
const { isProductNotEntitled, product } = useCaseSelector((state) => ({
|
|
18
|
+
isProductNotEntitled: state.isProductNotEntitled,
|
|
19
|
+
product: state.caseDetails.product,
|
|
20
|
+
}), isEqual);
|
|
13
21
|
return (React.createElement(React.Fragment, null,
|
|
14
22
|
React.createElement("div", { className: "product-selector-wrapper" },
|
|
15
23
|
React.createElement("label", { htmlFor: "product-selector-dropdown-search", ref: ref },
|
|
@@ -21,7 +29,7 @@ const ProductVersionDropdownSelector = forwardRef((props, ref) => {
|
|
|
21
29
|
React.createElement(NewProductDropdownSelector, { products: props.products, onProductChange: props.onProductChange, isNextBtnClickedToShowValidationError: isNextBtnClickedToShowValidationError, isCaseCreate: isCaseCreate, isOnSummaryPage: props.isOnSummaryPage, isLoading: props.isLoading })),
|
|
22
30
|
props.isLoading && (React.createElement("div", { className: "pf-v6-u-flex-basis-auto" },
|
|
23
31
|
React.createElement(LoadingIndicator, { className: "pf-v6-u-ml-sm", isInline: true, show: props.isLoading, size: "sm" })))),
|
|
24
|
-
React.createElement(
|
|
32
|
+
isProductNotEntitled && !isEmpty(product) && React.createElement(ProductNotEntitledWarning, null)),
|
|
25
33
|
React.createElement("div", { className: "version-selector-wrapper" },
|
|
26
34
|
React.createElement("label", { htmlFor: "version-selector-dropdown-toggle" },
|
|
27
35
|
React.createElement(Trans, null, "Version"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsideResults.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/AsideResults.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAUvD,OAAO,EAAoB,eAAe,EAAsC,MAAM,iCAAiC,CAAC;AAWxH,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"AsideResults.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/AsideResults.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAUvD,OAAO,EAAoB,eAAe,EAAsC,MAAM,iCAAiC,CAAC;AAWxH,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,qBA6MzC"}
|
|
@@ -49,6 +49,7 @@ export function AsideResults(props) {
|
|
|
49
49
|
const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
|
|
50
50
|
const { routeState: { activeSection, isCaseCreate }, } = useContext(RouteContext);
|
|
51
51
|
const PAGE_SIZE = 5;
|
|
52
|
+
const FETCH_ROWS = 50;
|
|
52
53
|
const payload = JSON.stringify({
|
|
53
54
|
product: product,
|
|
54
55
|
version: version,
|
|
@@ -82,8 +83,8 @@ export function AsideResults(props) {
|
|
|
82
83
|
summary: getTrimmedCharacters(payload.summary, WATSONX_SUMMARY_LIMIT),
|
|
83
84
|
description: getTrimmedCharacters(payload.description, WATSONX_DESCRIPTION_LIMIT),
|
|
84
85
|
};
|
|
85
|
-
const response = yield search.getWatsonXRecommendationsForCase2(convertObjToEncodedQueryParams(Object.assign({ rerank: true }, getSolrParams(
|
|
86
|
-
const sideDocs = uniqueRecommendationDocs(replaceHighlightingData(response.response.docs, response.highlighting));
|
|
86
|
+
const response = yield search.getWatsonXRecommendationsForCase2(convertObjToEncodedQueryParams(Object.assign({ rerank: true }, getSolrParams(FETCH_ROWS, 129, queryFilters))), payloadData, controllerRef.current.signal);
|
|
87
|
+
const sideDocs = uniqueRecommendationDocs(replaceHighlightingData(response.response.docs, response.highlighting)).slice(0, PAGE_SIZE);
|
|
87
88
|
recommendationDispatch({
|
|
88
89
|
type: RecommendationsConstants.receiveSidebarRecommendation,
|
|
89
90
|
payload: { sideRecommendation: sideDocs, sideRecommendationError: false },
|