@rh-support/cases 0.2.18 → 0.2.19
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseSearch.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-search/CaseSearch.tsx"],"names":[],"mappings":"AAeA,wBAAgB,UAAU,
|
|
1
|
+
{"version":3,"file":"CaseSearch.d.ts","sourceRoot":"","sources":["../../../../../src/components/case-list/case-search/CaseSearch.tsx"],"names":[],"mappings":"AAeA,wBAAgB,UAAU,gBA8IzB"}
|
|
@@ -34,11 +34,11 @@ export function CaseSearch() {
|
|
|
34
34
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
35
35
|
}, [filterQueryInfo.type]);
|
|
36
36
|
const onSearchValChange = (value) => {
|
|
37
|
-
if (isEmpty(value)) {
|
|
37
|
+
if (isEmpty(value.trim())) {
|
|
38
38
|
clearSearchVal();
|
|
39
39
|
}
|
|
40
40
|
else {
|
|
41
|
-
setSearchVal(value);
|
|
41
|
+
setSearchVal(value.trim());
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
const clearSearchVal = () => {
|
|
@@ -64,6 +64,16 @@ export function CaseSearch() {
|
|
|
64
64
|
}
|
|
65
65
|
setSearchType(newType);
|
|
66
66
|
};
|
|
67
|
+
// To check is Search Button is disabled or not
|
|
68
|
+
const isSearchButtonDisabled = isEmpty(filterQueryInfo.queryString) && isEmpty(searchVal.trim());
|
|
69
|
+
// To handle return or enter keydown event when search button is disabled
|
|
70
|
+
const handleSearchInputKeyDown = (e) => {
|
|
71
|
+
const key = e.which;
|
|
72
|
+
if (key === 13 && isSearchButtonDisabled) {
|
|
73
|
+
e.preventDefault();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
67
77
|
const handleSubmit = (ev) => {
|
|
68
78
|
ev.preventDefault();
|
|
69
79
|
// for advance search submit should only happen on btn click or ctrl+enter which will be handled manually
|
|
@@ -73,7 +83,7 @@ export function CaseSearch() {
|
|
|
73
83
|
return (React.createElement(React.Fragment, null,
|
|
74
84
|
React.createElement("div", { className: "case-search-input-container" },
|
|
75
85
|
React.createElement(SearchInput, { className: "pf-u-w-100", placeholder: t('Search by keyword or case ID'), value: searchVal.trim(), "data-tracking-id": "search-cases-text-input", id: "case-search-basic", "aria-label": t('Search by keyword or case ID'), onChange: onSearchValChange, onClear: clearSearchVal }),
|
|
76
|
-
React.createElement(Button, { variant: "primary", type: "submit", className: "search-btn", "data-tracking-id": "case-list-search-button", isDisabled:
|
|
86
|
+
React.createElement(Button, { variant: "primary", type: "submit", className: "search-btn", "data-tracking-id": "case-list-search-button", isDisabled: isSearchButtonDisabled },
|
|
77
87
|
React.createElement(Trans, null, "Search")),
|
|
78
88
|
canUseAdvancedSearch && (React.createElement(Button, { variant: "link", onClick: () => onSearchTypeChange(CaseSearchQueryType.ADVANCED), isDisabled: isFetching, "data-tracking-id": "case-list-adv-toggle-button" },
|
|
79
89
|
React.createElement(Trans, null, "Advanced"))))));
|
|
@@ -83,7 +93,7 @@ export function CaseSearch() {
|
|
|
83
93
|
React.createElement(AdvanceSearch, { onSearchValChange: onSearchValChange, onSearchClear: clearSearchVal, onSearchSubmit: onCaseSearch, onSearchTypeChange: onSearchTypeChange }))) : (React.createElement(React.Fragment, null));
|
|
84
94
|
};
|
|
85
95
|
return (React.createElement(React.Fragment, null,
|
|
86
|
-
React.createElement("form", { onSubmit: handleSubmit },
|
|
96
|
+
React.createElement("form", { onSubmit: handleSubmit, onKeyDown: handleSearchInputKeyDown },
|
|
87
97
|
React.createElement("div", { className: "form-group case-search-form-group" }, CaseSearchQueryType.BASIC === searchType ? renderBasicSearch() : renderAdvanceSearch())),
|
|
88
98
|
React.createElement(BookmarkedSearchesSelector, { currentCaseSearchString: searchVal, currentSearchType: searchType })));
|
|
89
99
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/cases",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.19",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"lib/**/*"
|
|
27
27
|
],
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@cee-eng/hydrajs": "4.
|
|
29
|
+
"@cee-eng/hydrajs": "4.7.3",
|
|
30
30
|
"@patternfly/patternfly": "4.102.2",
|
|
31
31
|
"@patternfly/pfe-collapse": "1.1.0",
|
|
32
32
|
"@patternfly/react-core": "4.128.2",
|
|
@@ -47,17 +47,17 @@
|
|
|
47
47
|
"solr-query-builder": "1.0.1"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@cee-eng/hydrajs": "4.
|
|
50
|
+
"@cee-eng/hydrajs": "4.7.3",
|
|
51
51
|
"@patternfly/patternfly": "4.102.2",
|
|
52
52
|
"@patternfly/pfe-collapse": "1.1.0",
|
|
53
53
|
"@patternfly/react-core": "4.128.2",
|
|
54
54
|
"@patternfly/react-table": "4.26.7",
|
|
55
|
-
"@rh-support/api": "0.3.
|
|
56
|
-
"@rh-support/components": "1.1.
|
|
57
|
-
"@rh-support/react-context": "0.2.
|
|
55
|
+
"@rh-support/api": "0.3.8",
|
|
56
|
+
"@rh-support/components": "1.1.14",
|
|
57
|
+
"@rh-support/react-context": "0.2.16",
|
|
58
58
|
"@rh-support/types": "0.2.0",
|
|
59
|
-
"@rh-support/user-permissions": "0.2.
|
|
60
|
-
"@rh-support/utils": "0.2.
|
|
59
|
+
"@rh-support/user-permissions": "0.2.10",
|
|
60
|
+
"@rh-support/utils": "0.2.10",
|
|
61
61
|
"i18next": "^19.0.1",
|
|
62
62
|
"localforage": "^1.7.3",
|
|
63
63
|
"lodash": "^4.17.15",
|
|
@@ -101,5 +101,5 @@
|
|
|
101
101
|
"not ie <= 11",
|
|
102
102
|
"not op_mini all"
|
|
103
103
|
],
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "9a2829fecfe0e5755eacfb6f27b67271edb56e33"
|
|
105
105
|
}
|