Skip to content

Commit

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

This will backport the following commits from `main` to `8.17`:
- [[SLOs] Added $state into filters schema !!
(#202887)](#202887)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"Shahzad","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-05T09:12:48Z","message":"[SLOs]
Added $state into filters schema !! (#202887)\n\n## Summary\r\n\r\nfixes
https://github.com/elastic/kibana/issues/202999\r\n\r\nAdded $state into
filters schema
!!","sha":"51e63eeaccd9998d473ef62d11d530697a836e7f","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-major"],"title":"[SLOs]
Added $state into filters schema
!!","number":202887,"url":"https://github.com/elastic/kibana/pull/202887","mergeCommit":{"message":"[SLOs]
Added $state into filters schema !! (#202887)\n\n## Summary\r\n\r\nfixes
https://github.com/elastic/kibana/issues/202999\r\n\r\nAdded $state into
filters schema
!!","sha":"51e63eeaccd9998d473ef62d11d530697a836e7f"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/202887","number":202887,"mergeCommit":{"message":"[SLOs]
Added $state into filters schema !! (#202887)\n\n## Summary\r\n\r\nfixes
https://github.com/elastic/kibana/issues/202999\r\n\r\nAdded $state into
filters schema !!","sha":"51e63eeaccd9998d473ef62d11d530697a836e7f"}}]}]
BACKPORT-->

Co-authored-by: Shahzad <[email protected]>
  • Loading branch information
kibanamachine and shahzad31 authored Dec 5, 2024
1 parent 901201e commit 5c78fb5
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 5c78fb5

Please sign in to comment.