@ -828,7 +828,7 @@ func permissionScenario(t *testing.T, desc string, canSave bool, fn permissionSc
dashboardStore , err := database . ProvideDashboardStore ( sqlStore , cfg , featuremgmt . WithFeatures ( ) , tagimpl . ProvideService ( sqlStore , cfg ) , quotaService )
require . NoError ( t , err )
folderStore := folderimpl . ProvideDashboardFolderStore ( sqlStore )
service := ProvideDashboardServiceImpl (
service , err := ProvideDashboardServiceImpl (
cfg , dashboardStore , folderStore , & dummyDashAlertExtractor { } ,
featuremgmt . WithFeatures ( ) ,
accesscontrolmock . NewMockedPermissionsService ( ) ,
@ -836,6 +836,7 @@ func permissionScenario(t *testing.T, desc string, canSave bool, fn permissionSc
accesscontrolmock . New ( ) ,
foldertest . NewFakeService ( ) ,
)
require . NoError ( t , err )
guardian . InitLegacyGuardian ( cfg , sqlStore , service , & teamtest . FakeService { } )
savedFolder := saveTestFolder ( t , "Saved folder" , testOrgID , sqlStore )
@ -889,7 +890,7 @@ func callSaveWithResult(t *testing.T, cmd dashboards.SaveDashboardCommand, sqlSt
dashboardStore , err := database . ProvideDashboardStore ( sqlStore , cfg , featuremgmt . WithFeatures ( ) , tagimpl . ProvideService ( sqlStore , cfg ) , quotaService )
require . NoError ( t , err )
folderStore := folderimpl . ProvideDashboardFolderStore ( sqlStore )
service := ProvideDashboardServiceImpl (
service , err := ProvideDashboardServiceImpl (
cfg , dashboardStore , folderStore , & dummyDashAlertExtractor { } ,
featuremgmt . WithFeatures ( ) ,
accesscontrolmock . NewMockedPermissionsService ( ) ,
@ -897,6 +898,7 @@ func callSaveWithResult(t *testing.T, cmd dashboards.SaveDashboardCommand, sqlSt
accesscontrolmock . New ( ) ,
foldertest . NewFakeService ( ) ,
)
require . NoError ( t , err )
res , err := service . SaveDashboard ( context . Background ( ) , & dto , false )
require . NoError ( t , err )
@ -912,7 +914,7 @@ func callSaveWithError(t *testing.T, cmd dashboards.SaveDashboardCommand, sqlSto
dashboardStore , err := database . ProvideDashboardStore ( sqlStore , cfg , featuremgmt . WithFeatures ( ) , tagimpl . ProvideService ( sqlStore , cfg ) , quotaService )
require . NoError ( t , err )
folderStore := folderimpl . ProvideDashboardFolderStore ( sqlStore )
service := ProvideDashboardServiceImpl (
service , err := ProvideDashboardServiceImpl (
cfg , dashboardStore , folderStore , & dummyDashAlertExtractor { } ,
featuremgmt . WithFeatures ( ) ,
accesscontrolmock . NewMockedPermissionsService ( ) ,
@ -920,6 +922,7 @@ func callSaveWithError(t *testing.T, cmd dashboards.SaveDashboardCommand, sqlSto
accesscontrolmock . New ( ) ,
foldertest . NewFakeService ( ) ,
)
require . NoError ( t , err )
_ , err = service . SaveDashboard ( context . Background ( ) , & dto , false )
return err
}
@ -953,7 +956,7 @@ func saveTestDashboard(t *testing.T, title string, orgID, folderID int64, sqlSto
dashboardStore , err := database . ProvideDashboardStore ( sqlStore , cfg , featuremgmt . WithFeatures ( ) , tagimpl . ProvideService ( sqlStore , cfg ) , quotaService )
require . NoError ( t , err )
folderStore := folderimpl . ProvideDashboardFolderStore ( sqlStore )
service := ProvideDashboardServiceImpl (
service , err := ProvideDashboardServiceImpl (
cfg , dashboardStore , folderStore , & dummyDashAlertExtractor { } ,
featuremgmt . WithFeatures ( ) ,
accesscontrolmock . NewMockedPermissionsService ( ) ,
@ -961,6 +964,7 @@ func saveTestDashboard(t *testing.T, title string, orgID, folderID int64, sqlSto
accesscontrolmock . New ( ) ,
foldertest . NewFakeService ( ) ,
)
require . NoError ( t , err )
res , err := service . SaveDashboard ( context . Background ( ) , & dto , false )
require . NoError ( t , err )
@ -995,7 +999,7 @@ func saveTestFolder(t *testing.T, title string, orgID int64, sqlStore db.DB) *da
dashboardStore , err := database . ProvideDashboardStore ( sqlStore , cfg , featuremgmt . WithFeatures ( ) , tagimpl . ProvideService ( sqlStore , cfg ) , quotaService )
require . NoError ( t , err )
folderStore := folderimpl . ProvideDashboardFolderStore ( sqlStore )
service := ProvideDashboardServiceImpl (
service , err := ProvideDashboardServiceImpl (
cfg , dashboardStore , folderStore , & dummyDashAlertExtractor { } ,
featuremgmt . WithFeatures ( ) ,
accesscontrolmock . NewMockedPermissionsService ( ) ,
@ -1003,6 +1007,7 @@ func saveTestFolder(t *testing.T, title string, orgID int64, sqlStore db.DB) *da
accesscontrolmock . New ( ) ,
foldertest . NewFakeService ( ) ,
)
require . NoError ( t , err )
res , err := service . SaveDashboard ( context . Background ( ) , & dto , false )
require . NoError ( t , err )