Skip to content

Fix empty Dashboard selector#243496

Merged
mgiota merged 40 commits intoelastic:mainfrom
mgiota:fix_empty_related_dashboards
Nov 26, 2025
Merged

Fix empty Dashboard selector#243496
mgiota merged 40 commits intoelastic:mainfrom
mgiota:fix_empty_related_dashboards

Conversation

@mgiota
Copy link
Contributor

@mgiota mgiota commented Nov 19, 2025

Fixes #243350

This PR fixes the issue where, no dashboards come up in the list when trying to link dashboards to a rule.

Before
515720113-9e346ea0-d5f6-4ef8-be8e-07db7d65743f (1)

After
Screenshot 2025-11-19 at 13 44 08

@github-actions github-actions bot added the author:obs-ux-management PRs authored by the obs ux management team label Nov 19, 2025
@mgiota mgiota changed the title temp, cursor assisted code Fix empty Dashboard selector Nov 19, 2025
plugins.contentManagement.favorites.registerFavoriteType('dashboard');

// Register dashboard in content management for search functionality
plugins.contentManagement.register({
Copy link
Contributor

@nreese nreese Nov 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the correct path. We removed content management because we want all interfacing with dashboards to go through the "dashboards as code" REST API. If your plugin depends on dashboard plugin, use findDashboardService search method exposed from the dashboard public start contract. If your plugin can not depend on dashboard plugin (because of circular dependencies), then use UI action searchDashboardAction. Here is an example of using the search action https://github.com/elastic/kibana/blob/main/src/platform/plugins/shared/presentation_util/public/components/dashboard_picker/dashboard_picker.tsx#L48

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I replaced contentManagement service with UiActions. I tested it locally and works. Let me know what you think

Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to remove entire src/platform/packages/shared/dashboards/dashboards-selector package and just use https://github.com/elastic/kibana/blob/main/src/platform/plugins/shared/presentation_util/public/index.ts#L22? This package is very duplicative of what already exists.

@cesco-f
Copy link
Contributor

cesco-f commented Nov 20, 2025

Would it be possible to remove entire src/platform/packages/shared/dashboards/dashboards-selector package and just use https://github.com/elastic/kibana/blob/main/src/platform/plugins/shared/presentation_util/public/index.ts#L22? This package is very duplicative of what already exists.

Is it possible to select multiple dashboards with the DashboardPicker?

That was the main reason why the dashboards-selector was created.

@mgiota mgiota force-pushed the fix_empty_related_dashboards branch from 92ad275 to 4434c0c Compare November 20, 2025 13:30
@nreese
Copy link
Contributor

nreese commented Nov 20, 2025

Is it possible to select multiple dashboards with the DashboardPicker?

That was the main reason why the dashboards-selector was created.

It was a mistake to put this component into its own package. Instead, this component should be a part of presentation-util-plugin. I have opened #243668 to track the issue

@mgiota mgiota force-pushed the fix_empty_related_dashboards branch from 5455bc5 to 7a0d454 Compare November 20, 2025 14:38
@mgiota mgiota force-pushed the fix_empty_related_dashboards branch from 7a0d454 to 9409d9c Compare November 20, 2025 14:43
@mgiota
Copy link
Contributor Author

mgiota commented Nov 20, 2025

@cesco-f Thanks for the review. I think I applied all your feedback. I'll do one more scan and then I will open it up for review.

@mgiota mgiota marked this pull request as ready for review November 20, 2025 20:10
@mgiota mgiota requested review from a team as code owners November 20, 2025 20:10
@mgiota mgiota requested a review from cesco-f November 21, 2025 13:51
Copy link
Contributor

@cesco-f cesco-f left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mgiota mgiota requested a review from nreese November 21, 2025 15:02
Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kibana-presentation changes LGTM
code review only

@@ -0,0 +1,41 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you rename file to get_dashboards_by_ids_action to match export getDashboardsByIdsAction

});

const results = await Promise.all(dashboardPromises);
// Fetch dashboards by their IDs directly instead of fetching all dashboards
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure comment is needed since it describes a change that no longer exists in the code base. This comment should be removed.

Copy link
Contributor

@js-jankisalvi js-jankisalvi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I missing something, couldn't see any dashboards even though they are available
Edit: fixed

Copy link
Contributor

@js-jankisalvi js-jankisalvi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified locally.

  • dashboards are visible in the dropdown
    • while creating rule from dashboards or o11y > rules page
    • while editing rules from o11y > rules page
  • not visible
    • while creating/editing rule from stack management > rules or security solution > rules page

@mgiota
Copy link
Contributor Author

mgiota commented Nov 26, 2025

@cesco-f I am trying to run the failing Synthetics tests locally, I get this error:

