Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
benfdking committed Jun 26, 2024
1 parent b1420c2 commit 6b75cfb
Show file tree
Hide file tree
Showing 18 changed files with 2,187 additions and 1,350 deletions.
122 changes: 109 additions & 13 deletions js/packages/proto/src/generated/quary/service/v1/wasm_rust_rpc_calls.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 27 additions & 18 deletions js/packages/quary-extension-bus/src/globalViewState.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { SqlLanguage } from './config'
import { ProjectDag } from '@quary/proto/quary/service/v1/project_dag'
import {
ListAssetsResponse_Asset,
ReturnDashboardWithSqlResponse
DashboardRenderingItem,
ListAssetsResponse_Asset,
} from '@quary/proto/quary/service/v1/wasm_rust_rpc_calls'
import { Project } from '@quary/proto/quary/service/v1/project'
import { TestRunner } from '@quary/proto/quary/service/v1/test_runner'
Expand All @@ -12,6 +12,7 @@ import { ProjectFileSource } from '@quary/proto/quary/service/v1/project_file'
import { ChartFile } from '@quary/proto/quary/service/v1/chart_file'
import { Table } from '@quary/proto/quary/service/v1/table'
import { QuaryError } from './result'
import { Dashboard } from '@quary/proto/quary/service/v1/dashboard'

/**
* The message type that is sent to the webview when the global state is set.
Expand Down Expand Up @@ -109,25 +110,33 @@ export type ChartEditorData = {
title: string
chartFile?: ChartFile
allAssets: string[]
results:
| {
type: 'not loaded'
}
| {
type: 'loading'
}
| {
type: 'error'
error: QuaryError
}
| {
type: 'success'
queryResult: QueryResult
}
results: ChartResult
}

type ChartResult =
| {
type: 'not loaded'
}
| {
type: 'loading'
}
| {
type: 'error'
error: QuaryError
}
| {
type: 'success'
queryResult: QueryResult
}

export type DashboardEditorData = {
dashboardFile: ReturnDashboardWithSqlResponse
dashboard: Dashboard
items: DashboardEditorDataItem[]
}

export type DashboardEditorDataItem = {
item: DashboardRenderingItem
result: ChartResult
}

export type SqlDocumentationResultsView =
Expand Down
5 changes: 2 additions & 3 deletions js/packages/quary-extension-ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { ErrorView } from '@ui/views/ErrorView'
import { ExecuteSQLView } from '@ui/views/ExecuteSQL'
import { ImportSourcesView } from '@ui/views/ImportSourcesView'
import { ChartEditorView } from '@ui/views/ChartEditorView'
import { DashboardEditorView } from '@ui/views/DashboardEditorView'

function App() {
const [view] = useGlobalState()
Expand Down Expand Up @@ -111,9 +112,7 @@ function App() {
return <ChartEditorView data={view.data} />
}
case 'dashboardEditor': {
return (
<div>Dashboard editor {JSON.stringify(view.data.dashboardFile)} </div>
)
return <DashboardEditorView data={view.data} />
}
default:
return <div>Invalid view type {JSON.stringify(view)}</div>
Expand Down
Loading

0 comments on commit 6b75cfb

Please sign in to comment.