@rh-support/troubleshoot 0.2.85 → 0.2.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/components/CaseEditView/CaseOverview/index.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/CaseOverview/index.js +6 -3
- package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +6 -4
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +169 -63
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.d.ts.map +1 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/Summary.js +3 -1
- package/lib/esm/components/CaseManagement/Cep.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/Cep.js +13 -13
- package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts +1 -0
- package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.js +1 -1
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts +3 -0
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +3 -3
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts +1 -0
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
- package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +2 -2
- package/lib/esm/components/Recommendations/AsideResults.d.ts +1 -4
- package/lib/esm/components/Recommendations/AsideResults.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/AsideResults.js +17 -14
- package/lib/esm/components/Recommendations/ClusterRecommendationItems.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/ClusterRecommendationItems.js +11 -6
- package/lib/esm/components/Recommendations/EARules/EARule.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/EARules/EARule.js +10 -6
- package/lib/esm/components/Recommendations/EARules/EARuleInfoInline.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/EARules/EARuleInfoInline.js +13 -2
- package/lib/esm/components/Recommendations/EARules/EARuleWidget.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/EARules/EARuleWidget.js +26 -1
- package/lib/esm/components/Recommendations/InsightsRuleInfo.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/InsightsRuleInfo.js +3 -5
- package/lib/esm/components/Recommendations/Recommendations.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/Recommendations.js +8 -7
- package/lib/esm/components/Recommendations/RulesModal.d.ts.map +1 -1
- package/lib/esm/components/Recommendations/RulesModal.js +9 -2
- package/lib/esm/components/shared/Constants.d.ts +8 -4
- package/lib/esm/components/shared/Constants.d.ts.map +1 -1
- package/lib/esm/components/shared/Constants.js +8 -4
- package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
- package/lib/esm/reducers/CaseReducer.js +2 -0
- package/lib/esm/reducers/SessionRestoreReducer.d.ts +3 -2
- package/lib/esm/reducers/SessionRestoreReducer.d.ts.map +1 -1
- package/lib/esm/reducers/SessionRestoreReducer.js +35 -52
- package/lib/esm/scss/_main.scss +13 -0
- package/lib/esm/scss/_pf4-overrides.scss +6 -0
- package/package.json +10 -10
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftDropdownV4.d.ts +0 -22
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftDropdownV4.d.ts.map +0 -1
- package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftDropdownV4.js +0 -228
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/CaseOverview/index.tsx"],"names":[],"mappings":"AAyCA,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;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":"AAyCA,UAAU,MAAM;IACZ,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,MAAM,eAidjD"}
|
|
@@ -222,10 +222,13 @@ export default function CaseOverview(props) {
|
|
|
222
222
|
props.caseNumber),
|
|
223
223
|
React.createElement("div", null,
|
|
224
224
|
exportPDFButton(props.caseNumber),
|
|
225
|
-
React.createElement(Button, { className: "pf-u-ml-md", isDisabled: !canManageCase || (caseOverviewState.caseStatusUpdating && isCaseUpdating),
|
|
225
|
+
React.createElement(Button, Object.assign({ className: "pf-u-ml-md", isDisabled: !canManageCase || (caseOverviewState.caseStatusUpdating && isCaseUpdating) }, (caseOverviewState.caseStatusUpdating &&
|
|
226
|
+
isCaseUpdating && {
|
|
227
|
+
isLoading: true,
|
|
228
|
+
}), { onClick: () => (isCaseInOpenState ? onCaseClose() : onCaseReopen()), variant: isCaseInOpenState ? ButtonVariant.secondary : ButtonVariant.tertiary, "data-tracking-id": isCaseInOpenState
|
|
226
229
|
? 'case-close-btn-case-details-overview'
|
|
227
|
-
: 'case-reopen-btn-case-details-overview' },
|
|
228
|
-
React.createElement(Trans, null, isCaseInOpenState ? 'Close case' : '
|
|
230
|
+
: 'case-reopen-btn-case-details-overview' }),
|
|
231
|
+
React.createElement(Trans, null, isCaseInOpenState ? 'Close case' : 'Reopen case')))),
|
|
229
232
|
React.createElement("div", { className: `case-details-header-secondary push-bottom-narrow ${isExportingPDF && !viewAsCustomer ? 'hide-in-pdf' : ''}` },
|
|
230
233
|
React.createElement("span", { className: "case-support-level" }, computeSupportLink())),
|
|
231
234
|
React.createElement("div", { className: "case-details-summary push-bottom-narrow" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReopenCaseModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/ConfirmationModals/ReopenCaseModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ReopenCaseModal.d.ts","sourceRoot":"","sources":["../../../../../src/components/CaseEditView/ConfirmationModals/ReopenCaseModal.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAEzE,UAAU,MAAM;IACZ,SAAS,EAAE,CAAC,SAAS,KAAA,EAAE,WAAW,KAAA,KAAK,IAAI,CAAC;IAC5C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,cAAc,CAAC;CAChC;AAMD,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,eAkL5C"}
|
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { Button, ButtonVariant, Form, FormGroup, Modal, ModalVariant, Select, SelectOption, TextArea, } from '@patternfly/react-core';
|
|
11
11
|
import ExclamationCircleIcon from '@patternfly/react-icons/dist/js/icons/exclamation-circle-icon';
|
|
12
|
+
import { isEmpty } from 'lodash';
|
|
12
13
|
import React, { useState } from 'react';
|
|
13
14
|
import { Trans, useTranslation } from 'react-i18next';
|
|
14
15
|
import { CaseStatusEnum } from '../../../constants/caseDetailsConstants';
|
|
@@ -62,9 +63,10 @@ export function ReopenCaseModal(props) {
|
|
|
62
63
|
setSelectedStatus(status);
|
|
63
64
|
onDropdownToggle(false);
|
|
64
65
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
const isDescriptionEmpty = isEmpty(reopenDescription === null || reopenDescription === void 0 ? void 0 : reopenDescription.trim());
|
|
67
|
+
return (React.createElement(Modal, { id: "case-reopen-modal", title: t(`Reopening case ${props.caseNumber}`), "aria-describedby": "case-reopen-modal", isOpen: true, onClose: props.onClose, showClose: true, actions: [
|
|
68
|
+
React.createElement(Button, { key: "submit-description", variant: ButtonVariant.primary, onClick: onSubmit, isLoading: props.isUpdating, isDisabled: isDescriptionEmpty || showValidationError || props.isUpdating, "data-tracking-id": "reopen-case-description-modal-submit" },
|
|
69
|
+
React.createElement(Trans, null, "Reopen case")),
|
|
68
70
|
React.createElement(Button, { key: "close-modal", variant: ButtonVariant.secondary, onClick: props.onClose, isDisabled: props.isUpdating, "data-tracking-id": "reopen-case-description-modal-cancel" },
|
|
69
71
|
React.createElement(Trans, null, "Cancel")),
|
|
70
72
|
], variant: ModalVariant.medium },
|
|
@@ -79,5 +81,5 @@ export function ReopenCaseModal(props) {
|
|
|
79
81
|
showTextArea && (React.createElement(FormGroup, { label: t('Please describe your reason'), type: "text", helperText: t(`Your comment will be visible${props.isInternal ? ' to the customers' : ''} under discussions after re-opening.`), isRequired: true, fieldId: "reopen-case-description" },
|
|
80
82
|
React.createElement(TextArea, { placeholder: t(props.isInternal
|
|
81
83
|
? 'Describe the reason for re-opening with the selected status'
|
|
82
|
-
: 'The better the description, the easier it will be for our support team to address your case.'), validated: showValidationError && !reopenDescription ? 'error' : 'default', isRequired: true, id: "reopen-case-description", name: "reopen-case-description", "aria-describedby": "reopen-case-description", value: reopenDescription, onChange: onDescriptionChange, isDisabled: props.isUpdating }))))));
|
|
84
|
+
: 'The better the description, the easier it will be for our support team to address your case.'), validated: showValidationError && isDescriptionEmpty && !reopenDescription ? 'error' : 'default', isRequired: true, id: "reopen-case-description", name: "reopen-case-description", "aria-describedby": "reopen-case-description", value: reopenDescription, onChange: onDescriptionChange, isDisabled: props.isUpdating }))))));
|
|
83
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseOpenshiftClusterId.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaseOpenshiftClusterId.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.tsx"],"names":[],"mappings":"AAsBA,wBAAgB,sBAAsB,gBAkPrC"}
|
|
@@ -7,98 +7,204 @@ 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 { ToastNotification } from '@rh-support/components';
|
|
11
|
-
import { GlobalMetadataStateContext
|
|
10
|
+
import { LoadingIndicator, ToastNotification } from '@rh-support/components';
|
|
11
|
+
import { GlobalMetadataStateContext } from '@rh-support/react-context';
|
|
12
|
+
import { getVersion } from '@rh-support/utils';
|
|
13
|
+
import debounce from 'lodash/debounce';
|
|
14
|
+
import isEmpty from 'lodash/isEmpty';
|
|
12
15
|
import isEqual from 'lodash/isEqual';
|
|
13
|
-
import React, { useContext, useEffect, useState } from 'react';
|
|
16
|
+
import React, { useCallback, useContext, useEffect, useState } from 'react';
|
|
14
17
|
import { useTranslation } from 'react-i18next';
|
|
15
18
|
import { useCaseDispatch, useCaseSelector } from '../../../../../context/CaseContext';
|
|
16
|
-
import { updateCaseDetails } from '../../../../../reducers/CaseReducer';
|
|
19
|
+
import { setCaseDetails, updateCaseDetails } from '../../../../../reducers/CaseReducer';
|
|
17
20
|
import { getIsClusterIdInvalid, isClusterIdEnabledForProduct } from '../../../../../utils/caseOpenshiftClusterIdUtils';
|
|
18
|
-
import {
|
|
21
|
+
import { NoClusterIDReasonSelector } from '../../../../CaseManagement/NoClusterIDReasonSelector';
|
|
22
|
+
import { discoverV4ClusterIdLink, discoverV4ClusterIdLinkError, isInvalidErrorMessage, } from '../../../../CaseManagement/OpenShiftClusterId';
|
|
23
|
+
import { fetchClusterIdDetails, OpenshiftDropdownV4 } from '../../../../CaseManagement/OpenshiftDropdownV4';
|
|
19
24
|
export function CaseOpenshiftClusterId() {
|
|
20
|
-
const { openshiftClusterID, caseNumber,
|
|
25
|
+
const { openshiftClusterID, product, version, caseNumber, openshiftClusterVersion, noClusterIdReason, noClusterIdReasonExplanation, selectedAccountDetails, } = useCaseSelector((state) => ({
|
|
21
26
|
openshiftClusterID: state.caseDetails.openshiftClusterID,
|
|
22
27
|
product: state.caseDetails.product,
|
|
28
|
+
version: state.caseDetails.version,
|
|
23
29
|
caseNumber: state.caseDetails.caseNumber,
|
|
30
|
+
openshiftClusterVersion: state.caseDetails.openshiftClusterVersion,
|
|
31
|
+
noClusterIdReason: state.caseDetails.noClusterIdReason,
|
|
32
|
+
noClusterIdReasonExplanation: state.caseDetails.noClusterIdReasonExplanation,
|
|
33
|
+
selectedAccountDetails: state.selectedAccountDetails,
|
|
24
34
|
}), isEqual);
|
|
25
35
|
const caseDispatch = useCaseDispatch();
|
|
26
|
-
const {
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const [
|
|
36
|
+
const { globalMetadataState: { pcmConfig, allProducts, loggedInUserRights }, } = useContext(GlobalMetadataStateContext);
|
|
37
|
+
const majorVersion = (version && getVersion(version).major) || '';
|
|
38
|
+
const isOpenShiftV3 = majorVersion === '3';
|
|
39
|
+
const isCustomer = loggedInUserRights.data.isAccountSameAsLoggedInAccount(selectedAccountDetails.data.accountNumber);
|
|
40
|
+
const [showClusterId, setShowClusterId] = useState(false);
|
|
31
41
|
const [isClusterIdInvalid, setIsClusterIdInValid] = useState(false);
|
|
42
|
+
const [dontKnowSelected, setDontKnowSelected] = useState(false);
|
|
43
|
+
const [selectedReason, setSelectedReason] = useState('');
|
|
32
44
|
const [isFetchingClusterDetails, setIsFetchingClusterDetails] = useState(false);
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const clusterIdUpdate = (caseDetails) => __awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
setIsClusterIdUpdating(true);
|
|
42
|
-
try {
|
|
43
|
-
yield updateCaseDetails(caseDispatch, caseNumber, caseDetails);
|
|
44
|
-
setIsClusterIdUpdating(false);
|
|
45
|
-
ToastNotification.addSuccessMessage(t(`OpenShift Cluster ID has been successfully updated`));
|
|
46
|
-
}
|
|
47
|
-
catch (e) {
|
|
48
|
-
setIsClusterIdUpdating(false);
|
|
49
|
-
ToastNotification.addDangerMessage(t(`OpenShift Cluster ID failed to updated`));
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
const onClusterIdStateUpdate = (openshiftClusterInputIdState) => {
|
|
53
|
-
setOpenshiftClusterIDState(openshiftClusterInputIdState);
|
|
54
|
-
const isClusterIdInvalid = getIsClusterIdInvalid(openshiftClusterInputIdState);
|
|
55
|
-
setIsClusterIdInValid(isClusterIdInvalid);
|
|
56
|
-
};
|
|
57
|
-
const onClusterIdStateCancel = () => {
|
|
58
|
-
setOpenshiftClusterIDState(openshiftClusterID);
|
|
59
|
-
setIsClusterIdInValid(false);
|
|
45
|
+
const [localOpenshiftClusterIDState, setLocalOpenshiftClusterIDState] = useState(openshiftClusterID);
|
|
46
|
+
const [isClusterIdUpdating, setIsClusterIdUpdating] = useState(false);
|
|
47
|
+
const [isReasonUpdating, setIsReasonUpdating] = useState(false);
|
|
48
|
+
const { t } = useTranslation();
|
|
49
|
+
const clusterStateReset = () => {
|
|
50
|
+
setSelectedReason('');
|
|
51
|
+
setDontKnowSelected(false);
|
|
60
52
|
};
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
const isClusterIdInvalid = getIsClusterIdInvalid(openshiftClusterInputIdState);
|
|
64
|
-
setIsClusterIdInValid(isClusterIdInvalid);
|
|
65
|
-
if (isClusterIdInvalid || openshiftClusterInputIdState === openshiftClusterID)
|
|
53
|
+
const setClusterVersion = (openshiftClusterID, clusterDetails) => __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
if (!openshiftClusterID || getIsClusterIdInvalid(openshiftClusterID))
|
|
66
55
|
return;
|
|
67
|
-
|
|
68
|
-
if (
|
|
69
|
-
|
|
56
|
+
let openshiftClusterVersion;
|
|
57
|
+
if (clusterDetails && clusterDetails.external_id === openshiftClusterID && clusterDetails.openshift_version) {
|
|
58
|
+
openshiftClusterVersion = clusterDetails.openshift_version;
|
|
70
59
|
}
|
|
71
60
|
else {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
caseDetails.openshiftClusterVersion = (clusterDetails === null || clusterDetails === void 0 ? void 0 : clusterDetails.openshift_version) || '';
|
|
75
|
-
setIsFetchingClusterDetails(false);
|
|
61
|
+
const clusterDetails = yield fetchClusterIdDetails(openshiftClusterID);
|
|
62
|
+
openshiftClusterVersion = clusterDetails === null || clusterDetails === void 0 ? void 0 : clusterDetails.openshift_version;
|
|
76
63
|
}
|
|
77
|
-
|
|
78
|
-
setOpenshiftClusterIDState(openshiftClusterInputIdState);
|
|
64
|
+
setCaseDetails(caseDispatch, { openshiftClusterVersion });
|
|
79
65
|
});
|
|
80
66
|
useEffect(() => {
|
|
81
67
|
var _a;
|
|
82
68
|
const isClusterVisible = () => __awaiter(this, void 0, void 0, function* () {
|
|
83
69
|
var _b;
|
|
84
70
|
const hasCluster = yield isClusterIdEnabledForProduct(product, (_b = allProducts.data) === null || _b === void 0 ? void 0 : _b.productsResult);
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
71
|
+
setShowClusterId(hasCluster);
|
|
72
|
+
// when product changes from a product with cluster to a product without cluster, reset the clusterId
|
|
73
|
+
const isResetClusterID = (!hasCluster || isOpenShiftV3) && openshiftClusterID;
|
|
74
|
+
if (isResetClusterID) {
|
|
75
|
+
const caseDetails = {
|
|
76
|
+
openshiftClusterID: '',
|
|
77
|
+
noClusterIdReasonExplanation: '',
|
|
78
|
+
noClusterIdReason: '',
|
|
79
|
+
};
|
|
80
|
+
yield clusterIdUpdate(caseDetails, false);
|
|
81
|
+
setCaseDetails(caseDispatch, caseDetails);
|
|
89
82
|
}
|
|
90
83
|
});
|
|
91
|
-
if ((((_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult) || []).length
|
|
84
|
+
if ((((_a = allProducts.data) === null || _a === void 0 ? void 0 : _a.productsResult) || []).length) {
|
|
92
85
|
isClusterVisible();
|
|
93
86
|
}
|
|
94
87
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
95
|
-
}, [product, allProducts.data]);
|
|
96
|
-
|
|
97
|
-
|
|
88
|
+
}, [product, version, pcmConfig, allProducts.data]);
|
|
89
|
+
// user may change product and version we need to reset internal state
|
|
90
|
+
// context api state will be reset on parent component each time user changes product and version
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
clusterStateReset(); //=>
|
|
93
|
+
}, [product, version]);
|
|
94
|
+
/**
|
|
95
|
+
* Hook to make sure that if cluster id comes from session or someother source
|
|
96
|
+
* we also fetch the details for the cluster id so that we can have fields like cluster version while creating the case
|
|
97
|
+
*/
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
const isClusterIdInvalid = getIsClusterIdInvalid(openshiftClusterID);
|
|
100
|
+
setIsClusterIdInValid(isClusterIdInvalid);
|
|
101
|
+
if (openshiftClusterID && !isClusterIdInvalid && isEmpty(openshiftClusterVersion)) {
|
|
102
|
+
setClusterVersion(openshiftClusterID);
|
|
103
|
+
}
|
|
104
|
+
if (!isEmpty(noClusterIdReason)) {
|
|
105
|
+
setDontKnowSelected(true);
|
|
106
|
+
setSelectedReason('dont-have-id');
|
|
107
|
+
}
|
|
108
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
109
|
+
}, [noClusterIdReason, openshiftClusterID, openshiftClusterVersion]);
|
|
110
|
+
const clusterIdUpdate = (caseDetails, showToast = true) => __awaiter(this, void 0, void 0, function* () {
|
|
111
|
+
if (showToast)
|
|
112
|
+
setIsClusterIdUpdating(true);
|
|
113
|
+
try {
|
|
114
|
+
yield updateCaseDetails(caseDispatch, caseNumber, caseDetails);
|
|
115
|
+
if (showToast) {
|
|
116
|
+
setIsClusterIdUpdating(false);
|
|
117
|
+
ToastNotification.addSuccessMessage(t(`OpenShift Cluster ID has been successfully updated`));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
catch (e) {
|
|
121
|
+
if (showToast) {
|
|
122
|
+
setIsClusterIdUpdating(false);
|
|
123
|
+
ToastNotification.addDangerMessage(t(`OpenShift Cluster ID failed to updated`));
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
const onClusterIdSave = (selectedCluster) => __awaiter(this, void 0, void 0, function* () {
|
|
128
|
+
const selectedClusterId = selectedCluster === null || selectedCluster === void 0 ? void 0 : selectedCluster.external_id;
|
|
129
|
+
if (isEmpty(selectedClusterId))
|
|
98
130
|
return;
|
|
99
|
-
|
|
131
|
+
setLocalOpenshiftClusterIDState(selectedClusterId);
|
|
132
|
+
if (selectedClusterId === 'dont-have-id') {
|
|
133
|
+
setDontKnowSelected(true);
|
|
134
|
+
setSelectedReason(selectedClusterId);
|
|
135
|
+
setIsClusterIdInValid(false);
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
const isClusterIdInvalid = getIsClusterIdInvalid(selectedClusterId);
|
|
139
|
+
setIsClusterIdInValid(isClusterIdInvalid);
|
|
140
|
+
if (isClusterIdInvalid || selectedClusterId === openshiftClusterID)
|
|
141
|
+
return;
|
|
142
|
+
const caseDetails = {
|
|
143
|
+
openshiftClusterID: selectedClusterId,
|
|
144
|
+
noClusterIdReasonExplanation: '',
|
|
145
|
+
noClusterIdReason: '',
|
|
146
|
+
};
|
|
147
|
+
if (selectedCluster === null || selectedCluster === void 0 ? void 0 : selectedCluster.openshift_version) {
|
|
148
|
+
caseDetails.openshiftClusterVersion = selectedCluster.openshift_version;
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
setIsFetchingClusterDetails(true);
|
|
152
|
+
const clusterDetails = yield fetchClusterIdDetails(selectedClusterId);
|
|
153
|
+
caseDetails.openshiftClusterVersion = (clusterDetails === null || clusterDetails === void 0 ? void 0 : clusterDetails.openshift_version) || '';
|
|
154
|
+
setIsFetchingClusterDetails(false);
|
|
155
|
+
}
|
|
156
|
+
yield clusterIdUpdate(caseDetails);
|
|
157
|
+
setDontKnowSelected(false);
|
|
158
|
+
setSelectedReason('');
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
const clusterIdDropdownFormInstructions = () => {
|
|
162
|
+
const errorMessage = isClusterIdInvalid
|
|
163
|
+
? isInvalidErrorMessage()
|
|
164
|
+
: isEmpty(openshiftClusterID) && isEmpty(selectedReason)
|
|
165
|
+
? discoverV4ClusterIdLinkError()
|
|
166
|
+
: null;
|
|
167
|
+
const infoMessage = discoverV4ClusterIdLink();
|
|
168
|
+
return errorMessage ? errorMessage : infoMessage;
|
|
100
169
|
};
|
|
101
|
-
|
|
170
|
+
const onReasonExplanationInputBoxChanged = (explanationInput) => __awaiter(this, void 0, void 0, function* () {
|
|
171
|
+
explanationInput = (explanationInput || '').trim();
|
|
172
|
+
if (explanationInput) {
|
|
173
|
+
const caseDetails = {
|
|
174
|
+
noClusterIdReason: 'Other',
|
|
175
|
+
openshiftClusterID: '',
|
|
176
|
+
noClusterIdReasonExplanation: explanationInput,
|
|
177
|
+
};
|
|
178
|
+
try {
|
|
179
|
+
setCaseDetails(caseDispatch, { noClusterIdReasonExplanation: explanationInput });
|
|
180
|
+
yield clusterIdUpdate(caseDetails);
|
|
181
|
+
}
|
|
182
|
+
catch (e) {
|
|
183
|
+
setCaseDetails(caseDispatch, { noClusterIdReasonExplanation });
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
188
|
+
const debounceFn = useCallback(debounce(onReasonExplanationInputBoxChanged, 1000), []);
|
|
189
|
+
const onReasonChange = (reason) => __awaiter(this, void 0, void 0, function* () {
|
|
190
|
+
if (!reason || reason === noClusterIdReason)
|
|
191
|
+
return;
|
|
192
|
+
try {
|
|
193
|
+
setIsReasonUpdating(true);
|
|
194
|
+
const caseDetails = { openshiftClusterID: '', noClusterIdReason: reason, noClusterIdReasonExplanation: '' };
|
|
195
|
+
setCaseDetails(caseDispatch, { noClusterIdReason: reason });
|
|
196
|
+
yield clusterIdUpdate(caseDetails);
|
|
197
|
+
}
|
|
198
|
+
catch (e) {
|
|
199
|
+
setCaseDetails(caseDispatch, { noClusterIdReason });
|
|
200
|
+
}
|
|
201
|
+
setIsReasonUpdating(false);
|
|
202
|
+
});
|
|
203
|
+
const isInVaidNoClusterIdReason = isEmpty(noClusterIdReason) || (noClusterIdReason === 'Other' && isEmpty(noClusterIdReasonExplanation.trim()));
|
|
204
|
+
if (!showClusterId || isOpenShiftV3)
|
|
102
205
|
return null;
|
|
103
|
-
return (React.createElement(
|
|
206
|
+
return (React.createElement(React.Fragment, null,
|
|
207
|
+
React.createElement(OpenshiftDropdownV4, { openshiftClusterIDState: localOpenshiftClusterIDState || selectedReason, onClusterIdStateUpdate: onClusterIdSave, isClusterIdInvalid: (isEmpty(localOpenshiftClusterIDState) && isEmpty(selectedReason)) || isClusterIdInvalid, clusterIdDropdownFormInstructions: clusterIdDropdownFormInstructions(), onClusterClear: () => setLocalOpenshiftClusterIDState(''), isV4: true, isDisabled: isClusterIdUpdating || isFetchingClusterDetails }),
|
|
208
|
+
(dontKnowSelected || noClusterIdReasonExplanation || noClusterIdReason) && (React.createElement(NoClusterIDReasonSelector, { noClusterIdReasonExplanation: noClusterIdReasonExplanation, noClusterIdReason: noClusterIdReason, onReasonInputBoxChanged: debounceFn, onReasonChange: onReasonChange, isInValid: isInVaidNoClusterIdReason, isCustomer: isCustomer, isDisabled: isReasonUpdating || isFetchingClusterDetails })),
|
|
209
|
+
React.createElement(LoadingIndicator, { show: isClusterIdUpdating, size: "xs" })));
|
|
104
210
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Summary.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/Summary.tsx"],"names":[],"mappings":"AAYA,UAAU,MAAM;IACZ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAOD,iBAAS,OAAO,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Summary.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CaseEditView/Tabs/CaseDetails/Summary.tsx"],"names":[],"mappings":"AAYA,UAAU,MAAM;IACZ,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAOD,iBAAS,OAAO,CAAC,KAAK,EAAE,MAAM,eAgI7B;kBAhIQ,OAAO;;;AAmIhB,eAAe,OAAO,CAAC"}
|
|
@@ -39,9 +39,11 @@ function Summary(props) {
|
|
|
39
39
|
const [localSummaryChange, setLocalSummaryChange] = useState(false);
|
|
40
40
|
const afterLocalChange = () => setLocalSummaryChange(false);
|
|
41
41
|
const getSummaryChangedTT = () => React.createElement(Trans, null, "Summary has been updated");
|
|
42
|
+
// Function to check if Invalid when input is non-focused
|
|
42
43
|
const onSummaryBlur = (e) => {
|
|
43
44
|
setIsSummaryInValid(isEmpty(e.target.value));
|
|
44
45
|
};
|
|
46
|
+
// Function to handle when summary changes
|
|
45
47
|
const onSummaryChange = (e) => {
|
|
46
48
|
if (canEditCase.alert())
|
|
47
49
|
return;
|
|
@@ -93,7 +95,7 @@ function Summary(props) {
|
|
|
93
95
|
React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")), allowInlineEdit: props.inlineEditable, content: summary, onSave: onSave, onCancel: onCancel, saveDisabled: isSummaryInValid ||
|
|
94
96
|
hasLargeSummary ||
|
|
95
97
|
summaryState === summary ||
|
|
96
|
-
(isSummaryUpdating && !isSummaryInValid), hideLabel: props.hideLabel, loadingIndicator: isSummaryUpdating && !isSummaryInValid ? React.createElement(LoadingIndicator, { isInline: true }) : null },
|
|
98
|
+
(isSummaryUpdating && !isSummaryInValid), hideLabel: props.hideLabel, loadingIndicator: isSummaryUpdating && !isSummaryInValid ? React.createElement(LoadingIndicator, { isInline: true }) : null, isSpaceAllowed: false, inputValue: summaryState },
|
|
97
99
|
React.createElement("input", { type: "text", id: "case-details-summary", className: `form-control${isSummaryInValid || hasLargeSummary ? ' form-invalid' : ''}`, "aria-invalid": isSummaryInValid, "aria-required": true, required: true, name: "case-details-summary", value: summaryState, onChange: onSummaryChange, onBlur: onSummaryBlur, disabled: isSummaryUpdating, "data-tracking-id": "case-details-summary" }),
|
|
98
100
|
hasLargeSummary && React.createElement("p", { className: "form-instructions" }, maxLengthErrorMessage)));
|
|
99
101
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cep.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/Cep.tsx"],"names":[],"mappings":"AAyBA,UAAU,MAAM;CAAG;AAEnB,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Cep.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/Cep.tsx"],"names":[],"mappings":"AAyBA,UAAU,MAAM;CAAG;AAEnB,wBAAgB,GAAG,CAAC,KAAK,EAAE,MAAM,eAuRhC"}
|
|
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { Modal, ModalVariant, Popover, PopoverPosition } from '@patternfly/react-core';
|
|
11
|
-
import { LoadingIndicator,
|
|
11
|
+
import { Input, LoadingIndicator, TextAreaResizable, ToastNotification, useConfirmation } from '@rh-support/components';
|
|
12
12
|
import { GlobalMetadataStateContext, useCanEditCase } from '@rh-support/react-context';
|
|
13
13
|
import { AbilityContext, CaseListFields, resourceActions, resources } from '@rh-support/user-permissions';
|
|
14
14
|
import isEmpty from 'lodash/isEmpty';
|
|
@@ -94,17 +94,17 @@ export function Cep(props) {
|
|
|
94
94
|
setCaseState(caseDispatch, { cepDetails: cepDetailsLocal });
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
|
-
const onCepContactNameChange = (
|
|
98
|
-
setCepDetailsLocal(Object.assign(Object.assign({}, cepDetailsLocal), { contactName:
|
|
97
|
+
const onCepContactNameChange = (value) => {
|
|
98
|
+
setCepDetailsLocal(Object.assign(Object.assign({}, cepDetailsLocal), { contactName: value }));
|
|
99
99
|
};
|
|
100
|
-
const onCepWorkingHoursChange = (
|
|
101
|
-
setCepDetailsLocal(Object.assign(Object.assign({}, cepDetailsLocal), { workingHours:
|
|
100
|
+
const onCepWorkingHoursChange = (value) => {
|
|
101
|
+
setCepDetailsLocal(Object.assign(Object.assign({}, cepDetailsLocal), { workingHours: value }));
|
|
102
102
|
};
|
|
103
|
-
const onCepContactInformationsChange = (
|
|
104
|
-
setCepDetailsLocal(Object.assign(Object.assign({}, cepDetailsLocal), { contactInformation:
|
|
103
|
+
const onCepContactInformationsChange = (value) => {
|
|
104
|
+
setCepDetailsLocal(Object.assign(Object.assign({}, cepDetailsLocal), { contactInformation: value }));
|
|
105
105
|
};
|
|
106
|
-
const onCepNotesChange = (
|
|
107
|
-
setCepDetailsLocal(Object.assign(Object.assign({}, cepDetailsLocal), { notes:
|
|
106
|
+
const onCepNotesChange = (value) => {
|
|
107
|
+
setCepDetailsLocal(Object.assign(Object.assign({}, cepDetailsLocal), { notes: value }));
|
|
108
108
|
};
|
|
109
109
|
const isSubmitButtonDisabled = isEmpty(cepDetailsLocal.contactName) ||
|
|
110
110
|
isEmpty(cepDetailsLocal.workingHours) ||
|
|
@@ -136,7 +136,7 @@ export function Cep(props) {
|
|
|
136
136
|
React.createElement(Trans, null, "Contact name"),
|
|
137
137
|
"\u00A0",
|
|
138
138
|
React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
|
|
139
|
-
React.createElement(
|
|
139
|
+
React.createElement(Input, { type: "text", id: "cep-contact-name", className: `form-control`, "aria-required": true, isRequired: true, maxLength: 254, ariaLabel: t('cep-contact-name'), onChange: onCepContactNameChange, isSpaceAllowed: false }),
|
|
140
140
|
React.createElement("p", { className: "form-instructions" },
|
|
141
141
|
React.createElement(Trans, null, "Provide main contact(s) troubleshooting the issue."))),
|
|
142
142
|
React.createElement("div", { className: "form-group" },
|
|
@@ -144,7 +144,7 @@ export function Cep(props) {
|
|
|
144
144
|
React.createElement(Trans, null, "Availability/Working hours"),
|
|
145
145
|
"\u00A0",
|
|
146
146
|
React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
|
|
147
|
-
React.createElement(
|
|
147
|
+
React.createElement(Input, { type: "text", id: "cep-workingHours", className: `form-control`, "aria-required": true, isRequired: true, maxLength: 254, placeholder: 'M-F 9:00am - 5:00pm EDT', ariaLabel: t('cep-workingHours'), onChange: onCepWorkingHoursChange, isSpaceAllowed: false }),
|
|
148
148
|
React.createElement("p", { className: "form-instructions" },
|
|
149
149
|
React.createElement(Trans, null, "Indicate working hours, time zone; specify if not available on certain dates (i.e. weekends, holidays)."))),
|
|
150
150
|
React.createElement("div", { className: "form-group" },
|
|
@@ -152,13 +152,13 @@ export function Cep(props) {
|
|
|
152
152
|
React.createElement(Trans, null, "Contact information"),
|
|
153
153
|
"\u00A0",
|
|
154
154
|
React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
|
|
155
|
-
React.createElement(
|
|
155
|
+
React.createElement(TextAreaResizable, { id: "cep-contactInformation", className: `form-control`, "aria-required": true, required: true, maxLength: 2000, name: "cep-contactInformation", value: cepDetailsLocal.contactInformation, onChange: onCepContactInformationsChange, "aria-label": "auto resizing text area example", isSpaceAllowed: false, autoResize: true }),
|
|
156
156
|
React.createElement("p", { className: "form-instructions" },
|
|
157
157
|
React.createElement(Trans, null, "Please provide phone number, chat ID or email."))),
|
|
158
158
|
React.createElement("div", { className: "form-group" },
|
|
159
159
|
React.createElement("label", { htmlFor: "cep-notes" },
|
|
160
160
|
React.createElement(Trans, null, "Notes")),
|
|
161
|
-
React.createElement(
|
|
161
|
+
React.createElement(TextAreaResizable, { id: "cep-notes", className: `form-control`, "aria-required": true, required: true, maxLength: 2000, name: "cep-notese", value: cepDetailsLocal.notes, onChange: onCepNotesChange, isSpaceAllowed: false, autoResize: true }),
|
|
162
162
|
React.createElement("p", { className: "form-instructions" },
|
|
163
163
|
React.createElement(Trans, null, "Provide any pertinent information that Red Hat Support should be aware of that's not already captured in the issue statement or comments.")))))));
|
|
164
164
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NoClusterIDReasonSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/NoClusterIDReasonSelector.tsx"],"names":[],"mappings":"AAcA,UAAU,MAAM;IACZ,uBAAuB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,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;
|
|
1
|
+
{"version":3,"file":"NoClusterIDReasonSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/NoClusterIDReasonSelector.tsx"],"names":[],"mappings":"AAcA,UAAU,MAAM;IACZ,uBAAuB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,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;AA0BD,QAAA,MAAM,yBAAyB,UAAW,MAAM,gBAsI/C,CAAC;AAEF,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
|
|
@@ -95,7 +95,7 @@ const NoClusterIDReasonSelector = (props) => {
|
|
|
95
95
|
React.createElement("label", { id: titleId },
|
|
96
96
|
React.createElement(Trans, null, "I don't have my Cluster ID, because:"),
|
|
97
97
|
React.createElement("span", { className: "form-required", "aria-hidden": true }, "*")),
|
|
98
|
-
React.createElement(Select, { variant: SelectVariant.typeahead, typeAheadAriaLabel: t('Select an option or briefly describe your reason'), onToggle: onToggle, onSelect: onSelect,
|
|
98
|
+
React.createElement(Select, { variant: SelectVariant.typeahead, typeAheadAriaLabel: t('Select an option or briefly describe your reason'), onToggle: onToggle, onSelect: onSelect, selections: getSelectedItem(), isOpen: isOpen, placeholderText: t('Select an option or briefly describe your reason'), noValidate: props.isInValid, "aria-labelledby": titleId, "aria-invalid": props.isInValid, "aria-describedby": "validate-reason-helper", validated: validated, className: `form-control${props.isInValid ? ' form-invalid' : ''}`, isDisabled: caseNoClusterIdReasons.isFetching || props.isDisabled, required: true, onFilter: () => null, ref: selectRef, onTypeaheadInputChanged: onTypeaheadInputChanged }, (caseNoClusterIdReasonsList || []).map((option, index) => (React.createElement(SelectOption, { key: index, value: createState(option, t(option)) })))),
|
|
99
99
|
React.createElement(LoadingIndicator, { show: caseNoClusterIdReasons.isFetching, size: "xs" }),
|
|
100
100
|
React.createElement("p", { id: "validate-reason-helper", className: `form-instructions ${props.isInValid ? 'form-invalid' : ''}` },
|
|
101
101
|
React.createElement(React.Fragment, null,
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
export declare const v3Tov4TransitionLink: () => JSX.Element;
|
|
2
|
+
export declare const discoverV4ClusterIdLink: () => JSX.Element;
|
|
3
|
+
export declare const discoverV4ClusterIdLinkError: () => JSX.Element;
|
|
4
|
+
export declare const isInvalidErrorMessage: () => JSX.Element;
|
|
2
5
|
export declare function OpenShiftClusterId(): JSX.Element;
|
|
3
6
|
//# sourceMappingURL=OpenShiftClusterId.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenShiftClusterId.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenShiftClusterId.tsx"],"names":[],"mappings":"AAwBA,eAAO,MAAM,oBAAoB,mBAShC,CAAC;
|
|
1
|
+
{"version":3,"file":"OpenShiftClusterId.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenShiftClusterId.tsx"],"names":[],"mappings":"AAwBA,eAAO,MAAM,oBAAoB,mBAShC,CAAC;AAEF,eAAO,MAAM,uBAAuB,mBAInC,CAAC;AAEF,eAAO,MAAM,4BAA4B,mBAKxC,CAAC;AAEF,eAAO,MAAM,qBAAqB,mBAIjC,CAAC;AAEF,wBAAgB,kBAAkB,gBAsRjC"}
|
|
@@ -27,14 +27,14 @@ import { fetchClusterIdDetails, OpenshiftDropdownV4 } from './OpenshiftDropdownV
|
|
|
27
27
|
import { OpenShiftV3Inputbox } from './OpenShiftV3Inputbox';
|
|
28
28
|
export const v3Tov4TransitionLink = () => (React.createElement("a", { className: "show-target", href: "https://access.redhat.com/documentation/en-us/openshift_container_platform/4.8/html-single/migrating_from_openshift_container_platform_3_to_4/index", target: "_blank", rel: "noopener noreferrer" },
|
|
29
29
|
React.createElement(Trans, null, "How to transition from v3 to v4?")));
|
|
30
|
-
const discoverV4ClusterIdLink = () => (React.createElement("a", { className: "show-target", href: "/solutions/4505861", target: "_blank", rel: "noopener noreferrer" },
|
|
30
|
+
export const discoverV4ClusterIdLink = () => (React.createElement("a", { className: "show-target", href: "/solutions/4505861", target: "_blank", rel: "noopener noreferrer" },
|
|
31
31
|
React.createElement(Trans, null, "How do I determine my OpenShift 4.x Cluster ID?")));
|
|
32
|
-
const discoverV4ClusterIdLinkError = () => (React.createElement(React.Fragment, null,
|
|
32
|
+
export const discoverV4ClusterIdLinkError = () => (React.createElement(React.Fragment, null,
|
|
33
33
|
React.createElement(ExclamationCircleIcon, { color: "#c9190b", className: "pf-u-mr-sm" }),
|
|
34
34
|
React.createElement(Trans, null, "Required field."),
|
|
35
35
|
" ",
|
|
36
36
|
discoverV4ClusterIdLink()));
|
|
37
|
-
const isInvalidErrorMessage = () => (React.createElement(React.Fragment, null,
|
|
37
|
+
export const isInvalidErrorMessage = () => (React.createElement(React.Fragment, null,
|
|
38
38
|
React.createElement(Trans, null, "Cluster Id is not valid. "),
|
|
39
39
|
" ",
|
|
40
40
|
discoverV4ClusterIdLink()));
|
|
@@ -7,6 +7,7 @@ interface IProps extends IDClassNameProps {
|
|
|
7
7
|
clusterIdDropdownFormInstructions?: JSX.Element;
|
|
8
8
|
onClusterClear: () => void;
|
|
9
9
|
isV4: boolean;
|
|
10
|
+
isDisabled?: boolean;
|
|
10
11
|
}
|
|
11
12
|
declare const fetchClusterIdDetails: (clusterId: string) => Promise<ICluster>;
|
|
12
13
|
declare function OpenshiftDropdownV4(props: IProps): JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenshiftDropdownV4.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenshiftDropdownV4.tsx"],"names":[],"mappings":"AACA,OAAO,EAAsB,QAAQ,EAAqB,MAAM,iBAAiB,CAAC;AAElF,OAAO,EAAE,gBAAgB,EAAuB,MAAM,0BAA0B,CAAC;AAUjF,UAAU,MAAO,SAAQ,gBAAgB;IACrC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7E,kBAAkB,EAAE,OAAO,CAAC;IAC5B,iCAAiC,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAChD,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,IAAI,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"OpenshiftDropdownV4.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenshiftDropdownV4.tsx"],"names":[],"mappings":"AACA,OAAO,EAAsB,QAAQ,EAAqB,MAAM,iBAAiB,CAAC;AAElF,OAAO,EAAE,gBAAgB,EAAuB,MAAM,0BAA0B,CAAC;AAUjF,UAAU,MAAO,SAAQ,gBAAgB;IACrC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7E,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;CACxB;AAcD,QAAA,MAAM,qBAAqB,cAAqB,MAAM,sBASrD,CAAC;AAeF,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,eA6OzC;kBA7OQ,mBAAmB;;;AAgP5B,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -20,6 +20,7 @@ import CaseOpenShiftPopover from '../CaseEditView/Tabs/CaseDetails/CaseOpenshift
|
|
|
20
20
|
const defaultProps = {
|
|
21
21
|
className: '',
|
|
22
22
|
id: '',
|
|
23
|
+
isDisabled: false,
|
|
23
24
|
};
|
|
24
25
|
const fetchClusterIdDetails = (clusterId) => __awaiter(void 0, void 0, void 0, function* () {
|
|
25
26
|
try {
|
|
@@ -112,7 +113,6 @@ function OpenshiftDropdownV4(props) {
|
|
|
112
113
|
]
|
|
113
114
|
: []),
|
|
114
115
|
React.createElement(SelectOption, { key: 'dont-have-id', value: createState('dont-have-id', t("I don't have my Cluster ID")) }),
|
|
115
|
-
...(clusterOptions.length !== 0 ? [React.createElement(Divider, { component: "div", key: 'cluster-id-last-divider' })] : []),
|
|
116
116
|
];
|
|
117
117
|
};
|
|
118
118
|
const fetchAccountClusters = (search = '') => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -197,7 +197,7 @@ function OpenshiftDropdownV4(props) {
|
|
|
197
197
|
React.createElement("span", { className: "form-required", "aria-hidden": true }, "*"),
|
|
198
198
|
React.createElement(CaseOpenShiftPopover, null)),
|
|
199
199
|
React.createElement("span", { id: titleId, hidden: true }, "Select a state"),
|
|
200
|
-
React.createElement(Select, Object.assign({ variant: SelectVariant.typeahead, typeAheadAriaLabel: t('Search by Cluster ID, alias, and domain or manually enter your Cluster ID'), onToggle: onToggle, onSelect: onSelect, onClear: onDropdownClear, selections: getSelectedItem(), isOpen: isOpen, "aria-labelledby": titleId, placeholderText: t('Search by Cluster ID, alias, and domain or manually enter your Cluster ID'), hasInlineFilter: false, onTypeaheadInputChanged: onTypeaheadInputChanged, onFilter: () => undefined, validated: validated, "aria-invalid": props.isClusterIdInvalid, "aria-describedby": "clusterID-validate-helper", required: true }, (isFetchingClusters && { loadingVariant: 'spinner' }), (!isFetchingClusters &&
|
|
200
|
+
React.createElement(Select, Object.assign({ variant: SelectVariant.typeahead, isDisabled: props.isDisabled, typeAheadAriaLabel: t('Search by Cluster ID, alias, and domain or manually enter your Cluster ID'), onToggle: onToggle, onSelect: onSelect, onClear: onDropdownClear, selections: getSelectedItem(), isOpen: isOpen, "aria-labelledby": titleId, placeholderText: t('Search by Cluster ID, alias, and domain or manually enter your Cluster ID'), hasInlineFilter: false, onTypeaheadInputChanged: onTypeaheadInputChanged, onFilter: () => undefined, validated: validated, "aria-invalid": props.isClusterIdInvalid, "aria-describedby": "clusterID-validate-helper", required: true }, (isFetchingClusters && { loadingVariant: 'spinner' }), (!isFetchingClusters &&
|
|
201
201
|
PER_PAGE <= clustersRawResponse.length && {
|
|
202
202
|
loadingVariant: {
|
|
203
203
|
text: 'Display additional results',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsideResults.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/AsideResults.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AsideResults.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/AsideResults.tsx"],"names":[],"mappings":"AAgCA,wBAAgB,YAAY,gBAmL3B"}
|