From 9f53362e3c85b7855da4f2d9d4437e389567912c Mon Sep 17 00:00:00 2001 From: Eric Leijonmarck Date: Wed, 20 Nov 2024 14:11:03 +0000 Subject: [PATCH 01/56] Serviceaccounts: FIX adds qoute for user UID query for postgres (#96749) * Add qoute for user UID of postgres * add tests for uid * fix for uid check not expectable --- .../serviceaccounts/database/store.go | 2 +- .../serviceaccounts/database/store_test.go | 33 +++++++++++++++---- pkg/services/serviceaccounts/tests/common.go | 1 + 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/pkg/services/serviceaccounts/database/store.go b/pkg/services/serviceaccounts/database/store.go index 1e84657a18c..2759fa764eb 100644 --- a/pkg/services/serviceaccounts/database/store.go +++ b/pkg/services/serviceaccounts/database/store.go @@ -222,7 +222,7 @@ func (s *ServiceAccountsStoreImpl) RetrieveServiceAccount(ctx context.Context, q } if query.UID != "" { - whereConditions = append(whereConditions, "user.uid = ?") + whereConditions = append(whereConditions, fmt.Sprintf("%s.uid = ?", s.sqlStore.GetDialect().Quote("user"))) whereParams = append(whereParams, query.UID) } diff --git a/pkg/services/serviceaccounts/database/store_test.go b/pkg/services/serviceaccounts/database/store_test.go index 71db51b1e7e..f00cd48d4df 100644 --- a/pkg/services/serviceaccounts/database/store_test.go +++ b/pkg/services/serviceaccounts/database/store_test.go @@ -265,15 +265,22 @@ func TestIntegrationStore_RetrieveServiceAccount(t *testing.T) { t.Skip("skipping test in short mode") } cases := []struct { - desc string - user tests.TestUser - expectedErr error + desc string + user tests.TestUser + retrieveByUID bool + expectedErr error }{ { desc: "service accounts should exist and get retrieved", user: tests.TestUser{Login: "servicetest1@admin", IsServiceAccount: true}, expectedErr: nil, }, + { + desc: "service accounts should be able to be retrieved with uid", + user: tests.TestUser{Login: "test1@admin", IsServiceAccount: true}, + expectedErr: nil, + retrieveByUID: true, + }, { desc: "service accounts is false should not retrieve user", user: tests.TestUser{Login: "test1@admin", IsServiceAccount: false}, @@ -283,18 +290,30 @@ func TestIntegrationStore_RetrieveServiceAccount(t *testing.T) { for _, c := range cases { t.Run(c.desc, func(t *testing.T) { + var dto *serviceaccounts.ServiceAccountProfileDTO + var err error db, store := setupTestDatabase(t) user := tests.SetupUserServiceAccount(t, db, store.cfg, c.user) - dto, err := store.RetrieveServiceAccount(context.Background(), &serviceaccounts.GetServiceAccountQuery{ - OrgID: user.OrgID, - ID: user.ID, - }) + if c.retrieveByUID { + dto, err = store.RetrieveServiceAccount(context.Background(), &serviceaccounts.GetServiceAccountQuery{ + OrgID: user.OrgID, + UID: user.UID, + }) + } else { + dto, err = store.RetrieveServiceAccount(context.Background(), &serviceaccounts.GetServiceAccountQuery{ + OrgID: user.OrgID, + ID: user.ID, + }) + } if c.expectedErr != nil { require.ErrorIs(t, err, c.expectedErr) } else { require.NoError(t, err) require.Equal(t, c.user.Login, dto.Login) require.Len(t, dto.Teams, 0) + if c.retrieveByUID { + require.Equal(t, user.UID, dto.UID) + } } }) } diff --git a/pkg/services/serviceaccounts/tests/common.go b/pkg/services/serviceaccounts/tests/common.go index 5d35b377b18..c88155232ee 100644 --- a/pkg/services/serviceaccounts/tests/common.go +++ b/pkg/services/serviceaccounts/tests/common.go @@ -25,6 +25,7 @@ type TestUser struct { Role string Login string IsServiceAccount bool + UID string } type TestApiKey struct { From b8e92aacd25184bd87f601c35eca2102280c5ecf Mon Sep 17 00:00:00 2001 From: Juan Cabanas Date: Wed, 20 Nov 2024 11:36:19 -0300 Subject: [PATCH 02/56] PublicDashboards: Remove publicDashboards FF (#96578) --- .../feature-toggles/index.md | 121 +++++++++--------- .../src/types/featureToggles.gen.ts | 1 - pkg/api/api.go | 2 +- pkg/api/dashboard.go | 2 +- pkg/services/featuremgmt/registry.go | 8 -- pkg/services/featuremgmt/toggles_gen.csv | 1 - pkg/services/featuremgmt/toggles_gen.go | 4 - pkg/services/featuremgmt/toggles_gen.json | 1 + pkg/services/navtree/navtreeimpl/navtree.go | 2 +- pkg/services/publicdashboards/api/api.go | 6 +- pkg/services/publicdashboards/api/api_test.go | 19 +-- .../publicdashboards/api/common_test.go | 4 - .../publicdashboards/api/query_test.go | 8 +- .../app/features/admin/UserListPage.test.tsx | 1 - .../sharing/ShareButton/ShareMenu.test.tsx | 2 - .../SharePublicDashboard.test.tsx | 8 -- .../SharePublicDashboardUtils.ts | 2 +- .../containers/PublicDashboardPage.test.tsx | 5 +- public/app/features/dashboard/routes.ts | 2 +- 19 files changed, 78 insertions(+), 121 deletions(-) diff --git a/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md b/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md index 5537f1d1e73..80eb722167b 100644 --- a/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md +++ b/docs/sources/setup-grafana/configure-grafana/feature-toggles/index.md @@ -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 diff --git a/packages/grafana-data/src/types/featureToggles.gen.ts b/packages/grafana-data/src/types/featureToggles.gen.ts index d4725a2ddfc..bc13567d445 100644 --- a/packages/grafana-data/src/types/featureToggles.gen.ts +++ b/packages/grafana-data/src/types/featureToggles.gen.ts @@ -22,7 +22,6 @@ export interface FeatureToggles { ['live-service-web-worker']?: boolean; queryOverLive?: boolean; panelTitleSearch?: boolean; - publicDashboards?: boolean; publicDashboardsEmailSharing?: boolean; publicDashboardsScene?: boolean; lokiExperimentalStreaming?: boolean; diff --git a/pkg/api/api.go b/pkg/api/api.go index adf60b406d7..10b62c61edf 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -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) diff --git a/pkg/api/dashboard.go b/pkg/api/dashboard.go index 82af44e30a4..9ac9a75d9b2 100644 --- a/pkg/api/dashboard.go +++ b/pkg/api/dashboard.go @@ -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) diff --git a/pkg/services/featuremgmt/registry.go b/pkg/services/featuremgmt/registry.go index 5b9c896da78..e0479cf21d8 100644 --- a/pkg/services/featuremgmt/registry.go +++ b/pkg/services/featuremgmt/registry.go @@ -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", diff --git a/pkg/services/featuremgmt/toggles_gen.csv b/pkg/services/featuremgmt/toggles_gen.csv index c2c16c42a24..bf16af29d46 100644 --- a/pkg/services/featuremgmt/toggles_gen.csv +++ b/pkg/services/featuremgmt/toggles_gen.csv @@ -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 diff --git a/pkg/services/featuremgmt/toggles_gen.go b/pkg/services/featuremgmt/toggles_gen.go index e4b508f069c..8578b6d27b0 100644 --- a/pkg/services/featuremgmt/toggles_gen.go +++ b/pkg/services/featuremgmt/toggles_gen.go @@ -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" diff --git a/pkg/services/featuremgmt/toggles_gen.json b/pkg/services/featuremgmt/toggles_gen.json index 31745d2b3c8..f1f7a7cd6d4 100644 --- a/pkg/services/featuremgmt/toggles_gen.json +++ b/pkg/services/featuremgmt/toggles_gen.json @@ -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" } diff --git a/pkg/services/navtree/navtreeimpl/navtree.go b/pkg/services/navtree/navtreeimpl/navtree.go index 7db5ee4a8cc..255f3452e36 100644 --- a/pkg/services/navtree/navtreeimpl/navtree.go +++ b/pkg/services/navtree/navtreeimpl/navtree.go @@ -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", diff --git a/pkg/services/publicdashboards/api/api.go b/pkg/services/publicdashboards/api/api.go index cbbbcf605f0..eda1a4a249e 100644 --- a/pkg/services/publicdashboards/api/api.go +++ b/pkg/services/publicdashboards/api/api.go @@ -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 } diff --git a/pkg/services/publicdashboards/api/api_test.go b/pkg/services/publicdashboards/api/api_test.go index d76d0239a41..a05ad2a14ff 100644 --- a/pkg/services/publicdashboards/api/api_test.go +++ b/pkg/services/publicdashboards/api/api_test.go @@ -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) diff --git a/pkg/services/publicdashboards/api/common_test.go b/pkg/services/publicdashboards/api/common_test.go index 4c02be71c97..85de1714450 100644 --- a/pkg/services/publicdashboards/api/common_test.go +++ b/pkg/services/publicdashboards/api/common_test.go @@ -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() diff --git a/pkg/services/publicdashboards/api/query_test.go b/pkg/services/publicdashboards/api/query_test.go index e94df756efa..10bd3b23a70 100644 --- a/pkg/services/publicdashboards/api/query_test.go +++ b/pkg/services/publicdashboards/api/query_test.go @@ -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) diff --git a/public/app/features/admin/UserListPage.test.tsx b/public/app/features/admin/UserListPage.test.tsx index 86e34581877..a59246fca23 100644 --- a/public/app/features/admin/UserListPage.test.tsx +++ b/public/app/features/admin/UserListPage.test.tsx @@ -38,7 +38,6 @@ const renderPage = () => { const enableEmailSharing = () => { config.featureToggles.publicDashboardsEmailSharing = true; - config.featureToggles.publicDashboards = true; config.licenseInfo = { ...config.licenseInfo, enabledFeatures: { publicDashboardsEmailSharing: true } }; }; diff --git a/public/app/features/dashboard-scene/sharing/ShareButton/ShareMenu.test.tsx b/public/app/features/dashboard-scene/sharing/ShareButton/ShareMenu.test.tsx index 0e7940e34d1..27271c66246 100644 --- a/public/app/features/dashboard-scene/sharing/ShareButton/ShareMenu.test.tsx +++ b/public/app/features/dashboard-scene/sharing/ShareButton/ShareMenu.test.tsx @@ -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(); diff --git a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboard.test.tsx b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboard.test.tsx index a0cf8085e08..12d213f8501 100644 --- a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboard.test.tsx +++ b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboard.test.tsx @@ -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' }); diff --git a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils.ts b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils.ts index dde37ece294..34de4860b99 100644 --- a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils.ts +++ b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils.ts @@ -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 = () => diff --git a/public/app/features/dashboard/containers/PublicDashboardPage.test.tsx b/public/app/features/dashboard/containers/PublicDashboardPage.test.tsx index d3e509db17c..b5b96868e02 100644 --- a/public/app/features/dashboard/containers/PublicDashboardPage.test.tsx +++ b/public/app/features/dashboard/containers/PublicDashboardPage.test.tsx @@ -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(); }); diff --git a/public/app/features/dashboard/routes.ts b/public/app/features/dashboard/routes.ts index 127d57b118e..4c20ec7229f 100644 --- a/public/app/features/dashboard/routes.ts +++ b/public/app/features/dashboard/routes.ts @@ -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 []; } From 51dec6317f3d79d3f67da324d08c3d704529114c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 14:56:17 +0000 Subject: [PATCH 03/56] Update dependency dompurify to v3.2.1 (#96762) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index 141a86acf54..9dab0994aeb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10899,7 +10899,7 @@ __metadata: languageName: node linkType: hard -"@types/trusted-types@npm:*": +"@types/trusted-types@npm:*, @types/trusted-types@npm:^2.0.7": version: 2.0.7 resolution: "@types/trusted-types@npm:2.0.7" checksum: 10/8e4202766a65877efcf5d5a41b7dd458480b36195e580a3b1085ad21e948bc417d55d6f8af1fd2a7ad008015d4117d5fdfe432731157da3c68678487174e4ba3 @@ -15785,9 +15785,14 @@ __metadata: linkType: hard "dompurify@npm:^3.0.0": - version: 3.2.0 - resolution: "dompurify@npm:3.2.0" - checksum: 10/d9139fdc69e95efe43d154362216a9a6768c3a238b02b988a7ac0ddd044a992422d6c5fae5b319ab47aef8465824a815d104b843800b294352657f70d5168bfa + version: 3.2.1 + resolution: "dompurify@npm:3.2.1" + dependencies: + "@types/trusted-types": "npm:^2.0.7" + dependenciesMeta: + "@types/trusted-types": + optional: true + checksum: 10/f5f906fadc5e92305ba4272ff60df77a803c0832f3f2ce941099f3dfe015cfb15db44e8623bd4ec1f2297a17bcdac90066c5cb0c5cf1059a09364d060c304ddb languageName: node linkType: hard From c010bf2dc7139eae823ff9735f0c2bae41e784c8 Mon Sep 17 00:00:00 2001 From: Adam Simpson Date: Wed, 20 Nov 2024 10:28:31 -0500 Subject: [PATCH 04/56] ds-querier: account for -100 meaning __expr__ (#96565) * ds-querier: account for -100 meaning __expr__ * temp debug log error parsing query * var confusion * log error --- pkg/registry/apis/query/parser.go | 2 +- pkg/registry/apis/query/query.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/registry/apis/query/parser.go b/pkg/registry/apis/query/parser.go index 98ae81fbd64..dabd8d46566 100644 --- a/pkg/registry/apis/query/parser.go +++ b/pkg/registry/apis/query/parser.go @@ -208,7 +208,7 @@ func (p *queryParser) getValidDataSourceRef(ctx context.Context, ds *data.DataSo if ds.UID == "" { return nil, fmt.Errorf("missing name/uid in data source reference") } - if ds.UID == expr.DatasourceType { + if expr.IsDataSource(ds.UID) { return ds, nil } if p.legacy == nil { diff --git a/pkg/registry/apis/query/query.go b/pkg/registry/apis/query/query.go index 1bbd6ef95a5..be8b24886c8 100644 --- a/pkg/registry/apis/query/query.go +++ b/pkg/registry/apis/query/query.go @@ -147,6 +147,8 @@ func (r *queryREST) Connect(connectCtx context.Context, name string, _ runtime.O }, } + b.log.Error("Error parsing query", "refId", refID, "message", message) + responder.Object(statusCode, qdr) return } From ca422ce5c0c5252b14b193becfeafe982f190242 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 15:30:38 +0000 Subject: [PATCH 05/56] Update dependency i18next to v23.16.8 (#96765) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9dab0994aeb..02523a196a9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -19744,11 +19744,11 @@ __metadata: linkType: hard "i18next@npm:^23.0.0, i18next@npm:^23.11.5, i18next@npm:^23.5.1": - version: 23.16.6 - resolution: "i18next@npm:23.16.6" + version: 23.16.8 + resolution: "i18next@npm:23.16.8" dependencies: "@babel/runtime": "npm:^7.23.2" - checksum: 10/38e8e92707c5c9eec0ba9fc46b0b036889467e738462b101478665e9aedd54570cc33bc3e6c891c2ec15ab683673a5ecacc0ae61ed5c91f2d1cd872d4c36cfc2 + checksum: 10/d5c38011de4d3b4aa466fac6773520eb28007b9d6138e03432bfbfc0d041c04df45e15c67d96f22cd660088cc9b24d3eda32cddc9fb4c6508c5afada6c2e6290 languageName: node linkType: hard From 88fc368c88e2883eded38ccbdb81656b2fc8bfb4 Mon Sep 17 00:00:00 2001 From: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com> Date: Wed, 20 Nov 2024 17:41:43 +0200 Subject: [PATCH 06/56] Update alpine version in Dockerfile (#95051) Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9c71569fc58..563a75e954a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 -ARG BASE_IMAGE=alpine:3.19.1 +ARG BASE_IMAGE=alpine:3.20 ARG JS_IMAGE=node:20-alpine ARG JS_PLATFORM=linux/amd64 ARG GO_IMAGE=golang:1.23.1-alpine From 1f37311de450e145a018d3143f77548f41079187 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 16:08:22 +0000 Subject: [PATCH 07/56] Update dependency rudder-sdk-js to v2.48.29 (#96768) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index c12722817d5..831ff3b693e 100644 --- a/package.json +++ b/package.json @@ -224,7 +224,7 @@ "react-test-renderer": "18.2.0", "redux-mock-store": "1.5.5", "rimraf": "6.0.1", - "rudder-sdk-js": "2.48.26", + "rudder-sdk-js": "2.48.29", "sass": "1.80.7", "sass-loader": "16.0.3", "smtp-tester": "^2.1.0", diff --git a/yarn.lock b/yarn.lock index 02523a196a9..bdf6a5c3b85 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18960,7 +18960,7 @@ __metadata: regenerator-runtime: "npm:0.14.1" reselect: "npm:5.1.1" rimraf: "npm:6.0.1" - rudder-sdk-js: "npm:2.48.26" + rudder-sdk-js: "npm:2.48.29" rxjs: "npm:7.8.1" sass: "npm:1.80.7" sass-loader: "npm:16.0.3" @@ -28801,10 +28801,10 @@ __metadata: languageName: node linkType: hard -"rudder-sdk-js@npm:2.48.26": - version: 2.48.26 - resolution: "rudder-sdk-js@npm:2.48.26" - checksum: 10/1f0bb65fce1b764bd40ac224be7a6b6ed8e16b6bbcc35e92337b850e20771de94e3f8e6142147a6b247afc3b704243e1aecaeeec873e2aad64578d14549e579d +"rudder-sdk-js@npm:2.48.29": + version: 2.48.29 + resolution: "rudder-sdk-js@npm:2.48.29" + checksum: 10/22cdda546c1317c9340e6a920f255b36625af211709631a8985a766d1e1f770ea1e926db291dbbd040b58f8000c3d5eb259acad2baddba830e196ce5a10ea5f3 languageName: node linkType: hard From 6b5a05486b9c1c8fff63225ad611e50f23eba7fd Mon Sep 17 00:00:00 2001 From: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com> Date: Wed, 20 Nov 2024 17:16:02 +0100 Subject: [PATCH 08/56] Fix error source for `clientSecret not found` error (#96771) * Fix error source for clientSecret not found errir * Use errors.New as we are not formatting the error --- pkg/tsdb/azuremonitor/httpclient.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/tsdb/azuremonitor/httpclient.go b/pkg/tsdb/azuremonitor/httpclient.go index 1b6338a75de..41db06c835d 100644 --- a/pkg/tsdb/azuremonitor/httpclient.go +++ b/pkg/tsdb/azuremonitor/httpclient.go @@ -3,6 +3,7 @@ package azuremonitor import ( "context" "crypto/tls" + "errors" "fmt" "net/http" @@ -34,7 +35,7 @@ func newHTTPClient(ctx context.Context, route types.AzRoute, model types.Datasou // Use Azure credentials if the route has OAuth scopes configured if len(route.Scopes) > 0 { if cred, ok := model.Credentials.(*azcredentials.AzureClientSecretCredentials); ok && cred.ClientSecret == "" { - return nil, fmt.Errorf("unable to initialize HTTP Client: clientSecret not found") + return nil, backend.DownstreamError(errors.New("unable to initialize HTTP Client: clientSecret not found")) } authOpts := azhttpclient.NewAuthOptions(azureSettings) From c3c4c6b49f6360fbf48de62b95fc958277db838e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 17:31:53 +0100 Subject: [PATCH 09/56] Update dependency @grafana/experimental to v2.1.4 (#96777) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- .../grafana-o11y-ds-frontend/package.json | 2 +- packages/grafana-prometheus/package.json | 2 +- packages/grafana-sql/package.json | 2 +- .../datasource/azuremonitor/package.json | 2 +- .../datasource/cloud-monitoring/package.json | 2 +- .../package.json | 2 +- .../grafana-testdata-datasource/package.json | 2 +- .../plugins/datasource/jaeger/package.json | 2 +- .../app/plugins/datasource/mssql/package.json | 2 +- .../app/plugins/datasource/mysql/package.json | 2 +- .../app/plugins/datasource/tempo/package.json | 2 +- .../plugins/datasource/zipkin/package.json | 2 +- yarn.lock | 34 +++++++++---------- 14 files changed, 30 insertions(+), 30 deletions(-) diff --git a/package.json b/package.json index 831ff3b693e..b1c46a41954 100644 --- a/package.json +++ b/package.json @@ -260,7 +260,7 @@ "@grafana/azure-sdk": "0.0.5", "@grafana/data": "workspace:*", "@grafana/e2e-selectors": "workspace:*", - "@grafana/experimental": "2.1.2", + "@grafana/experimental": "2.1.4", "@grafana/faro-core": "^1.3.6", "@grafana/faro-web-sdk": "^1.3.6", "@grafana/faro-web-tracing": "^1.8.2", diff --git a/packages/grafana-o11y-ds-frontend/package.json b/packages/grafana-o11y-ds-frontend/package.json index 577a6adcd29..e7e6fccb042 100644 --- a/packages/grafana-o11y-ds-frontend/package.json +++ b/packages/grafana-o11y-ds-frontend/package.json @@ -20,7 +20,7 @@ "@emotion/css": "11.13.4", "@grafana/data": "11.4.0-pre", "@grafana/e2e-selectors": "11.4.0-pre", - "@grafana/experimental": "2.1.2", + "@grafana/experimental": "2.1.4", "@grafana/runtime": "11.4.0-pre", "@grafana/schema": "11.4.0-pre", "@grafana/ui": "11.4.0-pre", diff --git a/packages/grafana-prometheus/package.json b/packages/grafana-prometheus/package.json index 682bdbea469..558a15b6dd6 100644 --- a/packages/grafana-prometheus/package.json +++ b/packages/grafana-prometheus/package.json @@ -39,7 +39,7 @@ "@emotion/css": "11.13.4", "@floating-ui/react": "0.26.28", "@grafana/data": "11.4.0-pre", - "@grafana/experimental": "2.1.2", + "@grafana/experimental": "2.1.4", "@grafana/faro-web-sdk": "1.12.1", "@grafana/runtime": "11.4.0-pre", "@grafana/schema": "11.4.0-pre", diff --git a/packages/grafana-sql/package.json b/packages/grafana-sql/package.json index 611de96aad4..53cbbe20673 100644 --- a/packages/grafana-sql/package.json +++ b/packages/grafana-sql/package.json @@ -17,7 +17,7 @@ "@emotion/css": "11.13.4", "@grafana/data": "11.4.0-pre", "@grafana/e2e-selectors": "11.4.0-pre", - "@grafana/experimental": "2.1.2", + "@grafana/experimental": "2.1.4", "@grafana/runtime": "11.4.0-pre", "@grafana/ui": "11.4.0-pre", "@react-awesome-query-builder/ui": "6.6.3", diff --git a/public/app/plugins/datasource/azuremonitor/package.json b/public/app/plugins/datasource/azuremonitor/package.json index 638e8ab640f..221512298f4 100644 --- a/public/app/plugins/datasource/azuremonitor/package.json +++ b/public/app/plugins/datasource/azuremonitor/package.json @@ -6,7 +6,7 @@ "dependencies": { "@emotion/css": "11.13.4", "@grafana/data": "11.4.0-pre", - "@grafana/experimental": "2.1.2", + "@grafana/experimental": "2.1.4", "@grafana/runtime": "11.4.0-pre", "@grafana/schema": "11.4.0-pre", "@grafana/ui": "11.4.0-pre", diff --git a/public/app/plugins/datasource/cloud-monitoring/package.json b/public/app/plugins/datasource/cloud-monitoring/package.json index 05cc3443b98..3b3dec493c0 100644 --- a/public/app/plugins/datasource/cloud-monitoring/package.json +++ b/public/app/plugins/datasource/cloud-monitoring/package.json @@ -6,7 +6,7 @@ "dependencies": { "@emotion/css": "11.13.4", "@grafana/data": "11.4.0-pre", - "@grafana/experimental": "2.1.2", + "@grafana/experimental": "2.1.4", "@grafana/google-sdk": "0.1.2", "@grafana/runtime": "11.4.0-pre", "@grafana/schema": "11.4.0-pre", diff --git a/public/app/plugins/datasource/grafana-postgresql-datasource/package.json b/public/app/plugins/datasource/grafana-postgresql-datasource/package.json index 1073206f02a..9aa184a7a99 100644 --- a/public/app/plugins/datasource/grafana-postgresql-datasource/package.json +++ b/public/app/plugins/datasource/grafana-postgresql-datasource/package.json @@ -6,7 +6,7 @@ "dependencies": { "@emotion/css": "11.13.4", "@grafana/data": "11.4.0-pre", - "@grafana/experimental": "2.1.2", + "@grafana/experimental": "2.1.4", "@grafana/runtime": "11.4.0-pre", "@grafana/sql": "11.4.0-pre", "@grafana/ui": "11.4.0-pre", diff --git a/public/app/plugins/datasource/grafana-testdata-datasource/package.json b/public/app/plugins/datasource/grafana-testdata-datasource/package.json index 59a588ad818..cb658e298da 100644 --- a/public/app/plugins/datasource/grafana-testdata-datasource/package.json +++ b/public/app/plugins/datasource/grafana-testdata-datasource/package.json @@ -6,7 +6,7 @@ "dependencies": { "@emotion/css": "11.13.4", "@grafana/data": "11.4.0-pre", - "@grafana/experimental": "2.1.2", + "@grafana/experimental": "2.1.4", "@grafana/runtime": "11.4.0-pre", "@grafana/schema": "11.4.0-pre", "@grafana/ui": "11.4.0-pre", diff --git a/public/app/plugins/datasource/jaeger/package.json b/public/app/plugins/datasource/jaeger/package.json index 16d3fefee70..206197b498c 100644 --- a/public/app/plugins/datasource/jaeger/package.json +++ b/public/app/plugins/datasource/jaeger/package.json @@ -7,7 +7,7 @@ "@emotion/css": "11.13.4", "@grafana/data": "workspace:*", "@grafana/e2e-selectors": "workspace:*", - "@grafana/experimental": "2.1.2", + "@grafana/experimental": "2.1.4", "@grafana/o11y-ds-frontend": "workspace:*", "@grafana/runtime": "workspace:*", "@grafana/ui": "workspace:*", diff --git a/public/app/plugins/datasource/mssql/package.json b/public/app/plugins/datasource/mssql/package.json index 52a98ecd261..5499d38215c 100644 --- a/public/app/plugins/datasource/mssql/package.json +++ b/public/app/plugins/datasource/mssql/package.json @@ -6,7 +6,7 @@ "dependencies": { "@emotion/css": "11.13.4", "@grafana/data": "11.4.0-pre", - "@grafana/experimental": "2.1.2", + "@grafana/experimental": "2.1.4", "@grafana/runtime": "11.4.0-pre", "@grafana/sql": "11.4.0-pre", "@grafana/ui": "11.4.0-pre", diff --git a/public/app/plugins/datasource/mysql/package.json b/public/app/plugins/datasource/mysql/package.json index 6b1a6a9c448..4e4826e823d 100644 --- a/public/app/plugins/datasource/mysql/package.json +++ b/public/app/plugins/datasource/mysql/package.json @@ -6,7 +6,7 @@ "dependencies": { "@emotion/css": "11.13.4", "@grafana/data": "11.4.0-pre", - "@grafana/experimental": "2.1.2", + "@grafana/experimental": "2.1.4", "@grafana/runtime": "11.4.0-pre", "@grafana/sql": "11.4.0-pre", "@grafana/ui": "11.4.0-pre", diff --git a/public/app/plugins/datasource/tempo/package.json b/public/app/plugins/datasource/tempo/package.json index 691fd413983..f446b37da61 100644 --- a/public/app/plugins/datasource/tempo/package.json +++ b/public/app/plugins/datasource/tempo/package.json @@ -7,7 +7,7 @@ "@emotion/css": "11.13.4", "@grafana/data": "workspace:*", "@grafana/e2e-selectors": "workspace:*", - "@grafana/experimental": "2.1.2", + "@grafana/experimental": "2.1.4", "@grafana/lezer-logql": "0.2.6", "@grafana/lezer-traceql": "0.0.20", "@grafana/monaco-logql": "^0.0.7", diff --git a/public/app/plugins/datasource/zipkin/package.json b/public/app/plugins/datasource/zipkin/package.json index 07b1b616b38..47721280305 100644 --- a/public/app/plugins/datasource/zipkin/package.json +++ b/public/app/plugins/datasource/zipkin/package.json @@ -7,7 +7,7 @@ "@emotion/css": "11.13.4", "@grafana/data": "workspace:*", "@grafana/e2e-selectors": "workspace:*", - "@grafana/experimental": "2.1.2", + "@grafana/experimental": "2.1.4", "@grafana/o11y-ds-frontend": "workspace:*", "@grafana/runtime": "workspace:*", "@grafana/ui": "workspace:*", diff --git a/yarn.lock b/yarn.lock index bdf6a5c3b85..8a75923580d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3044,7 +3044,7 @@ __metadata: "@emotion/css": "npm:11.13.4" "@grafana/data": "npm:11.4.0-pre" "@grafana/e2e-selectors": "npm:11.4.0-pre" - "@grafana/experimental": "npm:2.1.2" + "@grafana/experimental": "npm:2.1.4" "@grafana/plugin-configs": "npm:11.4.0-pre" "@grafana/runtime": "npm:11.4.0-pre" "@grafana/schema": "npm:11.4.0-pre" @@ -3087,7 +3087,7 @@ __metadata: "@emotion/css": "npm:11.13.4" "@grafana/data": "npm:11.4.0-pre" "@grafana/e2e-selectors": "npm:11.4.0-pre" - "@grafana/experimental": "npm:2.1.2" + "@grafana/experimental": "npm:2.1.4" "@grafana/plugin-configs": "npm:11.4.0-pre" "@grafana/runtime": "npm:11.4.0-pre" "@grafana/sql": "npm:11.4.0-pre" @@ -3158,7 +3158,7 @@ __metadata: "@emotion/css": "npm:11.13.4" "@grafana/data": "npm:11.4.0-pre" "@grafana/e2e-selectors": "npm:11.4.0-pre" - "@grafana/experimental": "npm:2.1.2" + "@grafana/experimental": "npm:2.1.4" "@grafana/plugin-configs": "npm:11.4.0-pre" "@grafana/runtime": "npm:11.4.0-pre" "@grafana/schema": "npm:11.4.0-pre" @@ -3198,7 +3198,7 @@ __metadata: "@emotion/css": "npm:11.13.4" "@grafana/data": "workspace:*" "@grafana/e2e-selectors": "workspace:*" - "@grafana/experimental": "npm:2.1.2" + "@grafana/experimental": "npm:2.1.4" "@grafana/o11y-ds-frontend": "workspace:*" "@grafana/plugin-configs": "workspace:*" "@grafana/runtime": "workspace:*" @@ -3240,7 +3240,7 @@ __metadata: "@emotion/css": "npm:11.13.4" "@grafana/data": "npm:11.4.0-pre" "@grafana/e2e-selectors": "npm:11.4.0-pre" - "@grafana/experimental": "npm:2.1.2" + "@grafana/experimental": "npm:2.1.4" "@grafana/plugin-configs": "npm:11.4.0-pre" "@grafana/runtime": "npm:11.4.0-pre" "@grafana/sql": "npm:11.4.0-pre" @@ -3271,7 +3271,7 @@ __metadata: "@emotion/css": "npm:11.13.4" "@grafana/data": "npm:11.4.0-pre" "@grafana/e2e-selectors": "npm:11.4.0-pre" - "@grafana/experimental": "npm:2.1.2" + "@grafana/experimental": "npm:2.1.4" "@grafana/plugin-configs": "npm:11.4.0-pre" "@grafana/runtime": "npm:11.4.0-pre" "@grafana/sql": "npm:11.4.0-pre" @@ -3334,7 +3334,7 @@ __metadata: "@emotion/css": "npm:11.13.4" "@grafana/data": "npm:11.4.0-pre" "@grafana/e2e-selectors": "npm:11.4.0-pre" - "@grafana/experimental": "npm:2.1.2" + "@grafana/experimental": "npm:2.1.4" "@grafana/google-sdk": "npm:0.1.2" "@grafana/plugin-configs": "npm:11.4.0-pre" "@grafana/runtime": "npm:11.4.0-pre" @@ -3381,7 +3381,7 @@ __metadata: "@emotion/css": "npm:11.13.4" "@grafana/data": "workspace:*" "@grafana/e2e-selectors": "workspace:*" - "@grafana/experimental": "npm:2.1.2" + "@grafana/experimental": "npm:2.1.4" "@grafana/lezer-logql": "npm:0.2.6" "@grafana/lezer-traceql": "npm:0.0.20" "@grafana/monaco-logql": "npm:^0.0.7" @@ -3441,7 +3441,7 @@ __metadata: "@emotion/css": "npm:11.13.4" "@grafana/data": "workspace:*" "@grafana/e2e-selectors": "workspace:*" - "@grafana/experimental": "npm:2.1.2" + "@grafana/experimental": "npm:2.1.4" "@grafana/o11y-ds-frontend": "workspace:*" "@grafana/plugin-configs": "workspace:*" "@grafana/runtime": "workspace:*" @@ -3631,9 +3631,9 @@ __metadata: languageName: node linkType: hard -"@grafana/experimental@npm:2.1.2": - version: 2.1.2 - resolution: "@grafana/experimental@npm:2.1.2" +"@grafana/experimental@npm:2.1.4": + version: 2.1.4 + resolution: "@grafana/experimental@npm:2.1.4" dependencies: "@hello-pangea/dnd": "npm:^16.6.0" "@types/uuid": "npm:^8.3.3" @@ -3653,7 +3653,7 @@ __metadata: react-dom: ^18.2.0 react-select: ^5.8.0 rxjs: ^7.8.1 - checksum: 10/6a00737f870a842d1178ab8515de06fb5eb845a5d6f2adcb32e3dcb5bc76af7d2f72c8c5ea5cedbb22526277bdd32916089bad47b9b04a65b95780244ac1558f + checksum: 10/b4b253e0fa0decdaf459c0e7bf16d78cce6de1f3ad6686002474cf626d8439b9a308cd8663564feab7b7242047d754c896e218db8cfc9f7c52971dfd61f294e7 languageName: node linkType: hard @@ -3792,7 +3792,7 @@ __metadata: "@emotion/css": "npm:11.13.4" "@grafana/data": "npm:11.4.0-pre" "@grafana/e2e-selectors": "npm:11.4.0-pre" - "@grafana/experimental": "npm:2.1.2" + "@grafana/experimental": "npm:2.1.4" "@grafana/runtime": "npm:11.4.0-pre" "@grafana/schema": "npm:11.4.0-pre" "@grafana/tsconfig": "npm:^2.0.0" @@ -3863,7 +3863,7 @@ __metadata: "@floating-ui/react": "npm:0.26.28" "@grafana/data": "npm:11.4.0-pre" "@grafana/e2e-selectors": "npm:11.4.0-pre" - "@grafana/experimental": "npm:2.1.2" + "@grafana/experimental": "npm:2.1.4" "@grafana/faro-web-sdk": "npm:1.12.1" "@grafana/runtime": "npm:11.4.0-pre" "@grafana/schema": "npm:11.4.0-pre" @@ -4109,7 +4109,7 @@ __metadata: "@emotion/css": "npm:11.13.4" "@grafana/data": "npm:11.4.0-pre" "@grafana/e2e-selectors": "npm:11.4.0-pre" - "@grafana/experimental": "npm:2.1.2" + "@grafana/experimental": "npm:2.1.4" "@grafana/runtime": "npm:11.4.0-pre" "@grafana/tsconfig": "npm:^2.0.0" "@grafana/ui": "npm:11.4.0-pre" @@ -18680,7 +18680,7 @@ __metadata: "@grafana/e2e-selectors": "workspace:*" "@grafana/eslint-config": "npm:8.0.0" "@grafana/eslint-plugin": "link:./packages/grafana-eslint-rules" - "@grafana/experimental": "npm:2.1.2" + "@grafana/experimental": "npm:2.1.4" "@grafana/faro-core": "npm:^1.3.6" "@grafana/faro-web-sdk": "npm:^1.3.6" "@grafana/faro-web-tracing": "npm:^1.8.2" From b5e9b78623d004a4c61d35906a2200780fc1c300 Mon Sep 17 00:00:00 2001 From: Matias Chomicki Date: Wed, 20 Nov 2024 17:04:30 +0000 Subject: [PATCH 10/56] Loki: Added support for disabled operations in Query Builder (#96751) * Loki operations: define basic toggleable operations * LokiQueryModeller: skip disabled operations * Loki operations: define toggleable operations * Add test * Add test --- .../querybuilder/LokiQueryModeller.test.ts | 11 ++++ .../loki/querybuilder/LokiQueryModeller.ts | 3 + .../querybuilder/binaryScalarOperations.ts | 1 + .../components/LokiQueryBuilder.test.tsx | 64 ++++++++++++++++++- .../loki/querybuilder/operationUtils.ts | 3 + .../loki/querybuilder/operations.ts | 22 +++++++ 6 files changed, 103 insertions(+), 1 deletion(-) diff --git a/public/app/plugins/datasource/loki/querybuilder/LokiQueryModeller.test.ts b/public/app/plugins/datasource/loki/querybuilder/LokiQueryModeller.test.ts index 7c7b7ac23bc..1557d36249f 100644 --- a/public/app/plugins/datasource/loki/querybuilder/LokiQueryModeller.test.ts +++ b/public/app/plugins/datasource/loki/querybuilder/LokiQueryModeller.test.ts @@ -334,4 +334,15 @@ describe('LokiQueryModeller', () => { expect(result.operations[1].id).toBe(LokiOperationId.Unwrap); }); }); + + describe('Disabled operations', () => { + it('Can query with line filter contains operation with empty params', () => { + expect( + modeller.renderQuery({ + labels: [{ label: 'app', op: '=', value: 'grafana' }], + operations: [{ id: LokiOperationId.LineContains, params: [''], disabled: true }], + }) + ).toBe('{app="grafana"}'); + }); + }); }); diff --git a/public/app/plugins/datasource/loki/querybuilder/LokiQueryModeller.ts b/public/app/plugins/datasource/loki/querybuilder/LokiQueryModeller.ts index 703d4c50f4f..ebb5aeefbb7 100644 --- a/public/app/plugins/datasource/loki/querybuilder/LokiQueryModeller.ts +++ b/public/app/plugins/datasource/loki/querybuilder/LokiQueryModeller.ts @@ -25,6 +25,9 @@ export class LokiQueryModeller extends QueryModellerBase { renderOperations(queryString: string, operations: QueryBuilderOperation[]): string { for (const operation of operations) { + if (operation.disabled) { + continue; + } const def = this.operationsRegistry.getIfExists(operation.id); if (!def) { console.error(`Could not find operation ${operation.id} in the registry`); diff --git a/public/app/plugins/datasource/loki/querybuilder/binaryScalarOperations.ts b/public/app/plugins/datasource/loki/querybuilder/binaryScalarOperations.ts index 3b2a56483ba..e41955641fd 100644 --- a/public/app/plugins/datasource/loki/querybuilder/binaryScalarOperations.ts +++ b/public/app/plugins/datasource/loki/querybuilder/binaryScalarOperations.ts @@ -95,6 +95,7 @@ export const binaryScalarOperations: QueryBuilderOperationDefinition[] = binaryS name: opDef.name, params, defaultParams, + toggleable: true, alternativesKey: 'binary scalar operations', category: LokiVisualQueryOperationCategory.BinaryOps, renderer: getSimpleBinaryRenderer(opDef.sign), diff --git a/public/app/plugins/datasource/loki/querybuilder/components/LokiQueryBuilder.test.tsx b/public/app/plugins/datasource/loki/querybuilder/components/LokiQueryBuilder.test.tsx index 2fa9d9f1801..137d733b7bf 100644 --- a/public/app/plugins/datasource/loki/querybuilder/components/LokiQueryBuilder.test.tsx +++ b/public/app/plugins/datasource/loki/querybuilder/components/LokiQueryBuilder.test.tsx @@ -7,7 +7,7 @@ import { config } from '@grafana/runtime'; import { createLokiDatasource } from '../../__mocks__/datasource'; import { LokiOperationId, LokiVisualQuery } from '../types'; -import { LokiQueryBuilder, TIME_SPAN_TO_TRIGGER_SAMPLES } from './LokiQueryBuilder'; +import { LokiQueryBuilder, Props, TIME_SPAN_TO_TRIGGER_SAMPLES } from './LokiQueryBuilder'; import { EXPLAIN_LABEL_FILTER_CONTENT } from './LokiQueryBuilderExplained'; const MISSING_LABEL_FILTER_ERROR_MESSAGE = 'Select at least 1 label filter (label and value)'; @@ -317,6 +317,68 @@ describe('LokiQueryBuilder', () => { expect(props.datasource.getDataSamples).toHaveBeenCalledTimes(1); }); }); + + describe('Disabling operations', () => { + let props: Omit; + beforeEach(() => { + props = createDefaultProps(); + props.datasource.getDataSamples = jest.fn().mockReturnValue(new Promise(() => {})); + props.datasource.languageProvider.fetchLabelValues = jest.fn().mockReturnValue(['a', 'b']); + }); + it('Allows to disable operations', async () => { + const onChange = jest.fn(); + + const query: LokiVisualQuery = { + labels: [{ op: '=', label: 'job', value: 'grafana' }], + operations: [ + { + id: LokiOperationId.Logfmt, + params: [], + }, + ], + }; + render(); + + expect(screen.getByText('Logfmt')).toBeInTheDocument(); + await userEvent.click(screen.getByTitle('Disable operation')); + expect(onChange).toHaveBeenCalledWith({ + ...query, + operations: [ + { + ...query.operations[0], + disabled: true, + }, + ], + }); + }); + + it('Allows to enable operations', async () => { + const onChange = jest.fn(); + const query: LokiVisualQuery = { + labels: [{ op: '=', label: 'job', value: 'grafana' }], + operations: [ + { + id: LokiOperationId.Logfmt, + params: [], + disabled: true, + }, + ], + }; + render(); + + expect(screen.getByText('Logfmt')).toBeInTheDocument(); + await userEvent.click(screen.getByTitle('Enable operation')); + expect(onChange).toHaveBeenCalledWith({ + ...query, + operations: [ + { + ...query.operations[0], + disabled: false, + }, + ], + }); + }); + }); }); const getSelectParent = (input: HTMLElement) => diff --git a/public/app/plugins/datasource/loki/querybuilder/operationUtils.ts b/public/app/plugins/datasource/loki/querybuilder/operationUtils.ts index 971ae7e3fc0..2ac580b9dc3 100644 --- a/public/app/plugins/datasource/loki/querybuilder/operationUtils.ts +++ b/public/app/plugins/datasource/loki/querybuilder/operationUtils.ts @@ -48,6 +48,7 @@ export function createRangeOperation( name: getLokiOperationDisplayName(name), params: params, defaultParams, + toggleable: true, alternativesKey: 'range function', category: LokiVisualQueryOperationCategory.RangeFunctions, orderRank: LokiOperationOrder.RangeVectorFunction, @@ -86,6 +87,7 @@ export function createRangeOperationWithGrouping(name: string): QueryBuilderOper }, ], defaultParams: [...rangeOperation.defaultParams, ''], + toggleable: true, alternativesKey: 'range function with grouping', category: LokiVisualQueryOperationCategory.RangeFunctions, renderer: getRangeAggregationWithGroupingRenderer(name, 'by'), @@ -431,6 +433,7 @@ export function createAggregationOperation( }, ], defaultParams: [], + toggleable: true, alternativesKey: 'plain aggregations', category: LokiVisualQueryOperationCategory.Aggregations, renderer: functionRendererLeft, diff --git a/public/app/plugins/datasource/loki/querybuilder/operations.ts b/public/app/plugins/datasource/loki/querybuilder/operations.ts index 1ecdec52d9e..5fb91ce0f2f 100644 --- a/public/app/plugins/datasource/loki/querybuilder/operations.ts +++ b/public/app/plugins/datasource/loki/querybuilder/operations.ts @@ -87,6 +87,7 @@ function getOperationDefinitions(): QueryBuilderOperationDefinition[] { }, ], defaultParams: [], + toggleable: true, alternativesKey: 'format', category: LokiVisualQueryOperationCategory.Formats, orderRank: LokiOperationOrder.Parsers, @@ -125,6 +126,7 @@ function getOperationDefinitions(): QueryBuilderOperationDefinition[] { }, ], defaultParams: [false, false], + toggleable: true, alternativesKey: 'format', category: LokiVisualQueryOperationCategory.Formats, orderRank: LokiOperationOrder.Parsers, @@ -147,6 +149,7 @@ function getOperationDefinitions(): QueryBuilderOperationDefinition[] { }, ], defaultParams: [''], + toggleable: true, alternativesKey: 'format', category: LokiVisualQueryOperationCategory.Formats, orderRank: LokiOperationOrder.Parsers, @@ -169,6 +172,7 @@ function getOperationDefinitions(): QueryBuilderOperationDefinition[] { }, ], defaultParams: [''], + toggleable: true, alternativesKey: 'format', category: LokiVisualQueryOperationCategory.Formats, orderRank: LokiOperationOrder.Parsers, @@ -182,6 +186,7 @@ function getOperationDefinitions(): QueryBuilderOperationDefinition[] { name: 'Unpack', params: [], defaultParams: [], + toggleable: true, alternativesKey: 'format', category: LokiVisualQueryOperationCategory.Formats, orderRank: LokiOperationOrder.Parsers, @@ -204,6 +209,7 @@ function getOperationDefinitions(): QueryBuilderOperationDefinition[] { }, ], defaultParams: [''], + toggleable: true, alternativesKey: 'format', category: LokiVisualQueryOperationCategory.Formats, orderRank: LokiOperationOrder.PipeOperations, @@ -225,6 +231,7 @@ Example: \`{{.status_code}} - {{.message}}\` { name: 'Rename to', type: 'string' }, ], defaultParams: ['', ''], + toggleable: true, alternativesKey: 'format', category: LokiVisualQueryOperationCategory.Formats, orderRank: LokiOperationOrder.PipeOperations, @@ -255,6 +262,7 @@ Example: \`\`error_level=\`level\` \`\` }, ], defaultParams: [''], + toggleable: true, alternativesKey: 'line filter', category: LokiVisualQueryOperationCategory.LineFilters, orderRank: LokiOperationOrder.LineFilters, @@ -278,6 +286,7 @@ Example: \`\`error_level=\`level\` \`\` }, ], defaultParams: [''], + toggleable: true, alternativesKey: 'line filter', category: LokiVisualQueryOperationCategory.LineFilters, orderRank: LokiOperationOrder.LineFilters, @@ -301,6 +310,7 @@ Example: \`\`error_level=\`level\` \`\` }, ], defaultParams: [''], + toggleable: true, alternativesKey: 'line filter', category: LokiVisualQueryOperationCategory.LineFilters, orderRank: LokiOperationOrder.LineFilters, @@ -324,6 +334,7 @@ Example: \`\`error_level=\`level\` \`\` }, ], defaultParams: [''], + toggleable: true, alternativesKey: 'line filter', category: LokiVisualQueryOperationCategory.LineFilters, orderRank: LokiOperationOrder.LineFilters, @@ -347,6 +358,7 @@ Example: \`\`error_level=\`level\` \`\` }, ], defaultParams: [''], + toggleable: true, alternativesKey: 'line filter', category: LokiVisualQueryOperationCategory.LineFilters, orderRank: LokiOperationOrder.LineFilters, @@ -370,6 +382,7 @@ Example: \`\`error_level=\`level\` \`\` }, ], defaultParams: [''], + toggleable: true, alternativesKey: 'line filter', category: LokiVisualQueryOperationCategory.LineFilters, orderRank: LokiOperationOrder.LineFilters, @@ -397,6 +410,7 @@ Example: \`\`error_level=\`level\` \`\` }, ], defaultParams: ['|=', ''], + toggleable: true, alternativesKey: 'line filter', category: LokiVisualQueryOperationCategory.LineFilters, orderRank: LokiOperationOrder.LineFilters, @@ -427,6 +441,7 @@ Example: \`\`error_level=\`level\` \`\` { name: 'Value', type: 'string', minWidth: 14 }, ], defaultParams: ['', '=', ''], + toggleable: true, alternativesKey: 'label filter', category: LokiVisualQueryOperationCategory.LabelFilters, orderRank: LokiOperationOrder.PipeOperations, @@ -448,6 +463,7 @@ Example: \`\`error_level=\`level\` \`\` { name: 'Value', type: 'string', minWidth: 14 }, ], defaultParams: ['', '=', ''], + toggleable: true, alternativesKey: 'label filter', category: LokiVisualQueryOperationCategory.LabelFilters, orderRank: LokiOperationOrder.PipeOperations, @@ -461,6 +477,7 @@ Example: \`\`error_level=\`level\` \`\` name: 'No pipeline errors', params: [], defaultParams: [], + toggleable: true, alternativesKey: 'label filter', category: LokiVisualQueryOperationCategory.LabelFilters, orderRank: LokiOperationOrder.NoErrors, @@ -489,6 +506,7 @@ Example: \`\`error_level=\`level\` \`\` }, ], defaultParams: ['', ''], + toggleable: true, alternativesKey: 'format', category: LokiVisualQueryOperationCategory.Formats, orderRank: LokiOperationOrder.Unwrap, @@ -509,6 +527,7 @@ Example: \`\`error_level=\`level\` \`\` name: 'Decolorize', params: [], defaultParams: [], + toggleable: true, alternativesKey: 'format', category: LokiVisualQueryOperationCategory.Formats, orderRank: LokiOperationOrder.PipeOperations, @@ -533,6 +552,7 @@ Example: \`\`error_level=\`level\` \`\` }, ], defaultParams: [''], + toggleable: true, alternativesKey: 'format', category: LokiVisualQueryOperationCategory.Formats, orderRank: LokiOperationOrder.PipeOperations, @@ -557,6 +577,7 @@ Example: \`\`error_level=\`level\` \`\` }, ], defaultParams: [''], + toggleable: true, alternativesKey: 'format', category: LokiVisualQueryOperationCategory.Formats, orderRank: LokiOperationOrder.PipeOperations, @@ -571,6 +592,7 @@ Example: \`\`error_level=\`level\` \`\` name: 'Binary operation with query', params: [], defaultParams: [], + toggleable: true, category: LokiVisualQueryOperationCategory.BinaryOps, renderer: (model, def, innerExpr) => innerExpr, addOperationHandler: addNestedQueryHandler, From 3aa5811b1e2b6b8e01868dbfd0080cab669054c4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 17:06:44 +0000 Subject: [PATCH 11/56] Update emotion monorepo (#96780) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 4 +- packages/grafana-flamegraph/package.json | 2 +- .../grafana-o11y-ds-frontend/package.json | 2 +- packages/grafana-prometheus/package.json | 2 +- packages/grafana-sql/package.json | 2 +- packages/grafana-ui/package.json | 6 +- .../datasource/azuremonitor/package.json | 2 +- .../datasource/cloud-monitoring/package.json | 2 +- .../package.json | 2 +- .../grafana-pyroscope-datasource/package.json | 2 +- .../grafana-testdata-datasource/package.json | 2 +- .../plugins/datasource/jaeger/package.json | 2 +- .../app/plugins/datasource/mssql/package.json | 2 +- .../app/plugins/datasource/mysql/package.json | 2 +- .../app/plugins/datasource/parca/package.json | 2 +- .../app/plugins/datasource/tempo/package.json | 2 +- .../plugins/datasource/zipkin/package.json | 2 +- yarn.lock | 110 +++++++++--------- 18 files changed, 75 insertions(+), 75 deletions(-) diff --git a/package.json b/package.json index b1c46a41954..126ac513647 100644 --- a/package.json +++ b/package.json @@ -250,8 +250,8 @@ }, "dependencies": { "@bsull/augurs": "^0.6.0", - "@emotion/css": "11.13.4", - "@emotion/react": "11.13.3", + "@emotion/css": "11.13.5", + "@emotion/react": "11.13.5", "@fingerprintjs/fingerprintjs": "^3.4.2", "@floating-ui/react": "0.26.28", "@formatjs/intl-durationformat": "^0.6.0", diff --git a/packages/grafana-flamegraph/package.json b/packages/grafana-flamegraph/package.json index ace41d3a1be..0edf8356a2f 100644 --- a/packages/grafana-flamegraph/package.json +++ b/packages/grafana-flamegraph/package.json @@ -43,7 +43,7 @@ "not IE 11" ], "dependencies": { - "@emotion/css": "11.13.4", + "@emotion/css": "11.13.5", "@grafana/data": "11.4.0-pre", "@grafana/ui": "11.4.0-pre", "@leeoniya/ufuzzy": "1.0.16", diff --git a/packages/grafana-o11y-ds-frontend/package.json b/packages/grafana-o11y-ds-frontend/package.json index e7e6fccb042..543d303bd14 100644 --- a/packages/grafana-o11y-ds-frontend/package.json +++ b/packages/grafana-o11y-ds-frontend/package.json @@ -17,7 +17,7 @@ "typecheck": "tsc --emitDeclarationOnly false --noEmit" }, "dependencies": { - "@emotion/css": "11.13.4", + "@emotion/css": "11.13.5", "@grafana/data": "11.4.0-pre", "@grafana/e2e-selectors": "11.4.0-pre", "@grafana/experimental": "2.1.4", diff --git a/packages/grafana-prometheus/package.json b/packages/grafana-prometheus/package.json index 558a15b6dd6..0bedb26c40a 100644 --- a/packages/grafana-prometheus/package.json +++ b/packages/grafana-prometheus/package.json @@ -36,7 +36,7 @@ "postpack": "mv package.json.bak package.json" }, "dependencies": { - "@emotion/css": "11.13.4", + "@emotion/css": "11.13.5", "@floating-ui/react": "0.26.28", "@grafana/data": "11.4.0-pre", "@grafana/experimental": "2.1.4", diff --git a/packages/grafana-sql/package.json b/packages/grafana-sql/package.json index 53cbbe20673..e86d2e86918 100644 --- a/packages/grafana-sql/package.json +++ b/packages/grafana-sql/package.json @@ -14,7 +14,7 @@ "typecheck": "tsc --emitDeclarationOnly false --noEmit" }, "dependencies": { - "@emotion/css": "11.13.4", + "@emotion/css": "11.13.5", "@grafana/data": "11.4.0-pre", "@grafana/e2e-selectors": "11.4.0-pre", "@grafana/experimental": "2.1.4", diff --git a/packages/grafana-ui/package.json b/packages/grafana-ui/package.json index bbf2eda4c06..9b3f5d41a0e 100644 --- a/packages/grafana-ui/package.json +++ b/packages/grafana-ui/package.json @@ -47,9 +47,9 @@ "not IE 11" ], "dependencies": { - "@emotion/css": "11.13.4", - "@emotion/react": "11.13.3", - "@emotion/serialize": "1.3.2", + "@emotion/css": "11.13.5", + "@emotion/react": "11.13.5", + "@emotion/serialize": "1.3.3", "@floating-ui/react": "0.26.28", "@grafana/data": "11.4.0-pre", "@grafana/e2e-selectors": "11.4.0-pre", diff --git a/public/app/plugins/datasource/azuremonitor/package.json b/public/app/plugins/datasource/azuremonitor/package.json index 221512298f4..c1e9f006538 100644 --- a/public/app/plugins/datasource/azuremonitor/package.json +++ b/public/app/plugins/datasource/azuremonitor/package.json @@ -4,7 +4,7 @@ "private": true, "version": "11.4.0-pre", "dependencies": { - "@emotion/css": "11.13.4", + "@emotion/css": "11.13.5", "@grafana/data": "11.4.0-pre", "@grafana/experimental": "2.1.4", "@grafana/runtime": "11.4.0-pre", diff --git a/public/app/plugins/datasource/cloud-monitoring/package.json b/public/app/plugins/datasource/cloud-monitoring/package.json index 3b3dec493c0..a2b016bfb7e 100644 --- a/public/app/plugins/datasource/cloud-monitoring/package.json +++ b/public/app/plugins/datasource/cloud-monitoring/package.json @@ -4,7 +4,7 @@ "private": true, "version": "11.4.0-pre", "dependencies": { - "@emotion/css": "11.13.4", + "@emotion/css": "11.13.5", "@grafana/data": "11.4.0-pre", "@grafana/experimental": "2.1.4", "@grafana/google-sdk": "0.1.2", diff --git a/public/app/plugins/datasource/grafana-postgresql-datasource/package.json b/public/app/plugins/datasource/grafana-postgresql-datasource/package.json index 9aa184a7a99..031943831af 100644 --- a/public/app/plugins/datasource/grafana-postgresql-datasource/package.json +++ b/public/app/plugins/datasource/grafana-postgresql-datasource/package.json @@ -4,7 +4,7 @@ "private": true, "version": "11.4.0-pre", "dependencies": { - "@emotion/css": "11.13.4", + "@emotion/css": "11.13.5", "@grafana/data": "11.4.0-pre", "@grafana/experimental": "2.1.4", "@grafana/runtime": "11.4.0-pre", diff --git a/public/app/plugins/datasource/grafana-pyroscope-datasource/package.json b/public/app/plugins/datasource/grafana-pyroscope-datasource/package.json index fe4d3308359..d5640330a3c 100644 --- a/public/app/plugins/datasource/grafana-pyroscope-datasource/package.json +++ b/public/app/plugins/datasource/grafana-pyroscope-datasource/package.json @@ -4,7 +4,7 @@ "private": true, "version": "11.4.0-pre", "dependencies": { - "@emotion/css": "11.13.4", + "@emotion/css": "11.13.5", "@grafana/data": "11.4.0-pre", "@grafana/runtime": "11.4.0-pre", "@grafana/schema": "11.4.0-pre", diff --git a/public/app/plugins/datasource/grafana-testdata-datasource/package.json b/public/app/plugins/datasource/grafana-testdata-datasource/package.json index cb658e298da..df2213c401e 100644 --- a/public/app/plugins/datasource/grafana-testdata-datasource/package.json +++ b/public/app/plugins/datasource/grafana-testdata-datasource/package.json @@ -4,7 +4,7 @@ "private": true, "version": "11.4.0-pre", "dependencies": { - "@emotion/css": "11.13.4", + "@emotion/css": "11.13.5", "@grafana/data": "11.4.0-pre", "@grafana/experimental": "2.1.4", "@grafana/runtime": "11.4.0-pre", diff --git a/public/app/plugins/datasource/jaeger/package.json b/public/app/plugins/datasource/jaeger/package.json index 206197b498c..10fec74bfcb 100644 --- a/public/app/plugins/datasource/jaeger/package.json +++ b/public/app/plugins/datasource/jaeger/package.json @@ -4,7 +4,7 @@ "private": true, "version": "11.4.0-pre", "dependencies": { - "@emotion/css": "11.13.4", + "@emotion/css": "11.13.5", "@grafana/data": "workspace:*", "@grafana/e2e-selectors": "workspace:*", "@grafana/experimental": "2.1.4", diff --git a/public/app/plugins/datasource/mssql/package.json b/public/app/plugins/datasource/mssql/package.json index 5499d38215c..6255725974d 100644 --- a/public/app/plugins/datasource/mssql/package.json +++ b/public/app/plugins/datasource/mssql/package.json @@ -4,7 +4,7 @@ "private": true, "version": "11.4.0-pre", "dependencies": { - "@emotion/css": "11.13.4", + "@emotion/css": "11.13.5", "@grafana/data": "11.4.0-pre", "@grafana/experimental": "2.1.4", "@grafana/runtime": "11.4.0-pre", diff --git a/public/app/plugins/datasource/mysql/package.json b/public/app/plugins/datasource/mysql/package.json index 4e4826e823d..aec294dc1ad 100644 --- a/public/app/plugins/datasource/mysql/package.json +++ b/public/app/plugins/datasource/mysql/package.json @@ -4,7 +4,7 @@ "private": true, "version": "11.4.0-pre", "dependencies": { - "@emotion/css": "11.13.4", + "@emotion/css": "11.13.5", "@grafana/data": "11.4.0-pre", "@grafana/experimental": "2.1.4", "@grafana/runtime": "11.4.0-pre", diff --git a/public/app/plugins/datasource/parca/package.json b/public/app/plugins/datasource/parca/package.json index 5ca3dc60876..a45857cae3f 100644 --- a/public/app/plugins/datasource/parca/package.json +++ b/public/app/plugins/datasource/parca/package.json @@ -4,7 +4,7 @@ "private": true, "version": "11.4.0-pre", "dependencies": { - "@emotion/css": "11.13.4", + "@emotion/css": "11.13.5", "@grafana/data": "11.4.0-pre", "@grafana/runtime": "11.4.0-pre", "@grafana/schema": "11.4.0-pre", diff --git a/public/app/plugins/datasource/tempo/package.json b/public/app/plugins/datasource/tempo/package.json index f446b37da61..7e4b277481a 100644 --- a/public/app/plugins/datasource/tempo/package.json +++ b/public/app/plugins/datasource/tempo/package.json @@ -4,7 +4,7 @@ "private": true, "version": "11.4.0-pre", "dependencies": { - "@emotion/css": "11.13.4", + "@emotion/css": "11.13.5", "@grafana/data": "workspace:*", "@grafana/e2e-selectors": "workspace:*", "@grafana/experimental": "2.1.4", diff --git a/public/app/plugins/datasource/zipkin/package.json b/public/app/plugins/datasource/zipkin/package.json index 47721280305..289d6466e0a 100644 --- a/public/app/plugins/datasource/zipkin/package.json +++ b/public/app/plugins/datasource/zipkin/package.json @@ -4,7 +4,7 @@ "private": true, "version": "11.4.0-pre", "dependencies": { - "@emotion/css": "11.13.4", + "@emotion/css": "11.13.5", "@grafana/data": "workspace:*", "@grafana/e2e-selectors": "workspace:*", "@grafana/experimental": "2.1.4", diff --git a/yarn.lock b/yarn.lock index 8a75923580d..9fc587eafa1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1915,35 +1915,35 @@ __metadata: languageName: node linkType: hard -"@emotion/babel-plugin@npm:^11.11.0, @emotion/babel-plugin@npm:^11.12.0": - version: 11.12.0 - resolution: "@emotion/babel-plugin@npm:11.12.0" +"@emotion/babel-plugin@npm:^11.11.0, @emotion/babel-plugin@npm:^11.13.5": + version: 11.13.5 + resolution: "@emotion/babel-plugin@npm:11.13.5" dependencies: "@babel/helper-module-imports": "npm:^7.16.7" "@babel/runtime": "npm:^7.18.3" "@emotion/hash": "npm:^0.9.2" "@emotion/memoize": "npm:^0.9.0" - "@emotion/serialize": "npm:^1.2.0" + "@emotion/serialize": "npm:^1.3.3" babel-plugin-macros: "npm:^3.1.0" convert-source-map: "npm:^1.5.0" escape-string-regexp: "npm:^4.0.0" find-root: "npm:^1.1.0" source-map: "npm:^0.5.7" stylis: "npm:4.2.0" - checksum: 10/fe6f4522ea2b61ef4214dd0b0f3778aad9c18434b47e50ae5091af226526bf305455c313065826a090682520c9462c151d4df62ec128f14671d3125afc05b148 + checksum: 10/cd310568314d886ca328e504f84c4f7f9c7f092ea34a2b43fdb61f84665bf301ba2ef49e0fd1e7ded3d81363d9bbefbb32674ce88b317cfb64db2b65e5ff423f languageName: node linkType: hard -"@emotion/cache@npm:^11.11.0, @emotion/cache@npm:^11.13.0, @emotion/cache@npm:^11.4.0": - version: 11.13.1 - resolution: "@emotion/cache@npm:11.13.1" +"@emotion/cache@npm:^11.11.0, @emotion/cache@npm:^11.13.5, @emotion/cache@npm:^11.4.0": + version: 11.13.5 + resolution: "@emotion/cache@npm:11.13.5" dependencies: "@emotion/memoize": "npm:^0.9.0" "@emotion/sheet": "npm:^1.4.0" - "@emotion/utils": "npm:^1.4.0" + "@emotion/utils": "npm:^1.4.2" "@emotion/weak-memoize": "npm:^0.4.0" stylis: "npm:4.2.0" - checksum: 10/090c8ad2e5b23f1b3a95e94f1f0554a40ed1dcd844c9d31629a68ff824eff40f32d1362f67aefa440ee0aabd5a8cabcc76870fd6d77144d3ff251bdcdf1420b9 + checksum: 10/d91139453d279cfd6f6f38180d3af2fdcee8c0fc6d9a6faa2cdce9a1211b294a8019ef45365bf1171e0687d1744a70ff760637b88ed46f7a9fe74db9dc36f4df languageName: node linkType: hard @@ -1960,16 +1960,16 @@ __metadata: languageName: node linkType: hard -"@emotion/css@npm:11.13.4, @emotion/css@npm:^11.11.2": - version: 11.13.4 - resolution: "@emotion/css@npm:11.13.4" +"@emotion/css@npm:11.13.5, @emotion/css@npm:^11.11.2": + version: 11.13.5 + resolution: "@emotion/css@npm:11.13.5" dependencies: - "@emotion/babel-plugin": "npm:^11.12.0" - "@emotion/cache": "npm:^11.13.0" - "@emotion/serialize": "npm:^1.3.0" + "@emotion/babel-plugin": "npm:^11.13.5" + "@emotion/cache": "npm:^11.13.5" + "@emotion/serialize": "npm:^1.3.3" "@emotion/sheet": "npm:^1.4.0" - "@emotion/utils": "npm:^1.4.0" - checksum: 10/57565a8bd9b712b0ade1c8b972bf2f84d2026e4372b3b035fb9d93a85a8f36ca7f2fbe67ecf32cc3fd03956587ece56ab89dd5bd43a76d3aed542a76841c76e5 + "@emotion/utils": "npm:^1.4.2" + checksum: 10/267acf535e6c82e5835563f38a2c49ddc320ba005aeee1b8d1b04a2a217ce6d45639601e95617a78f3746a424d92bbbc837f785dbc29c401e4b614c0c50766d9 languageName: node linkType: hard @@ -2014,16 +2014,16 @@ __metadata: languageName: node linkType: hard -"@emotion/react@npm:11.13.3, @emotion/react@npm:^11.8.1": - version: 11.13.3 - resolution: "@emotion/react@npm:11.13.3" +"@emotion/react@npm:11.13.5, @emotion/react@npm:^11.8.1": + version: 11.13.5 + resolution: "@emotion/react@npm:11.13.5" dependencies: "@babel/runtime": "npm:^7.18.3" - "@emotion/babel-plugin": "npm:^11.12.0" - "@emotion/cache": "npm:^11.13.0" - "@emotion/serialize": "npm:^1.3.1" + "@emotion/babel-plugin": "npm:^11.13.5" + "@emotion/cache": "npm:^11.13.5" + "@emotion/serialize": "npm:^1.3.3" "@emotion/use-insertion-effect-with-fallbacks": "npm:^1.1.0" - "@emotion/utils": "npm:^1.4.0" + "@emotion/utils": "npm:^1.4.2" "@emotion/weak-memoize": "npm:^0.4.0" hoist-non-react-statics: "npm:^3.3.1" peerDependencies: @@ -2031,20 +2031,20 @@ __metadata: peerDependenciesMeta: "@types/react": optional: true - checksum: 10/ee70d3afc2e8dd771e6fe176d27dd87a5e21a54e54d871438fd1caa5aa2312d848c6866292fdc65a6ea1c945147c8422bda2d22ed739178af9902dc86d6b298a + checksum: 10/c85bde9c6144be6f243e44d6834b16df8151b91c5136ea28d9d917155d64d1bbfba000ae98866fd9f5089546f0b0655c20b9e4280cdc5ccf39acc4a2fde37a39 languageName: node linkType: hard -"@emotion/serialize@npm:1.3.2, @emotion/serialize@npm:^1.1.2, @emotion/serialize@npm:^1.2.0, @emotion/serialize@npm:^1.3.0, @emotion/serialize@npm:^1.3.1": - version: 1.3.2 - resolution: "@emotion/serialize@npm:1.3.2" +"@emotion/serialize@npm:1.3.3, @emotion/serialize@npm:^1.1.2, @emotion/serialize@npm:^1.3.3": + version: 1.3.3 + resolution: "@emotion/serialize@npm:1.3.3" dependencies: "@emotion/hash": "npm:^0.9.2" "@emotion/memoize": "npm:^0.9.0" "@emotion/unitless": "npm:^0.10.0" - "@emotion/utils": "npm:^1.4.1" + "@emotion/utils": "npm:^1.4.2" csstype: "npm:^3.0.2" - checksum: 10/ead557c1ff19d917ef8169c02738ef36f0851fbfdf0bf69a543045bddea3b7281dc8252ee466cc5fb44ed27d1e61280ff943bb60a2c04158751fb07b3457cc93 + checksum: 10/44a2e06fc52dba177d9cf720f7b2c5d45ee4c0d9c09b78302d9a625e758d728ef3ae26f849237fec6f70e9eeb7d87e45a65028e944dc1f877df97c599f1cdaee languageName: node linkType: hard @@ -2071,10 +2071,10 @@ __metadata: languageName: node linkType: hard -"@emotion/utils@npm:^1.2.1, @emotion/utils@npm:^1.4.0, @emotion/utils@npm:^1.4.1": - version: 1.4.1 - resolution: "@emotion/utils@npm:1.4.1" - checksum: 10/95e56fc0c9e05cf01a96268f0486ce813f1109a8653d2f575c67df9e8765d9c1b2daf09ad1ada67d933efbb08ca7990228e14b210c713daf90156b4869abe6a7 +"@emotion/utils@npm:^1.2.1, @emotion/utils@npm:^1.4.2": + version: 1.4.2 + resolution: "@emotion/utils@npm:1.4.2" + checksum: 10/e5f3b8bca066b3361a7ad9064baeb9d01ed1bf51d98416a67359b62cb3affec6bb0249802c4ed11f4f8030f93cc4b67506909420bdb110adec6983d712897208 languageName: node linkType: hard @@ -3041,7 +3041,7 @@ __metadata: version: 0.0.0-use.local resolution: "@grafana-plugins/grafana-azure-monitor-datasource@workspace:public/app/plugins/datasource/azuremonitor" dependencies: - "@emotion/css": "npm:11.13.4" + "@emotion/css": "npm:11.13.5" "@grafana/data": "npm:11.4.0-pre" "@grafana/e2e-selectors": "npm:11.4.0-pre" "@grafana/experimental": "npm:2.1.4" @@ -3084,7 +3084,7 @@ __metadata: version: 0.0.0-use.local resolution: "@grafana-plugins/grafana-postgresql-datasource@workspace:public/app/plugins/datasource/grafana-postgresql-datasource" dependencies: - "@emotion/css": "npm:11.13.4" + "@emotion/css": "npm:11.13.5" "@grafana/data": "npm:11.4.0-pre" "@grafana/e2e-selectors": "npm:11.4.0-pre" "@grafana/experimental": "npm:2.1.4" @@ -3115,7 +3115,7 @@ __metadata: version: 0.0.0-use.local resolution: "@grafana-plugins/grafana-pyroscope-datasource@workspace:public/app/plugins/datasource/grafana-pyroscope-datasource" dependencies: - "@emotion/css": "npm:11.13.4" + "@emotion/css": "npm:11.13.5" "@grafana/data": "npm:11.4.0-pre" "@grafana/plugin-configs": "npm:11.4.0-pre" "@grafana/runtime": "npm:11.4.0-pre" @@ -3155,7 +3155,7 @@ __metadata: version: 0.0.0-use.local resolution: "@grafana-plugins/grafana-testdata-datasource@workspace:public/app/plugins/datasource/grafana-testdata-datasource" dependencies: - "@emotion/css": "npm:11.13.4" + "@emotion/css": "npm:11.13.5" "@grafana/data": "npm:11.4.0-pre" "@grafana/e2e-selectors": "npm:11.4.0-pre" "@grafana/experimental": "npm:2.1.4" @@ -3195,7 +3195,7 @@ __metadata: version: 0.0.0-use.local resolution: "@grafana-plugins/jaeger@workspace:public/app/plugins/datasource/jaeger" dependencies: - "@emotion/css": "npm:11.13.4" + "@emotion/css": "npm:11.13.5" "@grafana/data": "workspace:*" "@grafana/e2e-selectors": "workspace:*" "@grafana/experimental": "npm:2.1.4" @@ -3237,7 +3237,7 @@ __metadata: version: 0.0.0-use.local resolution: "@grafana-plugins/mssql@workspace:public/app/plugins/datasource/mssql" dependencies: - "@emotion/css": "npm:11.13.4" + "@emotion/css": "npm:11.13.5" "@grafana/data": "npm:11.4.0-pre" "@grafana/e2e-selectors": "npm:11.4.0-pre" "@grafana/experimental": "npm:2.1.4" @@ -3268,7 +3268,7 @@ __metadata: version: 0.0.0-use.local resolution: "@grafana-plugins/mysql@workspace:public/app/plugins/datasource/mysql" dependencies: - "@emotion/css": "npm:11.13.4" + "@emotion/css": "npm:11.13.5" "@grafana/data": "npm:11.4.0-pre" "@grafana/e2e-selectors": "npm:11.4.0-pre" "@grafana/experimental": "npm:2.1.4" @@ -3299,7 +3299,7 @@ __metadata: version: 0.0.0-use.local resolution: "@grafana-plugins/parca@workspace:public/app/plugins/datasource/parca" dependencies: - "@emotion/css": "npm:11.13.4" + "@emotion/css": "npm:11.13.5" "@grafana/data": "npm:11.4.0-pre" "@grafana/plugin-configs": "npm:11.4.0-pre" "@grafana/runtime": "npm:11.4.0-pre" @@ -3331,7 +3331,7 @@ __metadata: version: 0.0.0-use.local resolution: "@grafana-plugins/stackdriver@workspace:public/app/plugins/datasource/cloud-monitoring" dependencies: - "@emotion/css": "npm:11.13.4" + "@emotion/css": "npm:11.13.5" "@grafana/data": "npm:11.4.0-pre" "@grafana/e2e-selectors": "npm:11.4.0-pre" "@grafana/experimental": "npm:2.1.4" @@ -3378,7 +3378,7 @@ __metadata: version: 0.0.0-use.local resolution: "@grafana-plugins/tempo@workspace:public/app/plugins/datasource/tempo" dependencies: - "@emotion/css": "npm:11.13.4" + "@emotion/css": "npm:11.13.5" "@grafana/data": "workspace:*" "@grafana/e2e-selectors": "workspace:*" "@grafana/experimental": "npm:2.1.4" @@ -3438,7 +3438,7 @@ __metadata: version: 0.0.0-use.local resolution: "@grafana-plugins/zipkin@workspace:public/app/plugins/datasource/zipkin" dependencies: - "@emotion/css": "npm:11.13.4" + "@emotion/css": "npm:11.13.5" "@grafana/data": "workspace:*" "@grafana/e2e-selectors": "workspace:*" "@grafana/experimental": "npm:2.1.4" @@ -3705,7 +3705,7 @@ __metadata: "@babel/core": "npm:7.26.0" "@babel/preset-env": "npm:7.26.0" "@babel/preset-react": "npm:7.25.9" - "@emotion/css": "npm:11.13.4" + "@emotion/css": "npm:11.13.5" "@grafana/data": "npm:11.4.0-pre" "@grafana/tsconfig": "npm:^2.0.0" "@grafana/ui": "npm:11.4.0-pre" @@ -3789,7 +3789,7 @@ __metadata: version: 0.0.0-use.local resolution: "@grafana/o11y-ds-frontend@workspace:packages/grafana-o11y-ds-frontend" dependencies: - "@emotion/css": "npm:11.13.4" + "@emotion/css": "npm:11.13.5" "@grafana/data": "npm:11.4.0-pre" "@grafana/e2e-selectors": "npm:11.4.0-pre" "@grafana/experimental": "npm:2.1.4" @@ -3858,7 +3858,7 @@ __metadata: version: 0.0.0-use.local resolution: "@grafana/prometheus@workspace:packages/grafana-prometheus" dependencies: - "@emotion/css": "npm:11.13.4" + "@emotion/css": "npm:11.13.5" "@emotion/eslint-plugin": "npm:11.12.0" "@floating-ui/react": "npm:0.26.28" "@grafana/data": "npm:11.4.0-pre" @@ -4106,7 +4106,7 @@ __metadata: version: 0.0.0-use.local resolution: "@grafana/sql@workspace:packages/grafana-sql" dependencies: - "@emotion/css": "npm:11.13.4" + "@emotion/css": "npm:11.13.5" "@grafana/data": "npm:11.4.0-pre" "@grafana/e2e-selectors": "npm:11.4.0-pre" "@grafana/experimental": "npm:2.1.4" @@ -4159,9 +4159,9 @@ __metadata: resolution: "@grafana/ui@workspace:packages/grafana-ui" dependencies: "@babel/core": "npm:7.26.0" - "@emotion/css": "npm:11.13.4" - "@emotion/react": "npm:11.13.3" - "@emotion/serialize": "npm:1.3.2" + "@emotion/css": "npm:11.13.5" + "@emotion/react": "npm:11.13.5" + "@emotion/serialize": "npm:1.3.3" "@faker-js/faker": "npm:^9.0.0" "@floating-ui/react": "npm:0.26.28" "@grafana/data": "npm:11.4.0-pre" @@ -18666,9 +18666,9 @@ __metadata: "@betterer/eslint": "npm:5.4.0" "@bsull/augurs": "npm:^0.6.0" "@cypress/webpack-preprocessor": "npm:6.0.2" - "@emotion/css": "npm:11.13.4" + "@emotion/css": "npm:11.13.5" "@emotion/eslint-plugin": "npm:11.12.0" - "@emotion/react": "npm:11.13.3" + "@emotion/react": "npm:11.13.5" "@eslint/compat": "npm:^1.2.0" "@fingerprintjs/fingerprintjs": "npm:^3.4.2" "@floating-ui/react": "npm:0.26.28" From 68e7f6069ce4491c028457b50984080772c09894 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 19:07:03 +0200 Subject: [PATCH 12/56] Update scenes to v5.25.1 (#96782) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 4 ++-- yarn.lock | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 126ac513647..aab622b0ae3 100644 --- a/package.json +++ b/package.json @@ -272,8 +272,8 @@ "@grafana/prometheus": "workspace:*", "@grafana/runtime": "workspace:*", "@grafana/saga-icons": "workspace:*", - "@grafana/scenes": "5.25.0", - "@grafana/scenes-react": "5.25.0", + "@grafana/scenes": "5.25.1", + "@grafana/scenes-react": "5.25.1", "@grafana/schema": "workspace:*", "@grafana/sql": "workspace:*", "@grafana/ui": "workspace:*", diff --git a/yarn.lock b/yarn.lock index 9fc587eafa1..f89b5d7db42 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4042,11 +4042,11 @@ __metadata: languageName: unknown linkType: soft -"@grafana/scenes-react@npm:5.25.0": - version: 5.25.0 - resolution: "@grafana/scenes-react@npm:5.25.0" +"@grafana/scenes-react@npm:5.25.1": + version: 5.25.1 + resolution: "@grafana/scenes-react@npm:5.25.1" dependencies: - "@grafana/scenes": "npm:5.25.0" + "@grafana/scenes": "npm:5.25.1" lru-cache: "npm:^10.2.2" react-use: "npm:^17.4.0" peerDependencies: @@ -4057,16 +4057,16 @@ __metadata: "@grafana/ui": ^11.0.0 react: ^18.0.0 react-dom: ^18.0.0 - checksum: 10/7b1b253aab445ef8e8ed17ed8168c456066ccd518020ed217a0bfecc10635089e7ec5ff4acd0ccf2f86b506ee868602b2c2835de1dffc005b04fe73ce5154170 + checksum: 10/79802b7b83f93874be3fd8c8111efbf04fbf49f3003bdb2b34d45b1ab72ef30eec6fe601b20bbc00f6944584a8d9358664f19dac9dd5f9e3defbd32ac8356319 languageName: node linkType: hard -"@grafana/scenes@npm:5.25.0": - version: 5.25.0 - resolution: "@grafana/scenes@npm:5.25.0" +"@grafana/scenes@npm:5.25.1": + version: 5.25.1 + resolution: "@grafana/scenes@npm:5.25.1" dependencies: "@floating-ui/react": "npm:^0.26.16" - "@leeoniya/ufuzzy": "npm:^1.0.14" + "@leeoniya/ufuzzy": "npm:^1.0.16" "@tanstack/react-virtual": "npm:^3.9.0" react-grid-layout: "npm:^1.3.4" react-use: "npm:^17.5.0" @@ -4080,7 +4080,7 @@ __metadata: "@grafana/ui": ">=10.4" react: ^18.0.0 react-dom: ^18.0.0 - checksum: 10/bef40f88970de1486ba49afca03d2538b1c72ba7d7cfd1df42978ad369b842c66c30d87c814438fe00187d77112520c7ea508fc77d31a9045f37e043ecf12bf7 + checksum: 10/842f3f9bd0a41741905f6a712aa482b3754cc62912b5d508dc188d5e4b1c7f103718b90e031b0efdff74b37e983c1bc5d72c0497cfd8a73680967db1c0018e1b languageName: node linkType: hard @@ -4869,7 +4869,7 @@ __metadata: languageName: node linkType: hard -"@leeoniya/ufuzzy@npm:1.0.16, @leeoniya/ufuzzy@npm:^1.0.14": +"@leeoniya/ufuzzy@npm:1.0.16, @leeoniya/ufuzzy@npm:^1.0.16": version: 1.0.16 resolution: "@leeoniya/ufuzzy@npm:1.0.16" checksum: 10/b6d79f59eb972615d1eedeeb7eaa444c3a56b29955b3762a46d8f099cd22457f6a6a33c1a3ab3bdcd7307cb5bac75ec3827f1c4ed7b432dc03c90fa18cc164e4 @@ -18693,8 +18693,8 @@ __metadata: "@grafana/prometheus": "workspace:*" "@grafana/runtime": "workspace:*" "@grafana/saga-icons": "workspace:*" - "@grafana/scenes": "npm:5.25.0" - "@grafana/scenes-react": "npm:5.25.0" + "@grafana/scenes": "npm:5.25.1" + "@grafana/scenes-react": "npm:5.25.1" "@grafana/schema": "workspace:*" "@grafana/sql": "workspace:*" "@grafana/tsconfig": "npm:^2.0.0" From e06ad2a6efb9113e360897857db2fb424c9903f1 Mon Sep 17 00:00:00 2001 From: Larissa Wandzura <126723338+lwandz13@users.noreply.github.com> Date: Wed, 20 Nov 2024 11:11:21 -0600 Subject: [PATCH 13/56] Docs: Added datasources codeowner (#96784) added lwandz13 as datasources codeowner --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index b7ffa6c4c83..b78c5fd9303 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -40,6 +40,7 @@ /docs/sources/alerting/ @brendamuir /docs/sources/dashboards/ @imatwawana +/docs/sources/datasources/ @lwandz13 /docs/sources/panels-visualizations/ @imatwawana /docs/sources/release-notes/ @irenerl24 @GrafanaWriter /docs/sources/upgrade-guide/ @imatwawana From a60953c8f970fc61ac3f4ad6e3e3b96c53ee68f2 Mon Sep 17 00:00:00 2001 From: Ieva Date: Wed, 20 Nov 2024 17:37:12 +0000 Subject: [PATCH 14/56] GAS: Show mapped roles in role picker (#96681) * add group mapping UID returned mapped roles * request mapped roles from the frontend, but don't attempt to update mapped roles * lock mapped roles and show a pop-up message about why a role is locked * update role selectors to not allow deselecting a mapped role * swagger gen * simplify and set mapped as bool instead of mapping UID array * swagger gen --- pkg/services/accesscontrol/models.go | 1 + public/api-enterprise-spec.json | 3 ++ public/api-merged.json | 3 ++ .../RolePicker/RoleMenuGroupsSection.tsx | 6 +++- .../components/RolePicker/RoleMenuOption.tsx | 16 ++++++++- .../components/RolePicker/RolePickerMenu.tsx | 36 ++++++++++++++----- .../RolePicker/RolePickerSubMenu.tsx | 1 + public/app/core/components/RolePicker/api.ts | 7 ++-- public/app/features/admin/api.ts | 5 ++- public/app/features/users/state/actions.ts | 5 ++- public/app/types/accessControl.ts | 1 + public/openapi3.json | 3 ++ 12 files changed, 72 insertions(+), 15 deletions(-) diff --git a/pkg/services/accesscontrol/models.go b/pkg/services/accesscontrol/models.go index 9971f674a95..dc12171eaa5 100644 --- a/pkg/services/accesscontrol/models.go +++ b/pkg/services/accesscontrol/models.go @@ -81,6 +81,7 @@ type RoleDTO struct { Group string `xorm:"group_name" json:"group"` Permissions []Permission `json:"permissions,omitempty"` Delegatable *bool `json:"delegatable,omitempty"` + Mapped bool `json:"mapped,omitempty"` Hidden bool `json:"hidden,omitempty"` ID int64 `json:"-" xorm:"pk autoincr 'id'"` diff --git a/public/api-enterprise-spec.json b/public/api-enterprise-spec.json index 957d01fcb14..a6da300456c 100644 --- a/public/api-enterprise-spec.json +++ b/public/api-enterprise-spec.json @@ -7123,6 +7123,9 @@ "hidden": { "type": "boolean" }, + "mapped": { + "type": "boolean" + }, "name": { "type": "string" }, diff --git a/public/api-merged.json b/public/api-merged.json index f54a90d84d6..8e1dde8fa74 100644 --- a/public/api-merged.json +++ b/public/api-merged.json @@ -19793,6 +19793,9 @@ "hidden": { "type": "boolean" }, + "mapped": { + "type": "boolean" + }, "name": { "type": "string" }, diff --git a/public/app/core/components/RolePicker/RoleMenuGroupsSection.tsx b/public/app/core/components/RolePicker/RoleMenuGroupsSection.tsx index 90695287595..bae0a0aeedf 100644 --- a/public/app/core/components/RolePicker/RoleMenuGroupsSection.tsx +++ b/public/app/core/components/RolePicker/RoleMenuGroupsSection.tsx @@ -78,7 +78,10 @@ export const RoleMenuGroupsSection = forwardRef + isNotDelegatable(option) || selectedOptions.find((opt) => opt.uid === option.uid && opt.mapped) + )} onChange={onGroupChange} onOpenSubMenu={onOpenSubMenu} onCloseSubMenu={onCloseSubMenu} @@ -102,6 +105,7 @@ export const RoleMenuGroupsSection = forwardRef opt.uid === option.uid))} disabled={isNotDelegatable(option)} + mapped={!!(option.uid && selectedOptions.find((opt) => opt.uid === option.uid && opt.mapped))} onChange={onRoleChange} hideDescription /> diff --git a/public/app/core/components/RolePicker/RoleMenuOption.tsx b/public/app/core/components/RolePicker/RoleMenuOption.tsx index 8fabb22eb8e..b5ef7b02358 100644 --- a/public/app/core/components/RolePicker/RoleMenuOption.tsx +++ b/public/app/core/components/RolePicker/RoleMenuOption.tsx @@ -13,14 +13,23 @@ interface RoleMenuOptionProps { isSelected?: boolean; isFocused?: boolean; disabled?: boolean; + mapped?: boolean; hideDescription?: boolean; } export const RoleMenuOption = forwardRef>( - ({ data, isFocused, isSelected, disabled, onChange, hideDescription }, ref) => { + ({ data, isFocused, isSelected, disabled, mapped, onChange, hideDescription }, ref) => { const theme = useTheme2(); const styles = getSelectStyles(theme); const customStyles = useStyles2(getStyles); + disabled = disabled || mapped; + let disabledMessage = ''; + if (disabled) { + disabledMessage = 'You do not have permissions to assign this role.'; + if (mapped) { + disabledMessage = 'Role assignment cannot be removed because the role is mapped through group sync.'; + } + } const wrapperClassName = cx( styles.option, @@ -51,6 +60,11 @@ export const RoleMenuOption = forwardRef{data.displayName || data.name} {!hideDescription && data.description &&
{data.description}
} + {disabledMessage && ( + + + + )} {data.description && ( diff --git a/public/app/core/components/RolePicker/RolePickerMenu.tsx b/public/app/core/components/RolePicker/RolePickerMenu.tsx index 9ee528c1e9b..4ac739941ea 100644 --- a/public/app/core/components/RolePicker/RolePickerMenu.tsx +++ b/public/app/core/components/RolePicker/RolePickerMenu.tsx @@ -157,8 +157,15 @@ export const RolePickerMenu = ({ return selectedGroupOptions.length > 0 && selectedGroupOptions.length < groupOptions!.options.length; }; + const changeableGroupRolesSelected = (groupType: GroupType, group: string) => { + const selectedGroupOptions = getSelectedGroupOptions(group); + const changeableGroupOptions = selectedGroupOptions.filter((role) => role.delegatable && !role.mapped); + const groupOptions = rolesCollection[groupType]?.optionGroup.find((g) => g.value === group); + return changeableGroupOptions.length > 0 && changeableGroupOptions.length < groupOptions!.options.length; + }; + const onChange = (option: Role) => { - if (selectedOptions.find((role) => role.uid === option.uid)) { + if (selectedOptions.find((role) => role.uid === option.uid && !role.mapped)) { setSelectedOptions(selectedOptions.filter((role) => role.uid !== option.uid)); } else { setSelectedOptions([...selectedOptions, option]); @@ -174,12 +181,21 @@ export const RolePickerMenu = ({ return; } - if (groupSelected(groupType, value) || groupPartiallySelected(groupType, value)) { - setSelectedOptions(selectedOptions.filter((role) => !group.options.find((option) => role.uid === option.uid))); - } else { - const groupOptions = group.options.filter((role) => role.delegatable); + if (groupSelected(groupType, value) || changeableGroupRolesSelected(groupType, value)) { + const mappedGroupOptions = selectedOptions.filter((option) => + group.options.find((role) => role.uid === option.uid && option.mapped) + ); const restOptions = selectedOptions.filter((role) => !group.options.find((option) => role.uid === option.uid)); - setSelectedOptions([...restOptions, ...groupOptions]); + setSelectedOptions([...restOptions, ...mappedGroupOptions]); + } else { + const mappedGroupOptions = selectedOptions.filter((option) => + group.options.find((role) => role.uid === option.uid && role.delegatable) + ); + const groupOptions = group.options.filter( + (role) => role.delegatable && !selectedOptions.find((option) => role.uid === option.uid && option.mapped) + ); + const restOptions = selectedOptions.filter((role) => !group.options.find((option) => role.uid === option.uid)); + setSelectedOptions([...restOptions, ...groupOptions, ...mappedGroupOptions]); } }; @@ -188,13 +204,17 @@ export const RolePickerMenu = ({ }; const onClearInternal = async () => { - setSelectedOptions([]); + const mappedRoles = selectedOptions.filter((role) => role.mapped); + const nonDelegatableRoles = options.filter((role) => + selectedOptions.find((option) => role.uid === option.uid && !role.delegatable) + ); + setSelectedOptions([...mappedRoles, ...nonDelegatableRoles]); }; const onClearSubMenu = (group: string) => { const options = selectedOptions.filter((role) => { const roleGroup = getRoleGroup(role); - return roleGroup !== group; + return roleGroup !== group || role.mapped; }); setSelectedOptions(options); }; diff --git a/public/app/core/components/RolePicker/RolePickerSubMenu.tsx b/public/app/core/components/RolePicker/RolePickerSubMenu.tsx index 647ba41b301..1197796442b 100644 --- a/public/app/core/components/RolePicker/RolePickerSubMenu.tsx +++ b/public/app/core/components/RolePicker/RolePickerSubMenu.tsx @@ -57,6 +57,7 @@ export const RolePickerSubMenu = ({ disabled={ !!(option.uid && disabledOptions?.find((opt) => opt.uid === option.uid)) || isNotDelegatable(option) } + mapped={!!(option.uid && selectedOptions.find((opt) => opt.uid === option.uid && opt.mapped))} onChange={onSelect} hideDescription /> diff --git a/public/app/core/components/RolePicker/api.ts b/public/app/core/components/RolePicker/api.ts index 978fe333c4d..cb282da079a 100644 --- a/public/app/core/components/RolePicker/api.ts +++ b/public/app/core/components/RolePicker/api.ts @@ -16,9 +16,9 @@ export const fetchRoleOptions = async (orgId?: number): Promise => { }; export const fetchUserRoles = async (userId: number, orgId?: number): Promise => { - let userRolesUrl = `/api/access-control/users/${userId}/roles`; + let userRolesUrl = `/api/access-control/users/${userId}/roles?includeMapped=true`; if (orgId) { - userRolesUrl += `?targetOrgId=${orgId}`; + userRolesUrl += `&targetOrgId=${orgId}`; } try { const roles = await getBackendSrv().get(userRolesUrl); @@ -39,7 +39,8 @@ export const updateUserRoles = (roles: Role[], userId: number, orgId?: number) = if (orgId) { userRolesUrl += `?targetOrgId=${orgId}`; } - const roleUids = roles.flatMap((x) => x.uid); + const filteredRoles = roles.filter((role) => !role.mapped); + const roleUids = filteredRoles.flatMap((x) => x.uid); return getBackendSrv().put(userRolesUrl, { orgId, roleUids, diff --git a/public/app/features/admin/api.ts b/public/app/features/admin/api.ts index 49542e53b36..0db8de7ed13 100644 --- a/public/app/features/admin/api.ts +++ b/public/app/features/admin/api.ts @@ -19,7 +19,10 @@ export const getOrgUsers = async (orgId: UrlQueryValue, page: number) => { export const getUsersRoles = async (orgId: number, users: OrgUser[]) => { const userIds = users.map((u) => u.userId); - const roles = await getBackendSrv().post(`/api/access-control/users/roles/search`, { userIds, orgId }); + const roles = await getBackendSrv().post(`/api/access-control/users/roles/search?includeMapped=true`, { + userIds, + orgId, + }); users.forEach((u) => { u.roles = roles ? roles[u.userId] || [] : []; }); diff --git a/public/app/features/users/state/actions.ts b/public/app/features/users/state/actions.ts index a0f52473e1b..9dbc7672f63 100644 --- a/public/app/features/users/state/actions.ts +++ b/public/app/features/users/state/actions.ts @@ -36,7 +36,10 @@ export function loadUsers(): ThunkResult { dispatch(rolesFetchBegin()); const orgId = contextSrv.user.orgId; const userIds = users?.orgUsers.map((u: OrgUser) => u.userId); - const roles = await getBackendSrv().post(`/api/access-control/users/roles/search`, { userIds, orgId }); + const roles = await getBackendSrv().post(`/api/access-control/users/roles/search?includeMapped=true`, { + userIds, + orgId, + }); users.orgUsers.forEach((u: OrgUser) => { u.roles = roles ? roles[u.userId] || [] : []; }); diff --git a/public/app/types/accessControl.ts b/public/app/types/accessControl.ts index 4ae6fcfda75..e5148bf8758 100644 --- a/public/app/types/accessControl.ts +++ b/public/app/types/accessControl.ts @@ -167,6 +167,7 @@ export interface Role { group: string; global: boolean; delegatable?: boolean; + mapped?: boolean; version: number; created: string; updated: string; diff --git a/public/openapi3.json b/public/openapi3.json index 67c19b89eae..3552f7d812a 100644 --- a/public/openapi3.json +++ b/public/openapi3.json @@ -9751,6 +9751,9 @@ "hidden": { "type": "boolean" }, + "mapped": { + "type": "boolean" + }, "name": { "type": "string" }, From a758c2dbb7e50b14a178ab210a26704af5a670b9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 17:38:21 +0000 Subject: [PATCH 15/56] Update dependency @grafana/faro-core to v1.12.2 (#96786) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index f89b5d7db42..2a55c7d6f02 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3658,12 +3658,12 @@ __metadata: linkType: hard "@grafana/faro-core@npm:^1.12.1, @grafana/faro-core@npm:^1.3.6": - version: 1.12.1 - resolution: "@grafana/faro-core@npm:1.12.1" + version: 1.12.2 + resolution: "@grafana/faro-core@npm:1.12.2" dependencies: "@opentelemetry/api": "npm:^1.9.0" "@opentelemetry/otlp-transformer": "npm:^0.53.0" - checksum: 10/02502bc34723377f06a24ed89e4589654dd5fbeab7e9c31a19291fa088a1237de081f99ba7c5a2032d77d12a686281d16af55064cbf69fad9e52cf8a29d7c000 + checksum: 10/98b6d4dc5977fde257ee5968b4193ee9e683df67665f04e41053903796c250ca2d39bccefd61501908bfe500454faf452924714a613a7c84885e519cd5b598ce languageName: node linkType: hard From 5b386472d20ed98179b8006947f2ddf5cdc3a7e2 Mon Sep 17 00:00:00 2001 From: Ezequiel Victorero Date: Wed, 20 Nov 2024 14:43:53 -0300 Subject: [PATCH 16/56] Docs: Add domain allow list report docs (#96778) * Docs: Add domain allow list report docs * Update docs/sources/setup-grafana/configure-grafana/enterprise-configuration/index.md Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com> --------- Co-authored-by: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com> --- .../configure-grafana/enterprise-configuration/index.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/sources/setup-grafana/configure-grafana/enterprise-configuration/index.md b/docs/sources/setup-grafana/configure-grafana/enterprise-configuration/index.md index e025c241b48..5aaaa2253a6 100644 --- a/docs/sources/setup-grafana/configure-grafana/enterprise-configuration/index.md +++ b/docs/sources/setup-grafana/configure-grafana/enterprise-configuration/index.md @@ -174,6 +174,10 @@ Name of the TrueType font file with italic style. Maximum number of panel rendering request retries before returning an error. To disable the retry feature, enter `0`. This is available in public preview and requires the `reportingRetries` feature toggle. +### allowed_domains + +Allowed domains to receive reports. Use an asterisk (`*`) to allow all domains. Use a comma-separated list to allow multiple domains. Example: allowed_domains = grafana.com, example.org + ## [auditing] [Auditing]({{< relref "../../configure-security/audit-grafana" >}}) allows you to track important changes to your Grafana instance. By default, audit logs are logged to file but the auditing feature also supports sending logs directly to Loki. From fcae9c26b89abecf0b1ed63cae96be9dae014624 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 18:21:05 +0000 Subject: [PATCH 17/56] Update dependency @grafana/faro-web-sdk to v1.12.2 (#96788) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2a55c7d6f02..4ca2e043ebf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3657,7 +3657,7 @@ __metadata: languageName: node linkType: hard -"@grafana/faro-core@npm:^1.12.1, @grafana/faro-core@npm:^1.3.6": +"@grafana/faro-core@npm:^1.12.1, @grafana/faro-core@npm:^1.12.2, @grafana/faro-core@npm:^1.3.6": version: 1.12.2 resolution: "@grafana/faro-core@npm:1.12.2" dependencies: @@ -3667,7 +3667,7 @@ __metadata: languageName: node linkType: hard -"@grafana/faro-web-sdk@npm:1.12.1, @grafana/faro-web-sdk@npm:^1.12.1, @grafana/faro-web-sdk@npm:^1.3.6": +"@grafana/faro-web-sdk@npm:1.12.1": version: 1.12.1 resolution: "@grafana/faro-web-sdk@npm:1.12.1" dependencies: @@ -3678,6 +3678,17 @@ __metadata: languageName: node linkType: hard +"@grafana/faro-web-sdk@npm:^1.12.1, @grafana/faro-web-sdk@npm:^1.3.6": + version: 1.12.2 + resolution: "@grafana/faro-web-sdk@npm:1.12.2" + dependencies: + "@grafana/faro-core": "npm:^1.12.2" + ua-parser-js: "npm:^1.0.32" + web-vitals: "npm:^4.0.1" + checksum: 10/d8dde29c8c940f4850c0661190880837625977a2e6a500efcbe2ba299ee14c2a3189fc893ec1a0c6b6fcaa4057cf7f104b815000f0dbd181c68ec19e20789ba5 + languageName: node + linkType: hard + "@grafana/faro-web-tracing@npm:^1.8.2": version: 1.12.1 resolution: "@grafana/faro-web-tracing@npm:1.12.1" From bd07c6cf35254dbf7fdfeaed3906af6a11d1988a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 20 Nov 2024 19:37:51 +0100 Subject: [PATCH 18/56] PanelEditor: Tweak category design (#96760) * PanelEditor: Tweak category design * Update * remove unused import * Switch angle dirctions * Fix test --- .../grafana-ui/src/options/builder/axis.tsx | 32 +++++++++---------- .../panel-edit/PanelOptions.test.tsx | 2 +- .../PanelEditor/DynamicConfigValueEditor.tsx | 2 +- .../PanelEditor/OptionsPaneCategory.tsx | 17 +++++----- .../PanelEditor/OverrideCategoryTitle.tsx | 11 +++++-- 5 files changed, 35 insertions(+), 29 deletions(-) diff --git a/packages/grafana-ui/src/options/builder/axis.tsx b/packages/grafana-ui/src/options/builder/axis.tsx index 7e7730bfcb3..2e08654298c 100644 --- a/packages/grafana-ui/src/options/builder/axis.tsx +++ b/packages/grafana-ui/src/options/builder/axis.tsx @@ -10,6 +10,7 @@ import { AxisColorMode, AxisConfig, AxisPlacement, ScaleDistribution, ScaleDistr import { Field } from '../../components/Forms/Field'; import { RadioButtonGroup } from '../../components/Forms/RadioButtonGroup/RadioButtonGroup'; import { Input } from '../../components/Input/Input'; +import { Stack } from '../../components/Layout/Stack/Stack'; import { Select } from '../../components/Select/Select'; import { graphFieldOptions } from '../../components/uPlot/config'; @@ -163,21 +164,20 @@ const LOG_DISTRIBUTION_OPTIONS: Array> = [ export const ScaleDistributionEditor = ({ value, onChange }: StandardEditorProps) => { const type = value?.type ?? ScaleDistribution.Linear; const log = value?.log ?? 2; + return ( - <> -
- { - onChange({ - ...value, - type: v!, - log: v === ScaleDistribution.Linear ? undefined : log, - }); - }} - /> -
+ + { + onChange({ + ...value, + type: v!, + log: v === ScaleDistribution.Linear ? undefined : log, + }); + }} + /> {(type === ScaleDistribution.Log || type === ScaleDistribution.Symlog) && ( )} - + ); }; diff --git a/public/app/features/dashboard-scene/panel-edit/PanelOptions.test.tsx b/public/app/features/dashboard-scene/panel-edit/PanelOptions.test.tsx index cedf9e50a13..264c053de17 100644 --- a/public/app/features/dashboard-scene/panel-edit/PanelOptions.test.tsx +++ b/public/app/features/dashboard-scene/panel-edit/PanelOptions.test.tsx @@ -146,7 +146,7 @@ describe('PanelOptions', () => { it('Can update', async () => { const {} = setup(); - await userEvent.click(screen.getByLabelText('Remove label')); + await userEvent.click(screen.getByLabelText('Remove property')); expect(screen.queryByLabelText(overrideRuleTooltipDescription)).not.toBeInTheDocument(); }); diff --git a/public/app/features/dashboard/components/PanelEditor/DynamicConfigValueEditor.tsx b/public/app/features/dashboard/components/PanelEditor/DynamicConfigValueEditor.tsx index d062cfeb732..b30dcf490f0 100644 --- a/public/app/features/dashboard/components/PanelEditor/DynamicConfigValueEditor.tsx +++ b/public/app/features/dashboard/components/PanelEditor/DynamicConfigValueEditor.tsx @@ -71,7 +71,7 @@ export const DynamicConfigValueEditor = ({ {!isSystemOverride && (
- +
)} diff --git a/public/app/features/dashboard/components/PanelEditor/OptionsPaneCategory.tsx b/public/app/features/dashboard/components/PanelEditor/OptionsPaneCategory.tsx index a849f83f076..2540fe59a60 100644 --- a/public/app/features/dashboard/components/PanelEditor/OptionsPaneCategory.tsx +++ b/public/app/features/dashboard/components/PanelEditor/OptionsPaneCategory.tsx @@ -120,20 +120,20 @@ export const OptionsPaneCategory = React.memo( {/* this just provides a better experience for mouse users */} {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */}
+
+ {renderTitle(isExpanded)} +
{isExpanded && (
@@ -159,7 +159,6 @@ const getStyles = (theme: GrafanaTheme2) => ({ overflow: 'hidden', lineHeight: 1.5, fontSize: '1rem', - paddingLeft: '6px', fontWeight: theme.typography.fontWeightMedium, margin: 0, }), @@ -167,7 +166,7 @@ const getStyles = (theme: GrafanaTheme2) => ({ display: 'flex', cursor: 'pointer', alignItems: 'center', - padding: theme.spacing(0.5), + padding: theme.spacing(0.5, 1.5), color: theme.colors.text.primary, fontWeight: theme.typography.fontWeightMedium, @@ -185,7 +184,7 @@ const getStyles = (theme: GrafanaTheme2) => ({ padding: theme.spacing(0.5, 0, 0.5, 0), }), body: css({ - padding: theme.spacing(1, 2, 1, 4), + padding: theme.spacing(1, 2, 1, 2), }), bodyNested: css({ position: 'relative', @@ -195,7 +194,7 @@ const getStyles = (theme: GrafanaTheme2) => ({ content: "''", position: 'absolute', top: 0, - left: '8px', + left: '1px', width: '1px', height: '100%', background: theme.colors.border.weak, diff --git a/public/app/features/dashboard/components/PanelEditor/OverrideCategoryTitle.tsx b/public/app/features/dashboard/components/PanelEditor/OverrideCategoryTitle.tsx index ca12ab018fc..eee7fbf8a9d 100644 --- a/public/app/features/dashboard/components/PanelEditor/OverrideCategoryTitle.tsx +++ b/public/app/features/dashboard/components/PanelEditor/OverrideCategoryTitle.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/css'; import { FieldConfigOptionsRegistry, GrafanaTheme2, ConfigOverrideRule } from '@grafana/data'; -import { HorizontalGroup, Icon, IconButton, useStyles2 } from '@grafana/ui'; +import { Button, HorizontalGroup, Icon, useStyles2 } from '@grafana/ui'; import { FieldMatcherUIRegistryItem } from '@grafana/ui/src/components/MatchersUI/types'; interface Props { @@ -29,7 +29,14 @@ export const OverrideCategoryTitle = ({
{overrideName}
- + -
- - -

Organization Users

- - - - - - - - - - - - - - -
UsernameEmailRole
{{orgUser.login}}{{orgUser.email}} -
- - - -
-
- - - -
-
- -