Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query Filter \ Filter Manager: de-angularize and move to data plugin #37311

Merged
Merged
Changes from 1 commit
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
fb72077
Embeddable and Visualize to use type definitions from kbn-es-query pa…
May 22, 2019
33e3684
Merge remote-tracking branch 'upstream/master' into newplatform/data-…
May 29, 2019
f243294
moved state watching to new filter manager and removed query filter d…
May 29, 2019
4b70360
Merge remote-tracking branch 'upstream/master' into newplatform/data-…
May 30, 2019
fe60536
Deleted unused pinFilter
May 30, 2019
6231d85
Extracted merge fitlers function
May 30, 2019
cff30fc
Changed mappedFilters name
May 30, 2019
ec4ae2f
Merge remote-tracking branch 'upstream/master' into newplatform/data-…
Jun 3, 2019
ebf7dbd
Merge remote-tracking branch 'upstream/master' into newplatform/data-…
Jun 4, 2019
e87524e
Move state management to new filter management as well. query filter …
Jun 4, 2019
6cde2a7
Code works correctly with new setup of query filter
Jun 5, 2019
08ef0cd
improved typing
Jun 5, 2019
a26489f
Moved mapping into new filter manager
Jun 5, 2019
1178338
removed promise dependency from query filter
Jun 5, 2019
9f0c490
Extracted filter state manager from query filter
Jun 5, 2019
313edcc
Moved addFiltersAndChangeTimeFilter logic into new filter manager
Jun 5, 2019
348461a
Fixed addFiltersAndChangeTimeFilter implementation
Jun 6, 2019
efc85d9
Moved all logic to new filter manager - query filter is just a wrappe…
Jun 6, 2019
ced4d16
Connected query_filter observable management to new filter manager as…
Jun 6, 2019
f1e142e
Usage example in discover
Jun 6, 2019
4bb875b
filter state management tests + fire less events from filter state ma…
Jun 6, 2019
a54b7a3
Merge remote-tracking branch 'upstream/master' into newplatform/data-…
Jun 10, 2019
cba1b04
Tests for filter manager and filter state manager
Jun 10, 2019
2ad98e5
Moved new filter manager to data plugin
Jun 10, 2019
d5d09d8
Got rid of FilterManagerProvider and turned it into a getFilterGenera…
Jun 10, 2019
f4d8a3b
Added tests that make sure that filter manager listens to filter stat…
Jun 10, 2019
ad329be
fix typo
Jun 10, 2019
0d1beca
Fixed action add filter test
Jun 10, 2019
1354b6c
Fixed increasePredecessorCount test
Jun 10, 2019
557ff85
Fixed increaseSuccessorCount test
Jun 10, 2019
0be0d02
Fixed setPredecessorCount test
Jun 10, 2019
1166bef
Fixed setQueryParameters test
Jun 10, 2019
b0be03a
Fixed setSuccessorCount test
Jun 10, 2019
23fd40c
Fixed doc table filter actions test
Jun 10, 2019
78822c1
Fixed filter generator tests
Jun 10, 2019
f112acb
rename argument
Jun 10, 2019
bc7b11b
Moved push filters into vis filters (only place where its used)
Jun 10, 2019
1c40426
Filter type fix, test fix
Jun 10, 2019
cf82adf
Removed irrelevant filter tests (for deleted methods)
Jun 11, 2019
c3d52c3
Fixed most of get filters errors by sleeping (TODO!)
Jun 11, 2019
f4c472a
Added destroy methods
Jun 11, 2019
0230a80
Fixed discover functional tests
Jun 12, 2019
6bec62e
Allow filter $state to be empty
Jun 12, 2019
4cf4654
Merge remote-tracking branch 'upstream/master' into newplatform/data-…
Jun 12, 2019
1392346
Fixed types
Jun 12, 2019
194dc6a
Code review with @splager
Jun 12, 2019
1f75907
Merge remote-tracking branch 'upstream/master' into newplatform/data-…
Jun 13, 2019
91a88e5
Separate class\type defenitions from plugin instance setup in shim pl…
Jun 13, 2019
0b87154
Merge remote-tracking branch 'upstream/master' into newplatform/data-…
Jun 13, 2019
3dfa64c
Merge branch 'newplatform/data-plugin/plugin-export-strategy' into ne…
Jun 13, 2019
e800662
typescript fun
Jun 13, 2019
25123c8
Merge branch 'newplatform/data-plugin/plugin-export-strategy' into ne…
Jun 13, 2019
c329970
Merge remote-tracking branch 'upstream/master' into newplatform/data-…
Jun 13, 2019
d4a34d3
Merge remote-tracking branch 'upstream/master' into newplatform/data-…
Jun 16, 2019
b883443
Fixed merge
Jun 16, 2019
8cd7b39
updated some get filter tests to work with add filter, and therefore …
Jun 16, 2019
1913be0
Remove shouldFetch and add comment explaning the observable.
Jun 16, 2019
01498a1
Minor code style fixes
Jun 16, 2019
266cce5
Merge remote-tracking branch 'upstream/master' into newplatform/data-…
Jun 20, 2019
6358545
Merge remote-tracking branch 'upstream/master' into newplatform/data-…
Jun 23, 2019
cffb259
Code review fixes and changes
Jun 24, 2019
cd5cf08
Moved Karma tests to jest
Jun 24, 2019
faabd68
Merge remote-tracking branch 'upstream/master' into newplatform/data-…
Jun 24, 2019
2a5ed37
Fixed merge
Jun 24, 2019
4134965
Fixed some type errors
Jun 24, 2019
378799f
Improved watchFilterState logic
Jun 25, 2019
04ae2ed
Removed addFiltersAndChangeTimeFilter test for now, as I'm having TS …
Jun 25, 2019
72a188c
filters can also be null
Jun 25, 2019
8ec3936
Further watch state fine tuning
Jun 25, 2019
a64ed11
Merge remote-tracking branch 'upstream/master' into newplatform/data-…
Jun 26, 2019
3cd053d
Get data instance inside provider to avoid circular deps
Jun 26, 2019
c349177
mock chrome
Jun 26, 2019
0dbc4fc
Removed change to range filter
Jun 26, 2019
87c3e10
Deleted unnecessary injects
Jun 26, 2019
93360c7
dedup setFilters as well
Jun 27, 2019
abc9506
deleted unused subscription
Jun 27, 2019
cf7173b
Added tests for setFilters de-dupe
Jun 27, 2019
dabaa1b
Merge remote-tracking branch 'upstream/master' into newplatform/data-…
Jun 27, 2019
496d976
Update src/legacy/core_plugins/data/public/filter/filter_manager/filt…
lizozom Jun 27, 2019
b43256f
Update src/legacy/core_plugins/data/public/filter/filter_manager/filt…
lizozom Jun 27, 2019
399bfc5
Merge remote-tracking branch 'upstream/master' into newplatform/data-…
Jun 30, 2019
273e64d
Merge branch 'newplatform/data-plugin/filter-manager-1' of github.com…
Jun 30, 2019
4376e3e
Code review minor fixes
Jun 30, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Allow filter $state to be empty
Liza Katz committed Jun 12, 2019
commit 6bec62e0f0567146969b643630255f4069692165
4 changes: 2 additions & 2 deletions packages/kbn-es-query/src/filters/lib/meta_filter.ts
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ export interface FilterMeta {
}

