Chore: Remove dashboards from models pkg (#61578)
* Copy dashboard models to dashboard pkg * Use some models from current pkg instead of models * Adjust api pkg * Adjust pkg services * Fix lint * Chore: Remove dashboards models * Remove dashboards from models pkg * Fix lint in tests * Fix lint in tests 2 * Fix for import in auth * Remove newline * Revert unused fix
This commit is contained in:
@@ -3,8 +3,6 @@ package folder
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/slugify"
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
"github.com/grafana/grafana/pkg/services/user"
|
||||
"github.com/grafana/grafana/pkg/util/errutil"
|
||||
)
|
||||
@@ -148,34 +146,3 @@ type GetChildrenQuery struct {
|
||||
|
||||
SignedInUser *user.SignedInUser `json:"-"`
|
||||
}
|
||||
|
||||
// ToLegacyModel is temporary until the two folder services are merged
|
||||
func (f *Folder) ToLegacyModel() *models.Folder {
|
||||
return &models.Folder{
|
||||
Id: f.ID,
|
||||
Uid: f.UID,
|
||||
Title: f.Title,
|
||||
Url: models.GetFolderUrl(f.UID, slugify.Slugify(f.Title)),
|
||||
Version: 0,
|
||||
Created: f.Created,
|
||||
Updated: f.Updated,
|
||||
UpdatedBy: 0,
|
||||
CreatedBy: 0,
|
||||
HasACL: false,
|
||||
}
|
||||
}
|
||||
|
||||
func FromDashboard(dash *models.Dashboard) *Folder {
|
||||
return &Folder{
|
||||
ID: dash.Id,
|
||||
UID: dash.Uid,
|
||||
Title: dash.Title,
|
||||
HasACL: dash.HasACL,
|
||||
Url: models.GetFolderUrl(dash.Uid, dash.Slug),
|
||||
Version: dash.Version,
|
||||
Created: dash.Created,
|
||||
CreatedBy: dash.CreatedBy,
|
||||
Updated: dash.Updated,
|
||||
UpdatedBy: dash.UpdatedBy,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user