refactor(sql-expr): rename backendQueries to nonDashboardQueries
This commit is contained in:
+2
-2
@@ -11,9 +11,9 @@ describe('isDashboardDatasource', () => {
|
||||
{ refId: 'C', datasource: { uid: 'mysql-uid', type: 'mysql' } },
|
||||
];
|
||||
|
||||
const backendQueries = queries.filter((q) => !isDashboardDatasource(q));
|
||||
const nonDashboardQueries = queries.filter((q) => !isDashboardDatasource(q));
|
||||
|
||||
expect(backendQueries.map((q) => q.refId)).toEqual(['A', 'C']);
|
||||
expect(nonDashboardQueries.map((q) => q.refId)).toEqual(['A', 'C']);
|
||||
});
|
||||
|
||||
it('returns true when query has dashboard datasource uid', () => {
|
||||
|
||||
@@ -67,9 +67,9 @@ export function useSQLSchemas({ queries, enabled, timeRange }: UseSQLSchemasOpti
|
||||
|
||||
try {
|
||||
// Filter out Dashboard datasource queries - they are frontend-only and can't be processed by backend
|
||||
const backendQueries = currentQueries.filter((q) => !isDashboardDatasource(q));
|
||||
const nonDashboardQueries = currentQueries.filter((q) => !isDashboardDatasource(q));
|
||||
|
||||
if (backendQueries.length === 0) {
|
||||
if (nonDashboardQueries.length === 0) {
|
||||
setSchemas({ kind: 'SQLSchemaResponse', apiVersion: 'query.grafana.app/v0alpha1', sqlSchemas: {} });
|
||||
setLoading(false);
|
||||
return;
|
||||
@@ -81,7 +81,7 @@ export function useSQLSchemas({ queries, enabled, timeRange }: UseSQLSchemasOpti
|
||||
const response = await getBackendSrv().post<SQLSchemasResponse>(
|
||||
`/apis/query.grafana.app/v0alpha1/namespaces/${namespace}/sqlschemas/name`,
|
||||
{
|
||||
queries: backendQueries,
|
||||
queries: nonDashboardQueries,
|
||||
from: currentTimeRange.from.toISOString(),
|
||||
to: currentTimeRange.to.toISOString(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user