Public Dashboards: Disable email-sharing when there is no license (#80887)

* PublicDashboards: Disable email-shared dashboards when feature is disabled

* fix pubdash creation when it was email-shared

* add feature name const in OSS

* update doc

* Update service.go

* fix test & linter

* fix test

* Update query_test.go

* update tests

* fix imports

* fix doc linter issues

* Update docs/sources/administration/enterprise-licensing/_index.md

* fix after merge
This commit is contained in:
Agnès Toulet
2024-02-22 09:34:14 +01:00
committed by GitHub
parent cfcf03bf7a
commit 8d68159b52
11 changed files with 174 additions and 298 deletions
@@ -32,6 +32,7 @@ import (
"github.com/grafana/grafana/pkg/services/featuremgmt"
"github.com/grafana/grafana/pkg/services/folder/folderimpl"
"github.com/grafana/grafana/pkg/services/folder/foldertest"
"github.com/grafana/grafana/pkg/services/licensing/licensingtest"
"github.com/grafana/grafana/pkg/services/publicdashboards"
publicdashboardsStore "github.com/grafana/grafana/pkg/services/publicdashboards/database"
. "github.com/grafana/grafana/pkg/services/publicdashboards/models"
@@ -331,7 +332,9 @@ func TestIntegrationUnauthenticatedUserCanGetPubdashPanelQueryData(t *testing.T)
)
require.NoError(t, err)
pds := publicdashboardsService.ProvideService(cfg, store, qds, annotationsService, ac, ws, dashService)
license := licensingtest.NewFakeLicensing()
license.On("FeatureEnabled", FeaturePublicDashboardsEmailSharing).Return(false)
pds := publicdashboardsService.ProvideService(cfg, store, qds, annotationsService, ac, ws, dashService, license)
pubdash, err := pds.Create(context.Background(), &user.SignedInUser{}, savePubDashboardCmd)
require.NoError(t, err)