Skip to content

Commit

Permalink
Chore: associate label with input element and update applySQLTemplate…
Browse files Browse the repository at this point in the history
…Variables type (#88)

* Chore: update applySQLTemplateVariables type to extend SQLQuery

* associate label with input for ResourceSelector

* keep id
  • Loading branch information
kevinwcyu authored Jun 19, 2024
1 parent b466731 commit 9eec011
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/sql/ResourceSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export function ResourceSelector(props: ResourceSelectorProps) {
<Select
{...props}
id={props.id}
inputId={props.id}
aria-label={props.label}
options={options}
onChange={onChange}
Expand All @@ -141,6 +142,7 @@ export function ResourceSelector(props: ResourceSelectorProps) {
<Select
{...props}
id={props.id}
inputId={props.id}
aria-label={props.label}
options={options}
onChange={onChange}
Expand Down
6 changes: 3 additions & 3 deletions src/sql/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ export function filterSQLQuery(query: SQLQuery): boolean {
return !!query.rawSQL;
}

export function applySQLTemplateVariables(
query: SQLQuery,
export function applySQLTemplateVariables<T extends SQLQuery>(
query: T,
scopedVars: ScopedVars,
getTemplateSrv: () => any
): SQLQuery {
): T {
const templateSrv = getTemplateSrv();
return {
...query,
Expand Down

0 comments on commit 9eec011

Please sign in to comment.