PublicDashboards: Remove publicDashboards FF (#96578)
This commit is contained in:
@@ -21,67 +21,66 @@ For more information about feature release stages, refer to [Release life cycle
|
||||
|
||||
Most [generally available](https://grafana.com/docs/release-life-cycle/#general-availability) features are enabled by default. You can disable these feature by setting the feature flag to "false" in the configuration.
|
||||
|
||||
| Feature toggle name | Description | Enabled by default |
|
||||
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
|
||||
| `disableEnvelopeEncryption` | Disable envelope encryption (emergency only) | |
|
||||
| `publicDashboards` | [Deprecated] Public dashboards are now enabled by default; to disable them, use the configuration setting. This feature toggle will be removed in the next major version. | Yes |
|
||||
| `publicDashboardsScene` | Enables public dashboard rendering using scenes | Yes |
|
||||
| `featureHighlights` | Highlight Grafana Enterprise features | |
|
||||
| `correlations` | Correlations page | Yes |
|
||||
| `cloudWatchCrossAccountQuerying` | Enables cross-account querying in CloudWatch datasources | Yes |
|
||||
| `accessControlOnCall` | Access control primitives for OnCall | Yes |
|
||||
| `nestedFolders` | Enable folder nesting | Yes |
|
||||
| `logsContextDatasourceUi` | Allow datasource to provide custom UI for context view | Yes |
|
||||
| `lokiQuerySplitting` | Split large interval queries into subqueries with smaller time intervals | Yes |
|
||||
| `prometheusMetricEncyclopedia` | Adds the metrics explorer component to the Prometheus query builder as an option in metric select | Yes |
|
||||
| `influxdbBackendMigration` | Query InfluxDB InfluxQL without the proxy | Yes |
|
||||
| `lokiMetricDataplane` | Changes metric responses from Loki to be compliant with the dataplane specification. | Yes |
|
||||
| `dataplaneFrontendFallback` | Support dataplane contract field name change for transformations and field name matchers where the name is different | Yes |
|
||||
| `recordedQueriesMulti` | Enables writing multiple items from a single query within Recorded Queries | Yes |
|
||||
| `logsExploreTableVisualisation` | A table visualisation for logs in Explore | Yes |
|
||||
| `transformationsRedesign` | Enables the transformations redesign | Yes |
|
||||
| `traceQLStreaming` | Enables response streaming of TraceQL queries of the Tempo data source | |
|
||||
| `awsAsyncQueryCaching` | Enable caching for async queries for Redshift and Athena. Requires that the datasource has caching and async query support enabled | Yes |
|
||||
| `prometheusConfigOverhaulAuth` | Update the Prometheus configuration page with the new auth component | Yes |
|
||||
| `alertingNoDataErrorExecution` | Changes how Alerting state manager handles execution of NoData/Error | Yes |
|
||||
| `angularDeprecationUI` | Display Angular warnings in dashboards and panels | Yes |
|
||||
| `dashgpt` | Enable AI powered features in dashboards | Yes |
|
||||
| `alertingInsights` | Show the new alerting insights landing page | Yes |
|
||||
| `panelMonitoring` | Enables panel monitoring through logs and measurements | Yes |
|
||||
| `formatString` | Enable format string transformer | Yes |
|
||||
| `transformationsVariableSupport` | Allows using variables in transformations | Yes |
|
||||
| `kubernetesPlaylists` | Use the kubernetes API in the frontend for playlists, and route /api/playlist requests to k8s | Yes |
|
||||
| `recoveryThreshold` | Enables feature recovery threshold (aka hysteresis) for threshold server-side expression | Yes |
|
||||
| `lokiStructuredMetadata` | Enables the loki data source to request structured metadata from the Loki server | Yes |
|
||||
| `managedPluginsInstall` | Install managed plugins directly from plugins catalog | Yes |
|
||||
| `addFieldFromCalculationStatFunctions` | Add cumulative and window functions to the add field from calculation transformation | Yes |
|
||||
| `annotationPermissionUpdate` | Change the way annotation permissions work by scoping them to folders and dashboards. | Yes |
|
||||
| `dashboardSceneForViewers` | Enables dashboard rendering using Scenes for viewer roles | Yes |
|
||||
| `dashboardSceneSolo` | Enables rendering dashboards using scenes for solo panels | Yes |
|
||||
| `dashboardScene` | Enables dashboard rendering using scenes for all roles | Yes |
|
||||
| `ssoSettingsApi` | Enables the SSO settings API and the OAuth configuration UIs in Grafana | Yes |
|
||||
| `logsInfiniteScrolling` | Enables infinite scrolling for the Logs panel in Explore and Dashboards | Yes |
|
||||
| `exploreMetrics` | Enables the new Explore Metrics core app | Yes |
|
||||
| `alertingSimplifiedRouting` | Enables users to easily configure alert notifications by specifying a contact point directly when editing or creating an alert rule | Yes |
|
||||
| `logRowsPopoverMenu` | Enable filtering menu displayed when text of a log line is selected | Yes |
|
||||
| `lokiQueryHints` | Enables query hints for Loki | Yes |
|
||||
| `alertingQueryOptimization` | Optimizes eligible queries in order to reduce load on datasources | |
|
||||
| `promQLScope` | In-development feature that will allow injection of labels into prometheus queries. | Yes |
|
||||
| `groupToNestedTableTransformation` | Enables the group to nested table transformation | Yes |
|
||||
| `tlsMemcached` | Use TLS-enabled memcached in the enterprise caching feature | Yes |
|
||||
| `cloudWatchNewLabelParsing` | Updates CloudWatch label parsing to be more accurate | Yes |
|
||||
| `accessActionSets` | Introduces action sets for resource permissions. Also ensures that all folder editors and admins can create subfolders without needing any additional permissions. | Yes |
|
||||
| `newDashboardSharingComponent` | Enables the new sharing drawer design | |
|
||||
| `notificationBanner` | Enables the notification banner UI and API | Yes |
|
||||
| `pluginProxyPreserveTrailingSlash` | Preserve plugin proxy trailing slash. | |
|
||||
| `pinNavItems` | Enables pinning of nav items | Yes |
|
||||
| `openSearchBackendFlowEnabled` | Enables the backend query flow for Open Search datasource plugin | Yes |
|
||||
| `cloudWatchRoundUpEndTime` | Round up end time for metric queries to the next minute to avoid missing data | Yes |
|
||||
| `cloudwatchMetricInsightsCrossAccount` | Enables cross account observability for Cloudwatch Metric Insights query builder | Yes |
|
||||
| `singleTopNav` | Unifies the top search bar and breadcrumb bar into one | Yes |
|
||||
| `azureMonitorDisableLogLimit` | Disables the log limit restriction for Azure Monitor when true. The limit is enabled by default. | |
|
||||
| `preinstallAutoUpdate` | Enables automatic updates for pre-installed plugins | Yes |
|
||||
| `alertingUIOptimizeReducer` | Enables removing the reducer from the alerting UI when creating a new alert rule and using instant query | Yes |
|
||||
| Feature toggle name | Description | Enabled by default |
|
||||
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------ |
|
||||
| `disableEnvelopeEncryption` | Disable envelope encryption (emergency only) | |
|
||||
| `publicDashboardsScene` | Enables public dashboard rendering using scenes | Yes |
|
||||
| `featureHighlights` | Highlight Grafana Enterprise features | |
|
||||
| `correlations` | Correlations page | Yes |
|
||||
| `cloudWatchCrossAccountQuerying` | Enables cross-account querying in CloudWatch datasources | Yes |
|
||||
| `accessControlOnCall` | Access control primitives for OnCall | Yes |
|
||||
| `nestedFolders` | Enable folder nesting | Yes |
|
||||
| `logsContextDatasourceUi` | Allow datasource to provide custom UI for context view | Yes |
|
||||
| `lokiQuerySplitting` | Split large interval queries into subqueries with smaller time intervals | Yes |
|
||||
| `prometheusMetricEncyclopedia` | Adds the metrics explorer component to the Prometheus query builder as an option in metric select | Yes |
|
||||
| `influxdbBackendMigration` | Query InfluxDB InfluxQL without the proxy | Yes |
|
||||
| `lokiMetricDataplane` | Changes metric responses from Loki to be compliant with the dataplane specification. | Yes |
|
||||
| `dataplaneFrontendFallback` | Support dataplane contract field name change for transformations and field name matchers where the name is different | Yes |
|
||||
| `recordedQueriesMulti` | Enables writing multiple items from a single query within Recorded Queries | Yes |
|
||||
| `logsExploreTableVisualisation` | A table visualisation for logs in Explore | Yes |
|
||||
| `transformationsRedesign` | Enables the transformations redesign | Yes |
|
||||
| `traceQLStreaming` | Enables response streaming of TraceQL queries of the Tempo data source | |
|
||||
| `awsAsyncQueryCaching` | Enable caching for async queries for Redshift and Athena. Requires that the datasource has caching and async query support enabled | Yes |
|
||||
| `prometheusConfigOverhaulAuth` | Update the Prometheus configuration page with the new auth component | Yes |
|
||||
| `alertingNoDataErrorExecution` | Changes how Alerting state manager handles execution of NoData/Error | Yes |
|
||||
| `angularDeprecationUI` | Display Angular warnings in dashboards and panels | Yes |
|
||||
| `dashgpt` | Enable AI powered features in dashboards | Yes |
|
||||
| `alertingInsights` | Show the new alerting insights landing page | Yes |
|
||||
| `panelMonitoring` | Enables panel monitoring through logs and measurements | Yes |
|
||||
| `formatString` | Enable format string transformer | Yes |
|
||||
| `transformationsVariableSupport` | Allows using variables in transformations | Yes |
|
||||
| `kubernetesPlaylists` | Use the kubernetes API in the frontend for playlists, and route /api/playlist requests to k8s | Yes |
|
||||
| `recoveryThreshold` | Enables feature recovery threshold (aka hysteresis) for threshold server-side expression | Yes |
|
||||
| `lokiStructuredMetadata` | Enables the loki data source to request structured metadata from the Loki server | Yes |
|
||||
| `managedPluginsInstall` | Install managed plugins directly from plugins catalog | Yes |
|
||||
| `addFieldFromCalculationStatFunctions` | Add cumulative and window functions to the add field from calculation transformation | Yes |
|
||||
| `annotationPermissionUpdate` | Change the way annotation permissions work by scoping them to folders and dashboards. | Yes |
|
||||
| `dashboardSceneForViewers` | Enables dashboard rendering using Scenes for viewer roles | Yes |
|
||||
| `dashboardSceneSolo` | Enables rendering dashboards using scenes for solo panels | Yes |
|
||||
| `dashboardScene` | Enables dashboard rendering using scenes for all roles | Yes |
|
||||
| `ssoSettingsApi` | Enables the SSO settings API and the OAuth configuration UIs in Grafana | Yes |
|
||||
| `logsInfiniteScrolling` | Enables infinite scrolling for the Logs panel in Explore and Dashboards | Yes |
|
||||
| `exploreMetrics` | Enables the new Explore Metrics core app | Yes |
|
||||
| `alertingSimplifiedRouting` | Enables users to easily configure alert notifications by specifying a contact point directly when editing or creating an alert rule | Yes |
|
||||
| `logRowsPopoverMenu` | Enable filtering menu displayed when text of a log line is selected | Yes |
|
||||
| `lokiQueryHints` | Enables query hints for Loki | Yes |
|
||||
| `alertingQueryOptimization` | Optimizes eligible queries in order to reduce load on datasources | |
|
||||
| `promQLScope` | In-development feature that will allow injection of labels into prometheus queries. | Yes |
|
||||
| `groupToNestedTableTransformation` | Enables the group to nested table transformation | Yes |
|
||||
| `tlsMemcached` | Use TLS-enabled memcached in the enterprise caching feature | Yes |
|
||||
| `cloudWatchNewLabelParsing` | Updates CloudWatch label parsing to be more accurate | Yes |
|
||||
| `accessActionSets` | Introduces action sets for resource permissions. Also ensures that all folder editors and admins can create subfolders without needing any additional permissions. | Yes |
|
||||
| `newDashboardSharingComponent` | Enables the new sharing drawer design | |
|
||||
| `notificationBanner` | Enables the notification banner UI and API | Yes |
|
||||
| `pluginProxyPreserveTrailingSlash` | Preserve plugin proxy trailing slash. | |
|
||||
| `pinNavItems` | Enables pinning of nav items | Yes |
|
||||
| `openSearchBackendFlowEnabled` | Enables the backend query flow for Open Search datasource plugin | Yes |
|
||||
| `cloudWatchRoundUpEndTime` | Round up end time for metric queries to the next minute to avoid missing data | Yes |
|
||||
| `cloudwatchMetricInsightsCrossAccount` | Enables cross account observability for Cloudwatch Metric Insights query builder | Yes |
|
||||
| `singleTopNav` | Unifies the top search bar and breadcrumb bar into one | Yes |
|
||||
| `azureMonitorDisableLogLimit` | Disables the log limit restriction for Azure Monitor when true. The limit is enabled by default. | |
|
||||
| `preinstallAutoUpdate` | Enables automatic updates for pre-installed plugins | Yes |
|
||||
| `alertingUIOptimizeReducer` | Enables removing the reducer from the alerting UI when creating a new alert rule and using instant query | Yes |
|
||||
|
||||
## Public preview feature toggles
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ export interface FeatureToggles {
|
||||
['live-service-web-worker']?: boolean;
|
||||
queryOverLive?: boolean;
|
||||
panelTitleSearch?: boolean;
|
||||
publicDashboards?: boolean;
|
||||
publicDashboardsEmailSharing?: boolean;
|
||||
publicDashboardsScene?: boolean;
|
||||
lokiExperimentalStreaming?: boolean;
|
||||
|
||||
+1
-1
@@ -165,7 +165,7 @@ func (hs *HTTPServer) registerRoutes() {
|
||||
r.Get("/dashboards/*", reqSignedIn, hs.Index)
|
||||
r.Get("/goto/:uid", reqSignedIn, hs.redirectFromShortURL, hs.Index)
|
||||
|
||||
if hs.Features.IsEnabledGlobally(featuremgmt.FlagPublicDashboards) && hs.Cfg.PublicDashboardsEnabled {
|
||||
if hs.Cfg.PublicDashboardsEnabled {
|
||||
// list public dashboards
|
||||
r.Get("/public-dashboards/list", reqSignedIn, hs.Index)
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ func (hs *HTTPServer) GetDashboard(c *contextmodel.ReqContext) response.Response
|
||||
)
|
||||
|
||||
// If public dashboards is enabled and we have a public dashboard, update meta values
|
||||
if hs.Features.IsEnabledGlobally(featuremgmt.FlagPublicDashboards) && hs.Cfg.PublicDashboardsEnabled {
|
||||
if hs.Cfg.PublicDashboardsEnabled {
|
||||
publicDashboard, err := hs.PublicDashboardsApi.PublicDashboardService.FindByDashboardUid(ctx, c.SignedInUser.GetOrgID(), dash.UID)
|
||||
if err != nil && !errors.Is(err, publicdashboardModels.ErrPublicDashboardNotFound) {
|
||||
return response.Error(http.StatusInternalServerError, "Error while retrieving public dashboards", err)
|
||||
|
||||
@@ -48,14 +48,6 @@ var (
|
||||
Owner: grafanaSearchAndStorageSquad,
|
||||
HideFromAdminPage: true,
|
||||
},
|
||||
{
|
||||
Name: "publicDashboards",
|
||||
Description: "[Deprecated] Public dashboards are now enabled by default; to disable them, use the configuration setting. This feature toggle will be removed in the next major version.",
|
||||
Stage: FeatureStageGeneralAvailability,
|
||||
Owner: grafanaSharingSquad,
|
||||
Expression: "true", // enabled by default
|
||||
AllowSelfServe: true,
|
||||
},
|
||||
{
|
||||
Name: "publicDashboardsEmailSharing",
|
||||
Description: "Enables public dashboard sharing to be restricted to only allowed emails",
|
||||
|
||||
@@ -3,7 +3,6 @@ disableEnvelopeEncryption,GA,@grafana/grafana-as-code,false,false,false
|
||||
live-service-web-worker,experimental,@grafana/dashboards-squad,false,false,true
|
||||
queryOverLive,experimental,@grafana/dashboards-squad,false,false,true
|
||||
panelTitleSearch,preview,@grafana/search-and-storage,false,false,false
|
||||
publicDashboards,GA,@grafana/sharing-squad,false,false,false
|
||||
publicDashboardsEmailSharing,preview,@grafana/sharing-squad,false,false,false
|
||||
publicDashboardsScene,GA,@grafana/sharing-squad,false,false,true
|
||||
lokiExperimentalStreaming,experimental,@grafana/observability-logs,false,false,false
|
||||
|
||||
|
@@ -23,10 +23,6 @@ const (
|
||||
// Search for dashboards using panel title
|
||||
FlagPanelTitleSearch = "panelTitleSearch"
|
||||
|
||||
// FlagPublicDashboards
|
||||
// [Deprecated] Public dashboards are now enabled by default; to disable them, use the configuration setting. This feature toggle will be removed in the next major version.
|
||||
FlagPublicDashboards = "publicDashboards"
|
||||
|
||||
// FlagPublicDashboardsEmailSharing
|
||||
// Enables public dashboard sharing to be restricted to only allowed emails
|
||||
FlagPublicDashboardsEmailSharing = "publicDashboardsEmailSharing"
|
||||
|
||||
@@ -2833,6 +2833,7 @@
|
||||
"name": "publicDashboards",
|
||||
"resourceVersion": "1720021873452",
|
||||
"creationTimestamp": "2022-04-07T18:30:19Z",
|
||||
"deletionTimestamp": "2024-11-15T16:38:53Z",
|
||||
"annotations": {
|
||||
"grafana.app/updatedTimestamp": "2024-07-03 15:51:13.452477 +0000 UTC"
|
||||
}
|
||||
|
||||
@@ -380,7 +380,7 @@ func (s *ServiceImpl) buildDashboardNavLinks(c *contextmodel.ReqContext) []*navt
|
||||
Icon: "library-panel",
|
||||
})
|
||||
|
||||
if s.features.IsEnabled(c.Req.Context(), featuremgmt.FlagPublicDashboards) && s.cfg.PublicDashboardsEnabled {
|
||||
if s.cfg.PublicDashboardsEnabled {
|
||||
dashboardChildNavs = append(dashboardChildNavs, &navtree.NavLink{
|
||||
Text: "Public dashboards",
|
||||
Id: "dashboards/public",
|
||||
|
||||
@@ -55,14 +55,10 @@ func ProvideApi(
|
||||
}
|
||||
|
||||
// register endpoints if the feature is enabled
|
||||
if features.IsEnabledGlobally(featuremgmt.FlagPublicDashboards) && cfg.PublicDashboardsEnabled {
|
||||
if cfg.PublicDashboardsEnabled {
|
||||
api.RegisterAPIEndpoints()
|
||||
}
|
||||
|
||||
if !features.IsEnabledGlobally(featuremgmt.FlagPublicDashboards) {
|
||||
api.log.Warn("[Deprecated] The publicDashboards feature toggle will be removed in Grafana v11. To disable the public dashboards feature, use the public_dashboards.enabled setting.")
|
||||
}
|
||||
|
||||
return api
|
||||
}
|
||||
|
||||
|
||||
@@ -74,14 +74,7 @@ func TestAPIFeatureDisabled(t *testing.T) {
|
||||
cfg := setting.NewCfg()
|
||||
cfg.PublicDashboardsEnabled = false
|
||||
service := publicdashboards.NewFakePublicDashboardService(t)
|
||||
testServer := setupTestServer(t, cfg, service, userAdmin, true)
|
||||
response := callAPI(testServer, test.Method, test.Path, nil, t)
|
||||
assert.Equal(t, http.StatusNotFound, response.Code)
|
||||
})
|
||||
|
||||
t.Run(test.Name+" - feature flag disabled", func(t *testing.T) {
|
||||
service := publicdashboards.NewFakePublicDashboardService(t)
|
||||
testServer := setupTestServer(t, nil, service, userAdmin, false)
|
||||
testServer := setupTestServer(t, cfg, service, userAdmin)
|
||||
response := callAPI(testServer, test.Method, test.Path, nil, t)
|
||||
assert.Equal(t, http.StatusNotFound, response.Code)
|
||||
})
|
||||
@@ -136,7 +129,7 @@ func TestAPIListPublicDashboard(t *testing.T) {
|
||||
service.On("FindAllWithPagination", mock.Anything, mock.Anything, mock.Anything).
|
||||
Return(test.Response, test.ResponseErr).Maybe()
|
||||
|
||||
testServer := setupTestServer(t, nil, service, test.User, true)
|
||||
testServer := setupTestServer(t, nil, service, test.User)
|
||||
|
||||
response := callAPI(testServer, http.MethodGet, "/api/dashboards/public-dashboards", nil, t)
|
||||
assert.Equal(t, test.ExpectedHttpResponse, response.Code)
|
||||
@@ -263,7 +256,7 @@ func TestAPIDeletePublicDashboard(t *testing.T) {
|
||||
Return(test.ResponseErr)
|
||||
}
|
||||
|
||||
testServer := setupTestServer(t, nil, service, test.User, true)
|
||||
testServer := setupTestServer(t, nil, service, test.User)
|
||||
|
||||
response := callAPI(testServer, http.MethodDelete, fmt.Sprintf("/api/dashboards/uid/%s/public-dashboards/%s", test.DashboardUid, test.PublicDashboardUid), nil, t)
|
||||
assert.Equal(t, test.ExpectedHttpResponse, response.Code)
|
||||
@@ -345,7 +338,7 @@ func TestAPIGetPublicDashboard(t *testing.T) {
|
||||
Return(test.PublicDashboardResult, test.PublicDashboardErr)
|
||||
}
|
||||
|
||||
testServer := setupTestServer(t, nil, service, test.User, true)
|
||||
testServer := setupTestServer(t, nil, service, test.User)
|
||||
|
||||
response := callAPI(
|
||||
testServer,
|
||||
@@ -463,7 +456,7 @@ func TestApiCreatePublicDashboard(t *testing.T) {
|
||||
Return(&PublicDashboard{IsEnabled: true}, test.SaveDashboardErr)
|
||||
}
|
||||
|
||||
testServer := setupTestServer(t, nil, service, test.User, true)
|
||||
testServer := setupTestServer(t, nil, service, test.User)
|
||||
|
||||
response := callAPI(
|
||||
testServer,
|
||||
@@ -597,7 +590,7 @@ func TestAPIUpdatePublicDashboard(t *testing.T) {
|
||||
Return(test.ExpectedResponse, test.ExpectedError)
|
||||
}
|
||||
|
||||
testServer := setupTestServer(t, nil, service, test.User, true)
|
||||
testServer := setupTestServer(t, nil, service, test.User)
|
||||
url := fmt.Sprintf("/api/dashboards/uid/%s/public-dashboards/%s", test.DashboardUid, test.PublicDashboardUid)
|
||||
body := strings.NewReader(test.Body)
|
||||
|
||||
|
||||
@@ -50,7 +50,6 @@ func setupTestServer(
|
||||
cfg *setting.Cfg,
|
||||
service publicdashboards.Service,
|
||||
user *user.SignedInUser,
|
||||
ffEnabled bool,
|
||||
) *web.Mux {
|
||||
t.Helper()
|
||||
|
||||
@@ -66,9 +65,6 @@ func setupTestServer(
|
||||
m.Use(contextProvider(&testContext{user}))
|
||||
|
||||
features := featuremgmt.WithFeatures()
|
||||
if ffEnabled {
|
||||
features = featuremgmt.WithFeatures(featuremgmt.FlagPublicDashboards)
|
||||
}
|
||||
|
||||
if cfg == nil {
|
||||
cfg = setting.NewCfg()
|
||||
|
||||
@@ -104,7 +104,7 @@ func TestAPIViewPublicDashboard(t *testing.T) {
|
||||
service.On("GetPublicDashboardForView", mock.Anything, mock.AnythingOfType("string")).
|
||||
Return(test.DashboardResult, test.Err).Maybe()
|
||||
|
||||
testServer := setupTestServer(t, nil, service, anonymousUser, true)
|
||||
testServer := setupTestServer(t, nil, service, anonymousUser)
|
||||
|
||||
response := callAPI(testServer, http.MethodGet,
|
||||
fmt.Sprintf("/api/public/dashboards/%s", test.AccessToken),
|
||||
@@ -193,7 +193,7 @@ func TestAPIQueryPublicDashboard(t *testing.T) {
|
||||
|
||||
setup := func(enabled bool) (*web.Mux, *publicdashboards.FakePublicDashboardService) {
|
||||
service := publicdashboards.NewFakePublicDashboardService(t)
|
||||
testServer := setupTestServer(t, nil, service, anonymousUser, true)
|
||||
testServer := setupTestServer(t, nil, service, anonymousUser)
|
||||
|
||||
return testServer, service
|
||||
}
|
||||
@@ -337,7 +337,7 @@ func TestIntegrationUnauthenticatedUserCanGetPubdashPanelQueryData(t *testing.T)
|
||||
require.NoError(t, err)
|
||||
|
||||
// setup test server
|
||||
server := setupTestServer(t, cfg, pds, anonymousUser, true)
|
||||
server := setupTestServer(t, cfg, pds, anonymousUser)
|
||||
|
||||
resp := callAPI(server, http.MethodPost,
|
||||
fmt.Sprintf("/api/public/dashboards/%s/panels/1/query", pubdash.AccessToken),
|
||||
@@ -420,7 +420,7 @@ func TestAPIGetAnnotations(t *testing.T) {
|
||||
Return(test.Annotations, test.ServiceError).Once()
|
||||
}
|
||||
|
||||
testServer := setupTestServer(t, nil, service, anonymousUser, true)
|
||||
testServer := setupTestServer(t, nil, service, anonymousUser)
|
||||
|
||||
path := fmt.Sprintf("/api/public/dashboards/%s/annotations?from=%s&to=%s", test.AccessToken, test.From, test.To)
|
||||
response := callAPI(testServer, http.MethodGet, path, nil, t)
|
||||
|
||||
@@ -38,7 +38,6 @@ const renderPage = () => {
|
||||
|
||||
const enableEmailSharing = () => {
|
||||
config.featureToggles.publicDashboardsEmailSharing = true;
|
||||
config.featureToggles.publicDashboards = true;
|
||||
config.licenseInfo = { ...config.licenseInfo, enabledFeatures: { publicDashboardsEmailSharing: true } };
|
||||
};
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ describe('ShareMenu', () => {
|
||||
Object.defineProperty(contextSrv, 'isSignedIn', {
|
||||
value: true,
|
||||
});
|
||||
config.featureToggles.publicDashboards = true;
|
||||
config.publicDashboardsEnabled = true;
|
||||
config.snapshotEnabled = true;
|
||||
setup({ meta: { canEdit: true } });
|
||||
@@ -38,7 +37,6 @@ describe('ShareMenu', () => {
|
||||
expect(await screen.findByTestId(selector.shareSnapshot)).toBeInTheDocument();
|
||||
});
|
||||
it('should not share externally when public dashboard is disabled', async () => {
|
||||
config.featureToggles.publicDashboards = false;
|
||||
config.publicDashboardsEnabled = false;
|
||||
setup();
|
||||
|
||||
|
||||
-8
@@ -68,7 +68,6 @@ beforeAll(() => {
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
config.featureToggles.publicDashboards = true;
|
||||
config.publicDashboardsEnabled = true;
|
||||
|
||||
jest.spyOn(contextSrv, 'hasPermission').mockReturnValue(true);
|
||||
@@ -151,13 +150,6 @@ describe('SharePublic', () => {
|
||||
expect(screen.getByRole('tablist')).toHaveTextContent('Link');
|
||||
expect(screen.getByRole('tablist')).not.toHaveTextContent('Public dashboard');
|
||||
});
|
||||
it('does not render share panel when public dashboards feature is disabled using feature toggle', async () => {
|
||||
config.featureToggles.publicDashboards = false;
|
||||
await renderSharePublicDashboard(undefined, false);
|
||||
|
||||
expect(screen.getByRole('tablist')).toHaveTextContent('Link');
|
||||
expect(screen.getByRole('tablist')).not.toHaveTextContent('Public dashboard');
|
||||
});
|
||||
it('renders default relative time in settings summary when they are closed', async () => {
|
||||
expect(mockDashboard.time).toEqual({ from: 'now-6h', to: 'now' });
|
||||
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ export const generatePublicDashboardConfigUrl = (dashboardUid: string, dashboard
|
||||
export const validEmailRegex = /^[A-Z\d._%+-]+@[A-Z\d.-]+\.[A-Z]{2,}$/i;
|
||||
|
||||
export const isPublicDashboardsEnabled = () => {
|
||||
return Boolean(config.featureToggles.publicDashboards) && config.publicDashboardsEnabled;
|
||||
return config.publicDashboardsEnabled;
|
||||
};
|
||||
|
||||
export const isEmailSharingEnabled = () =>
|
||||
|
||||
@@ -6,8 +6,7 @@ import { Props as AutoSizerProps } from 'react-virtualized-auto-sizer';
|
||||
import { render } from 'test/test-utils';
|
||||
|
||||
import { selectors as e2eSelectors } from '@grafana/e2e-selectors/src';
|
||||
import { Dashboard, DashboardCursorSync, FieldConfigSource, ThresholdsMode, Panel } from '@grafana/schema/src';
|
||||
import config from 'app/core/config';
|
||||
import { Dashboard, DashboardCursorSync, FieldConfigSource, Panel, ThresholdsMode } from '@grafana/schema/src';
|
||||
import { getRouteComponentProps } from 'app/core/navigation/__mocks__/routeProps';
|
||||
import * as appTypes from 'app/types';
|
||||
import { DashboardInitPhase, DashboardMeta, DashboardRoutes } from 'app/types';
|
||||
@@ -122,8 +121,6 @@ const dashboardBase = {
|
||||
|
||||
describe('PublicDashboardPage', () => {
|
||||
beforeEach(() => {
|
||||
config.featureToggles.publicDashboards = true;
|
||||
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { RouteDescriptor } from '../../core/navigation/types';
|
||||
import { DashboardRoutes } from '../../types';
|
||||
|
||||
export const getPublicDashboardRoutes = (): RouteDescriptor[] => {
|
||||
if (!config.publicDashboardsEnabled || !config.featureToggles.publicDashboards) {
|
||||
if (!config.publicDashboardsEnabled) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user