forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Data][Filters] Move more filter utils to package and cleanup API (el…
…astic#106566) * Move more utils to package and cleanup API * docs and imports * better imports * change comment Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
51f420c
commit e894c41
Showing
65 changed files
with
925 additions
and
466 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...pment/plugins/data/public/kibana-plugin-plugins-data-public.extracttimerange.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [extractTimeRange](./kibana-plugin-plugins-data-public.extracttimerange.md) | ||
|
||
## extractTimeRange() function | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare function extractTimeRange(filters: Filter[], timeFieldName?: string): { | ||
restOfFilters: Filter[]; | ||
timeRange?: TimeRange; | ||
}; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| filters | <code>Filter[]</code> | | | ||
| timeFieldName | <code>string</code> | | | ||
|
||
<b>Returns:</b> | ||
|
||
`{ | ||
restOfFilters: Filter[]; | ||
timeRange?: TimeRange; | ||
}` | ||
|
11 changes: 11 additions & 0 deletions
11
...development/plugins/data/public/kibana-plugin-plugins-data-public.filteritem.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FilterItem](./kibana-plugin-plugins-data-public.filteritem.md) | ||
|
||
## FilterItem variable | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
FilterItem: (props: FilterItemProps) => JSX.Element | ||
``` |
11 changes: 11 additions & 0 deletions
11
...evelopment/plugins/data/public/kibana-plugin-plugins-data-public.filterlabel.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [FilterLabel](./kibana-plugin-plugins-data-public.filterlabel.md) | ||
|
||
## FilterLabel variable | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
FilterLabel: (props: FilterLabelProps) => JSX.Element | ||
``` |
30 changes: 30 additions & 0 deletions
30
...opment/plugins/data/public/kibana-plugin-plugins-data-public.generatefilters.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [generateFilters](./kibana-plugin-plugins-data-public.generatefilters.md) | ||
|
||
## generateFilters() function | ||
|
||
Generate filter objects, as a result of triggering a filter action on a specific index pattern field. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare function generateFilters(filterManager: FilterManager, field: IFieldType | string, values: any, operation: string, index: string): Filter[]; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| filterManager | <code>FilterManager</code> | | | ||
| field | <code>IFieldType | string</code> | | | ||
| values | <code>any</code> | | | ||
| operation | <code>string</code> | | | ||
| index | <code>string</code> | | | ||
|
||
<b>Returns:</b> | ||
|
||
`Filter[]` | ||
|
||
{<!-- -->object<!-- -->} An array of filters to be added back to filterManager | ||
|
23 changes: 23 additions & 0 deletions
23
...gins/data/public/kibana-plugin-plugins-data-public.getdisplayvaluefromfilter.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [getDisplayValueFromFilter](./kibana-plugin-plugins-data-public.getdisplayvaluefromfilter.md) | ||
|
||
## getDisplayValueFromFilter() function | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare function getDisplayValueFromFilter(filter: Filter, indexPatterns: IIndexPattern[]): string; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| filter | <code>Filter</code> | | | ||
| indexPatterns | <code>IIndexPattern[]</code> | | | ||
|
||
<b>Returns:</b> | ||
|
||
`string` | ||
|
22 changes: 22 additions & 0 deletions
22
...pment/plugins/data/public/kibana-plugin-plugins-data-public.getesqueryconfig.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [getEsQueryConfig](./kibana-plugin-plugins-data-public.getesqueryconfig.md) | ||
|
||
## getEsQueryConfig() function | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare function getEsQueryConfig(config: KibanaConfig): EsQueryConfig; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| config | <code>KibanaConfig</code> | | | ||
|
||
<b>Returns:</b> | ||
|
||
`EsQueryConfig` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
.../plugins/data/server/kibana-plugin-plugins-data-server.buildqueryfromfilters.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [buildQueryFromFilters](./kibana-plugin-plugins-data-server.buildqueryfromfilters.md) | ||
|
||
## buildQueryFromFilters variable | ||
|
||
> Warning: This API is now obsolete. | ||
> | ||
> Please import from the package kbn/es-query directly. This import will be deprecated in v8.0.0. | ||
> | ||
<b>Signature:</b> | ||
|
||
```typescript | ||
buildQueryFromFilters: (filters: oldFilter[] | undefined, indexPattern: import("@kbn/es-query").IndexPatternBase | undefined, ignoreFilterIfFieldNotInIndex?: boolean | undefined) => { | ||
must: never[]; | ||
filter: oldFilter[]; | ||
should: never[]; | ||
must_not: oldFilter[]; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...pment/plugins/data/server/kibana-plugin-plugins-data-server.getesqueryconfig.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [getEsQueryConfig](./kibana-plugin-plugins-data-server.getesqueryconfig.md) | ||
|
||
## getEsQueryConfig() function | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export declare function getEsQueryConfig(config: KibanaConfig): EsQueryConfig; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --- | --- | --- | | ||
| config | <code>KibanaConfig</code> | | | ||
|
||
<b>Returns:</b> | ||
|
||
`EsQueryConfig` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages/kbn-es-query/src/filters/build_filters/build_empty_filter.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { Filter, FilterMeta, FilterState, FilterStateStore } from './types'; | ||
|
||
export const buildEmptyFilter = (isPinned: boolean, index?: string): Filter => { | ||
const meta: FilterMeta = { | ||
disabled: false, | ||
negate: false, | ||
alias: null, | ||
index, | ||
}; | ||
const $state: FilterState = { | ||
store: isPinned ? FilterStateStore.GLOBAL_STATE : FilterStateStore.APP_STATE, | ||
}; | ||
|
||
return { meta, $state }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.