export interface Filter {
$state: FilterState;
$state?: FilterState;
meta: FilterMeta;
query?: object;
}
@@ -64,7 +64,7 @@ export function buildEmptyFilter(isPinned: boolean, index?: string): Filter {
}

export function isFilterPinned(filter: Filter) {
return filter.$state.store === FilterStateStore.GLOBAL_STATE;
return filter.$state && filter.$state.store === FilterStateStore.GLOBAL_STATE;
}

export function toggleFilterDisabled(filter: Filter) {
Original file line number Diff line number Diff line change
@@ -134,8 +134,8 @@ export class FilterManager {
private static setFiltersStore(filters: Filter[], store: FilterStateStore) {
_.map(filters, (filter: Filter) => {
// Override status only for filters that didn't have state in the first place.
if (filter.$state.store === undefined) {
filter.$state.store = store;
if (filter.$state === undefined) {
filter.$state = { store };
}
});
}
@@ -147,9 +147,9 @@ export class FilterManager {
// global filters should always be first
newFilters.sort(
(a: Filter, b: Filter): number => {
if (a.$state.store === FilterStateStore.GLOBAL_STATE) {
if (a.$state && a.$state.store === FilterStateStore.GLOBAL_STATE) {
return -1;
} else if (b.$state.store === FilterStateStore.GLOBAL_STATE) {
} else if (b.$state && b.$state.store === FilterStateStore.GLOBAL_STATE) {
return 1;
} else {
return 0;
Original file line number Diff line number Diff line change
@@ -20,17 +20,14 @@
export function getFiltersArray() {
return [
{
$state: {},
query: { match: { extension: { query: 'jpg', type: 'phrase' } } },
meta: { index: 'logstash-*', negate: false, disabled: false }
},
{
$state: {},
query: { match: { '@tags': { query: 'info', type: 'phrase' } } },
meta: { index: 'logstash-*', negate: false, disabled: false }
},
{
$state: {},
query: { match: { '_type': { query: 'nginx', type: 'phrase' } } },
meta: { index: 'logstash-*', negate: false, disabled: false }
}
1 change: 0 additions & 1 deletion src/legacy/ui/public/filter_manager/filter_generator.js
Original file line number Diff line number Diff line change
@@ -82,7 +82,6 @@ export function getFilterGenerator(queryFilter) {
break;
}

filter.$state = {};
newFilters.push(filter);
});