@rh-support/troubleshoot 2.6.287 → 2.6.292
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/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +43 -12
- package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Case.js +7 -5
- package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsAside.js +25 -8
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +14 -10
- package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.js +24 -18
- 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 +9 -9
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/ProductVersion.js +19 -59
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +16 -9
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +5 -3
- package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +3 -2
- package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseInformation.js +7 -5
- 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/SupportLevel.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/SupportLevel.js +32 -55
- 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/IdeaInformation/IdeaInformation.d.ts.map +1 -1
- package/lib/esm/components/IdeaInformation/IdeaInformation.js +10 -10
- 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 -15
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +13 -37
- 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/Review/Review.d.ts.map +1 -1
- package/lib/esm/components/Review/Review.js +16 -18
- package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
- package/lib/esm/components/SessionRestore/SessionRestore.js +3 -1
- package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +1 -1
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +50 -64
- 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/graphql/index.d.ts +4 -0
- package/lib/esm/graphql/index.d.ts.map +1 -0
- package/lib/esm/graphql/index.js +3 -0
- package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts +2 -0
- package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts.map +1 -0
- package/lib/esm/graphql/mutations/createRMECaseEscalation.js +24 -0
- package/lib/esm/graphql/mutations/index.d.ts +2 -0
- package/lib/esm/graphql/mutations/index.d.ts.map +1 -0
- package/lib/esm/graphql/mutations/index.js +1 -0
- package/lib/esm/graphql/queries/getEscalationDetails.d.ts +2 -0
- package/lib/esm/graphql/queries/getEscalationDetails.d.ts.map +1 -0
- package/lib/esm/graphql/queries/getEscalationDetails.js +24 -0
- package/lib/esm/graphql/queries/getParentId.d.ts +2 -0
- package/lib/esm/graphql/queries/getParentId.d.ts.map +1 -0
- package/lib/esm/graphql/queries/getParentId.js +16 -0
- package/lib/esm/graphql/queries/index.d.ts +3 -0
- package/lib/esm/graphql/queries/index.d.ts.map +1 -0
- package/lib/esm/graphql/queries/index.js +2 -0
- package/lib/esm/graphql/schemas/escalation.d.ts +85 -0
- package/lib/esm/graphql/schemas/escalation.d.ts.map +1 -0
- package/lib/esm/graphql/schemas/escalation.js +1 -0
- package/lib/esm/graphql/schemas/index.d.ts +2 -0
- package/lib/esm/graphql/schemas/index.d.ts.map +1 -0
- package/lib/esm/graphql/schemas/index.js +1 -0
- package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
- package/lib/esm/hooks/useResetCaseCreate.js +18 -11
- package/lib/esm/reducers/CaseConstNTypes.d.ts +86 -2
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +5 -0
- package/lib/esm/reducers/CaseDetailsPageReducer.d.ts +3 -1
- package/lib/esm/reducers/CaseDetailsPageReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseDetailsPageReducer.js +22 -5
- package/lib/esm/reducers/CaseHelpers.d.ts +2 -1
- package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/CaseHelpers.js +39 -2
- 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 +27 -8
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +100 -23
- package/package.json +5 -5
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
import { Button,
|
|
1
|
+
import { Button, MenuToggle, Select, SelectList, SelectOption, Spinner, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities, } from '@patternfly/react-core';
|
|
2
2
|
import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
|
|
3
3
|
import { useSelectKeyboardNavigator } from '@rh-support/components';
|
|
4
|
-
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
5
4
|
import isEmpty from 'lodash/isEmpty';
|
|
6
5
|
import isEqual from 'lodash/isEqual';
|
|
7
|
-
import React, {
|
|
8
|
-
import {
|
|
6
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
7
|
+
import { useTranslation } from 'react-i18next';
|
|
9
8
|
import { useCaseSelector } from '../../context/CaseContext';
|
|
10
|
-
const isProductSupportedForCustomer = (productName, productResults) => {
|
|
11
|
-
const foundItem = productResults.filter((item) => item.name === productName)[0];
|
|
12
|
-
return foundItem ? foundItem.supportedForCustomer : false;
|
|
13
|
-
};
|
|
14
9
|
export const NewProductDropdownSelector = (props) => {
|
|
15
10
|
const { t } = useTranslation();
|
|
16
11
|
const [isOpen, setIsOpen] = useState(false);
|
|
17
12
|
const [showValidationLocal, setShowValidationLocal] = useState(props.isNextBtnClickedToShowValidationError);
|
|
18
|
-
const [isSelectedProductSupportedForCustomer, setIsSelectedProductSupportedForCustomer] = useState(true);
|
|
19
13
|
const [filteredProducts, setFilteredProducts] = useState(props.products);
|
|
20
14
|
const [shouldFilter, setShouldFilter] = useState(false);
|
|
21
15
|
const textInputRef = useRef();
|
|
@@ -23,7 +17,6 @@ export const NewProductDropdownSelector = (props) => {
|
|
|
23
17
|
product: state.caseDetails.product,
|
|
24
18
|
}), isEqual);
|
|
25
19
|
const [inputValue, setInputValue] = useState('');
|
|
26
|
-
const { globalMetadataState: { allProducts }, } = useContext(GlobalMetadataStateContext);
|
|
27
20
|
useEffect(() => {
|
|
28
21
|
setShowValidationLocal(props.isNextBtnClickedToShowValidationError);
|
|
29
22
|
}, [props.isNextBtnClickedToShowValidationError]);
|
|
@@ -33,22 +26,15 @@ export const NewProductDropdownSelector = (props) => {
|
|
|
33
26
|
}
|
|
34
27
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
35
28
|
}, [product]);
|
|
36
|
-
// Update filtered products whenever input changes
|
|
37
29
|
useEffect(() => {
|
|
38
|
-
const productsToFilter = props.isCaseCreate ? props.products : allProducts.data.productsResult;
|
|
39
30
|
if (!isEmpty(inputValue === null || inputValue === void 0 ? void 0 : inputValue.trim())) {
|
|
40
|
-
const filtered =
|
|
31
|
+
const filtered = props.products.filter((p) => { var _a; return (_a = p.name) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(inputValue.toLowerCase()); });
|
|
41
32
|
setFilteredProducts(filtered);
|
|
42
33
|
}
|
|
43
34
|
else {
|
|
44
|
-
setFilteredProducts(
|
|
35
|
+
setFilteredProducts(props.products);
|
|
45
36
|
}
|
|
46
|
-
}, [inputValue, props.products
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
product &&
|
|
49
|
-
props.isOnSummaryPage &&
|
|
50
|
-
setIsSelectedProductSupportedForCustomer(isProductSupportedForCustomer(product, allProducts.data.productsResult));
|
|
51
|
-
}, [allProducts.data.productsResult, product, props.isOnSummaryPage]);
|
|
37
|
+
}, [inputValue, props.products]);
|
|
52
38
|
const onToggleClick = () => {
|
|
53
39
|
var _a;
|
|
54
40
|
setIsOpen(!isOpen);
|
|
@@ -83,14 +69,12 @@ export const NewProductDropdownSelector = (props) => {
|
|
|
83
69
|
setIsOpen(false);
|
|
84
70
|
},
|
|
85
71
|
});
|
|
86
|
-
const
|
|
87
|
-
const productsToShow = shouldFilter ? filteredProducts : products;
|
|
88
|
-
return productsToShow.length > 0 ? (React.createElement(React.Fragment, null,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return (React.createElement(SelectOption, { key: `${type}-${index}`, value: prod, isFocused: focusedItemIndex === index, className: "pf-v6-c-select__menu-wrapper", "data-tracking-id": `${(_a = prod.name) === null || _a === void 0 ? void 0 : _a.replace(/\s+/g, '')}-${type}-dropdown`, isSelected: prod.name === product }, prod.name));
|
|
93
|
-
}))) : (React.createElement(SelectOption, { key: '', value: '', className: "pf-v6-c-select__menu-wrapper", isDisabled: true }, "No Results Found"));
|
|
72
|
+
const renderProductOptions = () => {
|
|
73
|
+
const productsToShow = shouldFilter ? filteredProducts : props.products;
|
|
74
|
+
return productsToShow.length > 0 ? (React.createElement(React.Fragment, null, productsToShow.map((prod, index) => {
|
|
75
|
+
var _a;
|
|
76
|
+
return (React.createElement(SelectOption, { key: `product-${index}`, value: prod, isFocused: focusedItemIndex === index, className: "pf-v6-c-select__menu-wrapper", "data-tracking-id": `${(_a = prod.name) === null || _a === void 0 ? void 0 : _a.replace(/\s+/g, '')}-product-dropdown`, isSelected: prod.name === product }, prod.name));
|
|
77
|
+
}))) : (React.createElement(SelectOption, { key: '', value: '', className: "pf-v6-c-select__menu-wrapper", isDisabled: true }, "No Results Found"));
|
|
94
78
|
};
|
|
95
79
|
const toggle = (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, variant: "typeahead", onClick: onToggleClick, isExpanded: isOpen, isFullWidth: true, isDisabled: props.isLoading, status: isEmpty(inputValue) && showValidationLocal ? 'danger' : undefined },
|
|
96
80
|
React.createElement(TextInputGroup, { isPlain: true },
|
|
@@ -98,16 +82,8 @@ export const NewProductDropdownSelector = (props) => {
|
|
|
98
82
|
props.isLoading ? (React.createElement(TextInputGroupUtilities, null,
|
|
99
83
|
React.createElement(Spinner, { size: "md" }))) : (React.createElement(TextInputGroupUtilities, Object.assign({}, (!inputValue ? { style: { display: 'none' } } : {})),
|
|
100
84
|
React.createElement(Button, { icon: React.createElement(TimesIcon, { "aria-hidden": true }), variant: "plain", onClick: onClear, "aria-label": "Clear input value" }))))));
|
|
101
|
-
const topProducts = allProducts.data.topProducts.filter((p) => p.isEntitledProduct).slice(0, 3);
|
|
102
85
|
return (React.createElement("div", null,
|
|
103
86
|
React.createElement(Select, { id: "product-selector", isOpen: isOpen, onSelect: (e, selection) => onSelect(selection), onOpenChange: (isOpen) => setIsOpen(isOpen), toggle: toggle, selected: product, shouldFocusFirstItemOnOpen: false, isScrollable: true, "data-tracking-id": "get-support-product-dropdown-selector" },
|
|
104
|
-
React.createElement(SelectList, { id: "product-selector-listbox" },
|
|
105
|
-
!shouldFilter && createProductGroup(topProducts, t('Top products'), 'topProduct'),
|
|
106
|
-
!shouldFilter && React.createElement(Divider, null),
|
|
107
|
-
createProductGroup(props.isCaseCreate ? props.products : allProducts.data.productsResult, t('All products'), 'product', shouldFilter))),
|
|
108
|
-
!props.isLoading && !isSelectedProductSupportedForCustomer && (React.createElement("div", { className: "pf-v6-u-ml-xs pf-v6-u-mt-sm form-instructions" },
|
|
109
|
-
React.createElement(Trans, null, "Red Hat must confirm your subscription status before providing support."),
|
|
110
|
-
React.createElement("br", null),
|
|
111
|
-
React.createElement(Trans, null, "We'll contact you if we have any questions.")))));
|
|
87
|
+
React.createElement(SelectList, { id: "product-selector-listbox" }, renderProductOptions()))));
|
|
112
88
|
};
|
|
113
89
|
export default NewProductDropdownSelector;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewProductVersionSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/NewProductVersionSelector.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA0C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"NewProductVersionSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/NewProductVersionSelector.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAO/D,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,sBAoFtD,CAAC"}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
+
import { useApolloClient } from '@apollo/client/react';
|
|
1
2
|
import { SingleSelectDropdown } from '@rh-support/components';
|
|
2
3
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
3
|
-
import { getUniqueSortedVersions } from '@rh-support/utils';
|
|
4
4
|
import isEmpty from 'lodash/isEmpty';
|
|
5
5
|
import isEqual from 'lodash/isEqual';
|
|
6
6
|
import React, { useContext, useEffect, useState } from 'react';
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
8
8
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
9
|
-
import { getVersionsDetails } from '../../reducers/CaseReducer';
|
|
9
|
+
import { getVersionsDetails, setCaseState } from '../../reducers/CaseReducer';
|
|
10
10
|
import { getProductObj } from '../shared/utils';
|
|
11
11
|
export const NewProductVersionSelector = (props) => {
|
|
12
12
|
const { t } = useTranslation();
|
|
13
|
-
const [selectVersionOptions, setSelectVersionOptions] = useState([]);
|
|
14
13
|
const [showValidationLocal, setShowValidationLocal] = useState(props.isNextBtnClickedToShowValidationError);
|
|
15
|
-
const [isSEProductApiIsDown, setIsSEProductApiIsDown] = useState(false);
|
|
16
14
|
const caseDispatch = useCaseDispatch();
|
|
15
|
+
const apolloClient = useApolloClient();
|
|
17
16
|
const { versionsDetails, product, version } = useCaseSelector((state) => ({
|
|
18
17
|
product: state.caseDetails.product,
|
|
19
18
|
version: state.caseDetails.version,
|
|
@@ -24,76 +23,43 @@ export const NewProductVersionSelector = (props) => {
|
|
|
24
23
|
setShowValidationLocal(props.isNextBtnClickedToShowValidationError);
|
|
25
24
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26
25
|
}, [props.isNextBtnClickedToShowValidationError]);
|
|
27
|
-
// when user selects a product, we need to fetch versions
|
|
28
26
|
useEffect(() => {
|
|
29
27
|
if (isEmpty(product))
|
|
30
28
|
return;
|
|
31
29
|
const productObj = getProductObj(allProducts.data.productsResult, product);
|
|
32
|
-
if (productObj.
|
|
33
|
-
|
|
34
|
-
? productObj.versions.sort()
|
|
35
|
-
: productObj.versions;
|
|
36
|
-
// if versions array has one value set that value as selected
|
|
37
|
-
if (productVersions.length === 1) {
|
|
38
|
-
props.onVersionChange(productVersions[0]);
|
|
39
|
-
}
|
|
40
|
-
setSelectVersionOptions(productObj.versions);
|
|
30
|
+
if (productObj.productId) {
|
|
31
|
+
getVersionsDetails(caseDispatch, apolloClient, productObj.productId, productObj.name || product);
|
|
41
32
|
}
|
|
42
|
-
else {
|
|
43
|
-
setIsSEProductApiIsDown(true);
|
|
44
|
-
}
|
|
45
|
-
const getVersions = () => getVersionsDetails(caseDispatch, product);
|
|
46
|
-
// call sfdc version api version flags that is used in severity and submit components
|
|
47
|
-
getVersions();
|
|
48
33
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
49
34
|
}, [product]);
|
|
50
35
|
useEffect(() => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const productObj = getProductObj(allProducts.data.productsResult, product);
|
|
54
|
-
if (productObj.versions) {
|
|
55
|
-
const productVersions = productObj.hasComponentsInsteadOfVersions
|
|
56
|
-
? productObj.versions.sort()
|
|
57
|
-
: productObj.versions;
|
|
58
|
-
setSelectVersionOptions(productVersions);
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
setIsSEProductApiIsDown(true);
|
|
62
|
-
}
|
|
63
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
64
|
-
}, [version]);
|
|
65
|
-
// observe when fetched versions are available
|
|
66
|
-
useEffect(() => {
|
|
67
|
-
if (!isSEProductApiIsDown)
|
|
36
|
+
var _a;
|
|
37
|
+
if (versionsDetails.isFetching || !((_a = versionsDetails.data) === null || _a === void 0 ? void 0 : _a.length))
|
|
68
38
|
return;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
props.onVersionChange(fetchedVersions[0]);
|
|
39
|
+
if (versionsDetails.data.length === 1) {
|
|
40
|
+
props.onVersionChange(versionsDetails.data[0].name);
|
|
41
|
+
setCaseState(caseDispatch, { selectedVersionId: versionsDetails.data[0].id });
|
|
73
42
|
}
|
|
74
|
-
const productObj = getProductObj(allProducts.data.productsResult, product);
|
|
75
|
-
const sfdcVersions = getUniqueSortedVersions(fetchedVersions);
|
|
76
|
-
const productVersions = (productObj === null || productObj === void 0 ? void 0 : productObj.hasComponentsInsteadOfVersions) ? sfdcVersions.sort() : sfdcVersions;
|
|
77
|
-
setSelectVersionOptions(productVersions);
|
|
78
43
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
79
|
-
}, [versionsDetails.data
|
|
44
|
+
}, [versionsDetails.data]);
|
|
80
45
|
const onSelect = (selectedOption) => {
|
|
81
46
|
const selection = selectedOption.value;
|
|
82
47
|
if (isEqual(selection, version)) {
|
|
83
|
-
props.onVersionChange('');
|
|
48
|
+
props.onVersionChange('');
|
|
49
|
+
setCaseState(caseDispatch, { selectedVersionId: undefined });
|
|
84
50
|
return;
|
|
85
51
|
}
|
|
86
52
|
props.onVersionChange(selection);
|
|
53
|
+
const versionObj = versionsDetails.data.find((v) => v.name === selection);
|
|
54
|
+
setCaseState(caseDispatch, { selectedVersionId: versionObj === null || versionObj === void 0 ? void 0 : versionObj.id });
|
|
87
55
|
};
|
|
88
|
-
// Create selected option for SingleSelectDropdown
|
|
89
56
|
const getSelectedOption = () => ({
|
|
90
57
|
label: version || '',
|
|
91
58
|
value: version || '',
|
|
92
59
|
});
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
value: versionOption,
|
|
60
|
+
const getDropdownOptions = () => versionsDetails.data.map((v) => ({
|
|
61
|
+
label: v.name,
|
|
62
|
+
value: v.name,
|
|
97
63
|
}));
|
|
98
|
-
return (React.createElement(SingleSelectDropdown, { onSelect: onSelect, selected: getSelectedOption(), options: getDropdownOptions(), placeholder: t('Select a version'), ariaLabel: t('Select a version'), isInvalid: isEmpty(version) && showValidationLocal, isDisabled: isEmpty(product) || allProducts.isFetching, dataTrackingId: "get-support-version-dropdown-selector", isLoading:
|
|
64
|
+
return (React.createElement(SingleSelectDropdown, { onSelect: onSelect, selected: getSelectedOption(), options: getDropdownOptions(), placeholder: t('Select a version'), ariaLabel: t('Select a version'), isInvalid: isEmpty(version) && showValidationLocal, isDisabled: isEmpty(product) || allProducts.isFetching, dataTrackingId: "get-support-version-dropdown-selector", isLoading: versionsDetails.isFetching }));
|
|
99
65
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductSelector.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductSelector.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAKlE,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;IACzE,gCAAgC,CAAC,EAAE,OAAO,CAAC;IAC3C,aAAa,CAAC,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAC9D,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,KAAK,EAAE,MAAM,qBAiGpD"}
|
|
@@ -7,7 +7,6 @@ import isEqual from 'lodash/isEqual';
|
|
|
7
7
|
import React, { useContext, useEffect, useRef } from 'react';
|
|
8
8
|
import { Trans, useTranslation } from 'react-i18next';
|
|
9
9
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
10
|
-
import { RouteContext } from '../../context/RouteContext';
|
|
11
10
|
import { useAB } from '../../hooks/useAB';
|
|
12
11
|
import { useFetchCVEData } from '../../hooks/useFetchCVEData';
|
|
13
12
|
import { setCaseState } from '../../reducers/CaseReducer';
|
|
@@ -31,7 +30,6 @@ export default function ProductSelector(props) {
|
|
|
31
30
|
product: state.caseDetails.product,
|
|
32
31
|
version: state.caseDetails.version,
|
|
33
32
|
}), isEqual);
|
|
34
|
-
const { routeState: { isCaseCreate }, } = useContext(RouteContext);
|
|
35
33
|
const caseDispatch = useCaseDispatch();
|
|
36
34
|
const cveModalEnabledConfig = getConfigField(pcmConfig.data, 'isCVEModalEnabled', PCM_CONFIG_FIELD_TYPE.STRING);
|
|
37
35
|
const isCVEModalEnabled = cveModalEnabledConfig === '1';
|
|
@@ -51,7 +49,7 @@ export default function ProductSelector(props) {
|
|
|
51
49
|
const productSelectorRef = useRef(null);
|
|
52
50
|
const rederProductSelect = (React.createElement("form", null,
|
|
53
51
|
(cveRecommendation === null || cveRecommendation === void 0 ? void 0 : cveRecommendation.length) !== 0 && isCVEModalEnabled && React.createElement(CveModal, null),
|
|
54
|
-
React.createElement(AllProductsSelector, { routeProps: props.routeProps,
|
|
52
|
+
React.createElement(AllProductsSelector, { routeProps: props.routeProps, ref: productSelectorRef, isOnSummaryPage: true, isOnGetSupportPage: props === null || props === void 0 ? void 0 : props.isOnGetSupportPage, caseCreateExperience: props.caseCreateExperience })));
|
|
55
53
|
return (React.createElement(React.Fragment, null,
|
|
56
54
|
React.createElement(AlertMessage, { variant: AlertType.DANGER, className: "pf-v6-u-mt-lg", title: t('There was an error loading products.'), show: allProducts.isError }),
|
|
57
55
|
rederProductSelect,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Review.d.ts","sourceRoot":"","sources":["../../../../src/components/Review/Review.tsx"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"Review.d.ts","sourceRoot":"","sources":["../../../../src/components/Review/Review.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAIvD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAoBlE,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AACD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,MAAM,qBA4F3C"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Grid, GridItem } from '@patternfly/react-core';
|
|
2
|
-
import { AbilityContext, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
2
|
+
// import { AbilityContext, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
3
3
|
import { PreviousCaseTypes } from '@rh-support/utils';
|
|
4
4
|
import isEmpty from 'lodash/isEmpty';
|
|
5
5
|
import isEqual from 'lodash/isEqual';
|
|
6
|
-
import React, {
|
|
6
|
+
import React, { useEffect, useRef } from 'react';
|
|
7
7
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
8
8
|
import { setCaseDetails } from '../../reducers/CaseReducer';
|
|
9
9
|
import { AccountSelector } from '../AccountInfo/AccountSelector';
|
|
10
10
|
import { OwnerSelector } from '../AccountInfo/OwnerSelector';
|
|
11
|
-
import CaseGroup from '../CaseInformation/CaseGroup';
|
|
11
|
+
// import CaseGroup from '../CaseInformation/CaseGroup';
|
|
12
12
|
import CaseType from '../CaseInformation/CaseType';
|
|
13
13
|
import { ContactPhoneNumber } from '../CaseInformation/ContactPhoneNumber';
|
|
14
14
|
import { ContactPhoneNumberAlert } from '../CaseInformation/ContactPhoneNumberAlert';
|
|
@@ -16,12 +16,12 @@ import Fts from '../CaseInformation/Fts';
|
|
|
16
16
|
import Severity from '../CaseInformation/Severity';
|
|
17
17
|
import SupportLevel from '../CaseInformation/SupportLevel';
|
|
18
18
|
import CaseLanguageSelector from '../CaseManagement/CaseLanguageSelector';
|
|
19
|
-
import { Cep } from '../CaseManagement/Cep';
|
|
19
|
+
// import { Cep } from '../CaseManagement/Cep';
|
|
20
20
|
import OpenReferenceNumber from '../CaseManagement/OpenReferenceNumber';
|
|
21
21
|
import { OpenShiftClusterId } from '../CaseManagement/OpenShiftClusterId';
|
|
22
|
-
import { RHAssociatesSelector } from '../CaseManagement/RHAssociatesSelector';
|
|
23
|
-
import CaseContactSelector from '../CaseManagement/SendNotifications/CaseContactSelector';
|
|
24
|
-
import { Hostname } from '../ImproveCase/Hostname';
|
|
22
|
+
// import { RHAssociatesSelector } from '../CaseManagement/RHAssociatesSelector';
|
|
23
|
+
// import CaseContactSelector from '../CaseManagement/SendNotifications/CaseContactSelector';
|
|
24
|
+
// import { Hostname } from '../ImproveCase/Hostname';
|
|
25
25
|
import KtQuestions from '../ImproveCase/KtQuestions';
|
|
26
26
|
import { AllProductsSelector } from '../ProductSelector/AllProductsSelector';
|
|
27
27
|
export default function Review(props) {
|
|
@@ -41,8 +41,12 @@ export default function Review(props) {
|
|
|
41
41
|
}
|
|
42
42
|
previousCaseTypeRef.current = caseType;
|
|
43
43
|
}, [caseType, caseDispatch]);
|
|
44
|
-
const ability = useContext(AbilityContext);
|
|
45
|
-
const canSeeEmailNotifications = ability.can(
|
|
44
|
+
// const ability = useContext(AbilityContext);
|
|
45
|
+
// const canSeeEmailNotifications = ability.can(
|
|
46
|
+
// resourceActions.PATCH,
|
|
47
|
+
// resources.CASE_DETAILS,
|
|
48
|
+
// CaseDetailsFields.CASE_DETAILS_SEND_NOTIFICATIONS
|
|
49
|
+
// );
|
|
46
50
|
const onSeverityChange = (payload) => {
|
|
47
51
|
setCaseDetails(caseDispatch, payload);
|
|
48
52
|
};
|
|
@@ -50,9 +54,8 @@ export default function Review(props) {
|
|
|
50
54
|
React.createElement("form", { className: "review-form card card-light push-bottom" },
|
|
51
55
|
React.createElement(AccountSelector, null),
|
|
52
56
|
React.createElement(OwnerSelector, null),
|
|
53
|
-
React.createElement(AllProductsSelector, { routeProps: props.routeProps, loadTCOnChange: true, showTCAfterButtonClicked: true,
|
|
57
|
+
React.createElement(AllProductsSelector, { routeProps: props.routeProps, loadTCOnChange: true, showTCAfterButtonClicked: true, isOnReviewPage: true }),
|
|
54
58
|
React.createElement(OpenShiftClusterId, null),
|
|
55
|
-
caseType !== PreviousCaseTypes.FEATURE_ENHANCEMENT && React.createElement(Hostname, null),
|
|
56
59
|
React.createElement(KtQuestions, { inlineEditable: true, hideSaveCancel: true, onlyShowKT4: caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT }),
|
|
57
60
|
React.createElement(CaseType, null),
|
|
58
61
|
React.createElement(SupportLevel, null),
|
|
@@ -65,11 +68,6 @@ export default function Review(props) {
|
|
|
65
68
|
React.createElement(Fts, { inlineEditable: true, initialIsEditing: isEmpty(contactInfo24x7), hideSaveCancel: true }),
|
|
66
69
|
React.createElement(Grid, { hasGutter: true },
|
|
67
70
|
React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
|
|
68
|
-
React.createElement(CaseLanguageSelector, null)),
|
|
69
|
-
|
|
70
|
-
React.createElement(CaseGroup, null))),
|
|
71
|
-
canSeeEmailNotifications && React.createElement(CaseContactSelector, null),
|
|
72
|
-
React.createElement(RHAssociatesSelector, null),
|
|
73
|
-
React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true }),
|
|
74
|
-
React.createElement(Cep, null))));
|
|
71
|
+
React.createElement(CaseLanguageSelector, null))),
|
|
72
|
+
React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true }))));
|
|
75
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionRestore.d.ts","sourceRoot":"","sources":["../../../../src/components/SessionRestore/SessionRestore.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SessionRestore.d.ts","sourceRoot":"","sources":["../../../../src/components/SessionRestore/SessionRestore.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAgC,YAAY,EAAE,MAAM,qDAAqD,CAAC;AAQjH,OAAO,KAAkD,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAQvD,OAAO,EAGH,eAAe,EAElB,MAAM,iCAAiC,CAAC;AAmBzC,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,eAAO,MAAM,6BAA6B,GAAI,aAAa,YAAY,GAAG,SAAS,EAAE,uBAAuB,MAAM,YAKjH,CAAC;AAEF,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,qBAwX3C"}
|
|
@@ -8,6 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
11
|
+
import { useApolloClient } from '@apollo/client/react';
|
|
11
12
|
import { pcm } from '@cee-eng/hydrajs';
|
|
12
13
|
import { useDebounce, useDeepCompareDebounce, usePrevious } from '@rh-support/components';
|
|
13
14
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
@@ -43,6 +44,7 @@ export const isSessionFromCurrentAuthCycle = (sessionItem, currentLoginStartTime
|
|
|
43
44
|
};
|
|
44
45
|
export function SessionRestore(props) {
|
|
45
46
|
var _a;
|
|
47
|
+
const apolloClient = useApolloClient();
|
|
46
48
|
const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
|
|
47
49
|
const dispatchToAttachmentReducer = useContext(AttachmentDispatchContext);
|
|
48
50
|
const { sessionRestore } = useContext(SessionRestoreStateContext);
|
|
@@ -239,7 +241,7 @@ export function SessionRestore(props) {
|
|
|
239
241
|
const reg = new RegExp('Cluster Name: (.*) ');
|
|
240
242
|
const v3ClusterName = reg.exec(sessionDetails.description) ? reg.exec(sessionDetails.description)[1] : '';
|
|
241
243
|
setCaseState(caseDispatch, { v3ClusterName });
|
|
242
|
-
yield updateCaseWithSession(caseDispatch, sessionItem, loggedInUserRights.data.getAccountNumber(), loggedInUserRights.data.getHydraContactFromLoggedInUser(), loggedInUsersAccount.data);
|
|
244
|
+
yield updateCaseWithSession(caseDispatch, sessionItem, loggedInUserRights.data.getAccountNumber(), loggedInUserRights.data.getHydraContactFromLoggedInUser(), loggedInUsersAccount.data, apolloClient);
|
|
243
245
|
if (!isAISureSession(sessionItem)) {
|
|
244
246
|
restoreFilesFromSession(dispatchToAttachmentReducer, sessionItem.session.id);
|
|
245
247
|
}
|
|
@@ -223,7 +223,7 @@ export default function UpdateSeverityModal(props) {
|
|
|
223
223
|
});
|
|
224
224
|
onClose();
|
|
225
225
|
caseUpdateError.showError(e, t(`Failed to update case status. Please try again`));
|
|
226
|
-
yield updateCaseDetails(caseDispatch, caseDetails.caseNumber, Object.assign({ status: 'Waiting on Customer' },
|
|
226
|
+
yield updateCaseDetails(caseDispatch, caseDetails.caseNumber, Object.assign({ status: 'Waiting on Customer' }, updatedCaseDetails));
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsSectionValid.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/useIsSectionValid.tsx"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"useIsSectionValid.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/useIsSectionValid.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAyB1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAKnE,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,gBAAgB;;;;;EAuQ9D"}
|
|
@@ -1,32 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { contacts } from '@cee-eng/hydrajs';
|
|
1
|
+
// import { contacts } from '@cee-eng/hydrajs';
|
|
11
2
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
12
|
-
import find from 'lodash/find';
|
|
3
|
+
// import find from 'lodash/find';
|
|
13
4
|
import isEmpty from 'lodash/isEmpty';
|
|
14
5
|
import isEqual from 'lodash/isEqual';
|
|
15
|
-
import React, { useContext
|
|
6
|
+
import React, { useContext } from 'react';
|
|
7
|
+
// import React, { useContext, useEffect, useState } from 'react';
|
|
16
8
|
import { Trans } from 'react-i18next';
|
|
17
9
|
import { useCaseSelector } from '../../context/CaseContext';
|
|
18
|
-
import { RouteContext
|
|
10
|
+
import { RouteContext } from '../../context/RouteContext';
|
|
11
|
+
// import { RouteContext, useRouteDispatchContext } from '../../context/RouteContext';
|
|
19
12
|
import { TCStateContext } from '../../context/TopContentContext';
|
|
20
13
|
import { useAB } from '../../hooks/useAB';
|
|
21
14
|
import { CASE_DEATILS_ENVIRONMENT_LIMIT, CASE_REFERENCE_NUMBER_LIMIT, CONTACT_INFO_24X7_LIMIT, HOSTNAME_LENGTH_LIMIT, ISSUE_SUMMARY_LENGTH_LIMIT, KTQUESTION_MAX_LIMIT, TITLE_SUMMARY_LENGTH_LIMIT, } from '../../reducers/CaseConstNTypes';
|
|
22
15
|
import { isCaseInformationSectionValid, isCaseManagementStateValid, isCaseStateValid, isClusterIDValid, isIdeaCaseStateValid, } from '../../reducers/CaseHelpers';
|
|
23
16
|
import { AppRouteSections } from '../../reducers/RouteConstNTypes';
|
|
24
|
-
import { setNoValidEntitlement } from '../../reducers/RouteReducer';
|
|
25
17
|
import { AttachmentStateContext } from './fileUpload/reducer/AttachmentReducerContext';
|
|
26
18
|
export function useIsSectionValid(sectionName) {
|
|
27
|
-
var _a, _b;
|
|
28
19
|
const { isVariationA } = useAB();
|
|
29
|
-
const { caseState, caseType, product, version, contactSSOName, accountNumber, summary, hostname, contactInfo24x7, alternateId, selectedAccountDetails, issue, environment, timeFramesAndUrgency, periodicityOfIssue,
|
|
20
|
+
const { caseState, caseType, product, version, contactSSOName, accountNumber, summary, hostname, contactInfo24x7, alternateId, selectedAccountDetails, issue, environment, timeFramesAndUrgency, periodicityOfIssue, manageSupportCases, } = useCaseSelector((state) => ({
|
|
30
21
|
caseState: state,
|
|
31
22
|
caseType: state.caseDetails.caseType,
|
|
32
23
|
product: state.caseDetails.product,
|
|
@@ -42,35 +33,38 @@ export function useIsSectionValid(sectionName) {
|
|
|
42
33
|
environment: state.caseDetails.environment,
|
|
43
34
|
timeFramesAndUrgency: state.caseDetails.timeFramesAndUrgency,
|
|
44
35
|
periodicityOfIssue: state.caseDetails.periodicityOfIssue,
|
|
45
|
-
ssoUsername: state.selectedOwner.data.ssoUsername,
|
|
36
|
+
// ssoUsername: state.selectedOwner.data.ssoUsername,
|
|
46
37
|
manageSupportCases: state.selectedOwner.data.manageSupportCases,
|
|
47
38
|
}), isEqual);
|
|
48
|
-
const routeDispatch = useRouteDispatchContext();
|
|
49
|
-
const [isEntitlement, setIsEntitlement] = useState(null);
|
|
50
|
-
useEffect(() => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
//&seSessionId=8e8960ac-680b-443e-bf67-9e13f2acd64e
|
|
39
|
+
// const routeDispatch = useRouteDispatchContext();
|
|
40
|
+
// const [isEntitlement, setIsEntitlement] = useState<boolean | null>(null);
|
|
41
|
+
// useEffect(() => {
|
|
42
|
+
// const fetchContactDetails = async () => {
|
|
43
|
+
// if (ssoUsername) {
|
|
44
|
+
// try {
|
|
45
|
+
// const response = await contacts.getSFDCContactBySso(ssoUsername);
|
|
46
|
+
// setIsEntitlement(response?.isEntitled ?? null);
|
|
47
|
+
// setNoValidEntitlement(routeDispatch, !response?.isEntitled);
|
|
48
|
+
// } catch (error) {
|
|
49
|
+
// console.error('Error fetching contact details:', error);
|
|
50
|
+
// setIsEntitlement(null);
|
|
51
|
+
// setNoValidEntitlement(routeDispatch, null);
|
|
52
|
+
// }
|
|
53
|
+
// }
|
|
54
|
+
// };
|
|
55
|
+
// fetchContactDetails();
|
|
56
|
+
// }, [ssoUsername, routeDispatch]);
|
|
57
|
+
// Contact-level entitlement hardcoded to true — now resolved from SFDCProductJSON__c
|
|
58
|
+
const isEntitlement = true;
|
|
69
59
|
const { routeState: { isCaseCreate }, } = useContext(RouteContext);
|
|
70
60
|
const { globalMetadataState: { allProducts, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
|
|
71
61
|
const { topContentState: { topContent }, } = useContext(TCStateContext);
|
|
72
|
-
|
|
73
|
-
const
|
|
62
|
+
// isEntitledProduct — commented out; product-level entitlement now resolved from SFDCProductJSON__c
|
|
63
|
+
// const isEntitledProduct = find(
|
|
64
|
+
// allProducts?.data?.productsResult,
|
|
65
|
+
// (p) => p.product === caseState.caseDetails.product
|
|
66
|
+
// )?.isEntitledProduct;
|
|
67
|
+
const { routeState: { activeSection }, } = useContext(RouteContext);
|
|
74
68
|
const { attachmentState } = useContext(AttachmentStateContext);
|
|
75
69
|
const selectedLocalFiles = attachmentState.caseFiles.selectedLocalFiles;
|
|
76
70
|
const allowedTypesIdea = ['image/jpeg', 'image/png', 'image/jpg', 'image/gif'];
|
|
@@ -111,8 +105,6 @@ export function useIsSectionValid(sectionName) {
|
|
|
111
105
|
}
|
|
112
106
|
return (!isEmpty(product) &&
|
|
113
107
|
!isEmpty(version) &&
|
|
114
|
-
!isEmpty(accountNumber) &&
|
|
115
|
-
!isEmpty(contactSSOName) &&
|
|
116
108
|
!isEmpty(summary) &&
|
|
117
109
|
(summary === null || summary === void 0 ? void 0 : summary.length) <= TITLE_SUMMARY_LENGTH_LIMIT &&
|
|
118
110
|
!isEmpty(issue) &&
|
|
@@ -129,23 +121,22 @@ export function useIsSectionValid(sectionName) {
|
|
|
129
121
|
};
|
|
130
122
|
const isResourcesSectionValid = () => {
|
|
131
123
|
var _a;
|
|
132
|
-
//
|
|
133
|
-
const isEntitledProductLocal = isSearchIntent ? true : isEntitledProduct;
|
|
134
|
-
// Skip cluster ID validation for Variant A
|
|
124
|
+
// isEntitledProduct check removed — product-level entitlement now resolved from SFDCProductJSON__c
|
|
135
125
|
const clusterIdValid = isVariationA ? true : isClusterIDValid(caseState, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult);
|
|
136
|
-
return
|
|
126
|
+
return clusterIdValid;
|
|
137
127
|
};
|
|
138
128
|
const isReviewSectionValid = () => {
|
|
139
129
|
var _a;
|
|
140
|
-
return (
|
|
141
|
-
|
|
130
|
+
return (
|
|
131
|
+
// isEntitledProduct — product-level entitlement now resolved from SFDCProductJSON__c
|
|
132
|
+
isCaseStateValid(caseState, loggedInUserRights) &&
|
|
142
133
|
isClusterIDValid(caseState, (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult) &&
|
|
143
134
|
isSummarizeSectionValid() &&
|
|
144
135
|
isAdditionalInformationSectionValidLocal());
|
|
145
136
|
};
|
|
146
137
|
const isDescribeIdeaSectionValid = () => {
|
|
147
138
|
return (isCaseManagementStateValid(caseState, loggedInUserRights) &&
|
|
148
|
-
isEntitledProduct
|
|
139
|
+
// isEntitledProduct — product-level entitlement now resolved from SFDCProductJSON__c
|
|
149
140
|
isIdeaCaseStateValid(caseState, loggedInUserRights) &&
|
|
150
141
|
checkUnallowedFiles());
|
|
151
142
|
};
|
|
@@ -185,14 +176,8 @@ export function useIsSectionValid(sectionName) {
|
|
|
185
176
|
}
|
|
186
177
|
};
|
|
187
178
|
const recommendationSectionError = () => {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
const isEntitledProductLocal = isSearchIntent ? true : isEntitledProduct;
|
|
191
|
-
return !isEntitledProductLocal ? (React.createElement(Trans, { i18nKey: "i18ValidEntitlementContactCustomerService" },
|
|
192
|
-
"You need a valid entitlement to create a case.\u00A0 Please contact",
|
|
193
|
-
' ',
|
|
194
|
-
React.createElement("a", { href: "/support/contact/customerService" }, "Customer Service"),
|
|
195
|
-
" for assistance.")) : ('');
|
|
179
|
+
// isEntitledProduct check removed — product-level entitlement now resolved from SFDCProductJSON__c
|
|
180
|
+
return '';
|
|
196
181
|
};
|
|
197
182
|
const getSupportSectionError = () => {
|
|
198
183
|
if (manageSupportCases === false) {
|
|
@@ -202,13 +187,14 @@ export function useIsSectionValid(sectionName) {
|
|
|
202
187
|
React.createElement("a", { href: "/support/contact/customerService" }, "Customer Service"),
|
|
203
188
|
" for assistance."));
|
|
204
189
|
}
|
|
205
|
-
if (isEntitlement === false) {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
190
|
+
// if (isEntitlement === false) {
|
|
191
|
+
// return (
|
|
192
|
+
// <Trans i18nKey="i18ValidEntitlementContactCustomerService">
|
|
193
|
+
// You need a valid entitlement to create a case. Please contact{' '}
|
|
194
|
+
// <a href="/support/contact/customerService">Customer Service</a> for assistance.
|
|
195
|
+
// </Trans>
|
|
196
|
+
// );
|
|
197
|
+
// }
|
|
212
198
|
return '';
|
|
213
199
|
};
|
|
214
200
|
const activeSectionError = (sectionNameLocal) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalTroubleshootEffects.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/GlobalTroubleshootEffects.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GlobalTroubleshootEffects.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/GlobalTroubleshootEffects.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAkD,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAWvD,OAAO,EAAuC,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAYvG,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,qBAoWtD"}
|