@rh-support/troubleshoot 2.6.299 → 2.6.301
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/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +44 -23
- 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
|
@@ -7,11 +7,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import {
|
|
10
|
+
import { contacts } from '@cee-eng/hydrajs';
|
|
11
11
|
import { ValidatedOptions } from '@patternfly/react-core';
|
|
12
12
|
import { getPhoneObj, PhoneInput } from '@rh-support/components';
|
|
13
13
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
14
|
-
import { GET_ACCOUNT_CONTACTS } from '@rh-support/utils';
|
|
15
14
|
import isEmpty from 'lodash/isEmpty';
|
|
16
15
|
import isEqual from 'lodash/isEqual';
|
|
17
16
|
import isUndefined from 'lodash/isUndefined';
|
|
@@ -25,33 +24,13 @@ import { setCaseDetails, setCaseState } from '../../reducers/CaseReducer';
|
|
|
25
24
|
import { PDFContext } from '../CaseEditView/PDFContainer';
|
|
26
25
|
import { removeAllChars, trimAndReplacePlus } from '../shared/utils';
|
|
27
26
|
import { ContactPhoneNumberPopOver } from './ContactPhoneNumberPopOver';
|
|
28
|
-
function fetchContactBySSO(apolloClient, accountNumber, ssoUsername) {
|
|
29
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
31
|
-
const { data } = yield apolloClient.query({
|
|
32
|
-
query: GET_ACCOUNT_CONTACTS,
|
|
33
|
-
variables: {
|
|
34
|
-
accountNumber: { eq: accountNumber },
|
|
35
|
-
contactsWhere: { SSOUserName__c: { eq: ssoUsername } },
|
|
36
|
-
first: 1,
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
const response = data;
|
|
40
|
-
const contactNode = (_j = (_h = (_g = (_f = (_e = (_d = (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.salesforce_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.SalesforceSupportAccount) === null || _c === void 0 ? void 0 : _c.edges) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.node) === null || _f === void 0 ? void 0 : _f.Contacts) === null || _g === void 0 ? void 0 : _g.edges) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.node;
|
|
41
|
-
return {
|
|
42
|
-
phone: (_l = (_k = contactNode === null || contactNode === void 0 ? void 0 : contactNode.Phone) === null || _k === void 0 ? void 0 : _k.value) !== null && _l !== void 0 ? _l : '',
|
|
43
|
-
};
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
27
|
export function ContactPhoneNumber() {
|
|
47
|
-
const
|
|
48
|
-
const { suppliedPhoneNumberVerified, phoneCountryCode = '', phoneAreaCodePrefixLineNumber = '', hasLoggedInUserConfirmedPhoneNumber, contactSSOName, accountNumberRef, shouldNotSetPhoneCountryCode, isCasePhoneUpdating, } = useCaseSelector((state) => ({
|
|
28
|
+
const { suppliedPhoneNumberVerified, phoneCountryCode = '', phoneAreaCodePrefixLineNumber = '', hasLoggedInUserConfirmedPhoneNumber, contactSSOName, shouldNotSetPhoneCountryCode, isCasePhoneUpdating, } = useCaseSelector((state) => ({
|
|
49
29
|
suppliedPhoneNumberVerified: state.caseDetails.suppliedPhoneNumberVerified,
|
|
50
30
|
phoneCountryCode: state.caseDetails.phoneCountryCode,
|
|
51
31
|
phoneAreaCodePrefixLineNumber: state.caseDetails.phoneAreaCodePrefixLineNumber,
|
|
52
32
|
hasLoggedInUserConfirmedPhoneNumber: state.hasLoggedInUserConfirmedPhoneNumber,
|
|
53
33
|
contactSSOName: state.caseDetails.contactSSOName,
|
|
54
|
-
accountNumberRef: state.caseDetails.accountNumberRef,
|
|
55
34
|
shouldNotSetPhoneCountryCode: state.shouldNotSetPhoneCountryCode,
|
|
56
35
|
isCasePhoneUpdating: state.isCasePhoneUpdating,
|
|
57
36
|
}), isEqual);
|
|
@@ -177,25 +156,32 @@ export function ContactPhoneNumber() {
|
|
|
177
156
|
}
|
|
178
157
|
}
|
|
179
158
|
else {
|
|
180
|
-
// user is
|
|
159
|
+
// user is openning case for others (use is partner or red hatter)
|
|
181
160
|
try {
|
|
182
161
|
if (!contactSSOName)
|
|
183
162
|
return;
|
|
184
163
|
setIsFetchingSso(true);
|
|
185
|
-
const selectedContact = yield
|
|
164
|
+
const selectedContact = yield contacts.getSFDCContactBySso(contactSSOName);
|
|
186
165
|
setIsFetchingSso(false);
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
166
|
+
if (selectedContact.supportPhoneAreaCodePrefixLineNumber) {
|
|
167
|
+
_phoneAreaCodePrefixLineNumber = selectedContact.supportPhoneAreaCodePrefixLineNumber;
|
|
168
|
+
_phoneCountryCode = selectedContact.supportPhoneCountryCode;
|
|
169
|
+
_suppliedPhoneNumberVerified = 'Deferred';
|
|
191
170
|
}
|
|
192
171
|
else {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
172
|
+
const phoneLength = trimAndReplacePlus(removeAllChars(selectedContact.phone)).length;
|
|
173
|
+
if (phoneLength > 10) {
|
|
174
|
+
_phoneAreaCodePrefixLineNumber = getPhoneObj(selectedContact.phone).phoneLine || '';
|
|
175
|
+
_phoneCountryCode = getPhoneObj(selectedContact.phone).countryCode || '';
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
_phoneAreaCodePrefixLineNumber = selectedContact.phone;
|
|
179
|
+
_phoneCountryCode = '';
|
|
180
|
+
setCaseState(caseDispatch, { shouldNotSetPhoneCountryCode: true });
|
|
181
|
+
setPortalPhone(selectedContact.phone);
|
|
182
|
+
}
|
|
183
|
+
_suppliedPhoneNumberVerified = 'Deferred';
|
|
197
184
|
}
|
|
198
|
-
_suppliedPhoneNumberVerified = 'Deferred';
|
|
199
185
|
}
|
|
200
186
|
catch (e) {
|
|
201
187
|
_phoneAreaCodePrefixLineNumber = '';
|
|
@@ -227,11 +213,12 @@ export function ContactPhoneNumber() {
|
|
|
227
213
|
try {
|
|
228
214
|
if (!contactSSOName)
|
|
229
215
|
return;
|
|
230
|
-
const selectedContact = yield
|
|
231
|
-
if (
|
|
216
|
+
const selectedContact = yield contacts.getSFDCContactBySso(contactSSOName);
|
|
217
|
+
if (isEmpty(selectedContact.supportPhoneAreaCodePrefixLineNumber) &&
|
|
218
|
+
!isEmpty(selectedContact.phone)) {
|
|
232
219
|
portalPhone = selectedContact.phone;
|
|
233
220
|
phoneLength = trimAndReplacePlus(removeAllChars(portalPhone)).length;
|
|
234
|
-
supportPhone =
|
|
221
|
+
supportPhone = selectedContact.supportPhoneAreaCodePrefixLineNumber;
|
|
235
222
|
}
|
|
236
223
|
}
|
|
237
224
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SupportLevel.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/SupportLevel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SupportLevel.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/SupportLevel.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,KAA0C,MAAM,OAAO,CAAC;AAM/D,UAAU,MAAO,SAAQ,gBAAgB;CAAG;AAO5C,iBAAS,YAAY,CAAC,KAAK,EAAE,MAAM,qBAoJlC;kBApJQ,YAAY;;;AAsJrB,eAAe,YAAY,CAAC"}
|
|
@@ -1,82 +1,105 @@
|
|
|
1
1
|
import { Popover, PopoverPosition } from '@patternfly/react-core';
|
|
2
2
|
import QuestionCircleIcon from '@patternfly/react-icons/dist/js/icons/question-circle-icon';
|
|
3
3
|
import { SingleSelectDropdown } from '@rh-support/components';
|
|
4
|
+
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
4
5
|
import { PreviousCaseTypes, showFtsOnCaseViewEditPage, showFtsOnCreateCasePage } from '@rh-support/utils';
|
|
5
6
|
import isEmpty from 'lodash/isEmpty';
|
|
6
7
|
import isEqual from 'lodash/isEqual';
|
|
7
|
-
import React, { useEffect, useState } from 'react';
|
|
8
|
+
import React, { useContext, useEffect, useState } from 'react';
|
|
8
9
|
import { Trans, useTranslation } from 'react-i18next';
|
|
9
10
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
10
|
-
import { setCaseDetails
|
|
11
|
+
import { setCaseDetails } from '../../reducers/CaseReducer';
|
|
11
12
|
const defaultProps = {
|
|
12
13
|
id: '',
|
|
13
14
|
className: '',
|
|
14
15
|
};
|
|
15
16
|
function SupportLevel(props) {
|
|
16
|
-
const { caseNumber, severity, entitlementSla,
|
|
17
|
+
const { product, caseNumber, severity, entitlementSla, ownersEntitlements, caseType, openShiftClusterSupportLevel, } = useCaseSelector((state) => ({
|
|
18
|
+
product: state.caseDetails.product,
|
|
17
19
|
caseNumber: state.caseDetails.caseNumber,
|
|
18
20
|
severity: state.caseDetails.severity,
|
|
19
21
|
entitlementSla: state.caseDetails.entitlementSla,
|
|
22
|
+
ownersEntitlements: state.ownersEntitlements,
|
|
20
23
|
caseType: state.caseDetails.caseType,
|
|
21
|
-
|
|
22
|
-
otherServiceLevels: state.otherServiceLevels,
|
|
23
|
-
selectedEntitlementId: state.selectedEntitlementId,
|
|
24
|
+
openShiftClusterSupportLevel: state.openShiftClusterSupportLevel,
|
|
24
25
|
}), isEqual);
|
|
25
26
|
const caseDispatch = useCaseDispatch();
|
|
27
|
+
const { globalMetadataState: { allProducts }, } = useContext(GlobalMetadataStateContext);
|
|
26
28
|
const { t } = useTranslation();
|
|
27
29
|
const [isSupportLevelInValid, setIsSupportLevelInValid] = useState(false);
|
|
28
30
|
const isIdea = caseType === PreviousCaseTypes.FEATURE_ENHANCEMENT;
|
|
29
|
-
const allSlaOptions = [...(productServiceLevel ? [productServiceLevel] : []), ...(otherServiceLevels !== null && otherServiceLevels !== void 0 ? otherServiceLevels : [])].sort((a, b) => b.priority - a.priority);
|
|
30
|
-
const hasMultipleSlas = allSlaOptions.length > 1;
|
|
31
31
|
const onCaseDetailsChange = (caseDetails) => {
|
|
32
32
|
setCaseDetails(caseDispatch, caseDetails);
|
|
33
33
|
};
|
|
34
34
|
const onEntitlementChange = (selectedOption) => {
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const slaLabel = (matchedSla === null || matchedSla === void 0 ? void 0 : matchedSla.serviceLevelLabel) || '';
|
|
38
|
-
const casePayload = { entitlementSla: slaLabel };
|
|
35
|
+
const selected = selectedOption.value;
|
|
36
|
+
const casePayload = { entitlementSla: selected };
|
|
39
37
|
casePayload.fts = caseNumber
|
|
40
|
-
? showFtsOnCaseViewEditPage(
|
|
41
|
-
: showFtsOnCreateCasePage(
|
|
38
|
+
? showFtsOnCaseViewEditPage(selected, severity)
|
|
39
|
+
: showFtsOnCreateCasePage(selected, severity);
|
|
42
40
|
casePayload.fts = casePayload.fts && !isIdea;
|
|
43
|
-
setIsSupportLevelInValid(isEmpty(
|
|
41
|
+
setIsSupportLevelInValid(isEmpty(selected));
|
|
44
42
|
onCaseDetailsChange(casePayload);
|
|
45
|
-
setCaseState(caseDispatch, { selectedEntitlementId: entitlementId });
|
|
46
43
|
};
|
|
47
|
-
const
|
|
48
|
-
|
|
44
|
+
const getSlaList = () => {
|
|
45
|
+
var _a, _b;
|
|
46
|
+
if (openShiftClusterSupportLevel)
|
|
47
|
+
return [openShiftClusterSupportLevel];
|
|
48
|
+
const entitledProduct = ((_b = (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult) !== null && _b !== void 0 ? _b : []).find((entitledProduct) => entitledProduct.product === product);
|
|
49
|
+
if (entitledProduct && entitledProduct.serviceLevels) {
|
|
50
|
+
return entitledProduct.serviceLevels.split(';') || [];
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
return ownersEntitlements.data ? ownersEntitlements.data.map((sla) => sla.slaProcessId) : [];
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const getSelectedSla = () => {
|
|
57
|
+
var _a, _b;
|
|
58
|
+
if (openShiftClusterSupportLevel)
|
|
59
|
+
return openShiftClusterSupportLevel;
|
|
60
|
+
const entitledProduct = ((_b = (_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult) !== null && _b !== void 0 ? _b : []).find((entitledProduct) => entitledProduct.product === product);
|
|
61
|
+
// if sla is empty then it means either first time this component is rendered or product has changed.
|
|
62
|
+
if (isEmpty(entitlementSla) && entitledProduct && entitledProduct.preferredServiceLevel) {
|
|
63
|
+
return entitledProduct.preferredServiceLevel;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
return isEmpty(entitlementSla) && !isEmpty(ownersEntitlements.data)
|
|
67
|
+
? ownersEntitlements.data[0].slaProcessId
|
|
68
|
+
: entitlementSla;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
const selectedSla = getSelectedSla();
|
|
49
72
|
useEffect(() => {
|
|
50
|
-
if (!
|
|
73
|
+
if (!selectedSla || entitlementSla)
|
|
51
74
|
return;
|
|
52
|
-
if (entitlementSla !==
|
|
53
|
-
onCaseDetailsChange({ entitlementSla:
|
|
54
|
-
setCaseState(caseDispatch, { selectedEntitlementId: productServiceLevel.entitlementId });
|
|
75
|
+
if (entitlementSla !== selectedSla) {
|
|
76
|
+
onCaseDetailsChange({ entitlementSla: selectedSla });
|
|
55
77
|
}
|
|
56
78
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
57
|
-
}, [
|
|
79
|
+
}, [selectedSla, entitlementSla]);
|
|
80
|
+
// Create selected option for SingleSelectDropdown
|
|
58
81
|
const getSelectedOption = () => ({
|
|
59
|
-
label: selectedSla,
|
|
60
|
-
value:
|
|
82
|
+
label: selectedSla || '',
|
|
83
|
+
value: selectedSla || '',
|
|
61
84
|
});
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
85
|
+
// Create options array for SingleSelectDropdown
|
|
86
|
+
const getDropdownOptions = () => getSlaList().map((sla) => ({
|
|
87
|
+
label: sla,
|
|
88
|
+
value: sla,
|
|
65
89
|
}));
|
|
66
|
-
if (!hasMultipleSlas)
|
|
67
|
-
return null;
|
|
68
90
|
return (React.createElement("div", { className: `form-group ${props.className}`, id: `${props.id}` },
|
|
69
91
|
React.createElement("label", { htmlFor: "get-support-supportLevel" },
|
|
70
92
|
React.createElement(Trans, null, "Support level"),
|
|
71
93
|
' ',
|
|
72
|
-
React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
|
|
94
|
+
!isEmpty(ownersEntitlements.data) && (React.createElement("span", { className: "form-required", "aria-hidden": true }, "*"))),
|
|
73
95
|
React.createElement(Popover, { "aria-label": "Support Level info", position: PopoverPosition.top, bodyContent: React.createElement("p", null,
|
|
74
96
|
React.createElement(Trans, { i18nKey: "i18ProductionSupportServiceLevelAgreement" },
|
|
75
97
|
"Learn more about our",
|
|
76
98
|
' ',
|
|
77
99
|
React.createElement("a", { href: "/support/offerings/production/sla", target: "_blank" }, "production support service level agreement"))), closeBtnAriaLabel: "Close" },
|
|
78
100
|
React.createElement(QuestionCircleIcon, { color: "#5e40be", className: "pf-v6-u-ml-xs icon-size cursor-pointer", "aria-label": "Support Level Info" })),
|
|
79
|
-
React.createElement(SingleSelectDropdown, { ariaLabel: t('Select Support Level'), onSelect: onEntitlementChange, selected: getSelectedOption(), options: getDropdownOptions(), isInvalid: isSupportLevelInValid, dataTrackingId: "get-support-supportLevel", placeholder: t('Select Support Level') })
|
|
101
|
+
React.createElement(SingleSelectDropdown, { ariaLabel: t('Select Support Level'), onSelect: onEntitlementChange, selected: getSelectedOption(), options: getDropdownOptions(), isDisabled: ownersEntitlements.isError || isEmpty(ownersEntitlements.data), isInvalid: isSupportLevelInValid, dataTrackingId: "get-support-supportLevel", placeholder: t('Select Support Level') }),
|
|
102
|
+
isEmpty(ownersEntitlements.data) && (React.createElement("p", { className: "form-instructions" }, ownersEntitlements.isError ? t('Error loading support levels') : t('No active subscriptions')))));
|
|
80
103
|
}
|
|
81
104
|
SupportLevel.defaultProps = defaultProps;
|
|
82
105
|
export default SupportLevel;
|
|
@@ -53,11 +53,11 @@ export default function CaseLanguageSelector(props) {
|
|
|
53
53
|
props.isManageStep,
|
|
54
54
|
]);
|
|
55
55
|
const getLanguageDropdownOptions = map(caseLanguages.data, (language) => ({
|
|
56
|
-
label: Constants.languagesMap[language]
|
|
56
|
+
label: Constants.languagesMap[language],
|
|
57
57
|
value: language,
|
|
58
58
|
}));
|
|
59
59
|
const getSelectedLanguageOption = {
|
|
60
|
-
label: caseLanguage ? Constants.languagesMap[caseLanguage]
|
|
60
|
+
label: caseLanguage ? Constants.languagesMap[caseLanguage] : '',
|
|
61
61
|
value: caseLanguage || '',
|
|
62
62
|
};
|
|
63
63
|
return (React.createElement("div", { className: "form-group" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseManagement.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/CaseManagement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAgB1B,MAAM,WAAW,MAAM;CAAG;AAC1B,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"CaseManagement.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/CaseManagement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAgB1B,MAAM,WAAW,MAAM;CAAG;AAC1B,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,EAAE,MAAM,qBAiCnD"}
|
|
@@ -2,16 +2,17 @@ import { Grid, GridItem } from '@patternfly/react-core';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { useCaseDispatch } from '../../context/CaseContext';
|
|
4
4
|
import { setCaseDetails } from '../../reducers/CaseReducer';
|
|
5
|
-
|
|
5
|
+
import CaseGroup from '../CaseInformation/CaseGroup';
|
|
6
6
|
import { ContactPhoneNumber } from '../CaseInformation/ContactPhoneNumber';
|
|
7
7
|
import { ContactPhoneNumberAlert } from '../CaseInformation/ContactPhoneNumberAlert';
|
|
8
8
|
import Fts from '../CaseInformation/Fts';
|
|
9
9
|
import Severity from '../CaseInformation/Severity';
|
|
10
10
|
import SupportLevel from '../CaseInformation/SupportLevel';
|
|
11
11
|
import CaseLanguageSelector from './CaseLanguageSelector';
|
|
12
|
-
|
|
12
|
+
import { Cep } from './Cep';
|
|
13
13
|
import OpenReferenceNumber from './OpenReferenceNumber';
|
|
14
14
|
import { RHAssociatesSelector } from './RHAssociatesSelector';
|
|
15
|
+
import CaseContactSelector from './SendNotifications/CaseContactSelector';
|
|
15
16
|
export default function CaseManagement(props) {
|
|
16
17
|
const caseDispatch = useCaseDispatch();
|
|
17
18
|
const onSeverityChange = (payload) => {
|
|
@@ -28,7 +29,11 @@ export default function CaseManagement(props) {
|
|
|
28
29
|
React.createElement(Fts, { inlineEditable: false }),
|
|
29
30
|
React.createElement(Grid, { hasGutter: true },
|
|
30
31
|
React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
|
|
31
|
-
React.createElement(CaseLanguageSelector, { isManageStep: true }))
|
|
32
|
+
React.createElement(CaseLanguageSelector, { isManageStep: true })),
|
|
33
|
+
React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
|
|
34
|
+
React.createElement(CaseGroup, { init: true }))),
|
|
35
|
+
React.createElement(CaseContactSelector, null),
|
|
32
36
|
React.createElement(RHAssociatesSelector, null),
|
|
33
|
-
React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true })
|
|
37
|
+
React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true }),
|
|
38
|
+
React.createElement(Cep, null)));
|
|
34
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cep.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/Cep.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Cep.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/Cep.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAoB/D,UAAU,MAAM;CAAG;AAEnB,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,qBA8ThC"}
|
|
@@ -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 { Button, Checkbox, Form, FormGroup, FormHelperText, HelperText, HelperTextItem, Modal, ModalBody, ModalFooter, ModalHeader, ModalVariant, Popover, PopoverPosition, TextArea, TextInput, ValidatedOptions, } from '@patternfly/react-core';
|
|
12
11
|
import QuestionCircleIcon from '@patternfly/react-icons/dist/js/icons/question-circle-icon';
|
|
13
12
|
import { LoadingIndicator, ToastNotification, useConfirmation } from '@rh-support/components';
|
|
@@ -18,8 +17,10 @@ import isEqual from 'lodash/isEqual';
|
|
|
18
17
|
import React, { useContext, useEffect, useState } from 'react';
|
|
19
18
|
import { Trans, useTranslation } from 'react-i18next';
|
|
20
19
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
21
|
-
import {
|
|
20
|
+
import { useCaseDetailsPageStateContext } from '../../context/CaseDetailsPageContext';
|
|
21
|
+
import { useCaseDiscussionTabDispatchContext, useCaseDiscussionTabStateContext, } from '../../context/CaseDiscussionTabContext';
|
|
22
22
|
import { useCaseUpdateErrorMessage } from '../../hooks/useCaseUpdateErrorMessage';
|
|
23
|
+
import { updateDiscussionStateComments } from '../../reducers/CaseDiscussionTabReducer';
|
|
23
24
|
import { checkForCaseStatusToggleOnAttachOrComment, postCepDetails, setCaseDetails, setCaseState, updateCaseDetails, } from '../../reducers/CaseReducer';
|
|
24
25
|
import { PDFContext } from '../CaseEditView/PDFContainer';
|
|
25
26
|
export function Cep(props) {
|
|
@@ -41,7 +42,9 @@ export function Cep(props) {
|
|
|
41
42
|
const ability = useContext(AbilityContext);
|
|
42
43
|
const canUseCep = ability.can(resourceActions.PATCH, resources.CASE_CREATE, CaseListFields.CEP);
|
|
43
44
|
const confirm = useConfirmation();
|
|
44
|
-
const
|
|
45
|
+
const dispatchDiscussion = useCaseDiscussionTabDispatchContext();
|
|
46
|
+
const { sort, allDiscussions, discussionFiltersListState } = useCaseDiscussionTabStateContext();
|
|
47
|
+
const { caseDetailsPageState: { caseFeedbacksHydra }, } = useCaseDetailsPageStateContext();
|
|
45
48
|
const canEditCase = useCanEditCase();
|
|
46
49
|
const [saveButtonIsClicked, setSaveButtonIsClicked] = useState(false);
|
|
47
50
|
const { isExportingPDF } = useContext(PDFContext);
|
|
@@ -89,7 +92,7 @@ export function Cep(props) {
|
|
|
89
92
|
checkForCaseStatusToggleOnAttachOrComment(caseDispatch, loggedInUserRights.data.isInternal(), status);
|
|
90
93
|
if (caseDetails.cep) {
|
|
91
94
|
yield postCepDetails(caseDispatch, caseNumber, cepDetailsLocal);
|
|
92
|
-
|
|
95
|
+
updateDiscussionStateComments(dispatchDiscussion, caseDispatch, caseNumber, allDiscussions, sort, caseFeedbacksHydra.data, discussionFiltersListState);
|
|
93
96
|
}
|
|
94
97
|
ToastNotification.addSuccessMessage(t(`Consultant Engagement in Progress has been updated successfully`));
|
|
95
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenshiftDropdownV4.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenshiftDropdownV4.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAgB5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,KAA2D,MAAM,OAAO,CAAC;AAOhF,UAAU,MAAO,SAAQ,gBAAgB;IACrC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzF,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iCAAiC,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAChD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uBAAuB,CAAC,EAAE,CAAC,GAAG,KAAA,KAAK,IAAI,CAAC;CAC3C;AAsBD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"OpenshiftDropdownV4.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenshiftDropdownV4.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAgB5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,KAA2D,MAAM,OAAO,CAAC;AAOhF,UAAU,MAAO,SAAQ,gBAAgB;IACrC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACzF,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iCAAiC,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAChD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uBAAuB,CAAC,EAAE,CAAC,GAAG,KAAA,KAAK,IAAI,CAAC;CAC3C;AAsBD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,qBAsfzC;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -36,11 +36,17 @@ const createState = (external_cluster_id, display_name, openshift_version, suppo
|
|
|
36
36
|
function OpenshiftDropdownV4(props) {
|
|
37
37
|
const { t } = useTranslation();
|
|
38
38
|
const PER_PAGE = 200;
|
|
39
|
+
const LOAD_MORE_VALUE = 'loader';
|
|
39
40
|
const [clustersRawResponse, setClustersRawResponse] = useState([]);
|
|
41
|
+
const clustersRawResponseRef = useRef(clustersRawResponse);
|
|
42
|
+
clustersRawResponseRef.current = clustersRawResponse;
|
|
40
43
|
const abortControllerRef = useRef();
|
|
44
|
+
const loadMoreInProgressRef = useRef(false);
|
|
41
45
|
const [clustersSelectOptions, setClustersSelectOptions] = useState([]);
|
|
42
46
|
const [isOpen, setIsOpen] = useState(false);
|
|
43
47
|
const [inputVal, setInputVal] = useState(props.openshiftDisplayName);
|
|
48
|
+
const inputValRef = useRef(inputVal);
|
|
49
|
+
inputValRef.current = inputVal;
|
|
44
50
|
const [showArchivedClusters, setShowArchivedClusters] = useState(false);
|
|
45
51
|
const [isFetchingClusters, setIsFetchingClusters] = useState(false);
|
|
46
52
|
const [totalResultsNo, setTotalResultsNo] = useState(0);
|
|
@@ -67,31 +73,41 @@ function OpenshiftDropdownV4(props) {
|
|
|
67
73
|
const fetchedClusters = yield fetchAccountClusters();
|
|
68
74
|
setClustersRawResponse(fetchedClusters.items);
|
|
69
75
|
setTotalResultsNo(fetchedClusters.total);
|
|
70
|
-
setClustersSelectOptions(getClusterOptions(fetchedClusters.items));
|
|
76
|
+
setClustersSelectOptions(getClusterOptions(fetchedClusters.items, fetchedClusters.total));
|
|
71
77
|
});
|
|
72
78
|
const onToggle = () => setIsOpen(!isOpen);
|
|
73
|
-
const onViewMoreClick = () => __awaiter(this, void 0, void 0, function* () {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
79
|
+
const onViewMoreClick = (event) => __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
var _a;
|
|
81
|
+
(_a = event === null || event === void 0 ? void 0 : event.stopPropagation) === null || _a === void 0 ? void 0 : _a.call(event);
|
|
82
|
+
if (loadMoreInProgressRef.current)
|
|
83
|
+
return;
|
|
84
|
+
loadMoreInProgressRef.current = true;
|
|
85
|
+
try {
|
|
86
|
+
const currentClusters = clustersRawResponseRef.current;
|
|
87
|
+
const page = Math.floor(currentClusters.length / PER_PAGE) + 1;
|
|
88
|
+
const fetchedClusters = yield fetchAccountClusters(inputValRef.current, page);
|
|
89
|
+
const clusterResponse = [...clustersRawResponseRef.current, ...((fetchedClusters === null || fetchedClusters === void 0 ? void 0 : fetchedClusters.items) || [])];
|
|
90
|
+
setClustersRawResponse(clusterResponse);
|
|
91
|
+
setTotalResultsNo(fetchedClusters.total);
|
|
92
|
+
setClustersSelectOptions(getClusterOptions(clusterResponse, fetchedClusters.total));
|
|
93
|
+
setIsOpen(true);
|
|
94
|
+
}
|
|
95
|
+
finally {
|
|
96
|
+
loadMoreInProgressRef.current = false;
|
|
97
|
+
}
|
|
86
98
|
});
|
|
87
99
|
const onSelect = (event, selectedCluster) => __awaiter(this, void 0, void 0, function* () {
|
|
88
|
-
if (selectedCluster
|
|
100
|
+
if (selectedCluster === LOAD_MORE_VALUE) {
|
|
101
|
+
onViewMoreClick(event);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if ((selectedCluster === null || selectedCluster === void 0 ? void 0 : selectedCluster.type) === 'checkbox') {
|
|
89
105
|
setShowArchivedClusters(!showArchivedClusters);
|
|
90
106
|
props.onClusterClear();
|
|
91
107
|
setClustersRawResponse([]);
|
|
92
108
|
setInputVal('');
|
|
93
109
|
}
|
|
94
|
-
else
|
|
110
|
+
else {
|
|
95
111
|
props.onClusterIdStateUpdate(selectedCluster);
|
|
96
112
|
const displayName = selectedCluster.display_name || selectedCluster.toString();
|
|
97
113
|
setInputVal(displayName);
|
|
@@ -139,7 +155,7 @@ function OpenshiftDropdownV4(props) {
|
|
|
139
155
|
],
|
|
140
156
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
141
157
|
[showArchivedClusters, focusedItemIndex]);
|
|
142
|
-
const getClusterOptions = (clusters) => {
|
|
158
|
+
const getClusterOptions = (clusters, total = totalResultsNo) => {
|
|
143
159
|
const clustersResponseGrouped = groupBy(clusters, 'console_url') || [];
|
|
144
160
|
const domainNames = Object.keys(clustersResponseGrouped) || [];
|
|
145
161
|
// move clusters with empty console_urls to the end of domains array
|
|
@@ -161,11 +177,11 @@ function OpenshiftDropdownV4(props) {
|
|
|
161
177
|
clusterOptions.push(React.createElement(Divider, { component: "div", key: index + domain }));
|
|
162
178
|
});
|
|
163
179
|
if (isFetchingClusters) {
|
|
164
|
-
clusterOptions.push(React.createElement(SelectOption, { isLoading: true, disabled: true },
|
|
180
|
+
clusterOptions.push(React.createElement(SelectOption, { isLoading: true, disabled: true, key: "clusters-loading" },
|
|
165
181
|
React.createElement(Spinner, { size: "lg" })));
|
|
166
182
|
}
|
|
167
|
-
else if (!isFetchingClusters &&
|
|
168
|
-
clusterOptions.push(React.createElement(SelectOption, { isLoadButton: true, onClick: onViewMoreClick, value:
|
|
183
|
+
else if (!isFetchingClusters && clusters.length < total) {
|
|
184
|
+
clusterOptions.push(React.createElement(SelectOption, { isLoadButton: true, key: "display-additional-results", onClick: onViewMoreClick, value: LOAD_MORE_VALUE }, "Display additional results"));
|
|
169
185
|
}
|
|
170
186
|
return [
|
|
171
187
|
...dropdownHeaderOptions,
|
|
@@ -297,7 +313,7 @@ function OpenshiftDropdownV4(props) {
|
|
|
297
313
|
if (!isUnmounted) {
|
|
298
314
|
setClustersRawResponse(fetchedClusters.items);
|
|
299
315
|
setTotalResultsNo(fetchedClusters.total);
|
|
300
|
-
setClustersSelectOptions(getClusterOptions(fetchedClusters.items) || []);
|
|
316
|
+
setClustersSelectOptions(getClusterOptions(fetchedClusters.items, fetchedClusters.total) || []);
|
|
301
317
|
}
|
|
302
318
|
});
|
|
303
319
|
fetchClusters();
|
|
@@ -315,7 +331,7 @@ function OpenshiftDropdownV4(props) {
|
|
|
315
331
|
const fetchedClusters = yield fetchAccountClusters(value);
|
|
316
332
|
setClustersRawResponse(fetchedClusters.items);
|
|
317
333
|
setTotalResultsNo(fetchedClusters.total);
|
|
318
|
-
setClustersSelectOptions(getClusterOptions(fetchedClusters.items));
|
|
334
|
+
setClustersSelectOptions(getClusterOptions(fetchedClusters.items, fetchedClusters.total));
|
|
319
335
|
}), 500);
|
|
320
336
|
const getSelectedItem = () => {
|
|
321
337
|
if (!isEmpty(inputVal)) {
|
|
@@ -339,7 +355,12 @@ function OpenshiftDropdownV4(props) {
|
|
|
339
355
|
React.createElement("span", { className: `form-required ${isExportingPDF ? 'hide-in-pdf' : ''}`, "aria-hidden": true }, "*"),
|
|
340
356
|
!isExportingPDF ? React.createElement(CaseOpenShiftPopover, null) : ''),
|
|
341
357
|
React.createElement("span", { id: titleId, hidden: true }, "Select a state"),
|
|
342
|
-
React.createElement(Select, { id: "openshift-cluster-selector", isOpen: isOpen, selected: getSelectedItem(), onSelect: onSelect, onOpenChange: (
|
|
358
|
+
React.createElement(Select, { id: "openshift-cluster-selector", isOpen: isOpen, selected: getSelectedItem(), onSelect: onSelect, onOpenChange: (nextOpen) => {
|
|
359
|
+
if (!nextOpen && loadMoreInProgressRef.current) {
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
362
|
+
setIsOpen(nextOpen);
|
|
363
|
+
}, toggle: toggle, shouldFocusFirstItemOnOpen: true, isScrollable: true, "aria-invalid": props.isClusterIdInvalid, "aria-describedby": "clusterID-validate-helper", "data-tracking-id": "openshift-cluster-id", className: "openshift-cluster-id" },
|
|
343
364
|
React.createElement(SelectList, { id: "openshift-cluster-selector-listbox" }, clustersSelectOptions)),
|
|
344
365
|
React.createElement("div", { id: "clusterID-validate-helper", className: `form-instructions ${props.isClusterIdInvalid ? 'form-invalid' : ''}` }, props.clusterIdDropdownFormInstructions))));
|
|
345
366
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdeaInformation.d.ts","sourceRoot":"","sources":["../../../../src/components/IdeaInformation/IdeaInformation.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IdeaInformation.d.ts","sourceRoot":"","sources":["../../../../src/components/IdeaInformation/IdeaInformation.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAiBrD,MAAM,CAAC,OAAO,UAAU,eAAe,sBA8ItC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useApolloClient } from '@apollo/client/react';
|
|
2
1
|
import { Grid, GridItem } from '@patternfly/react-core';
|
|
3
2
|
import { AlertMessage, AlertType, LoadingIndicator } from '@rh-support/components';
|
|
4
3
|
import { fetchCaseSeverities, fetchCaseTypes, fetchLanguageMetadata, GlobalMetadataDispatchContext, GlobalMetadataStateContext, } from '@rh-support/react-context';
|
|
@@ -9,22 +8,21 @@ import React, { useContext, useEffect } from 'react';
|
|
|
9
8
|
import { Trans, useTranslation } from 'react-i18next';
|
|
10
9
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
11
10
|
import { setCaseDetails } from '../../reducers/CaseReducer';
|
|
12
|
-
|
|
11
|
+
import CaseGroup from '../CaseInformation/CaseGroup';
|
|
13
12
|
import { ContactPhoneNumber } from '../CaseInformation/ContactPhoneNumber';
|
|
14
13
|
import { ContactPhoneNumberAlert } from '../CaseInformation/ContactPhoneNumberAlert';
|
|
15
14
|
import Severity from '../CaseInformation/Severity';
|
|
16
15
|
import SupportLevel from '../CaseInformation/SupportLevel';
|
|
17
16
|
import CaseLanguageSelector from '../CaseManagement/CaseLanguageSelector';
|
|
18
|
-
|
|
17
|
+
import { Cep } from '../CaseManagement/Cep';
|
|
19
18
|
import OpenReferenceNumber from '../CaseManagement/OpenReferenceNumber';
|
|
20
19
|
import { RHAssociatesSelector } from '../CaseManagement/RHAssociatesSelector';
|
|
21
|
-
|
|
20
|
+
import CaseContactSelector from '../CaseManagement/SendNotifications/CaseContactSelector';
|
|
22
21
|
import KtQuestions from '../ImproveCase/KtQuestions';
|
|
23
22
|
export default function IdeaInformation() {
|
|
24
23
|
const { t } = useTranslation();
|
|
25
24
|
const { globalMetadataState: { allCaseTypes, allCaseSeverities, caseLanguages, loggedInUser, loggedInUserJwtToken, loggedInUsersAccount, loggedInUserRights, }, } = useContext(GlobalMetadataStateContext);
|
|
26
25
|
const dispatchToGlobalMetadataReducer = useContext(GlobalMetadataDispatchContext);
|
|
27
|
-
const apolloClient = useApolloClient();
|
|
28
26
|
const { contactSSOName, selectedAccountDetails, ownersCaseGroups, hasInvalidEntitlements } = useCaseSelector((state) => ({
|
|
29
27
|
contactSSOName: state.caseDetails.contactSSOName,
|
|
30
28
|
ownersCaseGroups: state.ownersCaseGroups,
|
|
@@ -50,13 +48,13 @@ export default function IdeaInformation() {
|
|
|
50
48
|
}
|
|
51
49
|
const allPromisses = [];
|
|
52
50
|
if (haventLoadedMetadata(allCaseTypes)) {
|
|
53
|
-
allPromisses.push(fetchCaseTypes(dispatchToGlobalMetadataReducer,
|
|
51
|
+
allPromisses.push(fetchCaseTypes(dispatchToGlobalMetadataReducer, loggedInUsersAccount.data.secureSupport));
|
|
54
52
|
}
|
|
55
53
|
if (haventLoadedMetadata(allCaseSeverities)) {
|
|
56
|
-
allPromisses.push(fetchCaseSeverities(dispatchToGlobalMetadataReducer,
|
|
54
|
+
allPromisses.push(fetchCaseSeverities(dispatchToGlobalMetadataReducer, loggedInUsersAccount.data.secureSupport));
|
|
57
55
|
}
|
|
58
56
|
if (haventLoadedMetadata(caseLanguages)) {
|
|
59
|
-
allPromisses.push(fetchLanguageMetadata(dispatchToGlobalMetadataReducer
|
|
57
|
+
allPromisses.push(fetchLanguageMetadata(dispatchToGlobalMetadataReducer));
|
|
60
58
|
}
|
|
61
59
|
Promise.all(allPromisses);
|
|
62
60
|
}, [
|
|
@@ -68,7 +66,6 @@ export default function IdeaInformation() {
|
|
|
68
66
|
loggedInUserJwtToken,
|
|
69
67
|
selectedAccountDetails,
|
|
70
68
|
loggedInUsersAccount.data.secureSupport,
|
|
71
|
-
apolloClient,
|
|
72
69
|
]);
|
|
73
70
|
const onSeverityChange = (payload) => {
|
|
74
71
|
setCaseDetails(caseDispatch, payload);
|
|
@@ -103,7 +100,11 @@ export default function IdeaInformation() {
|
|
|
103
100
|
React.createElement(ContactPhoneNumberAlert, null),
|
|
104
101
|
React.createElement(Grid, { hasGutter: true },
|
|
105
102
|
React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
|
|
106
|
-
React.createElement(CaseLanguageSelector, { isManageStep: true }))
|
|
103
|
+
React.createElement(CaseLanguageSelector, { isManageStep: true })),
|
|
104
|
+
React.createElement(GridItem, { span: 12, xl2: 6, className: "pf-v6-u-mb-xs" },
|
|
105
|
+
React.createElement(CaseGroup, { init: true }))),
|
|
106
|
+
React.createElement(CaseContactSelector, null),
|
|
107
107
|
React.createElement(RHAssociatesSelector, null),
|
|
108
|
-
React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true })
|
|
108
|
+
React.createElement(OpenReferenceNumber, { inlineEditable: false, hideSaveCancel: true }),
|
|
109
|
+
React.createElement(Cep, null))))));
|
|
109
110
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SupportTypeSelectorPage.d.ts","sourceRoot":"","sources":["../../../../src/components/OpenCase/SupportTypeSelectorPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SupportTypeSelectorPage.d.ts","sourceRoot":"","sources":["../../../../src/components/OpenCase/SupportTypeSelectorPage.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAiB/D,MAAM,CAAC,OAAO,UAAU,uBAAuB,sBAiM9C"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { useApolloClient } from '@apollo/client/react';
|
|
2
1
|
import { Bullseye, Card, CardBody, Gallery, GalleryItem, Split, SplitItem } from '@patternfly/react-core';
|
|
3
2
|
import { LoadingIndicator } from '@rh-support/components';
|
|
4
3
|
import { fetchCaseTypes, useGlobalDispatchContext, useGlobalStateContext } from '@rh-support/react-context';
|
|
@@ -12,9 +11,8 @@ import { getUpdatedDescription } from '../../reducers/CaseHelpers';
|
|
|
12
11
|
import { setCaseDetails } from '../../reducers/CaseReducer';
|
|
13
12
|
import { BugIcon, CertificationIcon, CustomerServiceIcon, DocumentationIcon, GearIcon, IdeaIcon, RcaIcon, } from './SupportTypeIcons';
|
|
14
13
|
export default function SupportTypeSelectorPage() {
|
|
15
|
-
const { globalMetadataState: { allCaseTypes }, } = useGlobalStateContext();
|
|
14
|
+
const { globalMetadataState: { allCaseTypes, loggedInUsersAccount }, } = useGlobalStateContext();
|
|
16
15
|
const globalDispatch = useGlobalDispatchContext();
|
|
17
|
-
const apolloClient = useApolloClient();
|
|
18
16
|
const [selectedSupportType, setSelectedSupportType] = useState('');
|
|
19
17
|
const { routeState: { isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
|
|
20
18
|
const { caseType, isFetchingSelectedAccountDetails, issue, timeFramesAndUrgency, v3ClusterName } = useCaseSelector((state) => ({
|
|
@@ -29,7 +27,7 @@ export default function SupportTypeSelectorPage() {
|
|
|
29
27
|
useEffect(() => {
|
|
30
28
|
if (haventLoadedMetadata(allCaseTypes)) {
|
|
31
29
|
// Load support types.
|
|
32
|
-
fetchCaseTypes(globalDispatch,
|
|
30
|
+
fetchCaseTypes(globalDispatch, loggedInUsersAccount.data.secureSupport);
|
|
33
31
|
}
|
|
34
32
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
35
33
|
}, []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AllProductsSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/AllProductsSelector.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AllProductsSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/AllProductsSelector.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAsD,MAAM,OAAO,CAAC;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,EAAuC,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAMvG,UAAU,MAAM;IACZ,qBAAqB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;IACjD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAClC;AAQD;;;;;;;GAOG;AACH,QAAA,MAAM,mBAAmB,4EAuKvB,CAAC;AAGH,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|