mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-26 09:55:52 +00:00
Minor: fixed failing query entity cypress (#17261)
* Minor: fixed failing query entity cypress * fixed failing cypress
This commit is contained in:
parent
9fcbf6a5b9
commit
1b6b48e7be
@ -61,6 +61,7 @@ import {
|
||||
updateQueryVote,
|
||||
} from '../../../rest/queryAPI';
|
||||
import { searchQuery } from '../../../rest/searchAPI';
|
||||
import { getEntityName } from '../../../utils/EntityUtils';
|
||||
import { DEFAULT_ENTITY_PERMISSION } from '../../../utils/PermissionsUtils';
|
||||
import {
|
||||
createQueryFilter,
|
||||
@ -288,11 +289,16 @@ const TableQueries: FC<TableQueriesProp> = ({
|
||||
};
|
||||
|
||||
const fetchTags = async (searchText = WILD_CARD_CHAR) => {
|
||||
return fetchFilterOptions(
|
||||
const data = await fetchFilterOptions(
|
||||
searchText,
|
||||
'disabled:false AND !classification.name:Tier',
|
||||
SearchIndex.TAG
|
||||
);
|
||||
|
||||
return data.hits.hits.map((hit) => ({
|
||||
key: hit._source.fullyQualifiedName ?? hit._source.name,
|
||||
label: getEntityName(hit._source),
|
||||
}));
|
||||
};
|
||||
|
||||
const setTagsDefaultOption = () => {
|
||||
@ -343,10 +349,15 @@ const TableQueries: FC<TableQueriesProp> = ({
|
||||
};
|
||||
|
||||
const fetchOwner = async (searchText = WILD_CARD_CHAR) => {
|
||||
return fetchFilterOptions(searchText, 'isBot:false', [
|
||||
const data = await fetchFilterOptions(searchText, 'isBot:false', [
|
||||
SearchIndex.USER,
|
||||
SearchIndex.TEAM,
|
||||
]);
|
||||
|
||||
return data.hits.hits.map((hit) => ({
|
||||
key: hit._source.name,
|
||||
label: getEntityName(hit._source),
|
||||
}));
|
||||
};
|
||||
|
||||
const setOwnerDefaultOption = () => {
|
||||
|
@ -17,7 +17,6 @@ import { SearchDropdownOption } from '../../components/SearchDropdown/SearchDrop
|
||||
import { PAGE_SIZE_BASE } from '../../constants/constants';
|
||||
import { SearchIndex } from '../../enums/search.enum';
|
||||
import { searchQuery } from '../../rest/searchAPI';
|
||||
import { getEntityName } from '../EntityUtils';
|
||||
|
||||
export const createQueryFilter = ({
|
||||
tableId,
|
||||
@ -46,7 +45,9 @@ export const createQueryFilter = ({
|
||||
{
|
||||
bool: {
|
||||
should: owners.map((data) => ({
|
||||
term: { 'owners.displayName.keyword': data.key },
|
||||
term: {
|
||||
'owners.name': data.key,
|
||||
},
|
||||
})),
|
||||
},
|
||||
},
|
||||
@ -102,10 +103,6 @@ export const fetchFilterOptions = async (
|
||||
pageSize: PAGE_SIZE_BASE,
|
||||
searchIndex,
|
||||
});
|
||||
const options = response.hits.hits.map((hit) => ({
|
||||
key: hit._source.fullyQualifiedName ?? hit._source.name,
|
||||
label: getEntityName(hit._source),
|
||||
}));
|
||||
|
||||
return options;
|
||||
return response;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user