Skip to content

Commit

Permalink
fix: show query link if chart fails to load
Browse files Browse the repository at this point in the history
  • Loading branch information
nextchamp-saqib committed Jan 12, 2024
1 parent f744ee1 commit 42ff43e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion frontend/src/dashboard/DashboardItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function openQueryInNewTab() {
:options="item.options"
/>
<div class="absolute right-3 top-3 z-10 flex items-center">
<div class="absolute right-3 top-3 z-[10001] flex items-center">
<div v-if="chartFilters?.length">
<Tooltip :text="chartFilters.map((c) => c.label || c.column?.label).join(', ')">
<div
Expand Down
16 changes: 11 additions & 5 deletions frontend/src/widgets/useChartData.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,17 @@ export default function useChartData(options = {}) {
function load(query) {
if (!query) return
state.loading = true
return options.resultsFetcher().then((results) => {
state.loading = false
state.rawData = getFormattedResult(results)
state.data = convertResultToObjects(state.rawData)
})
return options
.resultsFetcher()
.then((results) => {
state.loading = false
state.rawData = getFormattedResult(results)
state.data = convertResultToObjects(state.rawData)
})
.error((error) => {
state.loading = false
state.error = error
})
}

if (options.query) {
Expand Down

0 comments on commit 42ff43e

Please sign in to comment.