@rh-support/troubleshoot 0.2.87 → 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.
Files changed (24) hide show
  1. package/lib/esm/components/CaseEditView/ConfirmationModals/ReopenCaseModal.js +2 -2
  2. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.d.ts.map +1 -1
  3. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.js +169 -63
  4. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts +1 -0
  5. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.d.ts.map +1 -1
  6. package/lib/esm/components/CaseManagement/NoClusterIDReasonSelector.js +1 -1
  7. package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts +3 -0
  8. package/lib/esm/components/CaseManagement/OpenShiftClusterId.d.ts.map +1 -1
  9. package/lib/esm/components/CaseManagement/OpenShiftClusterId.js +3 -3
  10. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts +1 -0
  11. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.d.ts.map +1 -1
  12. package/lib/esm/components/CaseManagement/OpenshiftDropdownV4.js +2 -2
  13. package/lib/esm/components/Recommendations/ClusterRecommendationItems.d.ts.map +1 -1
  14. package/lib/esm/components/Recommendations/ClusterRecommendationItems.js +1 -1
  15. package/lib/esm/components/shared/Constants.d.ts +8 -4
  16. package/lib/esm/components/shared/Constants.d.ts.map +1 -1
  17. package/lib/esm/components/shared/Constants.js +8 -4
  18. package/lib/esm/reducers/CaseReducer.d.ts.map +1 -1
  19. package/lib/esm/reducers/CaseReducer.js +2 -0
  20. package/lib/esm/scss/_main.scss +13 -0
  21. package/package.json +8 -8
  22. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftDropdownV4.d.ts +0 -22
  23. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftDropdownV4.d.ts.map +0 -1
  24. package/lib/esm/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftDropdownV4.js +0 -228
@@ -64,9 +64,9 @@ export function ReopenCaseModal(props) {
64
64
  onDropdownToggle(false);
65
65
  };
66
66
  const isDescriptionEmpty = isEmpty(reopenDescription === null || reopenDescription === void 0 ? void 0 : reopenDescription.trim());
67
- return (React.createElement(Modal, { id: "case-reopen-modal", title: t(`Re-opening case ${props.caseNumber}`), "aria-describedby": "case-reopen-modal", isOpen: true, onClose: props.onClose, showClose: true, actions: [
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
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, "Re-open case")),
69
+ React.createElement(Trans, null, "Reopen case")),
70
70
  React.createElement(Button, { key: "close-modal", variant: ButtonVariant.secondary, onClick: props.onClose, isDisabled: props.isUpdating, "data-tracking-id": "reopen-case-description-modal-cancel" },
71
71
  React.createElement(Trans, null, "Cancel")),
72
72
  ], variant: ModalVariant.medium },
