mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Dashboards: Avoid adding unused revision property (#64362)
This commit is contained in:
parent
a186f036dd
commit
5f2fecfda7
@ -1629,7 +1629,6 @@
|
||||
}
|
||||
],
|
||||
"refresh": false,
|
||||
"revision": 8,
|
||||
"schemaVersion": 16,
|
||||
"style": "dark",
|
||||
"tags": ["gdev", "panel-tests"],
|
||||
|
@ -1629,7 +1629,6 @@
|
||||
}
|
||||
],
|
||||
"refresh": false,
|
||||
"revision": 8,
|
||||
"schemaVersion": 16,
|
||||
"style": "dark",
|
||||
"tags": ["gdev", "panel-tests", "graph"],
|
||||
|
@ -305,7 +305,6 @@
|
||||
"type": "heatmap"
|
||||
}
|
||||
],
|
||||
"revision": 1,
|
||||
"schemaVersion": 37,
|
||||
"style": "dark",
|
||||
"tags": [],
|
||||
|
@ -748,7 +748,6 @@
|
||||
"type": "histogram"
|
||||
}
|
||||
],
|
||||
"revision": 1,
|
||||
"schemaVersion": 37,
|
||||
"style": "dark",
|
||||
"tags": [
|
||||
|
@ -430,7 +430,6 @@
|
||||
}
|
||||
],
|
||||
"refresh": false,
|
||||
"revision": 8,
|
||||
"schemaVersion": 16,
|
||||
"style": "dark",
|
||||
"tags": ["gdev", "panel-tests"],
|
||||
|
@ -736,7 +736,6 @@
|
||||
}
|
||||
],
|
||||
"refresh": false,
|
||||
"revision": 1,
|
||||
"schemaVersion": 38,
|
||||
"style": "dark",
|
||||
"tags": [
|
||||
|
@ -1343,7 +1343,6 @@
|
||||
}
|
||||
],
|
||||
"refresh": "",
|
||||
"revision": 1,
|
||||
"schemaVersion": 38,
|
||||
"style": "dark",
|
||||
"tags": [
|
||||
|
@ -40,8 +40,8 @@ type ImportDashboardResponse struct {
|
||||
DashboardId int64 `json:"dashboardId"`
|
||||
FolderId int64 `json:"folderId"`
|
||||
FolderUID string `json:"folderUid"`
|
||||
ImportedRevision int64 `json:"importedRevision"`
|
||||
Revision int64 `json:"revision"`
|
||||
ImportedRevision int64 `json:"importedRevision,omitempty"` // Only used for plugin imports
|
||||
Revision int64 `json:"revision,omitempty"` // Only used for plugin imports
|
||||
Description string `json:"description"`
|
||||
Path string `json:"path"`
|
||||
Removed bool `json:"removed"`
|
||||
|
@ -136,17 +136,18 @@ func (s *ImportDashboardService) ImportDashboard(ctx context.Context, req *dashb
|
||||
return nil, err
|
||||
}
|
||||
|
||||
revision := savedDashboard.Data.Get("revision").MustInt64(0)
|
||||
return &dashboardimport.ImportDashboardResponse{
|
||||
UID: savedDashboard.UID,
|
||||
PluginId: req.PluginId,
|
||||
Title: savedDashboard.Title,
|
||||
Path: req.Path,
|
||||
Revision: savedDashboard.Data.Get("revision").MustInt64(1),
|
||||
Revision: revision, // only used for plugin version tracking
|
||||
FolderId: savedDashboard.FolderID,
|
||||
FolderUID: req.FolderUid,
|
||||
ImportedUri: "db/" + savedDashboard.Slug,
|
||||
ImportedUrl: savedDashboard.GetURL(),
|
||||
ImportedRevision: savedDashboard.Data.Get("revision").MustInt64(1),
|
||||
ImportedRevision: revision,
|
||||
Imported: true,
|
||||
DashboardId: savedDashboard.ID,
|
||||
Slug: savedDashboard.Slug,
|
||||
|
@ -90,7 +90,7 @@ export class DashboardModel implements TimeModel {
|
||||
snapshot: any;
|
||||
schemaVersion: number;
|
||||
version: number;
|
||||
revision: number;
|
||||
revision?: number; // Only used for dashboards managed by plugins
|
||||
links: DashboardLink[];
|
||||
gnetId: any;
|
||||
panels: PanelModel[];
|
||||
@ -131,7 +131,7 @@ export class DashboardModel implements TimeModel {
|
||||
this.id = data.id || null;
|
||||
// UID is not there for newly created dashboards
|
||||
this.uid = data.uid || null;
|
||||
this.revision = data.revision || 1;
|
||||
this.revision = data.revision ?? undefined;
|
||||
this.title = data.title ?? 'No Title';
|
||||
this.description = data.description;
|
||||
this.tags = data.tags ?? [];
|
||||
|
@ -22,7 +22,6 @@ export function createDashboardModelFixture(
|
||||
editable: true,
|
||||
graphTooltip: defaultDashboardCursorSync,
|
||||
schemaVersion: 1,
|
||||
revision: 1,
|
||||
style: 'dark',
|
||||
timezone: '',
|
||||
...dashboardInput,
|
||||
|
Loading…
Reference in New Issue
Block a user