Make a dashboard its widgets: drop the pages and sections nobody drew
This commit is contained in:
@@ -8,7 +8,7 @@ import {
|
||||
runQueryOptions,
|
||||
shortId,
|
||||
} from "@/components/Runs/queries"
|
||||
import { type Dashboard, flatWidgets, pagesOf } from "./DashboardView"
|
||||
import { type Dashboard, widgetsOf } from "./DashboardView"
|
||||
import {
|
||||
type ContextLine,
|
||||
type DataContext,
|
||||
@@ -22,10 +22,9 @@ import {
|
||||
* asking the server for its whole series would be a query nobody draws.
|
||||
*/
|
||||
function chartedNames(dashboard: Dashboard | undefined): string[] {
|
||||
const page = pagesOf(dashboard ?? ({} as Dashboard))[0]
|
||||
if (!page) return []
|
||||
if (!dashboard) return []
|
||||
const names = new Set<string>()
|
||||
for (const widget of flatWidgets(page)) {
|
||||
for (const widget of widgetsOf(dashboard)) {
|
||||
if (widget.type !== "chart") continue
|
||||
const config = (widget.config ?? {}) as {
|
||||
series?: { message?: string }[]
|
||||
|
||||
Reference in New Issue
Block a user