@rh-support/troubleshoot 0.4.0 → 0.4.1

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.
@@ -219,7 +219,7 @@ export function CaseOpenshiftClusterId() {
219
219
  }
220
220
  else {
221
221
  return (React.createElement(React.Fragment, null,
222
- React.createElement(OpenshiftDropdownV4, { openshiftDisplayName: displayName.current, openshiftClusterIDState: localOpenshiftClusterIDState || selectedReason, onClusterIdStateUpdate: onClusterIdSave, isClusterIdInvalid: (isEmpty(localOpenshiftClusterIDState) && isEmpty(selectedReason)) || isClusterIdInvalid, clusterIdDropdownFormInstructions: clusterIdDropdownFormInstructions(), onClusterClear: resetClusterData, isNotV3: majorVersion !== '3', isDisabled: isClusterIdUpdating, noClusterIdReasonExplanation: noClusterIdReasonExplanation }),
222
+ React.createElement(OpenshiftDropdownV4, { openshiftDisplayName: displayName.current, openshiftClusterIDState: localOpenshiftClusterIDState || selectedReason, onClusterIdStateUpdate: onClusterIdSave, isClusterIdInvalid: (isEmpty(localOpenshiftClusterIDState) && isEmpty(selectedReason)) || isClusterIdInvalid, clusterIdDropdownFormInstructions: clusterIdDropdownFormInstructions(), onClusterClear: resetClusterData, isV3: majorVersion === '3' || isNaN(parseInt(majorVersion)), isDisabled: isClusterIdUpdating, noClusterIdReasonExplanation: noClusterIdReasonExplanation }),
223
223
  noClusterIdReasonExplanation !== 'v3-cluster' &&
224
224
  (dontKnowSelected || noClusterIdReasonExplanation || noClusterIdReason) && (React.createElement(NoClusterIDReasonSelector, { noClusterIdReasonExplanation: noClusterIdReasonExplanation, noClusterIdReason: noClusterIdReason, onReasonInputBoxChanged: debounceFn, onReasonChange: onReasonChange, isInValid: isInVaidNoClusterIdReason, isCustomer: isCustomer, isDisabled: isReasonUpdating })),
225
225
  React.createElement(LoadingIndicator, { show: isClusterIdUpdating, size: "xs" })));
@@ -206,7 +206,7 @@ export function OpenShiftClusterId() {
206
206
  return null;
207
207
  return (React.createElement(React.Fragment, null,
208
208
  !isOpenShiftV3 && (React.createElement(OpenshiftDropdownV4, { openshiftDisplayName: openshiftDisplayName, openshiftClusterIDState: openshiftClusterID || selectedReason, onClusterIdStateUpdate: onClusterIdStateUpdate, isClusterIdInvalid: showValidationErrorAlert &&
209
- ((isEmpty(openshiftClusterID) && isEmpty(selectedReason)) || isClusterIdInvalid), clusterIdDropdownFormInstructions: clusterIdDropdownFormInstructions(), onClusterClear: resetClusterData, isNotV3: majorVersion !== '3' })),
209
+ ((isEmpty(openshiftClusterID) && isEmpty(selectedReason)) || isClusterIdInvalid), clusterIdDropdownFormInstructions: clusterIdDropdownFormInstructions(), onClusterClear: resetClusterData, isV3: majorVersion === '3' || isNaN(parseInt(majorVersion)) })),
210
210
  noClusterIdReasonExplanation !== 'v3-cluster' && dontKnowSelected && !isOpenShiftV3 && (React.createElement(NoClusterIDReasonSelector, { noClusterIdReasonExplanation: noClusterIdReasonExplanation, noClusterIdReason: noClusterIdReason, onReasonInputBoxChanged: onReasonExplanationInputBoxChanged, onReasonChange: onReasonChange, isInValid: isInVaidNoClusterIdReason, isCustomer: isCustomer })),
211
211
  (v3Selected || isOpenShiftV3) && (React.createElement(OpenShiftV3Inputbox, { v3ClusterName: v3ClusterName, onReasonInputBoxChanged: v3ClusterNameInputBoxChanged, isInValid: isEmpty(v3ClusterName.trim()) && showValidationErrorAlert, v3Selected: v3Selected }))));
212
212
  }
@@ -6,7 +6,7 @@ interface IProps extends IDClassNameProps {
6
6
  isClusterIdInvalid: boolean;
7
7
  clusterIdDropdownFormInstructions?: JSX.Element;
8
8
  onClusterClear: () => void;
9
- isNotV3: boolean;
9
+ isV3: boolean;
10
10
  isDisabled?: boolean;
11
11
  noClusterIdReasonExplanation?: string;
12
12
  openshiftDisplayName?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"OpenshiftDropdownV4.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseManagement/OpenshiftDropdownV4.tsx"],"names":[],"mappings":"AACA,OAAO,EA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,OAAO,CAAC;IACrB,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CACjC;AAuBD,iBAAS,mBAAmB,CAAC,KAAK,EAAE,MAAM,eA4WzC;kBA5WQ,mBAAmB;;;AA+W5B,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -99,7 +99,7 @@ function OpenshiftDropdownV4(props) {
99
99
  React.createElement(Checkbox, { label: t('Show archived clusters'), key: "show-archived-clusters", "aria-label": t('Show archived clusters'), id: "show-archived-clusters", "data-tracking-id": "show-hide-archived-clusters", isChecked: showArchivedClusters, className: "archived-clusters-checkbox" })),
100
100
  React.createElement(Divider, { component: "div", key: 'cluster-id-options-divider-e' }),
