-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Manually building KueryNode
for Fleet's routes
#75693
Changes from 18 commits
8a490fd
0c23f97
3341219
062aaf2
8bd226f
070552c
225bb15
0ee4f45
4cc972b
6da0f32
7afb589
130d5cf
55051f8
4ebbe98
97e19c0
aa14f7f
205dd30
195a5a1
f135722
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,5 @@ | |
<b>Signature:</b> | ||
|
||
```typescript | ||
filter?: string; | ||
filter?: string | KueryNode; | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,5 @@ | |
<b>Signature:</b> | ||
|
||
```typescript | ||
filter?: string; | ||
filter?: string | KueryNode; | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,9 @@ import { SavedObjectUnsanitizedDoc } from './serialization'; | |
import { SavedObjectsMigrationLogger } from './migrations/core/migration_logger'; | ||
import { SavedObject } from '../../types'; | ||
|
||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths | ||
import { KueryNode } from '../../../plugins/data/common'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Refactoring this code to remove the circular reference became quite time-consuming. Since a circular reference already exists between core and the data plugin, I'd like to postpone fixing the circular reference to another PR to minimize the likelihood of this change not making 7.10. |
||
|
||
export { | ||
SavedObjectAttributes, | ||
SavedObjectAttribute, | ||
|
@@ -89,7 +92,7 @@ export interface SavedObjectsFindOptions { | |
rootSearchFields?: string[]; | ||
hasReference?: { type: string; id: string }; | ||
defaultSearchOperator?: 'AND' | 'OR'; | ||
filter?: string; | ||
filter?: string | KueryNode; | ||
namespaces?: string[]; | ||
/** An optional ES preference value to be used for the query **/ | ||
preference?: string; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: we are no longer ignoring empty string filters, but I guess this has no impact?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty strings are still ignored, I added 195a5a1#diff-c5ab35755205b8adbf6cfc858d69ea3bR86-R88 to double-check this. JavaScript treats an empty-string as being falsy, so checking
filter
andfilter.length > 0
is redundant, we only need to checkfilter
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait what? Kibana is not Java code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, no... Maybe in the future though! New-new platform??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would need to find a more suitable codename if we switch to java. NewPlatformBijectiveAdapterFactory maybe.