@@ -1 +1 @@
1
- {"version":3,"file":"CaseOpenshiftClusterId.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftClusterId.tsx"],"names":[],"mappings":"AAaA,wBAAgB,sBAAsB,gBA8GrC"}
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, useCanEditCase } from '@rh-support/react-context';
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 { CaseOpenshiftDropdownV4, fetchClusterIdDetails } from './CaseOpenshiftDropdownV4';
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, product } = useCaseSelector((state) => ({
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 { t } = useTranslation();
27
- const { globalMetadataState: { allProducts }, } = useContext(GlobalMetadataStateContext);
28
- const [isClusterIdUpdating, setIsClusterIdUpdating] = useState(false);
29
- const [showSection, setShowSection] = useState(false);
30
- const [openshiftClusterIDState, setOpenshiftClusterIDState] = useState(openshiftClusterID);
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 canEditCase = useCanEditCase();
34
- useEffect(() => {
35
- if (openshiftClusterIDState !== openshiftClusterID) {
36
- setOpenshiftClusterIDState(openshiftClusterIDState);
37
- }
38
- // eslint-disable-next-line react-hooks/exhaustive-deps
39
- }, [openshiftClusterID]);
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 onClusterIdSave = (selectedCluster) => __awaiter(this, void 0, void 0, function* () {
62
- const openshiftClusterInputIdState = selectedCluster === null || selectedCluster === void 0 ? void 0 : selectedCluster.external_id;
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
- const caseDetails = { openshiftClusterID: openshiftClusterInputIdState };
68
- if (selectedCluster === null || selectedCluster === void 0 ? void 0 : selectedCluster.openshift_version) {
69
- caseDetails.openshiftClusterVersion = selectedCluster.openshift_version;
56
+ let openshiftClusterVersion;
57
+ if (clusterDetails && clusterDetails.external_id === openshiftClusterID && clusterDetails.openshift_version) {
58
+ openshiftClusterVersion = clusterDetails.openshift_version;
70
59
  }
71
60
  else {
72
- setIsFetchingClusterDetails(true);
73
- const clusterDetails = yield fetchClusterIdDetails(openshiftClusterInputIdState);
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
- yield clusterIdUpdate(caseDetails);
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
- setShowSection(hasCluster);
86
- if (!hasCluster && openshiftClusterID) {
87
- // reset the cluster id if product is changed and it's not visible for a product
88
- onClusterIdStateUpdate('');
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 > 0) {
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
- const onClusterIdChange = (selectedCluster) => {
97
- if (canEditCase.alert())
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
- onClusterIdStateUpdate(selectedCluster.external_id);
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
- if (!showSection)
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(CaseOpenshiftDropdownV4, { isClusterIdUpdating: isClusterIdUpdating || isFetchingClusterDetails, originalOpenshiftClusterID: openshiftClusterID, openshiftClusterIDState: openshiftClusterIDState, onClusterIdStateUpdate: onClusterIdChange, onClusterIdSave: onClusterIdSave, onClusterIdClear: onClusterIdSave, onClusterIdCancel: onClusterIdStateCancel, onDropdownOuterClick: onClusterIdStateCancel, isClusterIdInvalid: isClusterIdInvalid, setIsClusterIdInValid: setIsClusterIdInValid }));
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
  }
@@ -5,6 +5,7 @@ interface IProps {
5
5
  noClusterIdReason: string;
6
6
  isInValid: boolean;
7
7
  isCustomer: boolean;
8
+ isDisabled?: boolean;
8
9
  }
9
10
  declare const NoClusterIDReasonSelector: (props: IProps) => JSX.Element;
10
11
  export { NoClusterIDReasonSelector };
@@ -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;CACvB;AA0BD,QAAA,MAAM,yBAAyB,UAAW,MAAM,gBAuI/C,CAAC;AAEF,OAAO,EAAE,yBAAyB,EAAE,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, onClear: clearSelection, 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, required: true, onFilter: () => null, ref: selectRef, onTypeaheadInputChanged: onTypeaheadInputChanged }, (caseNoClusterIdReasonsList || []).map((option, index) => (React.createElement(SelectOption, { key: index, value: createState(option, t(option)) })))),
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;AAqBF,wBAAgB,kBAAkB,gBAsRjC"}
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;CACjB;AAaD,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"}
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":"ClusterRecommendationItems.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/ClusterRecommendationItems.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oDAAoD,CAAC;AAe5F,UAAU,MAAM;IACZ,sBAAsB,EAAE,sBAAsB,EAAE,CAAC;CACpD;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,eA8FvD"}
1
+ {"version":3,"file":"ClusterRecommendationItems.d.ts","sourceRoot":"","sources":["../../../../src/components/Recommendations/ClusterRecommendationItems.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oDAAoD,CAAC;AAe5F,UAAU,MAAM;IACZ,sBAAsB,EAAE,sBAAsB,EAAE,CAAC;CACpD;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,eAiGvD"}
@@ -33,7 +33,7 @@ export function ClusterRecommendationItems(props) {
33
33
  React.createElement("h3", null, rule.description)),
34
34
  React.createElement("pfe-accordion-panel", null,
35
35
  React.createElement("p", null,
36
- React.createElement(Label, { color: riskLabels[rule.total_risk].color },
36
+ React.createElement(Label, { icon: riskLabels[rule.total_risk].icon, className: riskLabels[rule.total_risk].className },
37
37
  React.createElement(Trans, null, riskLabels[rule.total_risk].label))),
38
38
  React.createElement("p", null, rule.details || ''),
39
39
  rule.reason && (React.createElement(React.Fragment, null,
@@ -52,20 +52,24 @@ export declare const markdownInlineFileSelectEvent = "PCM-Next > Markdown-toolba
52
52
  export declare const markdownFilePasteEvent = "PCM-Next > Markdown-toolbar-file-paste";
53
53
  export declare const riskLabels: {
54
54
  1: {
55
+ icon: import("react").ComponentClass<import("@patternfly/react-icons/dist/js/createIcon").SVGIconProps, any>;
55
56
  label: string;
56
- color: string;
57
+ className: string;
57
58
  };
58
59
  2: {
60
+ icon: import("react").ComponentClass<import("@patternfly/react-icons/dist/js/createIcon").SVGIconProps, any>;
59
61
  label: string;
60
- color: string;
62
+ className: string;
61
63
  };
62
64
  3: {
65
+ icon: import("react").ComponentClass<import("@patternfly/react-icons/dist/js/createIcon").SVGIconProps, any>;
63
66
  label: string;
64
- color: string;
67
+ className: string;
65
68
  };
66
69
  4: {
70
+ icon: import("react").ComponentClass<import("@patternfly/react-icons/dist/js/createIcon").SVGIconProps, any>;
67
71
  label: string;
68
- color: string;
72
+ className: string;
69
73
  };
70
74
  };
71
75
  //# sourceMappingURL=Constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/Constants.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBA+BE;AAEF;;GAEG;AACH,oBAAY,iBAAiB;IACzB,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,IAAI,cAAc;IAClB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,sBAAsB;IAC3B,KAAK,UAAU;IACf,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,kBAAkB,yBAAyB;CAC9C;AAED,eAAO,MAAM,8BAA8B,oDAAoD,CAAC;AAEhG,eAAO,MAAM,oCAAoC,wDAAwD,CAAC;AAC1G,eAAO,MAAM,6BAA6B,4CAA4C,CAAC;AACvF,eAAO,MAAM,sBAAsB,2CAA2C,CAAC;AAE/E,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;CAKtB,CAAC"}
1
+ {"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/Constants.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wBA+BE;AAEF;;GAEG;AACH,oBAAY,iBAAiB;IACzB,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,IAAI,cAAc;IAClB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,sBAAsB;IAC3B,KAAK,UAAU;IACf,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,kBAAkB,yBAAyB;CAC9C;AAED,eAAO,MAAM,8BAA8B,oDAAoD,CAAC;AAEhG,eAAO,MAAM,oCAAoC,wDAAwD,CAAC;AAC1G,eAAO,MAAM,6BAA6B,4CAA4C,CAAC;AACvF,eAAO,MAAM,sBAAsB,2CAA2C,CAAC;AAE/E,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;CAKtB,CAAC"}
@@ -1,3 +1,7 @@
1
+ import AngleDoubleDownIcon from '@patternfly/react-icons/dist/js/icons/angle-double-down-icon';
2
+ import AngleDoubleUpIcon from '@patternfly/react-icons/dist/js/icons/angle-double-up-icon';
3
+ import CriticalRiskIcon from '@patternfly/react-icons/dist/js/icons/critical-risk-icon';
4
+ import EqualsIcon from '@patternfly/react-icons/dist/js/icons/equals-icon';
1
5
  export default {
2
6
  languagesMap: {
3
7
  en: 'English',
@@ -51,8 +55,8 @@ export const recsViewedFromNoAttachmentModalEvent = 'PCM-Next > No-Attachment-mo
51
55
  export const markdownInlineFileSelectEvent = 'PCM-Next > Markdown-toolbar-file-select';
52
56
  export const markdownFilePasteEvent = 'PCM-Next > Markdown-toolbar-file-paste';
53
57
  export const riskLabels = {
54
- 1: { label: 'Low', color: 'blue' },
55
- 2: { label: 'Moderate', color: 'orange' },
56
- 3: { label: 'Important', color: 'red' },
57
- 4: { label: 'Critical', color: 'red' },
58
+ 1: { icon: AngleDoubleDownIcon, label: 'Low', className: 'risk-label-low' },
59
+ 2: { icon: EqualsIcon, label: 'Moderate', className: 'risk-label-moderate' },
60
+ 3: { icon: AngleDoubleUpIcon, label: 'Important', className: 'risk-label-important' },
61
+ 4: { icon: CriticalRiskIcon, label: 'Critical', className: 'risk-label-critical' },
58
62
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CaseReducer.d.ts","sourceRoot":"","sources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kB,aAAc,uBAAuB,QAAQ,OAAO,SAKlF,CAAC"}
@@ -501,6 +501,8 @@ export const fetchCaseDetails = (dispatch, caseNumber, loggedInUserRights, refre
501
501
  secondCaseInactivityWarningSentAt: (data === null || data === void 0 ? void 0 : data.secondCaseInactivityWarningSentAt) || undefined,
502
502
  groupName: data.groupName || '',
503
503
  remoteSessionTermsAcked: (_h = data.remoteSessionTermsAcked) !== null && _h !== void 0 ? _h : false,
504
+ noClusterIdReason: data.noClusterIdReason || '',
505
+ noClusterIdReasonExplanation: data.noClusterIdReasonExplanation || '',
504
506
  };
505
507
  caseDetails.chats = data === null || data === void 0 ? void 0 : data.chats;
506
508
  caseDetails.comments = data === null || data === void 0 ? void 0 : data.comments;
@@ -935,3 +935,16 @@ div.pf-c-alert.ea-rule-alert > div.pf-c-alert__description > p {
935
935
  .anchor-tag-link-td-none {
936
936
  text-decoration: none;
937
937
  }
938
+
939
+ .risk-label-low {
940
+ background-color: var(--pf-global--palette--blue-300);
941
+ }
942
+ .risk-label-moderate {
943
+ background-color: var(--pf-global--palette--gold-400);
944
+ }
945
+ .risk-label-important {
946
+ background-color: var(--pf-global--palette--orange-300);
947
+ }
948
+ .risk-label-critical {
949
+ background-color: var(--pf-global--palette--red-200);
950
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "0.2.87",
3
+ "version": "0.2.88",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -28,11 +28,11 @@
28
28
  "peerDependencies": {
29
29
  "@cee-eng/hydrajs": "4.7.22",
30
30
  "@cee-eng/ui-toolkit": "1.1.6",
31
- "@patternfly/patternfly": "4.176.2",
31
+ "@patternfly/patternfly": "4.185.1",
32
32
  "@patternfly/pfe-accordion": "1.12.3",
33
33
  "@patternfly/pfe-collapse": "1.12.3",
34
34
  "@patternfly/pfe-tabs": "1.12.3",
35
- "@patternfly/react-core": "4.194.0",
35
+ "@patternfly/react-core": "4.202.16",
36
36
  "@rh-support/api": "0.3.9",
37
37
  "@rh-support/components": "^0.1.3",
38
38
  "@rh-support/react-context": "^0.1.3",
@@ -65,17 +65,17 @@
65
65
  "dependencies": {
66
66
  "@cee-eng/hydrajs": "4.7.22",
67
67
  "@cee-eng/ui-toolkit": "1.1.6",
68
- "@patternfly/patternfly": "4.176.2",
68
+ "@patternfly/patternfly": "4.185.1",
69
69
  "@patternfly/pfe-accordion": "1.12.3",
70
70
  "@patternfly/pfe-collapse": "1.12.3",
71
71
  "@patternfly/pfe-icon": "^1.12.3",
72
72
  "@patternfly/pfe-tabs": "1.12.3",
73
- "@patternfly/react-core": "4.194.0",
73
+ "@patternfly/react-core": "4.202.16",
74
74
  "@progress/kendo-drawing": "^1.6.0",
75
75
  "@progress/kendo-react-pdf": "^3.12.0",
76
76
  "@rh-support/api": "0.3.13",
77
- "@rh-support/components": "1.1.55",
78
- "@rh-support/react-context": "0.2.55",
77
+ "@rh-support/components": "1.1.56",
78
+ "@rh-support/react-context": "0.2.56",
79
79
  "@rh-support/types": "0.2.0",
80
80
  "@rh-support/user-permissions": "0.2.44",
81
81
  "@rh-support/utils": "0.2.33",
@@ -143,5 +143,5 @@
143
143
  "not ie <= 11",
144
144
  "not op_mini all"
145
145
  ],
146
- "gitHead": "a3df00d1fcf2e999400a0b17f5ac00f2a32d878d"
146
+ "gitHead": "981468e419f36c15d6039eaa49b52e6a180752a3"
147
147
  }
@@ -1,22 +0,0 @@
1
- import { ICluster } from '@rh-support/api';
2
- import { IDClassNameProps } from '@rh-support/types/shared';
3
- interface IProps extends IDClassNameProps {
4
- openshiftClusterIDState: string;
5
- onClusterIdStateUpdate: (cluster: Partial<ICluster>) => void;
6
- isClusterIdInvalid: boolean;
7
- setIsClusterIdInValid: (flag: boolean) => void;
8
- isClusterIdUpdating?: boolean;
9
- originalOpenshiftClusterID?: string;
10
- onClusterIdSave?: (cluster: Partial<ICluster>) => void;
11
- onClusterIdCancel?: (cluster: Partial<ICluster>) => void;
12
- onClusterIdClear?: (cluster: Partial<ICluster>) => void;
13
- onDropdownOuterClick?: (cluster: Partial<ICluster>) => void;
14
- formInstructions?: JSX.Element;
15
- }
16
- declare const fetchClusterIdDetails: (clusterId: string) => Promise<ICluster>;
17
- declare function CaseOpenshiftDropdownV4(props: IProps): JSX.Element;
18
- declare namespace CaseOpenshiftDropdownV4 {
19
- var defaultProps: {};
20
- }
21
- export { CaseOpenshiftDropdownV4, fetchClusterIdDetails };
22
- //# sourceMappingURL=CaseOpenshiftDropdownV4.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CaseOpenshiftDropdownV4.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/CaseEditView/Tabs/CaseDetails/CaseOpenshiftClusterId/CaseOpenshiftDropdownV4.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,QAAQ,EAAqB,MAAM,iBAAiB,CAAC;AAElF,OAAO,EAAE,gBAAgB,EAAqB,MAAM,0BAA0B,CAAC;AAa/E,UAAU,MAAO,SAAQ,gBAAgB;IACrC,uBAAuB,EAAE,MAAM,CAAC;IAChC,sBAAsB,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;IAC7D,kBAAkB,EAAE,OAAO,CAAC;IAC5B,qBAAqB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAE/C,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;IACvD,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;IACzD,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;IACxD,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;IAC5D,gBAAgB,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;CAClC;AAeD,QAAA,MAAM,qBAAqB,cAAqB,MAAM,sBASrD,CAAC;AAEF,iBAAS,uBAAuB,CAAC,KAAK,EAAE,MAAM,eAyS7C;kBAzSQ,uBAAuB;;;AA4ShC,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,CAAC"}
@@ -1,228 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { getAccountClusters } from '@rh-support/api';
11
- import { AsyncDropDownList, InlineEdit, LoadingIndicator, useFetch } from '@rh-support/components';
12
- import { toOption, toOptions } from '@rh-support/utils';
13
- import groupBy from 'lodash/groupBy';
14
- import React, { useEffect, useMemo, useRef, useState } from 'react';
15
- import { Trans, useTranslation } from 'react-i18next';
16
- import { getDisplayNameById, getDisplayNameForCluster, invalidGuidHelperText, } from '../../../../../utils/caseOpenshiftClusterIdUtils';
17
- import CaseOpenShiftPopover from './CaseOpenShiftPopover';
18
- const defaultProps = {
19
- originalOpenshiftClusterID: '',
20
- isClusterIdUpdating: false,
21
- className: '',
22
- id: '',
23
- };
24
- const fetchClusterIdDetails = (clusterId) => __awaiter(void 0, void 0, void 0, function* () {
25
- try {
26
- const clustersResponse = yield getAccountClusters({
27
- order: 'display_name asc',
28
- search: `external_id ILIKE '%${clusterId}%'`,
29
- });
30
- const clusterDetails = (clustersResponse.items || []).find((item) => item.external_id === clusterId);
31
- return clusterDetails;
32
- }
33
- catch (e) { }
34
- });
35
- function CaseOpenshiftDropdownV4(props) {
36
- const { t } = useTranslation();
37
- const inputRef = useRef(undefined);
38
- const PER_PAGE = 200;
39
- const { request: getAccountClustersRequest, isFetching: isFetchingClusters } = useFetch(getAccountClusters, {
40
- propgateErrors: true,
41
- });
42
- const [clusters, setClusters] = useState([]);
43
- const [clustersRawResponse, setClustersRawResponse] = useState([]);
44
- const [showClusterIdInputBox, setShowClusterIdInputBox] = useState(false);
45
- const [haveClusterFromApi, setHaveClusterFromApi] = useState(false);
46
- const abortControllerRef = useRef(undefined);
47
- const getClusterObj = (clusterId) => {
48
- const selectedCluster = clustersRawResponse.find((item) => item.external_id === clusterId) || {};
49
- return Object.assign({ external_id: clusterId }, selectedCluster);
50
- };
51
- const onInlineEditSave = () => __awaiter(this, void 0, void 0, function* () {
52
- haveClusterFromApi && setShowClusterIdInputBox(false);
53
- props.onClusterIdSave
54
- ? yield props.onClusterIdSave(getClusterObj(props.openshiftClusterIDState))
55
- : props.onClusterIdStateUpdate(getClusterObj(props.openshiftClusterIDState));
56
- });
57
- const onInlineEditCancel = () => {
58
- props.onClusterIdCancel
59
- ? props.onClusterIdCancel(getClusterObj(props.originalOpenshiftClusterID))
60
- : props.onClusterIdStateUpdate(getClusterObj(props.originalOpenshiftClusterID));
61
- haveClusterFromApi && setShowClusterIdInputBox(false);
62
- };
63
- const onInlineEditInputChange = (e) => {
64
- props.onClusterIdStateUpdate(getClusterObj(e.target.value));
65
- };
66
- const onDropdownClear = () => __awaiter(this, void 0, void 0, function* () {
67
- props.onClusterIdClear
68
- ? yield props.onClusterIdClear(getClusterObj(''))
69
- : props.onClusterIdStateUpdate(getClusterObj(''));
70
- });
71
- const onDropdownOuterClick = () => {
72
- props.onDropdownOuterClick
73
- ? props.onDropdownOuterClick(getClusterObj(props.openshiftClusterIDState))
74
- : props.onClusterIdStateUpdate(getClusterObj(props.openshiftClusterIDState));
75
- setShowClusterIdInputBox(false);
76
- };
77
- const onDropdownClusterChange = (selectedCluster) => __awaiter(this, void 0, void 0, function* () {
78
- if (selectedCluster.label === 'Not Listed') {
79
- notListed();
80
- return;
81
- }
82
- const openshiftClusterID = selectedCluster.value.external_id;
83
- props.onClusterIdSave
84
- ? props.onClusterIdSave(getClusterObj(openshiftClusterID))
85
- : props.onClusterIdStateUpdate(getClusterObj(openshiftClusterID));
86
- });
87
- const notListed = () => {
88
- setShowClusterIdInputBox(true);
89
- window.setTimeout(() => {
90
- var _a;
91
- (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
92
- }, 100);
93
- };
94
- const getClusterOptions = () => {
95
- const clusterOptions = [];
96
- const clustersResponseGrouped = groupBy(clusters, 'dns.base_domain');
97
- const domainNames = Object.keys(clustersResponseGrouped);
98
- // move undefined to the end of domains array
99
- const undefinedIndex = domainNames.findIndex((i) => i === 'undefined');
100
- if (undefinedIndex !== -1 && undefinedIndex !== domainNames.length - 1) {
101
- domainNames.splice(undefinedIndex, 1);
102
- domainNames.push('undefined');
103
- }
104
- for (let i = 0, max = domainNames.length; i < max; i++) {
105
- // add domain name
106
- clusterOptions.push({
107
- children: (React.createElement(React.Fragment, null,
108
- i !== 0 && React.createElement("div", { className: "pf-c-divider", role: "separator" }),
109
- domainNames[i] !== 'undefined' && (React.createElement("div", { className: "pf-u-font-weight-bold pf-u-ml-md pf-u-color-400 pf-u-mt-sm", "aria-hidden": "true" }, domainNames[i])))),
110
- isNonActionable: true,
111
- isNotSelectable: true,
112
- display_name: domainNames[i],
113
- });
114
- // add clusters under the domain name
115
- clustersResponseGrouped[domainNames[i]].forEach((item) => {
116
- clusterOptions.push({
117
- display_name: item.display_name,
118
- external_id: item.external_id,
119
- });
120
- });
121
- }
122
- return [
123
- {
124
- children: (React.createElement("button", { className: "cta-link" },
125
- React.createElement(Trans, null, "Cluster is not listed"))),
126
- isNotSearchable: true,
127
- display_name: 'Not Listed',
128
- },
129
- ...clusterOptions,
130
- ];
131
- };
132
- const fetchAccountClusters = (search = '', finalResult = PER_PAGE) => __awaiter(this, void 0, void 0, function* () {
133
- const page = finalResult / PER_PAGE;
134
- try {
135
- if (abortControllerRef.current !== undefined) {
136
- // Cancel the previous request
137
- abortControllerRef.current.abort();
138
- }
139
- // recreate a new AbortController for each call
140
- let controller = new AbortController();
141
- abortControllerRef.current = controller;
142
- // query language: https://github.com/yaacov/tree-search-language
143
- const clustersResponse = yield getAccountClustersRequest({
144
- order: 'display_name asc',
145
- page,
146
- size: PER_PAGE,
147
- search: `external_id ILIKE '%${search}%' OR display_name ILIKE '%${search}%' OR dns.base_domain ILIKE '%${search}%'`,
148
- }, controller.signal);
149
- const items = clustersResponse.items.map((item) => ({
150
- display_name: getDisplayNameForCluster(item),
151
- external_id: item.external_id,
152
- dns: item.dns,
153
- }));
154
- setClustersRawResponse(clustersResponse.items);
155
- return {
156
- items,
157
- totalResult: clustersResponse.total,
158
- page: clustersResponse.page,
159
- };
160
- }
161
- catch (e) {
162
- // silently fails
163
- setClustersRawResponse([]);
164
- return { items: [], totalResult: 0, page: 0 };
165
- }
166
- });
167
- const onPaginate = (shownResults, inputVal) => __awaiter(this, void 0, void 0, function* () {
168
- const fetchedClusters = yield fetchAccountClusters(inputVal, shownResults);
169
- setClusters([...clusters, ...fetchedClusters.items]);
170
- });
171
- useEffect(() => {
172
- let isUnmounted = false;
173
- const fetchClusters = () => __awaiter(this, void 0, void 0, function* () {
174
- const fetchedClusters = yield fetchAccountClusters();
175
- const totalResult = fetchedClusters.totalResult;
176
- if (!isUnmounted) {
177
- if (totalResult === 0) {
178
- setShowClusterIdInputBox(true);
179
- }
180
- else {
181
- setClusters(fetchedClusters.items);
182
- setHaveClusterFromApi(true);
183
- }
184
- }
185
- });
186
- fetchClusters();
187
- return () => {
188
- isUnmounted = true;
189
- };
190
- // eslint-disable-next-line react-hooks/exhaustive-deps
191
- }, []);
192
- const memoizedSelectedItem = useMemo(() => {
193
- return toOption({
194
- display_name: getDisplayNameById(clusters, props.openshiftClusterIDState),
195
- external_id: props.openshiftClusterIDState,
196
- }, { labelKey: 'display_name' });
197
- }, [props.openshiftClusterIDState, clusters]);
198
- const onSearch = (inputValue) => __awaiter(this, void 0, void 0, function* () {
199
- props.onClusterIdStateUpdate(inputValue);
200
- setClusters([]);
201
- const fetchedClusters = yield fetchAccountClusters(inputValue);
202
- setClusters([...fetchedClusters.items]);
203
- });
204
- return (React.createElement("div", { className: `${props.className} form-group` },
205
- (haveClusterFromApi || isFetchingClusters) && (React.createElement("label", { htmlFor: "case-details-cluster-nickname-selector" },
206
- React.createElement(Trans, null, "OpenShift Cluster ID"),
207
- React.createElement(CaseOpenShiftPopover, null))),
208
- !showClusterIdInputBox && (React.createElement(AsyncDropDownList, { placeholder: 'Search by Cluster ID, alias, and domain or manually enter your Cluster ID', id: "case-details-cluster-nickname-selector", selectedItem: memoizedSelectedItem, list: toOptions(getClusterOptions(), {
209
- labelKey: 'display_name',
210
- childrenKey: 'children',
211
- nonSearchableItemKey: 'isNotSearchable',
212
- nonActionableItemKey: 'isNonActionable',
213
- nonSelectableItemKey: 'isNotSelectable',
214
- }), title: t('Search by Cluster ID, alias, and domain or manually enter your Cluster ID'), onOuterClick: onDropdownOuterClick, onChange: onDropdownClusterChange, delay: 200, useCache: true, isLoadingList: isFetchingClusters || props.isClusterIdUpdating, paginate: true, onPaginate: onPaginate, maxResults: PER_PAGE, emptyListLabel: t('No results found'), onClearSelection: onDropdownClear, disabled: props.isClusterIdUpdating, onSearch: onSearch, isInValid: props.isClusterIdInvalid })),
215
- showClusterIdInputBox && (React.createElement(InlineEdit, { labelProps: { htmlFor: 'case-details-openshift-cluster-id' }, labelContent: React.createElement(React.Fragment, null,
216
- React.createElement(Trans, null, "OpenShift Cluster ID"),
217
- React.createElement(CaseOpenShiftPopover, null)), allowInlineEdit: true, content: props.openshiftClusterIDState, onSave: onInlineEditSave, onCancel: onInlineEditCancel, saveDisabled: props.isClusterIdUpdating ||
218
- props.isClusterIdInvalid ||
219
- props.openshiftClusterIDState === props.originalOpenshiftClusterID ||
220
- props.openshiftClusterIDState === '', initialIsEditing: true, hideLabel: haveClusterFromApi, collapseOnBlur: false, saveOnBlur: false, loadingIndicator: props.isClusterIdUpdating ? React.createElement(LoadingIndicator, { isInline: true }) : null },
221
- React.createElement("input", { ref: inputRef, type: "text", id: "case-details-openshift-cluster-id", className: `form-control${props.isClusterIdInvalid ? ' form-invalid' : ''}`, "aria-invalid": props.isClusterIdInvalid, name: "case-details-openshift-cluster-id", placeholder: "Example (d3aa88e2-c754-41e0-8ba6-4198a34aa0a2)", value: props.openshiftClusterIDState, onChange: onInlineEditInputChange, disabled: props.isClusterIdUpdating, title: props.isClusterIdInvalid ? t(invalidGuidHelperText) : '', "data-tracking-id": "case-details-openshift-cluster-id" }),
222
- props.formInstructions
223
- ? props.formInstructions
224
- : props.isClusterIdInvalid && React.createElement("p", { className: "form-instructions" }, t(invalidGuidHelperText)))),
225
- !showClusterIdInputBox && haveClusterFromApi && props.formInstructions));
226
- }
227
- CaseOpenshiftDropdownV4.defaultProps = defaultProps;
228
- export { CaseOpenshiftDropdownV4, fetchClusterIdDetails };