-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Watcher] Fix simulate flyout blank page (#178016)
Fixes #177745 ## Summary This PR fixes the bug in the simulate flyout which caused a blank page when the watch execution returns no execution result. It also adds a check for whether there is an execution result with the condition property and only then displays the condition status under the title. **How to test:** 1. Go to Stack Management -> Watcher 2. Start creating an advanced watch. 3. Add the following json in the editor (it contains an invalid `interval` property in the `date_histogram` parameter): ``` { "trigger": { "schedule": { "interval": "10m" } }, "input": { "search": { "request": { "search_type": "query_then_fetch", "indices": [ "test*" ], "rest_total_hits_as_int": true, "body": { "size": "0", "query": { "match_all": {} }, "aggs": { "dateHistogram": { "date_histogram": { "field": "@timestamp", "interval": "1m" } } } } } } }, "condition": { "always": {} }, "actions": {} } ``` 5. Click on the "Simulate" tab and then the "Simulate" button. 6. Verify the page doesn't crash and no condition met status is displayed since the watch execution failed. 7. Start creating a new advanced watch, this time use the already provided json, which is valid. 8. Click on Simulate and verify that the Condition met status is displayed correctly - you can change the `condition.compare.ctx.payload.hits.total.gte` property in the json to `0` in order to see a "Condition met" status.
- Loading branch information
1 parent
1524236
commit be634a3
Showing
2 changed files
with
122 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters