Skip to content

Commit

Permalink
Merge pull request #29 from grafana/long-running-queries
Browse files Browse the repository at this point in the history
Make onRunQuery optional
  • Loading branch information
kevinwcyu authored Nov 7, 2022
2 parents 63bcbbd + d522c56 commit 2e96608
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/sql/QueryEditor/FillValueSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const SelectableFillValueOptions: Array<SelectableValue<FillValueOptions>
export type FillValueSelectProps<TQuery extends DataQuery> = {
query: TQuery;
onChange: (value: TQuery) => void;
onRunQuery: () => void;
onRunQuery?: () => void;
};

export function FillValueSelect<TQuery extends DataQuery & Record<string, any>>(props: FillValueSelectProps<TQuery>) {
Expand All @@ -43,7 +43,7 @@ export function FillValueSelect<TQuery extends DataQuery & Record<string, any>>(
// Keep the fillMode.value in case FillValueOptions.Value mode is selected back
fillMode: { ...props.query.fillMode, mode: value },
});
props.onRunQuery();
props.onRunQuery?.();
}}
className="width-12"
menuShouldPortal={true}
Expand All @@ -64,7 +64,7 @@ export function FillValueSelect<TQuery extends DataQuery & Record<string, any>>(
},
})
}
onBlur={() => props.onRunQuery()}
onBlur={() => props.onRunQuery?.()}
/>
</InlineField>
)}
Expand Down
4 changes: 2 additions & 2 deletions src/sql/QueryEditor/FormatSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export type FormatSelectProps<TQuery extends DataQuery, FormatOptions> = {
query: TQuery;
options: Array<SelectableValue<FormatOptions>>;
onChange: (value: TQuery) => void;
onRunQuery: () => void;
onRunQuery?: () => void;
};

export function FormatSelect<TQuery extends DataQuery & Record<string, any>, FormatOptions>(
Expand All @@ -17,7 +17,7 @@ export function FormatSelect<TQuery extends DataQuery & Record<string, any>, For
...props.query,
format: e.value || 0,
});
props.onRunQuery();
props.onRunQuery?.();
};
return (
<InlineField label="Format as" labelWidth={11}>
Expand Down

0 comments on commit 2e96608

Please sign in to comment.