@@ -40,6 +40,7 @@ import type { RelativeTimeRangeWithEnd } from 'views/logic/queries/Query';
4040import Search from 'views/logic/search/Search' ;
4141import { extractDurationAndUnit } from 'components/common/TimeUnitInput' ;
4242import { Alert , ButtonToolbar , ControlLabel , FormGroup , HelpBlock , Input } from 'components/bootstrap' ;
43+ import usePluginEntities from 'hooks/usePluginEntities' ;
4344import RelativeTime from 'components/common/RelativeTime' ;
4445import type { LookupTableParameterJson } from 'views/logic/parameters/LookupTableParameter' ;
4546import LookupTableParameter from 'views/logic/parameters/LookupTableParameter' ;
@@ -179,6 +180,7 @@ const QueryParameters = ({ eventDefinition, onChange, userCanViewLookupTables, v
179180const FilterForm = ( { currentUser, eventDefinition, onChange, streams, validation } : Props ) => {
180181 const { execute_every_ms : executeEveryMs , search_within_ms : searchWithinMs } = eventDefinition . config ;
181182 const [ currentConfig , setCurrentConfig ] = useState ( eventDefinition . config ) ;
183+ const searchQueryPreviews = usePluginEntities ( 'eventDefinitions.components.searchQueryPreview' ) ?? [ ] ;
182184 const searchWithin = extractDurationAndUnit ( searchWithinMs , TIME_UNITS ) ;
183185 const executeEvery = extractDurationAndUnit ( executeEveryMs , TIME_UNITS ) ;
184186 const { userTimezone } = useUserDateTime ( ) ;
@@ -553,6 +555,14 @@ const FilterForm = ({ currentUser, eventDefinition, onChange, streams, validatio
553555 </ FormGroup >
554556 ) }
555557
558+ { /* Extension point (filled by the enterprise search-filters plugin) for a read-only preview of the
559+ effective query beneath the Search Query. Scoped (Illuminate) definitions hide the base query, so
560+ the preview is not rendered for them. */ }
561+ { onlyFilters ||
562+ searchQueryPreviews . map ( ( { component : SearchQueryPreview , key } ) => (
563+ < SearchQueryPreview key = { key } queryString = { currentConfig . query ?? '' } filters = { currentConfig . filters ?? [ ] } />
564+ ) ) }
565+
556566 { onlyFilters || (
557567 < QueryParameters
558568 eventDefinition = { eventDefinition }
0 commit comments