SQL: Add macro support in select case (#88514)
* Feat: timeGroup macro handling in VQB * Add tests * Add functions to SQL ds * Fix lint errors * Add feature toggle * Add rendering based on object * Fix lint * Fix CI failures * Fix tests * Address review comments * Add docs * Fix JSX runtime warnings * Remove docs part that mentions suggest more macros * Update docs/sources/shared/datasources/sql-query-builder-macros.md Co-authored-by: Jack Baldry <jack.baldry@grafana.com> * Add smoke test for this feature * lint * Add supported macros to influx * Add setupTests.ts to include in tsconfig.json * Import jest-dom instead of setupTests.ts --------- Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
This commit is contained in:
co-authored by
Jack Baldry
parent
aacc83be5c
commit
85c696c4ad
@@ -117,7 +117,7 @@ func newAppBuilderGroup(cfg RunnerConfig, provider app.Provider) (appBuilderGrou
|
||||
|
||||
func (g *appBuilderGroup) setApp(app app.App) {
|
||||
g.app = app
|
||||
for i, _ := range g.builders {
|
||||
for i := range g.builders {
|
||||
g.builders[i].setApp(app)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ var typedResources = map[string]TypeInfo{
|
||||
NewNamespaceResourceIdent(
|
||||
folderalpha1.FolderResourceInfo.GroupResource().Group,
|
||||
folderalpha1.FolderResourceInfo.GroupResource().Resource,
|
||||
): TypeInfo{Type: "folder2"},
|
||||
): {Type: "folder2"},
|
||||
}
|
||||
|
||||
func GetTypeInfo(group, resource string) (TypeInfo, bool) {
|
||||
|
||||
@@ -676,9 +676,9 @@ func TestGetParentNames(t *testing.T) {
|
||||
{UID: "libraryElementUID-1"},
|
||||
},
|
||||
expectedParentNames: map[cloudmigration.MigrateDataType][]string{
|
||||
cloudmigration.DashboardDataType: []string{"", "Folder A", "Folder B"},
|
||||
cloudmigration.FolderDataType: []string{"Folder A"},
|
||||
cloudmigration.LibraryElementDataType: []string{"Folder A"},
|
||||
cloudmigration.DashboardDataType: {"", "Folder A", "Folder B"},
|
||||
cloudmigration.FolderDataType: {"Folder A"},
|
||||
cloudmigration.LibraryElementDataType: {"Folder A"},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -28,5 +28,6 @@ const (
|
||||
enterpriseDatasourcesSquad codeowner = "@grafana/enterprise-datasources"
|
||||
grafanaSharingSquad codeowner = "@grafana/sharing-squad"
|
||||
grafanaDatabasesFrontend codeowner = "@grafana/databases-frontend"
|
||||
grafanaOSSBigTent codeowner = "@grafana/oss-big-tent"
|
||||
growthAndOnboarding codeowner = "@grafana/growth-and-onboarding"
|
||||
)
|
||||
|
||||
@@ -1305,6 +1305,13 @@ var (
|
||||
Owner: grafanaPluginsPlatformSquad,
|
||||
Expression: "false", // disabled by default
|
||||
},
|
||||
{
|
||||
Name: "sqlQuerybuilderFunctionParameters",
|
||||
Description: "Enables SQL query builder function parameters",
|
||||
Stage: FeatureStageExperimental,
|
||||
Owner: grafanaOSSBigTent,
|
||||
FrontendOnly: true,
|
||||
},
|
||||
{
|
||||
Name: "azureMonitorPrometheusExemplars",
|
||||
Description: "Allows configuration of Azure Monitor as a data source that can provide Prometheus exemplars",
|
||||
|
||||
@@ -171,6 +171,7 @@ alertingDisableSendAlertsExternal,experimental,@grafana/alerting-squad,false,fal
|
||||
preserveDashboardStateWhenNavigating,experimental,@grafana/dashboards-squad,false,false,false
|
||||
alertingCentralAlertHistory,experimental,@grafana/alerting-squad,false,false,true
|
||||
pluginProxyPreserveTrailingSlash,GA,@grafana/plugins-platform-backend,false,false,false
|
||||
sqlQuerybuilderFunctionParameters,experimental,@grafana/oss-big-tent,false,false,true
|
||||
azureMonitorPrometheusExemplars,preview,@grafana/partner-datasources,false,false,false
|
||||
pinNavItems,GA,@grafana/grafana-frontend-platform,false,false,false
|
||||
authZGRPCServer,experimental,@grafana/identity-access-team,false,false,false
|
||||
|
||||
|
@@ -695,6 +695,10 @@ const (
|
||||
// Preserve plugin proxy trailing slash.
|
||||
FlagPluginProxyPreserveTrailingSlash = "pluginProxyPreserveTrailingSlash"
|
||||
|
||||
// FlagSqlQuerybuilderFunctionParameters
|
||||
// Enables SQL query builder function parameters
|
||||
FlagSqlQuerybuilderFunctionParameters = "sqlQuerybuilderFunctionParameters"
|
||||
|
||||
// FlagAzureMonitorPrometheusExemplars
|
||||
// Allows configuration of Azure Monitor as a data source that can provide Prometheus exemplars
|
||||
FlagAzureMonitorPrometheusExemplars = "azureMonitorPrometheusExemplars"
|
||||
|
||||
@@ -2985,6 +2985,19 @@
|
||||
"codeowner": "@grafana/grafana-app-platform-squad"
|
||||
}
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"name": "sqlQuerybuilderFunctionParameters",
|
||||
"resourceVersion": "1718487716739",
|
||||
"creationTimestamp": "2024-06-15T21:41:56Z"
|
||||
},
|
||||
"spec": {
|
||||
"description": "Enables SQL query builder function parameters",
|
||||
"stage": "experimental",
|
||||
"codeowner": "@grafana/oss-big-tent",
|
||||
"frontend": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"metadata": {
|
||||
"name": "sseGroupByDatasource",
|
||||
|
||||
Reference in New Issue
Block a user