GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix[frontend](dashboards): added visualizations update after edition · utmstack/UTMStack@04f6de1

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • frontend/src/features/dashboard/hooks
    • useVisualizationData.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎frontend/src/features/dashboard/hooks/useVisualizationData.ts‎

Copy file name to clipboardExpand all lines: frontend/src/features/dashboard/hooks/useVisualizationData.ts
+12-3Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ const EMPTY_FILTERS: FilterType[] = []
1515

1616
export const VISUALIZATION_DATA_QUERY_KEYS = {
1717
all: ['visualization-data'] as const,
18-
forViz: (vizId: string, fromISO: string, toISO: string, filtersKey: string) =>
19-
[...VISUALIZATION_DATA_QUERY_KEYS.all, vizId, fromISO, toISO, filtersKey] as const,
18+
forViz: (vizId: string, fromISO: string, toISO: string, filtersKey: string, specKey: string) =>
19+
[...VISUALIZATION_DATA_QUERY_KEYS.all, vizId, fromISO, toISO, filtersKey, specKey] as const,
2020
}
2121

2222
export interface VisualizationData {
@@ -63,7 +63,16 @@ export function useVisualizationData(
6363

6464
return useQuery<VisualizationData>({
6565
queryKey: visualization
66-
? VISUALIZATION_DATA_QUERY_KEYS.forViz(visualization.id, fromISO, toISO, filtersKey)
66+
? VISUALIZATION_DATA_QUERY_KEYS.forViz(
67+
visualization.id,
68+
fromISO,
69+
toISO,
70+
filtersKey,
71+
// The saved spec decides what the backend queries. Without it in the
72+
// key, editing a widget leaves the old data cached and staleTime
73+
// keeps serving it after returning to the dashboard.
74+
visualization.spec,
75+
)
6776
: [...VISUALIZATION_DATA_QUERY_KEYS.all, 'noop'],
6877
queryFn: async () => {
6978
if (!spec) return { rows: [], total: 0 }

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.