Skip to content

Commit

Permalink
[SLOs] Added $state into filters schema !! (#202887)
Browse files Browse the repository at this point in the history
## Summary

fixes #202999

Added $state  into filters schema !!

(cherry picked from commit 51e63ee)
  • Loading branch information
shahzad31 committed Dec 5, 2024
1 parent 671b16b commit 19e784b
Showing 1 changed file with 24 additions and 19 deletions.
43 changes: 24 additions & 19 deletions x-pack/packages/kbn-slo-schema/src/schema/indicators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,31 @@ import { allOrAnyString } from './common';
const kqlQuerySchema = t.string;

const filtersSchema = t.array(
t.type({
meta: t.partial({
alias: t.union([t.string, t.null]),
disabled: t.boolean,
negate: t.boolean,
// controlledBy is there to identify who owns the filter
controlledBy: t.string,
// allows grouping of filters
group: t.string,
// index and type are optional only because when you create a new filter, there are no defaults
index: t.string,
isMultiIndex: t.boolean,
type: t.string,
key: t.string,
field: t.string,
params: t.any,
value: t.string,
t.intersection([
t.type({
meta: t.partial({
alias: t.union([t.string, t.null]),
disabled: t.boolean,
negate: t.boolean,
// controlledBy is there to identify who owns the filter
controlledBy: t.string,
// allows grouping of filters
group: t.string,
// index and type are optional only because when you create a new filter, there are no defaults
index: t.string,
isMultiIndex: t.boolean,
type: t.string,
key: t.string,
field: t.string,
params: t.any,
value: t.string,
}),
query: t.record(t.string, t.any),
}),
t.partial({
$state: t.any,
}),
query: t.record(t.string, t.any),
})
])
);

const kqlWithFiltersSchema = t.type({
Expand Down

0 comments on commit 19e784b

Please sign in to comment.