@@ -365,8 +365,10 @@ func (dr *DashboardServiceImpl) Run(ctx context.Context) error {
365365 return ctx .Err ()
366366}
367367
368- var _ dashboards.PermissionsRegistrationService = (* DashboardServiceImpl )(nil )
369- var _ registry.BackgroundService = (* DashboardServiceImpl )(nil )
368+ var (
369+ _ dashboards.PermissionsRegistrationService = (* DashboardServiceImpl )(nil )
370+ _ registry.BackgroundService = (* DashboardServiceImpl )(nil )
371+ )
370372
371373// This is the uber service that implements a three smaller services
372374func ProvideDashboardServiceImpl (
@@ -645,7 +647,8 @@ func (dr *DashboardServiceImpl) ValidateBasicDashboardProperties(title string, u
645647
646648//nolint:gocyclo
647649func (dr * DashboardServiceImpl ) BuildSaveDashboardCommand (ctx context.Context , dto * dashboards.SaveDashboardDTO ,
648- validateProvisionedDashboard bool ) (* dashboards.SaveDashboardCommand , error ) {
650+ validateProvisionedDashboard bool ,
651+ ) (* dashboards.SaveDashboardCommand , error ) {
649652 ctx , span := tracer .Start (ctx , "dashboards.service.BuildSaveDashboardcommand" )
650653 defer span .End ()
651654
@@ -976,7 +979,8 @@ func (dr *DashboardServiceImpl) ValidateDashboardRefreshInterval(minRefreshInter
976979}
977980
978981func (dr * DashboardServiceImpl ) SaveProvisionedDashboard (ctx context.Context , dto * dashboards.SaveDashboardDTO ,
979- provisioning * dashboards.DashboardProvisioning ) (* dashboards.Dashboard , error ) {
982+ provisioning * dashboards.DashboardProvisioning ,
983+ ) (* dashboards.Dashboard , error ) {
980984 ctx , span := tracer .Start (ctx , "dashboards.service.SaveProvisionedDashboard" )
981985 defer span .End ()
982986
@@ -1050,7 +1054,8 @@ func (dr *DashboardServiceImpl) UpdateFolderWithManagedByAnnotation(ctx context.
10501054}
10511055
10521056func (dr * DashboardServiceImpl ) SaveDashboard (ctx context.Context , dto * dashboards.SaveDashboardDTO ,
1053- allowUiUpdate bool ) (* dashboards.Dashboard , error ) {
1057+ allowUiUpdate bool ,
1058+ ) (* dashboards.Dashboard , error ) {
10541059 ctx , span := tracer .Start (ctx , "dashboards.service.SaveDashboard" )
10551060 defer span .End ()
10561061
@@ -1085,8 +1090,8 @@ func (dr *DashboardServiceImpl) saveDashboard(ctx context.Context, cmd *dashboar
10851090
10861091// DeleteDashboard removes dashboard from the DB. Errors out if the dashboard was provisioned. Should be used for
10871092// operations by the user where we want to make sure user does not delete provisioned dashboard.
1088- func (dr * DashboardServiceImpl ) DeleteDashboard (ctx context.Context , dashboardId int64 , dashboardUID string , orgId int64 ) error {
1089- return dr .deleteDashboard (ctx , dashboardId , dashboardUID , orgId , true )
1093+ func (dr * DashboardServiceImpl ) DeleteDashboard (ctx context.Context , dashboardId int64 , dashboardUID string , orgId int64 , validateProvisionedDashboard bool ) error {
1094+ return dr .deleteDashboard (ctx , dashboardId , dashboardUID , orgId , validateProvisionedDashboard )
10901095}
10911096
10921097// DeleteAllDashboards will delete all dashboards within a given org.
@@ -1114,7 +1119,8 @@ func (dr *DashboardServiceImpl) deleteDashboard(ctx context.Context, dashboardId
11141119}
11151120
11161121func (dr * DashboardServiceImpl ) ImportDashboard (ctx context.Context , dto * dashboards.SaveDashboardDTO ) (
1117- * dashboards.Dashboard , error ) {
1122+ * dashboards.Dashboard , error ,
1123+ ) {
11181124 ctx , span := tracer .Start (ctx , "dashboards.service.ImportDashboard" )
11191125 defer span .End ()
11201126
@@ -1638,7 +1644,8 @@ func (dr *DashboardServiceImpl) GetDashboardTags(ctx context.Context, query *das
16381644 Limit : 100000 ,
16391645 },
16401646 },
1641- Limit : 100000 })
1647+ Limit : 100000 ,
1648+ })
16421649 if err != nil {
16431650 return nil , err
16441651 }
@@ -1682,7 +1689,6 @@ func (dr *DashboardServiceImpl) DeleteInFolders(ctx context.Context, orgID int64
16821689 OrgId : orgID ,
16831690 FolderUIDs : folderUIDs ,
16841691 })
1685-
16861692 if err != nil {
16871693 return folder .ErrInternal .Errorf ("failed to fetch dashboards: %w" , err )
16881694 }
@@ -1698,7 +1704,7 @@ func (dr *DashboardServiceImpl) DeleteInFolders(ctx context.Context, orgID int64
16981704 }
16991705
17001706 for _ , dash := range dashes {
1701- errDel := dr .DeleteDashboard (ctx , dash .ID , dash .UID , orgID )
1707+ errDel := dr .DeleteDashboard (ctx , dash .ID , dash .UID , orgID , false )
17021708 if errDel != nil {
17031709 dr .log .Error ("failed to delete dashboard inside folder" , "dashboardUID" , dash .UID , "folderUIDs" , folderUIDs , "error" , errDel )
17041710 }
@@ -1714,7 +1720,7 @@ func (dr *DashboardServiceImpl) CleanUpDashboard(ctx context.Context, dashboardU
17141720 defer span .End ()
17151721
17161722 // cleanup things related to dashboards that are not stored in unistore yet
1717- var err = dr .publicDashboardService .DeleteByDashboardUIDs (ctx , orgId , []string {dashboardUID })
1723+ err : = dr .publicDashboardService .DeleteByDashboardUIDs (ctx , orgId , []string {dashboardUID })
17181724 if err != nil {
17191725 return err
17201726 }
@@ -1894,7 +1900,8 @@ func (dr *DashboardServiceImpl) searchDashboardsThroughK8sRaw(ctx context.Contex
18941900 Fields : []* resourcepb.Requirement {},
18951901 Labels : []* resourcepb.Requirement {},
18961902 },
1897- Limit : 100000 }
1903+ Limit : 100000 ,
1904+ }
18981905
18991906 if len (query .DashboardUIDs ) > 0 {
19001907 request .Options .Fields = []* resourcepb.Requirement {{
0 commit comments