[RAM] Add shareable rule status filter#130705
Conversation
| import { FormattedMessage } from '@kbn/i18n-react'; | ||
| import { EuiFilterButton, EuiPopover, EuiFilterGroup, EuiFilterSelectItem } from '@elastic/eui'; | ||
|
|
||
| type State = 'enabled' | 'muted' | 'disabled'; |
There was a problem hiding this comment.
@JiaweiWu I know this PR is still a draft, but I would like to give an input at this stage. It should be snoozed instead of muted
| ) => ReactElement<RuleEditProps>; | ||
| getAlertsTable: (props: AlertsTableProps) => ReactElement<AlertsTableProps>; | ||
| getRuleStatusDropdown: (props: RuleStatusDropdownProps) => ReactElement<RuleStatusDropdownProps>; | ||
| getRuleStateFilter: (props: RuleStateFilterProps) => ReactElement<RuleStateFilterProps>; |
There was a problem hiding this comment.
@JiaweiWu Do you think we should call it getRuleStatusFilter instead?
|
@JiaweiWu As we discussed for the status filter to work, we need some API changes as well, since we are currently using That being said I expect some changes in this function call https://github.com/elastic/kibana/blob/main/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/rules.ts#L40, where we need to pass the new statusFilter along with the rest filters that are currently being passed. This means that this file https://github.com/elastic/kibana/blob/main/x-pack/plugins/triggers_actions_ui/public/application/lib/rule_api/map_filters_to_kql.ts needs to be changed as well. |
|
@elasticmachine merge upstream |
|
@mgiota I added changes to the |
|
@elasticmachine merge upstream |
|
Pinging @elastic/response-ops (Team:ResponseOps) |
💔 Build FailedFailed CI StepsTest Failures
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
async chunk count
ESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
|
@JiaweiWu I just checked out your branch locally and Stack Management rules page is currently broken. It is most probably related to the refactoring you did to the executionStatus. I will try to use now the shared component in Observability and will give update you on this. |
|
@JiaweiWu I confirm that I just had to make one small change in triggers_actions_ui plugin to make it work. I will leave a comment inline to export |
| RuleTableItem, | ||
| RuleType, | ||
| RuleTypeIndex, | ||
| RuleStatus, |
There was a problem hiding this comment.
Could you export RuleStatus here https://github.com/elastic/kibana/blob/main/x-pack/plugins/triggers_actions_ui/public/index.ts#L15, so that we don't have to redefine the same type in observability?
| ); | ||
| const [showErrors, setShowErrors] = useState(false); | ||
|
|
||
| const isRuleStatusFilterEnabled = getIsExperimentalFeatureEnabled('ruleStatusFilter'); |
There was a problem hiding this comment.
oh no, you shouldn't need to check the experiment in o11y.
I'm doing it here because this is a new filter for the rules list and we don't want to expose it to the user yet (until we get design feedback). So the experiment hides it for the triggers actions UI rules list.
There was a problem hiding this comment.
Ok I see, thanks for clarifying!
| ruleStatusesFilter?: string[]; | ||
| ruleExecutionStatusesFilter?: string[]; | ||
| }): Promise<RuleAggregations> { | ||
| const filters = mapFiltersToKql({ typesFilter, actionTypesFilter, ruleStatusesFilter }); |
There was a problem hiding this comment.
@JiaweiWu Out of curiosity I was wondering why the new ruleStatusesFilter is not included here. Is it because the options of the rule status filter is a static hardcoded list (enabled, disabled, snoozed)?
There was a problem hiding this comment.
do we want to filter the aggregate results as well? I suppose we do, I can add it
chrisronline
left a comment
There was a problem hiding this comment.
LGTM! One comment about adding a test
| }); | ||
|
|
||
| test('should handle ruleStatusesFilter', () => { | ||
| expect( |
There was a problem hiding this comment.
should we add a test for just disabled too?
|
@elasticmachine merge upstream |
💛 Build succeeded, but was flakyTest FailuresMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
async chunk count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
* Add severity field to create API and migration * Adds integration test for severity field migration * remove exclusive test * Change severity levels * Update integration tests for post case * Add more integration tests * Fix all cases list test * Fix some server test * Fix util server test * Fix client util test * Convert event log's duration from number to string in Kibana (keep as "long" in Elasticsearch) (#130819) * Convert event.duration to string in TypeScript, keep as long in Elasticsearch * Fix jest test * Fix functional tests * Add ecsStringOrNumber to event log schema * Fix jest test * Add utility functions to event log plugin * Use new event log utility functions * PR fixes Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> * filter o11y rule aggregations (#131301) * [Cloud Posture] Display and save rules per benchmark (#131412) * Adding aria-label for discover data grid select document checkbox (#131277) * Update API docs (#130999) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> * [CI] Use GCS buckets for bazel remote caching (#131345) * [Actionable Observability] Add license modal to rules table (#131232) * Add fix license link * fix localization * fix CI error * fix more translation issues Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> * [RAM] Add shareable rule status filter (#130705) * rule state filter * turn off experiment * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * Status filter API call * Fix tests * rename state to status, added tests * Address comments and fix tests * Revert experiment flag * Remove unused translations * Addressed comments Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> * [storybook] Watch for changes in packages (#131467) * [storybook] Watch for changes in packages * Update default_config.ts * Improve saved objects migrations failure errors and logs (#131359) * [Unified observability] Add tour step to guided setup (#131149) * [Lens] Improved interval input (#131372) * [Vega] Adjust vega doc for usage of ems files (#130948) * adjust vega doc * Update docs/user/dashboard/vega-reference.asciidoc Co-authored-by: Nick Peihl <nickpeihl@gmail.com> * Update docs/user/dashboard/vega-reference.asciidoc Co-authored-by: Nick Peihl <nickpeihl@gmail.com> * Update docs/user/dashboard/vega-reference.asciidoc Co-authored-by: Nick Peihl <nickpeihl@gmail.com> * Update docs/user/dashboard/vega-reference.asciidoc Co-authored-by: Nick Peihl <nickpeihl@gmail.com> * Update docs/user/dashboard/vega-reference.asciidoc Co-authored-by: Nick Peihl <nickpeihl@gmail.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Nick Peihl <nickpeihl@gmail.com> * Excess intersections * Create severity user action * Add severity to create_case user action * Fix and add integration tests * Minor improvements Co-authored-by: Mike Côté <mikecote@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: mgiota <panagiota.mitsopoulou@elastic.co> Co-authored-by: Jordan <51442161+JordanSh@users.noreply.github.com> Co-authored-by: Bhavya RM <bhavya@elastic.co> Co-authored-by: Thomas Neirynck <thomas@elastic.co> Co-authored-by: Brian Seeders <brian.seeders@elastic.co> Co-authored-by: Jiawei Wu <74562234+JiaweiWu@users.noreply.github.com> Co-authored-by: Clint Andrew Hall <clint.hall@elastic.co> Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co> Co-authored-by: Alejandro Fernández Gómez <alejandro.fernandez@elastic.co> Co-authored-by: Joe Reuter <johannes.reuter@elastic.co> Co-authored-by: Nick Peihl <nickpeihl@gmail.com> Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>
* rule state filter * turn off experiment * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * Status filter API call * Fix tests * rename state to status, added tests * Address comments and fix tests * Revert experiment flag * Remove unused translations * Addressed comments Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
* Add severity field to create API and migration * Adds integration test for severity field migration * remove exclusive test * Change severity levels * Update integration tests for post case * Add more integration tests * Fix all cases list test * Fix some server test * Fix util server test * Fix client util test * Convert event log's duration from number to string in Kibana (keep as "long" in Elasticsearch) (elastic#130819) * Convert event.duration to string in TypeScript, keep as long in Elasticsearch * Fix jest test * Fix functional tests * Add ecsStringOrNumber to event log schema * Fix jest test * Add utility functions to event log plugin * Use new event log utility functions * PR fixes Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> * filter o11y rule aggregations (elastic#131301) * [Cloud Posture] Display and save rules per benchmark (elastic#131412) * Adding aria-label for discover data grid select document checkbox (elastic#131277) * Update API docs (elastic#130999) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> * [CI] Use GCS buckets for bazel remote caching (elastic#131345) * [Actionable Observability] Add license modal to rules table (elastic#131232) * Add fix license link * fix localization * fix CI error * fix more translation issues Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> * [RAM] Add shareable rule status filter (elastic#130705) * rule state filter * turn off experiment * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * Status filter API call * Fix tests * rename state to status, added tests * Address comments and fix tests * Revert experiment flag * Remove unused translations * Addressed comments Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> * [storybook] Watch for changes in packages (elastic#131467) * [storybook] Watch for changes in packages * Update default_config.ts * Improve saved objects migrations failure errors and logs (elastic#131359) * [Unified observability] Add tour step to guided setup (elastic#131149) * [Lens] Improved interval input (elastic#131372) * [Vega] Adjust vega doc for usage of ems files (elastic#130948) * adjust vega doc * Update docs/user/dashboard/vega-reference.asciidoc Co-authored-by: Nick Peihl <nickpeihl@gmail.com> * Update docs/user/dashboard/vega-reference.asciidoc Co-authored-by: Nick Peihl <nickpeihl@gmail.com> * Update docs/user/dashboard/vega-reference.asciidoc Co-authored-by: Nick Peihl <nickpeihl@gmail.com> * Update docs/user/dashboard/vega-reference.asciidoc Co-authored-by: Nick Peihl <nickpeihl@gmail.com> * Update docs/user/dashboard/vega-reference.asciidoc Co-authored-by: Nick Peihl <nickpeihl@gmail.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Nick Peihl <nickpeihl@gmail.com> * Excess intersections * Create severity user action * Add severity to create_case user action * Fix and add integration tests * Minor improvements Co-authored-by: Mike Côté <mikecote@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: mgiota <panagiota.mitsopoulou@elastic.co> Co-authored-by: Jordan <51442161+JordanSh@users.noreply.github.com> Co-authored-by: Bhavya RM <bhavya@elastic.co> Co-authored-by: Thomas Neirynck <thomas@elastic.co> Co-authored-by: Brian Seeders <brian.seeders@elastic.co> Co-authored-by: Jiawei Wu <74562234+JiaweiWu@users.noreply.github.com> Co-authored-by: Clint Andrew Hall <clint.hall@elastic.co> Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co> Co-authored-by: Alejandro Fernández Gómez <alejandro.fernandez@elastic.co> Co-authored-by: Joe Reuter <johannes.reuter@elastic.co> Co-authored-by: Nick Peihl <nickpeihl@gmail.com> Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>



Summary
Resolves: #130160
Adds a shareable rule status filter, this is a new component that does not exist as a part of the rule list. Therefore, it is not being used, expect as a shareable component.
Also renames the existing
rule_status_filtertorule_execution_status_filter.