@rh-support/troubleshoot 0.2.92 → 0.2.93-alpha-0
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/ImproveCase/Hostname.js +2 -1
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.d.ts.map +1 -1
- package/lib/esm/components/ProductSelector/ProductVersionDropdownSelector.js +3 -14
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.d.ts.map +1 -1
- package/lib/esm/components/wizardLayout/GlobalTroubleshootEffects.js +3 -12
- package/package.json +6 -6
|
@@ -13,7 +13,8 @@ export function Hostname(props) {
|
|
|
13
13
|
setCaseDetails(caseDispatch, caseDetails);
|
|
14
14
|
};
|
|
15
15
|
const onHostnameChange = (e) => {
|
|
16
|
-
|
|
16
|
+
var _a;
|
|
17
|
+
onCaseDetailsChange({ hostname: (_a = e.target.value) === null || _a === void 0 ? void 0 : _a.trim() });
|
|
17
18
|
};
|
|
18
19
|
if (!canUseHostName) {
|
|
19
20
|
return React.createElement(React.Fragment, null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductVersionDropdownSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductVersionDropdownSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAW,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"ProductVersionDropdownSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/ProductSelector/ProductVersionDropdownSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAW,MAAM,0BAA0B,CAAC;AAGrE,OAAO,KAAsD,MAAM,OAAO,CAAC;AAK3E,UAAU,MAAO,SAAQ,gBAAgB;IACrC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;IAChC,eAAe,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,GAAG,CAAC;IACvD,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,GAAG,CAAC;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACnB;AAOD,QAAA,MAAM,8BAA8B,wEAqHlC,CAAC;AAEH,OAAO,EAAE,8BAA8B,EAAE,CAAC"}
|
|
@@ -1,32 +1,21 @@
|
|
|
1
1
|
import { Dropdown } from '@rh-support/components';
|
|
2
2
|
import { toOption, toOptions } from '@rh-support/utils';
|
|
3
3
|
import isEmpty from 'lodash/isEmpty';
|
|
4
|
-
import
|
|
5
|
-
import React, { forwardRef, useContext, useEffect, useMemo, useState } from 'react';
|
|
4
|
+
import React, { forwardRef, useContext, useEffect, useState } from 'react';
|
|
6
5
|
import { Trans, useTranslation } from 'react-i18next';
|
|
7
|
-
import { useCaseSelector } from '../../context/CaseContext';
|
|
8
6
|
import { RouteContext } from '../../context/RouteContext';
|
|
9
7
|
const defaultProps = {
|
|
10
8
|
disabled: false,
|
|
11
9
|
htmlForId: '',
|
|
12
10
|
};
|
|
13
11
|
const ProductVersionDropdownSelector = forwardRef((props, ref) => {
|
|
12
|
+
var _a;
|
|
14
13
|
const { t } = useTranslation();
|
|
15
14
|
const [isProductInValid, setIsProductInValid] = useState(true);
|
|
16
15
|
const [isVersionInValid, setIsVersionInValid] = useState(false);
|
|
17
16
|
const [isProductBlured, setIsProductBlured] = useState(false);
|
|
18
17
|
const [isVersionBlured, setIsVersionBlured] = useState(false);
|
|
19
18
|
const { routeState: { showValidationErrorAlert }, } = useContext(RouteContext);
|
|
20
|
-
const versionsDetails = useCaseSelector((state) => state.versionsDetails, isEqual);
|
|
21
|
-
const productVenisons = useMemo(() => versionsDetails.data.map(({ name }) => name),
|
|
22
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
23
|
-
[props.selectedProduct.name, versionsDetails.data]);
|
|
24
|
-
// Here we are conditionally checking if selected product is having version and if not fallback to fetched version list ].
|
|
25
|
-
const selectedProductVersion = isEmpty(props.selectedProduct.versions)
|
|
26
|
-
? productVenisons
|
|
27
|
-
: props.selectedProduct.versions;
|
|
28
|
-
// On the basis of which version source we are using we need to use loading status of it.
|
|
29
|
-
const isLoadingList = isEmpty(props.selectedProduct.versions) ? versionsDetails.isFetching : props.isLoading;
|
|
30
19
|
const onProductChange = (option) => {
|
|
31
20
|
props.onProductChange(option.value);
|
|
32
21
|
validateProduct(option);
|
|
@@ -83,7 +72,7 @@ const ProductVersionDropdownSelector = forwardRef((props, ref) => {
|
|
|
83
72
|
React.createElement(Trans, null, "Version"),
|
|
84
73
|
' ',
|
|
85
74
|
React.createElement("span", { className: "form-required", "aria-hidden": true }, "*"))),
|
|
86
|
-
React.createElement(Dropdown, { selectedItem: toOption(props.version), list: toOptions(
|
|
75
|
+
React.createElement(Dropdown, { selectedItem: toOption(props.version), list: props.selectedProduct ? toOptions((_a = props.selectedProduct.versions) !== null && _a !== void 0 ? _a : []) : [], id: "version-selector-dropdown", placeholder: t('Select a version'), isLoadingList: props.isLoading, title: `Versions for ${props.selectedProduct.product}`, disabled: props.disabled || isEmpty(props.selectedProduct.versions), isInValid: !props.disabled &&
|
|
87
76
|
isVersionInValid &&
|
|
88
77
|
showValidationErrorAlert &&
|
|
89
78
|
props.selectedProduct.product &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalTroubleshootEffects.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/GlobalTroubleshootEffects.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAWvD,OAAO,EAAqB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAOrF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"GlobalTroubleshootEffects.d.ts","sourceRoot":"","sources":["../../../../src/components/wizardLayout/GlobalTroubleshootEffects.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAWvD,OAAO,EAAqB,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAOrF,UAAU,MAAM;IACZ,UAAU,EAAE,mBAAmB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,eAkXtD"}
|
|
@@ -50,11 +50,6 @@ export function GlobalTroubleshootEffects(props) {
|
|
|
50
50
|
language: state.caseDetails.caseLanguage,
|
|
51
51
|
selectedAccountDetails: state.selectedAccountDetails,
|
|
52
52
|
}), isEqual);
|
|
53
|
-
const versionsDetails = useCaseSelector((state) => {
|
|
54
|
-
if (isEmpty(state.versionsDetails.data))
|
|
55
|
-
return [];
|
|
56
|
-
return state.versionsDetails.data.map(({ name }) => name);
|
|
57
|
-
}, isEqual);
|
|
58
53
|
const caseDispatch = useCaseDispatch();
|
|
59
54
|
const isCaseCreate = RouteUtils.getQueryParams(props.routeProps).caseCreate === 'true';
|
|
60
55
|
const urlQueryParams = RouteUtils.getQueryParams(props.routeProps);
|
|
@@ -89,13 +84,9 @@ export function GlobalTroubleshootEffects(props) {
|
|
|
89
84
|
RouteUtils.updateQueryParams(props.routeProps, newParams);
|
|
90
85
|
}
|
|
91
86
|
else {
|
|
92
|
-
// Check if product information it self is having version list or fallback to version list from different source.
|
|
93
|
-
const productVersions = isEmpty(allProducts.data.productsResult[index].versions)
|
|
94
|
-
? versionsDetails
|
|
95
|
-
: allProducts.data.productsResult[index].versions;
|
|
96
87
|
// product in url is valid
|
|
97
|
-
const isVersionFromURLValid = !isEmpty(versionFromUrl) && includes(
|
|
98
|
-
const isMultiVersionProduct = !isOnlyVersion(
|
|
88
|
+
const isVersionFromURLValid = !isEmpty(versionFromUrl) && includes(allProducts.data.productsResult[index].versions, versionFromUrl);
|
|
89
|
+
const isMultiVersionProduct = !isOnlyVersion(allProducts.data.productsResult[index].versions);
|
|
99
90
|
if (isVersionFromURLValid || isMultiVersionProduct) {
|
|
100
91
|
// version is also valid
|
|
101
92
|
const versionToSet = isVersionFromURLValid ? versionFromUrl : undefined;
|
|
@@ -105,7 +96,7 @@ export function GlobalTroubleshootEffects(props) {
|
|
|
105
96
|
}
|
|
106
97
|
else if (!isMultiVersionProduct) {
|
|
107
98
|
// no version or invalid version and there is only 1 version we set default version in url that will trigger the flow with valid version this time
|
|
108
|
-
const defaultVersion = getVersionIfOnlyVersion(
|
|
99
|
+
const defaultVersion = getVersionIfOnlyVersion(allProducts.data.productsResult[index].versions);
|
|
109
100
|
const newParams = { product: productFromUrl, version: defaultVersion };
|
|
110
101
|
RouteUtils.updateQueryParams(props.routeProps, newParams);
|
|
111
102
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/troubleshoot",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.93-alpha-0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -74,11 +74,11 @@
|
|
|
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.57",
|
|
78
|
-
"@rh-support/react-context": "0.2.57",
|
|
77
|
+
"@rh-support/components": "1.1.57-alpha-0",
|
|
78
|
+
"@rh-support/react-context": "0.2.57-alpha-0",
|
|
79
79
|
"@rh-support/types": "0.2.0",
|
|
80
|
-
"@rh-support/user-permissions": "0.2.45",
|
|
81
|
-
"@rh-support/utils": "0.2.34",
|
|
80
|
+
"@rh-support/user-permissions": "0.2.45-alpha-0",
|
|
81
|
+
"@rh-support/utils": "0.2.34-alpha-0",
|
|
82
82
|
"@types/react-redux": "^7.1.12",
|
|
83
83
|
"@types/redux": "^3.6.0",
|
|
84
84
|
"@webcomponents/webcomponentsjs": "^2.2.10",
|
|
@@ -143,5 +143,5 @@
|
|
|
143
143
|
"not ie <= 11",
|
|
144
144
|
"not op_mini all"
|
|
145
145
|
],
|
|
146
|
-
"gitHead": "
|
|
146
|
+
"gitHead": "c493eace4748f428da4c41f386381e609dd39651"
|
|
147
147
|
}
|