* For the nodes listing page, do not fetch shard data for indices
* Optimize our shard queries for the index and node listing pages
* This change isn't necessary
* Rename file and function
* Use optimized query for ml jobs and es overview
* Apply to node/index detail page, and more renaming
* Unnecessary change
* Fix tests
* Add basic tests
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Fix Watcher regression in which a threshold watch's termOrder and hasTermsAgg properties weren't being passed to the serializeThresholdWatch function.
* Remove unused upstreamJson getter method from server models.
* Finish implementing snapshot count redux code.
* Replace GQL-powered Snapshot export with Redux/Rest-powered version.
* Add tests for Snapshot API call.
* Rename new test file from tsx to ts, it has no JSX.
* Rename outdated snapshot file.
* Update filter groups to use redux and add tags dropdown.
* Delete obsolete graphql filter bar query.
* Add fetch effect factory.
* Use generic fetch effect factory to avoid code redundancy.
* Infer isDisabled status from data for filter group buttons and disable when there are no items.
* Fix removal of overview filter from previous rebase.
* Rename generator-related functions from *saga to *effect.
* WIP trying to make filters filterable.
* WIP cleaning up.
* Delete obsolete API test.
* Add API test for filters endpoint.
* Remove obsolete fields from overview filters.
* Add functional testing attributes and delete a comment for filter popover.
* Update obsolete unit test snapshots and test props for filter popover.
* Fix broken types and delete obsolete test snapshots for filters api call.
* Modify filters endpoint to adhere to np routing contracts.
* Add functional test and associated helper functions for filters API.
* Remove obsolete resolver function for filter bar.
* Remove obsolete FilterBar type from graphql schema.
* Delete static types generated for obsolete GQL schema types.
* Delete obsolete fields from default filters state.
* Delete obsolete method from graphql schema.
* Add default values to unit test that requires complete app state mock.
* Extract helper logic to dedicated module.
* Finish working on adapter/helper tests.
* Add state field for overview page search query.
* Apply search kuery to filters.
* Simplify creation of overview filter fetch actions and API call.
* Add tests for overview filter action creators.
* Simplify api query parameterizaton.
* Improve a variable name.
* Update formatting of file.
* Improve a variable name.
* Improve a variable name.
* Simplify API endpoint typing.
* Clean up helper code and rename some functions/vars.
* Clean up parameterization of filter values.
* Move function from dedicated file back to calling file.
* Clean up naming in a function.
* Move function from dedicated file to caller's file.
* Modify interface of function return value.
* Have function throw error when it receives invalid input instead of returning empty object.
* Extract constant value to dedicated function value and remove parameter from function.
* Clean up object declarations.
* Rename a property.
* Fix issue where function was not handling empty input.
* Delete unnecessary snapshots.
* Add message to internal server error response.
* Fix broken type.
* Delete type that was added as a result of a merge error.
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Adding placeholder for functionbeat telemetry in test fixture
* Adding placeholder for functionbeat telemetry expectation
* Adding placeholder for aggregating functionbeat telemetry per cluster
* Update test + fixture
* Updating code
Today, apps rely on AppState and GlobalState in the ui/state_management module to deal with internal (app) and shared (global) state. These classes give apps an ability to read/write state, when is then synced to the URL as well as sessionStorage. They also react to changes in the URL and automatically update state & emit events when changes occur.
This PR introduces new state synching utilities, which together with state containers src/plugins/kibana_utils/public/state_containers will be a replacement for AppState and GlobalState in New Platform.
* [ML] Display anomaly actual in chart tooltip when model plot enabled
* [ML] Fixes translations for chart tooltip fixes
* [ML] Edits to chart tooltip div following review
* add onAppLeave to AppMountParameters
* adapt legacy shims of app mount
* update generated doc
* returns properly typed AppLeaveAction from leave handler instead of raw strings
* add openConfirm to modal service and use it instead of window.confirm
* fix unit test
* update querystringinput snapshots
* add integration tests
* nits and review comments
* add functional tests
* Added max tree depth guard
Removed recursive normalizeTimes functions (one fewer iteration through the entire data structure)
Optimizied appliation of tree mutations by taking `if` out of tight loop
Cleaned up types
* Tidy up data being passed into store (and through immer)
* Fix max tree depth logic
* Remove immer from non-test code.
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
## Summary
* Adds Import and Export REST endpoints
* Fixes minor misc issues with types
* Changes camel case from bulk api to become snake_case
For the API and testing it is very similar to the saved objects API
For import:
```ts
POST /api/detection_engine/rules/_import
```
With a ndjson body of:
```ts
{"created_at":"2020-01-09T01:38:00.740Z","updated_at":"2020-01-09T01:38:00.740Z","created_by":"elastic_kibana","description":"Query with a rule_id that acts like an external id","enabled":true,"false_positives":[],"from":"now-6m","id":"6688f367-1aa2-4895-a5a8-b3701eecf57d","immutable":false,"interval":"5m","rule_id":"query-rule-id-1","language":"kuery","output_index":".siem-signals-frank-hassanabad-default","max_signals":100,"risk_score":1,"name":"Query with a rule id Number 1","query":"user.name: root or user.name: admin","references":[],"severity":"high","updated_by":"elastic_kibana","tags":[],"to":"now","type":"query","threats":[],"version":1}
{"created_at":"2020-01-09T01:38:00.745Z","updated_at":"2020-01-09T01:38:00.745Z","created_by":"elastic_kibana","description":"Query with a rule_id that acts like an external id","enabled":true,"false_positives":[],"from":"now-6m","id":"7a912444-6cfa-4c8f-83f4-2b26fb2a2ed9","immutable":false,"interval":"5m","rule_id":"query-rule-id-2","language":"kuery","output_index":".siem-signals-frank-hassanabad-default","max_signals":100,"risk_score":2,"name":"Query with a rule id Number 2","query":"user.name: root or user.name: admin","references":[],"severity":"low","updated_by":"elastic_kibana","tags":[],"to":"now","type":"query","threats":[],"version":1}
{"exported_count":2,"missing_rules":[],"missing_rules_count":0}
```
If you want to overwrite existing objects you can use the overwrite query parameter like so:
```ts
POST /api/detection_engine/rules/_import?overwrite=true
```
See and run the scripts of:
```ts
import_rules.sh
import_rules_no_overwrite.sh
```
For exporting everything:
```ts
POST /api/detection_engine/rules/_export
```
For exporting just a handful of things you would send a body like so:
```ts
POST /api/detection_engine/rules/_export
{
"objects": [
{
"rule_id": "query-rule-id-1"
},
{
"rule_id": "query-rule-id-2"
}
]
}
```
To change either the filename of the file that gets downloaded or to remove the extra appended export details you can do the following:
```ts
POST /api/detection_engine/rules/_export?exclude_export_details=true&file_name=my_file.ndjson"
```
See the scripts of:
```ts
export_rules.sh
export_rules_by_rule_id.sh
export_rules_by_rule_id_to_file.sh
export_rules_to_file.sh
```
### Checklist
Use ~~strikethroughs~~ to remove checklist items you don't feel are applicable to this PR.
~~- [ ] This was checked for cross-browser compatibility, [including a check against IE11](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility)~~
~~- [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/master/packages/kbn-i18n/README.md)~~
~~- [ ] [Documentation](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#writing-documentation) was added for features that require explanation or tutorials~~
- [x] [Unit or functional tests](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#cross-browser-compatibility) were updated or added to match the most common scenarios
~~- [ ] This was checked for [keyboard-only and screenreader accessibility](https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Cross_browser_testing/Accessibility#Accessibility_testing_checklist)~~
### For maintainers
~~- [ ] This was checked for breaking API changes and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)~~
- [x] This includes a feature addition or change that requires a release note and was [labeled appropriately](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#release-notes-process)
resolves https://github.com/elastic/kibana/issues/50522
The alert executor function is now passed these additional alert-specific
properties as parameters:
- spaceId
- namespace
- name
- tags
- createdBy
- updatedBy
* Fix server types
* Remove graphql types from the frontend
* More type cleanup
* Replace more types. Delete unused files
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* [Reporting] Update some runtime validations
* fix unit test
* i18n
* make warning logging of encryptionKey possible
* update snapshot
* revert unrelated config change
* Add header element to indices page for WCAG
* Add h1 element for WCAG to node page
* Add h1 element for WCAG to stack monitoring overview page
* Add h1 to advanced nodes page in stack monitoring
* Add h1 to nodes page in stack monitoring
* Add h1 header for index advanced page in stack monitoring
* Standarize more on ide for h1 tag
* Give heading element to beats overview
* Update Beats listing page for H1 compat with WAVE
* Modified beat page to comply with heading rules from WCAG
* Kibana instance listing page updated for header WCAG
* Add WCAG header fix to logstash listing page
* Added headings for WCAG to logstash overview page
* Update pipeline listing page for WCAG A headings
* Fix WCAG heading problems in pipeline viewer
* Fix screen reader heading for APM overview page
* Update APM instances page for screen reader headings
* Update APM instance page for screen reader heading
* Update ccr page for screen reader headings
* More a11y fixes for headings in stack monitoring
* Fixup
* Consistant captalization per review
* Removed help text per review comment
* Include Elasticsearch node into screen reader message, per review feedback
* Update snapshots
* Linting
* Implement review suggestion for i8n compat
* Revert back to just plain string
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Check for a trial license as well as platinum when loading the map
* Increase the z-index of the controls so clicking on them works
* Rename the styled component to `ControlsContainer` from `Container` to make a less ambiguous class name on the element