Public Dashboards: Replace simplejson with TimeSettings on dashboard struct (#55047)

* Replace simplejson for TimeSettings on PublicDashboard struct

* Implement xorm conversion interface to TimeSettings

* Fix minor test assertion issue
This commit is contained in:
Guilherme Caulada
2022-09-13 13:33:41 -03:00
committed by GitHub
parent 6e99d8bba5
commit b06eaf66b6
6 changed files with 26 additions and 21 deletions

View File

@@ -8,7 +8,6 @@ import (
"github.com/google/uuid"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/datasources"
@@ -109,7 +108,7 @@ func (pd *PublicDashboardServiceImpl) SavePublicDashboardConfig(ctx context.Cont
// set default value for time settings
if dto.PublicDashboard.TimeSettings == nil {
dto.PublicDashboard.TimeSettings = simplejson.New()
dto.PublicDashboard.TimeSettings = &TimeSettings{}
}
// get existing public dashboard if exists