@rh-support/troubleshoot 2.6.357 → 2.6.358
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/OwnerSelector.js +4 -4
- package/lib/esm/components/CaseEditView/CaseDetailsErrorMessage.js +2 -2
- package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.js +7 -6
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.js +41 -8
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +10 -10
- package/lib/esm/components/CaseInformation/CaseLabels.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/CaseLabels.js +15 -12
- package/lib/esm/components/CaseInformation/Severity.d.ts.map +1 -1
- package/lib/esm/components/CaseInformation/Severity.js +16 -15
- package/lib/esm/components/CaseManagement/CaseLabelsCreate.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/CaseLabelsCreate.js +52 -21
- package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.js +1 -3
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +1 -1
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts +0 -1
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +6 -12
- package/lib/esm/components/IdeaInformation/IdeaInformation.d.ts.map +1 -1
- package/lib/esm/components/IdeaInformation/IdeaInformation.js +11 -3
- package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.d.ts.map +1 -1
- package/lib/esm/components/UpdateSeverityModal/UpdateSeverityModal.js +50 -44
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts +1 -0
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/reducer/AttachmentHelper.js +126 -54
- package/lib/esm/components/shared/fileUpload/useFileUploader.d.ts.map +1 -1
- package/lib/esm/components/shared/fileUpload/useFileUploader.js +6 -3
- package/lib/esm/components/wizardLayout/MainSection.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/MainSection.js +2 -1
- package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts +2 -0
- package/lib/esm/hooks/useCaseLabelLinkMutations.d.ts.map +1 -1
- package/lib/esm/hooks/useCaseLabelLinkMutations.js +21 -28
- package/lib/esm/reducers/CaseHelpers.d.ts.map +1 -1
- package/lib/esm/reducers/CaseHelpers.js +5 -3
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +6 -2
- package/package.json +6 -6
|
@@ -34,7 +34,7 @@ function getOwnerDropdownOptions(contacts) {
|
|
|
34
34
|
function OwnerSelector(props) {
|
|
35
35
|
const { t } = useTranslation();
|
|
36
36
|
const caseUpdateError = useCaseUpdateErrorMessage();
|
|
37
|
-
const { accountNumber, caseNumber, contactSsoUsername, existingCaseDetails, selectedNotificationContacts, selectedOwner, selectedCaseGroupUsers, selectedAccountDetails, isCaseOwnerUpdating, isCasePhoneUpdating,
|
|
37
|
+
const { accountNumber, caseNumber, contactSsoUsername, existingCaseDetails, selectedNotificationContacts, selectedOwner, selectedCaseGroupUsers, selectedAccountDetails, isCaseOwnerUpdating, isCasePhoneUpdating, } = useCaseSelector((state) => ({
|
|
38
38
|
accountNumber: state.caseDetails.accountNumberRef,
|
|
39
39
|
caseNumber: state.caseDetails.caseNumber,
|
|
40
40
|
existingCaseDetails: state.caseDetails,
|
|
@@ -45,7 +45,6 @@ function OwnerSelector(props) {
|
|
|
45
45
|
isCaseOwnerUpdating: state.isCaseOwnerUpdating,
|
|
46
46
|
isCasePhoneUpdating: state.isCasePhoneUpdating,
|
|
47
47
|
contactSsoUsername: state.caseDetails.contactSSOName,
|
|
48
|
-
groupNumber: state.caseDetails.groupNumber,
|
|
49
48
|
}), isEqual);
|
|
50
49
|
const { routeState: { isNextBtnClickedToShowValidationError }, } = useContext(RouteContext);
|
|
51
50
|
const caseDispatch = useCaseDispatch();
|
|
@@ -281,9 +280,10 @@ function OwnerSelector(props) {
|
|
|
281
280
|
setCaseState(caseDispatch, {
|
|
282
281
|
selectedOwner: { data: contact, isFetching: false, isError: false, errorMessage: '' },
|
|
283
282
|
});
|
|
284
|
-
if (contact.id
|
|
285
|
-
|
|
283
|
+
if (!contact.id || !accountNumber || caseNumber) {
|
|
284
|
+
return;
|
|
286
285
|
}
|
|
286
|
+
fetchCaseGroupsForContactGraphQL(caseDispatch, apolloClient, contact.id, accountNumber, (_a = contact.defaultCaseGroup) !== null && _a !== void 0 ? _a : null, (_b = contact.isOrgAdmin) !== null && _b !== void 0 ? _b : false, null);
|
|
287
287
|
}, placeholder: t(`Search by name or username`), clearButton: true, id: "get-support-owner", name: "get-support-owner", className: "react-select-custom", isUpdating: isCaseOwnerUpdating, isInvalid: isNextBtnClickedToShowValidationError && isEmpty(selectedOwner.data), isDisabled: isCasePhoneUpdating || isCaseOwnerUpdating || canEditCase.isCaseNotEditable }))));
|
|
288
288
|
}
|
|
289
289
|
export { OwnerSelector };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AlertMessage, AlertType, errorMessageTitle, formattedApiErrorMessage } from '@rh-support/components';
|
|
2
2
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
3
|
-
import { CSS_ACCESS_RESTRICTION_ERROR_DETAIL,
|
|
3
|
+
import { CSS_ACCESS_RESTRICTION_ERROR_DETAIL, getCssPortalUrl, getSFDCSecureSupportCaseLink } from '@rh-support/utils';
|
|
4
4
|
import React, { useContext } from 'react';
|
|
5
5
|
import { Trans, useTranslation } from 'react-i18next';
|
|
6
6
|
// Here we need to use 'detailMessage' from case API if user is not authorized to see case detail
|
|
@@ -29,7 +29,7 @@ export function CaseDetailsErrorMessage(props) {
|
|
|
29
29
|
errorMessage403 = (React.createElement(React.Fragment, null,
|
|
30
30
|
"Open this case in the",
|
|
31
31
|
' ',
|
|
32
|
-
React.createElement("a", { href:
|
|
32
|
+
React.createElement("a", { href: getCssPortalUrl(), "data-tracking-id": "css-access-restriction-portal-redirect" }, "Confirmed Sovereign Support portal"),
|
|
33
33
|
"."));
|
|
34
34
|
}
|
|
35
35
|
else if (!canReadCase) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/index.tsx"],"names":[],"mappings":"AAmCA,OAAO,KAAkD,MAAM,OAAO,CAAC;AA4BvE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CACnD;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/index.tsx"],"names":[],"mappings":"AAmCA,OAAO,KAAkD,MAAM,OAAO,CAAC;AA4BvE,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CACnD;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,MAAM,qBAwjBjD"}
|
|
@@ -330,22 +330,23 @@ export default function CaseOverview(props) {
|
|
|
330
330
|
const success = yield updateStatusState(CaseStatusEnum.CLOSED, undefined, undefined, undefined, undefined, null, { showSuccessToast: false });
|
|
331
331
|
if (success) {
|
|
332
332
|
setShowCaseCloseModal(false);
|
|
333
|
-
yield postCommentAfterStatusUpdate(commentBody);
|
|
334
|
-
dtmTrackEventCaseStepEncountered('close', caseNumber, product, version);
|
|
335
333
|
showStatusUpdateSuccessToast();
|
|
334
|
+
void postCommentAfterStatusUpdate(commentBody).then(() => {
|
|
335
|
+
dtmTrackEventCaseStepEncountered('close', caseNumber, product, version);
|
|
336
|
+
});
|
|
336
337
|
}
|
|
337
338
|
}), isUpdating: (caseOverviewState.caseStatusUpdating && isCaseUpdating) || isPostingComment, onClose: () => {
|
|
338
339
|
setShowCaseCloseModal(false);
|
|
339
340
|
}, caseNumber: caseNumber })),
|
|
340
341
|
showReOpenCaseModal && (React.createElement(ReopenCaseModal, { isInternal: loggedInUserRights.data.isInternal(), onConfirm: (commentBody, newPortalStatus, reopenedAt, reopenedBySSOName, reopenedReason, reopenedReasonOther) => __awaiter(this, void 0, void 0, function* () {
|
|
341
342
|
const newApiStatus = resolvePortalStatusToApiValue(newPortalStatus, status);
|
|
342
|
-
const success = yield updateStatusState(newApiStatus, reopenedAt || null, reopenedBySSOName || null, reopenedReason || null, reopenedReasonOther || null,
|
|
343
|
-
yield postCommentAfterStatusUpdate(commentBody);
|
|
344
|
-
dtmTrackEventCaseStepEncountered('reopen', caseNumber, product, version);
|
|
345
|
-
}), { showSuccessToast: false });
|
|
343
|
+
const success = yield updateStatusState(newApiStatus, reopenedAt || null, reopenedBySSOName || null, reopenedReason || null, reopenedReasonOther || null, null, { showSuccessToast: false });
|
|
346
344
|
if (success) {
|
|
347
345
|
setShowReopenCaseModal(false);
|
|
348
346
|
showStatusUpdateSuccessToast();
|
|
347
|
+
void postCommentAfterStatusUpdate(commentBody).then(() => {
|
|
348
|
+
dtmTrackEventCaseStepEncountered('reopen', caseNumber, product, version);
|
|
349
|
+
});
|
|
349
350
|
}
|
|
350
351
|
}), onClose: () => {
|
|
351
352
|
setShowReopenCaseModal(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseDetailsManagement.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaseDetailsManagement.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseDetailsManagement.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAI5D,OAAO,KAA0C,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAsBvD,UAAU,MAAO,SAAQ,gBAAgB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,mBAAmB,CAAC;IAChC,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC;CAClD;AAED,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,KAAK,EAAE,MAAM,qBAgI1D"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import { useApolloClient } from '@apollo/client/react';
|
|
1
2
|
import { Flex, FlexItem } from '@patternfly/react-core';
|
|
2
3
|
import { AlertMessage, AlertType } from '@rh-support/components';
|
|
3
4
|
import { AbilityContext, CaseDetailsFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
5
|
+
import isEmpty from 'lodash/isEmpty';
|
|
4
6
|
import isEqual from 'lodash/isEqual';
|
|
5
|
-
import React, { useContext, useState } from 'react';
|
|
7
|
+
import React, { useContext, useEffect, useState } from 'react';
|
|
6
8
|
import { useTranslation } from 'react-i18next';
|
|
7
|
-
import { useCaseSelector } from '../../../../context/CaseContext';
|
|
9
|
+
import { useCaseDispatch, useCaseSelector } from '../../../../context/CaseContext';
|
|
8
10
|
import { useShowCaseGroupField } from '../../../../hooks/useCaseGroupUiState';
|
|
11
|
+
import { fetchCaseGroupsForContactGraphQL } from '../../../../reducers/CaseReducer';
|
|
9
12
|
import { OwnerSelector } from '../../../AccountInfo/OwnerSelector';
|
|
10
13
|
import CaseGroup from '../../../CaseInformation/CaseGroup';
|
|
11
14
|
import CaseLabels from '../../../CaseInformation/CaseLabels';
|
|
@@ -25,15 +28,45 @@ import SFDCUrl from './SFDCUrl';
|
|
|
25
28
|
export default function CaseDetailsManagement(props) {
|
|
26
29
|
const { t } = useTranslation();
|
|
27
30
|
const [isUpdatingPartner, setIsUpdatingPartner] = useState(false);
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
const caseDispatch = useCaseDispatch();
|
|
32
|
+
const apolloClient = useApolloClient();
|
|
33
|
+
const caseState = useCaseSelector((state) => {
|
|
34
|
+
var _a, _b, _c, _d, _e;
|
|
35
|
+
return ({
|
|
36
|
+
caseDetails: {
|
|
37
|
+
accountNumber: state.caseDetails.accountNumberRef,
|
|
38
|
+
groupNumber: state.caseDetails.groupNumber,
|
|
39
|
+
},
|
|
40
|
+
showMandatoryCaseGroupValidationError: state.showMandatoryCaseGroupValidationError,
|
|
41
|
+
selectedOwnerContactId: (_b = (_a = state.selectedOwner) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.id,
|
|
42
|
+
selectedOwnerIsOrgAdmin: (_e = (_d = (_c = state.selectedOwner) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.isOrgAdmin) !== null && _e !== void 0 ? _e : false,
|
|
43
|
+
ownersCaseGroupsData: state.ownersCaseGroups.data,
|
|
44
|
+
ownersCaseGroupsFetching: state.ownersCaseGroups.isFetching,
|
|
45
|
+
});
|
|
46
|
+
}, isEqual);
|
|
34
47
|
const accountNumber = caseState.caseDetails.accountNumber;
|
|
48
|
+
const groupNumber = caseState.caseDetails.groupNumber;
|
|
35
49
|
const showCaseGroupField = useShowCaseGroupField();
|
|
36
50
|
const ability = useContext(AbilityContext);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
const { selectedOwnerContactId, ownersCaseGroupsData, ownersCaseGroupsFetching } = caseState;
|
|
53
|
+
if (!props.caseNumber || isEmpty(accountNumber) || isEmpty(selectedOwnerContactId)) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (ownersCaseGroupsFetching || ownersCaseGroupsData !== undefined) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
fetchCaseGroupsForContactGraphQL(caseDispatch, apolloClient, selectedOwnerContactId, accountNumber, groupNumber || null, caseState.selectedOwnerIsOrgAdmin, groupNumber !== null && groupNumber !== void 0 ? groupNumber : '');
|
|
60
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
61
|
+
}, [
|
|
62
|
+
props.caseNumber,
|
|
63
|
+
accountNumber,
|
|
64
|
+
caseState.selectedOwnerContactId,
|
|
65
|
+
caseState.selectedOwnerIsOrgAdmin,
|
|
66
|
+
groupNumber,
|
|
67
|
+
caseState.ownersCaseGroupsData,
|
|
68
|
+
caseState.ownersCaseGroupsFetching,
|
|
69
|
+
]);
|
|
37
70
|
// const canSeeEmailNotifications = ability.can(
|
|
38
71
|
// resourceActions.PATCH,
|
|
39
72
|
// resources.CASE_DETAILS,
|
|
@@ -55,6 +55,7 @@ export function CaseOpenshiftClusterId() {
|
|
|
55
55
|
const [isClusterIdUpdating, setIsClusterIdUpdating] = useState(false);
|
|
56
56
|
const [isReasonUpdating, setIsReasonUpdating] = useState(false);
|
|
57
57
|
const [displayName, setDisplayName] = useState('');
|
|
58
|
+
const [localReasonExplanation, setLocalReasonExplanation] = useState('');
|
|
58
59
|
const previousLocalOpenshiftClusterIDState = usePrevious(localOpenshiftClusterIDState);
|
|
59
60
|
const previousSelectedReason = usePrevious(selectedReason);
|
|
60
61
|
const previousProduct = usePrevious(product);
|
|
@@ -99,6 +100,9 @@ export function CaseOpenshiftClusterId() {
|
|
|
99
100
|
]);
|
|
100
101
|
const resolvedNoClusterIdReason = resolvedNoClusterFields.reason;
|
|
101
102
|
const resolvedNoClusterIdReasonExplanation = resolvedNoClusterFields.explanation;
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
setLocalReasonExplanation(resolvedNoClusterIdReasonExplanation || '');
|
|
105
|
+
}, [resolvedNoClusterIdReasonExplanation]);
|
|
102
106
|
const shouldShowNoClusterReasonSelector = resolvedNoClusterIdReasonExplanation !== 'v3-cluster' &&
|
|
103
107
|
(clusterDropdownId === 'dont-have-id' || dontKnowSelected);
|
|
104
108
|
const clusterStateReset = () => {
|
|
@@ -264,9 +268,9 @@ export function CaseOpenshiftClusterId() {
|
|
|
264
268
|
const clusterIdDropdownFormInstructions = () => {
|
|
265
269
|
const errorMessage = isClusterIdInvalid
|
|
266
270
|
? isInvalidErrorMessage()
|
|
267
|
-
: isEmpty(clusterDropdownId)
|
|
268
|
-
?
|
|
269
|
-
:
|
|
271
|
+
: isEmpty(clusterDropdownId)
|
|
272
|
+
? discoverV4ClusterIdLinkError()
|
|
273
|
+
: null;
|
|
270
274
|
const infoMessage = isDedicatedV3() ? v3Message() : discoverV4ClusterIdLink();
|
|
271
275
|
return errorMessage ? errorMessage : infoMessage;
|
|
272
276
|
};
|
|
@@ -308,7 +312,7 @@ export function CaseOpenshiftClusterId() {
|
|
|
308
312
|
setIsReasonUpdating(false);
|
|
309
313
|
});
|
|
310
314
|
const isInVaidNoClusterIdReason = isEmpty(resolvedNoClusterIdReason) ||
|
|
311
|
-
(resolvedNoClusterIdReason === 'Other' && isEmpty((
|
|
315
|
+
(resolvedNoClusterIdReason === 'Other' && isEmpty((localReasonExplanation || '').trim()));
|
|
312
316
|
if (!showClusterId || isFetchingCaseDetails) {
|
|
313
317
|
return null;
|
|
314
318
|
}
|
|
@@ -317,12 +321,8 @@ export function CaseOpenshiftClusterId() {
|
|
|
317
321
|
}
|
|
318
322
|
else {
|
|
319
323
|
return (React.createElement(React.Fragment, null,
|
|
320
|
-
React.createElement(OpenshiftDropdownV4, { openshiftDisplayName: displayName, setOpenshiftDisplayName: onDisplayNameChange, openshiftClusterIDState: clusterDropdownId || '', onClusterIdStateUpdate: onClusterIdSave, isClusterIdInvalid: isEmpty(clusterDropdownId) ||
|
|
321
|
-
|
|
322
|
-
clusterDropdownId === 'v3-cluster'
|
|
323
|
-
? false
|
|
324
|
-
: isClusterIdInvalid, clusterIdDropdownFormInstructions: !isExportingPDF ? clusterIdDropdownFormInstructions() : undefined, onClusterClear: resetClusterData, isV3: product === 'OpenShift Container Platform', isDisabled: isClusterIdUpdating || isCaseReadOnly, noClusterIdReasonExplanation: resolvedNoClusterIdReasonExplanation || '' }),
|
|
325
|
-
shouldShowNoClusterReasonSelector && (React.createElement(NoClusterIDReasonSelector, { noClusterIdReasonExplanation: resolvedNoClusterIdReasonExplanation || '', noClusterIdReason: resolvedNoClusterIdReason || '', onReasonInputBoxBlur: onReasonExplanationInputBoxChanged, onReasonChange: onReasonChange, isInValid: isInVaidNoClusterIdReason, isCustomer: isCustomer, isDisabled: isReasonUpdating || isCaseReadOnly })),
|
|
324
|
+
React.createElement(OpenshiftDropdownV4, { openshiftDisplayName: displayName, setOpenshiftDisplayName: onDisplayNameChange, openshiftClusterIDState: clusterDropdownId || '', onClusterIdStateUpdate: onClusterIdSave, isClusterIdInvalid: isClusterIdInvalid || isEmpty(clusterDropdownId), clusterIdDropdownFormInstructions: !isExportingPDF ? clusterIdDropdownFormInstructions() : undefined, onClusterClear: resetClusterData, isDisabled: isClusterIdUpdating || isCaseReadOnly, noClusterIdReasonExplanation: resolvedNoClusterIdReasonExplanation || '' }),
|
|
325
|
+
shouldShowNoClusterReasonSelector && (React.createElement(NoClusterIDReasonSelector, { noClusterIdReasonExplanation: resolvedNoClusterIdReasonExplanation || '', noClusterIdReason: resolvedNoClusterIdReason || '', onReasonInputBoxChanged: setLocalReasonExplanation, onReasonInputBoxBlur: onReasonExplanationInputBoxChanged, onReasonChange: onReasonChange, isInValid: isInVaidNoClusterIdReason, isCustomer: isCustomer, isDisabled: isReasonUpdating || isCaseReadOnly })),
|
|
326
326
|
React.createElement(LoadingIndicator, { show: isClusterIdUpdating, size: "xs" })));
|
|
327
327
|
}
|
|
328
328
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseLabels.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseLabels.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaseLabels.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/CaseLabels.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAWzD,MAAM,CAAC,OAAO,UAAU,UAAU,sBA2LjC"}
|
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { Label, MenuToggle, Select, SelectList, SelectOption, Spinner, } from '@patternfly/react-core';
|
|
11
|
-
import { ToastNotification } from '@rh-support/components';
|
|
11
|
+
import { CaseLabelLoadErrorModal, ToastNotification } from '@rh-support/components';
|
|
12
12
|
import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
|
|
13
13
|
import isEqual from 'lodash/isEqual';
|
|
14
14
|
import React, { useContext, useState } from 'react';
|
|
@@ -18,19 +18,17 @@ import { useCaseSelector } from '../../context/CaseContext';
|
|
|
18
18
|
import { useCaseLabelLinks } from '../../hooks/useCaseLabelLinkMutations';
|
|
19
19
|
const NUM_VISIBLE_LABELS = 3;
|
|
20
20
|
export default function CaseLabels() {
|
|
21
|
+
var _a;
|
|
21
22
|
const { t } = useTranslation();
|
|
22
23
|
const canEditCase = useCanEditCase();
|
|
23
|
-
const { globalMetadataState: { loggedInUser }, } = useContext(GlobalMetadataStateContext);
|
|
24
|
+
const { globalMetadataState: { loggedInUser, loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
|
|
24
25
|
const isOrgAdmin = loggedInUser.data.isOrgAdmin;
|
|
25
|
-
const { caseId
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
salesforceAccountId: (_b = (_a = state.selectedAccountDetails) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.salesforceAccountId,
|
|
30
|
-
});
|
|
31
|
-
}, isEqual);
|
|
32
|
-
const { availableLabels, assignedLinks, selectedLabelIds, loading, mutating, setAssignedLinks, createLink, deleteLink, } = useCaseLabelLinks(salesforceAccountId, caseId);
|
|
26
|
+
const { caseId } = useCaseSelector((state) => ({ caseId: state.caseDetails.id }), isEqual);
|
|
27
|
+
const labelAccountId = (_a = loggedInUsersAccount.data) === null || _a === void 0 ? void 0 : _a.salesforceAccountId;
|
|
28
|
+
const isLabelAccountReady = !loggedInUsersAccount.isFetching && Boolean(labelAccountId);
|
|
29
|
+
const { availableLabels, assignedLinks, selectedLabelIds, loading, error, mutating, setAssignedLinks, createLink, deleteLink, refetch, } = useCaseLabelLinks(isLabelAccountReady ? labelAccountId : undefined, caseId);
|
|
33
30
|
const [isOpen, setIsOpen] = useState(false);
|
|
31
|
+
const [isErrorModalDismissed, setIsErrorModalDismissed] = useState(false);
|
|
34
32
|
const handleSelect = (_event, labelId) => __awaiter(this, void 0, void 0, function* () {
|
|
35
33
|
if (!labelId || typeof labelId !== 'string')
|
|
36
34
|
return;
|
|
@@ -74,8 +72,9 @@ export default function CaseLabels() {
|
|
|
74
72
|
const haltEvent = (e) => e.stopPropagation();
|
|
75
73
|
const toggle = (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, onClick: () => setIsOpen((prev) => !prev), isExpanded: isOpen, isDisabled: loading ||
|
|
76
74
|
mutating ||
|
|
75
|
+
!!error ||
|
|
77
76
|
!caseId ||
|
|
78
|
-
(!isOrgAdmin && availableLabels.length === 0) ||
|
|
77
|
+
(!isOrgAdmin && availableLabels.length === 0 && !error) ||
|
|
79
78
|
canEditCase.isCaseNotEditable, isFullWidth: true, style: { height: '36px' } }, loading || mutating ? (React.createElement(Spinner, { size: "md" })) : selectedLabels.length > 0 ? (React.createElement("span", { style: { display: 'flex', gap: '8px', alignItems: 'center', flexWrap: 'nowrap' } },
|
|
80
79
|
selectedLabels.slice(0, NUM_VISIBLE_LABELS).map((label) => (React.createElement(Label, { key: label.id, variant: "outline", onClose: () => handleChipRemove(label.id), closeBtnAriaLabel: t('Remove label {{name}}', { name: label.name }), onClick: haltEvent }, label.name))),
|
|
81
80
|
selectedLabels.length > NUM_VISIBLE_LABELS && (React.createElement("span", { style: {
|
|
@@ -87,11 +86,15 @@ export default function CaseLabels() {
|
|
|
87
86
|
if (!caseId)
|
|
88
87
|
return null;
|
|
89
88
|
return (React.createElement("div", { className: "form-group" },
|
|
89
|
+
React.createElement(CaseLabelLoadErrorModal, { isOpen: !!error && !isErrorModalDismissed, onRetry: () => {
|
|
90
|
+
setIsErrorModalDismissed(false);
|
|
91
|
+
refetch();
|
|
92
|
+
}, onClose: () => setIsErrorModalDismissed(true) }),
|
|
90
93
|
React.createElement("label", { htmlFor: "case-labels" },
|
|
91
94
|
React.createElement(Trans, null, "Labels")),
|
|
92
95
|
React.createElement(Select, { id: "case-labels", "data-tracking-id": "case-labels", role: "menu", isOpen: isOpen, onSelect: handleSelect, onOpenChange: () => setIsOpen(false), toggle: toggle, shouldFocusFirstItemOnOpen: false, isScrollable: true, popperProps: { direction: 'down', enableFlip: false } },
|
|
93
96
|
React.createElement(SelectList, { id: "case-labels-listbox" }, availableLabels.map((label) => (React.createElement(SelectOption, { key: label.id, value: label.id, hasCheckbox: true, isSelected: selectedLabelIds.includes(label.id) }, label.name))))),
|
|
94
|
-
!loading && availableLabels.length === 0 && (React.createElement("p", { className: "form-instructions" }, isOrgAdmin ? (React.createElement(Trans, null,
|
|
97
|
+
!loading && !error && availableLabels.length === 0 && (React.createElement("p", { className: "form-instructions" }, isOrgAdmin ? (React.createElement(Trans, null,
|
|
95
98
|
React.createElement("strong", null, "No labels available:"),
|
|
96
99
|
" You haven't created any labels yet.",
|
|
97
100
|
' ',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Severity.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Severity.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAMvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"Severity.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseInformation/Severity.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAMvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAa5D,OAAO,KAA0C,MAAM,OAAO,CAAC;AAW/D,UAAU,MAAO,SAAQ,gBAAgB;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IAChE,oBAAoB,EAAE,OAAO,CAAC;CACjC;AASD,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,GAAG,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;CACxD;AAED,iBAAS,QAAQ,CAAC,KAAK,EAAE,MAAM,qBA+R9B;kBA/RQ,QAAQ;;;AAiSjB,eAAe,QAAQ,CAAC"}
|
|
@@ -3,7 +3,7 @@ import QuestionCircleIcon from '@patternfly/react-icons/dist/js/icons/question-c
|
|
|
3
3
|
import WarningTriangleIcon from '@patternfly/react-icons/dist/js/icons/warning-triangle-icon';
|
|
4
4
|
import { SingleSelectDropdown, ValueChangedIcon } from '@rh-support/components';
|
|
5
5
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
6
|
-
import {
|
|
6
|
+
import { getFtsForSeverityChange, PreviousCaseTypes, severitySort, } from '@rh-support/utils';
|
|
7
7
|
import find from 'lodash/find';
|
|
8
8
|
import findLast from 'lodash/findLast';
|
|
9
9
|
import includes from 'lodash/includes';
|
|
@@ -56,12 +56,11 @@ function Severity(props) {
|
|
|
56
56
|
const casePayload = {
|
|
57
57
|
severity: value,
|
|
58
58
|
};
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
if (
|
|
62
|
-
casePayload.fts =
|
|
59
|
+
// Always send an explicit fts flag so CasePatch clears 24x7 when leaving severity 1.
|
|
60
|
+
casePayload.fts = getFtsForSeverityChange(entitlementSla, value, Object.assign({ isCaseEdit: isOnCaseDetailsPage }, ftsCreateOptions));
|
|
61
|
+
if (isIdea) {
|
|
62
|
+
casePayload.fts = false;
|
|
63
63
|
}
|
|
64
|
-
casePayload.fts = casePayload.fts && !isIdea;
|
|
65
64
|
if (isOnCaseDetailsPage) {
|
|
66
65
|
props.onSeverityChange && props.onSeverityChange(casePayload);
|
|
67
66
|
}
|
|
@@ -110,8 +109,11 @@ function Severity(props) {
|
|
|
110
109
|
label: `${severity} - ${getSeverityDescription(severity)}`,
|
|
111
110
|
additionalInfo: getNewSeverityStringDef(severity),
|
|
112
111
|
};
|
|
113
|
-
const
|
|
114
|
-
setOpenUpdateSeverityModal(
|
|
112
|
+
const openSeverityModal = () => {
|
|
113
|
+
setOpenUpdateSeverityModal(true);
|
|
114
|
+
};
|
|
115
|
+
const closeSeverityModal = () => {
|
|
116
|
+
setOpenUpdateSeverityModal(false);
|
|
115
117
|
};
|
|
116
118
|
useEffect(() => {
|
|
117
119
|
var _a, _b, _c;
|
|
@@ -174,13 +176,12 @@ function Severity(props) {
|
|
|
174
176
|
React.createElement(Icon, { size: "sm" },
|
|
175
177
|
React.createElement(WarningTriangleIcon, { color: "#ec7a08", title: "Support Severity Level warning" })))),
|
|
176
178
|
!props.isDisabled && isOnCaseDetailsPage ? (React.createElement(React.Fragment, null,
|
|
177
|
-
React.createElement("
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
openUpdateSeverityModal && (React.createElement(UpdateSeverityModal, { isDisabled: props.isFetching, isFetching: props.isFetching, show: openUpdateSeverityModal, onClose: toggleModal })))) : (React.createElement("div", null,
|
|
179
|
+
React.createElement(SingleSelectDropdown, { dataTrackingId: "get-support-severity", selected: getSelectedDropdownOption, options: getDropdownOptions, onSelect: onSeverityChange, isDisabled: allCaseSeverities.isError ||
|
|
180
|
+
props.isDisabled ||
|
|
181
|
+
allCaseSeverities.isFetching ||
|
|
182
|
+
ownersEntitlements.isFetching ||
|
|
183
|
+
versionsDetails.isFetching, isLoading: props.isFetching, placeholder: t(`Select a severity`), isInvalid: allCaseSeverities.isError || isSeverityInValid, isScrollable: true, isModalOpen: openUpdateSeverityModal, onMenuToggle: openSeverityModal }),
|
|
184
|
+
openUpdateSeverityModal && (React.createElement(UpdateSeverityModal, { isDisabled: props.isFetching, isFetching: props.isFetching, show: openUpdateSeverityModal, onClose: closeSeverityModal })))) : (React.createElement("div", null,
|
|
184
185
|
React.createElement(SingleSelectDropdown, { className: "case-creation-severity-select", dataTrackingId: "get-support-severity", selected: getSelectedDropdownOption, options: getDropdownOptions, onSelect: onSeverityChange, isDisabled: allCaseSeverities.isError ||
|
|
185
186
|
props.isDisabled ||
|
|
186
187
|
allCaseSeverities.isFetching ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseLabelsCreate.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/CaseLabelsCreate.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaseLabelsCreate.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/CaseLabelsCreate.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAqE,MAAM,OAAO,CAAC;AAY1F,wFAAwF;AACxF,MAAM,CAAC,OAAO,UAAU,gBAAgB,sBA6NvC"}
|
|
@@ -9,11 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { useApolloClient } from '@apollo/client/react';
|
|
11
11
|
import { Label, MenuToggle, Select, SelectList, SelectOption, Spinner, } from '@patternfly/react-core';
|
|
12
|
+
import { CaseLabelLoadErrorModal } from '@rh-support/components';
|
|
12
13
|
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
13
|
-
import {
|
|
14
|
+
import { fetchAllAccountCaseLabels } from '@rh-support/utils';
|
|
14
15
|
import isEqual from 'lodash/isEqual';
|
|
15
16
|
import unescape from 'lodash/unescape';
|
|
16
|
-
import React, { useCallback, useContext, useEffect, useState } from 'react';
|
|
17
|
+
import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
17
18
|
import { Trans, useTranslation } from 'react-i18next';
|
|
18
19
|
import { Link } from 'react-router-dom';
|
|
19
20
|
import { useCaseDispatch, useCaseSelector } from '../../context/CaseContext';
|
|
@@ -21,40 +22,65 @@ import { setCaseState } from '../../reducers/CaseReducer';
|
|
|
21
22
|
const NUM_VISIBLE_LABELS = 3;
|
|
22
23
|
/** Case creation Labels dropdown — selection is stored and linked after case create. */
|
|
23
24
|
export default function CaseLabelsCreate() {
|
|
25
|
+
var _a, _b, _c;
|
|
24
26
|
const { t } = useTranslation();
|
|
25
27
|
const client = useApolloClient();
|
|
26
28
|
const caseDispatch = useCaseDispatch();
|
|
27
|
-
const { globalMetadataState: { loggedInUser }, } = useContext(GlobalMetadataStateContext);
|
|
29
|
+
const { globalMetadataState: { loggedInUser, loggedInUsersAccount }, } = useContext(GlobalMetadataStateContext);
|
|
28
30
|
const isOrgAdmin = loggedInUser.data.isOrgAdmin;
|
|
29
|
-
const {
|
|
30
|
-
var _a, _b, _c;
|
|
31
|
+
const { salesforceAccountIdFromSelected, isSelectedAccountFetching, selectedAccountNumber, selectedLabelIds } = useCaseSelector((state) => {
|
|
32
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
31
33
|
return ({
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
salesforceAccountIdFromSelected: (_b = (_a = state.selectedAccountDetails) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.salesforceAccountId,
|
|
35
|
+
isSelectedAccountFetching: (_d = (_c = state.selectedAccountDetails) === null || _c === void 0 ? void 0 : _c.isFetching) !== null && _d !== void 0 ? _d : false,
|
|
36
|
+
selectedAccountNumber: (_f = (_e = state.selectedAccountDetails) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.accountNumber,
|
|
37
|
+
selectedLabelIds: (_g = state.selectedLabelIds) !== null && _g !== void 0 ? _g : [],
|
|
34
38
|
});
|
|
35
39
|
}, isEqual);
|
|
40
|
+
const salesforceAccountId = useMemo(() => {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
if (salesforceAccountIdFromSelected) {
|
|
43
|
+
return salesforceAccountIdFromSelected;
|
|
44
|
+
}
|
|
45
|
+
const loggedInAccountNumber = (_a = loggedInUsersAccount.data) === null || _a === void 0 ? void 0 : _a.accountNumber;
|
|
46
|
+
const loggedInSalesforceAccountId = (_b = loggedInUsersAccount.data) === null || _b === void 0 ? void 0 : _b.salesforceAccountId;
|
|
47
|
+
if (loggedInSalesforceAccountId &&
|
|
48
|
+
(!selectedAccountNumber || selectedAccountNumber === loggedInAccountNumber)) {
|
|
49
|
+
return loggedInSalesforceAccountId;
|
|
50
|
+
}
|
|
51
|
+
return undefined;
|
|
52
|
+
}, [
|
|
53
|
+
salesforceAccountIdFromSelected,
|
|
54
|
+
(_a = loggedInUsersAccount.data) === null || _a === void 0 ? void 0 : _a.accountNumber,
|
|
55
|
+
(_b = loggedInUsersAccount.data) === null || _b === void 0 ? void 0 : _b.salesforceAccountId,
|
|
56
|
+
selectedAccountNumber,
|
|
57
|
+
]);
|
|
58
|
+
const isAccountLoading = isSelectedAccountFetching || loggedInUsersAccount.isFetching;
|
|
59
|
+
const labelAccountId = salesforceAccountId !== null && salesforceAccountId !== void 0 ? salesforceAccountId : (_c = loggedInUsersAccount.data) === null || _c === void 0 ? void 0 : _c.salesforceAccountId;
|
|
36
60
|
const [availableLabels, setAvailableLabels] = useState([]);
|
|
37
61
|
const [loading, setLoading] = useState(false);
|
|
62
|
+
const [error, setError] = useState(undefined);
|
|
38
63
|
const [isOpen, setIsOpen] = useState(false);
|
|
64
|
+
const [isErrorModalDismissed, setIsErrorModalDismissed] = useState(false);
|
|
39
65
|
const updateSelectedLabelIds = (nextIds) => {
|
|
40
66
|
setCaseState(caseDispatch, { selectedLabelIds: nextIds });
|
|
41
67
|
};
|
|
42
68
|
const fetchLabels = useCallback(() => __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
|
|
44
|
-
|
|
69
|
+
if (!labelAccountId) {
|
|
70
|
+
if (isAccountLoading) {
|
|
71
|
+
setLoading(true);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
setLoading(false);
|
|
45
75
|
setAvailableLabels([]);
|
|
46
76
|
return;
|
|
47
77
|
}
|
|
48
78
|
setLoading(true);
|
|
79
|
+
setError(undefined);
|
|
49
80
|
try {
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
fetchPolicy: 'cache-first',
|
|
54
|
-
});
|
|
55
|
-
const edges = (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.redhat_support_uiapi) === null || _a === void 0 ? void 0 : _a.query) === null || _b === void 0 ? void 0 : _b.RedHatSupportCaseLabel__c) === null || _c === void 0 ? void 0 : _c.edges) !== null && _d !== void 0 ? _d : [];
|
|
56
|
-
setAvailableLabels(edges
|
|
57
|
-
.map(({ node }) => {
|
|
81
|
+
const labelNodes = yield fetchAllAccountCaseLabels(client, labelAccountId);
|
|
82
|
+
setAvailableLabels(labelNodes
|
|
83
|
+
.map((node) => {
|
|
58
84
|
var _a, _b;
|
|
59
85
|
return ({
|
|
60
86
|
id: node.Id,
|
|
@@ -63,13 +89,14 @@ export default function CaseLabelsCreate() {
|
|
|
63
89
|
})
|
|
64
90
|
.filter((label) => label.id && label.name));
|
|
65
91
|
}
|
|
66
|
-
catch (
|
|
92
|
+
catch (e) {
|
|
93
|
+
setError(e);
|
|
67
94
|
setAvailableLabels([]);
|
|
68
95
|
}
|
|
69
96
|
finally {
|
|
70
97
|
setLoading(false);
|
|
71
98
|
}
|
|
72
|
-
}), [client,
|
|
99
|
+
}), [client, isAccountLoading, labelAccountId]);
|
|
73
100
|
useEffect(() => {
|
|
74
101
|
fetchLabels();
|
|
75
102
|
}, [fetchLabels]);
|
|
@@ -85,7 +112,7 @@ export default function CaseLabelsCreate() {
|
|
|
85
112
|
};
|
|
86
113
|
const selectedLabels = availableLabels.filter((label) => selectedLabelIds.includes(label.id));
|
|
87
114
|
const haltEvent = (e) => e.stopPropagation();
|
|
88
|
-
const toggle = (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, onClick: () => setIsOpen((prev) => !prev), isExpanded: isOpen, isDisabled: loading || (!isOrgAdmin && availableLabels.length === 0), isFullWidth: true, style: { height: '36px' } }, loading ? (React.createElement(Spinner, { size: "md" })) : selectedLabels.length > 0 ? (React.createElement("span", { style: { display: 'flex', gap: '8px', alignItems: 'center', flexWrap: 'nowrap' } },
|
|
115
|
+
const toggle = (toggleRef) => (React.createElement(MenuToggle, { ref: toggleRef, onClick: () => setIsOpen((prev) => !prev), isExpanded: isOpen, isDisabled: loading || isAccountLoading || !!error || (!isOrgAdmin && availableLabels.length === 0 && !error), isFullWidth: true, style: { height: '36px' } }, loading || isAccountLoading ? (React.createElement(Spinner, { size: "md" })) : selectedLabels.length > 0 ? (React.createElement("span", { style: { display: 'flex', gap: '8px', alignItems: 'center', flexWrap: 'nowrap' } },
|
|
89
116
|
selectedLabels.slice(0, NUM_VISIBLE_LABELS).map((label) => (React.createElement(Label, { key: label.id, variant: "outline", onClose: () => handleChipRemove(label.id), closeBtnAriaLabel: t('Remove label {{name}}', { name: label.name }), onClick: haltEvent }, label.name))),
|
|
90
117
|
selectedLabels.length > NUM_VISIBLE_LABELS && (React.createElement("span", { style: {
|
|
91
118
|
color: 'var(--pf-t--global--text--color--link--default)',
|
|
@@ -94,11 +121,15 @@ export default function CaseLabelsCreate() {
|
|
|
94
121
|
cursor: 'pointer',
|
|
95
122
|
} }, t('{{count}} more', { count: selectedLabels.length - NUM_VISIBLE_LABELS }))))) : availableLabels.length === 0 ? (t('No label assigned')) : (t('Select labels'))));
|
|
96
123
|
return (React.createElement("div", { className: "form-group" },
|
|
124
|
+
React.createElement(CaseLabelLoadErrorModal, { isOpen: !!error && !isErrorModalDismissed, onRetry: () => {
|
|
125
|
+
setIsErrorModalDismissed(false);
|
|
126
|
+
fetchLabels();
|
|
127
|
+
}, onClose: () => setIsErrorModalDismissed(true) }),
|
|
97
128
|
React.createElement("label", { htmlFor: "case-labels-create" },
|
|
98
129
|
React.createElement(Trans, null, "Labels")),
|
|
99
130
|
React.createElement(Select, { id: "case-labels-create", "data-tracking-id": "case-labels-create", role: "menu", isOpen: isOpen, onSelect: handleSelect, onOpenChange: () => setIsOpen(false), toggle: toggle, shouldFocusFirstItemOnOpen: false, isScrollable: true, popperProps: { direction: 'down', enableFlip: false } },
|
|
100
131
|
React.createElement(SelectList, { id: "case-labels-create-listbox" }, availableLabels.map((label) => (React.createElement(SelectOption, { key: label.id, value: label.id, hasCheckbox: true, isSelected: selectedLabelIds.includes(label.id) }, label.name))))),
|
|
101
|
-
!loading && availableLabels.length === 0 && (React.createElement("p", { className: "form-instructions" }, isOrgAdmin ? (React.createElement(Trans, null,
|
|
132
|
+
!loading && !isAccountLoading && !error && availableLabels.length === 0 && (React.createElement("p", { className: "form-instructions" }, isOrgAdmin ? (React.createElement(Trans, null,
|
|
102
133
|
React.createElement("strong", null, "No labels available:"),
|
|
103
134
|
" You haven't created any labels yet.",
|
|
104
135
|
' ',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoClusterIDReasonSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/NoClusterIDReasonSelector.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAM/D,UAAU,MAAM;IACZ,uBAAuB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,4BAA4B,EAAE,MAAM,CAAC;IACrC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,QAAA,MAAM,yBAAyB,GAAI,OAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"NoClusterIDReasonSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/NoClusterIDReasonSelector.tsx"],"names":[],"mappings":"AAWA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAM/D,UAAU,MAAM;IACZ,uBAAuB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,4BAA4B,EAAE,MAAM,CAAC;IACrC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,QAAA,MAAM,yBAAyB,GAAI,OAAO,MAAM,sBAqL/C,CAAC;AAEF,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
|
|
@@ -46,9 +46,7 @@ const NoClusterIDReasonSelector = (props) => {
|
|
|
46
46
|
const cleaned = value.trim().length === 0 ? '' : value;
|
|
47
47
|
setInputValue(cleaned);
|
|
48
48
|
setHasLargeReasonExplanation(cleaned.length > SESSION_NO_CLUSTER_REASON_LENGTH_LIMIT);
|
|
49
|
-
|
|
50
|
-
(_a = props.onReasonInputBoxChanged) === null || _a === void 0 ? void 0 : _a.call(props, cleaned);
|
|
51
|
-
}
|
|
49
|
+
(_a = props.onReasonInputBoxChanged) === null || _a === void 0 ? void 0 : _a.call(props, cleaned);
|
|
52
50
|
};
|
|
53
51
|
const handleInputBlur = () => {
|
|
54
52
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenShiftClusterId.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenShiftClusterId.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAuB/D,eAAO,MAAM,oBAAoB,yBAShC,CAAC;AAEF,eAAO,MAAM,uBAAuB,yBAInC,CAAC;AAEF,eAAO,MAAM,4BAA4B,yBAYxC,CAAC;AAEF,eAAO,MAAM,qBAAqB,yBAIjC,CAAC;AAEF,UAAU,MAAM;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"OpenShiftClusterId.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenShiftClusterId.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAuB/D,eAAO,MAAM,oBAAoB,yBAShC,CAAC;AAEF,eAAO,MAAM,uBAAuB,yBAInC,CAAC;AAEF,eAAO,MAAM,4BAA4B,yBAYxC,CAAC;AAEF,eAAO,MAAM,qBAAqB,yBAIjC,CAAC;AAEF,UAAU,MAAM;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,qBAkT/C"}
|
|
@@ -232,7 +232,7 @@ export function OpenShiftClusterId(props) {
|
|
|
232
232
|
return null;
|
|
233
233
|
return (React.createElement("div", { className: `${props.className ? props.className : ''}` },
|
|
234
234
|
!showV3TextBox && (React.createElement(OpenshiftDropdownV4, { openshiftDisplayName: openshiftDisplayName, openshiftClusterIDState: openshiftClusterID || selectedReason, onClusterIdStateUpdate: onClusterIdStateUpdate, isClusterIdInvalid: isNextBtnClickedToShowValidationError &&
|
|
235
|
-
((isEmpty(openshiftClusterID) && isEmpty(selectedReason)) || isClusterIdInvalid), clusterIdDropdownFormInstructions: clusterIdDropdownFormInstructions(), onClusterClear: resetClusterData
|
|
235
|
+
((isEmpty(openshiftClusterID) && isEmpty(selectedReason)) || isClusterIdInvalid), clusterIdDropdownFormInstructions: clusterIdDropdownFormInstructions(), onClusterClear: resetClusterData })),
|
|
236
236
|
noClusterIdReasonExplanation !== 'v3-cluster' && dontKnowSelected && !showV3TextBox && (React.createElement(NoClusterIDReasonSelector, { noClusterIdReasonExplanation: noClusterIdReasonExplanation, noClusterIdReason: noClusterIdReason, onReasonInputBoxChanged: onReasonExplanationInputBoxChanged, onReasonChange: onReasonChange, isInValid: isInVaidNoClusterIdReason, isCustomer: isCustomer })),
|
|
237
237
|
(v3Selected || showV3TextBox) && (React.createElement(OpenShiftV3Inputbox, { v3ClusterName: v3ClusterName, onReasonInputBoxChanged: v3ClusterNameInputBoxChanged, isInValid: isEmpty(v3ClusterName.trim()) && isNextBtnClickedToShowValidationError, v3Selected: v3Selected }))));
|
|
238
238
|
}
|
|
@@ -7,7 +7,6 @@ interface IProps extends IDClassNameProps {
|
|
|
7
7
|
isClusterIdInvalid: boolean;
|
|
8
8
|
clusterIdDropdownFormInstructions?: JSX.Element;
|
|
9
9
|
onClusterClear: () => void;
|
|
10
|
-
isV3: boolean;
|
|
11
10
|
isDisabled?: boolean;
|
|
12
11
|
noClusterIdReasonExplanation?: string;
|
|
13
12
|
openshiftDisplayName?: string;
|
|
@@ -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,
|
|
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,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,qBAmfzC;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -117,8 +117,8 @@ function OpenshiftDropdownV4(props) {
|
|
|
117
117
|
const dropdownOptions = useMemo(() => [
|
|
118
118
|
{ type: 'checkbox', key: 'show-hide-archived-clusters', label: t('Show archived clusters') },
|
|
119
119
|
{ type: 'option', key: 'dont-have-id', label: t("I don't have my Cluster ID") },
|
|
120
|
-
|
|
121
|
-
], [
|
|
120
|
+
{ type: 'option', key: 'v3-cluster', label: t('The case is for a v3 cluster') },
|
|
121
|
+
], [t]);
|
|
122
122
|
// Use the keyboard navigation hook
|
|
123
123
|
const { focusedItemIndex, onInputKeyDown } = useSelectKeyboardNavigator({
|
|
124
124
|
list: dropdownOptions,
|
|
@@ -145,13 +145,9 @@ function OpenshiftDropdownV4(props) {
|
|
|
145
145
|
const dropdownHeaderOptions = useMemo(() => [
|
|
146
146
|
React.createElement(SelectOption, { hasCheckbox: true, key: "show-archived-clusters", "aria-label": t('Show archived clusters'), id: "show-archived-clusters", className: "archived-clusters-checkbox", "data-tracking-id": "show-hide-archived-clusters", value: { type: 'checkbox' }, isSelected: showArchivedClusters }, t('Show archived clusters')),
|
|
147
147
|
React.createElement(Divider, { component: "div", key: 'cluster-id-options-divider-e' }),
|
|
148
|
-
React.createElement(SelectOption, { key: 'dont-have-id', value: createState('dont-have-id', t("I don't have my Cluster ID")), "data-tracking-id": "dont-have-cluster-id", isFocused: focusedItemIndex === 1 }, "I don't have my Cluster ID"),
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
React.createElement(SelectOption, { key: 'v3-cluster', value: createState('v3-cluster', t('The case is for a v3 cluster')), "data-tracking-id": "v3-cluster-case", isFocused: focusedItemIndex === 2 }, t('The case is for a v3 cluster')),
|
|
152
|
-
]
|
|
153
|
-
: []),
|
|
154
|
-
], [showArchivedClusters, focusedItemIndex, props.isV3, t]);
|
|
148
|
+
React.createElement(SelectOption, { key: 'dont-have-id', value: createState('dont-have-id', t("I don't have my Cluster ID")), "data-tracking-id": "dont-have-cluster-id", isFocused: focusedItemIndex === 1 }, t("I don't have my Cluster ID")),
|
|
149
|
+
React.createElement(SelectOption, { key: 'v3-cluster', value: createState('v3-cluster', t('The case is for a v3 cluster')), "data-tracking-id": "v3-cluster-case", isFocused: focusedItemIndex === 2 }, t('The case is for a v3 cluster')),
|
|
150
|
+
], [showArchivedClusters, focusedItemIndex, t]);
|
|
155
151
|
const getClusterOptions = (clusters, total = totalResultsNo) => {
|
|
156
152
|
const clustersResponseGrouped = groupBy(clusters, 'console_url') || [];
|
|
157
153
|
const domainNames = Object.keys(clustersResponseGrouped) || [];
|
|
@@ -294,8 +290,6 @@ function OpenshiftDropdownV4(props) {
|
|
|
294
290
|
}, [props.openshiftClusterIDState, props.openshiftDisplayName, props.noClusterIdReasonExplanation]);
|
|
295
291
|
// need to get clusters when user opens the dropdown
|
|
296
292
|
// as the api response is cached np extra call is made on open/close
|
|
297
|
-
// added observing props.isV3 because re-render
|
|
298
|
-
// is needed when user on overview page changing version
|
|
299
293
|
useEffect(() => {
|
|
300
294
|
if (!isOpen)
|
|
301
295
|
return;
|
|
@@ -314,7 +308,7 @@ function OpenshiftDropdownV4(props) {
|
|
|
314
308
|
isUnmounted = true;
|
|
315
309
|
};
|
|
316
310
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
317
|
-
}, [
|
|
311
|
+
}, [showArchivedClusters, isOpen, inputVal]);
|
|
318
312
|
const onTextInputChange = (_event, value) => {
|
|
319
313
|
setInputVal(value);
|
|
320
314
|
props.onClusterIdStateUpdate({ external_cluster_id: value });
|