Dashboards: Add feature toggle to use dashboard level time macros in scenes (#108670)

* Add feature toggle to use dashboard level time macros in scenes

* Add test

* remove unregister time macro as it was removed from scenes
This commit is contained in:
Oscar Kilhed
2025-07-31 11:49:07 +02:00
committed by GitHub
parent d71924ea7b
commit e7cfe0c023
9 changed files with 143 additions and 3 deletions
-2
View File
@@ -90,7 +90,6 @@ func (_m *FakeDashboardStore) CountInOrg(ctx context.Context, orgID int64, isFol
return r0, r1
}
// DeleteDashboard provides a mock function with given fields: ctx, cmd
func (_m *FakeDashboardStore) DeleteDashboard(ctx context.Context, cmd *DeleteDashboardCommand) error {
ret := _m.Called(ctx, cmd)
@@ -127,7 +126,6 @@ func (_m *FakeDashboardStore) DeleteDashboardsInFolders(ctx context.Context, req
return r0
}
// FindDashboards provides a mock function with given fields: ctx, query
func (_m *FakeDashboardStore) FindDashboards(ctx context.Context, query *FindPersistedDashboardsQuery) ([]DashboardSearchProjection, error) {
ret := _m.Called(ctx, query)
+7
View File
@@ -1857,6 +1857,13 @@ var (
Owner: grafanaDataProSquad,
FrontendOnly: true,
},
{
Name: "dashboardLevelTimeMacros",
Description: "Supports __from and __to macros that always use the dashboard level time range",
Stage: FeatureStageExperimental,
Owner: grafanaDashboardsSquad,
FrontendOnly: true,
},
{
Name: "alertmanagerRemoteSecondaryWithRemoteState",
Description: "Starts Grafana in remote secondary mode pulling the latest state from the remote Alertmanager to avoid duplicate notifications.",
+1
View File
@@ -240,5 +240,6 @@ alertingNotificationHistory,experimental,@grafana/alerting-squad,false,false,fal
pluginAssetProvider,experimental,@grafana/plugins-platform-backend,false,true,false
unifiedStorageSearchDualReaderEnabled,experimental,@grafana/search-and-storage,false,false,false
dashboardDsAdHocFiltering,experimental,@grafana/datapro,false,false,true
dashboardLevelTimeMacros,experimental,@grafana/dashboards-squad,false,false,true
alertmanagerRemoteSecondaryWithRemoteState,experimental,@grafana/alerting-squad,false,false,false
adhocFiltersInTooltips,experimental,@grafana/datapro,false,false,true
1 Name Stage Owner requiresDevMode RequiresRestart FrontendOnly
240 pluginAssetProvider experimental @grafana/plugins-platform-backend false true false
241 unifiedStorageSearchDualReaderEnabled experimental @grafana/search-and-storage false false false
242 dashboardDsAdHocFiltering experimental @grafana/datapro false false true
243 dashboardLevelTimeMacros experimental @grafana/dashboards-squad false false true
244 alertmanagerRemoteSecondaryWithRemoteState experimental @grafana/alerting-squad false false false
245 adhocFiltersInTooltips experimental @grafana/datapro false false true
+4
View File
@@ -971,6 +971,10 @@ const (
// Enables adhoc filtering support for the dashboard datasource
FlagDashboardDsAdHocFiltering = "dashboardDsAdHocFiltering"
// FlagDashboardLevelTimeMacros
// Supports __from and __to macros that always use the dashboard level time range
FlagDashboardLevelTimeMacros = "dashboardLevelTimeMacros"
// FlagAlertmanagerRemoteSecondaryWithRemoteState
// Starts Grafana in remote secondary mode pulling the latest state from the remote Alertmanager to avoid duplicate notifications.
FlagAlertmanagerRemoteSecondaryWithRemoteState = "alertmanagerRemoteSecondaryWithRemoteState"
+13
View File
@@ -836,6 +836,19 @@
"frontend": true
}
},
{
"metadata": {
"name": "dashboardLevelTimeMacros",
"resourceVersion": "1753435849295",
"creationTimestamp": "2025-07-25T09:30:49Z"
},
"spec": {
"description": "Supports __from and __to macros that always use the dashboard level time range",
"stage": "experimental",
"codeowner": "@grafana/dashboards-squad",
"frontend": true
}
},
{
"metadata": {
"name": "dashboardNewLayouts",