mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
RestoreDashboards: Create trash section (#88278)
* feat: add feature toggle to docs * feat: create page in BE * feat: create page in FE * refactor: set feat toggle as a condition * refactor * refactor * refactor * feat: add permission conditions * refactor * feat: add subtitle to translations * feat: add to codeowners * refactor: fix docs situation * refactor * Merge main branch into feat branch
This commit is contained in:
parent
f772056296
commit
f6a83432a5
1
.github/CODEOWNERS
vendored
1
.github/CODEOWNERS
vendored
@ -435,6 +435,7 @@ playwright.config.ts @grafana/plugins-platform-frontend
|
|||||||
/public/app/features/transformers/timeSeriesTable/ @grafana/dataviz-squad @grafana/app-o11y-visualizations
|
/public/app/features/transformers/timeSeriesTable/ @grafana/dataviz-squad @grafana/app-o11y-visualizations
|
||||||
/public/app/features/users/ @grafana/identity-access-team
|
/public/app/features/users/ @grafana/identity-access-team
|
||||||
/public/app/features/variables/ @grafana/dashboards-squad
|
/public/app/features/variables/ @grafana/dashboards-squad
|
||||||
|
/public/app/features/trash-section/ @grafana/grafana-frontend-platform
|
||||||
/public/app/plugins/panel/alertlist/ @grafana/alerting-frontend
|
/public/app/plugins/panel/alertlist/ @grafana/alerting-frontend
|
||||||
/public/app/plugins/panel/annolist/ @grafana/grafana-frontend-platform
|
/public/app/plugins/panel/annolist/ @grafana/grafana-frontend-platform
|
||||||
/public/app/plugins/panel/barchart/ @grafana/dataviz-squad
|
/public/app/plugins/panel/barchart/ @grafana/dataviz-squad
|
||||||
|
@ -189,6 +189,7 @@ Experimental features might be changed or removed without prior notice.
|
|||||||
| `newDashboardSharingComponent` | Enables the new sharing drawer design |
|
| `newDashboardSharingComponent` | Enables the new sharing drawer design |
|
||||||
| `alertingListViewV2` | Enables the new alert list view design |
|
| `alertingListViewV2` | Enables the new alert list view design |
|
||||||
| `notificationBanner` | Enables the notification banner UI and API |
|
| `notificationBanner` | Enables the notification banner UI and API |
|
||||||
|
| `dashboardRestore` | Enables deleted dashboard restore feature |
|
||||||
|
|
||||||
## Development feature toggles
|
## Development feature toggles
|
||||||
|
|
||||||
|
@ -1279,7 +1279,6 @@ var (
|
|||||||
Description: "Enables deleted dashboard restore feature",
|
Description: "Enables deleted dashboard restore feature",
|
||||||
Stage: FeatureStageExperimental,
|
Stage: FeatureStageExperimental,
|
||||||
Owner: grafanaFrontendPlatformSquad,
|
Owner: grafanaFrontendPlatformSquad,
|
||||||
HideFromDocs: true,
|
|
||||||
HideFromAdminPage: true,
|
HideFromAdminPage: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -588,15 +588,17 @@
|
|||||||
{
|
{
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"name": "dashboardRestore",
|
"name": "dashboardRestore",
|
||||||
"resourceVersion": "1716448665531",
|
"resourceVersion": "1716564259132",
|
||||||
"creationTimestamp": "2024-05-23T07:17:45Z"
|
"creationTimestamp": "2024-05-23T07:17:45Z",
|
||||||
|
"annotations": {
|
||||||
|
"grafana.app/updatedTimestamp": "2024-05-24 15:24:19.132272 +0000 UTC"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"spec": {
|
"spec": {
|
||||||
"description": "Enables deleted dashboard restore feature",
|
"description": "Enables deleted dashboard restore feature",
|
||||||
"stage": "experimental",
|
"stage": "experimental",
|
||||||
"codeowner": "@grafana/grafana-frontend-platform",
|
"codeowner": "@grafana/grafana-frontend-platform",
|
||||||
"hideFromAdminPage": true,
|
"hideFromAdminPage": true
|
||||||
"hideFromDocs": true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -2204,26 +2206,19 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"name": "influxdbRunQueriesInParallel",
|
"name": "dashboardRestore",
|
||||||
"resourceVersion": "1716448665531",
|
"resourceVersion": "1716563559003",
|
||||||
"creationTimestamp": "2024-05-23T07:17:45Z"
|
"creationTimestamp": "2024-02-20T18:50:41Z",
|
||||||
},
|
"deletionTimestamp": "2024-05-24T15:24:19Z",
|
||||||
"spec": {
|
"annotations": {
|
||||||
"description": "Enables running InfluxDB Influxql queries in parallel",
|
"grafana.app/updatedTimestamp": "2024-05-24 15:12:39.003245 +0000 UTC"
|
||||||
"stage": "privatePreview",
|
}
|
||||||
"codeowner": "@grafana/observability-metrics"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"metadata": {
|
|
||||||
"name": "disableSSEDataplane",
|
|
||||||
"resourceVersion": "1716448665531",
|
|
||||||
"creationTimestamp": "2024-05-23T07:17:45Z"
|
|
||||||
},
|
},
|
||||||
"spec": {
|
"spec": {
|
||||||
"description": "Disables dataplane specific processing in server side expressions.",
|
"description": "Disables dataplane specific processing in server side expressions.",
|
||||||
"stage": "experimental",
|
"stage": "experimental",
|
||||||
"codeowner": "@grafana/observability-metrics"
|
"codeowner": "@grafana/grafana-frontend-platform",
|
||||||
|
"hideFromAdminPage": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -2265,6 +2260,30 @@
|
|||||||
"hideFromAdminPage": true,
|
"hideFromAdminPage": true,
|
||||||
"hideFromDocs": true
|
"hideFromDocs": true
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"metadata": {
|
||||||
|
"name": "disableSSEDataplane",
|
||||||
|
"resourceVersion": "1716816471156",
|
||||||
|
"creationTimestamp": "2024-05-27T13:27:51Z"
|
||||||
|
},
|
||||||
|
"spec": {
|
||||||
|
"description": "Disables dataplane specific processing in server side expressions.",
|
||||||
|
"stage": "experimental",
|
||||||
|
"codeowner": "@grafana/observability-metrics"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"metadata": {
|
||||||
|
"name": "influxdbRunQueriesInParallel",
|
||||||
|
"resourceVersion": "1716816471156",
|
||||||
|
"creationTimestamp": "2024-05-27T13:27:51Z"
|
||||||
|
},
|
||||||
|
"spec": {
|
||||||
|
"description": "Enables running InfluxDB Influxql queries in parallel",
|
||||||
|
"stage": "privatePreview",
|
||||||
|
"codeowner": "@grafana/observability-metrics"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -353,6 +353,15 @@ func (s *ServiceImpl) buildDashboardNavLinks(c *contextmodel.ReqContext) []*navt
|
|||||||
Icon: "library-panel",
|
Icon: "library-panel",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if s.features.IsEnabled(c.Req.Context(), featuremgmt.FlagDashboardRestore) && hasAccess(ac.EvalPermission(dashboards.ActionDashboardsDelete)) {
|
||||||
|
dashboardChildNavs = append(dashboardChildNavs, &navtree.NavLink{
|
||||||
|
Text: "Trash",
|
||||||
|
SubTitle: "Any items remaining in the Trash for more than 30 days will be automatically deleted",
|
||||||
|
Id: "dashboards/trash",
|
||||||
|
Url: s.cfg.AppSubURL + "/dashboard/trash",
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if hasAccess(ac.EvalPermission(dashboards.ActionDashboardsCreate)) {
|
if hasAccess(ac.EvalPermission(dashboards.ActionDashboardsCreate)) {
|
||||||
|
@ -40,6 +40,8 @@ export function getNavTitle(navId: string | undefined) {
|
|||||||
return t('nav.reporting.title', 'Reporting');
|
return t('nav.reporting.title', 'Reporting');
|
||||||
case 'dashboards/public':
|
case 'dashboards/public':
|
||||||
return t('nav.public.title', 'Public dashboards');
|
return t('nav.public.title', 'Public dashboards');
|
||||||
|
case 'dashboards/trash':
|
||||||
|
return t('nav.trash.title', 'Trash');
|
||||||
case 'dashboards/new':
|
case 'dashboards/new':
|
||||||
return t('nav.new-dashboard.title', 'New dashboard');
|
return t('nav.new-dashboard.title', 'New dashboard');
|
||||||
case 'dashboards/folder/new':
|
case 'dashboards/folder/new':
|
||||||
@ -206,6 +208,11 @@ export function getNavSubTitle(navId: string | undefined) {
|
|||||||
);
|
);
|
||||||
case 'dashboards/library-panels':
|
case 'dashboards/library-panels':
|
||||||
return t('nav.library-panels.subtitle', 'Reusable panels that can be added to multiple dashboards');
|
return t('nav.library-panels.subtitle', 'Reusable panels that can be added to multiple dashboards');
|
||||||
|
case 'dashboards/trash':
|
||||||
|
return t(
|
||||||
|
'nav.trash.subtitle',
|
||||||
|
'Any items remaining in the Trash for more than 30 days will be automatically deleted'
|
||||||
|
);
|
||||||
case 'alerting':
|
case 'alerting':
|
||||||
return t('nav.alerting.subtitle', 'Learn about problems in your systems moments after they occur');
|
return t('nav.alerting.subtitle', 'Learn about problems in your systems moments after they occur');
|
||||||
case 'alerting-upgrade':
|
case 'alerting-upgrade':
|
||||||
|
15
public/app/features/trash-section/TrashPage.tsx
Normal file
15
public/app/features/trash-section/TrashPage.tsx
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
import { Page } from 'app/core/components/Page/Page';
|
||||||
|
|
||||||
|
const TrashPage = () => {
|
||||||
|
return (
|
||||||
|
<Page navId="dashboards/trash">
|
||||||
|
<Page.Contents>
|
||||||
|
<p>page content</p>
|
||||||
|
</Page.Contents>
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default TrashPage;
|
@ -435,6 +435,13 @@ export function getAppRoutes(): RouteDescriptor[] {
|
|||||||
() => import(/* webpackChunkName: "SnapshotListPage" */ 'app/features/manage-dashboards/SnapshotListPage')
|
() => import(/* webpackChunkName: "SnapshotListPage" */ 'app/features/manage-dashboards/SnapshotListPage')
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
config.featureToggles.dashboardRestore && {
|
||||||
|
path: '/dashboard/trash',
|
||||||
|
roles: () => contextSrv.evaluatePermission([AccessControlAction.DashboardsDelete]),
|
||||||
|
component: SafeDynamicImport(
|
||||||
|
() => import(/* webpackChunkName: "TrashPage" */ 'app/features/trash-section/TrashPage')
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/playlists',
|
path: '/playlists',
|
||||||
component: SafeDynamicImport(
|
component: SafeDynamicImport(
|
||||||
|
@ -1179,6 +1179,10 @@
|
|||||||
"subtitle": "Optimize performance with k6 and Synthetic Monitoring insights",
|
"subtitle": "Optimize performance with k6 and Synthetic Monitoring insights",
|
||||||
"title": "Testing & synthetics"
|
"title": "Testing & synthetics"
|
||||||
},
|
},
|
||||||
|
"trash": {
|
||||||
|
"subtitle": "Any items remaining in the Trash for more than 30 days will be automatically deleted",
|
||||||
|
"title": "Trash"
|
||||||
|
},
|
||||||
"upgrading": {
|
"upgrading": {
|
||||||
"title": "Stats and license"
|
"title": "Stats and license"
|
||||||
},
|
},
|
||||||
|
@ -1179,6 +1179,10 @@
|
|||||||
"subtitle": "Øpŧįmįžę pęřƒőřmäʼnčę ŵįŧĥ ĸ6 äʼnđ Ŝyʼnŧĥęŧįč Mőʼnįŧőřįʼnģ įʼnşįģĥŧş",
|
"subtitle": "Øpŧįmįžę pęřƒőřmäʼnčę ŵįŧĥ ĸ6 äʼnđ Ŝyʼnŧĥęŧįč Mőʼnįŧőřįʼnģ įʼnşįģĥŧş",
|
||||||
"title": "Ŧęşŧįʼnģ & şyʼnŧĥęŧįčş"
|
"title": "Ŧęşŧįʼnģ & şyʼnŧĥęŧįčş"
|
||||||
},
|
},
|
||||||
|
"trash": {
|
||||||
|
"subtitle": "Åʼny įŧęmş řęmäįʼnįʼnģ įʼn ŧĥę Ŧřäşĥ ƒőř mőřę ŧĥäʼn 30 đäyş ŵįľľ þę äūŧőmäŧįčäľľy đęľęŧęđ",
|
||||||
|
"title": "Ŧřäşĥ"
|
||||||
|
},
|
||||||
"upgrading": {
|
"upgrading": {
|
||||||
"title": "Ŝŧäŧş äʼnđ ľįčęʼnşę"
|
"title": "Ŝŧäŧş äʼnđ ľįčęʼnşę"
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user