Screenshot 2025-11-26 at 11 40 17

On CI the add test monitor step works fine. It is the next one should create status rule that fails. Do you have any idea why I get the following error? Can you share the commands you use to run e2e Synthetic tests locally?

@mgiota
Copy link
Contributor Author

mgiota commented Nov 26, 2025

@js-jankisalvi Thanks for testing it out.

not visible
while creating/editing rule from stack management > rules

We actually want the related dashboards dropdown to be visible in the Stack Managamanet > Rules page as well. This was a bug, that I fixed in this commit

@js-jankisalvi
Copy link
Contributor

@js-jankisalvi Thanks for testing it out.

not visible
while creating/editing rule from stack management > rules

We actually want the related dashboards dropdown to be visible in the Stack Managamanet > Rules page as well. This was a bug, that I fixed in this commit

Able to see and select dashboards while creating/editing rule from stack management > rules 👍

@mgiota mgiota enabled auto-merge (squash) November 26, 2025 12:34
@mgiota mgiota disabled auto-merge November 26, 2025 14:18
@elasticmachine
Copy link
Contributor

elasticmachine commented Nov 26, 2025

💛 Build succeeded, but was flaky

  • Buildkite Build
  • Commit: d2d51e0
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-243496-d2d51e0e6453

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
apm 2045 2044 -1
dashboard 946 947 +1
datasetQuality 894 893 -1
discover 1845 1844 -1
infra 1728 1727 -1
ml 2811 2810 -1
monitoring 750 749 -1
observability 1600 1599 -1
slo 1314 1313 -1
synthetics 1371 1370 -1
transform 811 810 -1
triggersActionsUi 1091 1090 -1
uptime 895 894 -1
total -11

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/response-ops-rule-form 188 189 +1
triggersActionsUi 501 502 +1
total +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
apm 2.8MB 2.8MB -478.0B
dashboard 673.7KB 674.0KB +346.0B
datasetQuality 428.4KB 427.9KB -478.0B
discover 1.2MB 1.2MB -475.0B
infra 1.1MB 1.1MB -478.0B
ml 5.6MB 5.6MB -478.0B
monitoring 631.9KB 631.5KB -478.0B
observability 1.7MB 1.7MB -478.0B
slo 988.3KB 987.4KB -962.0B
synthetics 1.0MB 1.0MB -456.0B
transform 624.9KB 624.5KB -478.0B
triggersActionsUi 1.5MB 1.5MB -457.0B
uptime 490.7KB 490.2KB -478.0B
total -5.7KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
dashboard 17.6KB 17.7KB +155.0B
triggersActionsUi 106.7KB 106.7KB +66.0B
total +221.0B
Unknown metric groups

API count

id before after diff
@kbn/response-ops-rule-form 189 190 +1
triggersActionsUi 505 506 +1
total +2

History

@mgiota mgiota enabled auto-merge (squash) November 26, 2025 16:14
@mgiota mgiota merged commit 2759b77 into elastic:main Nov 26, 2025
12 checks passed
eokoneyo pushed a commit to eokoneyo/kibana that referenced this pull request Dec 2, 2025
Fixes elastic#243350

This PR fixes the issue where, no dashboards come up in the list when
trying to link dashboards to a rule.


Before
<img width="1068" height="237"
alt="515720113-9e346ea0-d5f6-4ef8-be8e-07db7d65743f (1)"
src="https://github.com/user-attachments/assets/97cf3e1f-a8bb-46e5-a99a-2b74e2689015"
/>


**After**
<img width="839" height="237" alt="Screenshot 2025-11-19 at 13 44 08"
src="https://github.com/user-attachments/assets/86af5081-c71b-4b29-96ea-dae630681bba"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@mgiota mgiota self-assigned this Dec 3, 2025
JordanSh pushed a commit to JordanSh/kibana that referenced this pull request Dec 9, 2025
Fixes elastic#243350

This PR fixes the issue where, no dashboards come up in the list when
trying to link dashboards to a rule.


Before
<img width="1068" height="237"
alt="515720113-9e346ea0-d5f6-4ef8-be8e-07db7d65743f (1)"
src="https://github.com/user-attachments/assets/97cf3e1f-a8bb-46e5-a99a-2b74e2689015"
/>


**After**
<img width="839" height="237" alt="Screenshot 2025-11-19 at 13 44 08"
src="https://github.com/user-attachments/assets/86af5081-c71b-4b29-96ea-dae630681bba"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author:obs-ux-management PRs authored by the obs ux management team backport:skip This PR does not require backporting ci:project-deploy-observability Create an Observability project release_note:fix Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. Team:obs-ux-management v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Related dashboards] empty list with dashboards during rule creation

6 participants