Skip to content

Commit

Permalink
fix: cannot create a query when autosave is active
Browse files Browse the repository at this point in the history
  • Loading branch information
nextchamp-saqib committed Dec 1, 2024
1 parent 8a07769 commit a43c769
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions frontend/src2/workbook/Workbook.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const route = useRoute()
const workbook = useWorkbook(props.name)
provide(workbookKey, workbook)
window.workbook = workbook
const keys = useMagicKeys()
const cmdS = keys['Meta+S']
Expand Down
11 changes: 8 additions & 3 deletions frontend/src2/workbook/workbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ export default function useWorkbook(name: string) {
title: `Query ${idx + 1}`,
use_live_connection: true,
operations: [],
is_builder_query: false,
is_native_query: false,
is_script_query: false,
})
setActiveTab('query', idx)
}
Expand Down Expand Up @@ -295,10 +298,12 @@ function getWorkbookResource(name: string) {
doc.dashboards = safeJSONParse(doc.dashboards) || []

doc.queries.forEach((query: any) => {
if (!query.is_native_query && !query.is_script_query) {
if (
query.is_native_query === undefined &&
query.is_script_query === undefined &&
query.is_builder_query === undefined
) {
query.is_builder_query = true
} else {
query.is_builder_query = false
}
})

Expand Down

0 comments on commit a43c769

Please sign in to comment.