query builder improvements (#18377)

This commit is contained in:
Karan Hotchandani 2024-10-23 18:05:17 +05:30 committed by GitHub
parent d145d29e9a
commit ef0b03d4a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View File

@ -46,10 +46,10 @@ const QueryBuilderWidget: FC<WidgetProps> = ({
useAdvanceSearch(); useAdvanceSearch();
const [searchResults, setSearchResults] = useState<number>(0); const [searchResults, setSearchResults] = useState<number>(0);
const entityType = const entityType =
(props.formContext?.entityType ?? props?.entityType) || EntityType.ALL; (props.formContext?.entityType ?? schema?.entityType) || EntityType.ALL;
const searchIndexMapping = searchClassBase.getEntityTypeSearchIndexMapping(); const searchIndexMapping = searchClassBase.getEntityTypeSearchIndexMapping();
const searchIndex = searchIndexMapping[entityType as string]; const searchIndex = searchIndexMapping[entityType as string];
const outputType = props?.outputType ?? QueryBuilderOutputType.ELASTICSEARCH; const outputType = schema?.outputType ?? QueryBuilderOutputType.ELASTICSEARCH;
const fetchEntityCount = useCallback( const fetchEntityCount = useCallback(
async (queryFilter: Record<string, unknown>) => { async (queryFilter: Record<string, unknown>) => {
@ -152,17 +152,17 @@ const QueryBuilderWidget: FC<WidgetProps> = ({
showIcon showIcon
icon={<InfoCircleOutlined height={16} />} icon={<InfoCircleOutlined height={16} />}
message={ message={
<> <div className="d-flex flex-wrap items-center gap-1">
<Typography.Text> <Typography.Text>
{t('message.search-entity-count', { {t('message.search-entity-count', {
count: searchResults, count: searchResults,
})} })}
</Typography.Text> </Typography.Text>
<Typography.Text className="m-l-sm text-xs text-grey-muted"> <Typography.Text className="text-xs text-grey-muted">
{t('message.click-here-to-view-assets-on-explore')} {t('message.click-here-to-view-assets-on-explore')}
</Typography.Text> </Typography.Text>
</> </div>
} }
type="info" type="info"
/> />

View File

@ -193,7 +193,7 @@ const AppInstall = () => {
case 2: case 2:
return ( return (
<div className="w-500 p-md border rounded-4"> <div className="w-4/5 p-md border rounded-4">
<FormBuilder <FormBuilder
showFormHeader showFormHeader
useSelectWidget useSelectWidget