@rh-support/troubleshoot 2.6.299 → 2.6.300
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 +40 -28
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ActiveCustomerEscalation/RequestEscalationModal.js +19 -46
- package/lib/esm/components/CaseEditView/Case.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Case.js +17 -49
- package/lib/esm/components/CaseEditView/CaseDetailsAside.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsAside.js +8 -25
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseDetailsTabs.js +17 -31
- package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts +2 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/CaseStatus.js +6 -8
- package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.js +28 -39
- package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts +3 -1
- package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +4 -3
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/ESSRemoteSessionModal.js +7 -4
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/NewEssTermsModal.js +36 -13
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/RemoteSessionAgreementModal.js +33 -11
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseContactPhoneNumber.js +34 -38
- 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 +59 -19
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +9 -16
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts +2 -4
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/CaseDiscussion.js +148 -110
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts +2 -6
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment.js +241 -147
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/VerifyCaseStatusModal/VerifyCaseStatusModal.js +3 -5
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/CaseHistory.js +1 -3
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.css +4 -4
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts +3 -35
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseHistory/Timeline.js +224 -63
- package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseSummary/CaseSummary.js +2 -7
- package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/RMEEscalations/RMEEscalationList.js +9 -7
- package/lib/esm/components/CaseInformation/CaseInformation.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseInformation.js +5 -7
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/ContactPhoneNumber.js +24 -37
- package/lib/esm/components/CaseInformation/SupportLevel.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/SupportLevel.js +55 -32
- 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 +9 -4
- package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/Cep.js +7 -4
- package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
- package/lib/esm/components/IdeaInformation/IdeaInformation.js +12 -11
- package/lib/esm/components/OpenCase/SupportTypeSelectorPage.d.ts.map +1 -1
- package/lib/esm/components/OpenCase/SupportTypeSelectorPage.js +2 -4
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts +1 -0
- package/lib/esm/components/ProductSelector/AllProductsSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/AllProductsSelector.js +15 -3
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductDropdownSelector.js +37 -13
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/NewProductVersionSelector.js +50 -30
- package/lib/esm/components/ProductSelector/ProductSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductSelector.js +3 -1
- package/lib/esm/components/Review/Review.d.ts.map +1 -1
- package/lib/esm/components/Review/Review.js +18 -16
- package/lib/esm/components/SessionRestore/SessionRestore.d.ts.map +1 -1
- package/lib/esm/components/SessionRestore/SessionRestore.js +1 -3
- package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
- package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +8 -5
- package/lib/esm/components/shared/useIsSectionValid.d.ts.map +1 -1
- package/lib/esm/components/shared/useIsSectionValid.js +64 -50
- package/lib/esm/components/shared/usePostComment.d.ts.map +1 -1
- package/lib/esm/components/shared/usePostComment.js +10 -6
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +24 -105
- package/lib/esm/components/wizardLayout/WizardLayout.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardLayout.js +7 -6
- package/lib/esm/components/wizardLayout/WizardNavigation.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/WizardNavigation.js +10 -10
- package/lib/esm/context/CaseContext.d.ts.map +1 -1
- package/lib/esm/hooks/useResetCaseCreate.d.ts.map +1 -1
- package/lib/esm/hooks/useResetCaseCreate.js +11 -18
- package/lib/esm/reducers/CaseConstNTypes.d.ts +3 -86
- package/lib/esm/reducers/CaseConstNTypes.d.ts.map +1 -1
- package/lib/esm/reducers/CaseConstNTypes.js +1 -5
- package/lib/esm/reducers/CaseDetailsPageReducer.d.ts +1 -3
- package/lib/esm/reducers/CaseDetailsPageReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseDetailsPageReducer.js +5 -22
- package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts +2 -0
- package/lib/esm/reducers/CaseDiscussionTabReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseDiscussionTabReducer.js +28 -1
- package/lib/esm/reducers/CaseHelpers.d.ts +1 -2
- package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/CaseHelpers.js +2 -34
- package/lib/esm/reducers/CaseOverviewReducer.d.ts +1 -3
- package/lib/esm/reducers/CaseOverviewReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseOverviewReducer.js +5 -7
- package/lib/esm/reducers/CaseReducer.d.ts +8 -27
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +33 -127
- package/package.json +6 -6
- package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts +0 -3
- package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.d.ts.map +0 -1
- package/lib/esm/components/CaseEditView/RequestRemoteSession/remoteSessionUtils.js +0 -22
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts +0 -15
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.d.ts.map +0 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useAttachmentUploadCompletion.js +0 -19
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts +0 -17
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.d.ts.map +0 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDiscussion/PostComment/useCommentDrafts.js +0 -49
- package/lib/esm/graphql/index.d.ts +0 -4
- package/lib/esm/graphql/index.d.ts.map +0 -1
- package/lib/esm/graphql/index.js +0 -3
- package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts +0 -2
- package/lib/esm/graphql/mutations/createRMECaseEscalation.d.ts.map +0 -1
- package/lib/esm/graphql/mutations/createRMECaseEscalation.js +0 -24
- package/lib/esm/graphql/mutations/index.d.ts +0 -2
- package/lib/esm/graphql/mutations/index.d.ts.map +0 -1
- package/lib/esm/graphql/mutations/index.js +0 -1
- package/lib/esm/graphql/queries/getEscalationDetails.d.ts +0 -2
- package/lib/esm/graphql/queries/getEscalationDetails.d.ts.map +0 -1
- package/lib/esm/graphql/queries/getEscalationDetails.js +0 -24
- package/lib/esm/graphql/queries/getParentId.d.ts +0 -2
- package/lib/esm/graphql/queries/getParentId.d.ts.map +0 -1
- package/lib/esm/graphql/queries/getParentId.js +0 -16
- package/lib/esm/graphql/queries/index.d.ts +0 -3
- package/lib/esm/graphql/queries/index.d.ts.map +0 -1
- package/lib/esm/graphql/queries/index.js +0 -2
- package/lib/esm/graphql/schemas/escalation.d.ts +0 -84
- package/lib/esm/graphql/schemas/escalation.d.ts.map +0 -1
- package/lib/esm/graphql/schemas/escalation.js +0 -1
- package/lib/esm/graphql/schemas/index.d.ts +0 -2
- package/lib/esm/graphql/schemas/index.d.ts.map +0 -1
- package/lib/esm/graphql/schemas/index.js +0 -1
- package/lib/esm/hooks/useCaseComments/caseCommentMutation.d.ts +0 -4
- package/lib/esm/hooks/useCaseComments/caseCommentMutation.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseComments/caseCommentMutation.js +0 -12
- package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts +0 -4
- package/lib/esm/hooks/useCaseComments/caseCommentsQuery.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseComments/caseCommentsQuery.js +0 -55
- package/lib/esm/hooks/useCaseComments/index.d.ts +0 -7
- package/lib/esm/hooks/useCaseComments/index.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseComments/index.js +0 -5
- package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts +0 -25
- package/lib/esm/hooks/useCaseComments/mapCaseComment.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseComments/mapCaseComment.js +0 -66
- package/lib/esm/hooks/useCaseComments/types.d.ts +0 -80
- package/lib/esm/hooks/useCaseComments/types.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseComments/types.js +0 -1
- package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts +0 -16
- package/lib/esm/hooks/useCaseComments/useCaseComments.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseComments/useCaseComments.js +0 -25
- package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts +0 -19
- package/lib/esm/hooks/useCaseComments/useCreateCaseComment.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseComments/useCreateCaseComment.js +0 -33
- package/lib/esm/hooks/useCaseHistory.d.ts +0 -26
- package/lib/esm/hooks/useCaseHistory.d.ts.map +0 -1
- package/lib/esm/hooks/useCaseHistory.js +0 -98
- package/lib/esm/models/caseHistory.d.ts +0 -80
- package/lib/esm/models/caseHistory.d.ts.map +0 -1
- package/lib/esm/models/caseHistory.js +0 -1
- package/lib/esm/utils/TimelineUtils.d.ts +0 -41
- package/lib/esm/utils/TimelineUtils.d.ts.map +0 -1
- package/lib/esm/utils/TimelineUtils.js +0 -134
- package/lib/esm/utils/caseHistoryUtils.d.ts +0 -66
- package/lib/esm/utils/caseHistoryUtils.d.ts.map +0 -1
- package/lib/esm/utils/caseHistoryUtils.js +0 -165
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
import { Button, MenuToggle, Select, SelectList, SelectOption, Spinner, TextInputGroup, TextInputGroupMain, TextInputGroupUtilities, } from '@patternfly/react-core';
|
|
1
|
+
import { Button, Divider, MenuToggle, Select, SelectGroup, 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';
|
|
4
5
|
import isEmpty from 'lodash/isEmpty';
|
|
5
6
|
import isEqual from 'lodash/isEqual';
|
|
6
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
7
|
-
import { useTranslation } from 'react-i18next';
|
|
7
|
+
import React, { useContext, useEffect, useRef, useState } from 'react';
|
|
8
|
+
import { Trans, useTranslation } from 'react-i18next';
|
|
8
9
|
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
|
+
};
|
|
9
14
|
export const NewProductDropdownSelector = (props) => {
|
|
10
15
|
const { t } = useTranslation();
|
|
11
16
|
const [isOpen, setIsOpen] = useState(false);
|
|
12
17
|
const [showValidationLocal, setShowValidationLocal] = useState(props.isNextBtnClickedToShowValidationError);
|
|
18
|
+
const [isSelectedProductSupportedForCustomer, setIsSelectedProductSupportedForCustomer] = useState(true);
|
|
13
19
|
const [filteredProducts, setFilteredProducts] = useState(props.products);
|
|
14
20
|
const [shouldFilter, setShouldFilter] = useState(false);
|
|
15
21
|
const textInputRef = useRef();
|
|
@@ -17,6 +23,7 @@ export const NewProductDropdownSelector = (props) => {
|
|
|
17
23
|
product: state.caseDetails.product,
|
|
18
24
|
}), isEqual);
|
|
19
25
|
const [inputValue, setInputValue] = useState('');
|
|
26
|
+
const { globalMetadataState: { allProducts }, } = useContext(GlobalMetadataStateContext);
|
|
20
27
|
useEffect(() => {
|
|
21
28
|
setShowValidationLocal(props.isNextBtnClickedToShowValidationError);
|
|
22
29
|
}, [props.isNextBtnClickedToShowValidationError]);
|
|
@@ -26,15 +33,22 @@ export const NewProductDropdownSelector = (props) => {
|
|
|
26
33
|
}
|
|
27
34
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
28
35
|
}, [product]);
|
|
36
|
+
// Update filtered products whenever input changes
|
|
29
37
|
useEffect(() => {
|
|
38
|
+
const productsToFilter = props.isCaseCreate ? props.products : allProducts.data.productsResult;
|
|
30
39
|
if (!isEmpty(inputValue === null || inputValue === void 0 ? void 0 : inputValue.trim())) {
|
|
31
|
-
const filtered =
|
|
40
|
+
const filtered = productsToFilter.filter((p) => { var _a; return (_a = p.name) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(inputValue.toLowerCase()); });
|
|
32
41
|
setFilteredProducts(filtered);
|
|
33
42
|
}
|
|
34
43
|
else {
|
|
35
|
-
setFilteredProducts(
|
|
44
|
+
setFilteredProducts(productsToFilter);
|
|
36
45
|
}
|
|
37
|
-
}, [inputValue, props.products]);
|
|
46
|
+
}, [inputValue, props.products, props.isCaseCreate, allProducts.data.productsResult]);
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
product &&
|
|
49
|
+
props.isOnSummaryPage &&
|
|
50
|
+
setIsSelectedProductSupportedForCustomer(isProductSupportedForCustomer(product, allProducts.data.productsResult));
|
|
51
|
+
}, [allProducts.data.productsResult, product, props.isOnSummaryPage]);
|
|
38
52
|
const onToggleClick = () => {
|
|
39
53
|
var _a;
|
|
40
54
|
setIsOpen(!isOpen);
|
|
@@ -69,12 +83,14 @@ export const NewProductDropdownSelector = (props) => {
|
|
|
69
83
|
setIsOpen(false);
|
|
70
84
|
},
|
|
71
85
|
});
|
|
72
|
-
const
|
|
73
|
-
const productsToShow = shouldFilter ? filteredProducts :
|
|
74
|
-
return productsToShow.length > 0 ? (React.createElement(React.Fragment, null,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
86
|
+
const createProductGroup = (products, label, type, shouldFilter = false) => {
|
|
87
|
+
const productsToShow = shouldFilter ? filteredProducts : products;
|
|
88
|
+
return productsToShow.length > 0 ? (React.createElement(React.Fragment, null,
|
|
89
|
+
!shouldFilter && (React.createElement(SelectGroup, { label: label, key: type, value: '', className: "product-selector-group", children: '' })),
|
|
90
|
+
productsToShow.map((prod, index) => {
|
|
91
|
+
var _a;
|
|
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"));
|
|
78
94
|
};
|
|
79
95
|
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 },
|
|
80
96
|
React.createElement(TextInputGroup, { isPlain: true },
|
|
@@ -82,8 +98,16 @@ export const NewProductDropdownSelector = (props) => {
|
|
|
82
98
|
props.isLoading ? (React.createElement(TextInputGroupUtilities, null,
|
|
83
99
|
React.createElement(Spinner, { size: "md" }))) : (React.createElement(TextInputGroupUtilities, Object.assign({}, (!inputValue ? { style: { display: 'none' } } : {})),
|
|
84
100
|
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);
|
|
85
102
|
return (React.createElement("div", null,
|
|
86
103
|
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" },
|
|
87
|
-
React.createElement(SelectList, { id: "product-selector-listbox" },
|
|
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.")))));
|
|
88
112
|
};
|
|
89
113
|
export default NewProductDropdownSelector;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewProductVersionSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/NewProductVersionSelector.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NewProductVersionSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/NewProductVersionSelector.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAM/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,sBAmItD,CAAC"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { useApolloClient } from '@apollo/client/react';
|
|
2
1
|
import { SingleSelectDropdown } from '@rh-support/components';
|
|
3
2
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
4
3
|
import { getUniqueSortedVersions } from '@rh-support/utils';
|
|
5
4
|
import isEmpty from 'lodash/isEmpty';
|
|
6
5
|
import isEqual from 'lodash/isEqual';
|
|
7
|
-
import React, { useContext, useEffect,
|
|
6
|
+
import React, { useContext, useEffect, useState } from 'react';
|
|
8
7
|
import { useTranslation } from 'react-i18next';
|
|
9
8
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
10
|
-
import { getVersionsDetails
|
|
9
|
+
import { getVersionsDetails } from '../../reducers/CaseReducer';
|
|
11
10
|
import { getProductObj } from '../shared/utils';
|
|
12
11
|
export const NewProductVersionSelector = (props) => {
|
|
13
12
|
const { t } = useTranslation();
|
|
13
|
+
const [selectVersionOptions, setSelectVersionOptions] = useState([]);
|
|
14
14
|
const [showValidationLocal, setShowValidationLocal] = useState(props.isNextBtnClickedToShowValidationError);
|
|
15
|
+
const [isSEProductApiIsDown, setIsSEProductApiIsDown] = useState(false);
|
|
15
16
|
const caseDispatch = useCaseDispatch();
|
|
16
|
-
const apolloClient = useApolloClient();
|
|
17
17
|
const { versionsDetails, product, version } = useCaseSelector((state) => ({
|
|
18
18
|
product: state.caseDetails.product,
|
|
19
19
|
version: state.caseDetails.version,
|
|
@@ -24,56 +24,76 @@ export const NewProductVersionSelector = (props) => {
|
|
|
24
24
|
setShowValidationLocal(props.isNextBtnClickedToShowValidationError);
|
|
25
25
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26
26
|
}, [props.isNextBtnClickedToShowValidationError]);
|
|
27
|
+
// when user selects a product, we need to fetch versions
|
|
27
28
|
useEffect(() => {
|
|
28
29
|
if (isEmpty(product))
|
|
29
30
|
return;
|
|
30
31
|
const productObj = getProductObj(allProducts.data.productsResult, product);
|
|
31
|
-
if (productObj.
|
|
32
|
-
|
|
32
|
+
if (productObj.versions) {
|
|
33
|
+
const productVersions = productObj.hasComponentsInsteadOfVersions
|
|
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);
|
|
33
41
|
}
|
|
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();
|
|
34
48
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
35
49
|
}, [product]);
|
|
36
50
|
useEffect(() => {
|
|
37
|
-
|
|
38
|
-
if (versionsDetails.isFetching || !((_a = versionsDetails.data) === null || _a === void 0 ? void 0 : _a.length))
|
|
51
|
+
if (!product)
|
|
39
52
|
return;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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);
|
|
43
62
|
}
|
|
44
63
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
45
|
-
}, [
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (!
|
|
49
|
-
return
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
if (
|
|
53
|
-
|
|
64
|
+
}, [version]);
|
|
65
|
+
// observe when fetched versions are available
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
if (!isSEProductApiIsDown)
|
|
68
|
+
return;
|
|
69
|
+
const fetchedVersions = versionsDetails.data.map(({ name }) => name);
|
|
70
|
+
// if versions array has one value set that value as selected
|
|
71
|
+
if (fetchedVersions.length === 1) {
|
|
72
|
+
props.onVersionChange(fetchedVersions[0]);
|
|
54
73
|
}
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
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
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
79
|
+
}, [versionsDetails.data, isSEProductApiIsDown]);
|
|
59
80
|
const onSelect = (selectedOption) => {
|
|
60
81
|
const selection = selectedOption.value;
|
|
61
82
|
if (isEqual(selection, version)) {
|
|
62
|
-
props.onVersionChange('');
|
|
63
|
-
setCaseState(caseDispatch, { selectedVersionId: undefined });
|
|
83
|
+
props.onVersionChange(''); // To unselect a version when user clicks on the same selected product version
|
|
64
84
|
return;
|
|
65
85
|
}
|
|
66
86
|
props.onVersionChange(selection);
|
|
67
|
-
const versionObj = versionsDetails.data.find((v) => v.name === selection);
|
|
68
|
-
setCaseState(caseDispatch, { selectedVersionId: versionObj === null || versionObj === void 0 ? void 0 : versionObj.id });
|
|
69
87
|
};
|
|
88
|
+
// Create selected option for SingleSelectDropdown
|
|
70
89
|
const getSelectedOption = () => ({
|
|
71
90
|
label: version || '',
|
|
72
91
|
value: version || '',
|
|
73
92
|
});
|
|
74
|
-
|
|
93
|
+
// Create options array for SingleSelectDropdown
|
|
94
|
+
const getDropdownOptions = () => selectVersionOptions.map((versionOption) => ({
|
|
75
95
|
label: versionOption,
|
|
76
96
|
value: versionOption,
|
|
77
97
|
}));
|
|
78
|
-
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 }));
|
|
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: isSEProductApiIsDown && versionsDetails.isFetching }));
|
|
79
99
|
};
|
|
@@ -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;AAOvD,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,qBAqGpD"}
|
|
@@ -7,6 +7,7 @@ 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';
|
|
10
11
|
import { useAB } from '../../hooks/useAB';
|
|
11
12
|
import { useFetchCVEData } from '../../hooks/useFetchCVEData';
|
|
12
13
|
import { setCaseState } from '../../reducers/CaseReducer';
|
|
@@ -30,6 +31,7 @@ export default function ProductSelector(props) {
|
|
|
30
31
|
product: state.caseDetails.product,
|
|
31
32
|
version: state.caseDetails.version,
|
|
32
33
|
}), isEqual);
|
|
34
|
+
const { routeState: { isCaseCreate }, } = useContext(RouteContext);
|
|
33
35
|
const caseDispatch = useCaseDispatch();
|
|
34
36
|
const cveModalEnabledConfig = getConfigField(pcmConfig.data, 'isCVEModalEnabled', PCM_CONFIG_FIELD_TYPE.STRING);
|
|
35
37
|
const isCVEModalEnabled = cveModalEnabledConfig === '1';
|
|
@@ -49,7 +51,7 @@ export default function ProductSelector(props) {
|
|
|
49
51
|
const productSelectorRef = useRef(null);
|
|
50
52
|
const rederProductSelect = (React.createElement("form", null,
|
|
51
53
|
(cveRecommendation === null || cveRecommendation === void 0 ? void 0 : cveRecommendation.length) !== 0 && isCVEModalEnabled && React.createElement(CveModal, null),
|
|
52
|
-
React.createElement(AllProductsSelector, { routeProps: props.routeProps, ref: productSelectorRef, isOnSummaryPage: true, isOnGetSupportPage: props === null || props === void 0 ? void 0 : props.isOnGetSupportPage, caseCreateExperience: props.caseCreateExperience })));
|
|
54
|
+
React.createElement(AllProductsSelector, { routeProps: props.routeProps, checkEntitledProduct: isCaseCreate ? true : false, ref: productSelectorRef, isOnSummaryPage: true, isOnGetSupportPage: props === null || props === void 0 ? void 0 : props.isOnGetSupportPage, caseCreateExperience: props.caseCreateExperience })));
|
|
53
55
|
return (React.createElement(React.Fragment, null,
|
|
54
56
|
React.createElement(AlertMessage, { variant: AlertType.DANGER, className: "pf-v6-u-mt-lg", title: t('There was an error loading products.'), show: allProducts.isError }),
|
|
55
57
|
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,KAAwC,MAAM,OAAO,CAAC;AAC7D,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,qBAqF3C"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Grid, GridItem } from '@patternfly/react-core';
|
|
2
|
-
|
|
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, { useEffect, useRef } from 'react';
|
|
6
|
+
import React, { useContext, 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
|
-
|
|
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
|
-
|
|
19
|
+
import { Cep } from '../CaseManagement/Cep';
|
|
20
20
|
import OpenReferenceNumber from '../CaseManagement/OpenReferenceNumber';
|
|
21
21
|
import { OpenShiftClusterId } from '../CaseManagement/OpenShiftClusterId';
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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,12 +41,8 @@ export default function Review(props) {
|
|
|
41
41
|
}
|
|
42
42
|
previousCaseTypeRef.current = caseType;
|
|
43
43
|
}, [caseType, caseDispatch]);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
// resourceActions.PATCH,
|
|
47
|
-
// resources.CASE_DETAILS,
|
|
48
|
-
// CaseDetailsFields.CASE_DETAILS_SEND_NOTIFICATIONS
|
|
49
|
-
// );
|
|
44
|
+
const ability = useContext(AbilityContext);
|
|
45
|
+
const canSeeEmailNotifications = ability.can(resourceActions.PATCH, resources.CASE_DETAILS, CaseDetailsFields.CASE_DETAILS_SEND_NOTIFICATIONS);
|
|
50
46
|
const onSeverityChange = (payload) => {
|
|
51
47
|
setCaseDetails(caseDispatch, payload);
|
|
52
48
|
};
|
|
@@ -54,8 +50,9 @@ export default function Review(props) {
|
|
|
54
50
|
React.createElement("form", { className: "review-form card card-light push-bottom" },
|
|
55
51
|
React.createElement(AccountSelector, null),
|
|
56
52
|
React.createElement(OwnerSelector, null),
|
|
57
|
-
React.createElement(AllProductsSelector, { routeProps: props.routeProps, loadTCOnChange: true, showTCAfterButtonClicked: true, isOnReviewPage: true }),
|
|
53
|
+
React.createElement(AllProductsSelector, { routeProps: props.routeProps, loadTCOnChange: true, showTCAfterButtonClicked: true, checkEntitledProduct: true, isOnReviewPage: true }),
|
|
58
54
|
React.createElement(OpenShiftClusterId, null),
|
|
55
|
+
caseType !== PreviousCaseTypes.FEATURE_ENHANCEMENT && React.createElement(Hostname, null),
|
|
59
56
|
React.createElement(KtQuestions, { inlineEditable: true, hideSaveCancel: true, onlyShowKT4: caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT }),
|
|
60
57
|
React.createElement(CaseType, null),
|
|
61
58
|
React.createElement(SupportLevel, null),
|
|
@@ -68,6 +65,11 @@ export default function Review(props) {
|
|
|
68
65
|
React.createElement(Fts, { inlineEditable: true, initialIsEditing: isEmpty(contactInfo24x7), hideSaveCancel: true }),
|
|
69
66
|
React.createElement(Grid, { hasGutter: true },
|
|
70
67
|
React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
|
|
71
|
-
React.createElement(CaseLanguageSelector, null))
|
|
72
|
-
|
|
68
|
+
React.createElement(CaseLanguageSelector, null)),
|
|
69
|
+
React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
|
|
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))));
|
|
73
75
|
}
|
|
@@ -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":"AAEA,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,qBAsX3C"}
|
|
@@ -8,7 +8,6 @@ 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';
|
|
12
11
|
import { pcm } from '@cee-eng/hydrajs';
|
|
13
12
|
import { useDebounce, useDeepCompareDebounce, usePrevious } from '@rh-support/components';
|
|
14
13
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
@@ -44,7 +43,6 @@ export const isSessionFromCurrentAuthCycle = (sessionItem, currentLoginStartTime
|
|
|
44
43
|
};
|
|
45
44
|
export function SessionRestore(props) {
|
|
46
45
|
var _a;
|
|
47
|
-
const apolloClient = useApolloClient();
|
|
48
46
|
const sessionRestoreDispatch = useContext(SessionRestoreDispatchContext);
|
|
49
47
|
const dispatchToAttachmentReducer = useContext(AttachmentDispatchContext);
|
|
50
48
|
const { sessionRestore } = useContext(SessionRestoreStateContext);
|
|
@@ -241,7 +239,7 @@ export function SessionRestore(props) {
|
|
|
241
239
|
const reg = new RegExp('Cluster Name: (.*) ');
|
|
242
240
|
const v3ClusterName = reg.exec(sessionDetails.description) ? reg.exec(sessionDetails.description)[1] : '';
|
|
243
241
|
setCaseState(caseDispatch, { v3ClusterName });
|
|
244
|
-
yield updateCaseWithSession(caseDispatch, sessionItem, loggedInUserRights.data.getAccountNumber(), loggedInUserRights.data.getHydraContactFromLoggedInUser(), loggedInUsersAccount.data
|
|
242
|
+
yield updateCaseWithSession(caseDispatch, sessionItem, loggedInUserRights.data.getAccountNumber(), loggedInUserRights.data.getHydraContactFromLoggedInUser(), loggedInUsersAccount.data);
|
|
245
243
|
if (!isAISureSession(sessionItem)) {
|
|
246
244
|
restoreFilesFromSession(dispatchToAttachmentReducer, sessionItem.session.id);
|
|
247
245
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateSeverityModal.d.ts","sourceRoot":"","sources":["../../../../src/components/UpdateSeverityModal/UpdateSeverityModal.tsx"],"names":[],"mappings":"AAmCA,OAAO,KAAmE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"UpdateSeverityModal.d.ts","sourceRoot":"","sources":["../../../../src/components/UpdateSeverityModal/UpdateSeverityModal.tsx"],"names":[],"mappings":"AAmCA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAgBxF,UAAU,MAAM;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAqlBxD"}
|
|
@@ -7,7 +7,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import { useApolloClient } from '@apollo/client/react';
|
|
11
10
|
import { publicApi } from '@cee-eng/hydrajs';
|
|
12
11
|
import { Button, Dropdown, DropdownItem, DropdownList, Flex, FlexItem, MenuToggle, Modal, ModalBody, ModalFooter, ModalHeader, Spinner, TextArea, } from '@patternfly/react-core';
|
|
13
12
|
import { ToastNotification, useFetch } from '@rh-support/components';
|
|
@@ -22,8 +21,10 @@ import map from 'lodash/map';
|
|
|
22
21
|
import React, { useContext, useEffect, useReducer, useRef, useState } from 'react';
|
|
23
22
|
import { Trans, useTranslation } from 'react-i18next';
|
|
24
23
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
25
|
-
import {
|
|
24
|
+
import { useCaseDetailsPageStateContext } from '../../context/CaseDetailsPageContext';
|
|
25
|
+
import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext, } from '../../context/CaseDiscussionTabContext';
|
|
26
26
|
import { useCaseUpdateErrorMessage } from '../../hooks/useCaseUpdateErrorMessage';
|
|
27
|
+
import { updateDiscussionStateComments } from '../../reducers/CaseDiscussionTabReducer';
|
|
27
28
|
import { getNewSeverityStringDef, getSeverityDescription } from '../../reducers/CaseHelpers';
|
|
28
29
|
import { caseOverviewReducer, initialCaseViewState, setSeverityUpdating } from '../../reducers/CaseOverviewReducer';
|
|
29
30
|
import { checkForCaseStatusToggleOnAttachOrComment, setCaseState, updateCaseDetails } from '../../reducers/CaseReducer';
|
|
@@ -39,10 +40,12 @@ export default function UpdateSeverityModal(props) {
|
|
|
39
40
|
const [isUpdateClickedToShowError, setIsUpdateClickedToShowError] = useState(false);
|
|
40
41
|
const [isSeverityInValid, setIsSeverityInValid] = useState(false);
|
|
41
42
|
const [seviritiesOptions, setSeveritiesOptions] = useState([]);
|
|
42
|
-
const client = useApolloClient();
|
|
43
43
|
const { request: postCommentRequest, isFetching: isPostingComment } = useFetch(publicApi.kase.postComment, {
|
|
44
44
|
propgateErrors: true,
|
|
45
45
|
});
|
|
46
|
+
const { caseDetailsPageState: { caseFeedbacksHydra }, } = useCaseDetailsPageStateContext();
|
|
47
|
+
const dispatchDiscussion = useCaseDiscussionTabDispatchContext();
|
|
48
|
+
const { sort, allDiscussions, discussionFiltersListState } = useCaseDiscussionTabStateContext();
|
|
46
49
|
const { globalMetadataState: { allCaseSeverities, allProducts, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
|
|
47
50
|
const caseState = useCaseSelector((state) => ({
|
|
48
51
|
caseDetails: {
|
|
@@ -220,7 +223,7 @@ export default function UpdateSeverityModal(props) {
|
|
|
220
223
|
});
|
|
221
224
|
onClose();
|
|
222
225
|
caseUpdateError.showError(e, t(`Failed to update case status. Please try again`));
|
|
223
|
-
yield updateCaseDetails(caseDispatch, caseDetails.caseNumber, Object.assign({ status: 'Waiting on Customer' },
|
|
226
|
+
yield updateCaseDetails(caseDispatch, caseDetails.caseNumber, Object.assign({ status: 'Waiting on Customer' }, updateCaseDetails));
|
|
224
227
|
}
|
|
225
228
|
}
|
|
226
229
|
catch (e) {
|
|
@@ -244,7 +247,7 @@ export default function UpdateSeverityModal(props) {
|
|
|
244
247
|
setDescriptionValue(descriptionValue === null || descriptionValue === void 0 ? void 0 : descriptionValue.trim());
|
|
245
248
|
}
|
|
246
249
|
finally {
|
|
247
|
-
yield
|
|
250
|
+
yield updateDiscussionStateComments(dispatchDiscussion, caseDispatch, caseDetails.caseNumber, allDiscussions, sort, caseFeedbacksHydra.data, discussionFiltersListState);
|
|
248
251
|
setIsUpdateClickedToShowError(false);
|
|
249
252
|
setDescriptionValue('');
|
|
250
253
|
}
|
|
@@ -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,KAA0C,MAAM,OAAO,CAAC;AAuB/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAMnE,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,gBAAgB;;;;;EAkR9D"}
|