File tree Expand file tree Collapse file tree
packages/app/src/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export type SavedChartConfigWithSelectArray = Omit<
2323 * arrays. `series` stores the array `select` data for the form.
2424 **/
2525export type ChartEditorFormState = Partial < BuilderSavedChartConfig > &
26- Partial < RawSqlSavedChartConfig > & {
26+ Partial < Omit < RawSqlSavedChartConfig , 'configType' > > & {
2727 series : SavedChartConfigWithSelectArray [ 'select' ] ;
28+ configType ?: 'sql' | 'builder' ;
2829 } ;
Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ export function convertSavedChartConfigToFormState(
135135) : ChartEditorFormState {
136136 return {
137137 ...config ,
138- configType : isRawSqlSavedChartConfig ( config ) ? 'sql' : undefined ,
138+ configType : isRawSqlSavedChartConfig ( config ) ? 'sql' : 'builder' ,
139139 series :
140140 isBuilderSavedChartConfig ( config ) && Array . isArray ( config . select )
141141 ? config . select . map ( s => ( {
Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ import { zodResolver } from '@hookform/resolvers/zod';
1616import { tcFromSource } from '@hyperdx/common-utils/dist/core/metadata' ;
1717import {
1818 isBuilderChartConfig ,
19- isBuilderSavedChartConfig ,
2019 isRawSqlChartConfig ,
2120 isRawSqlSavedChartConfig ,
2221} from '@hyperdx/common-utils/dist/guards' ;
@@ -1063,7 +1062,7 @@ export default function EditTimeChartForm({
10631062 < SegmentedControl
10641063 value = { value === 'sql' ? 'sql' : 'builder' }
10651064 onChange = { ( value : string ) => {
1066- onChange ( value == 'sql' ? 'sql' : undefined ) ;
1065+ onChange ( value == 'sql' ? 'sql' : 'builder' ) ;
10671066 } }
10681067 data = { [
10691068 { label : 'Builder' , value : 'builder' } ,
You can’t perform that action at this time.
0 commit comments