101
101
  React.createElement(SelectOption, { key: 'dont-have-id', value: createState('dont-have-id', t("I don't have my Cluster ID")) }),
102
- ...(!props.isNotV3
102
+ ...(props.isV3
103
103
  ? [
104
104
  React.createElement(SelectOption, { key: 'v3-cluster', value: createState('v3-cluster', t('The case is for a v3 cluster')) }),
105
105
  ]
@@ -231,7 +231,7 @@ function OpenshiftDropdownV4(props) {
231
231
  }, []);
232
232
  // need to get clusters when user opens the dropdown
233
233
  // as the api response is cached np extra call is made on open/close
234
- // added observing props.isNotV3 because re-render
234
+ // added observing props.isV3 because re-render
235
235
  // is needed when user on overview page changing version
236
236
  useEffect(() => {
237
237
  if (!isOpen)
@@ -251,7 +251,7 @@ function OpenshiftDropdownV4(props) {
251
251
  isUnmounted = true;
252
252
  };
253
253
  // eslint-disable-next-line react-hooks/exhaustive-deps
254
- }, [props.isNotV3, showArchivedClusters, isOpen, inputVal]);
254
+ }, [props.isV3, showArchivedClusters, isOpen, inputVal]);
255
255
  useEffect(() => {
256
256
  if (props.isClusterIdInvalid) {
257
257
  setValidated('error');
@@ -6,6 +6,5 @@ export interface IClusterSubscriptionExtended extends IClusterSubscription {
6
6
  export declare const getDisplayNameForCluster: (cluster: Partial<IClusterSubscriptionExtended>) => string;
7
7
  export declare const invalidGuidHelperText = "Please enter a valid Cluster ID (For example: d3aa88e2-c754-41e0-8ba6-4198a34aa0a2)";
8
8
  export declare const isClusterIdEnabledForProduct: (selectedProduct: string, allProducts: Partial<ISEProduct>[]) => boolean;
9
- export declare const isOpenShiftV3Product: (product: string, pcmConfig: any) => boolean;
10
9
  export declare const getIsClusterIdInvalid: (openshiftClusterID: any) => boolean;
11
10
  //# sourceMappingURL=caseOpenshiftClusterIdUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"caseOpenshiftClusterIdUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/caseOpenshiftClusterIdUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAIpE,MAAM,WAAW,4BAA6B,SAAQ,oBAAoB;IACtE,iBAAiB,EAAE,MAAM,CAAC;CAC7B;AAED,eAAO,MAAM,wBAAwB,YAAa,QAAQ,4BAA4B,CAAC,WAKtF,CAAC;AAEF,eAAO,MAAM,qBAAqB,wFACuD,CAAC;AAE1F,eAAO,MAAM,4BAA4B,oBAAqB,MAAM,eAAe,QAAQ,UAAU,CAAC,EAAE,YAIvG,CAAC;AAEF,eAAO,MAAM,oBAAoB,YAAa,MAAM,4BAenD,CAAC;AAEF,eAAO,MAAM,qBAAqB,sCACkC,CAAC"}
1
+ {"version":3,"file":"caseOpenshiftClusterIdUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/caseOpenshiftClusterIdUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAIpE,MAAM,WAAW,4BAA6B,SAAQ,oBAAoB;IACtE,iBAAiB,EAAE,MAAM,CAAC;CAC7B;AAED,eAAO,MAAM,wBAAwB,YAAa,QAAQ,4BAA4B,CAAC,WAKtF,CAAC;AAEF,eAAO,MAAM,qBAAqB,wFACuD,CAAC;AAE1F,eAAO,MAAM,4BAA4B,oBAAqB,MAAM,eAAe,QAAQ,UAAU,CAAC,EAAE,YAIvG,CAAC;AAEF,eAAO,MAAM,qBAAqB,sCACkC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { getConfigField, isValidGuid } from '@rh-support/utils';
1
+ import { isValidGuid } from '@rh-support/utils';
2
2
  import isEmpty from 'lodash/isEmpty';
3
3
  export const getDisplayNameForCluster = (cluster) => {
4
4
  if (isEmpty(cluster))
@@ -15,18 +15,4 @@ export const isClusterIdEnabledForProduct = (selectedProduct, allProducts) => {
15
15
  return false;
16
16
  return productDetails.openShiftClusterIdRelevantInCases;
17
17
  };
18
- export const isOpenShiftV3Product = (product, pcmConfig) => {
19
- var _a;
20
- if (isEmpty(product)) {
21
- return false;
22
- }
23
- let _isOpenShiftV3Product = false;
24
- const openShiftV3InfoTextProducts = getConfigField(pcmConfig.data, 'openShiftV3InfoTextProducts');
25
- if (openShiftV3InfoTextProducts) {
26
- ((_a = JSON.parse(openShiftV3InfoTextProducts[0])) === null || _a === void 0 ? void 0 : _a.products.findIndex((osProduct) => osProduct.toLowerCase() === product.toLowerCase())) > -1
27
- ? (_isOpenShiftV3Product = true)
28
- : (_isOpenShiftV3Product = false);
29
- }
30
- return _isOpenShiftV3Product;
31
- };
32
18
  export const getIsClusterIdInvalid = (openshiftClusterID) => !isEmpty(openshiftClusterID) && !isValidGuid(openshiftClusterID);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/troubleshoot",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -142,5 +142,5 @@
142
142
  "not ie <= 11",
143
143
  "not op_mini all"
144
144
  ],
145
- "gitHead": "a8d923cd016218bdddc33eb00705340cb6f63d57"
145
+ "gitHead": "9ec3db4f755eced3812b70aadaa81964dc186a01"
146
146
  }