@@ -578,14 +578,14 @@ func TestDashboardAPIEndpoint(t *testing.T) {
578
578
})
579
579
580
580
t .Run ("Given two dashboards with the same title in different folders" , func (t * testing.T ) {
581
- dashOne := models .NewDashboard ("dash" )
582
- dashOne .Id = 2
583
- dashOne .FolderId = 1
581
+ dashOne := dashboards .NewDashboard ("dash" )
582
+ dashOne .ID = 2
583
+ dashOne .FolderID = 1
584
584
dashOne .HasACL = false
585
585
586
- dashTwo := models .NewDashboard ("dash" )
587
- dashTwo .Id = 4
588
- dashTwo .FolderId = 3
586
+ dashTwo := dashboards .NewDashboard ("dash" )
587
+ dashTwo .ID = 4
588
+ dashTwo .FolderID = 3
589
589
dashTwo .HasACL = false
590
590
})
591
591
@@ -597,14 +597,14 @@ func TestDashboardAPIEndpoint(t *testing.T) {
597
597
const folderID int64 = 3
598
598
const dashID int64 = 2
599
599
600
- cmd := models .SaveDashboardCommand {
601
- OrgId : 1 ,
602
- UserId : 5 ,
600
+ cmd := dashboards .SaveDashboardCommand {
601
+ OrgID : 1 ,
602
+ UserID : 5 ,
603
603
Dashboard : simplejson .NewFromAny (map [string ]interface {}{
604
604
"title" : "Dash" ,
605
605
}),
606
606
Overwrite : true ,
607
- FolderId : folderID ,
607
+ FolderID : folderID ,
608
608
IsFolder : false ,
609
609
Message : "msg" ,
610
610
}
@@ -629,14 +629,14 @@ func TestDashboardAPIEndpoint(t *testing.T) {
629
629
const folderUid string = "folderUID"
630
630
const dashID int64 = 2
631
631
632
- cmd := models .SaveDashboardCommand {
633
- OrgId : 1 ,
634
- UserId : 5 ,
632
+ cmd := dashboards .SaveDashboardCommand {
633
+ OrgID : 1 ,
634
+ UserID : 5 ,
635
635
Dashboard : simplejson .NewFromAny (map [string ]interface {}{
636
636
"title" : "Dash" ,
637
637
}),
638
638
Overwrite : true ,
639
- FolderUid : folderUid ,
639
+ FolderUID : folderUid ,
640
640
IsFolder : false ,
641
641
Message : "msg" ,
642
642
}
@@ -662,14 +662,14 @@ func TestDashboardAPIEndpoint(t *testing.T) {
662
662
})
663
663
664
664
t .Run ("Given a request with incorrect folder uid for creating a dashboard with" , func (t * testing.T ) {
665
- cmd := models .SaveDashboardCommand {
666
- OrgId : 1 ,
667
- UserId : 5 ,
665
+ cmd := dashboards .SaveDashboardCommand {
666
+ OrgID : 1 ,
667
+ UserID : 5 ,
668
668
Dashboard : simplejson .NewFromAny (map [string ]interface {}{
669
669
"title" : "Dash" ,
670
670
}),
671
671
Overwrite : true ,
672
- FolderUid : "folderUID" ,
672
+ FolderUID : "folderUID" ,
673
673
IsFolder : false ,
674
674
Message : "msg" ,
675
675
}
@@ -712,8 +712,8 @@ func TestDashboardAPIEndpoint(t *testing.T) {
712
712
{SaveError : dashboards.UpdatePluginDashboardError {PluginId : "plug" }, ExpectedStatusCode : 412 },
713
713
}
714
714
715
- cmd := models .SaveDashboardCommand {
716
- OrgId : 1 ,
715
+ cmd := dashboards .SaveDashboardCommand {
716
+ OrgID : 1 ,
717
717
Dashboard : simplejson .NewFromAny (map [string ]interface {}{
718
718
"title" : "" ,
719
719
}),
@@ -736,7 +736,7 @@ func TestDashboardAPIEndpoint(t *testing.T) {
736
736
sqlmock := mockstore.SQLStoreMock {}
737
737
738
738
t .Run ("When an invalid dashboard json is posted" , func (t * testing.T ) {
739
- cmd := models .ValidateDashboardCommand {
739
+ cmd := dashboards .ValidateDashboardCommand {
740
740
Dashboard : "{\" hello\" : \" world\" }" ,
741
741
}
742
742
@@ -752,7 +752,7 @@ func TestDashboardAPIEndpoint(t *testing.T) {
752
752
})
753
753
754
754
t .Run ("When a dashboard with a too-low schema version is posted" , func (t * testing.T ) {
755
- cmd := models .ValidateDashboardCommand {
755
+ cmd := dashboards .ValidateDashboardCommand {
756
756
Dashboard : "{\" schemaVersion\" : 1}" ,
757
757
}
758
758
@@ -771,7 +771,7 @@ func TestDashboardAPIEndpoint(t *testing.T) {
771
771
devenvDashboard , readErr := os .ReadFile ("../../devenv/dev-dashboards/home.json" )
772
772
assert .Empty (t , readErr )
773
773
774
- cmd := models .ValidateDashboardCommand {
774
+ cmd := dashboards .ValidateDashboardCommand {
775
775
Dashboard : string (devenvDashboard ),
776
776
}
777
777
@@ -930,7 +930,7 @@ func TestDashboardAPIEndpoint(t *testing.T) {
930
930
t .Run ("Given provisioned dashboard" , func (t * testing.T ) {
931
931
mockSQLStore := mockstore .NewSQLStoreMock ()
932
932
dashboardStore := dashboards .NewFakeDashboardStore (t )
933
- dashboardStore .On ("GetProvisionedDataByDashboardID" , mock .Anything , mock .AnythingOfType ("int64" )).Return (& models .DashboardProvisioning {ExternalId : "/dashboard1.json" }, nil ).Once ()
933
+ dashboardStore .On ("GetProvisionedDataByDashboardID" , mock .Anything , mock .AnythingOfType ("int64" )).Return (& dashboards .DashboardProvisioning {ExternalID : "/dashboard1.json" }, nil ).Once ()
934
934
935
935
teamService := & teamtest.FakeService {}
936
936
dashboardService := dashboards .NewFakeDashboardService (t )
@@ -1086,7 +1086,7 @@ func callPostDashboardShouldReturnSuccess(sc *scenarioContext) {
1086
1086
assert .Equal (sc .t , 200 , sc .resp .Code )
1087
1087
}
1088
1088
1089
- func postDashboardScenario (t * testing.T , desc string , url string , routePattern string , cmd models .SaveDashboardCommand , dashboardService dashboards.DashboardService , folderService folder.Service , fn scenarioFunc ) {
1089
+ func postDashboardScenario (t * testing.T , desc string , url string , routePattern string , cmd dashboards .SaveDashboardCommand , dashboardService dashboards.DashboardService , folderService folder.Service , fn scenarioFunc ) {
1090
1090
t .Run (fmt .Sprintf ("%s %s" , desc , url ), func (t * testing.T ) {
1091
1091
cfg := setting .NewCfg ()
1092
1092
hs := HTTPServer {
@@ -1109,7 +1109,7 @@ func postDashboardScenario(t *testing.T, desc string, url string, routePattern s
1109
1109
c .Req .Body = mockRequestBody (cmd )
1110
1110
c .Req .Header .Add ("Content-Type" , "application/json" )
1111
1111
sc .context = c
1112
- sc .context .SignedInUser = & user.SignedInUser {OrgID : cmd .OrgId , UserID : cmd .UserId }
1112
+ sc .context .SignedInUser = & user.SignedInUser {OrgID : cmd .OrgID , UserID : cmd .UserID }
1113
1113
1114
1114
return hs .PostDashboard (c )
1115
1115
})
@@ -1120,7 +1120,7 @@ func postDashboardScenario(t *testing.T, desc string, url string, routePattern s
1120
1120
})
1121
1121
}
1122
1122
1123
- func postValidateScenario (t * testing.T , desc string , url string , routePattern string , cmd models .ValidateDashboardCommand ,
1123
+ func postValidateScenario (t * testing.T , desc string , url string , routePattern string , cmd dashboards .ValidateDashboardCommand ,
1124
1124
role org.RoleType , fn scenarioFunc , sqlmock db.DB ) {
1125
1125
t .Run (fmt .Sprintf ("%s %s" , desc , url ), func (t * testing.T ) {
1126
1126
cfg := setting .NewCfg ()
@@ -1250,7 +1250,7 @@ type mockDashboardProvisioningService struct {
1250
1250
}
1251
1251
1252
1252
func (s mockDashboardProvisioningService ) GetProvisionedDashboardDataByDashboardID (ctx context.Context , dashboardID int64 ) (
1253
- * models .DashboardProvisioning , error ) {
1253
+ * dashboards .DashboardProvisioning , error ) {
1254
1254
return nil , nil
1255
1255
}
1256
1256
0 commit comments