mirror of
https://github.com/ansible/awx.git
synced 2026-03-22 03:17:39 -02:30
fixed job details search bar when empty input or duplicate input
This commit is contained in:
@@ -64,9 +64,21 @@ function removeSearchTag (index) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function submitSearch () {
|
function submitSearch () {
|
||||||
|
// empty input, not submit new search, return.
|
||||||
|
if (!vm.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const currentQueryset = getCurrentQueryset();
|
const currentQueryset = getCurrentQueryset();
|
||||||
|
// check duplicate , see if search input already exists in current search tags
|
||||||
|
if (currentQueryset.search) {
|
||||||
|
if (currentQueryset.search.includes(vm.value)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const searchInputQueryset = qs.getSearchInputQueryset(vm.value, isFilterable);
|
const searchInputQueryset = qs.getSearchInputQueryset(vm.value, isFilterable);
|
||||||
|
|
||||||
const modifiedQueryset = qs.mergeQueryset(currentQueryset, searchInputQueryset);
|
const modifiedQueryset = qs.mergeQueryset(currentQueryset, searchInputQueryset);
|
||||||
|
|
||||||
reloadQueryset(modifiedQueryset, strings.get('search.REJECT_INVALID'));
|
reloadQueryset(modifiedQueryset, strings.get('search.REJECT_INVALID'));
|
||||||
|
|||||||
Reference in New Issue
Block a user