Commit 2465fcbd by Torkel Ödegaard

fix: FolderId and IsFolder when saving dashboard

parent d3858d88
......@@ -23,9 +23,7 @@ func SetRepository(rep Repository) {
}
type SaveDashboardItem struct {
TitleLower string
OrgId int64
Folder string
UpdatedAt time.Time
UserId int64
Message string
......@@ -57,6 +55,8 @@ func (dr *DashboardRepository) SaveDashboard(json *SaveDashboardItem) (*models.D
OrgId: json.OrgId,
Overwrite: json.Overwrite,
UserId: json.UserId,
FolderId: dashboard.FolderId,
IsFolder: dashboard.IsFolder,
}
if !json.UpdatedAt.IsZero() {
......
package dashboards
import (
"strings"
"time"
"github.com/grafana/grafana/pkg/components/simplejson"
......@@ -23,11 +22,9 @@ func createDashboardJson(data *simplejson.Json, lastModified time.Time, cfg *Das
dash := &dashboards.SaveDashboardItem{}
dash.Dashboard = models.NewDashboardFromJson(data)
dash.TitleLower = strings.ToLower(dash.Dashboard.Title)
dash.UpdatedAt = lastModified
dash.Overwrite = true
dash.OrgId = cfg.OrgId
dash.Folder = cfg.Folder
dash.Dashboard.Data.Set("editable", cfg.Editable)
if dash.Dashboard.Title == "" {
......
......@@ -9,7 +9,6 @@ export class SearchResultsCtrl {
/** @ngInject */
constructor(private $location) {
}
toggleFolderExpand(section) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment