Refines hasAnyData check for alerts#117499
Conversation
|
I feel the change that needs to happen is to not use an array for alerts, but I'm not sure why is there. @cauemarcondes The logic seems to have been introdued in https://github.com/elastic/kibana/pull/80644/files#diff-68524697b54a56da17a8561e97878fc82f52d1e5064230c81a9e60568989415dR21. Do you remember the reason to treat alerts differently and store the presence of data as an array? |
x-pack/plugins/observability/public/context/has_data_context.tsx
Outdated
Show resolved
Hide resolved
|
@afgomez that sounds the cleanest approach, however I wasn't sure it was the correct one. I would be worried if the has data context uses the list of alerts in another call site. |
@afgomez FWIR alert is handled differently because it is the only plugin that we don't use the standard registration process to get the data. |
|
@cauemarcondes but what's the reason to keep the |
I believe that was a mistake on my part, |
|
@cauemarcondes nice, sounds like a good follow-up task 😜 |
afgomez
left a comment
There was a problem hiding this comment.
I do think it's worth removing the array from hasData, but it looks like a slightly more convoluted task and it can be done in a separate PR (maybe by @elastic/unified-observability).
We can move forward with this as-is to unblock you @claudiopro
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
* Refines hasAnyData check for alerts * Fixes type refinements * Applies review feedback * Naming is hard
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
…ink-to-kibana-app * 'main' of github.com:elastic/kibana: (290 commits) [Connectors][ServiceNow] Remove SN flags (elastic#117511) [ML] Functional tests - stabilize and re-enable feature importance tests (elastic#117503) [RAC] Disable the actions button if the user has inadequate privileges (elastic#117488) [Visualize] [xyChart] filter labels by default (elastic#117288) Fix warning when setting description to undefined (elastic#117338) [build] Set monitoring.ui.container.elasticsearch.enabled for all containers (elastic#115087) fix types [Alerting] UX fixes for execution duration chart (elastic#117193) [CI] Delete node_modules in between bootstrap attempts (elastic#117588) Flaky test fixes (elastic#117028) [Security Solution] [Sourcerer] [Feature Branch] Update to use Kibana Data Views (elastic#114806) [ML] Hide anomaly entity filter button tooltips when clicked (elastic#117493) adjust the synthetics journey type (elastic#117316) Refines hasAnyData check for alerts (elastic#117499) [Fleet] Default to APM tutorial (elastic#117421) [Maps] update docs for index pattern -> data view rename (elastic#117400) [Logs UI][Metrics UI] Remove deprecated config fields from APIs and SavedObjects (elastic#116821) [Fleet] Fix agent logs not reading query from URL (elastic#117286) Fixing Failing test: Chrome X-Pack UI Functional Tests.x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/alert_create_flyout·ts - Actions and Triggers app create alert should successfully test valid es_query alert (elastic#114917) [Metrics UI] Add docs link to redundant groupBy detection (elastic#116822) ... # Conflicts: # x-pack/plugins/reporting/public/management/__snapshots__/report_listing.test.tsx.snap # x-pack/plugins/reporting/public/shared_imports.ts # x-pack/plugins/reporting/server/routes/management/jobs.ts
I'm tracking this in #117638 |
|
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
|
@afgomez I'm confused about the message by @kibanamachine, does it require an action on my end? |
|
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
|
@claudiopro yes. We need to take care of this PR #117578 The backport mechanism replicates PRs on top of different branches, in this case on top of the As a first step I'd run |
|
Super, thanks! I'll merge and watch the build status. |
Summary
This PR fixes #116759 by refining the condition that determines
hasAnyDatato accommodate for the case whenapp === 'alerts'whosehasDatafield is always set to anArray, eventually empty:Once applied this change, the Alerts page renders fine for a user in a role with the matrix of permissions described in #116759.
Before
After
Checklist
Delete any items that are not applicable to this PR.