[AO] Add data view to the new threshold rule (#159479)

Closes #158840

## Summary

This PR adds selecting a persisted data view and using it in the new
threshold rule.

|Flyout|Rule saved object|
|---|---|

|![image](6f1115e2-e1f1-4348-b380-18b7ce2cacba)|

## 🧪 How to test
- Create a threshold rule with a persisted data view
- Make sure the related feature flag is configured:
`xpack.observability.unsafe.thresholdRule.enabled: true`
- Check whether the triggered alert matches the expectation related to
that data view
- Check the rule saved object to ensure data is saved there correctly

## What is not covered in this PR
I will follow up on the following list in future PRs:
- [Temporary data view](https://github.com/elastic/kibana/issues/159774)
- [Initial loading](https://github.com/elastic/kibana/issues/159779)
- [Setting a timeField beside the
timestamp](https://github.com/elastic/kibana/issues/159777)
- [Error handling](https://github.com/elastic/kibana/issues/159776)
- [Testing](https://github.com/elastic/kibana/issues/159778)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Maryam Saeidi 2023-06-21 13:25:51 +02:00 committed by GitHub
parent a705225f6f
commit 87b80cb21b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
81 changed files with 231 additions and 659 deletions

View file

@ -8,6 +8,7 @@
import { i18n } from '@kbn/i18n';
import { BehaviorSubject, from } from 'rxjs';
import { map } from 'rxjs/operators';
import { DataViewEditorStart } from '@kbn/data-view-editor-plugin/public';
import { SharePluginSetup, SharePluginStart } from '@kbn/share-plugin/public';
import {
AppDeepLink,
@ -103,6 +104,7 @@ export interface ObservabilityPublicPluginsStart {
charts: ChartsPluginStart;
data: DataPublicPluginStart;
dataViews: DataViewsPublicPluginStart;
dataViewEditor: DataViewEditorStart;
discover: DiscoverStart;
embeddable: EmbeddableStart;
exploratoryView: ExploratoryViewPublicStart;