Skip to content

Commit

Permalink
bounaries filter
Browse files Browse the repository at this point in the history
  • Loading branch information
nreese committed Aug 30, 2023
1 parent 2f7625f commit bd66277
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import type { DataPublicPluginStart } from '@kbn/data-plugin/public';
import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public';
import { DataViewSelect } from './data_view_select';
import { SingleFieldSelect } from './single_field_select';
import { QueryInput } from './query_input';

export const BOUNDARY_GEO_FIELD_TYPES = ['geo_shape'];

Expand All @@ -37,6 +38,7 @@ interface Props {
setDataViewTitle: (title: string) => void;
setGeoField: (fieldName: string) => void;
setNameField: (fieldName: string) => void;
setQuery: (query: Query) => void;
unifiedSearch: UnifiedSearchPublicPluginStart;
}

Expand Down Expand Up @@ -194,6 +196,23 @@ export const BoundaryForm = (props: Props) => {
fields={nameFields}
/>
</EuiFormRow>

<EuiFormRow
helpText={i18n.translate('xpack.stackAlerts.geoContainment.boundariesFilterHelpText', {
defaultMessage: 'Add a filter to narrow boundaries.',
})}
label={i18n.translate('xpack.stackAlerts.geoContainment.filterLabel', {
defaultMessage: 'Filter',
})}
>
<QueryInput
dataView={dataView}
onChange={(query: Query) => {
props.setQuery(query);
}}
query={props.ruleParams.boundaryIndexQuery}
/>
</EuiFormRow>
</>
)}
</EuiSkeletonText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,7 @@ export const EntityForm = (props: Props) => {
</EuiFormRow>

<EuiFormRow
error={entityFieldError}
isInvalid={Boolean(entityFieldError)}
helpText={i18n.translate('xpack.stackAlerts.geoContainment.filterHelpText', {
helpText={i18n.translate('xpack.stackAlerts.geoContainment.entityFilterHelpText', {
defaultMessage: 'Add a filter to narrow entities.',
})}
label={i18n.translate('xpack.stackAlerts.geoContainment.filterLabel', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const GeoContainmentRuleTypeExpression: React.FunctionComponent<
setDataViewTitle={(title: string) => props.setRuleParams('boundaryIndexTitle', title)}
setGeoField={(fieldName: string) => props.setRuleParams('boundaryGeoField', fieldName)}
setNameField={(fieldName: string) => props.setRuleParams('boundaryNameField', fieldName)}
setQuery={(query: Query) => props.setRuleParams('boundaryIndexQuery', query)}
unifiedSearch={props.unifiedSearch}
/>

Expand Down

0 comments on commit bd66277

Please sign in to comment.