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,
|
updateQueryVote,
|
||||||
} from '../../../rest/queryAPI';
|
} from '../../../rest/queryAPI';
|
||||||
import { searchQuery } from '../../../rest/searchAPI';
|
import { searchQuery } from '../../../rest/searchAPI';
|
||||||
|
import { getEntityName } from '../../../utils/EntityUtils';
|
||||||
import { DEFAULT_ENTITY_PERMISSION } from '../../../utils/PermissionsUtils';
|
import { DEFAULT_ENTITY_PERMISSION } from '../../../utils/PermissionsUtils';
|
||||||
import {
|
import {
|
||||||
createQueryFilter,
|
createQueryFilter,
|
||||||
@ -288,11 +289,16 @@ const TableQueries: FC<TableQueriesProp> = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const fetchTags = async (searchText = WILD_CARD_CHAR) => {
|
const fetchTags = async (searchText = WILD_CARD_CHAR) => {
|
||||||
return fetchFilterOptions(
|
const data = await fetchFilterOptions(
|
||||||
searchText,
|
searchText,
|
||||||
'disabled:false AND !classification.name:Tier',
|
'disabled:false AND !classification.name:Tier',
|
||||||
SearchIndex.TAG
|
SearchIndex.TAG
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return data.hits.hits.map((hit) => ({
|
||||||
|
key: hit._source.fullyQualifiedName ?? hit._source.name,
|
||||||
|
label: getEntityName(hit._source),
|
||||||
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
const setTagsDefaultOption = () => {
|
const setTagsDefaultOption = () => {
|
||||||
@ -343,10 +349,15 @@ const TableQueries: FC<TableQueriesProp> = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const fetchOwner = async (searchText = WILD_CARD_CHAR) => {
|
const fetchOwner = async (searchText = WILD_CARD_CHAR) => {
|
||||||
return fetchFilterOptions(searchText, 'isBot:false', [
|
const data = await fetchFilterOptions(searchText, 'isBot:false', [
|
||||||
SearchIndex.USER,
|
SearchIndex.USER,
|
||||||
SearchIndex.TEAM,
|
SearchIndex.TEAM,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
return data.hits.hits.map((hit) => ({
|
||||||
|
key: hit._source.name,
|
||||||
|
label: getEntityName(hit._source),
|
||||||
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
const setOwnerDefaultOption = () => {
|
const setOwnerDefaultOption = () => {
|
||||||
|
@ -17,7 +17,6 @@ import { SearchDropdownOption } from '../../components/SearchDropdown/SearchDrop
|
|||||||
import { PAGE_SIZE_BASE } from '../../constants/constants';
|
import { PAGE_SIZE_BASE } from '../../constants/constants';
|
||||||
import { SearchIndex } from '../../enums/search.enum';
|
import { SearchIndex } from '../../enums/search.enum';
|
||||||
import { searchQuery } from '../../rest/searchAPI';
|
import { searchQuery } from '../../rest/searchAPI';
|
||||||
import { getEntityName } from '../EntityUtils';
|
|
||||||
|
|
||||||
export const createQueryFilter = ({
|
export const createQueryFilter = ({
|
||||||
tableId,
|
tableId,
|
||||||
@ -46,7 +45,9 @@ export const createQueryFilter = ({
|
|||||||
{
|
{
|
||||||
bool: {
|
bool: {
|
||||||
should: owners.map((data) => ({
|
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,
|
pageSize: PAGE_SIZE_BASE,
|
||||||
searchIndex,
|
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