Skip to content

Commit

Permalink
Fix search for Custom Dashboards (#5668)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericpgreen2 authored Sep 12, 2024
1 parent ba2a82e commit c628b2c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions web-admin/src/features/dashboards/listing/DashboardsTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,13 @@
},
{
id: "title",
accessorFn: (row: DashboardResource) =>
row.resource.metricsView.spec.title,
accessorFn: (row: DashboardResource) => {
const resource = row.resource;
const isMetricsExplorer = !!resource?.metricsView;
return isMetricsExplorer
? resource.metricsView.spec.title
: resource.dashboard.spec.title;
},
},
{
id: "name",
Expand All @@ -71,8 +76,11 @@
},
{
id: "description",
accessorFn: (row: DashboardResource) =>
row.resource.metricsView.spec.description,
accessorFn: (row: DashboardResource) => {
const resource = row.resource;
const isMetricsExplorer = !!resource?.metricsView;
return isMetricsExplorer ? resource.metricsView.spec.description : "";
},
},
];
Expand Down

1 comment on commit c628b2c

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

Please sign in to comment.