Commit 55287b3
authored
Fix Query Stats tab stuck on loading spinner (#6)
Pre-existing bug unrelated to Phase 1a. The sort dropdown and refresh
button in the Query Stats tab partial were commented out (likely in
79a17f7 when sortable column headers replaced the dropdown-based
sorting), but the JavaScript that reads their values and attaches
event listeners was left in place. When the tab loaded, the JS threw
TypeError on the null element, killing loadQueryStats() mid-flight
after it showed the spinner but before it issued the fetch — so the
spinner sat forever.
Fix: delete the commented-out div from _tab_query_stats.html.erb,
delete the dead var sort = el('qstats-sort').value line, hardcode
sort: 'total_time' in the ajaxGet call (matches the controller's
default), and delete the two addEventListener calls for the removed
elements. Client-side sortable column headers continue to provide
sort UX after data loads.
The Dashboard tab's "Top 5 expensive queries" widget was unaffected
because it uses its own ajaxGet with hardcoded sort params, which is
how Query Stats JSON data was still coming back over the wire even
though the UI was broken.1 parent 0e754bb commit 55287b3
2 files changed
Lines changed: 1 addition & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | 5 | | |
16 | 6 | | |
17 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1037 | 1037 | | |
1038 | 1038 | | |
1039 | 1039 | | |
1040 | | - | |
1041 | | - | |
| 1040 | + | |
1042 | 1041 | | |
1043 | 1042 | | |
1044 | 1043 | | |
| |||
1074 | 1073 | | |
1075 | 1074 | | |
1076 | 1075 | | |
1077 | | - | |
1078 | | - | |
1079 | | - | |
1080 | 1076 | | |
1081 | 1077 | | |
1082 | 1078 | | |
| |||
0 commit comments