mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
RestoreDashboards: Merge both feature toggles to dashboardRestore (#94412)
* refactor: remove FE feat toggle from BE * refactor: remove FE toggle and adjust roles * refactor: replace feat toggle in tracking events * refactor: remove FE feat toggle * refactor: remove FE feat toggle * fix: autogenerated file
This commit is contained in:
parent
3d59d3b40f
commit
4092741f24
@ -191,11 +191,10 @@ Experimental features might be changed or removed without prior notice.
|
||||
| `queryLibrary` | Enables Query Library feature in Explore |
|
||||
| `logsExploreTableDefaultVisualization` | Sets the logs table as default visualisation in logs explore |
|
||||
| `alertingListViewV2` | Enables the new alert list view design |
|
||||
| `dashboardRestore` | Enables deleted dashboard restore feature (backend only) |
|
||||
| `dashboardRestore` | Enables deleted dashboard restore feature |
|
||||
| `alertingCentralAlertHistory` | Enables the new central alert history. |
|
||||
| `failWrongDSUID` | Throws an error if a datasource has an invalid UIDs |
|
||||
| `alertingApiServer` | Register Alerting APIs with the K8s API server |
|
||||
| `dashboardRestoreUI` | Enables the frontend to be able to restore a recently deleted dashboard |
|
||||
| `dataplaneAggregator` | Enable grafana dataplane aggregator |
|
||||
| `newFiltersUI` | Enables new combobox style UI for the Ad hoc filters variable in scenes architecture |
|
||||
| `lokiSendDashboardPanelNames` | Send dashboard and panel names to Loki when querying |
|
||||
|
@ -198,7 +198,6 @@ export interface FeatureToggles {
|
||||
zanzana?: boolean;
|
||||
passScopeToDashboardApi?: boolean;
|
||||
alertingApiServer?: boolean;
|
||||
dashboardRestoreUI?: boolean;
|
||||
cloudWatchRoundUpEndTime?: boolean;
|
||||
cloudwatchMetricInsightsCrossAccount?: boolean;
|
||||
prometheusAzureOverrideAudience?: boolean;
|
||||
|
@ -1255,10 +1255,11 @@ var (
|
||||
},
|
||||
{
|
||||
Name: "dashboardRestore",
|
||||
Description: "Enables deleted dashboard restore feature (backend only)",
|
||||
Description: "Enables deleted dashboard restore feature",
|
||||
Stage: FeatureStageExperimental,
|
||||
Owner: grafanaSearchAndStorageSquad,
|
||||
HideFromAdminPage: true,
|
||||
Expression: "false", // enabled by default
|
||||
},
|
||||
{
|
||||
Name: "datasourceProxyDisableRBAC",
|
||||
@ -1367,13 +1368,6 @@ var (
|
||||
Owner: grafanaAlertingSquad,
|
||||
RequiresRestart: true,
|
||||
},
|
||||
{
|
||||
Name: "dashboardRestoreUI",
|
||||
Description: "Enables the frontend to be able to restore a recently deleted dashboard",
|
||||
Stage: FeatureStageExperimental,
|
||||
Owner: grafanaFrontendPlatformSquad,
|
||||
Expression: "false", // enabled by default
|
||||
},
|
||||
{
|
||||
Name: "cloudWatchRoundUpEndTime",
|
||||
Description: "Round up end time for metric queries to the next minute to avoid missing data",
|
||||
|
@ -179,7 +179,6 @@ failWrongDSUID,experimental,@grafana/plugins-platform-backend,false,false,false
|
||||
zanzana,experimental,@grafana/identity-access-team,false,false,false
|
||||
passScopeToDashboardApi,experimental,@grafana/dashboards-squad,false,false,false
|
||||
alertingApiServer,experimental,@grafana/alerting-squad,false,true,false
|
||||
dashboardRestoreUI,experimental,@grafana/grafana-frontend-platform,false,false,false
|
||||
cloudWatchRoundUpEndTime,GA,@grafana/aws-datasources,false,false,false
|
||||
cloudwatchMetricInsightsCrossAccount,preview,@grafana/aws-datasources,false,false,true
|
||||
prometheusAzureOverrideAudience,deprecated,@grafana/partner-datasources,false,false,false
|
||||
|
|
@ -668,7 +668,7 @@ const (
|
||||
FlagNotificationBanner = "notificationBanner"
|
||||
|
||||
// FlagDashboardRestore
|
||||
// Enables deleted dashboard restore feature (backend only)
|
||||
// Enables deleted dashboard restore feature
|
||||
FlagDashboardRestore = "dashboardRestore"
|
||||
|
||||
// FlagDatasourceProxyDisableRBAC
|
||||
@ -727,10 +727,6 @@ const (
|
||||
// Register Alerting APIs with the K8s API server
|
||||
FlagAlertingApiServer = "alertingApiServer"
|
||||
|
||||
// FlagDashboardRestoreUI
|
||||
// Enables the frontend to be able to restore a recently deleted dashboard
|
||||
FlagDashboardRestoreUI = "dashboardRestoreUI"
|
||||
|
||||
// FlagCloudWatchRoundUpEndTime
|
||||
// Round up end time for metric queries to the next minute to avoid missing data
|
||||
FlagCloudWatchRoundUpEndTime = "cloudWatchRoundUpEndTime"
|
||||
|
@ -808,17 +808,18 @@
|
||||
{
|
||||
"metadata": {
|
||||
"name": "dashboardRestore",
|
||||
"resourceVersion": "1719321877748",
|
||||
"resourceVersion": "1728397491294",
|
||||
"creationTimestamp": "2024-05-16T17:36:26Z",
|
||||
"annotations": {
|
||||
"grafana.app/updatedTimestamp": "2024-06-25 13:24:37.748284 +0000 UTC"
|
||||
"grafana.app/updatedTimestamp": "2024-10-08 14:24:51.294668 +0000 UTC"
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"description": "Enables deleted dashboard restore feature (backend only)",
|
||||
"description": "Enables deleted dashboard restore feature",
|
||||
"stage": "experimental",
|
||||
"codeowner": "@grafana/search-and-storage",
|
||||
"hideFromAdminPage": true
|
||||
"hideFromAdminPage": true,
|
||||
"expression": "false"
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -826,6 +827,7 @@
|
||||
"name": "dashboardRestoreUI",
|
||||
"resourceVersion": "1720021873452",
|
||||
"creationTimestamp": "2024-06-25T14:43:13Z",
|
||||
"deletionTimestamp": "2024-10-08T14:24:51Z",
|
||||
"annotations": {
|
||||
"grafana.app/updatedTimestamp": "2024-07-03 15:51:13.452477 +0000 UTC"
|
||||
}
|
||||
|
@ -389,7 +389,7 @@ func (s *ServiceImpl) buildDashboardNavLinks(c *contextmodel.ReqContext) []*navt
|
||||
})
|
||||
}
|
||||
|
||||
if s.features.IsEnabled(c.Req.Context(), featuremgmt.FlagDashboardRestoreUI) && (c.SignedInUser.GetOrgRole() == org.RoleAdmin || c.IsGrafanaAdmin) {
|
||||
if s.features.IsEnabled(c.Req.Context(), featuremgmt.FlagDashboardRestore) && (c.SignedInUser.GetOrgRole() == org.RoleAdmin || c.IsGrafanaAdmin) {
|
||||
dashboardChildNavs = append(dashboardChildNavs, &navtree.NavLink{
|
||||
Text: "Recently deleted",
|
||||
SubTitle: "Any items listed here for more than 30 days will be automatically deleted.",
|
||||
|
@ -121,7 +121,7 @@ const BrowseDashboardsPage = memo(() => {
|
||||
onEditTitle={showEditTitle ? onEditTitle : undefined}
|
||||
actions={
|
||||
<>
|
||||
{config.featureToggles.dashboardRestore && config.featureToggles.dashboardRestoreUI && hasAdminRights && (
|
||||
{config.featureToggles.dashboardRestore && hasAdminRights && (
|
||||
<LinkButton
|
||||
variant="secondary"
|
||||
href={getConfig().appSubUrl + '/dashboard/recently-deleted'}
|
||||
|
@ -115,6 +115,6 @@ function trackAction(action: keyof typeof actionMap, selectedItems: Omit<Dashboa
|
||||
dashboard: selectedDashboards.length,
|
||||
},
|
||||
source: 'tree_actions',
|
||||
restore_enabled: config.featureToggles.dashboardRestoreUI,
|
||||
restore_enabled: config.featureToggles.dashboardRestore,
|
||||
});
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ export const DeleteModal = ({ onConfirm, onDismiss, selectedItems, ...props }: P
|
||||
folder: Object.keys(selectedItems.folder).length,
|
||||
},
|
||||
source: 'browse_dashboards',
|
||||
restore_enabled: config.featureToggles.dashboardRestoreUI,
|
||||
restore_enabled: config.featureToggles.dashboardRestore,
|
||||
});
|
||||
setIsDeleting(true);
|
||||
try {
|
||||
|
@ -39,7 +39,7 @@ export interface NameAlreadyExistsErrorProps {
|
||||
}
|
||||
|
||||
export function NameAlreadyExistsError({ cancelButton, saveButton }: NameAlreadyExistsErrorProps) {
|
||||
const isRestoreDashboardsEnabled = config.featureToggles.dashboardRestore && config.featureToggles.dashboardRestoreUI;
|
||||
const isRestoreDashboardsEnabled = config.featureToggles.dashboardRestore;
|
||||
return isRestoreDashboardsEnabled ? (
|
||||
<Alert title={t('save-dashboards.name-exists.title', 'Dashboard name already exists')} severity="error">
|
||||
<p>
|
||||
|
@ -33,7 +33,7 @@ export function DeleteDashboardButton({ dashboard }: ButtonProps) {
|
||||
dashboard: 1,
|
||||
},
|
||||
source: 'dashboard_scene_settings',
|
||||
restore_enabled: config.featureToggles.dashboardRestoreUI,
|
||||
restore_enabled: config.featureToggles.dashboardRestore,
|
||||
});
|
||||
toggleModal();
|
||||
if (dashboard.state.uid) {
|
||||
|
@ -34,7 +34,7 @@ const DeleteDashboardModalUnconnected = ({ hideModal, cleanUpDashboardAndVariabl
|
||||
dashboard: 1,
|
||||
},
|
||||
source: 'dashboard_settings',
|
||||
restore_enabled: config.featureToggles.dashboardRestoreUI,
|
||||
restore_enabled: config.featureToggles.dashboardRestore,
|
||||
});
|
||||
await deleteItems({
|
||||
selectedItems: {
|
||||
|
@ -31,7 +31,7 @@ export const SaveDashboardErrorProxy = ({
|
||||
setErrorIsHandled,
|
||||
}: SaveDashboardErrorProxyProps) => {
|
||||
const { onDashboardSave } = useDashboardSave();
|
||||
const isRestoreDashboardsEnabled = config.featureToggles.dashboardRestore && config.featureToggles.dashboardRestoreUI;
|
||||
const isRestoreDashboardsEnabled = config.featureToggles.dashboardRestore;
|
||||
return (
|
||||
<>
|
||||
{error.data && error.data.status === 'version-mismatch' && (
|
||||
|
@ -444,9 +444,9 @@ export function getAppRoutes(): RouteDescriptor[] {
|
||||
() => import(/* webpackChunkName: "SnapshotListPage" */ 'app/features/manage-dashboards/SnapshotListPage')
|
||||
),
|
||||
},
|
||||
config.featureToggles.dashboardRestoreUI && {
|
||||
config.featureToggles.dashboardRestore && {
|
||||
path: '/dashboard/recently-deleted',
|
||||
roles: () => ['Admin'],
|
||||
roles: () => ['Admin', 'ServerAdmin'],
|
||||
component: SafeDynamicImport(
|
||||
() => import(/* webpackChunkName: "RecentlyDeletedPage" */ 'app/features/browse-dashboards/RecentlyDeletedPage')
|
||||
),
|
||||
|
Loading…
Reference in New Issue
Block a user