From 874e98a48842f0907964c5e4f95277bde6d048d2 Mon Sep 17 00:00:00 2001 From: linoman <2051016+linoman@users.noreply.github.com> Date: Tue, 25 Mar 2025 10:06:45 +0100 Subject: [PATCH 001/100] SCIM: Add a distinctive label for externally provisioned users (#102701) * Add json mapping for user.isProvisioned * Retrieve the isProvisioned value from database * Add a Provisioned label to pages that list users * Update swagger definitions * Add changes to User Admin pages --- pkg/services/org/model.go | 1 + pkg/services/org/orgimpl/store.go | 1 + pkg/services/user/model.go | 4 ++-- pkg/services/user/userimpl/store.go | 3 ++- public/api-enterprise-spec.json | 9 +++++++++ public/api-merged.json | 9 +++++++++ public/app/features/admin/UserAdminPage.tsx | 5 ++++- public/app/features/admin/UserProfile.tsx | 12 +++++++++--- public/app/features/admin/Users/OrgUsersTable.tsx | 7 +++++++ public/app/features/admin/Users/UsersTable.tsx | 7 +++++++ public/app/features/profile/UserProfileEditForm.tsx | 5 ++++- public/app/types/user.ts | 3 +++ public/openapi3.json | 9 +++++++++ 13 files changed, 67 insertions(+), 8 deletions(-) diff --git a/pkg/services/org/model.go b/pkg/services/org/model.go index 9e2691f0340..7873e899eb3 100644 --- a/pkg/services/org/model.go +++ b/pkg/services/org/model.go @@ -157,6 +157,7 @@ type OrgUserDTO struct { IsDisabled bool `json:"isDisabled"` AuthLabels []string `json:"authLabels" xorm:"-"` IsExternallySynced bool `json:"isExternallySynced"` + IsProvisioned bool `json:"isProvisioned"` } type RemoveOrgUserCommand struct { diff --git a/pkg/services/org/orgimpl/store.go b/pkg/services/org/orgimpl/store.go index 04edfb1e8f0..be838861c6a 100644 --- a/pkg/services/org/orgimpl/store.go +++ b/pkg/services/org/orgimpl/store.go @@ -611,6 +611,7 @@ func (ss *sqlStore) SearchOrgUsers(ctx context.Context, query *org.SearchOrgUser "u.created", "u.updated", "u.is_disabled", + "u.is_provisioned", ) if len(query.SortOpts) > 0 { diff --git a/pkg/services/user/model.go b/pkg/services/user/model.go index 78d9f492e36..6e2377052a9 100644 --- a/pkg/services/user/model.go +++ b/pkg/services/user/model.go @@ -137,11 +137,11 @@ type UserSearchHitDTO struct { AvatarURL string `json:"avatarUrl" xorm:"avatar_url"` IsAdmin bool `json:"isAdmin"` IsDisabled bool `json:"isDisabled"` + IsProvisioned bool `json:"isProvisioned"` LastSeenAt time.Time `json:"lastSeenAt"` LastSeenAtAge string `json:"lastSeenAtAge"` AuthLabels []string `json:"authLabels"` AuthModule AuthModuleConversion `json:"-"` - IsProvisioned bool `json:"-" xorm:"is_provisioned"` } type GetUserProfileQuery struct { @@ -166,7 +166,7 @@ type UserProfileDTO struct { CreatedAt time.Time `json:"createdAt"` AvatarURL string `json:"avatarUrl"` AccessControl map[string]bool `json:"accessControl,omitempty"` - IsProvisioned bool `json:"-"` + IsProvisioned bool `json:"isProvisioned"` } // implement Conversion interface to define custom field mapping (xorm feature) diff --git a/pkg/services/user/userimpl/store.go b/pkg/services/user/userimpl/store.go index f740949942e..eb6b5a68227 100644 --- a/pkg/services/user/userimpl/store.go +++ b/pkg/services/user/userimpl/store.go @@ -374,6 +374,7 @@ func (ss *sqlStore) GetProfile(ctx context.Context, query *user.GetUserProfileQu Theme: usr.Theme, IsGrafanaAdmin: usr.IsAdmin, IsDisabled: usr.IsDisabled, + IsProvisioned: usr.IsProvisioned, OrgID: usr.OrgID, UpdatedAt: usr.Updated, CreatedAt: usr.Created, @@ -526,7 +527,7 @@ func (ss *sqlStore) Search(ctx context.Context, query *user.SearchUsersQuery) (* sess.Limit(query.Limit, offset) } - sess.Cols("u.id", "u.uid", "u.email", "u.name", "u.login", "u.is_admin", "u.is_disabled", "u.last_seen_at", "user_auth.auth_module") + sess.Cols("u.id", "u.uid", "u.email", "u.name", "u.login", "u.is_admin", "u.is_disabled", "u.last_seen_at", "user_auth.auth_module", "u.is_provisioned") if len(query.SortOpts) > 0 { for i := range query.SortOpts { diff --git a/public/api-enterprise-spec.json b/public/api-enterprise-spec.json index a036e242e30..cc8046467ec 100644 --- a/public/api-enterprise-spec.json +++ b/public/api-enterprise-spec.json @@ -5913,6 +5913,9 @@ "isExternallySynced": { "type": "boolean" }, + "isProvisioned": { + "type": "boolean" + }, "lastSeenAt": { "type": "string", "format": "date-time" @@ -8605,6 +8608,9 @@ "isGrafanaAdminExternallySynced": { "type": "boolean" }, + "isProvisioned": { + "type": "boolean" + }, "login": { "type": "string" }, @@ -8652,6 +8658,9 @@ "isDisabled": { "type": "boolean" }, + "isProvisioned": { + "type": "boolean" + }, "lastSeenAt": { "type": "string", "format": "date-time" diff --git a/public/api-merged.json b/public/api-merged.json index 3ca4e15b213..cba17c0c8ac 100644 --- a/public/api-merged.json +++ b/public/api-merged.json @@ -17760,6 +17760,9 @@ "isExternallySynced": { "type": "boolean" }, + "isProvisioned": { + "type": "boolean" + }, "lastSeenAt": { "type": "string", "format": "date-time" @@ -22367,6 +22370,9 @@ "isGrafanaAdminExternallySynced": { "type": "boolean" }, + "isProvisioned": { + "type": "boolean" + }, "login": { "type": "string" }, @@ -22414,6 +22420,9 @@ "isDisabled": { "type": "boolean" }, + "isProvisioned": { + "type": "boolean" + }, "lastSeenAt": { "type": "string", "format": "date-time" diff --git a/public/app/features/admin/UserAdminPage.tsx b/public/app/features/admin/UserAdminPage.tsx index 46d6fa41f03..9af0af250b3 100644 --- a/public/app/features/admin/UserAdminPage.tsx +++ b/public/app/features/admin/UserAdminPage.tsx @@ -115,7 +115,10 @@ export const UserAdminPage = ({ const isLDAPUser = user?.isExternal && user?.authLabels?.includes('LDAP'); const canReadSessions = contextSrv.hasPermission(AccessControlAction.UsersAuthTokenList); const canReadLDAPStatus = contextSrv.hasPermission(AccessControlAction.LDAPStatusRead); - const authSource = user?.authLabels?.[0]; + let authSource = user?.authLabels?.[0]; + if (user?.isProvisioned) { + authSource = 'SCIM'; + } const lockMessage = authSource ? `Synced via ${authSource}` : ''; const pageNav: NavModelItem = { text: user?.login ?? '', diff --git a/public/app/features/admin/UserProfile.tsx b/public/app/features/admin/UserProfile.tsx index 01f4256d523..8fa8e1f0bc4 100644 --- a/public/app/features/admin/UserProfile.tsx +++ b/public/app/features/admin/UserProfile.tsx @@ -71,12 +71,18 @@ export function UserProfile({ }); }; - const authSource = user.authLabels?.length && user.authLabels[0]; + let authSource = user.authLabels?.length && user.authLabels[0]; + if (user.isProvisioned) { + authSource = 'SCIM'; + } const lockMessage = authSource ? `Synced via ${authSource}` : ''; - const editLocked = user.isExternal || !contextSrv.hasPermissionInMetadata(AccessControlAction.UsersWrite, user); + const editLocked = + user.isExternal || user.isProvisioned || !contextSrv.hasPermissionInMetadata(AccessControlAction.UsersWrite, user); const passwordChangeLocked = - user.isExternal || !contextSrv.hasPermissionInMetadata(AccessControlAction.UsersPasswordUpdate, user); + user.isExternal || + user.isProvisioned || + !contextSrv.hasPermissionInMetadata(AccessControlAction.UsersPasswordUpdate, user); const canDelete = contextSrv.hasPermissionInMetadata(AccessControlAction.UsersDelete, user); const canDisable = contextSrv.hasPermissionInMetadata(AccessControlAction.UsersDisable, user); const canEnable = contextSrv.hasPermissionInMetadata(AccessControlAction.UsersEnable, user); diff --git a/public/app/features/admin/Users/OrgUsersTable.tsx b/public/app/features/admin/Users/OrgUsersTable.tsx index 861181db16c..9e27806a05c 100644 --- a/public/app/features/admin/Users/OrgUsersTable.tsx +++ b/public/app/features/admin/Users/OrgUsersTable.tsx @@ -216,6 +216,13 @@ export const OrgUsersTable = ({ <>{Array.isArray(value) && value.length > 0 && } ), }, + { + id: 'isProvisioned', + header: 'Provisioned', + cell: ({ cell: { value } }: Cell<'isProvisioned'>) => ( + <>{value && } + ), + }, { id: 'isDisabled', header: '', diff --git a/public/app/features/admin/Users/UsersTable.tsx b/public/app/features/admin/Users/UsersTable.tsx index 23fbf4b763f..405186e229b 100644 --- a/public/app/features/admin/Users/UsersTable.tsx +++ b/public/app/features/admin/Users/UsersTable.tsx @@ -152,6 +152,13 @@ export const UsersTable = ({ <>{Array.isArray(value) && value.length > 0 && } ), }, + { + id: 'isProvisioned', + header: 'Provisioned', + cell: ({ cell: { value } }: Cell<'isProvisioned'>) => ( + <>{value && } + ), + }, { id: 'isDisabled', header: '', diff --git a/public/app/features/profile/UserProfileEditForm.tsx b/public/app/features/profile/UserProfileEditForm.tsx index f942b6876fc..0c788577731 100644 --- a/public/app/features/profile/UserProfileEditForm.tsx +++ b/public/app/features/profile/UserProfileEditForm.tsx @@ -22,7 +22,10 @@ export const UserProfileEditForm = ({ user, isSavingUser, updateProfile }: Props // check if authLabels is longer than 0 otherwise false const isExternalUser: boolean = (user && user.isExternal) ?? false; - const authSource = isExternalUser && user && user.authLabels ? user.authLabels[0] : ''; + let authSource = isExternalUser && user && user.authLabels ? user.authLabels[0] : ''; + if (user?.isProvisioned) { + authSource = 'SCIM'; + } const lockMessage = authSource ? ` (Synced via ${authSource})` : ''; const disabledEdit = disableLoginForm || isExternalUser; diff --git a/public/app/types/user.ts b/public/app/types/user.ts index 0d6a231692c..67264b0f298 100644 --- a/public/app/types/user.ts +++ b/public/app/types/user.ts @@ -19,6 +19,8 @@ export interface OrgUser extends WithAccessControlMetadata { isDisabled: boolean; authLabels?: string[]; isExternallySynced?: boolean; + // Externally provisioned + isProvisioned?: boolean; } export interface User { @@ -56,6 +58,7 @@ export interface UserDTO extends WithAccessControlMetadata { orgs?: Unit[]; isExternallySynced?: boolean; isGrafanaAdminExternallySynced?: boolean; + isProvisioned?: boolean; } export interface Invitee { diff --git a/public/openapi3.json b/public/openapi3.json index d89f792df71..78d904c2847 100644 --- a/public/openapi3.json +++ b/public/openapi3.json @@ -7822,6 +7822,9 @@ "isExternallySynced": { "type": "boolean" }, + "isProvisioned": { + "type": "boolean" + }, "lastSeenAt": { "format": "date-time", "type": "string" @@ -12428,6 +12431,9 @@ "isGrafanaAdminExternallySynced": { "type": "boolean" }, + "isProvisioned": { + "type": "boolean" + }, "login": { "type": "string" }, @@ -12475,6 +12481,9 @@ "isDisabled": { "type": "boolean" }, + "isProvisioned": { + "type": "boolean" + }, "lastSeenAt": { "format": "date-time", "type": "string" From 9dbcb3a0666be9135848a530991786f8c4510d0b Mon Sep 17 00:00:00 2001 From: Mihai Doarna Date: Tue, 25 Mar 2025 11:18:40 +0200 Subject: [PATCH 002/100] Team: Add user_uid in TeamMemberDTO (#102524) * add user_uid in TeamMemberDTO * rewrite sql select string with Sprintf() --- pkg/services/team/model.go | 1 + pkg/services/team/teamimpl/store.go | 23 +++++++++++------------ pkg/services/team/teamimpl/store_test.go | 6 ++++++ public/api-merged.json | 3 +++ public/openapi3.json | 3 +++ 5 files changed, 24 insertions(+), 12 deletions(-) diff --git a/pkg/services/team/model.go b/pkg/services/team/model.go index 1fcc79f941f..15c362eb272 100644 --- a/pkg/services/team/model.go +++ b/pkg/services/team/model.go @@ -177,6 +177,7 @@ type TeamMemberDTO struct { TeamID int64 `json:"teamId" xorm:"team_id"` TeamUID string `json:"teamUID" xorm:"uid"` UserID int64 `json:"userId" xorm:"user_id"` + UserUID string `json:"userUID" xorm:"user_uid"` External bool `json:"-"` AuthModule string `json:"auth_module"` Email string `json:"email"` diff --git a/pkg/services/team/teamimpl/store.go b/pkg/services/team/teamimpl/store.go index 557d6513fa4..34260ae10d0 100644 --- a/pkg/services/team/teamimpl/store.go +++ b/pkg/services/team/teamimpl/store.go @@ -551,18 +551,17 @@ func (ss *xormStore) getTeamMembers(ctx context.Context, query *team.GetTeamMemb if query.External { sess.Where("team_member.external=?", ss.db.GetDialect().BooleanValue(true)) } - sess.Cols( - "team_member.org_id", - "team_member.team_id", - "team_member.user_id", - "user.email", - "user.name", - "user.login", - "team_member.external", - "team_member.permission", - "user_auth.auth_module", - "team.uid", - ) + sess.Select(fmt.Sprintf(`team_member.org_id, + team_member.team_id, + team_member.user_id, + %[1]s.email, + %[1]s.name, + %[1]s.login, + %[1]s.uid as user_uid, + team_member.external, + team_member.permission, + user_auth.auth_module, + team.uid`, ss.db.GetDialect().Quote("user"))) sess.Asc("user.login", "user.email") err := sess.Find(&queryResult) diff --git a/pkg/services/team/teamimpl/store_test.go b/pkg/services/team/teamimpl/store_test.go index 066cc02b13e..ae082b4907d 100644 --- a/pkg/services/team/teamimpl/store_test.go +++ b/pkg/services/team/teamimpl/store_test.go @@ -58,6 +58,7 @@ func TestIntegrationTeamCommandsAndQueries(t *testing.T) { t.Run("Given saved users and two teams", func(t *testing.T) { var userIds []int64 + var userUIDs []string const testOrgID int64 = 1 var team1, team2 team.Team var usr *user.User @@ -74,6 +75,7 @@ func TestIntegrationTeamCommandsAndQueries(t *testing.T) { usr, err = userSvc.Create(context.Background(), &userCmd) require.NoError(t, err) userIds = append(userIds, usr.ID) + userUIDs = append(userUIDs, usr.UID) } team1, err = teamSvc.CreateTeam(context.Background(), "group1 name", "test1@test.com", testOrgID) require.NoError(t, err) @@ -108,9 +110,13 @@ func TestIntegrationTeamCommandsAndQueries(t *testing.T) { require.NoError(t, err) require.Equal(t, 2, len(q1Result)) require.Equal(t, q1Result[0].TeamID, team1.ID) + require.Contains(t, userIds[:2], q1Result[0].UserID) + require.Contains(t, userUIDs[:2], q1Result[0].UserUID) require.Equal(t, q1Result[0].Login, "loginuser0") require.Equal(t, q1Result[0].OrgID, testOrgID) require.Equal(t, q1Result[1].TeamID, team1.ID) + require.Contains(t, userIds[:2], q1Result[1].UserID) + require.Contains(t, userUIDs[:2], q1Result[1].UserUID) require.Equal(t, q1Result[1].Login, "loginuser1") require.Equal(t, q1Result[1].OrgID, testOrgID) require.Equal(t, q1Result[1].External, true) diff --git a/public/api-merged.json b/public/api-merged.json index cba17c0c8ac..69c75802fa7 100644 --- a/public/api-merged.json +++ b/public/api-merged.json @@ -21247,6 +21247,9 @@ "userId": { "type": "integer", "format": "int64" + }, + "userUID": { + "type": "string" } } }, diff --git a/public/openapi3.json b/public/openapi3.json index 78d904c2847..49aa64f9c5e 100644 --- a/public/openapi3.json +++ b/public/openapi3.json @@ -11308,6 +11308,9 @@ "userId": { "format": "int64", "type": "integer" + }, + "userUID": { + "type": "string" } }, "type": "object" From 3aa3371f589293139e00855467879e360367fe2a Mon Sep 17 00:00:00 2001 From: Mariell Hoversholm Date: Tue, 25 Mar 2025 10:20:23 +0100 Subject: [PATCH 003/100] Chore: update workspace (#102759) * Chore: update workspace * fix: ignore deprecation warnings --- apps/alerting/notifications/go.mod | 2 +- go.mod | 4 ++-- go.sum | 4 ++-- pkg/services/encryption/provider/cipher_aescfb.go | 1 + pkg/services/encryption/provider/decipher_aes.go | 1 + pkg/storage/unified/apistore/go.mod | 2 +- pkg/storage/unified/resource/go.mod | 2 +- pkg/util/encryption.go | 2 ++ 8 files changed, 11 insertions(+), 7 deletions(-) diff --git a/apps/alerting/notifications/go.mod b/apps/alerting/notifications/go.mod index fec89a07666..1f6db443174 100644 --- a/apps/alerting/notifications/go.mod +++ b/apps/alerting/notifications/go.mod @@ -1,6 +1,6 @@ module github.com/grafana/grafana/apps/alerting/notifications -go 1.23.7 +go 1.24.1 replace github.com/grafana/grafana => ../../.. diff --git a/go.mod b/go.mod index 0a347474767..0f06dddb0ac 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/grafana/grafana -go 1.23.7 +go 1.24.1 require ( buf.build/gen/go/parca-dev/parca/connectrpc/go v1.17.0-20240902100956-02fd72488966.1 // @grafana/observability-traces-and-profiling @@ -216,7 +216,7 @@ require ( github.com/grafana/grafana/pkg/aggregator v0.0.0-20250220163425-b4c4b9abbdc8 // @grafana/grafana-app-platform-squad github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250314071911-14e2784e6979 // @grafana/grafana-app-platform-squad github.com/grafana/grafana/pkg/apis/secret v0.0.0-20250319110241-5a004939da2a // @grafana/grafana-operator-experience-squad - github.com/grafana/grafana/pkg/apiserver v0.0.0-20250220154326-6e5de80ef295 // @grafana/grafana-app-platform-squad + github.com/grafana/grafana/pkg/apiserver v0.0.0-20250325075903-77fa2271be7a // @grafana/grafana-app-platform-squad // This needs to be here for other projects that import grafana/grafana // For local development grafana/grafana will always use the local files diff --git a/go.sum b/go.sum index 38ff7f37cb8..6146a2fe000 100644 --- a/go.sum +++ b/go.sum @@ -1615,8 +1615,8 @@ github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250314071911-14e2784e6979 h github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250314071911-14e2784e6979/go.mod h1:A/SJ9CiAWNOdeD/IezNwRaDZusLKq0z6dTfhKDgZw5Y= github.com/grafana/grafana/pkg/apis/secret v0.0.0-20250319110241-5a004939da2a h1:dMllTcE0R1qvV4rWDehQzxNiHaale1yCzXsVkub07D0= github.com/grafana/grafana/pkg/apis/secret v0.0.0-20250319110241-5a004939da2a/go.mod h1:K/fP4kODJmABug5b90PhACUZD6Xh/veEz2b1VRKNyuA= -github.com/grafana/grafana/pkg/apiserver v0.0.0-20250220154326-6e5de80ef295 h1:ivbywO8ZnmzDDkn169qUb9REsCGYAA7H8W6VfqSmCEw= -github.com/grafana/grafana/pkg/apiserver v0.0.0-20250220154326-6e5de80ef295/go.mod h1:OugmKouuvgWeOI8Kghram2Pv8b/1SuXRR8/iW068uLk= +github.com/grafana/grafana/pkg/apiserver v0.0.0-20250325075903-77fa2271be7a h1:NN0j9zdqYpfliR0P+au/PAJ5lqP7IZPNe8tAX5eaQNE= +github.com/grafana/grafana/pkg/apiserver v0.0.0-20250325075903-77fa2271be7a/go.mod h1:3Z958XEs20R6Wf5y4TFD07PGuGld6grB+wZ1qP/iyqg= github.com/grafana/grafana/pkg/promlib v0.0.8 h1:VUWsqttdf0wMI4j9OX9oNrykguQpZcruudDAFpJJVw0= github.com/grafana/grafana/pkg/promlib v0.0.8/go.mod h1:U1ezG/MGaEPoThqsr3lymMPN5yIPdVTJnDZ+wcXT+ao= github.com/grafana/grafana/pkg/semconv v0.0.0-20250220164708-c8d4ff28a450 h1:wSqgLKFwI7fyeqf3djRXGClBLb/UPjZ4XPm/UsKFDB0= diff --git a/pkg/services/encryption/provider/cipher_aescfb.go b/pkg/services/encryption/provider/cipher_aescfb.go index 1712fc66dde..272944074a5 100644 --- a/pkg/services/encryption/provider/cipher_aescfb.go +++ b/pkg/services/encryption/provider/cipher_aescfb.go @@ -38,6 +38,7 @@ func (c aesCfbCipher) Encrypt(_ context.Context, payload []byte, secret string) return nil, err } + //nolint:staticcheck stream := cipher.NewCFBEncrypter(block, iv) stream.XORKeyStream(ciphertext[encryption.SaltLength+aes.BlockSize:], payload) diff --git a/pkg/services/encryption/provider/decipher_aes.go b/pkg/services/encryption/provider/decipher_aes.go index 33cebbfe975..bfbf1911702 100644 --- a/pkg/services/encryption/provider/decipher_aes.go +++ b/pkg/services/encryption/provider/decipher_aes.go @@ -59,6 +59,7 @@ func decryptCFB(block cipher.Block, payload []byte) ([]byte, error) { payload = payload[encryption.SaltLength+aes.BlockSize:] payloadDst := make([]byte, len(payload)) + //nolint:staticcheck stream := cipher.NewCFBDecrypter(block, iv) // XORKeyStream can work in-place if the two arguments are the same. diff --git a/pkg/storage/unified/apistore/go.mod b/pkg/storage/unified/apistore/go.mod index f0b502e45eb..65b2956bf2b 100644 --- a/pkg/storage/unified/apistore/go.mod +++ b/pkg/storage/unified/apistore/go.mod @@ -18,7 +18,7 @@ require ( github.com/grafana/grafana v11.4.0-00010101000000-000000000000+incompatible github.com/grafana/grafana/apps/dashboard v0.0.0-20250317130411-3f270d1de043 github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250314071911-14e2784e6979 - github.com/grafana/grafana/pkg/apiserver v0.0.0-20250220154326-6e5de80ef295 + github.com/grafana/grafana/pkg/apiserver v0.0.0-20250325075903-77fa2271be7a github.com/grafana/grafana/pkg/storage/unified/resource v0.0.0-20250317130411-3f270d1de043 github.com/stretchr/testify v1.10.0 gocloud.dev v0.40.0 diff --git a/pkg/storage/unified/resource/go.mod b/pkg/storage/unified/resource/go.mod index 68ff0c85fd1..67acc7c1389 100644 --- a/pkg/storage/unified/resource/go.mod +++ b/pkg/storage/unified/resource/go.mod @@ -18,7 +18,7 @@ require ( github.com/grafana/grafana-plugin-sdk-go v0.274.1-0.20250318081012-21a7f15619b0 github.com/grafana/grafana/apps/dashboard v0.0.0-20250317130411-3f270d1de043 github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250314071911-14e2784e6979 - github.com/grafana/grafana/pkg/apiserver v0.0.0-20250220154326-6e5de80ef295 // indirect + github.com/grafana/grafana/pkg/apiserver v0.0.0-20250325075903-77fa2271be7a // indirect github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.1 github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.1 github.com/hashicorp/golang-lru/v2 v2.0.7 diff --git a/pkg/util/encryption.go b/pkg/util/encryption.go index 9c8c3a4c440..79f4012a1a8 100644 --- a/pkg/util/encryption.go +++ b/pkg/util/encryption.go @@ -102,6 +102,7 @@ func decryptCFB(block cipher.Block, payload []byte) ([]byte, error) { payload = payload[saltLength+aes.BlockSize:] payloadDst := make([]byte, len(payload)) + //nolint:staticcheck stream := cipher.NewCFBDecrypter(block, iv) // XORKeyStream can work in-place if the two arguments are the same. @@ -136,6 +137,7 @@ func Encrypt(payload []byte, secret string) ([]byte, error) { return nil, err } + //nolint:staticcheck stream := cipher.NewCFBEncrypter(block, iv) stream.XORKeyStream(ciphertext[saltLength+aes.BlockSize:], payload) From 0536aa2d529d7e54050ac40ab23c29bc9a2aa4dc Mon Sep 17 00:00:00 2001 From: Mariell Hoversholm Date: Tue, 25 Mar 2025 10:41:38 +0100 Subject: [PATCH 004/100] Provisioning: Gracefully handle AlreadyExists errors (#102758) * Provisioning: Gracefully handle AlreadyExists errors When this occurs, the job is already in the store. The vast majority of use-cases (which currently is all of them!) will be fine with just accepting that as an OK. * chore: make update-workspace * fix: return error, but expect it in tests --- .../provisioning/controller/repository.go | 4 ++ .../apis/provisioning/jobs/persistentstore.go | 9 ++-- pkg/tests/apis/provisioning/helper_test.go | 36 +++++++++++++++ .../apis/provisioning/provisioning_test.go | 46 +------------------ 4 files changed, 45 insertions(+), 50 deletions(-) diff --git a/pkg/registry/apis/provisioning/controller/repository.go b/pkg/registry/apis/provisioning/controller/repository.go index 5a2a18e375b..d5d61239cbd 100644 --- a/pkg/registry/apis/provisioning/controller/repository.go +++ b/pkg/registry/apis/provisioning/controller/repository.go @@ -371,6 +371,10 @@ func (rc *RepositoryController) addSyncJob(ctx context.Context, obj *provisionin Pull: syncOptions, }, }) + if apierrors.IsAlreadyExists(err) { + logging.FromContext(ctx).Info("sync job already exists, nothing triggered") + return nil + } if err != nil { // FIXME: should we update the status of the repository if we fail to add the job? return fmt.Errorf("error adding sync job: %w", err) diff --git a/pkg/registry/apis/provisioning/jobs/persistentstore.go b/pkg/registry/apis/provisioning/jobs/persistentstore.go index c8e836efe41..681462772bf 100644 --- a/pkg/registry/apis/provisioning/jobs/persistentstore.go +++ b/pkg/registry/apis/provisioning/jobs/persistentstore.go @@ -57,7 +57,9 @@ var ( type Queue interface { // Insert adds a new job to the queue. // - // This saves it if it is a new job, or fails with ErrJobAlreadyExists if one with the same name already exists. + // The job name is not honoured. It will be overwritten with a name that fits the job. + // + // This saves it if it is a new job, or fails with `apierrors.IsAlreadyExists(err) == true` if one already exists. Insert(ctx context.Context, job *provisioning.Job) (*provisioning.Job, error) } @@ -374,11 +376,6 @@ func (s *persistentStore) cleanupClaims(ctx context.Context) error { return nil } -// Insert adds a new job to the queue. -// -// The job name is not honoured. It will be overwritten with a name that fits the job. -// -// This saves it if it is a new job, or fails with `apierrors.IsAlreadyExists(err) == true` if one already exists. func (s *persistentStore) Insert(ctx context.Context, job *provisioning.Job) (*provisioning.Job, error) { s.generateJobName(job) // Side-effect: updates the job's name. diff --git a/pkg/tests/apis/provisioning/helper_test.go b/pkg/tests/apis/provisioning/helper_test.go index a319f069e26..8100407fc29 100644 --- a/pkg/tests/apis/provisioning/helper_test.go +++ b/pkg/tests/apis/provisioning/helper_test.go @@ -17,6 +17,7 @@ import ( ghmock "github.com/migueleliasweb/go-github-mock/src/mock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" @@ -52,6 +53,41 @@ type provisioningTestHelper struct { ViewerREST *rest.RESTClient } +func (h *provisioningTestHelper) SyncAndWait(t *testing.T, repo string, options *provisioning.SyncJobOptions) { + t.Helper() + + var opts provisioning.SyncJobOptions + if options != nil { + opts = *options + } + body := asJSON(opts) + + result := h.AdminREST.Post(). + Namespace("default"). + Resource("repositories"). + Name(repo). + SubResource("sync"). + Body(body). + SetHeader("Content-Type", "application/json"). + Do(t.Context()) + + if apierrors.IsAlreadyExists(result.Error()) { + // Wait for all jobs to finish as we don't have the name. + h.AwaitJobs(t, repo) + return + } + + obj, err := result.Get() + require.NoError(t, err, "expecting to be able to sync repository") + + unstruct, ok := obj.(*unstructured.Unstructured) + require.True(t, ok, "expecting unstructured object, but got %T", obj) + + name := unstruct.GetName() + require.NotEmpty(t, name, "expecting name to be set") + h.AwaitJobSuccess(t, t.Context(), name) +} + func (h *provisioningTestHelper) AwaitJobSuccess(t *testing.T, ctx context.Context, jobName string) { t.Helper() if !assert.EventuallyWithT(t, func(collect *assert.CollectT) { diff --git a/pkg/tests/apis/provisioning/provisioning_test.go b/pkg/tests/apis/provisioning/provisioning_test.go index 358057dc421..d1e45ccb2c5 100644 --- a/pkg/tests/apis/provisioning/provisioning_test.go +++ b/pkg/tests/apis/provisioning/provisioning_test.go @@ -181,27 +181,7 @@ func TestIntegrationProvisioning_CreatingGitHubRepository(t *testing.T) { ) require.NoError(t, err) - result := helper.AdminREST.Post(). - Namespace("default"). - Resource("repositories"). - Name(repo). - SubResource("sync"). - Body(asJSON(provisioning.SyncJobOptions{ - Incremental: false, - })). - SetHeader("Content-Type", "application/json"). - Do(ctx) - - obj, err := result.Get() - require.NoError(t, err, "expecting to be able to sync repository") - obj2, ok := obj.(*unstructured.Unstructured) - if !ok { - require.Fail(t, "expected unstructured response, %T", obj) - } - job := obj2.GetName() - require.NotEmpty(t, job) - - helper.AwaitJobSuccess(t, ctx, job) + helper.SyncAndWait(t, repo, nil) // By now, we should have synced, meaning we have data to read in the local Grafana instance! @@ -290,29 +270,7 @@ func TestIntegrationProvisioning_ImportAllPanelsFromLocalRepository(t *testing.T require.Error(t, err, "no all-panels dashboard should exist") // Now, we import it, such that it may exist - result := helper.AdminREST.Post(). - Namespace("default"). - Resource("repositories"). - Name(repo). - SubResource("sync"). - SetHeader("Content-Type", "application/json"). - Body(asJSON(provisioning.SyncJobOptions{ - Incremental: false, - })). - Do(ctx) - - obj, err := result.Get() - require.NoError(t, err, "expecting to be able to sync repository") - - obj2, ok := obj.(*unstructured.Unstructured) - if !ok { - require.Fail(t, "expected unstructured response, %T", obj) - } - job := obj2.GetName() - require.NotEmpty(t, job) - - // Wait for the async job to finish - helper.AwaitJobSuccess(t, ctx, job) + helper.SyncAndWait(t, repo, nil) found, err := helper.Dashboards.Resource.List(ctx, metav1.ListOptions{}) require.NoError(t, err, "can list values") From 1ca9910736475cf8f6a0660d2b523bb02ff26103 Mon Sep 17 00:00:00 2001 From: Jack Westbrook Date: Tue, 25 Mar 2025 10:48:36 +0100 Subject: [PATCH 005/100] Grafana Data: Use package.json exports for internal code (#102696) * refactor(frontend): rename all @grafana/data/src imports to @grafana/data * feat(grafana-data): introduce internal entrypoint for sharing code only with grafana * feat(grafana-data): add test entrypoint for data test utils usage in core * refactor(frontend): update import paths to use grafana/data exports entrypoints * docs(grafana-data): update comment in internal/index.ts * refactor(frontend): prefer public namespaced exports over re-exporting via internal * chore(frontend): fix a couple more weird paths that typescript complains about --- .betterer.results | 549 +++++------------- packages/grafana-data/package.json | 20 + packages/grafana-data/src/internal/index.ts | 100 ++++ .../panel/getPanelOptionsWithDefaults.test.ts | 3 +- .../{__mocks__ => helpers}/pluginMocks.ts | 0 packages/grafana-data/test/index.ts | 2 + .../src/querybuilder/operationUtils.ts | 2 +- public/app/core/components/GraphNG/utils.ts | 6 +- .../core/components/OptionsUI/registry.tsx | 2 +- .../core/components/TimelineChart/timeline.ts | 5 +- .../core/components/TimelineChart/utils.ts | 6 +- .../GrafanaJavascriptAgentBackend.test.ts | 2 +- public/app/core/services/theme.ts | 2 +- public/app/core/utils/explore.test.ts | 11 +- public/app/core/utils/richHistory.ts | 10 +- .../DashboardsListModalButton.tsx | 2 +- .../DeleteUserModalButton.tsx | 2 +- .../unified/GrafanaRuleQueryViewer.tsx | 5 +- .../GrafanaAlertmanagerDeliveryWarning.tsx | 2 +- .../rule-editor/CloudAlertPreview.tsx | 2 +- .../rule-editor/DashboardPicker.tsx | 2 +- .../components/rule-editor/QueryOptions.tsx | 5 +- .../rule-editor/rule-types/RuleTypePicker.tsx | 2 +- .../rules/AlertInstanceStateFilter.tsx | 2 +- .../components/rules/RuleConfigStatus.tsx | 2 +- .../rules/central-state-history/utils.ts | 2 +- .../state-history/useRuleHistoryRecords.tsx | 2 +- .../unified/home/PluginIntegrations.tsx | 2 +- .../alerting/unified/styles/pagination.ts | 2 +- .../features/alerting/unified/utils/misc.ts | 2 +- .../alerting/unified/utils/routeTree.ts | 6 +- .../features/alerting/unified/utils/time.ts | 4 +- .../StandardAnnotationQueryEditor.test.tsx | 2 +- .../auth-config/AuthProvidersListPage.tsx | 2 +- public/app/features/canvas/element.ts | 2 +- .../app/features/canvas/elements/button.tsx | 3 +- public/app/features/canvas/types.ts | 2 +- .../inspect/HelpWizard/HelpWizard.test.tsx | 2 +- .../inspect/InspectJsonTab.test.tsx | 2 +- .../pages/DashboardScenePage.test.tsx | 2 +- .../pages/PublicDashboardScenePage.test.tsx | 2 +- .../PanelDataQueriesTab.test.tsx | 2 +- .../panel-edit/PanelEditor.test.ts | 2 +- .../panel-edit/PanelOptions.test.tsx | 2 +- .../DashboardDatasourceBehaviour.test.tsx | 2 +- .../scene/DashboardLinksControls.tsx | 2 +- .../scene/DashboardSceneRenderer.test.tsx | 2 +- .../scene/LibraryPanelBehavior.test.tsx | 2 +- .../scene/PanelMenuBehavior.test.tsx | 2 +- .../layout-default/DashboardGridItem.test.tsx | 2 +- .../RowRepeaterBehavior.test.tsx | 2 +- .../RowItemRepeaterBehavior.test.tsx | 2 +- .../serialization/angularMigration.test.ts | 2 +- .../transformSaveModelToScene.test.ts | 2 +- .../transformSceneToSaveModel.test.ts | 2 +- .../settings/VariablesEditView.test.tsx | 2 +- .../share-externally/ShareExternally.test.tsx | 2 +- .../sharing/ShareDrawer/ShareDrawer.test.tsx | 2 +- .../sharing/ShareLinkTab.test.tsx | 2 +- .../panel-share/SharePanelInternally.test.tsx | 2 +- .../DashboardPrompt/DashboardPrompt.test.tsx | 2 +- .../components/HelpWizard/HelpWizard.test.tsx | 2 +- .../PanelEditor/OptionsPaneOptions.test.tsx | 2 +- .../PanelEditor/PanelHeaderCorner.tsx | 3 +- .../PanelEditor/getVisualizationOptions.tsx | 8 +- .../PanelEditor/state/actions.test.ts | 2 +- .../PublicDashboardNotAvailable.tsx | 2 +- .../ConfigPublicDashboard.tsx | 2 +- .../ConfigPublicDashboard/Configuration.tsx | 2 +- .../AcknowledgeCheckboxes.tsx | 2 +- .../UnsupportedDataSourcesAlert.tsx | 2 +- .../SharePublicDashboard.test.tsx | 2 +- .../SharePublicDashboard.tsx | 2 +- .../SharePublicDashboardUtils.test.tsx | 3 +- .../components/SubMenu/DashboardLinks.tsx | 2 +- .../SubMenu/DashboardLinksDashboard.tsx | 2 +- .../dashboard/state/DashboardMigrator.test.ts | 2 +- .../dashboard/state/DashboardMigrator.ts | 3 +- .../dashboard/state/PanelModel.test.ts | 3 +- .../features/dashboard/utils/panel.test.ts | 2 +- .../app/features/dashboard/utils/timeRange.ts | 3 +- .../datasources/components/CloudInfoBox.tsx | 2 +- .../datasources/state/buildCategories.test.ts | 2 +- public/app/features/dimensions/context.ts | 2 +- public/app/features/dimensions/scale.ts | 3 +- .../app/features/explore/Logs/Logs.test.tsx | 2 +- .../explore/Logs/LogsColumnSearch.tsx | 2 +- .../explore/Logs/LogsMetaRow.test.tsx | 2 +- .../app/features/explore/Logs/LogsMetaRow.tsx | 2 +- .../features/explore/Logs/LogsTable.test.tsx | 2 +- .../explore/Logs/LogsTableActiveFields.tsx | 2 +- .../explore/Logs/LogsTableMultiSelect.tsx | 2 +- .../explore/Logs/LogsTableWrap.test.tsx | 10 +- .../explore/Logs/utils/testMocks.test.ts | 4 +- public/app/features/explore/NoData.tsx | 2 +- .../explore/PrometheusListView/ItemLabels.tsx | 2 +- .../explore/PrometheusListView/ItemValues.tsx | 2 +- .../RawListContainer.test.tsx | 2 +- .../PrometheusListView/RawListContainer.tsx | 2 +- .../PrometheusListView/RawListItem.tsx | 2 +- .../RawListItemAttributes.tsx | 2 +- .../app/features/explore/state/main.test.ts | 3 +- .../live/centrifuge/LiveDataStream.ts | 2 +- .../logs/components/InfiniteScroll.test.tsx | 5 +- .../logs/components/InfiniteScroll.tsx | 12 +- .../logs/components/LogDetailsRow.test.tsx | 3 +- public/app/features/logs/logsModel.ts | 2 +- .../DeletePublicDashboardModal.tsx | 2 +- .../app/features/panel/state/actions.test.ts | 3 +- .../plugins/components/AppRootPage.test.tsx | 2 +- .../extensions/registry/AddedLinksRegistry.ts | 2 +- .../features/plugins/extensions/validators.ts | 19 +- .../plugins/loader/sharedDependencies.ts | 2 +- .../app/features/plugins/pluginPreloader.ts | 7 +- .../features/scopes/tests/utils/render.tsx | 2 +- .../app/features/trails/DataTrailsHistory.tsx | 5 +- .../logs/lokiRecordingRules.test.ts | 2 +- .../FilterByValueFilterEditor.tsx | 2 +- .../FilterByValueTransformerEditor.test.tsx | 2 +- .../FilterByValueTransformerEditor.tsx | 2 +- .../calculateHeatmap/heatmap.test.ts | 3 +- .../transformers/calculateHeatmap/heatmap.ts | 2 +- .../BinaryOperationOptionsEditor.tsx | 2 +- .../CalculateFieldTransformerEditor.tsx | 2 +- .../CumulativeOptionsEditor.tsx | 6 +- .../IndexOptionsEditor.tsx | 2 +- .../ReduceRowOptionsEditor.tsx | 5 +- .../UnaryOperationEditor.tsx | 6 +- .../WindowOptionsEditor.tsx | 2 +- .../editors/ConcatenateTransformerEditor.tsx | 5 +- .../ConvertFieldTypeTransformerEditor.tsx | 5 +- .../editors/EnumMappingEditor.tsx | 2 +- .../editors/FilterByNameTransformerEditor.tsx | 2 +- .../FilterByRefIdTransformerEditor.tsx | 2 +- .../editors/FormatStringTransformerEditor.tsx | 5 +- .../editors/FormatTimeTransformerEditor.tsx | 2 +- .../editors/GroupByTransformerEditor.tsx | 6 +- .../GroupToNestedTableTransformerEditor.tsx | 4 +- .../editors/HistogramTransformerEditor.tsx | 5 +- .../editors/JoinByFieldTransformerEditor.tsx | 2 +- .../LabelsToFieldsTransformerEditor.tsx | 5 +- .../editors/LimitTransformerEditor.tsx | 2 +- .../editors/MergeTransformerEditor.tsx | 2 +- .../OrganizeFieldsTransformerEditor.tsx | 3 +- .../editors/ReduceTransformerEditor.tsx | 2 +- .../editors/RenameByRegexTransformer.tsx | 2 +- .../editors/SeriesToRowsTransformerEditor.tsx | 2 +- .../editors/SortByTransformerEditor.tsx | 2 +- .../editors/TransposeTransformerEditor.tsx | 2 +- .../extractFields/extractFields.test.ts | 5 +- .../lookupGazetteer/fieldLookup.test.ts | 4 +- .../partitionByValues/partitionByValues.ts | 3 +- .../transformers/spatial/optionsHelper.tsx | 3 +- .../spatial/spatialTransformer.test.ts | 5 +- .../variables/datasource/actions.test.ts | 2 +- .../variables/datasource/reducer.test.ts | 2 +- .../state/initVariableTransaction.test.ts | 2 +- ...igrateVariablesDatasourceNameToRef.test.ts | 2 +- .../azuremonitor/__mocks__/utils.ts | 3 +- .../components/LogsQueryEditor/RawQuery.tsx | 2 +- .../CloudWatchMetricsQueryRunner.test.ts | 3 +- .../datasource/dashboard/datasource.test.ts | 2 +- .../elasticsearch/ElasticResponse.ts | 2 +- .../editor/annotation/AnnotationEditor.tsx | 2 +- .../influxdb/components/editor/constants.ts | 2 +- .../components/editor/query/QueryEditor.tsx | 2 +- .../editor/query/flux/FluxQueryEditor.tsx | 2 +- .../editor/query/fsql/FSQLEditor.tsx | 2 +- .../utils/getTemplateVariableOptions.ts | 2 +- .../utils/withTemplateVariableOptions.ts | 2 +- .../editor/query/influxql/utils/wrapper.ts | 2 +- .../influxdb/influxql_metadata_query.ts | 2 +- .../datasources/prometheus/RawQuery.tsx | 2 +- public/app/plugins/datasource/tempo/types.ts | 2 +- public/app/plugins/panel/barchart/bars.ts | 6 +- public/app/plugins/panel/barchart/utils.ts | 2 +- .../plugins/panel/bargauge/BarGaugeLegend.tsx | 3 +- .../app/plugins/panel/candlestick/fields.ts | 2 +- .../panel/canvas/components/CanvasTooltip.tsx | 4 +- .../panel/canvas/editor/connectionEditor.tsx | 2 +- .../editor/element/QuickPositioning.tsx | 2 +- .../canvas/editor/element/elementEditor.tsx | 2 +- .../canvas/editor/inline/InlineEditBody.tsx | 3 +- .../panel/canvas/editor/layer/layerEditor.tsx | 2 +- .../plugins/panel/canvas/editor/options.ts | 2 +- public/app/plugins/panel/canvas/utils.ts | 3 +- .../components/DatagridContextMenu.tsx | 2 +- .../panel/geomap/components/MarkersLegend.tsx | 9 +- .../panel/geomap/editor/layerEditor.tsx | 2 +- .../panel/geomap/layers/data/routeLayer.tsx | 6 +- .../utils/checkFeatureMatchesStyleRule.ts | 2 +- .../app/plugins/panel/geomap/utils/tooltip.ts | 2 +- .../app/plugins/panel/geomap/utils/utils.ts | 3 +- .../app/plugins/panel/graph/data_processor.ts | 2 +- .../app/plugins/panel/histogram/Histogram.tsx | 4 +- .../panel/histogram/HistogramPanel.tsx | 11 +- public/app/plugins/panel/histogram/module.tsx | 2 +- public/app/plugins/panel/histogram/utils.ts | 5 +- public/app/plugins/panel/logs/LogsPanel.tsx | 4 +- .../app/plugins/panel/nodeGraph/Node.test.tsx | 2 +- public/app/plugins/panel/stat/StatPanel.tsx | 2 +- .../app/plugins/panel/status-history/utils.ts | 3 +- public/app/plugins/panel/table/migrations.ts | 2 +- public/app/plugins/panel/timeseries/utils.ts | 6 +- public/app/plugins/panel/trend/TrendPanel.tsx | 11 +- .../plugins/panel/xychart/XYChartPanel.tsx | 5 +- .../plugins/panel/xychart/XYChartTooltip.tsx | 5 +- public/app/plugins/panel/xychart/scatter.ts | 14 +- public/app/plugins/panel/xychart/utils.ts | 2 +- public/app/routes/RoutesWrapper.tsx | 2 +- 210 files changed, 572 insertions(+), 729 deletions(-) create mode 100644 packages/grafana-data/src/internal/index.ts rename packages/grafana-data/test/{__mocks__ => helpers}/pluginMocks.ts (100%) create mode 100644 packages/grafana-data/test/index.ts diff --git a/.betterer.results b/.betterer.results index e83dff234b4..be6ec2229c5 100644 --- a/.betterer.results +++ b/.betterer.results @@ -392,8 +392,9 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "7"], [0, 0, 0, "Unexpected any. Specify a different type.", "8"] ], - "packages/grafana-data/test/__mocks__/pluginMocks.ts:5381": [ - [0, 0, 0, "Unexpected any. Specify a different type.", "0"] + "packages/grafana-data/test/helpers/pluginMocks.ts:5381": [ + [0, 0, 0, "Do not use any type assertions.", "0"], + [0, 0, 0, "Unexpected any. Specify a different type.", "1"] ], "packages/grafana-e2e-selectors/src/resolver.ts:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] @@ -882,11 +883,6 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "4"], [0, 0, 0, "Unexpected any. Specify a different type.", "5"] ], - "public/app/core/components/GraphNG/utils.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/joinDataFrames\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/nulls/nullInsertThreshold\' import is restricted from being used by a pattern. Import from the public export instead.", "1"], - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/nulls/nullToUndefThreshold\' import is restricted from being used by a pattern. Import from the public export instead.", "2"] - ], "public/app/core/components/Layers/LayerDragDropList.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], @@ -912,9 +908,6 @@ exports[`better eslint`] = { "public/app/core/components/OptionsUI/fieldColor.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], - "public/app/core/components/OptionsUI/registry.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/field/overrides/processors\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/core/components/OptionsUI/units.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], @@ -996,14 +989,6 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "1"], [0, 0, 0, "Unexpected any. Specify a different type.", "2"] ], - "public/app/core/components/TimelineChart/timeline.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/themes/colorManipulator\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], - "public/app/core/components/TimelineChart/utils.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/joinDataFrames\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/nulls/nullInsertThreshold\' import is restricted from being used by a pattern. Import from the public export instead.", "1"], - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/nulls/nullToValue\' import is restricted from being used by a pattern. Import from the public export instead.", "2"] - ], "public/app/core/config.ts:5381": [ [0, 0, 0, "Do not re-export imported variable (\`Settings\`)", "0"], [0, 0, 0, "Do not re-export imported variable (\`config\`)", "1"] @@ -1052,12 +1037,6 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "2"], [0, 0, 0, "Unexpected any. Specify a different type.", "3"] ], - "public/app/core/services/echo/backends/grafana-javascript-agent/GrafanaJavascriptAgentBackend.test.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/types/config\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], - "public/app/core/services/theme.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/themes/registry\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/core/specs/backend_srv.test.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], @@ -1097,9 +1076,6 @@ exports[`better eslint`] = { "public/app/core/utils/deferred.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], - "public/app/core/utils/explore.test.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/utils/url\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/core/utils/fetch.ts:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "1"], @@ -1121,10 +1097,9 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], "public/app/core/utils/richHistory.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/utils/url\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "Do not re-export imported variable (\`RichHistorySearchFilters\`)", "1"], - [0, 0, 0, "Do not re-export imported variable (\`RichHistorySettings\`)", "2"], - [0, 0, 0, "Do not re-export imported variable (\`SortOrder\`)", "3"] + [0, 0, 0, "Do not re-export imported variable (\`RichHistorySearchFilters\`)", "0"], + [0, 0, 0, "Do not re-export imported variable (\`RichHistorySettings\`)", "1"], + [0, 0, 0, "Do not re-export imported variable (\`SortOrder\`)", "2"] ], "public/app/core/utils/ticks.ts:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], @@ -1209,9 +1184,9 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings. Wrap text with ", "4"] ], "public/app/features/alerting/unified/GrafanaRuleQueryViewer.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/datetime/rangeutil\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], + [0, 0, 0, "No untranslated strings. Wrap text with ", "2"], [0, 0, 0, "No untranslated strings. Wrap text with ", "3"], [0, 0, 0, "No untranslated strings. Wrap text with ", "4"], [0, 0, 0, "No untranslated strings. Wrap text with ", "5"], @@ -1224,8 +1199,7 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings. Wrap text with ", "12"], [0, 0, 0, "No untranslated strings. Wrap text with ", "13"], [0, 0, 0, "No untranslated strings. Wrap text with ", "14"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "15"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "16"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "15"] ], "public/app/features/alerting/unified/NotificationPoliciesPage.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], @@ -1871,11 +1845,10 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings. Wrap text with ", "1"] ], "public/app/features/alerting/unified/components/rule-editor/QueryOptions.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/datetime/rangeutil\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], + [0, 0, 0, "No untranslated strings. Wrap text with ", "1"], [0, 0, 0, "No untranslated strings. Wrap text with ", "2"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "3"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "4"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "3"] ], "public/app/features/alerting/unified/components/rule-editor/QueryRows.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], @@ -2227,9 +2200,6 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings. Wrap text with ", "3"], [0, 0, 0, "No untranslated strings. Wrap text with ", "4"] ], - "public/app/features/alerting/unified/components/rules/central-state-history/utils.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/field/fieldComparers\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/features/alerting/unified/components/rules/state-history/LogRecordViewer.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], [0, 0, 0, "No untranslated strings. Wrap text with ", "1"] @@ -2251,9 +2221,6 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings. Wrap text with ", "3"], [0, 0, 0, "No untranslated strings. Wrap text with ", "4"] ], - "public/app/features/alerting/unified/components/rules/state-history/useRuleHistoryRecords.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/field/fieldComparers\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/features/alerting/unified/components/settings/AlertmanagerCard.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], @@ -2475,9 +2442,6 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "1"], [0, 0, 0, "Unexpected any. Specify a different type.", "2"] ], - "public/app/features/alerting/unified/utils/misc.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/types/config\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/features/alerting/unified/utils/receiver-form.ts:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "1"], @@ -2494,9 +2458,6 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "6"], [0, 0, 0, "Unexpected any. Specify a different type.", "7"] ], - "public/app/features/alerting/unified/utils/routeTree.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/utils/arrayUtils\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/features/alerting/unified/utils/rule-form.ts:5381": [ [0, 0, 0, "\'@grafana/runtime/src/utils/DataSourceWithBackend\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] ], @@ -2506,9 +2467,6 @@ exports[`better eslint`] = { [0, 0, 0, "Do not use any type assertions.", "2"], [0, 0, 0, "Unexpected any. Specify a different type.", "3"] ], - "public/app/features/alerting/unified/utils/time.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/datetime/rangeutil\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/features/annotations/components/AnnotationResultMapper.tsx:5381": [ [0, 0, 0, "No untranslated strings. Wrap text with ", "0"], [0, 0, 0, "No untranslated strings. Wrap text with ", "1"], @@ -2550,8 +2508,7 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings. Wrap text with ", "2"] ], "public/app/features/auth-config/AuthProvidersListPage.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/types/config\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "1"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] ], "public/app/features/auth-config/ProviderConfigForm.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], @@ -2602,9 +2559,6 @@ exports[`better eslint`] = { [0, 0, 0, "Do not use export all (\`export * from ...\`)", "1"], [0, 0, 0, "Do not use export all (\`export * from ...\`)", "2"] ], - "public/app/features/canvas/element.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/panel/PanelPlugin\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/features/canvas/elements/notFound.tsx:5381": [ [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] ], @@ -2850,9 +2804,6 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], [0, 0, 0, "No untranslated strings. Wrap text with ", "1"] ], - "public/app/features/dashboard-scene/scene/DashboardLinksControls.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/text/sanitize\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/features/dashboard-scene/scene/PanelLinks.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], @@ -3333,10 +3284,8 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"] ], "public/app/features/dashboard/components/PanelEditor/getVisualizationOptions.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/panel/PanelPlugin\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "\'@grafana/data/src/utils/OptionsUIBuilders\' import is restricted from being used by a pattern. Import from the public export instead.", "1"], - [0, 0, 0, "Unexpected any. Specify a different type.", "2"], - [0, 0, 0, "Unexpected any. Specify a different type.", "3"] + [0, 0, 0, "Unexpected any. Specify a different type.", "0"], + [0, 0, 0, "Unexpected any. Specify a different type.", "1"] ], "public/app/features/dashboard/components/PanelEditor/utils.ts:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], @@ -3448,20 +3397,13 @@ exports[`better eslint`] = { "public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboard.tsx:5381": [ [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] ], - "public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils.test.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/types/query\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/features/dashboard/components/ShareModal/ViewJsonModal.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], - "public/app/features/dashboard/components/SubMenu/DashboardLinks.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/text/sanitize\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/features/dashboard/components/SubMenu/DashboardLinksDashboard.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/text/sanitize\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "Do not use any type assertions.", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "Unexpected any. Specify a different type.", "3"] + [0, 0, 0, "Do not use any type assertions.", "0"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], + [0, 0, 0, "Unexpected any. Specify a different type.", "2"] ], "public/app/features/dashboard/components/SubMenu/SubMenu.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] @@ -3574,12 +3516,12 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "11"] ], "public/app/features/dashboard/state/DashboardMigrator.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/labelsToFields\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/merge\' import is restricted from being used by a pattern. Import from the public export instead.", "1"], + [0, 0, 0, "Do not use any type assertions.", "0"], + [0, 0, 0, "Do not use any type assertions.", "1"], [0, 0, 0, "Do not use any type assertions.", "2"], [0, 0, 0, "Do not use any type assertions.", "3"], - [0, 0, 0, "Do not use any type assertions.", "4"], - [0, 0, 0, "Do not use any type assertions.", "5"], + [0, 0, 0, "Unexpected any. Specify a different type.", "4"], + [0, 0, 0, "Unexpected any. Specify a different type.", "5"], [0, 0, 0, "Unexpected any. Specify a different type.", "6"], [0, 0, 0, "Unexpected any. Specify a different type.", "7"], [0, 0, 0, "Unexpected any. Specify a different type.", "8"], @@ -3601,9 +3543,7 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "24"], [0, 0, 0, "Unexpected any. Specify a different type.", "25"], [0, 0, 0, "Unexpected any. Specify a different type.", "26"], - [0, 0, 0, "Unexpected any. Specify a different type.", "27"], - [0, 0, 0, "Unexpected any. Specify a different type.", "28"], - [0, 0, 0, "Unexpected any. Specify a different type.", "29"] + [0, 0, 0, "Unexpected any. Specify a different type.", "27"] ], "public/app/features/dashboard/state/DashboardModel.repeat.test.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], @@ -3716,10 +3656,9 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings. Wrap text with ", "2"] ], "public/app/features/datasources/components/CloudInfoBox.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/types/config\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "3"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "2"] ], "public/app/features/datasources/components/DashboardsTable.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], @@ -3900,8 +3839,7 @@ exports[`better eslint`] = { [0, 0, 0, "Do not use export all (\`export * from ...\`)", "7"] ], "public/app/features/dimensions/scale.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/field/scale\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "Do not use any type assertions.", "1"] + [0, 0, 0, "Do not use any type assertions.", "0"] ], "public/app/features/dimensions/types.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] @@ -3933,9 +3871,6 @@ exports[`better eslint`] = { "public/app/features/explore/Logs/LiveLogs.tsx:5381": [ [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] ], - "public/app/features/explore/Logs/Logs.test.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/organize\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/features/explore/Logs/Logs.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], [0, 0, 0, "No untranslated strings. Wrap text with ", "1"], @@ -3948,15 +3883,9 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], [0, 0, 0, "No untranslated strings. Wrap text with ", "1"] ], - "public/app/features/explore/Logs/LogsMetaRow.test.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/organize\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/features/explore/Logs/LogsSamplePanel.tsx:5381": [ [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] ], - "public/app/features/explore/Logs/LogsTable.test.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/organize\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/features/explore/Logs/LogsTableAvailableFields.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], @@ -3966,9 +3895,6 @@ exports[`better eslint`] = { "public/app/features/explore/Logs/LogsTableNavField.tsx:5381": [ [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] ], - "public/app/features/explore/Logs/LogsTableWrap.test.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/organize\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/features/explore/Logs/LogsTableWrap.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], @@ -4149,9 +4075,6 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings. Wrap text with ", "1"], [0, 0, 0, "Unexpected any. Specify a different type.", "2"] ], - "public/app/features/explore/state/main.test.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/utils/url\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/features/explore/state/time.test.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], @@ -4319,10 +4242,9 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], "public/app/features/live/centrifuge/LiveDataStream.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/dataframe/StreamingDataFrame\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "\'@grafana/runtime/src/services/live\' import is restricted from being used by a pattern. Import from the public export instead.", "1"], - [0, 0, 0, "\'@grafana/runtime/src/utils/toDataQueryError\' import is restricted from being used by a pattern. Import from the public export instead.", "2"], - [0, 0, 0, "Do not use any type assertions.", "3"] + [0, 0, 0, "\'@grafana/runtime/src/services/live\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], + [0, 0, 0, "\'@grafana/runtime/src/utils/toDataQueryError\' import is restricted from being used by a pattern. Import from the public export instead.", "1"], + [0, 0, 0, "Do not use any type assertions.", "2"] ], "public/app/features/live/centrifuge/channel.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] @@ -4344,12 +4266,8 @@ exports[`better eslint`] = { "public/app/features/live/live.ts:5381": [ [0, 0, 0, "\'@grafana/runtime/src/utils/DataSourceWithBackend\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] ], - "public/app/features/logs/components/InfiniteScroll.test.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/datetime/rangeutil\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/features/logs/components/InfiniteScroll.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/datetime/rangeutil\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "1"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] ], "public/app/features/logs/components/LogDetails.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], @@ -4397,9 +4315,6 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings. Wrap text with ", "4"], [0, 0, 0, "No untranslated strings. Wrap text with ", "5"] ], - "public/app/features/logs/logsModel.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/valueFormats/symbolFormatters\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/features/logs/utils.ts:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] ], @@ -4713,24 +4628,15 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"] ], - "public/app/features/plugins/extensions/registry/AddedLinksRegistry.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/types/pluginExtensions\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/features/plugins/extensions/usePluginComponents.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] ], "public/app/features/plugins/extensions/usePluginFunctions.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] ], - "public/app/features/plugins/extensions/validators.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/types/pluginExtensions\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/features/plugins/loader/sharedDependencies.ts:5381": [ [0, 0, 0, "* import is invalid because \'Layout,HorizontalGroup,VerticalGroup\' from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"] ], - "public/app/features/plugins/pluginPreloader.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/types/pluginExtensions\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/features/plugins/sandbox/distortion_map.ts:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] ], @@ -5382,8 +5288,7 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] ], "public/app/features/trails/DataTrailsHistory.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/datetime/rangeutil\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "1"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] ], "public/app/features/trails/MetricScene.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], @@ -5417,21 +5322,16 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], "public/app/features/transformers/FilterByValueTransformer/FilterByValueFilterEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/filterByValue\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "5"] - ], - "public/app/features/transformers/FilterByValueTransformer/FilterByValueTransformerEditor.test.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/filterByValue\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"] ], "public/app/features/transformers/FilterByValueTransformer/FilterByValueTransformerEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/filterByValue\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "3"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "2"] ], "public/app/features/transformers/FilterByValueTransformer/ValueMatchers/BasicMatcherEditor.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], @@ -5467,13 +5367,9 @@ exports[`better eslint`] = { "public/app/features/transformers/calculateHeatmap/editor/helper.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], - "public/app/features/transformers/calculateHeatmap/heatmap.test.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/dataframe/processDataFrame\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/features/transformers/calculateHeatmap/heatmap.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/joinDataFrames\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "Do not use any type assertions.", "1"], - [0, 0, 0, "Do not use any type assertions.", "2"] + [0, 0, 0, "Do not use any type assertions.", "0"], + [0, 0, 0, "Do not use any type assertions.", "1"] ], "public/app/features/transformers/configFromQuery/ConfigFromQueryTransformerEditor.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], @@ -5481,66 +5377,58 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"] ], "public/app/features/transformers/editors/CalculateFieldTransformerEditor/BinaryOperationOptionsEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/calculateField\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"] - ], - "public/app/features/transformers/editors/CalculateFieldTransformerEditor/CalculateFieldTransformerEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/calculateField\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"] - ], - "public/app/features/transformers/editors/CalculateFieldTransformerEditor/CumulativeOptionsEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/calculateField\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "Do not use any type assertions.", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"] - ], - "public/app/features/transformers/editors/CalculateFieldTransformerEditor/IndexOptionsEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/calculateField\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"] ], - "public/app/features/transformers/editors/CalculateFieldTransformerEditor/ReduceRowOptionsEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/calculateField\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "1"], - [0, 0, 0, "Do not use any type assertions.", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"] + "public/app/features/transformers/editors/CalculateFieldTransformerEditor/CalculateFieldTransformerEditor.tsx:5381": [ + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"] ], - "public/app/features/transformers/editors/CalculateFieldTransformerEditor/UnaryOperationEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/calculateField\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], + "public/app/features/transformers/editors/CalculateFieldTransformerEditor/CumulativeOptionsEditor.tsx:5381": [ + [0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "4"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"] + ], + "public/app/features/transformers/editors/CalculateFieldTransformerEditor/IndexOptionsEditor.tsx:5381": [ + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"] + ], + "public/app/features/transformers/editors/CalculateFieldTransformerEditor/ReduceRowOptionsEditor.tsx:5381": [ + [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"], + [0, 0, 0, "Do not use any type assertions.", "1"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"] + ], + "public/app/features/transformers/editors/CalculateFieldTransformerEditor/UnaryOperationEditor.tsx:5381": [ + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], + [0, 0, 0, "No untranslated strings. Wrap text with ", "3"] ], "public/app/features/transformers/editors/CalculateFieldTransformerEditor/WindowOptionsEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/calculateField\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "Do not use any type assertions.", "1"], + [0, 0, 0, "Do not use any type assertions.", "0"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "5"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "6"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "7"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "6"] ], "public/app/features/transformers/editors/CalculateFieldTransformerEditor/index.ts:5381": [ [0, 0, 0, "Do not re-export imported variable (\`CalculateFieldTransformerEditor\`)", "0"], [0, 0, 0, "Do not re-export imported variable (\`calculateFieldTransformRegistryItem\`)", "1"] ], "public/app/features/transformers/editors/ConcatenateTransformerEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/concat\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"] ], "public/app/features/transformers/editors/ConvertFieldTypeTransformerEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/convertFieldType\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "Do not use any type assertions.", "1"], + [0, 0, 0, "Do not use any type assertions.", "0"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"], @@ -5555,15 +5443,13 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "13"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "14"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "15"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "16"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "17"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "16"] ], "public/app/features/transformers/editors/EnumMappingEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/convertFieldType\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "1"], - [0, 0, 0, "\'VerticalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "2"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "3"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "4"] + [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"], + [0, 0, 0, "\'VerticalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "1"], + [0, 0, 0, "No untranslated strings. Wrap text with ", "2"], + [0, 0, 0, "No untranslated strings. Wrap text with ", "3"] ], "public/app/features/transformers/editors/EnumMappingRow.tsx:5381": [ [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"], @@ -5571,49 +5457,40 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"] ], "public/app/features/transformers/editors/FilterByNameTransformerEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/filterByName\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "\'@grafana/runtime/src/services\' import is restricted from being used by a pattern. Import from the public export instead.", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "5"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "6"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "7"] - ], - "public/app/features/transformers/editors/FilterByRefIdTransformerEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/filterByRefId\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], - "public/app/features/transformers/editors/FormatStringTransformerEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/formatString\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], + [0, 0, 0, "\'@grafana/runtime/src/services\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"] - ], - "public/app/features/transformers/editors/FormatTimeTransformerEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/formatTime\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "5"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "6"] - ], - "public/app/features/transformers/editors/GroupByTransformerEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/groupBy\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "Do not use any type assertions.", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"] - ], - "public/app/features/transformers/editors/GroupToNestedTableTransformerEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/groupBy\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/groupToNestedTable\' import is restricted from being used by a pattern. Import from the public export instead.", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "5"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "6"] ], + "public/app/features/transformers/editors/FormatStringTransformerEditor.tsx:5381": [ + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"] + ], + "public/app/features/transformers/editors/FormatTimeTransformerEditor.tsx:5381": [ + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"], + [0, 0, 0, "No untranslated strings. Wrap text with ", "5"] + ], + "public/app/features/transformers/editors/GroupByTransformerEditor.tsx:5381": [ + [0, 0, 0, "Do not use any type assertions.", "0"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"] + ], + "public/app/features/transformers/editors/GroupToNestedTableTransformerEditor.tsx:5381": [ + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"] + ], "public/app/features/transformers/editors/GroupingToMatrixTransformerEditor.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], @@ -5621,73 +5498,59 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"] ], "public/app/features/transformers/editors/HistogramTransformerEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/histogram\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"] ], "public/app/features/transformers/editors/JoinByFieldTransformerEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/joinByField\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"] + ], + "public/app/features/transformers/editors/LabelsToFieldsTransformerEditor.tsx:5381": [ + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"] + ], + "public/app/features/transformers/editors/LimitTransformerEditor.tsx:5381": [ + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] + ], + "public/app/features/transformers/editors/MergeTransformerEditor.tsx:5381": [ + [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] + ], + "public/app/features/transformers/editors/OrganizeFieldsTransformerEditor.tsx:5381": [ + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], + [0, 0, 0, "No untranslated strings. Wrap text with ", "2"] + ], + "public/app/features/transformers/editors/ReduceTransformerEditor.tsx:5381": [ + [0, 0, 0, "Do not use any type assertions.", "0"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "5"] + ], + "public/app/features/transformers/editors/RenameByRegexTransformer.tsx:5381": [ + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"] ], - "public/app/features/transformers/editors/LabelsToFieldsTransformerEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/labelsToFields\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "5"] - ], - "public/app/features/transformers/editors/LimitTransformerEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/limit\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"] - ], - "public/app/features/transformers/editors/MergeTransformerEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/merge\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "1"] - ], - "public/app/features/transformers/editors/OrganizeFieldsTransformerEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/order\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/organize\' import is restricted from being used by a pattern. Import from the public export instead.", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "4"] - ], - "public/app/features/transformers/editors/ReduceTransformerEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/reduce\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "Do not use any type assertions.", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "5"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "6"] - ], - "public/app/features/transformers/editors/RenameByRegexTransformer.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/renameByRegex\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"] - ], - "public/app/features/transformers/editors/SeriesToRowsTransformerEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/seriesToRows\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/features/transformers/editors/SortByTransformerEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/sortBy\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "Do not use any type assertions.", "1"], + [0, 0, 0, "Do not use any type assertions.", "0"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"] ], "public/app/features/transformers/editors/TransposeTransformerEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/transpose\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "5"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"] ], "public/app/features/transformers/extractFields/ExtractFieldsTransformerEditor.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], @@ -5714,11 +5577,6 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings. Wrap text with ", "5"], [0, 0, 0, "No untranslated strings. Wrap text with ", "6"] ], - "public/app/features/transformers/extractFields/extractFields.test.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/dataframe/processDataFrame\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/sortBy\' import is restricted from being used by a pattern. Import from the public export instead.", "1"], - [0, 0, 0, "\'@grafana/data/src/utils/tests/mockTransformationsRegistry\' import is restricted from being used by a pattern. Import from the public export instead.", "2"] - ], "public/app/features/transformers/extractFields/extractFields.ts:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"] @@ -5761,10 +5619,6 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"] ], - "public/app/features/transformers/lookupGazetteer/fieldLookup.test.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/dataframe/processDataFrame\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/ids\' import is restricted from being used by a pattern. Import from the public export instead.", "1"] - ], "public/app/features/transformers/lookupGazetteer/fieldLookup.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], @@ -5778,10 +5632,6 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "6"], [0, 0, 0, "No untranslated strings. Wrap text with ", "7"] ], - "public/app/features/transformers/partitionByValues/partitionByValues.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/filterByName\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/noop\' import is restricted from being used by a pattern. Import from the public export instead.", "1"] - ], "public/app/features/transformers/prepareTimeSeries/PrepareTimeSeriesEditor.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], @@ -5816,18 +5666,12 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "5"] ], "public/app/features/transformers/spatial/optionsHelper.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/panel/PanelPlugin\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "\'@grafana/data/src/utils/OptionsUIBuilders\' import is restricted from being used by a pattern. Import from the public export instead.", "1"], + [0, 0, 0, "Do not use any type assertions.", "0"], + [0, 0, 0, "Do not use any type assertions.", "1"], [0, 0, 0, "Do not use any type assertions.", "2"], - [0, 0, 0, "Do not use any type assertions.", "3"], - [0, 0, 0, "Do not use any type assertions.", "4"], - [0, 0, 0, "Unexpected any. Specify a different type.", "5"], - [0, 0, 0, "Unexpected any. Specify a different type.", "6"], - [0, 0, 0, "Unexpected any. Specify a different type.", "7"] - ], - "public/app/features/transformers/spatial/spatialTransformer.test.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/dataframe/processDataFrame\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/ids\' import is restricted from being used by a pattern. Import from the public export instead.", "1"] + [0, 0, 0, "Unexpected any. Specify a different type.", "3"], + [0, 0, 0, "Unexpected any. Specify a different type.", "4"], + [0, 0, 0, "Unexpected any. Specify a different type.", "5"] ], "public/app/features/transformers/suggestionsInput/SuggestionsInput.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], @@ -6110,9 +5954,6 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"] ], - "public/app/plugins/datasource/azuremonitor/__mocks__/utils.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/types/data\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/plugins/datasource/azuremonitor/azureMetadata/index.ts:5381": [ [0, 0, 0, "Do not use export all (\`export * from ...\`)", "0"], [0, 0, 0, "Do not use export all (\`export * from ...\`)", "1"] @@ -6283,9 +6124,6 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "1"], [0, 0, 0, "Unexpected any. Specify a different type.", "2"] ], - "public/app/plugins/datasource/cloudwatch/query-runner/CloudWatchMetricsQueryRunner.test.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/datetime/moment_wrapper\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/plugins/datasource/cloudwatch/types.ts:5381": [ [0, 0, 0, "Do not use export all (\`export * from ...\`)", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"], @@ -6308,9 +6146,9 @@ exports[`better eslint`] = { [0, 0, 0, "Do not use any type assertions.", "1"] ], "public/app/plugins/datasource/elasticsearch/ElasticResponse.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/convertFieldType\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], + [0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "1"], - [0, 0, 0, "Do not use any type assertions.", "2"], + [0, 0, 0, "Unexpected any. Specify a different type.", "2"], [0, 0, 0, "Unexpected any. Specify a different type.", "3"], [0, 0, 0, "Unexpected any. Specify a different type.", "4"], [0, 0, 0, "Unexpected any. Specify a different type.", "5"], @@ -6339,8 +6177,7 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "28"], [0, 0, 0, "Unexpected any. Specify a different type.", "29"], [0, 0, 0, "Unexpected any. Specify a different type.", "30"], - [0, 0, 0, "Unexpected any. Specify a different type.", "31"], - [0, 0, 0, "Unexpected any. Specify a different type.", "32"] + [0, 0, 0, "Unexpected any. Specify a different type.", "31"] ], "public/app/plugins/datasource/elasticsearch/LanguageProvider.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], @@ -6712,22 +6549,15 @@ exports[`better eslint`] = { [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"] ], "public/app/plugins/panel/barchart/bars.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/themes/colorManipulator\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "Do not use any type assertions.", "1"] + [0, 0, 0, "Do not use any type assertions.", "0"] ], "public/app/plugins/panel/barchart/quadtree.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], - "public/app/plugins/panel/barchart/utils.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/field/fieldState\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/plugins/panel/candlestick/CandlestickPanel.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"] ], - "public/app/plugins/panel/candlestick/fields.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/joinDataFrames\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/plugins/panel/candlestick/types.ts:5381": [ [0, 0, 0, "Do not re-export imported variable (\`CandleStyle\`)", "0"], [0, 0, 0, "Do not re-export imported variable (\`CandlestickColors\`)", "1"], @@ -6738,28 +6568,6 @@ exports[`better eslint`] = { [0, 0, 0, "Do not re-export imported variable (\`VizDisplayMode\`)", "6"], [0, 0, 0, "Do not re-export imported variable (\`defaultCandlestickColors\`)", "7"] ], - "public/app/plugins/panel/canvas/components/CanvasTooltip.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/types/action\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], - "public/app/plugins/panel/canvas/editor/connectionEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/utils/OptionsUIBuilders\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], - "public/app/plugins/panel/canvas/editor/element/elementEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/utils/OptionsUIBuilders\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], - "public/app/plugins/panel/canvas/editor/inline/InlineEditBody.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/panel/PanelPlugin\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "\'@grafana/data/src/utils/OptionsUIBuilders\' import is restricted from being used by a pattern. Import from the public export instead.", "1"] - ], - "public/app/plugins/panel/canvas/editor/layer/layerEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/utils/OptionsUIBuilders\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], - "public/app/plugins/panel/canvas/editor/options.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/panel/PanelPlugin\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], - "public/app/plugins/panel/datagrid/components/DatagridContextMenu.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/convertFieldType\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/plugins/panel/debug/CursorView.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"] @@ -6772,10 +6580,9 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], "public/app/plugins/panel/geomap/components/MarkersLegend.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/field/scale\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], + [0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "1"], - [0, 0, 0, "Do not use any type assertions.", "2"], - [0, 0, 0, "Unexpected any. Specify a different type.", "3"] + [0, 0, 0, "Unexpected any. Specify a different type.", "2"] ], "public/app/plugins/panel/geomap/editor/GeomapStyleRulesEditor.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] @@ -6801,9 +6608,6 @@ exports[`better eslint`] = { "public/app/plugins/panel/geomap/editor/StyleRuleEditor.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] ], - "public/app/plugins/panel/geomap/editor/layerEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/utils/OptionsUIBuilders\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/plugins/panel/geomap/layers/basemaps/esri.ts:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] ], @@ -6811,8 +6615,7 @@ exports[`better eslint`] = { [0, 0, 0, "Do not use any type assertions.", "0"] ], "public/app/plugins/panel/geomap/layers/data/routeLayer.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/themes/colorManipulator\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "Do not use any type assertions.", "1"] + [0, 0, 0, "Do not use any type assertions.", "0"] ], "public/app/plugins/panel/geomap/layers/registry.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], @@ -6825,9 +6628,6 @@ exports[`better eslint`] = { "public/app/plugins/panel/geomap/types.ts:5381": [ [0, 0, 0, "Do not re-export imported variable (\`./panelcfg.gen\`)", "0"] ], - "public/app/plugins/panel/geomap/utils/checkFeatureMatchesStyleRule.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/matchers/compareValues\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/plugins/panel/geomap/utils/layers.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], @@ -6868,18 +6668,6 @@ exports[`better eslint`] = { [0, 0, 0, "Do not use any type assertions.", "15"], [0, 0, 0, "Do not use any type assertions.", "16"] ], - "public/app/plugins/panel/histogram/Histogram.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/histogram\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], - "public/app/plugins/panel/histogram/HistogramPanel.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/histogram\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], - "public/app/plugins/panel/histogram/module.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/histogram\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], - "public/app/plugins/panel/histogram/utils.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/histogram\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/plugins/panel/live/LiveChannelEditor.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "1"], @@ -6891,9 +6679,6 @@ exports[`better eslint`] = { "public/app/plugins/panel/logs/LogsPanel.test.tsx:5381": [ [0, 0, 0, "* import is invalid because \'Layout,HorizontalGroup,VerticalGroup\' from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"] ], - "public/app/plugins/panel/logs/LogsPanel.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/datetime/rangeutil\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/plugins/panel/logs/types.ts:5381": [ [0, 0, 0, "Do not re-export imported variable (\`./panelcfg.gen\`)", "0"] ], @@ -6927,9 +6712,6 @@ exports[`better eslint`] = { "public/app/plugins/panel/stat/StatMigrations.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], - "public/app/plugins/panel/stat/StatPanel.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/field/fieldOverrides\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/plugins/panel/state-timeline/migrations.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"] @@ -6938,11 +6720,10 @@ exports[`better eslint`] = { [0, 0, 0, "\'VerticalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"] ], "public/app/plugins/panel/table/migrations.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/reduce\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], + [0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"], [0, 0, 0, "Unexpected any. Specify a different type.", "2"], - [0, 0, 0, "Unexpected any. Specify a different type.", "3"], - [0, 0, 0, "Unexpected any. Specify a different type.", "4"] + [0, 0, 0, "Unexpected any. Specify a different type.", "3"] ], "public/app/plugins/panel/text/textPanelMigrationHandler.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] @@ -6981,31 +6762,17 @@ exports[`better eslint`] = { [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"] ], - "public/app/plugins/panel/timeseries/utils.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/convertFieldType\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/nulls/nullInsertThreshold\' import is restricted from being used by a pattern. Import from the public export instead.", "1"], - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/nulls/nullToValue\' import is restricted from being used by a pattern. Import from the public export instead.", "2"] - ], - "public/app/plugins/panel/trend/TrendPanel.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/transformations/transformers/joinDataFrames\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/plugins/panel/xychart/SeriesEditor.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "1"], [0, 0, 0, "Do not use any type assertions.", "2"], [0, 0, 0, "Do not use any type assertions.", "3"] ], - "public/app/plugins/panel/xychart/XYChartPanel.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/themes/colorManipulator\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], - "public/app/plugins/panel/xychart/XYChartTooltip.tsx:5381": [ - [0, 0, 0, "\'@grafana/data/src/themes/colorManipulator\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] - ], "public/app/plugins/panel/xychart/migrations.ts:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] ], "public/app/plugins/panel/xychart/scatter.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/themes/colorManipulator\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], + [0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "1"], [0, 0, 0, "Do not use any type assertions.", "2"], [0, 0, 0, "Do not use any type assertions.", "3"], @@ -7019,14 +6786,10 @@ exports[`better eslint`] = { [0, 0, 0, "Do not use any type assertions.", "11"], [0, 0, 0, "Do not use any type assertions.", "12"], [0, 0, 0, "Do not use any type assertions.", "13"], - [0, 0, 0, "Do not use any type assertions.", "14"], + [0, 0, 0, "Unexpected any. Specify a different type.", "14"], [0, 0, 0, "Unexpected any. Specify a different type.", "15"], [0, 0, 0, "Unexpected any. Specify a different type.", "16"], - [0, 0, 0, "Unexpected any. Specify a different type.", "17"], - [0, 0, 0, "Unexpected any. Specify a different type.", "18"] - ], - "public/app/plugins/panel/xychart/utils.ts:5381": [ - [0, 0, 0, "\'@grafana/data/src/field/fieldState\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] + [0, 0, 0, "Unexpected any. Specify a different type.", "17"] ], "public/app/plugins/sdk.ts:5381": [ [0, 0, 0, "Do not re-export imported variable (\`loadPluginCss\`)", "0"] diff --git a/packages/grafana-data/package.json b/packages/grafana-data/package.json index 82a8a8c46f9..5c1c72c6947 100644 --- a/packages/grafana-data/package.json +++ b/packages/grafana-data/package.json @@ -15,6 +15,26 @@ }, "main": "src/index.ts", "types": "src/index.ts", + "module": "src/index.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "import": "./src/index.ts", + "require": "./src/index.ts" + }, + "./internal": { + "import": "./src/internal/index.ts", + "require": "./src/internal/index.ts" + }, + "./unstable": { + "import": "./src/unstable.ts", + "require": "./src/unstable.ts" + }, + "./test": { + "import": "./test/index.ts", + "require": "./test/index.ts" + } + }, "publishConfig": { "main": "./dist/cjs/index.cjs", "module": "./dist/esm/index.mjs", diff --git a/packages/grafana-data/src/internal/index.ts b/packages/grafana-data/src/internal/index.ts new file mode 100644 index 00000000000..c0e52d01c67 --- /dev/null +++ b/packages/grafana-data/src/internal/index.ts @@ -0,0 +1,100 @@ +/** + * This file is used to share internal grafana/data code with Grafana core. + * Note that these exports are also used within Enterprise. + * + * Through the exports declared in package.json we can import this code in core Grafana and the grafana/data + * package will continue to be able to access all code when it's published to npm as it's private to the package. + * + * During the yarn pack lifecycle the exports[./internal] property is deleted from the package.json + * preventing the code from being importable by plugins or other npm packages making it truly "internal". + * + */ + +export { actionsOverrideProcessor } from '../field/overrides/processors'; +export { nullToUndefThreshold } from '../transformations/transformers/nulls/nullToUndefThreshold'; +export { applyNullInsertThreshold } from '../transformations/transformers/nulls/nullInsertThreshold'; +export { + NULL_EXPAND, + NULL_REMOVE, + NULL_RETAIN, + isLikelyAscendingVector, + maybeSortFrame, +} from '../transformations/transformers/joinDataFrames'; +export { ConcatenateFrameNameMode, type ConcatenateTransformerOptions } from '../transformations/transformers/concat'; +export { + type ConvertFieldTypeOptions, + type ConvertFieldTypeTransformerOptions, + convertFieldType, +} from '../transformations/transformers/convertFieldType'; +export { type FilterFieldsByNameTransformerOptions } from '../transformations/transformers/filterByName'; +export { type FilterFramesByRefIdTransformerOptions } from '../transformations/transformers/filterByRefId'; +export { FormatStringOutput, type FormatStringTransformerOptions } from '../transformations/transformers/formatString'; +export { organizeFieldsTransformer } from '../transformations/transformers/organize'; +export { labelsToFieldsTransformer } from '../transformations/transformers/labelsToFields'; +export { type FormatTimeTransformerOptions } from '../transformations/transformers/formatTime'; +export { + type GroupByFieldOptions, + GroupByOperationID, + type GroupByTransformerOptions, +} from '../transformations/transformers/groupBy'; +export { + type GroupToNestedTableTransformerOptions, + SHOW_NESTED_HEADERS_DEFAULT, +} from '../transformations/transformers/groupToNestedTable'; +export { + type BinaryValue, + type BinaryOptions, + CalculateFieldMode, + type CalculateFieldTransformerOptions, + getNameFromOptions, + defaultWindowOptions, + checkBinaryValueType, + type CumulativeOptions, + type ReduceOptions, + type UnaryOptions, + WindowAlignment, + type WindowOptions, + WindowSizeMode, +} from '../transformations/transformers/calculateField'; +export { type SeriesToRowsTransformerOptions } from '../transformations/transformers/seriesToRows'; +export { histogramFieldInfo, type HistogramTransformerInputs } from '../transformations/transformers/histogram'; +export { type JoinByFieldOptions, JoinMode } from '../transformations/transformers/joinByField'; +export { LabelsToFieldsMode, type LabelsToFieldsOptions } from '../transformations/transformers/labelsToFields'; +export { type LimitTransformerOptions } from '../transformations/transformers/limit'; +export { type MergeTransformerOptions } from '../transformations/transformers/merge'; +export { ReduceTransformerMode, type ReduceTransformerOptions } from '../transformations/transformers/reduce'; +export { createOrderFieldsComparer } from '../transformations/transformers/order'; +export { type RenameByRegexTransformerOptions } from '../transformations/transformers/renameByRegex'; +export { type OrganizeFieldsTransformerOptions } from '../transformations/transformers/organize'; +export { compareValues } from '../transformations/matchers/compareValues'; +export { + type SortByField, + type SortByTransformerOptions, + sortByTransformer, +} from '../transformations/transformers/sortBy'; +export { type TransposeTransformerOptions } from '../transformations/transformers/transpose'; +export { + type FilterByValueTransformerOptions, + FilterByValueMatch, + FilterByValueType, + type FilterByValueFilter, +} from '../transformations/transformers/filterByValue'; +export { getMatcherConfig } from '../transformations/transformers/filterByName'; +export { mockTransformationsRegistry } from '../utils/tests/mockTransformationsRegistry'; +export { noopTransformer } from '../transformations/transformers/noop'; +export { DataTransformerID } from '../transformations/transformers/ids'; + +export { mergeTransformer } from '../transformations/transformers/merge'; +export { getThemeById } from '../themes/registry'; +export { GrafanaEdition } from '../types/config'; +export { SIPrefix } from '../valueFormats/symbolFormatters'; + +export { type PluginAddedLinksConfigureFunc, type PluginExtensionEventHelpers } from '../types/pluginExtensions'; + +export { getStreamingFrameOptions } from '../dataframe/StreamingDataFrame'; +export { fieldIndexComparer } from '../field/fieldComparers'; +export { decoupleHideFromState } from '../field/fieldState'; +export { findNumericFieldMinMax } from '../field/fieldOverrides'; +export { type PanelOptionsSupplier } from '../panel/PanelPlugin'; +export { sanitize, sanitizeUrl } from '../text/sanitize'; +export { type NestedValueAccess, type NestedPanelOptions, isNestedPanelOptions } from '../utils/OptionsUIBuilders'; diff --git a/packages/grafana-data/src/panel/getPanelOptionsWithDefaults.test.ts b/packages/grafana-data/src/panel/getPanelOptionsWithDefaults.test.ts index 01b42612f1d..f155696053d 100644 --- a/packages/grafana-data/src/panel/getPanelOptionsWithDefaults.test.ts +++ b/packages/grafana-data/src/panel/getPanelOptionsWithDefaults.test.ts @@ -11,8 +11,7 @@ import { ThresholdsMode, } from '@grafana/data'; -import { getPanelPlugin } from '../../test/__mocks__/pluginMocks'; -import { mockStandardFieldConfigOptions } from '../../test/helpers/fieldConfig'; +import { getPanelPlugin, mockStandardFieldConfigOptions } from '../../test'; import { getPanelOptionsWithDefaults, restoreCustomOverrideRules } from './getPanelOptionsWithDefaults'; diff --git a/packages/grafana-data/test/__mocks__/pluginMocks.ts b/packages/grafana-data/test/helpers/pluginMocks.ts similarity index 100% rename from packages/grafana-data/test/__mocks__/pluginMocks.ts rename to packages/grafana-data/test/helpers/pluginMocks.ts diff --git a/packages/grafana-data/test/index.ts b/packages/grafana-data/test/index.ts new file mode 100644 index 00000000000..c6f6494b213 --- /dev/null +++ b/packages/grafana-data/test/index.ts @@ -0,0 +1,2 @@ +export { getMockPlugin, getMockPlugins, getPanelPlugin } from './helpers/pluginMocks'; +export { mockStandardFieldConfigOptions } from './helpers/fieldConfig'; diff --git a/packages/grafana-prometheus/src/querybuilder/operationUtils.ts b/packages/grafana-prometheus/src/querybuilder/operationUtils.ts index bf5bc98c0ad..36b9a3f6bd8 100644 --- a/packages/grafana-prometheus/src/querybuilder/operationUtils.ts +++ b/packages/grafana-prometheus/src/querybuilder/operationUtils.ts @@ -2,7 +2,7 @@ import { capitalize } from 'lodash'; import pluralize from 'pluralize'; -import { SelectableValue } from '@grafana/data/src'; +import { SelectableValue } from '@grafana/data'; import { LabelParamEditor } from './components/LabelParamEditor'; import { diff --git a/public/app/core/components/GraphNG/utils.ts b/public/app/core/components/GraphNG/utils.ts index b0c4368f3bb..34757b4d81a 100644 --- a/public/app/core/components/GraphNG/utils.ts +++ b/public/app/core/components/GraphNG/utils.ts @@ -1,7 +1,5 @@ -import { DataFrame, Field, FieldType, outerJoinDataFrames, TimeRange } from '@grafana/data'; -import { NULL_EXPAND, NULL_REMOVE, NULL_RETAIN } from '@grafana/data/src/transformations/transformers/joinDataFrames'; -import { applyNullInsertThreshold } from '@grafana/data/src/transformations/transformers/nulls/nullInsertThreshold'; -import { nullToUndefThreshold } from '@grafana/data/src/transformations/transformers/nulls/nullToUndefThreshold'; +import { DataFrame, Field, FieldType, outerJoinDataFrames, TimeRange, applyNullInsertThreshold } from '@grafana/data'; +import { NULL_EXPAND, NULL_REMOVE, NULL_RETAIN, nullToUndefThreshold } from '@grafana/data/internal'; import { GraphDrawStyle } from '@grafana/schema'; import { XYFieldMatchers } from './types'; diff --git a/public/app/core/components/OptionsUI/registry.tsx b/public/app/core/components/OptionsUI/registry.tsx index da20681e556..d1c51c96de8 100644 --- a/public/app/core/components/OptionsUI/registry.tsx +++ b/public/app/core/components/OptionsUI/registry.tsx @@ -29,7 +29,7 @@ import { Action, DataLinksFieldConfigSettings, } from '@grafana/data'; -import { actionsOverrideProcessor } from '@grafana/data/src/field/overrides/processors'; +import { actionsOverrideProcessor } from '@grafana/data/internal'; import { FieldConfig } from '@grafana/schema'; import { RadioButtonGroup, TimeZonePicker, Switch } from '@grafana/ui'; import { FieldNamePicker } from '@grafana/ui/internal'; diff --git a/public/app/core/components/TimelineChart/timeline.ts b/public/app/core/components/TimelineChart/timeline.ts index 68acea164f6..8fa0a8faef1 100644 --- a/public/app/core/components/TimelineChart/timeline.ts +++ b/public/app/core/components/TimelineChart/timeline.ts @@ -1,7 +1,6 @@ import uPlot, { Series } from 'uplot'; -import { GrafanaTheme2, TimeRange } from '@grafana/data'; -import { alpha } from '@grafana/data/src/themes/colorManipulator'; +import { GrafanaTheme2, TimeRange, colorManipulator } from '@grafana/data'; import { TimelineValueAlignment, VisibilityMode } from '@grafana/schema'; import { FIXED_UNIT } from '@grafana/ui'; import { distribute, SPACE_BETWEEN } from 'app/plugins/panel/barchart/distribute'; @@ -533,5 +532,5 @@ function getFillColor(fieldConfig: { fillOpacity?: number; lineWidth?: number }, } const opacityPercent = (fieldConfig.fillOpacity ?? 100) / 100; - return alpha(color, opacityPercent); + return colorManipulator.alpha(color, opacityPercent); } diff --git a/public/app/core/components/TimelineChart/utils.ts b/public/app/core/components/TimelineChart/utils.ts index bf38c4bc5c5..a9af674a839 100644 --- a/public/app/core/components/TimelineChart/utils.ts +++ b/public/app/core/components/TimelineChart/utils.ts @@ -18,10 +18,10 @@ import { outerJoinDataFrames, ValueMapping, ThresholdsConfig, + applyNullInsertThreshold, + nullToValue, } from '@grafana/data'; -import { maybeSortFrame, NULL_RETAIN } from '@grafana/data/src/transformations/transformers/joinDataFrames'; -import { applyNullInsertThreshold } from '@grafana/data/src/transformations/transformers/nulls/nullInsertThreshold'; -import { nullToValue } from '@grafana/data/src/transformations/transformers/nulls/nullToValue'; +import { maybeSortFrame, NULL_RETAIN } from '@grafana/data/internal'; import { VizLegendOptions, AxisPlacement, diff --git a/public/app/core/services/echo/backends/grafana-javascript-agent/GrafanaJavascriptAgentBackend.test.ts b/public/app/core/services/echo/backends/grafana-javascript-agent/GrafanaJavascriptAgentBackend.test.ts index 5ee5b184736..ca92345ccac 100644 --- a/public/app/core/services/echo/backends/grafana-javascript-agent/GrafanaJavascriptAgentBackend.test.ts +++ b/public/app/core/services/echo/backends/grafana-javascript-agent/GrafanaJavascriptAgentBackend.test.ts @@ -1,5 +1,5 @@ import { BuildInfo } from '@grafana/data'; -import { GrafanaEdition } from '@grafana/data/src/types/config'; +import { GrafanaEdition } from '@grafana/data/internal'; import { Faro, Instrumentation } from '@grafana/faro-core'; import * as faroWebSdkModule from '@grafana/faro-web-sdk'; import { BrowserConfig, FetchTransport } from '@grafana/faro-web-sdk'; diff --git a/public/app/core/services/theme.ts b/public/app/core/services/theme.ts index b244b95e012..30d63375f6b 100644 --- a/public/app/core/services/theme.ts +++ b/public/app/core/services/theme.ts @@ -1,4 +1,4 @@ -import { getThemeById } from '@grafana/data/src/themes/registry'; +import { getThemeById } from '@grafana/data/internal'; import { ThemeChangedEvent } from '@grafana/runtime'; import appEvents from '../app_events'; diff --git a/public/app/core/utils/explore.test.ts b/public/app/core/utils/explore.test.ts index 76da92421a9..011380fed79 100644 --- a/public/app/core/utils/explore.test.ts +++ b/public/app/core/utils/explore.test.ts @@ -1,5 +1,12 @@ -import { DataSourceApi, dateTime, ExploreUrlState, GrafanaConfig, locationUtil, LogsSortOrder } from '@grafana/data'; -import { serializeStateToUrlParam } from '@grafana/data/src/utils/url'; +import { + DataSourceApi, + dateTime, + ExploreUrlState, + GrafanaConfig, + locationUtil, + LogsSortOrder, + serializeStateToUrlParam, +} from '@grafana/data'; import { config } from '@grafana/runtime'; import { DataQuery } from '@grafana/schema'; import { RefreshPicker } from '@grafana/ui'; diff --git a/public/app/core/utils/richHistory.ts b/public/app/core/utils/richHistory.ts index b99a16f5ceb..8816613a51b 100644 --- a/public/app/core/utils/richHistory.ts +++ b/public/app/core/utils/richHistory.ts @@ -1,7 +1,13 @@ import { omit } from 'lodash'; -import { DataQuery, DataSourceApi, dateTimeFormat, ExploreUrlState, urlUtil } from '@grafana/data'; -import { serializeStateToUrlParam } from '@grafana/data/src/utils/url'; +import { + DataQuery, + DataSourceApi, + dateTimeFormat, + ExploreUrlState, + urlUtil, + serializeStateToUrlParam, +} from '@grafana/data'; import { getDataSourceSrv } from '@grafana/runtime'; import { notifyApp } from 'app/core/actions'; import { createErrorNotification, createWarningNotification } from 'app/core/copy/appNotification'; diff --git a/public/app/features/admin/UserListPublicDashboardPage/DashboardsListModalButton.tsx b/public/app/features/admin/UserListPublicDashboardPage/DashboardsListModalButton.tsx index cc0284d753d..87d3b1fe591 100644 --- a/public/app/features/admin/UserListPublicDashboardPage/DashboardsListModalButton.tsx +++ b/public/app/features/admin/UserListPublicDashboardPage/DashboardsListModalButton.tsx @@ -1,6 +1,6 @@ import { css, cx } from '@emotion/css'; -import { GrafanaTheme2 } from '@grafana/data/src'; +import { GrafanaTheme2 } from '@grafana/data'; import { selectors as e2eSelectors } from '@grafana/e2e-selectors/src'; import { config } from '@grafana/runtime'; import { Button, LoadingPlaceholder, Modal, ModalsController, useStyles2 } from '@grafana/ui'; diff --git a/public/app/features/admin/UserListPublicDashboardPage/DeleteUserModalButton.tsx b/public/app/features/admin/UserListPublicDashboardPage/DeleteUserModalButton.tsx index 1ca1f8d6656..fa33265f205 100644 --- a/public/app/features/admin/UserListPublicDashboardPage/DeleteUserModalButton.tsx +++ b/public/app/features/admin/UserListPublicDashboardPage/DeleteUserModalButton.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/css'; -import { GrafanaTheme2 } from '@grafana/data/src'; +import { GrafanaTheme2 } from '@grafana/data'; import { config } from '@grafana/runtime'; import { Button, Modal, ModalsController, useStyles2 } from '@grafana/ui'; import { Trans, t } from 'app/core/internationalization'; diff --git a/public/app/features/alerting/unified/GrafanaRuleQueryViewer.tsx b/public/app/features/alerting/unified/GrafanaRuleQueryViewer.tsx index b591ece380d..b7946517a41 100644 --- a/public/app/features/alerting/unified/GrafanaRuleQueryViewer.tsx +++ b/public/app/features/alerting/unified/GrafanaRuleQueryViewer.tsx @@ -2,8 +2,7 @@ import { css, cx } from '@emotion/css'; import { keyBy, startCase, uniqueId } from 'lodash'; import * as React from 'react'; -import { DataSourceInstanceSettings, GrafanaTheme2, PanelData, urlUtil } from '@grafana/data'; -import { secondsToHms } from '@grafana/data/src/datetime/rangeutil'; +import { DataSourceInstanceSettings, GrafanaTheme2, PanelData, rangeUtil, urlUtil } from '@grafana/data'; import { config } from '@grafana/runtime'; import { DataSourceRef } from '@grafana/schema'; import { Preview } from '@grafana/sql/src/components/visual-query-builder/Preview'; @@ -123,7 +122,7 @@ export function QueryPreview({ if (relativeTimeRange) { headerItems.push( - {secondsToHms(relativeTimeRange.from)} to now + {rangeUtil.secondsToHms(relativeTimeRange.from)} to now ); } diff --git a/public/app/features/alerting/unified/components/GrafanaAlertmanagerDeliveryWarning.tsx b/public/app/features/alerting/unified/components/GrafanaAlertmanagerDeliveryWarning.tsx index 239de85bd2d..b16c50bbb44 100644 --- a/public/app/features/alerting/unified/components/GrafanaAlertmanagerDeliveryWarning.tsx +++ b/public/app/features/alerting/unified/components/GrafanaAlertmanagerDeliveryWarning.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/css'; -import { GrafanaTheme2 } from '@grafana/data/src'; +import { GrafanaTheme2 } from '@grafana/data'; import { Alert, useStyles2 } from '@grafana/ui'; import { AlertmanagerChoice } from '../../../../plugins/datasource/alertmanager/types'; diff --git a/public/app/features/alerting/unified/components/rule-editor/CloudAlertPreview.tsx b/public/app/features/alerting/unified/components/rule-editor/CloudAlertPreview.tsx index a9d67203d14..b2fa4fa8297 100644 --- a/public/app/features/alerting/unified/components/rule-editor/CloudAlertPreview.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/CloudAlertPreview.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/css'; -import { DataFrame, GrafanaTheme2 } from '@grafana/data/src'; +import { DataFrame, GrafanaTheme2 } from '@grafana/data'; import { Icon, TagList, Tooltip, useStyles2 } from '@grafana/ui'; import { labelsToTags } from '../../utils/labels'; diff --git a/public/app/features/alerting/unified/components/rule-editor/DashboardPicker.tsx b/public/app/features/alerting/unified/components/rule-editor/DashboardPicker.tsx index 14eea33da9d..4428ba2e1a9 100644 --- a/public/app/features/alerting/unified/components/rule-editor/DashboardPicker.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/DashboardPicker.tsx @@ -5,7 +5,7 @@ import { useDebounce } from 'react-use'; import AutoSizer from 'react-virtualized-auto-sizer'; import { FixedSizeList } from 'react-window'; -import { GrafanaTheme2 } from '@grafana/data/src'; +import { GrafanaTheme2 } from '@grafana/data'; import { Alert, Button, diff --git a/public/app/features/alerting/unified/components/rule-editor/QueryOptions.tsx b/public/app/features/alerting/unified/components/rule-editor/QueryOptions.tsx index 1a046f8e2a3..215ae1d3646 100644 --- a/public/app/features/alerting/unified/components/rule-editor/QueryOptions.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/QueryOptions.tsx @@ -1,8 +1,7 @@ import { css } from '@emotion/css'; import { useState } from 'react'; -import { GrafanaTheme2, RelativeTimeRange, dateTime, getDefaultRelativeTimeRange } from '@grafana/data'; -import { relativeToTimeRange } from '@grafana/data/src/datetime/rangeutil'; +import { GrafanaTheme2, RelativeTimeRange, dateTime, getDefaultRelativeTimeRange, rangeUtil } from '@grafana/data'; import { Icon, InlineField, RelativeTimeRangePicker, Toggletip, clearButtonStyles, useStyles2 } from '@grafana/ui'; import { AlertQuery } from 'app/types/unified-alerting-dto'; @@ -27,7 +26,7 @@ export const QueryOptions = ({ const [showOptions, setShowOptions] = useState(false); - const timeRange = query.relativeTimeRange ? relativeToTimeRange(query.relativeTimeRange) : undefined; + const timeRange = query.relativeTimeRange ? rangeUtil.relativeToTimeRange(query.relativeTimeRange) : undefined; return ( <> diff --git a/public/app/features/alerting/unified/components/rule-editor/rule-types/RuleTypePicker.tsx b/public/app/features/alerting/unified/components/rule-editor/rule-types/RuleTypePicker.tsx index ab41cd3121f..17cbdcfcd6e 100644 --- a/public/app/features/alerting/unified/components/rule-editor/rule-types/RuleTypePicker.tsx +++ b/public/app/features/alerting/unified/components/rule-editor/rule-types/RuleTypePicker.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/css'; import { isEmpty } from 'lodash'; -import { GrafanaTheme2 } from '@grafana/data/src'; +import { GrafanaTheme2 } from '@grafana/data'; import { Stack, useStyles2 } from '@grafana/ui'; import { useRulesSourcesWithRuler } from '../../../hooks/useRuleSourcesWithRuler'; diff --git a/public/app/features/alerting/unified/components/rules/AlertInstanceStateFilter.tsx b/public/app/features/alerting/unified/components/rules/AlertInstanceStateFilter.tsx index 97cf310a478..29afb21fa2c 100644 --- a/public/app/features/alerting/unified/components/rules/AlertInstanceStateFilter.tsx +++ b/public/app/features/alerting/unified/components/rules/AlertInstanceStateFilter.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/css'; import { capitalize } from 'lodash'; -import { GrafanaTheme2 } from '@grafana/data/src'; +import { GrafanaTheme2 } from '@grafana/data'; import { Label, RadioButtonGroup, Tag, useStyles2 } from '@grafana/ui'; import { GrafanaAlertState, PromAlertingRuleState } from 'app/types/unified-alerting-dto'; diff --git a/public/app/features/alerting/unified/components/rules/RuleConfigStatus.tsx b/public/app/features/alerting/unified/components/rules/RuleConfigStatus.tsx index 8b10c1388bf..ed3f96dc960 100644 --- a/public/app/features/alerting/unified/components/rules/RuleConfigStatus.tsx +++ b/public/app/features/alerting/unified/components/rules/RuleConfigStatus.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/css'; import { useMemo } from 'react'; -import { GrafanaTheme2 } from '@grafana/data/src'; +import { GrafanaTheme2 } from '@grafana/data'; import { config } from '@grafana/runtime/src'; import { Icon, Tooltip, useStyles2 } from '@grafana/ui'; diff --git a/public/app/features/alerting/unified/components/rules/central-state-history/utils.ts b/public/app/features/alerting/unified/components/rules/central-state-history/utils.ts index 21b2548dac9..d78688c1ab8 100644 --- a/public/app/features/alerting/unified/components/rules/central-state-history/utils.ts +++ b/public/app/features/alerting/unified/components/rules/central-state-history/utils.ts @@ -11,7 +11,7 @@ import { ThresholdsMode, getDisplayProcessor, } from '@grafana/data'; -import { fieldIndexComparer } from '@grafana/data/src/field/fieldComparers'; +import { fieldIndexComparer } from '@grafana/data/internal'; import { mapStateWithReasonToBaseState } from 'app/types/unified-alerting-dto'; import { labelsMatchMatchers } from '../../../utils/alertmanager'; diff --git a/public/app/features/alerting/unified/components/rules/state-history/useRuleHistoryRecords.tsx b/public/app/features/alerting/unified/components/rules/state-history/useRuleHistoryRecords.tsx index 9f18e9bea2c..613938eebb5 100644 --- a/public/app/features/alerting/unified/components/rules/state-history/useRuleHistoryRecords.tsx +++ b/public/app/features/alerting/unified/components/rules/state-history/useRuleHistoryRecords.tsx @@ -9,7 +9,7 @@ import { GrafanaTheme2, getDisplayProcessor, } from '@grafana/data'; -import { fieldIndexComparer } from '@grafana/data/src/field/fieldComparers'; +import { fieldIndexComparer } from '@grafana/data/internal'; import { MappingType, ThresholdsMode } from '@grafana/schema'; import { useTheme2 } from '@grafana/ui'; diff --git a/public/app/features/alerting/unified/home/PluginIntegrations.tsx b/public/app/features/alerting/unified/home/PluginIntegrations.tsx index f07a0738934..4a7d560da38 100644 --- a/public/app/features/alerting/unified/home/PluginIntegrations.tsx +++ b/public/app/features/alerting/unified/home/PluginIntegrations.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/css'; -import { GrafanaTheme2 } from '@grafana/data/'; +import { GrafanaTheme2 } from '@grafana/data'; import { Stack, Text, useStyles2 } from '@grafana/ui'; import { useAlertingHomePageExtensions } from '../plugins/useAlertingHomePageExtensions'; diff --git a/public/app/features/alerting/unified/styles/pagination.ts b/public/app/features/alerting/unified/styles/pagination.ts index f3d92f70662..0a16b5ce7ee 100644 --- a/public/app/features/alerting/unified/styles/pagination.ts +++ b/public/app/features/alerting/unified/styles/pagination.ts @@ -1,6 +1,6 @@ import { css } from '@emotion/css'; -import { GrafanaTheme2 } from '@grafana/data/src'; +import { GrafanaTheme2 } from '@grafana/data'; export const getPaginationStyles = (theme: GrafanaTheme2) => { return css({ diff --git a/public/app/features/alerting/unified/utils/misc.ts b/public/app/features/alerting/unified/utils/misc.ts index c136c2aa883..686194d24c6 100644 --- a/public/app/features/alerting/unified/utils/misc.ts +++ b/public/app/features/alerting/unified/utils/misc.ts @@ -1,7 +1,7 @@ import { sortBy } from 'lodash'; import { Labels, UrlQueryMap } from '@grafana/data'; -import { GrafanaEdition } from '@grafana/data/src/types/config'; +import { GrafanaEdition } from '@grafana/data/internal'; import { config, isFetchError } from '@grafana/runtime'; import { DataSourceRef } from '@grafana/schema'; import { contextSrv } from 'app/core/services/context_srv'; diff --git a/public/app/features/alerting/unified/utils/routeTree.ts b/public/app/features/alerting/unified/utils/routeTree.ts index 6aa80dcb030..ba08bfd7526 100644 --- a/public/app/features/alerting/unified/utils/routeTree.ts +++ b/public/app/features/alerting/unified/utils/routeTree.ts @@ -5,7 +5,7 @@ import { produce } from 'immer'; import { omit } from 'lodash'; -import { insertAfterImmutably, insertBeforeImmutably } from '@grafana/data/src/utils/arrayUtils'; +import { arrayUtils } from '@grafana/data'; import { ROUTES_META_SYMBOL, Route, RouteWithID } from 'app/plugins/datasource/alertmanager/types'; import { @@ -109,12 +109,12 @@ export const addRouteToReferenceRoute = ( // insert new policy before / above the referenceRoute if (position === 'above') { - parentRoute.routes = insertBeforeImmutably(parentRoute.routes ?? [], newRoute, positionInParent); + parentRoute.routes = arrayUtils.insertBeforeImmutably(parentRoute.routes ?? [], newRoute, positionInParent); } // insert new policy after / below the referenceRoute if (position === 'below') { - parentRoute.routes = insertAfterImmutably(parentRoute.routes ?? [], newRoute, positionInParent); + parentRoute.routes = arrayUtils.insertAfterImmutably(parentRoute.routes ?? [], newRoute, positionInParent); } }); }; diff --git a/public/app/features/alerting/unified/utils/time.ts b/public/app/features/alerting/unified/utils/time.ts index a34dc0ffdad..51da3a10e71 100644 --- a/public/app/features/alerting/unified/utils/time.ts +++ b/public/app/features/alerting/unified/utils/time.ts @@ -1,4 +1,4 @@ -import { describeInterval } from '@grafana/data/src/datetime/rangeutil'; +import { rangeUtil } from '@grafana/data'; import { TimeOptions } from '../types/time'; @@ -18,7 +18,7 @@ export function parseInterval(value: string): [number, string] { } export function intervalToSeconds(interval: string): number { - const { sec, count } = describeInterval(interval); + const { sec, count } = rangeUtil.describeInterval(interval); return sec * count; } diff --git a/public/app/features/annotations/components/StandardAnnotationQueryEditor.test.tsx b/public/app/features/annotations/components/StandardAnnotationQueryEditor.test.tsx index c347a069369..c4126cb6aa1 100644 --- a/public/app/features/annotations/components/StandardAnnotationQueryEditor.test.tsx +++ b/public/app/features/annotations/components/StandardAnnotationQueryEditor.test.tsx @@ -1,6 +1,6 @@ import { render } from '@testing-library/react'; -import { AnnotationQuery, DataSourceApi, DataSourceInstanceSettings } from '@grafana/data/src'; +import { AnnotationQuery, DataSourceApi, DataSourceInstanceSettings } from '@grafana/data'; import StandardAnnotationQueryEditor, { Props as EditorProps } from './StandardAnnotationQueryEditor'; diff --git a/public/app/features/auth-config/AuthProvidersListPage.tsx b/public/app/features/auth-config/AuthProvidersListPage.tsx index 46909ed9397..7318db7441c 100644 --- a/public/app/features/auth-config/AuthProvidersListPage.tsx +++ b/public/app/features/auth-config/AuthProvidersListPage.tsx @@ -1,7 +1,7 @@ import { JSX, useEffect, useState } from 'react'; import { connect, ConnectedProps } from 'react-redux'; -import { GrafanaEdition } from '@grafana/data/src/types/config'; +import { GrafanaEdition } from '@grafana/data/internal'; import { reportInteraction } from '@grafana/runtime'; import { Grid, TextLink, ToolbarButton } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; diff --git a/public/app/features/canvas/element.ts b/public/app/features/canvas/element.ts index 1d6c39dba0d..7f987fed873 100644 --- a/public/app/features/canvas/element.ts +++ b/public/app/features/canvas/element.ts @@ -1,7 +1,7 @@ import { ComponentType } from 'react'; import { DataLink, RegistryItem, Action } from '@grafana/data'; -import { PanelOptionsSupplier } from '@grafana/data/src/panel/PanelPlugin'; +import { PanelOptionsSupplier } from '@grafana/data/internal'; import { ColorDimensionConfig, ScaleDimensionConfig } from '@grafana/schema'; import { config } from 'app/core/config'; import { BackgroundConfig, Constraint, LineConfig, Placement } from 'app/plugins/panel/canvas/panelcfg.gen'; diff --git a/public/app/features/canvas/elements/button.tsx b/public/app/features/canvas/elements/button.tsx index eb926056ace..2b70fa66e3a 100644 --- a/public/app/features/canvas/elements/button.tsx +++ b/public/app/features/canvas/elements/button.tsx @@ -1,8 +1,7 @@ import { css } from '@emotion/css'; import { useState } from 'react'; -import { GrafanaTheme2 } from '@grafana/data'; -import { PluginState } from '@grafana/data/src'; +import { GrafanaTheme2, PluginState } from '@grafana/data'; import { TextDimensionMode } from '@grafana/schema'; import { Button, Spinner, useStyles2 } from '@grafana/ui'; import { DimensionContext } from 'app/features/dimensions/context'; diff --git a/public/app/features/canvas/types.ts b/public/app/features/canvas/types.ts index 1dd3f298e7a..50b926779a6 100644 --- a/public/app/features/canvas/types.ts +++ b/public/app/features/canvas/types.ts @@ -1,4 +1,4 @@ -import { LinkModel } from '@grafana/data/src'; +import { LinkModel } from '@grafana/data'; import { ColorDimensionConfig, ResourceDimensionConfig, TextDimensionConfig } from '@grafana/schema'; import { BackgroundImageSize } from 'app/plugins/panel/canvas/panelcfg.gen'; diff --git a/public/app/features/dashboard-scene/inspect/HelpWizard/HelpWizard.test.tsx b/public/app/features/dashboard-scene/inspect/HelpWizard/HelpWizard.test.tsx index 276c71f61dd..be4fbbb8692 100644 --- a/public/app/features/dashboard-scene/inspect/HelpWizard/HelpWizard.test.tsx +++ b/public/app/features/dashboard-scene/inspect/HelpWizard/HelpWizard.test.tsx @@ -2,7 +2,7 @@ import userEvent from '@testing-library/user-event'; import { render, screen } from 'test/test-utils'; import { FieldType, getDefaultTimeRange, LoadingState, toDataFrame } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { config } from '@grafana/runtime'; import { SceneQueryRunner, SceneTimeRange, VizPanel, VizPanelMenu } from '@grafana/scenes'; import { contextSrv } from 'app/core/services/context_srv'; diff --git a/public/app/features/dashboard-scene/inspect/InspectJsonTab.test.tsx b/public/app/features/dashboard-scene/inspect/InspectJsonTab.test.tsx index 582e0855008..b49a61cd1b8 100644 --- a/public/app/features/dashboard-scene/inspect/InspectJsonTab.test.tsx +++ b/public/app/features/dashboard-scene/inspect/InspectJsonTab.test.tsx @@ -10,7 +10,7 @@ import { standardTransformersRegistry, toDataFrame, } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { setPluginImportUtils, setRunRequest } from '@grafana/runtime'; import { SceneCanvasText, SceneDataTransformer, SceneQueryRunner, VizPanel } from '@grafana/scenes'; import * as libpanels from 'app/features/library-panels/state/api'; diff --git a/public/app/features/dashboard-scene/pages/DashboardScenePage.test.tsx b/public/app/features/dashboard-scene/pages/DashboardScenePage.test.tsx index c9a3cd6937f..8a58e5c8917 100644 --- a/public/app/features/dashboard-scene/pages/DashboardScenePage.test.tsx +++ b/public/app/features/dashboard-scene/pages/DashboardScenePage.test.tsx @@ -6,7 +6,7 @@ import { TestProvider } from 'test/helpers/TestProvider'; import { getGrafanaContextMock } from 'test/mocks/getGrafanaContextMock'; import { PanelProps } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { selectors } from '@grafana/e2e-selectors'; import { LocationServiceProvider, diff --git a/public/app/features/dashboard-scene/pages/PublicDashboardScenePage.test.tsx b/public/app/features/dashboard-scene/pages/PublicDashboardScenePage.test.tsx index a8c109d261b..b5c05c830b8 100644 --- a/public/app/features/dashboard-scene/pages/PublicDashboardScenePage.test.tsx +++ b/public/app/features/dashboard-scene/pages/PublicDashboardScenePage.test.tsx @@ -4,7 +4,7 @@ import { of } from 'rxjs'; import { render } from 'test/test-utils'; import { getDefaultTimeRange, LoadingState, PanelData, PanelProps } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { selectors as e2eSelectors } from '@grafana/e2e-selectors'; import { config, getPluginLinkExtensions, setPluginImportUtils, setRunRequest } from '@grafana/runtime'; import { Dashboard } from '@grafana/schema'; diff --git a/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.test.tsx b/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.test.tsx index f3c58622b27..ba6f6f48461 100644 --- a/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.test.tsx +++ b/public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.test.tsx @@ -16,7 +16,7 @@ import { TimeRange, toDataFrame, } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { selectors } from '@grafana/e2e-selectors'; import { config, locationService, setPluginExtensionsHook } from '@grafana/runtime'; import { PANEL_EDIT_LAST_USED_DATASOURCE } from 'app/features/dashboard/utils/dashboard'; diff --git a/public/app/features/dashboard-scene/panel-edit/PanelEditor.test.ts b/public/app/features/dashboard-scene/panel-edit/PanelEditor.test.ts index fe263ee3bde..ee2bda935fd 100644 --- a/public/app/features/dashboard-scene/panel-edit/PanelEditor.test.ts +++ b/public/app/features/dashboard-scene/panel-edit/PanelEditor.test.ts @@ -1,7 +1,7 @@ import { of } from 'rxjs'; import { DataQueryRequest, DataSourceApi, LoadingState, PanelPlugin } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { CancelActivationHandler, CustomVariable, 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 3f54a519b70..afc761b080b 100644 --- a/public/app/features/dashboard-scene/panel-edit/PanelOptions.test.tsx +++ b/public/app/features/dashboard-scene/panel-edit/PanelOptions.test.tsx @@ -3,7 +3,7 @@ import userEvent from '@testing-library/user-event'; import { render } from 'test/test-utils'; import { standardEditorsRegistry, standardFieldConfigEditorRegistry } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { selectors } from '@grafana/e2e-selectors'; import { VizPanel } from '@grafana/scenes'; import { getAllOptionEditors, getAllStandardFieldConfigs } from 'app/core/components/OptionsUI/registry'; diff --git a/public/app/features/dashboard-scene/scene/DashboardDatasourceBehaviour.test.tsx b/public/app/features/dashboard-scene/scene/DashboardDatasourceBehaviour.test.tsx index 59a27eacaad..55aac56789a 100644 --- a/public/app/features/dashboard-scene/scene/DashboardDatasourceBehaviour.test.tsx +++ b/public/app/features/dashboard-scene/scene/DashboardDatasourceBehaviour.test.tsx @@ -10,7 +10,7 @@ import { LoadingState, PanelData, } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { setPluginImportUtils } from '@grafana/runtime'; import { SceneDataTransformer, SceneFlexLayout, SceneQueryRunner, VizPanel } from '@grafana/scenes'; import { SHARED_DASHBOARD_QUERY, DASHBOARD_DATASOURCE_PLUGIN_ID } from 'app/plugins/datasource/dashboard/constants'; diff --git a/public/app/features/dashboard-scene/scene/DashboardLinksControls.tsx b/public/app/features/dashboard-scene/scene/DashboardLinksControls.tsx index 72a046fc6e5..db7fb59dad7 100644 --- a/public/app/features/dashboard-scene/scene/DashboardLinksControls.tsx +++ b/public/app/features/dashboard-scene/scene/DashboardLinksControls.tsx @@ -1,4 +1,4 @@ -import { sanitizeUrl } from '@grafana/data/src/text/sanitize'; +import { sanitizeUrl } from '@grafana/data/internal'; import { selectors } from '@grafana/e2e-selectors'; import { sceneGraph } from '@grafana/scenes'; import { DashboardLink } from '@grafana/schema'; diff --git a/public/app/features/dashboard-scene/scene/DashboardSceneRenderer.test.tsx b/public/app/features/dashboard-scene/scene/DashboardSceneRenderer.test.tsx index 3f456078a7e..74c91e3037e 100644 --- a/public/app/features/dashboard-scene/scene/DashboardSceneRenderer.test.tsx +++ b/public/app/features/dashboard-scene/scene/DashboardSceneRenderer.test.tsx @@ -1,7 +1,7 @@ import { screen } from '@testing-library/react'; import { render } from 'test/test-utils'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { config, setPluginImportUtils } from '@grafana/runtime'; import { transformSaveModelToScene } from '../serialization/transformSaveModelToScene'; diff --git a/public/app/features/dashboard-scene/scene/LibraryPanelBehavior.test.tsx b/public/app/features/dashboard-scene/scene/LibraryPanelBehavior.test.tsx index b6eb6872566..5d95b292cb4 100644 --- a/public/app/features/dashboard-scene/scene/LibraryPanelBehavior.test.tsx +++ b/public/app/features/dashboard-scene/scene/LibraryPanelBehavior.test.tsx @@ -1,7 +1,7 @@ import { of } from 'rxjs'; import { FieldType, LoadingState, PanelData, getDefaultTimeRange, toDataFrame } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { setPluginImportUtils, setRunRequest } from '@grafana/runtime'; import { SceneCanvasText, sceneGraph, SceneGridLayout, VizPanel } from '@grafana/scenes'; import { LibraryPanel } from '@grafana/schema'; diff --git a/public/app/features/dashboard-scene/scene/PanelMenuBehavior.test.tsx b/public/app/features/dashboard-scene/scene/PanelMenuBehavior.test.tsx index d0aa2f56b9f..182ebac330f 100644 --- a/public/app/features/dashboard-scene/scene/PanelMenuBehavior.test.tsx +++ b/public/app/features/dashboard-scene/scene/PanelMenuBehavior.test.tsx @@ -8,7 +8,7 @@ import { toDataFrame, urlUtil, } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { config, getPluginLinkExtensions, locationService } from '@grafana/runtime'; import { LocalValueVariable, diff --git a/public/app/features/dashboard-scene/scene/layout-default/DashboardGridItem.test.tsx b/public/app/features/dashboard-scene/scene/layout-default/DashboardGridItem.test.tsx index ec13a7992c8..00458d505a9 100644 --- a/public/app/features/dashboard-scene/scene/layout-default/DashboardGridItem.test.tsx +++ b/public/app/features/dashboard-scene/scene/layout-default/DashboardGridItem.test.tsx @@ -1,4 +1,4 @@ -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { setPluginImportUtils } from '@grafana/runtime'; import { SceneGridLayout, SceneVariableSet, TestVariable, VizPanel } from '@grafana/scenes'; import { ALL_VARIABLE_TEXT, ALL_VARIABLE_VALUE } from 'app/features/variables/constants'; diff --git a/public/app/features/dashboard-scene/scene/layout-default/RowRepeaterBehavior.test.tsx b/public/app/features/dashboard-scene/scene/layout-default/RowRepeaterBehavior.test.tsx index 843f58b5640..28effcf18b5 100644 --- a/public/app/features/dashboard-scene/scene/layout-default/RowRepeaterBehavior.test.tsx +++ b/public/app/features/dashboard-scene/scene/layout-default/RowRepeaterBehavior.test.tsx @@ -1,5 +1,5 @@ import { VariableRefresh } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { setPluginImportUtils } from '@grafana/runtime'; import { SceneCanvasText, diff --git a/public/app/features/dashboard-scene/scene/layout-rows/RowItemRepeaterBehavior.test.tsx b/public/app/features/dashboard-scene/scene/layout-rows/RowItemRepeaterBehavior.test.tsx index ec5b4710089..ca967ce3d06 100644 --- a/public/app/features/dashboard-scene/scene/layout-rows/RowItemRepeaterBehavior.test.tsx +++ b/public/app/features/dashboard-scene/scene/layout-rows/RowItemRepeaterBehavior.test.tsx @@ -1,5 +1,5 @@ import { VariableRefresh } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { setPluginImportUtils } from '@grafana/runtime'; import { SceneGridRow, diff --git a/public/app/features/dashboard-scene/serialization/angularMigration.test.ts b/public/app/features/dashboard-scene/serialization/angularMigration.test.ts index cda96b97e9c..a9f63b34cf0 100644 --- a/public/app/features/dashboard-scene/serialization/angularMigration.test.ts +++ b/public/app/features/dashboard-scene/serialization/angularMigration.test.ts @@ -1,5 +1,5 @@ import { PanelTypeChangedHandler } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { getAngularPanelMigrationHandler } from './angularMigration'; diff --git a/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.test.ts b/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.test.ts index e74c3f21664..546c8e95038 100644 --- a/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.test.ts +++ b/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.test.ts @@ -1,5 +1,5 @@ import { LoadingState } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { config } from '@grafana/runtime'; import { AdHocFiltersVariable, diff --git a/public/app/features/dashboard-scene/serialization/transformSceneToSaveModel.test.ts b/public/app/features/dashboard-scene/serialization/transformSceneToSaveModel.test.ts index 9d6061e3c6f..f1ed038dfb5 100644 --- a/public/app/features/dashboard-scene/serialization/transformSceneToSaveModel.test.ts +++ b/public/app/features/dashboard-scene/serialization/transformSceneToSaveModel.test.ts @@ -13,7 +13,7 @@ import { toDataFrame, VariableSupportType, } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { getPluginLinkExtensions, setPluginImportUtils } from '@grafana/runtime'; import { MultiValueVariable, sceneGraph, SceneGridRow, VizPanel } from '@grafana/scenes'; import { Dashboard, LoadingState, Panel, RowPanel, VariableRefresh } from '@grafana/schema'; diff --git a/public/app/features/dashboard-scene/settings/VariablesEditView.test.tsx b/public/app/features/dashboard-scene/settings/VariablesEditView.test.tsx index f3d93596d03..8c5f690518e 100644 --- a/public/app/features/dashboard-scene/settings/VariablesEditView.test.tsx +++ b/public/app/features/dashboard-scene/settings/VariablesEditView.test.tsx @@ -8,7 +8,7 @@ import { getDefaultTimeRange, toDataFrame, } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { setPluginImportUtils, setRunRequest } from '@grafana/runtime'; import { SceneVariableSet, diff --git a/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/ShareExternally.test.tsx b/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/ShareExternally.test.tsx index 07fdec6b6a1..b3c7a22a257 100644 --- a/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/ShareExternally.test.tsx +++ b/public/app/features/dashboard-scene/sharing/ShareButton/share-externally/ShareExternally.test.tsx @@ -2,7 +2,7 @@ import { screen, waitForElementToBeRemoved } from '@testing-library/react'; import { render } from 'test/test-utils'; import { getDefaultTimeRange, LoadingState } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { selectors as e2eSelectors } from '@grafana/e2e-selectors'; import { config, setPluginImportUtils } from '@grafana/runtime'; import { diff --git a/public/app/features/dashboard-scene/sharing/ShareDrawer/ShareDrawer.test.tsx b/public/app/features/dashboard-scene/sharing/ShareDrawer/ShareDrawer.test.tsx index 5e7e71ee6b3..35eaec800d1 100644 --- a/public/app/features/dashboard-scene/sharing/ShareDrawer/ShareDrawer.test.tsx +++ b/public/app/features/dashboard-scene/sharing/ShareDrawer/ShareDrawer.test.tsx @@ -1,7 +1,7 @@ import { act, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { selectors } from '@grafana/e2e-selectors'; import { locationService, setPluginImportUtils } from '@grafana/runtime'; import { SceneTimeRange, UrlSyncContextProvider } from '@grafana/scenes'; diff --git a/public/app/features/dashboard-scene/sharing/ShareLinkTab.test.tsx b/public/app/features/dashboard-scene/sharing/ShareLinkTab.test.tsx index cded7ef3abe..d149d075e02 100644 --- a/public/app/features/dashboard-scene/sharing/ShareLinkTab.test.tsx +++ b/public/app/features/dashboard-scene/sharing/ShareLinkTab.test.tsx @@ -3,7 +3,7 @@ import userEvent from '@testing-library/user-event'; import { advanceTo, clear } from 'jest-date-mock'; import { dateTime } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { selectors } from '@grafana/e2e-selectors'; import { config, locationService, setPluginImportUtils } from '@grafana/runtime'; import { SceneTimeRange, VizPanel } from '@grafana/scenes'; diff --git a/public/app/features/dashboard-scene/sharing/panel-share/SharePanelInternally.test.tsx b/public/app/features/dashboard-scene/sharing/panel-share/SharePanelInternally.test.tsx index ac5daf5eac4..d2cbfaa14f7 100644 --- a/public/app/features/dashboard-scene/sharing/panel-share/SharePanelInternally.test.tsx +++ b/public/app/features/dashboard-scene/sharing/panel-share/SharePanelInternally.test.tsx @@ -1,6 +1,6 @@ import { render, screen } from '@testing-library/react'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { selectors as e2eSelectors } from '@grafana/e2e-selectors'; import { config, setPluginImportUtils } from '@grafana/runtime'; import { SceneTimeRange, VizPanel } from '@grafana/scenes'; diff --git a/public/app/features/dashboard/components/DashboardPrompt/DashboardPrompt.test.tsx b/public/app/features/dashboard/components/DashboardPrompt/DashboardPrompt.test.tsx index 021060699b4..8da1d2bb549 100644 --- a/public/app/features/dashboard/components/DashboardPrompt/DashboardPrompt.test.tsx +++ b/public/app/features/dashboard/components/DashboardPrompt/DashboardPrompt.test.tsx @@ -1,4 +1,4 @@ -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { ContextSrv, setContextSrv } from '../../../../core/services/context_srv'; import { PanelModel } from '../../state/PanelModel'; diff --git a/public/app/features/dashboard/components/HelpWizard/HelpWizard.test.tsx b/public/app/features/dashboard/components/HelpWizard/HelpWizard.test.tsx index 8fdc82a5dd8..2eb805aa87e 100644 --- a/public/app/features/dashboard/components/HelpWizard/HelpWizard.test.tsx +++ b/public/app/features/dashboard/components/HelpWizard/HelpWizard.test.tsx @@ -1,7 +1,7 @@ import { render, screen } from '@testing-library/react'; import { FieldType, getDefaultTimeRange, LoadingState, toDataFrame } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { PanelModel } from '../../state/PanelModel'; diff --git a/public/app/features/dashboard/components/PanelEditor/OptionsPaneOptions.test.tsx b/public/app/features/dashboard/components/PanelEditor/OptionsPaneOptions.test.tsx index 6387aac97a8..91351c87a85 100644 --- a/public/app/features/dashboard/components/PanelEditor/OptionsPaneOptions.test.tsx +++ b/public/app/features/dashboard/components/PanelEditor/OptionsPaneOptions.test.tsx @@ -13,7 +13,7 @@ import { TimeRange, toDataFrame, } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { selectors } from '@grafana/e2e-selectors'; import { getAllOptionEditors, getAllStandardFieldConfigs } from 'app/core/components/OptionsUI/registry'; diff --git a/public/app/features/dashboard/components/PanelEditor/PanelHeaderCorner.tsx b/public/app/features/dashboard/components/PanelEditor/PanelHeaderCorner.tsx index 07936f463b8..7e0edec648b 100644 --- a/public/app/features/dashboard/components/PanelEditor/PanelHeaderCorner.tsx +++ b/public/app/features/dashboard/components/PanelEditor/PanelHeaderCorner.tsx @@ -1,8 +1,7 @@ import { css, cx } from '@emotion/css'; import { Component } from 'react'; -import { renderMarkdown, LinkModelSupplier, ScopedVars, IconName } from '@grafana/data'; -import { GrafanaTheme2 } from '@grafana/data/'; +import { GrafanaTheme2, renderMarkdown, LinkModelSupplier, ScopedVars, IconName } from '@grafana/data'; import { selectors } from '@grafana/e2e-selectors'; import { locationService, getTemplateSrv } from '@grafana/runtime'; import { Tooltip, PopoverContent, Icon, Themeable2, withTheme2, useStyles2 } from '@grafana/ui'; diff --git a/public/app/features/dashboard/components/PanelEditor/getVisualizationOptions.tsx b/public/app/features/dashboard/components/PanelEditor/getVisualizationOptions.tsx index b62d0493c2e..4b003d91c84 100644 --- a/public/app/features/dashboard/components/PanelEditor/getVisualizationOptions.tsx +++ b/public/app/features/dashboard/components/PanelEditor/getVisualizationOptions.tsx @@ -7,13 +7,9 @@ import { PanelPlugin, StandardEditorContext, VariableSuggestionsScope, -} from '@grafana/data'; -import { PanelOptionsSupplier } from '@grafana/data/src/panel/PanelPlugin'; -import { - NestedValueAccess, PanelOptionsEditorBuilder, - isNestedPanelOptions, -} from '@grafana/data/src/utils/OptionsUIBuilders'; +} from '@grafana/data'; +import { NestedValueAccess, isNestedPanelOptions, PanelOptionsSupplier } from '@grafana/data/internal'; import { VizPanel } from '@grafana/scenes'; import { Input } from '@grafana/ui'; import { LibraryVizPanelInfo } from 'app/features/dashboard-scene/panel-edit/LibraryVizPanelInfo'; diff --git a/public/app/features/dashboard/components/PanelEditor/state/actions.test.ts b/public/app/features/dashboard/components/PanelEditor/state/actions.test.ts index b661ef017b8..ab46604bb92 100644 --- a/public/app/features/dashboard/components/PanelEditor/state/actions.test.ts +++ b/public/app/features/dashboard/components/PanelEditor/state/actions.test.ts @@ -1,5 +1,5 @@ import { PanelPlugin } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { LibraryElementDTOMeta } from '@grafana/schema'; import { createDashboardModelFixture } from 'app/features/dashboard/state/__fixtures__/dashboardFixtures'; import { panelModelAndPluginReady, removePanel } from 'app/features/panel/state/reducers'; diff --git a/public/app/features/dashboard/components/PublicDashboardNotAvailable/PublicDashboardNotAvailable.tsx b/public/app/features/dashboard/components/PublicDashboardNotAvailable/PublicDashboardNotAvailable.tsx index 4bf24218d60..e413a750181 100644 --- a/public/app/features/dashboard/components/PublicDashboardNotAvailable/PublicDashboardNotAvailable.tsx +++ b/public/app/features/dashboard/components/PublicDashboardNotAvailable/PublicDashboardNotAvailable.tsx @@ -1,6 +1,6 @@ import { css, cx } from '@emotion/css'; -import { GrafanaTheme2 } from '@grafana/data/src'; +import { GrafanaTheme2 } from '@grafana/data'; import { selectors as e2eSelectors } from '@grafana/e2e-selectors/src'; import { useStyles2 } from '@grafana/ui'; diff --git a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/ConfigPublicDashboard/ConfigPublicDashboard.tsx b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/ConfigPublicDashboard/ConfigPublicDashboard.tsx index b83161aa968..5cf08218411 100644 --- a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/ConfigPublicDashboard/ConfigPublicDashboard.tsx +++ b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/ConfigPublicDashboard/ConfigPublicDashboard.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/css'; import { useForm } from 'react-hook-form'; -import { GrafanaTheme2, TimeRange } from '@grafana/data/src'; +import { GrafanaTheme2, TimeRange } from '@grafana/data'; import { selectors as e2eSelectors } from '@grafana/e2e-selectors/src'; import { Button, diff --git a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/ConfigPublicDashboard/Configuration.tsx b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/ConfigPublicDashboard/Configuration.tsx index eb9a3d8a34f..5156356f470 100644 --- a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/ConfigPublicDashboard/Configuration.tsx +++ b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/ConfigPublicDashboard/Configuration.tsx @@ -1,6 +1,6 @@ import { UseFormRegister } from 'react-hook-form'; -import { TimeRange } from '@grafana/data/src'; +import { TimeRange } from '@grafana/data'; import { selectors as e2eSelectors } from '@grafana/e2e-selectors/src'; import { FieldSet, Label, Switch, TimeRangeInput, Stack, VerticalGroup } from '@grafana/ui'; import { Trans, t } from 'app/core/internationalization'; diff --git a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/CreatePublicDashboard/AcknowledgeCheckboxes.tsx b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/CreatePublicDashboard/AcknowledgeCheckboxes.tsx index 574e289609a..d1913aa3b9f 100644 --- a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/CreatePublicDashboard/AcknowledgeCheckboxes.tsx +++ b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/CreatePublicDashboard/AcknowledgeCheckboxes.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/css'; import { UseFormRegister } from 'react-hook-form'; -import { GrafanaTheme2 } from '@grafana/data/src'; +import { GrafanaTheme2 } from '@grafana/data'; import { selectors as e2eSelectors } from '@grafana/e2e-selectors/src'; import { Checkbox, FieldSet, HorizontalGroup, LinkButton, useStyles2, VerticalGroup } from '@grafana/ui'; import { t, Trans } from 'app/core/internationalization'; diff --git a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/ModalAlerts/UnsupportedDataSourcesAlert.tsx b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/ModalAlerts/UnsupportedDataSourcesAlert.tsx index 3850c5e8b17..1df2bbeac48 100644 --- a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/ModalAlerts/UnsupportedDataSourcesAlert.tsx +++ b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/ModalAlerts/UnsupportedDataSourcesAlert.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/css'; import cx from 'classnames'; -import { GrafanaTheme2 } from '@grafana/data/src'; +import { GrafanaTheme2 } from '@grafana/data'; import { selectors as e2eSelectors } from '@grafana/e2e-selectors/src'; import { config } from '@grafana/runtime'; import { Alert, useStyles2 } from '@grafana/ui'; 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 12d213f8501..9a0357f0626 100644 --- a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboard.test.tsx +++ b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboard.test.tsx @@ -3,7 +3,7 @@ import userEvent from '@testing-library/user-event'; import { http, HttpResponse } from 'msw'; import { setupServer } from 'msw/node'; -import { BootData, DataQuery } from '@grafana/data/src'; +import { BootData, DataQuery } from '@grafana/data'; import { selectors as e2eSelectors } from '@grafana/e2e-selectors/src'; import { reportInteraction, setEchoSrv } from '@grafana/runtime'; import { Panel } from '@grafana/schema'; diff --git a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboard.tsx b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboard.tsx index 8cbfdd8bd57..329e0d5ef08 100644 --- a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboard.tsx +++ b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboard.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/css'; -import { GrafanaTheme2 } from '@grafana/data/src'; +import { GrafanaTheme2 } from '@grafana/data'; import { Spinner, useStyles2 } from '@grafana/ui'; import { useGetPublicDashboardQuery } from 'app/features/dashboard/api/publicDashboardApi'; import { publicDashboardPersisted } from 'app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils'; diff --git a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils.test.tsx b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils.test.tsx index 7a14d0a4e45..6ca108fc542 100644 --- a/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils.test.tsx +++ b/public/app/features/dashboard/components/ShareModal/SharePublicDashboard/SharePublicDashboardUtils.test.tsx @@ -1,5 +1,4 @@ -import { TypedVariableModel } from '@grafana/data'; -import { DataSourceRef, DataQuery } from '@grafana/data/src/types/query'; +import { DataSourceRef, DataQuery, TypedVariableModel } from '@grafana/data'; import { DataSourceWithBackend } from '@grafana/runtime'; import { updateConfig } from 'app/core/config'; import { mockDataSource } from 'app/features/alerting/unified/mocks'; diff --git a/public/app/features/dashboard/components/SubMenu/DashboardLinks.tsx b/public/app/features/dashboard/components/SubMenu/DashboardLinks.tsx index 1fa176900eb..65a7c39b335 100644 --- a/public/app/features/dashboard/components/SubMenu/DashboardLinks.tsx +++ b/public/app/features/dashboard/components/SubMenu/DashboardLinks.tsx @@ -1,6 +1,6 @@ import { useEffectOnce } from 'react-use'; -import { sanitizeUrl } from '@grafana/data/src/text/sanitize'; +import { sanitizeUrl } from '@grafana/data/internal'; import { selectors } from '@grafana/e2e-selectors'; import { TimeRangeUpdatedEvent } from '@grafana/runtime'; import { DashboardLink } from '@grafana/schema'; diff --git a/public/app/features/dashboard/components/SubMenu/DashboardLinksDashboard.tsx b/public/app/features/dashboard/components/SubMenu/DashboardLinksDashboard.tsx index f36232b7b2b..7beb284f28b 100644 --- a/public/app/features/dashboard/components/SubMenu/DashboardLinksDashboard.tsx +++ b/public/app/features/dashboard/components/SubMenu/DashboardLinksDashboard.tsx @@ -3,7 +3,7 @@ import { forwardRef } from 'react'; import { useAsync } from 'react-use'; import { GrafanaTheme2, ScopedVars } from '@grafana/data'; -import { sanitize, sanitizeUrl } from '@grafana/data/src/text/sanitize'; +import { sanitize, sanitizeUrl } from '@grafana/data/internal'; import { selectors } from '@grafana/e2e-selectors'; import { DashboardLink } from '@grafana/schema'; import { Dropdown, Icon, LinkButton, Button, Menu, ScrollContainer, useStyles2 } from '@grafana/ui'; diff --git a/public/app/features/dashboard/state/DashboardMigrator.test.ts b/public/app/features/dashboard/state/DashboardMigrator.test.ts index d2b6715e4a6..b184b5d0922 100644 --- a/public/app/features/dashboard/state/DashboardMigrator.test.ts +++ b/public/app/features/dashboard/state/DashboardMigrator.test.ts @@ -1,7 +1,7 @@ import { each, map } from 'lodash'; import { DataLinkBuiltInVars, MappingType, VariableHide } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { FieldConfigSource } from '@grafana/schema'; import { config } from 'app/core/config'; import { GRID_CELL_HEIGHT, GRID_CELL_VMARGIN } from 'app/core/constants'; diff --git a/public/app/features/dashboard/state/DashboardMigrator.ts b/public/app/features/dashboard/state/DashboardMigrator.ts index e1f6b0a85fa..b595fa3a685 100644 --- a/public/app/features/dashboard/state/DashboardMigrator.ts +++ b/public/app/features/dashboard/state/DashboardMigrator.ts @@ -27,8 +27,7 @@ import { ValueMapping, VariableHide, } from '@grafana/data'; -import { labelsToFieldsTransformer } from '@grafana/data/src/transformations/transformers/labelsToFields'; -import { mergeTransformer } from '@grafana/data/src/transformations/transformers/merge'; +import { labelsToFieldsTransformer, mergeTransformer } from '@grafana/data/internal'; import { getDataSourceSrv, setDataSourceSrv } from '@grafana/runtime'; import { DataTransformerConfig } from '@grafana/schema'; import { AxisPlacement, GraphFieldConfig } from '@grafana/ui'; diff --git a/public/app/features/dashboard/state/PanelModel.test.ts b/public/app/features/dashboard/state/PanelModel.test.ts index a8a7aaae420..092ec0e0947 100644 --- a/public/app/features/dashboard/state/PanelModel.test.ts +++ b/public/app/features/dashboard/state/PanelModel.test.ts @@ -11,8 +11,7 @@ import { PanelMigrationHandler, PanelTypeChangedHandler, } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; -import { mockStandardFieldConfigOptions } from '@grafana/data/test/helpers/fieldConfig'; +import { getPanelPlugin, mockStandardFieldConfigOptions } from '@grafana/data/test'; import { setTemplateSrv } from '@grafana/runtime'; import { queryBuilder } from 'app/features/variables/shared/testing/builders'; diff --git a/public/app/features/dashboard/utils/panel.test.ts b/public/app/features/dashboard/utils/panel.test.ts index a739dcedab4..0a444a7726a 100644 --- a/public/app/features/dashboard/utils/panel.test.ts +++ b/public/app/features/dashboard/utils/panel.test.ts @@ -2,7 +2,7 @@ import { advanceTo, clear } from 'jest-date-mock'; import { ComponentClass } from 'react'; import { dateTime, DateTime, PanelProps, TimeRange } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { applyPanelTimeOverrides, calculateInnerPanelHeight } from 'app/features/dashboard/utils/panel'; import { PanelModel } from '../state/PanelModel'; diff --git a/public/app/features/dashboard/utils/timeRange.ts b/public/app/features/dashboard/utils/timeRange.ts index 79cf1f10244..da144cf427c 100644 --- a/public/app/features/dashboard/utils/timeRange.ts +++ b/public/app/features/dashboard/utils/timeRange.ts @@ -1,5 +1,4 @@ -import { DateTime, TimeRange } from '@grafana/data'; -import { dateMath, dateTime, isDateTime } from '@grafana/data/src'; +import { dateMath, dateTime, isDateTime, DateTime, TimeRange } from '@grafana/data'; import { TimeModel } from 'app/features/dashboard/state/TimeModel'; export const getTimeRange = ( diff --git a/public/app/features/datasources/components/CloudInfoBox.tsx b/public/app/features/datasources/components/CloudInfoBox.tsx index c34c44ce810..17e6b6d26b8 100644 --- a/public/app/features/datasources/components/CloudInfoBox.tsx +++ b/public/app/features/datasources/components/CloudInfoBox.tsx @@ -1,5 +1,5 @@ import { DataSourceSettings } from '@grafana/data'; -import { GrafanaEdition } from '@grafana/data/src/types/config'; +import { GrafanaEdition } from '@grafana/data/internal'; import { Alert } from '@grafana/ui'; import { LocalStorageValueProvider } from 'app/core/components/LocalStorageValueProvider'; import { config } from 'app/core/config'; diff --git a/public/app/features/datasources/state/buildCategories.test.ts b/public/app/features/datasources/state/buildCategories.test.ts index 5370c5a5789..297c413073d 100644 --- a/public/app/features/datasources/state/buildCategories.test.ts +++ b/public/app/features/datasources/state/buildCategories.test.ts @@ -1,5 +1,5 @@ import { DataSourcePluginMeta } from '@grafana/data'; -import { getMockPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getMockPlugin } from '@grafana/data/test'; import { buildCategories } from './buildCategories'; diff --git a/public/app/features/dimensions/context.ts b/public/app/features/dimensions/context.ts index a4693ada2a9..bd0755de986 100644 --- a/public/app/features/dimensions/context.ts +++ b/public/app/features/dimensions/context.ts @@ -1,4 +1,4 @@ -import { PanelData } from '@grafana/data/src'; +import { PanelData } from '@grafana/data'; import { ColorDimensionConfig, ResourceDimensionConfig, diff --git a/public/app/features/dimensions/scale.ts b/public/app/features/dimensions/scale.ts index 06f3be04dee..7c82df3c29d 100644 --- a/public/app/features/dimensions/scale.ts +++ b/public/app/features/dimensions/scale.ts @@ -1,5 +1,4 @@ -import { DataFrame, Field } from '@grafana/data'; -import { getMinMaxAndDelta } from '@grafana/data/src/field/scale'; +import { getMinMaxAndDelta, DataFrame, Field } from '@grafana/data'; import { ScaleDimensionConfig, ScaleDimensionMode } from '@grafana/schema'; import { DimensionSupplier, ScaleDimensionOptions } from './types'; diff --git a/public/app/features/explore/Logs/Logs.test.tsx b/public/app/features/explore/Logs/Logs.test.tsx index 958bad54ad4..85b5906eef6 100644 --- a/public/app/features/explore/Logs/Logs.test.tsx +++ b/public/app/features/explore/Logs/Logs.test.tsx @@ -16,7 +16,7 @@ import { ExploreLogsPanelState, DataQuery, } from '@grafana/data'; -import { organizeFieldsTransformer } from '@grafana/data/src/transformations/transformers/organize'; +import { organizeFieldsTransformer } from '@grafana/data/internal'; import { config } from '@grafana/runtime'; import { extractFieldsTransformer } from 'app/features/transformers/extractFields/extractFields'; import { LokiQueryDirection } from 'app/plugins/datasource/loki/dataquery.gen'; diff --git a/public/app/features/explore/Logs/LogsColumnSearch.tsx b/public/app/features/explore/Logs/LogsColumnSearch.tsx index 16e24d48954..6919e9e3fcf 100644 --- a/public/app/features/explore/Logs/LogsColumnSearch.tsx +++ b/public/app/features/explore/Logs/LogsColumnSearch.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/css'; import * as React from 'react'; -import { GrafanaTheme2 } from '@grafana/data/src'; +import { GrafanaTheme2 } from '@grafana/data'; import { Field, Input, useTheme2 } from '@grafana/ui'; function getStyles(theme: GrafanaTheme2) { diff --git a/public/app/features/explore/Logs/LogsMetaRow.test.tsx b/public/app/features/explore/Logs/LogsMetaRow.test.tsx index ce63d19b4d0..e66a3d1bd77 100644 --- a/public/app/features/explore/Logs/LogsMetaRow.test.tsx +++ b/public/app/features/explore/Logs/LogsMetaRow.test.tsx @@ -4,7 +4,7 @@ import saveAs from 'file-saver'; import { ComponentProps } from 'react'; import { FieldType, LogLevel, LogsDedupStrategy, standardTransformersRegistry, toDataFrame } from '@grafana/data'; -import { organizeFieldsTransformer } from '@grafana/data/src/transformations/transformers/organize'; +import { organizeFieldsTransformer } from '@grafana/data/internal'; import { config } from '@grafana/runtime'; import { MAX_CHARACTERS } from '../../logs/components/LogRowMessage'; diff --git a/public/app/features/explore/Logs/LogsMetaRow.tsx b/public/app/features/explore/Logs/LogsMetaRow.tsx index f69b84b6dd5..8be56cca1cc 100644 --- a/public/app/features/explore/Logs/LogsMetaRow.tsx +++ b/public/app/features/explore/Logs/LogsMetaRow.tsx @@ -14,8 +14,8 @@ import { DataTransformerConfig, CustomTransformOperator, Labels, + DataFrame, } from '@grafana/data'; -import { DataFrame } from '@grafana/data/'; import { config, reportInteraction } from '@grafana/runtime'; import { Button, Dropdown, Menu, ToolbarButton, Tooltip, useStyles2 } from '@grafana/ui'; import { Trans } from 'app/core/internationalization'; diff --git a/public/app/features/explore/Logs/LogsTable.test.tsx b/public/app/features/explore/Logs/LogsTable.test.tsx index 6dff92ec2c5..a8fa211431e 100644 --- a/public/app/features/explore/Logs/LogsTable.test.tsx +++ b/public/app/features/explore/Logs/LogsTable.test.tsx @@ -2,7 +2,7 @@ import { render, screen, waitFor } from '@testing-library/react'; import { ComponentProps } from 'react'; import { DataFrame, FieldType, LogsSortOrder, standardTransformersRegistry, toUtc } from '@grafana/data'; -import { organizeFieldsTransformer } from '@grafana/data/src/transformations/transformers/organize'; +import { organizeFieldsTransformer } from '@grafana/data/internal'; import { config } from '@grafana/runtime'; import { extractFieldsTransformer } from 'app/features/transformers/extractFields/extractFields'; diff --git a/public/app/features/explore/Logs/LogsTableActiveFields.tsx b/public/app/features/explore/Logs/LogsTableActiveFields.tsx index eb833030106..c228c7aaf7b 100644 --- a/public/app/features/explore/Logs/LogsTableActiveFields.tsx +++ b/public/app/features/explore/Logs/LogsTableActiveFields.tsx @@ -1,7 +1,7 @@ import { css, cx } from '@emotion/css'; import { DragDropContext, Draggable, DraggableProvided, Droppable, DropResult } from '@hello-pangea/dnd'; -import { GrafanaTheme2 } from '@grafana/data/src'; +import { GrafanaTheme2 } from '@grafana/data'; import { useTheme2 } from '@grafana/ui'; import { LogsTableEmptyFields } from './LogsTableEmptyFields'; diff --git a/public/app/features/explore/Logs/LogsTableMultiSelect.tsx b/public/app/features/explore/Logs/LogsTableMultiSelect.tsx index ad0b2dec903..d50057aeaa7 100644 --- a/public/app/features/explore/Logs/LogsTableMultiSelect.tsx +++ b/public/app/features/explore/Logs/LogsTableMultiSelect.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/css'; -import { GrafanaTheme2 } from '@grafana/data/src'; +import { GrafanaTheme2 } from '@grafana/data'; import { useTheme2 } from '@grafana/ui'; import { Trans } from 'app/core/internationalization'; diff --git a/public/app/features/explore/Logs/LogsTableWrap.test.tsx b/public/app/features/explore/Logs/LogsTableWrap.test.tsx index a862b326065..3fd2add101f 100644 --- a/public/app/features/explore/Logs/LogsTableWrap.test.tsx +++ b/public/app/features/explore/Logs/LogsTableWrap.test.tsx @@ -1,14 +1,8 @@ import { act, fireEvent, render, screen, waitFor } from '@testing-library/react'; import { ComponentProps } from 'react'; -import { - createTheme, - ExploreLogsPanelState, - LogsSortOrder, - standardTransformersRegistry, - toUtc, -} from '@grafana/data/src'; -import { organizeFieldsTransformer } from '@grafana/data/src/transformations/transformers/organize'; +import { createTheme, ExploreLogsPanelState, LogsSortOrder, standardTransformersRegistry, toUtc } from '@grafana/data'; +import { organizeFieldsTransformer } from '@grafana/data/internal'; import { config } from '@grafana/runtime'; import { extractFieldsTransformer } from '../../transformers/extractFields/extractFields'; diff --git a/public/app/features/explore/Logs/utils/testMocks.test.ts b/public/app/features/explore/Logs/utils/testMocks.test.ts index 55a19433b20..93ddc7b2eeb 100644 --- a/public/app/features/explore/Logs/utils/testMocks.test.ts +++ b/public/app/features/explore/Logs/utils/testMocks.test.ts @@ -1,6 +1,4 @@ -import { DataFrame, Field, FieldType } from '@grafana/data/src'; - -import { DataFrameType } from '../../../../../../packages/grafana-data'; +import { DataFrame, DataFrameType, Field, FieldType } from '@grafana/data'; export const getMockLokiFrame = (override?: Partial) => { const testDataFrame: DataFrame = { diff --git a/public/app/features/explore/NoData.tsx b/public/app/features/explore/NoData.tsx index 130f38750ef..38384793050 100644 --- a/public/app/features/explore/NoData.tsx +++ b/public/app/features/explore/NoData.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/css'; -import { GrafanaTheme2 } from '@grafana/data/src'; +import { GrafanaTheme2 } from '@grafana/data'; import { useStyles2, PanelContainer } from '@grafana/ui'; export const NoData = () => { diff --git a/public/app/features/explore/PrometheusListView/ItemLabels.tsx b/public/app/features/explore/PrometheusListView/ItemLabels.tsx index 4f0884ab71b..4fb465818cc 100644 --- a/public/app/features/explore/PrometheusListView/ItemLabels.tsx +++ b/public/app/features/explore/PrometheusListView/ItemLabels.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/css'; -import { Field, GrafanaTheme2 } from '@grafana/data/'; +import { Field, GrafanaTheme2 } from '@grafana/data'; import { InstantQueryRefIdIndex } from '@grafana/prometheus'; import { useStyles2 } from '@grafana/ui'; diff --git a/public/app/features/explore/PrometheusListView/ItemValues.tsx b/public/app/features/explore/PrometheusListView/ItemValues.tsx index 2cb61be35c0..ab46049a540 100644 --- a/public/app/features/explore/PrometheusListView/ItemValues.tsx +++ b/public/app/features/explore/PrometheusListView/ItemValues.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/css'; -import { GrafanaTheme2 } from '@grafana/data/'; +import { GrafanaTheme2 } from '@grafana/data'; import { useStyles2 } from '@grafana/ui'; import { rawListItemColumnWidth, rawListPaddingToHoldSpaceForCopyIcon, RawListValue } from './RawListItem'; diff --git a/public/app/features/explore/PrometheusListView/RawListContainer.test.tsx b/public/app/features/explore/PrometheusListView/RawListContainer.test.tsx index 8f3d27dbac8..896b5dd7ba8 100644 --- a/public/app/features/explore/PrometheusListView/RawListContainer.test.tsx +++ b/public/app/features/explore/PrometheusListView/RawListContainer.test.tsx @@ -1,6 +1,6 @@ import { render, screen, within } from '@testing-library/react'; -import { FieldType, FormattedValue, toDataFrame } from '@grafana/data/src'; +import { FieldType, FormattedValue, toDataFrame } from '@grafana/data'; import RawListContainer, { RawListContainerProps } from './RawListContainer'; diff --git a/public/app/features/explore/PrometheusListView/RawListContainer.tsx b/public/app/features/explore/PrometheusListView/RawListContainer.tsx index ee8dedfd5ab..eb0717b6c43 100644 --- a/public/app/features/explore/PrometheusListView/RawListContainer.tsx +++ b/public/app/features/explore/PrometheusListView/RawListContainer.tsx @@ -4,7 +4,7 @@ import { useEffect, useId, useRef, useState } from 'react'; import { useWindowSize } from 'react-use'; import { VariableSizeList as List } from 'react-window'; -import { DataFrame, Field as DataFrameField } from '@grafana/data/'; +import { DataFrame, Field as DataFrameField } from '@grafana/data'; import { reportInteraction } from '@grafana/runtime/src'; import { Field, Switch } from '@grafana/ui'; diff --git a/public/app/features/explore/PrometheusListView/RawListItem.tsx b/public/app/features/explore/PrometheusListView/RawListItem.tsx index ae4790090fd..9a5e84e318c 100644 --- a/public/app/features/explore/PrometheusListView/RawListItem.tsx +++ b/public/app/features/explore/PrometheusListView/RawListItem.tsx @@ -1,7 +1,7 @@ import { css } from '@emotion/css'; import { useCopyToClipboard } from 'react-use'; -import { Field, GrafanaTheme2 } from '@grafana/data/'; +import { Field, GrafanaTheme2 } from '@grafana/data'; import { isValidLegacyName, utf8Support } from '@grafana/prometheus/src/utf8_support'; import { reportInteraction } from '@grafana/runtime/src'; import { IconButton, useStyles2 } from '@grafana/ui'; diff --git a/public/app/features/explore/PrometheusListView/RawListItemAttributes.tsx b/public/app/features/explore/PrometheusListView/RawListItemAttributes.tsx index bbc7962c918..8d9ecb28fe2 100644 --- a/public/app/features/explore/PrometheusListView/RawListItemAttributes.tsx +++ b/public/app/features/explore/PrometheusListView/RawListItemAttributes.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/css'; -import { GrafanaTheme2 } from '@grafana/data/'; +import { GrafanaTheme2 } from '@grafana/data'; import { useStyles2 } from '@grafana/ui'; import { RawListValue } from './RawListItem'; diff --git a/public/app/features/explore/state/main.test.ts b/public/app/features/explore/state/main.test.ts index 28fe5009234..d52a1be7211 100644 --- a/public/app/features/explore/state/main.test.ts +++ b/public/app/features/explore/state/main.test.ts @@ -1,7 +1,6 @@ import { thunkTester } from 'test/core/thunk/thunkTester'; -import { dateTime, ExploreUrlState } from '@grafana/data'; -import { serializeStateToUrlParam } from '@grafana/data/src/utils/url'; +import { dateTime, ExploreUrlState, serializeStateToUrlParam } from '@grafana/data'; import { locationService } from '@grafana/runtime'; import { PanelModel } from 'app/features/dashboard/state/PanelModel'; diff --git a/public/app/features/live/centrifuge/LiveDataStream.ts b/public/app/features/live/centrifuge/LiveDataStream.ts index a4b6eb80255..6d0787c205f 100644 --- a/public/app/features/live/centrifuge/LiveDataStream.ts +++ b/public/app/features/live/centrifuge/LiveDataStream.ts @@ -12,7 +12,7 @@ import { LoadingState, StreamingDataFrame, } from '@grafana/data'; -import { getStreamingFrameOptions } from '@grafana/data/src/dataframe/StreamingDataFrame'; +import { getStreamingFrameOptions } from '@grafana/data/internal'; import { LiveDataStreamOptions, StreamingFrameAction, StreamingFrameOptions } from '@grafana/runtime/src/services/live'; import { toDataQueryError } from '@grafana/runtime/src/utils/toDataQueryError'; diff --git a/public/app/features/logs/components/InfiniteScroll.test.tsx b/public/app/features/logs/components/InfiniteScroll.test.tsx index 9b9792c2849..90b10988e73 100644 --- a/public/app/features/logs/components/InfiniteScroll.test.tsx +++ b/public/app/features/logs/components/InfiniteScroll.test.tsx @@ -2,8 +2,7 @@ import { act, render, screen } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { useEffect, useRef, useState } from 'react'; -import { CoreApp, LogRowModel, dateTimeForTimeZone } from '@grafana/data'; -import { convertRawToRange } from '@grafana/data/src/datetime/rangeutil'; +import { CoreApp, LogRowModel, dateTimeForTimeZone, rangeUtil } from '@grafana/data'; import { config } from '@grafana/runtime'; import { LogsSortOrder } from '@grafana/schema'; @@ -16,7 +15,7 @@ const absoluteRange = { from: 1702578600000, to: 1702578900000, }; -const defaultRange = convertRawToRange({ +const defaultRange = rangeUtil.convertRawToRange({ from: dateTimeForTimeZone(defaultTz, absoluteRange.from), to: dateTimeForTimeZone(defaultTz, absoluteRange.to), }); diff --git a/public/app/features/logs/components/InfiniteScroll.tsx b/public/app/features/logs/components/InfiniteScroll.tsx index 5ebe5516332..d75327e0a2e 100644 --- a/public/app/features/logs/components/InfiniteScroll.tsx +++ b/public/app/features/logs/components/InfiniteScroll.tsx @@ -1,8 +1,8 @@ import { css } from '@emotion/css'; import { ReactNode, MutableRefObject, useCallback, useEffect, useRef, useState } from 'react'; -import { AbsoluteTimeRange, CoreApp, LogRowModel, TimeRange } from '@grafana/data'; -import { convertRawToRange, isRelativeTime, isRelativeTimeRange } from '@grafana/data/src/datetime/rangeutil'; +import { AbsoluteTimeRange, CoreApp, LogRowModel, TimeRange, rangeUtil } from '@grafana/data'; +// import { convertRawToRange, isRelativeTime, isRelativeTimeRange } from '@grafana/data/internal'; import { config, reportInteraction } from '@grafana/runtime'; import { LogsSortOrder, TimeZone } from '@grafana/schema'; import { Button, Icon } from '@grafana/ui'; @@ -141,8 +141,8 @@ export const InfiniteScroll = ({ }, [loadMoreLogs, loading, range, rows, scrollElement, sortOrder, timeZone, topScrollEnabled]); // We allow "now" to move when using relative time, so we hide the message so it doesn't flash. - const hideTopMessage = sortOrder === LogsSortOrder.Descending && isRelativeTime(range.raw.to); - const hideBottomMessage = sortOrder === LogsSortOrder.Ascending && isRelativeTime(range.raw.to); + const hideTopMessage = sortOrder === LogsSortOrder.Descending && rangeUtil.isRelativeTime(range.raw.to); + const hideBottomMessage = sortOrder === LogsSortOrder.Ascending && rangeUtil.isRelativeTime(range.raw.to); const loadOlderLogs = useCallback(() => { //If we are not on the last page, use next page's range @@ -345,5 +345,7 @@ export function canScrollBottom( // Given a TimeRange, returns a new instance if using relative time, or else the same. function updateCurrentRange(timeRange: TimeRange, timeZone: TimeZone) { - return isRelativeTimeRange(timeRange.raw) ? convertRawToRange(timeRange.raw, timeZone) : timeRange; + return rangeUtil.isRelativeTimeRange(timeRange.raw) + ? rangeUtil.convertRawToRange(timeRange.raw, timeZone) + : timeRange; } diff --git a/public/app/features/logs/components/LogDetailsRow.test.tsx b/public/app/features/logs/components/LogDetailsRow.test.tsx index 5f3229255b3..4463adde1f7 100644 --- a/public/app/features/logs/components/LogDetailsRow.test.tsx +++ b/public/app/features/logs/components/LogDetailsRow.test.tsx @@ -1,8 +1,7 @@ import { fireEvent, render, screen } from '@testing-library/react'; import { ComponentProps } from 'react'; -import { CoreApp, FieldType, LinkModel } from '@grafana/data'; -import { Field } from '@grafana/data/'; +import { Field, CoreApp, FieldType, LinkModel } from '@grafana/data'; import { LogDetailsRow } from './LogDetailsRow'; import { createLogRow } from './__mocks__/logRow'; diff --git a/public/app/features/logs/logsModel.ts b/public/app/features/logs/logsModel.ts index 60aef4364bd..a63e464c62f 100644 --- a/public/app/features/logs/logsModel.ts +++ b/public/app/features/logs/logsModel.ts @@ -39,7 +39,7 @@ import { toDataFrame, toUtc, } from '@grafana/data'; -import { SIPrefix } from '@grafana/data/src/valueFormats/symbolFormatters'; +import { SIPrefix } from '@grafana/data/internal'; import { config } from '@grafana/runtime'; import { BarAlignment, GraphDrawStyle, StackingMode } from '@grafana/schema'; import { colors } from '@grafana/ui'; diff --git a/public/app/features/manage-dashboards/components/PublicDashboardListTable/DeletePublicDashboardModal.tsx b/public/app/features/manage-dashboards/components/PublicDashboardListTable/DeletePublicDashboardModal.tsx index 8e3766ce457..dabaa6d3473 100644 --- a/public/app/features/manage-dashboards/components/PublicDashboardListTable/DeletePublicDashboardModal.tsx +++ b/public/app/features/manage-dashboards/components/PublicDashboardListTable/DeletePublicDashboardModal.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/css'; -import { GrafanaTheme2 } from '@grafana/data/src'; +import { GrafanaTheme2 } from '@grafana/data'; import { config } from '@grafana/runtime'; import { ConfirmModal, useStyles2 } from '@grafana/ui'; import { t } from 'app/core/internationalization'; diff --git a/public/app/features/panel/state/actions.test.ts b/public/app/features/panel/state/actions.test.ts index 0f6dc41284d..98c0105f848 100644 --- a/public/app/features/panel/state/actions.test.ts +++ b/public/app/features/panel/state/actions.test.ts @@ -1,6 +1,5 @@ import { standardEditorsRegistry, standardFieldConfigEditorRegistry } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; -import { mockStandardFieldConfigOptions } from '@grafana/data/test/helpers/fieldConfig'; +import { getPanelPlugin, mockStandardFieldConfigOptions } from '@grafana/data/test'; import { PanelModel } from 'app/features/dashboard/state/PanelModel'; import { panelPluginLoaded } from 'app/features/plugins/admin/state/actions'; diff --git a/public/app/features/plugins/components/AppRootPage.test.tsx b/public/app/features/plugins/components/AppRootPage.test.tsx index 594028bcebf..bef9ed62306 100644 --- a/public/app/features/plugins/components/AppRootPage.test.tsx +++ b/public/app/features/plugins/components/AppRootPage.test.tsx @@ -4,7 +4,7 @@ import { Routes, Route, Link } from 'react-router-dom-v5-compat'; import { render } from 'test/test-utils'; import { AppPlugin, PluginType, AppRootProps, NavModelItem, PluginIncludeType, OrgRole } from '@grafana/data'; -import { getMockPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getMockPlugin } from '@grafana/data/test'; import { setEchoSrv } from '@grafana/runtime'; import { GrafanaRouteWrapper } from 'app/core/navigation/GrafanaRoute'; import { contextSrv } from 'app/core/services/context_srv'; diff --git a/public/app/features/plugins/extensions/registry/AddedLinksRegistry.ts b/public/app/features/plugins/extensions/registry/AddedLinksRegistry.ts index 52a1ad9a96c..12024fd0863 100644 --- a/public/app/features/plugins/extensions/registry/AddedLinksRegistry.ts +++ b/public/app/features/plugins/extensions/registry/AddedLinksRegistry.ts @@ -1,7 +1,7 @@ import { ReplaySubject } from 'rxjs'; import { IconName, PluginExtensionAddedLinkConfig } from '@grafana/data'; -import { PluginAddedLinksConfigureFunc, PluginExtensionEventHelpers } from '@grafana/data/src/types/pluginExtensions'; +import { PluginAddedLinksConfigureFunc, PluginExtensionEventHelpers } from '@grafana/data/internal'; import * as errors from '../errors'; import { isGrafanaDevMode } from '../utils'; diff --git a/public/app/features/plugins/extensions/validators.ts b/public/app/features/plugins/extensions/validators.ts index cbdaf81e935..4106544567f 100644 --- a/public/app/features/plugins/extensions/validators.ts +++ b/public/app/features/plugins/extensions/validators.ts @@ -1,13 +1,14 @@ -import type { - PluginExtensionAddedLinkConfig, - PluginExtension, - PluginExtensionLink, - PluginContextType, - PluginExtensionAddedComponentConfig, - PluginExtensionExposedComponentConfig, - PluginExtensionAddedFunctionConfig, +import { + type PluginExtensionAddedLinkConfig, + type PluginExtension, + type PluginExtensionLink, + type PluginContextType, + type PluginExtensionAddedComponentConfig, + type PluginExtensionExposedComponentConfig, + type PluginExtensionAddedFunctionConfig, + PluginExtensionPoints, } from '@grafana/data'; -import { PluginAddedLinksConfigureFunc, PluginExtensionPoints } from '@grafana/data/src/types/pluginExtensions'; +import { PluginAddedLinksConfigureFunc } from '@grafana/data/internal'; import { config, isPluginExtensionLink } from '@grafana/runtime'; import * as errors from './errors'; diff --git a/public/app/features/plugins/loader/sharedDependencies.ts b/public/app/features/plugins/loader/sharedDependencies.ts index dc88d5a292c..0551cd8d170 100644 --- a/public/app/features/plugins/loader/sharedDependencies.ts +++ b/public/app/features/plugins/loader/sharedDependencies.ts @@ -49,7 +49,7 @@ export const sharedDependenciesMap = { '@emotion/css': () => import('@emotion/css'), '@emotion/react': () => import('@emotion/react'), '@grafana/data': grafanaData, - '@grafana/data/unstable': () => import('@grafana/data/src/unstable'), + '@grafana/data/unstable': () => import('@grafana/data/unstable'), '@grafana/runtime': grafanaRuntime, '@grafana/runtime/unstable': () => import('@grafana/runtime/src/unstable'), '@grafana/slate-react': () => import('slate-react'), diff --git a/public/app/features/plugins/pluginPreloader.ts b/public/app/features/plugins/pluginPreloader.ts index 8b7a85759be..43b58f2d08e 100644 --- a/public/app/features/plugins/pluginPreloader.ts +++ b/public/app/features/plugins/pluginPreloader.ts @@ -1,5 +1,8 @@ -import type { PluginExtensionAddedLinkConfig, PluginExtensionExposedComponentConfig } from '@grafana/data'; -import { PluginExtensionAddedComponentConfig } from '@grafana/data/src/types/pluginExtensions'; +import type { + PluginExtensionAddedLinkConfig, + PluginExtensionExposedComponentConfig, + PluginExtensionAddedComponentConfig, +} from '@grafana/data'; import type { AppPluginConfig } from '@grafana/runtime'; import { getPluginSettings } from 'app/features/plugins/pluginSettings'; diff --git a/public/app/features/scopes/tests/utils/render.tsx b/public/app/features/scopes/tests/utils/render.tsx index 3fa447d952b..391331eb5f1 100644 --- a/public/app/features/scopes/tests/utils/render.tsx +++ b/public/app/features/scopes/tests/utils/render.tsx @@ -2,7 +2,7 @@ import { cleanup, waitFor } from '@testing-library/react'; import { KBarProvider } from 'kbar'; import { render } from 'test/test-utils'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { config, setPluginImportUtils } from '@grafana/runtime'; import { sceneGraph } from '@grafana/scenes'; import { defaultDashboard } from '@grafana/schema'; diff --git a/public/app/features/trails/DataTrailsHistory.tsx b/public/app/features/trails/DataTrailsHistory.tsx index bfd7af07344..81e20a8b29c 100644 --- a/public/app/features/trails/DataTrailsHistory.tsx +++ b/public/app/features/trails/DataTrailsHistory.tsx @@ -1,8 +1,7 @@ import { css, cx } from '@emotion/css'; import { useMemo } from 'react'; -import { getTimeZoneInfo, GrafanaTheme2, InternalTimeZones, TIME_FORMAT } from '@grafana/data'; -import { convertRawToRange } from '@grafana/data/src/datetime/rangeutil'; +import { getTimeZoneInfo, GrafanaTheme2, InternalTimeZones, TIME_FORMAT, rangeUtil } from '@grafana/data'; import { config } from '@grafana/runtime'; import { SceneComponentProps, @@ -349,7 +348,7 @@ export function parseTimeTooltip(urlValues: SceneObjectUrlValues): string { return ''; } - const range = convertRawToRange({ + const range = rangeUtil.convertRawToRange({ from: urlValues.from, to: urlValues.to, }); diff --git a/public/app/features/trails/Integrations/logs/lokiRecordingRules.test.ts b/public/app/features/trails/Integrations/logs/lokiRecordingRules.test.ts index 673cb2d5348..8d7e5418b3a 100644 --- a/public/app/features/trails/Integrations/logs/lokiRecordingRules.test.ts +++ b/public/app/features/trails/Integrations/logs/lokiRecordingRules.test.ts @@ -1,7 +1,7 @@ import { of } from 'rxjs'; import type { DataSourceInstanceSettings, DataSourceJsonData } from '@grafana/data'; -import { getMockPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getMockPlugin } from '@grafana/data/test'; import * as runtime from '@grafana/runtime'; import { MetricsLogsConnector } from './base'; diff --git a/public/app/features/transformers/FilterByValueTransformer/FilterByValueFilterEditor.tsx b/public/app/features/transformers/FilterByValueTransformer/FilterByValueFilterEditor.tsx index f896c2a5759..1b2f85c51da 100644 --- a/public/app/features/transformers/FilterByValueTransformer/FilterByValueFilterEditor.tsx +++ b/public/app/features/transformers/FilterByValueTransformer/FilterByValueFilterEditor.tsx @@ -1,7 +1,7 @@ import { useCallback } from 'react'; import { Field, SelectableValue, valueMatchers } from '@grafana/data'; -import { FilterByValueFilter } from '@grafana/data/src/transformations/transformers/filterByValue'; +import { FilterByValueFilter } from '@grafana/data/internal'; import { Button, Select, InlineField, InlineFieldRow, Box } from '@grafana/ui'; import { valueMatchersUI } from './ValueMatchers/valueMatchersUI'; diff --git a/public/app/features/transformers/FilterByValueTransformer/FilterByValueTransformerEditor.test.tsx b/public/app/features/transformers/FilterByValueTransformer/FilterByValueTransformerEditor.test.tsx index e9cf39d1497..6c064b2ad0c 100644 --- a/public/app/features/transformers/FilterByValueTransformer/FilterByValueTransformerEditor.test.tsx +++ b/public/app/features/transformers/FilterByValueTransformer/FilterByValueTransformerEditor.test.tsx @@ -1,7 +1,7 @@ import { render, fireEvent } from '@testing-library/react'; import { DataFrame, FieldType, ValueMatcherID, valueMatchers } from '@grafana/data'; -import { FilterByValueMatch, FilterByValueType } from '@grafana/data/src/transformations/transformers/filterByValue'; +import { FilterByValueMatch, FilterByValueType } from '@grafana/data/internal'; import { FilterByValueTransformerEditor } from './FilterByValueTransformerEditor'; diff --git a/public/app/features/transformers/FilterByValueTransformer/FilterByValueTransformerEditor.tsx b/public/app/features/transformers/FilterByValueTransformer/FilterByValueTransformerEditor.tsx index 683350d47b1..57b42e72d32 100644 --- a/public/app/features/transformers/FilterByValueTransformer/FilterByValueTransformerEditor.tsx +++ b/public/app/features/transformers/FilterByValueTransformer/FilterByValueTransformerEditor.tsx @@ -19,7 +19,7 @@ import { FilterByValueMatch, FilterByValueTransformerOptions, FilterByValueType, -} from '@grafana/data/src/transformations/transformers/filterByValue'; +} from '@grafana/data/internal'; import { Button, RadioButtonGroup, InlineField, Box } from '@grafana/ui'; import { getTransformationContent } from '../docs/getTransformationContent'; diff --git a/public/app/features/transformers/calculateHeatmap/heatmap.test.ts b/public/app/features/transformers/calculateHeatmap/heatmap.test.ts index 0087b9fe22f..256cd576ebe 100644 --- a/public/app/features/transformers/calculateHeatmap/heatmap.test.ts +++ b/public/app/features/transformers/calculateHeatmap/heatmap.test.ts @@ -1,5 +1,4 @@ -import { FieldType } from '@grafana/data'; -import { toDataFrame } from '@grafana/data/src/dataframe/processDataFrame'; +import { FieldType, toDataFrame } from '@grafana/data'; import { HeatmapCalculationOptions } from '@grafana/schema'; import { rowsToCellsHeatmap, calculateHeatmapFromData } from './heatmap'; diff --git a/public/app/features/transformers/calculateHeatmap/heatmap.ts b/public/app/features/transformers/calculateHeatmap/heatmap.ts index 6a7a29ce69c..ed37d76651e 100644 --- a/public/app/features/transformers/calculateHeatmap/heatmap.ts +++ b/public/app/features/transformers/calculateHeatmap/heatmap.ts @@ -15,7 +15,7 @@ import { TransformationApplicabilityLevels, TimeRange, } from '@grafana/data'; -import { isLikelyAscendingVector } from '@grafana/data/src/transformations/transformers/joinDataFrames'; +import { isLikelyAscendingVector } from '@grafana/data/internal'; import { ScaleDistribution, HeatmapCellLayout, diff --git a/public/app/features/transformers/editors/CalculateFieldTransformerEditor/BinaryOperationOptionsEditor.tsx b/public/app/features/transformers/editors/CalculateFieldTransformerEditor/BinaryOperationOptionsEditor.tsx index 0dd7cc033cb..e0439cf7126 100644 --- a/public/app/features/transformers/editors/CalculateFieldTransformerEditor/BinaryOperationOptionsEditor.tsx +++ b/public/app/features/transformers/editors/CalculateFieldTransformerEditor/BinaryOperationOptionsEditor.tsx @@ -5,7 +5,7 @@ import { CalculateFieldMode, CalculateFieldTransformerOptions, checkBinaryValueType, -} from '@grafana/data/src/transformations/transformers/calculateField'; +} from '@grafana/data/internal'; import { getFieldTypeIconName, InlineField, InlineFieldRow, Select } from '@grafana/ui'; import { LABEL_WIDTH } from './constants'; diff --git a/public/app/features/transformers/editors/CalculateFieldTransformerEditor/CalculateFieldTransformerEditor.tsx b/public/app/features/transformers/editors/CalculateFieldTransformerEditor/CalculateFieldTransformerEditor.tsx index bc39a4e2c62..bd0e589dd88 100644 --- a/public/app/features/transformers/editors/CalculateFieldTransformerEditor/CalculateFieldTransformerEditor.tsx +++ b/public/app/features/transformers/editors/CalculateFieldTransformerEditor/CalculateFieldTransformerEditor.tsx @@ -21,7 +21,7 @@ import { CalculateFieldTransformerOptions, getNameFromOptions, defaultWindowOptions, -} from '@grafana/data/src/transformations/transformers/calculateField'; +} from '@grafana/data/internal'; import { getTemplateSrv, config as cfg } from '@grafana/runtime'; import { InlineField, InlineSwitch, Input, Select } from '@grafana/ui'; diff --git a/public/app/features/transformers/editors/CalculateFieldTransformerEditor/CumulativeOptionsEditor.tsx b/public/app/features/transformers/editors/CalculateFieldTransformerEditor/CumulativeOptionsEditor.tsx index 1194514bcf4..5d8eb17ea1d 100644 --- a/public/app/features/transformers/editors/CalculateFieldTransformerEditor/CumulativeOptionsEditor.tsx +++ b/public/app/features/transformers/editors/CalculateFieldTransformerEditor/CumulativeOptionsEditor.tsx @@ -1,9 +1,5 @@ import { ReducerID, SelectableValue } from '@grafana/data'; -import { - CalculateFieldMode, - CalculateFieldTransformerOptions, - CumulativeOptions, -} from '@grafana/data/src/transformations/transformers/calculateField'; +import { CalculateFieldMode, CalculateFieldTransformerOptions, CumulativeOptions } from '@grafana/data/internal'; import { InlineField, Select, StatsPicker } from '@grafana/ui'; import { LABEL_WIDTH } from './constants'; diff --git a/public/app/features/transformers/editors/CalculateFieldTransformerEditor/IndexOptionsEditor.tsx b/public/app/features/transformers/editors/CalculateFieldTransformerEditor/IndexOptionsEditor.tsx index c660ac21317..e812dfafb0e 100644 --- a/public/app/features/transformers/editors/CalculateFieldTransformerEditor/IndexOptionsEditor.tsx +++ b/public/app/features/transformers/editors/CalculateFieldTransformerEditor/IndexOptionsEditor.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import { CalculateFieldTransformerOptions } from '@grafana/data/src/transformations/transformers/calculateField'; +import { CalculateFieldTransformerOptions } from '@grafana/data/internal'; import { InlineField, InlineSwitch } from '@grafana/ui'; import { LABEL_WIDTH } from './constants'; diff --git a/public/app/features/transformers/editors/CalculateFieldTransformerEditor/ReduceRowOptionsEditor.tsx b/public/app/features/transformers/editors/CalculateFieldTransformerEditor/ReduceRowOptionsEditor.tsx index c48870fc36b..e3e50a475ef 100644 --- a/public/app/features/transformers/editors/CalculateFieldTransformerEditor/ReduceRowOptionsEditor.tsx +++ b/public/app/features/transformers/editors/CalculateFieldTransformerEditor/ReduceRowOptionsEditor.tsx @@ -1,8 +1,5 @@ import { ReducerID } from '@grafana/data'; -import { - CalculateFieldTransformerOptions, - ReduceOptions, -} from '@grafana/data/src/transformations/transformers/calculateField'; +import { CalculateFieldTransformerOptions, ReduceOptions } from '@grafana/data/internal'; import { FilterPill, HorizontalGroup, InlineField, StatsPicker } from '@grafana/ui'; import { LABEL_WIDTH } from './constants'; diff --git a/public/app/features/transformers/editors/CalculateFieldTransformerEditor/UnaryOperationEditor.tsx b/public/app/features/transformers/editors/CalculateFieldTransformerEditor/UnaryOperationEditor.tsx index 3b38248b705..4c57fca1b9b 100644 --- a/public/app/features/transformers/editors/CalculateFieldTransformerEditor/UnaryOperationEditor.tsx +++ b/public/app/features/transformers/editors/CalculateFieldTransformerEditor/UnaryOperationEditor.tsx @@ -1,9 +1,5 @@ import { unaryOperators, SelectableValue, UnaryOperationID } from '@grafana/data'; -import { - UnaryOptions, - CalculateFieldMode, - CalculateFieldTransformerOptions, -} from '@grafana/data/src/transformations/transformers/calculateField'; +import { UnaryOptions, CalculateFieldMode, CalculateFieldTransformerOptions } from '@grafana/data/internal'; import { InlineField, InlineFieldRow, InlineLabel, Select } from '@grafana/ui'; import { LABEL_WIDTH } from './constants'; diff --git a/public/app/features/transformers/editors/CalculateFieldTransformerEditor/WindowOptionsEditor.tsx b/public/app/features/transformers/editors/CalculateFieldTransformerEditor/WindowOptionsEditor.tsx index b025c705c12..34fee4b264d 100644 --- a/public/app/features/transformers/editors/CalculateFieldTransformerEditor/WindowOptionsEditor.tsx +++ b/public/app/features/transformers/editors/CalculateFieldTransformerEditor/WindowOptionsEditor.tsx @@ -5,7 +5,7 @@ import { CalculateFieldTransformerOptions, WindowOptions, WindowSizeMode, -} from '@grafana/data/src/transformations/transformers/calculateField'; +} from '@grafana/data/internal'; import { InlineField, RadioButtonGroup, Select, StatsPicker } from '@grafana/ui'; import { NumberInput } from 'app/core/components/OptionsUI/NumberInput'; diff --git a/public/app/features/transformers/editors/ConcatenateTransformerEditor.tsx b/public/app/features/transformers/editors/ConcatenateTransformerEditor.tsx index 8c548fb2f38..91a0b251d74 100644 --- a/public/app/features/transformers/editors/ConcatenateTransformerEditor.tsx +++ b/public/app/features/transformers/editors/ConcatenateTransformerEditor.tsx @@ -8,10 +8,7 @@ import { TransformerUIProps, TransformerCategory, } from '@grafana/data'; -import { - ConcatenateFrameNameMode, - ConcatenateTransformerOptions, -} from '@grafana/data/src/transformations/transformers/concat'; +import { ConcatenateFrameNameMode, ConcatenateTransformerOptions } from '@grafana/data/internal'; import { InlineField, Input, Select } from '@grafana/ui'; import { getTransformationContent } from '../docs/getTransformationContent'; diff --git a/public/app/features/transformers/editors/ConvertFieldTypeTransformerEditor.tsx b/public/app/features/transformers/editors/ConvertFieldTypeTransformerEditor.tsx index c7d0f4f2f39..e331388cb3e 100644 --- a/public/app/features/transformers/editors/ConvertFieldTypeTransformerEditor.tsx +++ b/public/app/features/transformers/editors/ConvertFieldTypeTransformerEditor.tsx @@ -12,10 +12,7 @@ import { TransformerCategory, getTimeZones, } from '@grafana/data'; -import { - ConvertFieldTypeOptions, - ConvertFieldTypeTransformerOptions, -} from '@grafana/data/src/transformations/transformers/convertFieldType'; +import { ConvertFieldTypeOptions, ConvertFieldTypeTransformerOptions } from '@grafana/data/internal'; import { Button, InlineField, InlineFieldRow, Input, Select } from '@grafana/ui'; import { allFieldTypeIconOptions, FieldNamePicker } from '@grafana/ui/internal'; import { findField } from 'app/features/dimensions'; diff --git a/public/app/features/transformers/editors/EnumMappingEditor.tsx b/public/app/features/transformers/editors/EnumMappingEditor.tsx index 09f1822302c..ed1947a7181 100644 --- a/public/app/features/transformers/editors/EnumMappingEditor.tsx +++ b/public/app/features/transformers/editors/EnumMappingEditor.tsx @@ -4,7 +4,7 @@ import { isEqual } from 'lodash'; import { useEffect, useState } from 'react'; import { DataFrame, EnumFieldConfig, GrafanaTheme2 } from '@grafana/data'; -import { ConvertFieldTypeTransformerOptions } from '@grafana/data/src/transformations/transformers/convertFieldType'; +import { ConvertFieldTypeTransformerOptions } from '@grafana/data/internal'; import { Button, HorizontalGroup, InlineFieldRow, useStyles2, VerticalGroup } from '@grafana/ui'; import EnumMappingRow from './EnumMappingRow'; diff --git a/public/app/features/transformers/editors/FilterByNameTransformerEditor.tsx b/public/app/features/transformers/editors/FilterByNameTransformerEditor.tsx index 8ac19f37e7f..f8035a86f0b 100644 --- a/public/app/features/transformers/editors/FilterByNameTransformerEditor.tsx +++ b/public/app/features/transformers/editors/FilterByNameTransformerEditor.tsx @@ -11,7 +11,7 @@ import { TransformerCategory, SelectableValue, } from '@grafana/data'; -import { FilterFieldsByNameTransformerOptions } from '@grafana/data/src/transformations/transformers/filterByName'; +import { FilterFieldsByNameTransformerOptions } from '@grafana/data/internal'; import { getTemplateSrv } from '@grafana/runtime/src/services'; import { Input, FilterPill, InlineFieldRow, InlineField, InlineSwitch, Select } from '@grafana/ui'; diff --git a/public/app/features/transformers/editors/FilterByRefIdTransformerEditor.tsx b/public/app/features/transformers/editors/FilterByRefIdTransformerEditor.tsx index f67a7cb2b95..05b9e196b83 100644 --- a/public/app/features/transformers/editors/FilterByRefIdTransformerEditor.tsx +++ b/public/app/features/transformers/editors/FilterByRefIdTransformerEditor.tsx @@ -6,7 +6,7 @@ import { TransformerCategory, FrameMatcherID, } from '@grafana/data'; -import { FilterFramesByRefIdTransformerOptions } from '@grafana/data/src/transformations/transformers/filterByRefId'; +import { FilterFramesByRefIdTransformerOptions } from '@grafana/data/internal'; import { FrameMultiSelectionEditor } from 'app/plugins/panel/geomap/editor/FrameSelectionEditor'; import { getTransformationContent } from '../docs/getTransformationContent'; diff --git a/public/app/features/transformers/editors/FormatStringTransformerEditor.tsx b/public/app/features/transformers/editors/FormatStringTransformerEditor.tsx index e208d67976e..cf14f69a044 100644 --- a/public/app/features/transformers/editors/FormatStringTransformerEditor.tsx +++ b/public/app/features/transformers/editors/FormatStringTransformerEditor.tsx @@ -12,10 +12,7 @@ import { FieldNamePickerConfigSettings, TransformerCategory, } from '@grafana/data'; -import { - FormatStringOutput, - FormatStringTransformerOptions, -} from '@grafana/data/src/transformations/transformers/formatString'; +import { FormatStringOutput, FormatStringTransformerOptions } from '@grafana/data/internal'; import { Select, InlineFieldRow, InlineField } from '@grafana/ui'; import { FieldNamePicker } from '@grafana/ui/internal'; import { NumberInput } from 'app/core/components/OptionsUI/NumberInput'; diff --git a/public/app/features/transformers/editors/FormatTimeTransformerEditor.tsx b/public/app/features/transformers/editors/FormatTimeTransformerEditor.tsx index 4c2a646d93f..3f30a79d1a5 100644 --- a/public/app/features/transformers/editors/FormatTimeTransformerEditor.tsx +++ b/public/app/features/transformers/editors/FormatTimeTransformerEditor.tsx @@ -9,7 +9,7 @@ import { getFieldDisplayName, PluginState, } from '@grafana/data'; -import { FormatTimeTransformerOptions } from '@grafana/data/src/transformations/transformers/formatTime'; +import { FormatTimeTransformerOptions } from '@grafana/data/internal'; import { Select, InlineFieldRow, InlineField, Input } from '@grafana/ui'; import { getTransformationContent } from '../docs/getTransformationContent'; diff --git a/public/app/features/transformers/editors/GroupByTransformerEditor.tsx b/public/app/features/transformers/editors/GroupByTransformerEditor.tsx index ca4386f541f..5dc4636bf59 100644 --- a/public/app/features/transformers/editors/GroupByTransformerEditor.tsx +++ b/public/app/features/transformers/editors/GroupByTransformerEditor.tsx @@ -11,11 +11,7 @@ import { TransformerCategory, GrafanaTheme2, } from '@grafana/data'; -import { - GroupByFieldOptions, - GroupByOperationID, - GroupByTransformerOptions, -} from '@grafana/data/src/transformations/transformers/groupBy'; +import { GroupByFieldOptions, GroupByOperationID, GroupByTransformerOptions } from '@grafana/data/internal'; import { useTheme2, Select, StatsPicker, InlineField, Stack, Alert } from '@grafana/ui'; import { getTransformationContent } from '../docs/getTransformationContent'; diff --git a/public/app/features/transformers/editors/GroupToNestedTableTransformerEditor.tsx b/public/app/features/transformers/editors/GroupToNestedTableTransformerEditor.tsx index 17170be06cc..9b874bf5c64 100644 --- a/public/app/features/transformers/editors/GroupToNestedTableTransformerEditor.tsx +++ b/public/app/features/transformers/editors/GroupToNestedTableTransformerEditor.tsx @@ -16,11 +16,9 @@ import { GroupByFieldOptions, GroupByOperationID, GroupByTransformerOptions, -} from '@grafana/data/src/transformations/transformers/groupBy'; -import { GroupToNestedTableTransformerOptions, SHOW_NESTED_HEADERS_DEFAULT, -} from '@grafana/data/src/transformations/transformers/groupToNestedTable'; +} from '@grafana/data/internal'; import { useTheme2, Select, StatsPicker, InlineField, Field, Switch, Alert, Stack } from '@grafana/ui'; import { useAllFieldNamesFromDataFrames } from '../utils'; diff --git a/public/app/features/transformers/editors/HistogramTransformerEditor.tsx b/public/app/features/transformers/editors/HistogramTransformerEditor.tsx index a257f02b0af..e9fa82aec13 100644 --- a/public/app/features/transformers/editors/HistogramTransformerEditor.tsx +++ b/public/app/features/transformers/editors/HistogramTransformerEditor.tsx @@ -7,10 +7,7 @@ import { TransformerUIProps, TransformerCategory, } from '@grafana/data'; -import { - histogramFieldInfo, - HistogramTransformerInputs, -} from '@grafana/data/src/transformations/transformers/histogram'; +import { histogramFieldInfo, HistogramTransformerInputs } from '@grafana/data/internal'; import { InlineField, InlineFieldRow, InlineSwitch } from '@grafana/ui'; import { getTransformationContent } from '../docs/getTransformationContent'; diff --git a/public/app/features/transformers/editors/JoinByFieldTransformerEditor.tsx b/public/app/features/transformers/editors/JoinByFieldTransformerEditor.tsx index cccf062d843..a28c8548780 100644 --- a/public/app/features/transformers/editors/JoinByFieldTransformerEditor.tsx +++ b/public/app/features/transformers/editors/JoinByFieldTransformerEditor.tsx @@ -8,7 +8,7 @@ import { TransformerUIProps, TransformerCategory, } from '@grafana/data'; -import { JoinByFieldOptions, JoinMode } from '@grafana/data/src/transformations/transformers/joinByField'; +import { JoinByFieldOptions, JoinMode } from '@grafana/data/internal'; import { getTemplateSrv } from '@grafana/runtime'; import { Select, InlineFieldRow, InlineField } from '@grafana/ui'; import { useFieldDisplayNames, useSelectOptions } from '@grafana/ui/internal'; diff --git a/public/app/features/transformers/editors/LabelsToFieldsTransformerEditor.tsx b/public/app/features/transformers/editors/LabelsToFieldsTransformerEditor.tsx index e41017a51a2..263aff71a36 100644 --- a/public/app/features/transformers/editors/LabelsToFieldsTransformerEditor.tsx +++ b/public/app/features/transformers/editors/LabelsToFieldsTransformerEditor.tsx @@ -8,10 +8,7 @@ import { TransformerUIProps, TransformerCategory, } from '@grafana/data'; -import { - LabelsToFieldsMode, - LabelsToFieldsOptions, -} from '@grafana/data/src/transformations/transformers/labelsToFields'; +import { LabelsToFieldsMode, LabelsToFieldsOptions } from '@grafana/data/internal'; import { InlineField, InlineFieldRow, RadioButtonGroup, Select, FilterPill, Stack } from '@grafana/ui'; import { getTransformationContent } from '../docs/getTransformationContent'; diff --git a/public/app/features/transformers/editors/LimitTransformerEditor.tsx b/public/app/features/transformers/editors/LimitTransformerEditor.tsx index c55cb9bbfd3..fd10293e2ce 100644 --- a/public/app/features/transformers/editors/LimitTransformerEditor.tsx +++ b/public/app/features/transformers/editors/LimitTransformerEditor.tsx @@ -7,7 +7,7 @@ import { TransformerUIProps, TransformerCategory, } from '@grafana/data'; -import { LimitTransformerOptions } from '@grafana/data/src/transformations/transformers/limit'; +import { LimitTransformerOptions } from '@grafana/data/internal'; import { InlineFieldRow } from '@grafana/ui'; import { getTransformationContent } from '../docs/getTransformationContent'; diff --git a/public/app/features/transformers/editors/MergeTransformerEditor.tsx b/public/app/features/transformers/editors/MergeTransformerEditor.tsx index cd55fbd5543..c81f59bcf9b 100644 --- a/public/app/features/transformers/editors/MergeTransformerEditor.tsx +++ b/public/app/features/transformers/editors/MergeTransformerEditor.tsx @@ -5,7 +5,7 @@ import { TransformerUIProps, TransformerCategory, } from '@grafana/data'; -import { MergeTransformerOptions } from '@grafana/data/src/transformations/transformers/merge'; +import { MergeTransformerOptions } from '@grafana/data/internal'; import { FieldValidationMessage } from '@grafana/ui'; import { getTransformationContent } from '../docs/getTransformationContent'; diff --git a/public/app/features/transformers/editors/OrganizeFieldsTransformerEditor.tsx b/public/app/features/transformers/editors/OrganizeFieldsTransformerEditor.tsx index ef640a79dad..b253066abbf 100644 --- a/public/app/features/transformers/editors/OrganizeFieldsTransformerEditor.tsx +++ b/public/app/features/transformers/editors/OrganizeFieldsTransformerEditor.tsx @@ -10,8 +10,7 @@ import { TransformerUIProps, TransformerCategory, } from '@grafana/data'; -import { createOrderFieldsComparer } from '@grafana/data/src/transformations/transformers/order'; -import { OrganizeFieldsTransformerOptions } from '@grafana/data/src/transformations/transformers/organize'; +import { createOrderFieldsComparer, OrganizeFieldsTransformerOptions } from '@grafana/data/internal'; import { Input, IconButton, diff --git a/public/app/features/transformers/editors/ReduceTransformerEditor.tsx b/public/app/features/transformers/editors/ReduceTransformerEditor.tsx index fc8e10c6b7e..3131e85be1d 100644 --- a/public/app/features/transformers/editors/ReduceTransformerEditor.tsx +++ b/public/app/features/transformers/editors/ReduceTransformerEditor.tsx @@ -9,7 +9,7 @@ import { TransformerUIProps, TransformerCategory, } from '@grafana/data'; -import { ReduceTransformerMode, ReduceTransformerOptions } from '@grafana/data/src/transformations/transformers/reduce'; +import { ReduceTransformerMode, ReduceTransformerOptions } from '@grafana/data/internal'; import { selectors } from '@grafana/e2e-selectors'; import { InlineField, Select, StatsPicker, InlineSwitch } from '@grafana/ui'; diff --git a/public/app/features/transformers/editors/RenameByRegexTransformer.tsx b/public/app/features/transformers/editors/RenameByRegexTransformer.tsx index d192c4a9ee0..4530ad8b84a 100644 --- a/public/app/features/transformers/editors/RenameByRegexTransformer.tsx +++ b/public/app/features/transformers/editors/RenameByRegexTransformer.tsx @@ -8,7 +8,7 @@ import { stringToJsRegex, TransformerCategory, } from '@grafana/data'; -import { RenameByRegexTransformerOptions } from '@grafana/data/src/transformations/transformers/renameByRegex'; +import { RenameByRegexTransformerOptions } from '@grafana/data/internal'; import { InlineField, Input } from '@grafana/ui'; import { getTransformationContent } from '../docs/getTransformationContent'; diff --git a/public/app/features/transformers/editors/SeriesToRowsTransformerEditor.tsx b/public/app/features/transformers/editors/SeriesToRowsTransformerEditor.tsx index 606d0cdb417..8b3b66e64ed 100644 --- a/public/app/features/transformers/editors/SeriesToRowsTransformerEditor.tsx +++ b/public/app/features/transformers/editors/SeriesToRowsTransformerEditor.tsx @@ -5,7 +5,7 @@ import { TransformerUIProps, TransformerCategory, } from '@grafana/data'; -import { SeriesToRowsTransformerOptions } from '@grafana/data/src/transformations/transformers/seriesToRows'; +import { SeriesToRowsTransformerOptions } from '@grafana/data/internal'; import { getTransformationContent } from '../docs/getTransformationContent'; diff --git a/public/app/features/transformers/editors/SortByTransformerEditor.tsx b/public/app/features/transformers/editors/SortByTransformerEditor.tsx index 3faa19ebf8f..4247e1c4f66 100644 --- a/public/app/features/transformers/editors/SortByTransformerEditor.tsx +++ b/public/app/features/transformers/editors/SortByTransformerEditor.tsx @@ -7,7 +7,7 @@ import { TransformerUIProps, TransformerCategory, } from '@grafana/data'; -import { SortByField, SortByTransformerOptions } from '@grafana/data/src/transformations/transformers/sortBy'; +import { SortByField, SortByTransformerOptions } from '@grafana/data/internal'; import { getTemplateSrv } from '@grafana/runtime'; import { InlineField, InlineSwitch, InlineFieldRow, Select } from '@grafana/ui'; diff --git a/public/app/features/transformers/editors/TransposeTransformerEditor.tsx b/public/app/features/transformers/editors/TransposeTransformerEditor.tsx index 4190d385e48..9ba613fe78c 100644 --- a/public/app/features/transformers/editors/TransposeTransformerEditor.tsx +++ b/public/app/features/transformers/editors/TransposeTransformerEditor.tsx @@ -5,7 +5,7 @@ import { TransformerUIProps, TransformerCategory, } from '@grafana/data'; -import { TransposeTransformerOptions } from '@grafana/data/src/transformations/transformers/transpose'; +import { TransposeTransformerOptions } from '@grafana/data/internal'; import { InlineField, InlineFieldRow, Input } from '@grafana/ui'; export const TransposeTransfomerEditor = ({ options, onChange }: TransformerUIProps) => { diff --git a/public/app/features/transformers/extractFields/extractFields.test.ts b/public/app/features/transformers/extractFields/extractFields.test.ts index a6617aecea9..863b89163ca 100644 --- a/public/app/features/transformers/extractFields/extractFields.test.ts +++ b/public/app/features/transformers/extractFields/extractFields.test.ts @@ -5,10 +5,9 @@ import { Field, FieldType, transformDataFrame, + toDataFrame, } from '@grafana/data'; -import { toDataFrame } from '@grafana/data/src/dataframe/processDataFrame'; -import { SortByTransformerOptions, sortByTransformer } from '@grafana/data/src/transformations/transformers/sortBy'; -import { mockTransformationsRegistry } from '@grafana/data/src/utils/tests/mockTransformationsRegistry'; +import { mockTransformationsRegistry, SortByTransformerOptions, sortByTransformer } from '@grafana/data/internal'; import { extractFieldsTransformer } from './extractFields'; import { ExtractFieldsOptions, FieldExtractorID } from './types'; diff --git a/public/app/features/transformers/lookupGazetteer/fieldLookup.test.ts b/public/app/features/transformers/lookupGazetteer/fieldLookup.test.ts index 7f0072dd4d7..bc0ef8c8b82 100644 --- a/public/app/features/transformers/lookupGazetteer/fieldLookup.test.ts +++ b/public/app/features/transformers/lookupGazetteer/fieldLookup.test.ts @@ -1,6 +1,4 @@ -import { FieldMatcherID, fieldMatchers, FieldType } from '@grafana/data'; -import { toDataFrame } from '@grafana/data/src/dataframe/processDataFrame'; -import { DataTransformerID } from '@grafana/data/src/transformations/transformers/ids'; +import { DataTransformerID, toDataFrame, FieldMatcherID, fieldMatchers, FieldType } from '@grafana/data'; import { frameAsGazetter } from 'app/features/geo/gazetteer/gazetteer'; import { addFieldsFromGazetteer } from './fieldLookup'; diff --git a/public/app/features/transformers/partitionByValues/partitionByValues.ts b/public/app/features/transformers/partitionByValues/partitionByValues.ts index 80c349fe762..4ab8d360cbe 100644 --- a/public/app/features/transformers/partitionByValues/partitionByValues.ts +++ b/public/app/features/transformers/partitionByValues/partitionByValues.ts @@ -8,8 +8,7 @@ import { DataTransformContext, FieldMatcher, } from '@grafana/data'; -import { getMatcherConfig } from '@grafana/data/src/transformations/transformers/filterByName'; -import { noopTransformer } from '@grafana/data/src/transformations/transformers/noop'; +import { getMatcherConfig, noopTransformer } from '@grafana/data/internal'; import { partition } from './partition'; diff --git a/public/app/features/transformers/spatial/optionsHelper.tsx b/public/app/features/transformers/spatial/optionsHelper.tsx index 49f77cf7927..e493dfc7d0c 100644 --- a/public/app/features/transformers/spatial/optionsHelper.tsx +++ b/public/app/features/transformers/spatial/optionsHelper.tsx @@ -1,8 +1,7 @@ import { set, get as lodashGet } from 'lodash'; import { StandardEditorContext, TransformerUIProps, PanelOptionsEditorBuilder } from '@grafana/data'; -import { PanelOptionsSupplier } from '@grafana/data/src/panel/PanelPlugin'; -import { NestedValueAccess } from '@grafana/data/src/utils/OptionsUIBuilders'; +import { NestedValueAccess, PanelOptionsSupplier } from '@grafana/data/internal'; import { OptionsPaneCategoryDescriptor } from 'app/features/dashboard/components/PanelEditor/OptionsPaneCategoryDescriptor'; import { fillOptionsPaneItems } from 'app/features/dashboard/components/PanelEditor/getVisualizationOptions'; import { setOptionImmutably } from 'app/features/dashboard/components/PanelEditor/utils'; diff --git a/public/app/features/transformers/spatial/spatialTransformer.test.ts b/public/app/features/transformers/spatial/spatialTransformer.test.ts index b36315fefe5..196a6b3680d 100644 --- a/public/app/features/transformers/spatial/spatialTransformer.test.ts +++ b/public/app/features/transformers/spatial/spatialTransformer.test.ts @@ -1,6 +1,5 @@ -import { FieldMatcherID, fieldMatchers, FieldType } from '@grafana/data'; -import { toDataFrame } from '@grafana/data/src/dataframe/processDataFrame'; -import { DataTransformerID } from '@grafana/data/src/transformations/transformers/ids'; +import { toDataFrame, FieldMatcherID, fieldMatchers, FieldType } from '@grafana/data'; +import { DataTransformerID } from '@grafana/data/internal'; import { frameAsGazetter } from 'app/features/geo/gazetteer/gazetteer'; describe('spatial transformer', () => { diff --git a/public/app/features/variables/datasource/actions.test.ts b/public/app/features/variables/datasource/actions.test.ts index 4d3a5ca8e94..2a0b42b30ff 100644 --- a/public/app/features/variables/datasource/actions.test.ts +++ b/public/app/features/variables/datasource/actions.test.ts @@ -1,5 +1,5 @@ import { DataSourceInstanceSettings } from '@grafana/data'; -import { getMockPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getMockPlugin } from '@grafana/data/test'; import { reduxTester } from '../../../../test/core/redux/reduxTester'; import { variableAdapters } from '../adapters'; diff --git a/public/app/features/variables/datasource/reducer.test.ts b/public/app/features/variables/datasource/reducer.test.ts index 2acb6e96346..6a3abaa27cb 100644 --- a/public/app/features/variables/datasource/reducer.test.ts +++ b/public/app/features/variables/datasource/reducer.test.ts @@ -1,7 +1,7 @@ import { cloneDeep } from 'lodash'; import { DataSourceInstanceSettings, DataSourceVariableModel } from '@grafana/data'; -import { getMockPlugins } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getMockPlugins } from '@grafana/data/test'; import { reducerTester } from '../../../../test/core/redux/reducerTester'; import { getDataSourceInstanceSetting } from '../shared/testing/helpers'; diff --git a/public/app/features/variables/state/initVariableTransaction.test.ts b/public/app/features/variables/state/initVariableTransaction.test.ts index ba9939b8442..0e9c0070023 100644 --- a/public/app/features/variables/state/initVariableTransaction.test.ts +++ b/public/app/features/variables/state/initVariableTransaction.test.ts @@ -1,4 +1,4 @@ -import { DataSourceRef, LoadingState } from '@grafana/data/src'; +import { DataSourceRef, LoadingState } from '@grafana/data'; import { setDataSourceSrv } from '@grafana/runtime/src'; import { DashboardModel } from 'app/features/dashboard/state/DashboardModel'; diff --git a/public/app/features/variables/state/migrateVariablesDatasourceNameToRef.test.ts b/public/app/features/variables/state/migrateVariablesDatasourceNameToRef.test.ts index aea1a31a10b..7673e9bf8d5 100644 --- a/public/app/features/variables/state/migrateVariablesDatasourceNameToRef.test.ts +++ b/public/app/features/variables/state/migrateVariablesDatasourceNameToRef.test.ts @@ -1,4 +1,4 @@ -import { DataSourceRef } from '@grafana/data/src'; +import { DataSourceRef } from '@grafana/data'; import { adHocBuilder, queryBuilder } from '../shared/testing/builders'; import { toVariablePayload } from '../utils'; diff --git a/public/app/plugins/datasource/azuremonitor/__mocks__/utils.ts b/public/app/plugins/datasource/azuremonitor/__mocks__/utils.ts index 921573b797e..3e0204fdd6e 100644 --- a/public/app/plugins/datasource/azuremonitor/__mocks__/utils.ts +++ b/public/app/plugins/datasource/azuremonitor/__mocks__/utils.ts @@ -1,5 +1,4 @@ -import { VariableType, VariableWithOptions } from '@grafana/data'; -import { LoadingState } from '@grafana/data/src/types/data'; +import { LoadingState, VariableType, VariableWithOptions } from '@grafana/data'; interface TemplateableValue { variableName: string; diff --git a/public/app/plugins/datasource/azuremonitor/components/LogsQueryEditor/RawQuery.tsx b/public/app/plugins/datasource/azuremonitor/components/LogsQueryEditor/RawQuery.tsx index 742b12b9d50..bbf7c27cc5c 100644 --- a/public/app/plugins/datasource/azuremonitor/components/LogsQueryEditor/RawQuery.tsx +++ b/public/app/plugins/datasource/azuremonitor/components/LogsQueryEditor/RawQuery.tsx @@ -1,7 +1,7 @@ import { css, cx } from '@emotion/css'; import Prism, { Grammar } from 'prismjs'; -import { GrafanaTheme2 } from '@grafana/data/src'; +import { GrafanaTheme2 } from '@grafana/data'; import { useTheme2 } from '@grafana/ui'; export interface Props { diff --git a/public/app/plugins/datasource/cloudwatch/query-runner/CloudWatchMetricsQueryRunner.test.ts b/public/app/plugins/datasource/cloudwatch/query-runner/CloudWatchMetricsQueryRunner.test.ts index 637328f022a..7654c6228cd 100644 --- a/public/app/plugins/datasource/cloudwatch/query-runner/CloudWatchMetricsQueryRunner.test.ts +++ b/public/app/plugins/datasource/cloudwatch/query-runner/CloudWatchMetricsQueryRunner.test.ts @@ -1,7 +1,6 @@ import { of } from 'rxjs'; -import { CustomVariableModel, getFrameDisplayName, VariableHide } from '@grafana/data'; -import { dateTime } from '@grafana/data/src/datetime/moment_wrapper'; +import { dateTime, CustomVariableModel, getFrameDisplayName, VariableHide } from '@grafana/data'; import { toDataQueryResponse } from '@grafana/runtime'; import { diff --git a/public/app/plugins/datasource/dashboard/datasource.test.ts b/public/app/plugins/datasource/dashboard/datasource.test.ts index 114bb966941..a543c5037d4 100644 --- a/public/app/plugins/datasource/dashboard/datasource.test.ts +++ b/public/app/plugins/datasource/dashboard/datasource.test.ts @@ -8,7 +8,7 @@ import { LoadingState, standardTransformersRegistry, } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { setPluginImportUtils } from '@grafana/runtime'; import { SafeSerializableSceneObject, diff --git a/public/app/plugins/datasource/elasticsearch/ElasticResponse.ts b/public/app/plugins/datasource/elasticsearch/ElasticResponse.ts index 5b46beee758..103a571b8a6 100644 --- a/public/app/plugins/datasource/elasticsearch/ElasticResponse.ts +++ b/public/app/plugins/datasource/elasticsearch/ElasticResponse.ts @@ -8,7 +8,7 @@ import { MutableDataFrame, PreferredVisualisationType, } from '@grafana/data'; -import { convertFieldType } from '@grafana/data/src/transformations/transformers/convertFieldType'; +import { convertFieldType } from '@grafana/data/internal'; import TableModel from 'app/core/TableModel'; import { isMetricAggregationWithField } from './components/QueryEditor/MetricAggregationsEditor/aggregations'; diff --git a/public/app/plugins/datasource/influxdb/components/editor/annotation/AnnotationEditor.tsx b/public/app/plugins/datasource/influxdb/components/editor/annotation/AnnotationEditor.tsx index a0feea2669b..71418a7904e 100644 --- a/public/app/plugins/datasource/influxdb/components/editor/annotation/AnnotationEditor.tsx +++ b/public/app/plugins/datasource/influxdb/components/editor/annotation/AnnotationEditor.tsx @@ -1,6 +1,6 @@ import { useState } from 'react'; -import { QueryEditorProps } from '@grafana/data/src'; +import { QueryEditorProps } from '@grafana/data'; import { InlineFormLabel, Input, Stack } from '@grafana/ui'; import InfluxDatasource from '../../../datasource'; diff --git a/public/app/plugins/datasource/influxdb/components/editor/constants.ts b/public/app/plugins/datasource/influxdb/components/editor/constants.ts index e234d7652ea..f9f0c4850a5 100644 --- a/public/app/plugins/datasource/influxdb/components/editor/constants.ts +++ b/public/app/plugins/datasource/influxdb/components/editor/constants.ts @@ -1,4 +1,4 @@ -import { SelectableValue } from '@grafana/data/src'; +import { SelectableValue } from '@grafana/data'; import { ResultFormat } from '../../types'; diff --git a/public/app/plugins/datasource/influxdb/components/editor/query/QueryEditor.tsx b/public/app/plugins/datasource/influxdb/components/editor/query/QueryEditor.tsx index acb8d949f4c..079bb5ba02e 100644 --- a/public/app/plugins/datasource/influxdb/components/editor/query/QueryEditor.tsx +++ b/public/app/plugins/datasource/influxdb/components/editor/query/QueryEditor.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/css'; -import { QueryEditorProps } from '@grafana/data/src'; +import { QueryEditorProps } from '@grafana/data'; import InfluxDatasource from '../../../datasource'; import { buildRawQuery } from '../../../queryUtils'; diff --git a/public/app/plugins/datasource/influxdb/components/editor/query/flux/FluxQueryEditor.tsx b/public/app/plugins/datasource/influxdb/components/editor/query/flux/FluxQueryEditor.tsx index b5b594f3445..daedc65855e 100644 --- a/public/app/plugins/datasource/influxdb/components/editor/query/flux/FluxQueryEditor.tsx +++ b/public/app/plugins/datasource/influxdb/components/editor/query/flux/FluxQueryEditor.tsx @@ -1,7 +1,7 @@ import { css, cx } from '@emotion/css'; import { PureComponent } from 'react'; -import { GrafanaTheme2, SelectableValue } from '@grafana/data/src'; +import { GrafanaTheme2, SelectableValue } from '@grafana/data'; import { getTemplateSrv } from '@grafana/runtime/src'; import { CodeEditor, diff --git a/public/app/plugins/datasource/influxdb/components/editor/query/fsql/FSQLEditor.tsx b/public/app/plugins/datasource/influxdb/components/editor/query/fsql/FSQLEditor.tsx index 4858da88623..e25e951c25d 100644 --- a/public/app/plugins/datasource/influxdb/components/editor/query/fsql/FSQLEditor.tsx +++ b/public/app/plugins/datasource/influxdb/components/editor/query/fsql/FSQLEditor.tsx @@ -1,7 +1,7 @@ import { css, cx } from '@emotion/css'; import { PureComponent } from 'react'; -import { GrafanaTheme2 } from '@grafana/data/src'; +import { GrafanaTheme2 } from '@grafana/data'; import { SQLQuery, SqlQueryEditorLazy, applyQueryDefaults } from '@grafana/sql'; import { InlineFormLabel, LinkButton, Themeable2, withTheme2 } from '@grafana/ui'; diff --git a/public/app/plugins/datasource/influxdb/components/editor/query/influxql/utils/getTemplateVariableOptions.ts b/public/app/plugins/datasource/influxdb/components/editor/query/influxql/utils/getTemplateVariableOptions.ts index 51db862e4d9..b3e9860798e 100644 --- a/public/app/plugins/datasource/influxdb/components/editor/query/influxql/utils/getTemplateVariableOptions.ts +++ b/public/app/plugins/datasource/influxdb/components/editor/query/influxql/utils/getTemplateVariableOptions.ts @@ -1,4 +1,4 @@ -import { TypedVariableModel } from '@grafana/data/src'; +import { TypedVariableModel } from '@grafana/data'; import { getTemplateSrv } from '@grafana/runtime/src'; export function getTemplateVariableOptions(wrapper: (v: TypedVariableModel) => string) { diff --git a/public/app/plugins/datasource/influxdb/components/editor/query/influxql/utils/withTemplateVariableOptions.ts b/public/app/plugins/datasource/influxdb/components/editor/query/influxql/utils/withTemplateVariableOptions.ts index 89bd1372bcd..c346946dbfc 100644 --- a/public/app/plugins/datasource/influxdb/components/editor/query/influxql/utils/withTemplateVariableOptions.ts +++ b/public/app/plugins/datasource/influxdb/components/editor/query/influxql/utils/withTemplateVariableOptions.ts @@ -1,5 +1,5 @@ // helper function to make it easy to call this from the widget-render-code -import { TypedVariableModel } from '@grafana/data/src'; +import { TypedVariableModel } from '@grafana/data'; import { getTemplateVariableOptions } from './getTemplateVariableOptions'; diff --git a/public/app/plugins/datasource/influxdb/components/editor/query/influxql/utils/wrapper.ts b/public/app/plugins/datasource/influxdb/components/editor/query/influxql/utils/wrapper.ts index 769a9a435a4..745ada1dd39 100644 --- a/public/app/plugins/datasource/influxdb/components/editor/query/influxql/utils/wrapper.ts +++ b/public/app/plugins/datasource/influxdb/components/editor/query/influxql/utils/wrapper.ts @@ -1,4 +1,4 @@ -import { TypedVariableModel } from '@grafana/data/src'; +import { TypedVariableModel } from '@grafana/data'; export function wrapRegex(v: TypedVariableModel): string { return `/^$${v.name}$/`; diff --git a/public/app/plugins/datasource/influxdb/influxql_metadata_query.ts b/public/app/plugins/datasource/influxdb/influxql_metadata_query.ts index b343f668018..314b70c2d15 100644 --- a/public/app/plugins/datasource/influxdb/influxql_metadata_query.ts +++ b/public/app/plugins/datasource/influxdb/influxql_metadata_query.ts @@ -1,4 +1,4 @@ -import { ScopedVars } from '@grafana/data/src'; +import { ScopedVars } from '@grafana/data'; import config from 'app/core/config'; import InfluxDatasource from './datasource'; diff --git a/public/app/plugins/datasource/tempo/_importedDependencies/datasources/prometheus/RawQuery.tsx b/public/app/plugins/datasource/tempo/_importedDependencies/datasources/prometheus/RawQuery.tsx index 742b12b9d50..bbf7c27cc5c 100644 --- a/public/app/plugins/datasource/tempo/_importedDependencies/datasources/prometheus/RawQuery.tsx +++ b/public/app/plugins/datasource/tempo/_importedDependencies/datasources/prometheus/RawQuery.tsx @@ -1,7 +1,7 @@ import { css, cx } from '@emotion/css'; import Prism, { Grammar } from 'prismjs'; -import { GrafanaTheme2 } from '@grafana/data/src'; +import { GrafanaTheme2 } from '@grafana/data'; import { useTheme2 } from '@grafana/ui'; export interface Props { diff --git a/public/app/plugins/datasource/tempo/types.ts b/public/app/plugins/datasource/tempo/types.ts index de6c050fb6c..02dbe712969 100644 --- a/public/app/plugins/datasource/tempo/types.ts +++ b/public/app/plugins/datasource/tempo/types.ts @@ -1,4 +1,4 @@ -import { DataSourceJsonData } from '@grafana/data/src'; +import { DataSourceJsonData } from '@grafana/data'; import { NodeGraphOptions, TraceToLogsOptions } from '@grafana/o11y-ds-frontend'; import { TempoQuery as TempoBase, TempoQueryType, TraceqlFilter } from './dataquery.gen'; diff --git a/public/app/plugins/panel/barchart/bars.ts b/public/app/plugins/panel/barchart/bars.ts index 7d3e318eea3..40a3c62f73d 100644 --- a/public/app/plugins/panel/barchart/bars.ts +++ b/public/app/plugins/panel/barchart/bars.ts @@ -1,7 +1,6 @@ import uPlot, { Axis, AlignedData, Scale } from 'uplot'; -import { DataFrame, dateTimeFormat, GrafanaTheme2, systemDateFormats, TimeZone } from '@grafana/data'; -import { alpha } from '@grafana/data/src/themes/colorManipulator'; +import { colorManipulator, DataFrame, dateTimeFormat, GrafanaTheme2, systemDateFormats, TimeZone } from '@grafana/data'; import { StackingMode, VisibilityMode, @@ -545,7 +544,8 @@ export function getConfig(opts: BarsOptions, theme: GrafanaTheme2) { }); barsColors.push({ - fill: fillOpacity < 1 ? colors.map((c) => (c != null ? alpha(c, fillOpacity) : null)) : colors, + fill: + fillOpacity < 1 ? colors.map((c) => (c != null ? colorManipulator.alpha(c, fillOpacity) : null)) : colors, stroke: colors, }); } diff --git a/public/app/plugins/panel/barchart/utils.ts b/public/app/plugins/panel/barchart/utils.ts index 79d9629b11b..fba262b7abe 100644 --- a/public/app/plugins/panel/barchart/utils.ts +++ b/public/app/plugins/panel/barchart/utils.ts @@ -13,7 +13,7 @@ import { getFieldSeriesColor, outerJoinDataFrames, } from '@grafana/data'; -import { decoupleHideFromState } from '@grafana/data/src/field/fieldState'; +import { decoupleHideFromState } from '@grafana/data/internal'; import { AxisColorMode, AxisPlacement, diff --git a/public/app/plugins/panel/bargauge/BarGaugeLegend.tsx b/public/app/plugins/panel/bargauge/BarGaugeLegend.tsx index 0ddecee36f6..5364552267a 100644 --- a/public/app/plugins/panel/bargauge/BarGaugeLegend.tsx +++ b/public/app/plugins/panel/bargauge/BarGaugeLegend.tsx @@ -1,7 +1,6 @@ import { memo } from 'react'; -import { cacheFieldDisplayNames, DataFrame, FieldType, getFieldSeriesColor } from '@grafana/data'; -import { Field } from '@grafana/data/'; +import { Field, cacheFieldDisplayNames, DataFrame, FieldType, getFieldSeriesColor } from '@grafana/data'; import { AxisPlacement, VizLegendOptions } from '@grafana/schema'; import { useTheme2, VizLayout, VizLayoutLegendProps, VizLegend, VizLegendItem } from '@grafana/ui'; import { getDisplayValuesForCalcs } from '@grafana/ui/internal'; diff --git a/public/app/plugins/panel/candlestick/fields.ts b/public/app/plugins/panel/candlestick/fields.ts index c370b953a72..5019dfe06d0 100644 --- a/public/app/plugins/panel/candlestick/fields.ts +++ b/public/app/plugins/panel/candlestick/fields.ts @@ -7,7 +7,7 @@ import { outerJoinDataFrames, TimeRange, } from '@grafana/data'; -import { maybeSortFrame } from '@grafana/data/src/transformations/transformers/joinDataFrames'; +import { maybeSortFrame } from '@grafana/data/internal'; import { findField } from 'app/features/dimensions'; import { prepareGraphableFields } from '../timeseries/utils'; diff --git a/public/app/plugins/panel/canvas/components/CanvasTooltip.tsx b/public/app/plugins/panel/canvas/components/CanvasTooltip.tsx index aa756baa9c8..ceb17a8ce7d 100644 --- a/public/app/plugins/panel/canvas/components/CanvasTooltip.tsx +++ b/public/app/plugins/panel/canvas/components/CanvasTooltip.tsx @@ -12,8 +12,8 @@ import { getFieldDisplayName, ScopedVars, ValueLinkConfig, -} from '@grafana/data/src'; -import { ActionModel } from '@grafana/data/src/types/action'; + ActionModel, +} from '@grafana/data'; import { Portal, useStyles2, VizTooltipContainer } from '@grafana/ui'; import { VizTooltipContent, diff --git a/public/app/plugins/panel/canvas/editor/connectionEditor.tsx b/public/app/plugins/panel/canvas/editor/connectionEditor.tsx index 96e8a21b331..869bcec4adb 100644 --- a/public/app/plugins/panel/canvas/editor/connectionEditor.tsx +++ b/public/app/plugins/panel/canvas/editor/connectionEditor.tsx @@ -1,6 +1,6 @@ import { get as lodashGet } from 'lodash'; -import { NestedPanelOptions, NestedValueAccess } from '@grafana/data/src/utils/OptionsUIBuilders'; +import { NestedPanelOptions, NestedValueAccess } from '@grafana/data/internal'; import { Scene } from 'app/features/canvas/runtime/scene'; import { setOptionImmutably } from 'app/features/dashboard/components/PanelEditor/utils'; diff --git a/public/app/plugins/panel/canvas/editor/element/QuickPositioning.tsx b/public/app/plugins/panel/canvas/editor/element/QuickPositioning.tsx index acfe2f3b755..c63a14aabc6 100644 --- a/public/app/plugins/panel/canvas/editor/element/QuickPositioning.tsx +++ b/public/app/plugins/panel/canvas/editor/element/QuickPositioning.tsx @@ -1,6 +1,6 @@ import { css } from '@emotion/css'; -import { GrafanaTheme2 } from '@grafana/data/src'; +import { GrafanaTheme2 } from '@grafana/data'; import { IconButton, useStyles2 } from '@grafana/ui'; import { ElementState } from 'app/features/canvas/runtime/element'; import { QuickPlacement } from 'app/features/canvas/types'; diff --git a/public/app/plugins/panel/canvas/editor/element/elementEditor.tsx b/public/app/plugins/panel/canvas/editor/element/elementEditor.tsx index bdad1130a50..4e0164319ea 100644 --- a/public/app/plugins/panel/canvas/editor/element/elementEditor.tsx +++ b/public/app/plugins/panel/canvas/editor/element/elementEditor.tsx @@ -1,6 +1,6 @@ import { get as lodashGet } from 'lodash'; -import { NestedPanelOptions, NestedValueAccess } from '@grafana/data/src/utils/OptionsUIBuilders'; +import { NestedPanelOptions, NestedValueAccess } from '@grafana/data/internal'; import { CanvasElementOptions } from 'app/features/canvas/element'; import { canvasElementRegistry, diff --git a/public/app/plugins/panel/canvas/editor/inline/InlineEditBody.tsx b/public/app/plugins/panel/canvas/editor/inline/InlineEditBody.tsx index 5b13b982eb8..8c6a2764035 100644 --- a/public/app/plugins/panel/canvas/editor/inline/InlineEditBody.tsx +++ b/public/app/plugins/panel/canvas/editor/inline/InlineEditBody.tsx @@ -4,8 +4,7 @@ import { useMemo, useState } from 'react'; import { useObservable } from 'react-use'; import { DataFrame, GrafanaTheme2, PanelOptionsEditorBuilder, StandardEditorContext } from '@grafana/data'; -import { PanelOptionsSupplier } from '@grafana/data/src/panel/PanelPlugin'; -import { NestedValueAccess } from '@grafana/data/src/utils/OptionsUIBuilders'; +import { NestedValueAccess, PanelOptionsSupplier } from '@grafana/data/internal'; import { useStyles2 } from '@grafana/ui'; import { AddLayerButton } from 'app/core/components/Layers/AddLayerButton'; import { FrameState } from 'app/features/canvas/runtime/frame'; diff --git a/public/app/plugins/panel/canvas/editor/layer/layerEditor.tsx b/public/app/plugins/panel/canvas/editor/layer/layerEditor.tsx index 59c9b40fd46..69a0e9aa29e 100644 --- a/public/app/plugins/panel/canvas/editor/layer/layerEditor.tsx +++ b/public/app/plugins/panel/canvas/editor/layer/layerEditor.tsx @@ -1,6 +1,6 @@ import { get as lodashGet } from 'lodash'; -import { NestedPanelOptions, NestedValueAccess } from '@grafana/data/src/utils/OptionsUIBuilders'; +import { NestedPanelOptions, NestedValueAccess } from '@grafana/data/internal'; import { ElementState } from 'app/features/canvas/runtime/element'; import { FrameState } from 'app/features/canvas/runtime/frame'; import { Scene } from 'app/features/canvas/runtime/scene'; diff --git a/public/app/plugins/panel/canvas/editor/options.ts b/public/app/plugins/panel/canvas/editor/options.ts index 221ab5f7979..48640dfddb0 100644 --- a/public/app/plugins/panel/canvas/editor/options.ts +++ b/public/app/plugins/panel/canvas/editor/options.ts @@ -1,7 +1,7 @@ import { capitalize } from 'lodash'; import { FieldType } from '@grafana/data'; -import { PanelOptionsSupplier } from '@grafana/data/src/panel/PanelPlugin'; +import { PanelOptionsSupplier } from '@grafana/data/internal'; import { ConnectionDirection } from 'app/features/canvas/element'; import { SVGElements } from 'app/features/canvas/runtime/element'; import { ColorDimensionEditor, ResourceDimensionEditor, ScaleDimensionEditor } from 'app/features/dimensions/editors'; diff --git a/public/app/plugins/panel/canvas/utils.ts b/public/app/plugins/panel/canvas/utils.ts index bf5fb30b15f..386466d3378 100644 --- a/public/app/plugins/panel/canvas/utils.ts +++ b/public/app/plugins/panel/canvas/utils.ts @@ -1,7 +1,6 @@ import { isNumber, isString } from 'lodash'; -import { AppEvents, getFieldDisplayName, PluginState, SelectableValue } from '@grafana/data'; -import { DataFrame, Field } from '@grafana/data/'; +import { DataFrame, Field, AppEvents, getFieldDisplayName, PluginState, SelectableValue } from '@grafana/data'; import appEvents from 'app/core/app_events'; import { hasAlphaPanels, config } from 'app/core/config'; import { diff --git a/public/app/plugins/panel/datagrid/components/DatagridContextMenu.tsx b/public/app/plugins/panel/datagrid/components/DatagridContextMenu.tsx index f9629ce7053..1e06330c88d 100644 --- a/public/app/plugins/panel/datagrid/components/DatagridContextMenu.tsx +++ b/public/app/plugins/panel/datagrid/components/DatagridContextMenu.tsx @@ -3,7 +3,7 @@ import { capitalize } from 'lodash'; import * as React from 'react'; import { DataFrame, FieldType } from '@grafana/data'; -import { convertFieldType } from '@grafana/data/src/transformations/transformers/convertFieldType'; +import { convertFieldType } from '@grafana/data/internal'; import { reportInteraction } from '@grafana/runtime'; import { ContextMenu, MenuGroup, MenuItem } from '@grafana/ui'; import { MenuDivider } from '@grafana/ui/internal'; diff --git a/public/app/plugins/panel/geomap/components/MarkersLegend.tsx b/public/app/plugins/panel/geomap/components/MarkersLegend.tsx index 2d6cdabfc5d..34eda649940 100644 --- a/public/app/plugins/panel/geomap/components/MarkersLegend.tsx +++ b/public/app/plugins/panel/geomap/components/MarkersLegend.tsx @@ -4,8 +4,13 @@ import { useMemo } from 'react'; import { useObservable } from 'react-use'; import { of } from 'rxjs'; -import { DataFrame, formattedValueToString, getFieldColorModeForField, GrafanaTheme2 } from '@grafana/data'; -import { getMinMaxAndDelta } from '@grafana/data/src/field/scale'; +import { + getMinMaxAndDelta, + DataFrame, + formattedValueToString, + getFieldColorModeForField, + GrafanaTheme2, +} from '@grafana/data'; import { useStyles2, VizLegendItem } from '@grafana/ui'; import { ColorScale } from 'app/core/components/ColorScale/ColorScale'; import { SanitizedSVG } from 'app/core/components/SVG/SanitizedSVG'; diff --git a/public/app/plugins/panel/geomap/editor/layerEditor.tsx b/public/app/plugins/panel/geomap/editor/layerEditor.tsx index e0676fab740..064e6189cf7 100644 --- a/public/app/plugins/panel/geomap/editor/layerEditor.tsx +++ b/public/app/plugins/panel/geomap/editor/layerEditor.tsx @@ -1,7 +1,7 @@ import { get as lodashGet, isEqual } from 'lodash'; import { FrameGeometrySourceMode, getFrameMatchers, MapLayerOptions } from '@grafana/data'; -import { NestedPanelOptions, NestedValueAccess } from '@grafana/data/src/utils/OptionsUIBuilders'; +import { NestedPanelOptions, NestedValueAccess } from '@grafana/data/internal'; import { setOptionImmutably } from 'app/features/dashboard/components/PanelEditor/utils'; import { addLocationFields } from 'app/features/geo/editor/locationEditor'; diff --git a/public/app/plugins/panel/geomap/layers/data/routeLayer.tsx b/public/app/plugins/panel/geomap/layers/data/routeLayer.tsx index 43e9500ad0c..366b687c5aa 100644 --- a/public/app/plugins/panel/geomap/layers/data/routeLayer.tsx +++ b/public/app/plugins/panel/geomap/layers/data/routeLayer.tsx @@ -20,8 +20,8 @@ import { DataHoverClearEvent, DataFrame, FieldType, + colorManipulator } from '@grafana/data'; -import { alpha } from '@grafana/data/src/themes/colorManipulator'; import { MapLayerOptions, FrameGeometrySourceMode } from '@grafana/schema'; import { FrameVectorSource } from 'app/features/geo/utils/frameVectorSource'; import { getGeometryField, getLocationMatchers } from 'app/features/geo/utils/location'; @@ -207,10 +207,10 @@ export const routeLayer: MapLayerRegistryItem = { image: new Circle({ radius: crosshairRadius, stroke: new Stroke({ - color: alpha(crosshairColor, 1), + color: colorManipulator.alpha(crosshairColor, 1), width: 1, }), - fill: new Fill({ color: alpha(crosshairColor, 0.4) }), + fill: new Fill({ color: colorManipulator.alpha(crosshairColor, 0.4) }), }), }); const lineStyle = new Style({ diff --git a/public/app/plugins/panel/geomap/utils/checkFeatureMatchesStyleRule.ts b/public/app/plugins/panel/geomap/utils/checkFeatureMatchesStyleRule.ts index 569bbdf7c7b..cc0558c4e44 100644 --- a/public/app/plugins/panel/geomap/utils/checkFeatureMatchesStyleRule.ts +++ b/public/app/plugins/panel/geomap/utils/checkFeatureMatchesStyleRule.ts @@ -1,6 +1,6 @@ import { FeatureLike } from 'ol/Feature'; -import { compareValues } from '@grafana/data/src/transformations/matchers/compareValues'; +import { compareValues } from '@grafana/data/internal'; import { FeatureRuleConfig } from '../types'; diff --git a/public/app/plugins/panel/geomap/utils/tooltip.ts b/public/app/plugins/panel/geomap/utils/tooltip.ts index 74fc3d6a8ba..547ef6e498b 100644 --- a/public/app/plugins/panel/geomap/utils/tooltip.ts +++ b/public/app/plugins/panel/geomap/utils/tooltip.ts @@ -2,7 +2,7 @@ import { debounce } from 'lodash'; import { MapBrowserEvent } from 'ol'; import { toLonLat } from 'ol/proj'; -import { DataFrame, DataHoverClearEvent } from '@grafana/data/src'; +import { DataFrame, DataHoverClearEvent } from '@grafana/data'; import { GeomapPanel } from '../GeomapPanel'; import { GeomapHoverPayload, GeomapLayerHover } from '../event'; diff --git a/public/app/plugins/panel/geomap/utils/utils.ts b/public/app/plugins/panel/geomap/utils/utils.ts index 6587dda7ee2..44bb31c0876 100644 --- a/public/app/plugins/panel/geomap/utils/utils.ts +++ b/public/app/plugins/panel/geomap/utils/utils.ts @@ -1,8 +1,7 @@ import { Map as OpenLayersMap } from 'ol'; import { defaults as interactionDefaults } from 'ol/interaction'; -import { SelectableValue } from '@grafana/data'; -import { DataFrame, GrafanaTheme2 } from '@grafana/data/src'; +import { DataFrame, GrafanaTheme2, SelectableValue } from '@grafana/data'; import { getColorDimension, getScalarDimension, getScaledDimension, getTextDimension } from 'app/features/dimensions'; import { getGrafanaDatasource } from 'app/plugins/datasource/grafana/datasource'; diff --git a/public/app/plugins/panel/graph/data_processor.ts b/public/app/plugins/panel/graph/data_processor.ts index 21afccf65d3..0b97dd6efbd 100644 --- a/public/app/plugins/panel/graph/data_processor.ts +++ b/public/app/plugins/panel/graph/data_processor.ts @@ -1,7 +1,7 @@ import { find } from 'lodash'; import { DataFrame, dateTime, Field, FieldType, getFieldDisplayName, getTimeField, TimeRange } from '@grafana/data'; -import { applyNullInsertThreshold } from '@grafana/data/src/transformations/transformers/nulls/nullInsertThreshold'; +import { applyNullInsertThreshold } from '@grafana/data/internal'; import { colors } from '@grafana/ui'; import config from 'app/core/config'; import TimeSeries from 'app/core/time_series2'; diff --git a/public/app/plugins/panel/histogram/Histogram.tsx b/public/app/plugins/panel/histogram/Histogram.tsx index 024d3105a51..3225018263a 100644 --- a/public/app/plugins/panel/histogram/Histogram.tsx +++ b/public/app/plugins/panel/histogram/Histogram.tsx @@ -9,11 +9,9 @@ import { getFieldSeriesColor, GrafanaTheme2, roundDecimals, -} from '@grafana/data'; -import { histogramBucketSizes, histogramFrameBucketMaxFieldName, -} from '@grafana/data/src/transformations/transformers/histogram'; +} from '@grafana/data'; import { VizLegendOptions, ScaleDistribution, AxisPlacement, ScaleDirection, ScaleOrientation } from '@grafana/schema'; import { Themeable2, diff --git a/public/app/plugins/panel/histogram/HistogramPanel.tsx b/public/app/plugins/panel/histogram/HistogramPanel.tsx index 082b0be63c4..6ec723bd766 100644 --- a/public/app/plugins/panel/histogram/HistogramPanel.tsx +++ b/public/app/plugins/panel/histogram/HistogramPanel.tsx @@ -1,7 +1,14 @@ import { useMemo } from 'react'; -import { DataFrameType, PanelProps, buildHistogram, cacheFieldDisplayNames, getHistogramFields } from '@grafana/data'; -import { histogramFieldsToFrame, joinHistograms } from '@grafana/data/src/transformations/transformers/histogram'; +import { + histogramFieldsToFrame, + joinHistograms, + DataFrameType, + PanelProps, + buildHistogram, + cacheFieldDisplayNames, + getHistogramFields, +} from '@grafana/data'; import { TooltipDisplayMode, TooltipPlugin2, useTheme2 } from '@grafana/ui'; import { TooltipHoverMode } from '@grafana/ui/internal'; diff --git a/public/app/plugins/panel/histogram/module.tsx b/public/app/plugins/panel/histogram/module.tsx index cf95bbc463d..2584b008737 100644 --- a/public/app/plugins/panel/histogram/module.tsx +++ b/public/app/plugins/panel/histogram/module.tsx @@ -4,8 +4,8 @@ import { FieldType, identityOverrideProcessor, PanelPlugin, + histogramFieldInfo, } from '@grafana/data'; -import { histogramFieldInfo } from '@grafana/data/src/transformations/transformers/histogram'; import { commonOptionsBuilder, graphFieldOptions } from '@grafana/ui'; import { StackingEditor } from '@grafana/ui/internal'; diff --git a/public/app/plugins/panel/histogram/utils.ts b/public/app/plugins/panel/histogram/utils.ts index 51d041050bf..25e1f33c4bd 100644 --- a/public/app/plugins/panel/histogram/utils.ts +++ b/public/app/plugins/panel/histogram/utils.ts @@ -1,8 +1,9 @@ -import { DataFrame, FieldType } from '@grafana/data'; import { isHistogramFrameBucketMinFieldName, isHistogramFrameBucketMaxFieldName, -} from '@grafana/data/src/transformations/transformers/histogram'; + DataFrame, + FieldType, +} from '@grafana/data'; export function originalDataHasHistogram(frames?: DataFrame[]): boolean { if (frames?.length !== 1) { diff --git a/public/app/plugins/panel/logs/LogsPanel.tsx b/public/app/plugins/panel/logs/LogsPanel.tsx index 088f4fd2b14..145fad771a3 100644 --- a/public/app/plugins/panel/logs/LogsPanel.tsx +++ b/public/app/plugins/panel/logs/LogsPanel.tsx @@ -29,8 +29,8 @@ import { urlUtil, LogSortOrderChangeEvent, LoadingState, + rangeUtil, } from '@grafana/data'; -import { convertRawToRange } from '@grafana/data/src/datetime/rangeutil'; import { config, getAppEvents } from '@grafana/runtime'; import { ScrollContainer, usePanelContext, useStyles2 } from '@grafana/ui'; import { getFieldLinksForExplore } from 'app/features/explore/utils/links'; @@ -599,7 +599,7 @@ export async function requestMoreLogs( return []; } - const range: TimeRange = convertRawToRange({ + const range: TimeRange = rangeUtil.convertRawToRange({ from: dateTimeForTimeZone(timeZone, timeRange.from), to: dateTimeForTimeZone(timeZone, timeRange.to), }); diff --git a/public/app/plugins/panel/nodeGraph/Node.test.tsx b/public/app/plugins/panel/nodeGraph/Node.test.tsx index a73f0b8334e..2c9bf841394 100644 --- a/public/app/plugins/panel/nodeGraph/Node.test.tsx +++ b/public/app/plugins/panel/nodeGraph/Node.test.tsx @@ -1,6 +1,6 @@ import { render, screen } from '@testing-library/react'; -import { FieldType } from '@grafana/data/src'; +import { FieldType } from '@grafana/data'; import { Node } from './Node'; diff --git a/public/app/plugins/panel/stat/StatPanel.tsx b/public/app/plugins/panel/stat/StatPanel.tsx index 2411ab49943..6d1c35cc63a 100644 --- a/public/app/plugins/panel/stat/StatPanel.tsx +++ b/public/app/plugins/panel/stat/StatPanel.tsx @@ -10,7 +10,7 @@ import { NumericRange, PanelProps, } from '@grafana/data'; -import { findNumericFieldMinMax } from '@grafana/data/src/field/fieldOverrides'; +import { findNumericFieldMinMax } from '@grafana/data/internal'; import { BigValueTextMode, BigValueGraphMode } from '@grafana/schema'; import { BigValue, DataLinksContextMenu, VizRepeater, VizRepeaterRenderValueProps } from '@grafana/ui'; import { DataLinksContextMenuApi } from '@grafana/ui/internal'; diff --git a/public/app/plugins/panel/status-history/utils.ts b/public/app/plugins/panel/status-history/utils.ts index cd683b7129c..d077a54a959 100644 --- a/public/app/plugins/panel/status-history/utils.ts +++ b/public/app/plugins/panel/status-history/utils.ts @@ -1,5 +1,4 @@ -import { ActionModel, Field, InterpolateFunction, LinkModel } from '@grafana/data'; -import { DataFrame } from '@grafana/data/'; +import { DataFrame, ActionModel, Field, InterpolateFunction, LinkModel } from '@grafana/data'; import { getActions } from 'app/features/actions/utils'; export const getDataLinks = (field: Field, rowIdx: number) => { diff --git a/public/app/plugins/panel/table/migrations.ts b/public/app/plugins/panel/table/migrations.ts index 734376e18be..aa4c635682c 100644 --- a/public/app/plugins/panel/table/migrations.ts +++ b/public/app/plugins/panel/table/migrations.ts @@ -10,7 +10,7 @@ import { DataFrame, FieldType, } from '@grafana/data'; -import { ReduceTransformerOptions } from '@grafana/data/src/transformations/transformers/reduce'; +import { ReduceTransformerOptions } from '@grafana/data/internal'; import { Options } from './panelcfg.gen'; diff --git a/public/app/plugins/panel/timeseries/utils.ts b/public/app/plugins/panel/timeseries/utils.ts index 02fc7ea3b34..8b974ac38fa 100644 --- a/public/app/plugins/panel/timeseries/utils.ts +++ b/public/app/plugins/panel/timeseries/utils.ts @@ -7,10 +7,10 @@ import { isBooleanUnit, TimeRange, cacheFieldDisplayNames, + applyNullInsertThreshold, + nullToValue, } from '@grafana/data'; -import { convertFieldType } from '@grafana/data/src/transformations/transformers/convertFieldType'; -import { applyNullInsertThreshold } from '@grafana/data/src/transformations/transformers/nulls/nullInsertThreshold'; -import { nullToValue } from '@grafana/data/src/transformations/transformers/nulls/nullToValue'; +import { convertFieldType } from '@grafana/data/internal'; import { GraphFieldConfig, LineInterpolation, TooltipDisplayMode, VizTooltipOptions } from '@grafana/schema'; import { buildScaleKey } from '@grafana/ui/internal'; diff --git a/public/app/plugins/panel/trend/TrendPanel.tsx b/public/app/plugins/panel/trend/TrendPanel.tsx index f043c113b1f..ff54529bbe4 100644 --- a/public/app/plugins/panel/trend/TrendPanel.tsx +++ b/public/app/plugins/panel/trend/TrendPanel.tsx @@ -1,7 +1,14 @@ import { useMemo } from 'react'; -import { DataFrame, FieldMatcherID, fieldMatchers, FieldType, PanelProps, TimeRange } from '@grafana/data'; -import { isLikelyAscendingVector } from '@grafana/data/src/transformations/transformers/joinDataFrames'; +import { + isLikelyAscendingVector, + DataFrame, + FieldMatcherID, + fieldMatchers, + FieldType, + PanelProps, + TimeRange, +} from '@grafana/data'; import { config, PanelDataErrorView } from '@grafana/runtime'; import { KeyboardPlugin, TooltipDisplayMode, usePanelContext, TooltipPlugin2 } from '@grafana/ui'; import { TooltipHoverMode } from '@grafana/ui/internal'; diff --git a/public/app/plugins/panel/xychart/XYChartPanel.tsx b/public/app/plugins/panel/xychart/XYChartPanel.tsx index 31d4784a7aa..e3e667730c2 100644 --- a/public/app/plugins/panel/xychart/XYChartPanel.tsx +++ b/public/app/plugins/panel/xychart/XYChartPanel.tsx @@ -1,8 +1,7 @@ import { css } from '@emotion/css'; import { useMemo } from 'react'; -import { FALLBACK_COLOR, PanelProps } from '@grafana/data'; -import { alpha } from '@grafana/data/src/themes/colorManipulator'; +import { colorManipulator, FALLBACK_COLOR, PanelProps } from '@grafana/data'; import { config } from '@grafana/runtime'; import { TooltipDisplayMode, @@ -72,7 +71,7 @@ export const XYChartPanel2 = (props: Props2) => { items.push({ yAxis: 1, // TODO: pull from y field label: s.name.value, - color: alpha(s.color.fixed ?? FALLBACK_COLOR, 1), + color: colorManipulator.alpha(s.color.fixed ?? FALLBACK_COLOR, 1), getItemKey: () => `${idx}-${s.name.value}`, fieldName: yField.state?.displayName ?? yField.name, disabled: yField.state?.hideFrom?.viz ?? false, diff --git a/public/app/plugins/panel/xychart/XYChartTooltip.tsx b/public/app/plugins/panel/xychart/XYChartTooltip.tsx index f9b0d588d31..f72a67b7b5e 100644 --- a/public/app/plugins/panel/xychart/XYChartTooltip.tsx +++ b/public/app/plugins/panel/xychart/XYChartTooltip.tsx @@ -1,7 +1,6 @@ import { ReactNode } from 'react'; -import { DataFrame, InterpolateFunction, LinkModel } from '@grafana/data'; -import { alpha } from '@grafana/data/src/themes/colorManipulator'; +import { colorManipulator, DataFrame, InterpolateFunction, LinkModel } from '@grafana/data'; import { VizTooltipContent, VizTooltipFooter, @@ -67,7 +66,7 @@ export const XYChartTooltip = ({ const headerItem: VizTooltipItem = { label, value: '', - color: alpha(seriesColor ?? '#fff', 0.5), + color: colorManipulator.alpha(seriesColor ?? '#fff', 0.5), colorIndicator: ColorIndicator.marker_md, }; diff --git a/public/app/plugins/panel/xychart/scatter.ts b/public/app/plugins/panel/xychart/scatter.ts index b2d9156ffbb..d7bb53a3838 100644 --- a/public/app/plugins/panel/xychart/scatter.ts +++ b/public/app/plugins/panel/xychart/scatter.ts @@ -11,8 +11,8 @@ import { MappingType, SpecialValueMatch, ThresholdsMode, + colorManipulator, } from '@grafana/data'; -import { alpha } from '@grafana/data/src/themes/colorManipulator'; import { AxisPlacement, FieldColorModeId, ScaleDirection, ScaleOrientation, VisibilityMode } from '@grafana/schema'; import { UPlotConfigBuilder } from '@grafana/ui'; import { FacetedData, FacetSeries } from '@grafana/ui/internal'; @@ -86,8 +86,8 @@ export const prepConfig = (xySeries: XYSeries[], theme: GrafanaTheme2) => { let pointAlpha = scatterInfo.fillOpacity / 100; - u.ctx.fillStyle = alpha((series.fill as any)(), pointAlpha); - u.ctx.strokeStyle = alpha((series.stroke as any)(), 1); + u.ctx.fillStyle = colorManipulator.alpha((series.fill as any)(), pointAlpha); + u.ctx.strokeStyle = colorManipulator.alpha((series.stroke as any)(), 1); u.ctx.lineWidth = strokeWidth; let deg360 = 2 * Math.PI; @@ -138,8 +138,8 @@ export const prepConfig = (xySeries: XYSeries[], theme: GrafanaTheme2) => { if (pointColors[i] !== curColorIdx) { curColorIdx = pointColors[i]; let c = curColorIdx === -1 ? FALLBACK_COLOR : pointPalette[curColorIdx]; - u.ctx.fillStyle = paletteHasAlpha ? c : alpha(c as string, pointAlpha); - u.ctx.strokeStyle = alpha(c as string, 1); + u.ctx.fillStyle = paletteHasAlpha ? c : colorManipulator.alpha(c as string, pointAlpha); + u.ctx.strokeStyle = colorManipulator.alpha(c as string, 1); } } @@ -421,8 +421,8 @@ export const prepConfig = (xySeries: XYSeries[], theme: GrafanaTheme2) => { pathBuilder: drawBubbles, // drawBubbles({disp: {size: {values: () => }}}) theme, scaleKey: '', // facets' scales used (above) - lineColor: alpha(lineColor ?? '#ffff', 1), - fillColor: alpha(pointColor ?? '#ffff', 0.5), + lineColor: colorManipulator.alpha(lineColor ?? '#ffff', 1), + fillColor: colorManipulator.alpha(pointColor ?? '#ffff', 0.5), show: !field.state?.hideFrom?.viz, }); }); diff --git a/public/app/plugins/panel/xychart/utils.ts b/public/app/plugins/panel/xychart/utils.ts index 47884a7540b..4425666fe0b 100644 --- a/public/app/plugins/panel/xychart/utils.ts +++ b/public/app/plugins/panel/xychart/utils.ts @@ -12,7 +12,7 @@ import { FieldMatcherID, FieldConfigSource, } from '@grafana/data'; -import { decoupleHideFromState } from '@grafana/data/src/field/fieldState'; +import { decoupleHideFromState } from '@grafana/data/internal'; import { config } from '@grafana/runtime'; import { VisibilityMode } from '@grafana/schema'; diff --git a/public/app/routes/RoutesWrapper.tsx b/public/app/routes/RoutesWrapper.tsx index 7e4701f040e..ee0318cb7a7 100644 --- a/public/app/routes/RoutesWrapper.tsx +++ b/public/app/routes/RoutesWrapper.tsx @@ -4,7 +4,7 @@ import { ComponentType, ReactNode } from 'react'; import { Router } from 'react-router-dom'; import { CompatRouter } from 'react-router-dom-v5-compat'; -import { GrafanaTheme2 } from '@grafana/data/'; +import { GrafanaTheme2 } from '@grafana/data'; import { config, locationService, From cc0c86b286df19122e66eb42543fc362dac7d3fb Mon Sep 17 00:00:00 2001 From: Mariell Hoversholm Date: Tue, 25 Mar 2025 11:09:24 +0100 Subject: [PATCH 006/100] Provisioning: Fix migration: Go-git should pretend the Path is the repo root (#102755) * fix: go git migration should pretend the path is the repo root The migration was broken due to its having the path already in the repository, then adding it once more. This now pretends the path is the repository root as intended. * chore: remove test log * fix: reduce permissions of directory * chore: make update-workspace --- .../provisioning/repository/go-git/wrapper.go | 16 +++--- .../repository/go-git/wrapper_test.go | 54 +++++++++++++++++++ .../apis/provisioning/safepath/path.go | 13 +++-- .../apis/provisioning/safepath/path_test.go | 3 ++ 4 files changed, 77 insertions(+), 9 deletions(-) diff --git a/pkg/registry/apis/provisioning/repository/go-git/wrapper.go b/pkg/registry/apis/provisioning/repository/go-git/wrapper.go index 4447aa2174a..580bf61f622 100644 --- a/pkg/registry/apis/provisioning/repository/go-git/wrapper.go +++ b/pkg/registry/apis/provisioning/repository/go-git/wrapper.go @@ -249,17 +249,21 @@ func (g *GoGitRepo) ReadTree(ctx context.Context, ref string) ([]repository.File if g.config.Spec.GitHub.Path != "" { treePath = g.config.Spec.GitHub.Path } - - // TODO: do we really need this? - if !strings.HasPrefix(treePath, "/") { - treePath = "/" + treePath - } + treePath = safepath.Clean(treePath) entries := make([]repository.FileTreeEntry, 0, 100) err := util.Walk(g.tree.Filesystem, treePath, func(path string, info fs.FileInfo, err error) error { - if err != nil || path == "/" { + // We already have an error, just pass it onwards. + if err != nil || + // This is the root of the repository (or should pretend to be) + safepath.Clean(path) == "" || path == treePath || + // This is the Git data + (treePath == "" && strings.HasPrefix(path, ".git/")) { return err } + if treePath != "" { + path = strings.TrimPrefix(path, treePath) + } entry := repository.FileTreeEntry{ Path: strings.TrimLeft(path, "/"), Size: info.Size(), diff --git a/pkg/registry/apis/provisioning/repository/go-git/wrapper_test.go b/pkg/registry/apis/provisioning/repository/go-git/wrapper_test.go index 4ce86d18859..beaac3d4da6 100644 --- a/pkg/registry/apis/provisioning/repository/go-git/wrapper_test.go +++ b/pkg/registry/apis/provisioning/repository/go-git/wrapper_test.go @@ -5,9 +5,11 @@ import ( "encoding/json" "fmt" "os" + "path/filepath" "testing" "time" + "github.com/go-git/go-git/v5" "github.com/stretchr/testify/require" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -92,3 +94,55 @@ func TestGoGitWrapper(t *testing.T) { }, os.Stdout) require.NoError(t, err) } + +func TestReadTree(t *testing.T) { + dir := t.TempDir() + gitRepo, err := git.PlainInit(dir, false) + require.NoError(t, err, "failed to init a new git repository") + worktree, err := gitRepo.Worktree() + require.NoError(t, err, "failed to get worktree") + + repo := &GoGitRepo{ + config: &v0alpha1.Repository{ + ObjectMeta: v1.ObjectMeta{ + Name: "test", + Namespace: "default", + }, + Spec: v0alpha1.RepositorySpec{ + Title: "test", + Workflows: []v0alpha1.Workflow{v0alpha1.WriteWorkflow}, + Type: v0alpha1.GitHubRepositoryType, + GitHub: &v0alpha1.GitHubRepositoryConfig{ + URL: "https://github.com/grafana/__unit-test", + Path: "grafana/", + Branch: "main", + }, + }, + Status: v0alpha1.RepositoryStatus{}, + }, + decryptedPassword: "password", + + repo: gitRepo, + tree: worktree, + dir: dir, + } + + err = os.WriteFile(filepath.Join(dir, "test.txt"), []byte("test"), 0644) + require.NoError(t, err, "failed to write test file") + + err = os.Mkdir(filepath.Join(dir, "grafana"), 0750) + require.NoError(t, err, "failed to mkdir grafana") + + err = os.WriteFile(filepath.Join(dir, "grafana", "test2.txt"), []byte("test"), 0644) + require.NoError(t, err, "failed to write grafana/test2 file") + + ctx := context.Background() + entries, err := repo.ReadTree(ctx, "HEAD") + require.NoError(t, err, "failed to read tree") + + // Here is the meat of why this test exists: the ReadTree call should only read the config.Spec.GitHub.Path files. + // All prefixes are removed (i.e. a file is just its name, not ${Path}/${Name}). + // And it does not include the directory in the listing, as it pretends to be the root. + require.Len(t, entries, 1, "entries from ReadTree") + require.Equal(t, entries[0].Path, "test2.txt", "entry path") +} diff --git a/pkg/registry/apis/provisioning/safepath/path.go b/pkg/registry/apis/provisioning/safepath/path.go index d314fa80cdf..e1fa2fa464c 100644 --- a/pkg/registry/apis/provisioning/safepath/path.go +++ b/pkg/registry/apis/provisioning/safepath/path.go @@ -13,15 +13,22 @@ import ( var osSeparator = os.PathSeparator // Performs a [path.Clean] on the path, as well as replacing its OS separators. +// // This replaces the OS separator with a slash. // All OSes we target (Linux, macOS, and Windows) support forward-slashes in path traversals, as such it's simpler to use the same character everywhere. // BSDs do as well (even though they're not a target as of writing). +// +// The output of a root path (i.e. absolute root or relative current dir) is always "" (empty string). func Clean(p string) string { - if osSeparator == '/' { // perf: nothing to do! - return path.Clean(p) + if osSeparator != '/' { + p = strings.ReplaceAll(p, string(osSeparator), "/") } - return path.Clean(strings.ReplaceAll(p, string(osSeparator), "/")) + cleaned := path.Clean(p) + if cleaned == "." || cleaned == "/" { + return "" + } + return cleaned } // Join is like path.Join but preserves trailing slashes from the last element diff --git a/pkg/registry/apis/provisioning/safepath/path_test.go b/pkg/registry/apis/provisioning/safepath/path_test.go index d42bde6296e..23375e4226f 100644 --- a/pkg/registry/apis/provisioning/safepath/path_test.go +++ b/pkg/registry/apis/provisioning/safepath/path_test.go @@ -55,6 +55,9 @@ func TestPathClean(t *testing.T) { {"Path traversal with multiple slashes", "/test////abc/..//def", "/test/def"}, {"Path traversal with current directory", "/test/./abc/../def/./ghi", "/test/def/ghi"}, {"Empty path segments with traversal", "//test//abc//..//def", "/test/def"}, + {"Root path returns empty string", "/", ""}, + {"Current directory returns empty string", ".", ""}, + {"Path traversal to root returns empty string", "/test/..", ""}, } for _, tc := range testCases { From 0b5a0d0f66bad009d94737008dd63a8f2632b276 Mon Sep 17 00:00:00 2001 From: Jack Westbrook Date: Tue, 25 Mar 2025 11:14:54 +0100 Subject: [PATCH 007/100] Frontend: Fix failing test (#102765) test(paneloptionspane): fix broken import path --- .betterer.results | 5 ++++- .../dashboard-scene/panel-edit/PanelOptionsPane.test.tsx | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.betterer.results b/.betterer.results index be6ec2229c5..599827d5204 100644 --- a/.betterer.results +++ b/.betterer.results @@ -2726,6 +2726,9 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"] ], + "public/app/features/dashboard-scene/panel-edit/PanelOptionsPane.test.tsx:5381": [ + [0, 0, 0, "Unexpected any. Specify a different type.", "0"] + ], "public/app/features/dashboard-scene/panel-edit/PanelOptionsPane.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], @@ -4795,7 +4798,7 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings. Wrap text with ", "3"], [0, 0, 0, "No untranslated strings. Wrap text with ", "4"], [0, 0, 0, "No untranslated strings. Wrap text with ", "5"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "6"] + [0, 0, 0, "Unexpected any. Specify a different type.", "6"] ], "public/app/features/provisioning/Repository/CheckRepository.tsx:5381": [ [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] diff --git a/public/app/features/dashboard-scene/panel-edit/PanelOptionsPane.test.tsx b/public/app/features/dashboard-scene/panel-edit/PanelOptionsPane.test.tsx index b7c7d4f4797..9af129511f3 100644 --- a/public/app/features/dashboard-scene/panel-edit/PanelOptionsPane.test.tsx +++ b/public/app/features/dashboard-scene/panel-edit/PanelOptionsPane.test.tsx @@ -1,5 +1,5 @@ import { PanelPlugin } from '@grafana/data'; -import { getPanelPlugin } from '@grafana/data/test/__mocks__/pluginMocks'; +import { getPanelPlugin } from '@grafana/data/test'; import { OptionFilter } from 'app/features/dashboard/components/PanelEditor/OptionsPaneOptions'; import { getDashboardSrv } from 'app/features/dashboard/services/DashboardSrv'; From 3776a0baed6a81dac028f4cd72a0f9cf978338b3 Mon Sep 17 00:00:00 2001 From: Ashley Harrison Date: Tue, 25 Mar 2025 10:44:05 +0000 Subject: [PATCH 008/100] Chore: auto mark up some areas for translations (#102711) * auto markup users/variables/visualization features * mark up transformers feature * betterer + translations * markup trails * mark up service accounts + translations + betterer * undo ServiceAccountProfileRow change for now * dedupe a little --- .betterer.results | 414 +++-------------- .../serviceaccounts/ServiceAccountPage.tsx | 31 +- .../ServiceAccountPermissions.tsx | 3 +- .../serviceaccounts/ServiceAccountTable.tsx | 9 +- .../ServiceAccountsListPage.tsx | 19 +- .../components/CreateTokenModal.tsx | 24 +- .../components/ServiceAccountProfile.tsx | 23 +- .../components/ServiceAccountRoleRow.tsx | 3 +- .../components/ServiceAccountTokensTable.tsx | 23 +- .../components/ServiceAccountsListItem.tsx | 11 +- .../Breakdown/AddToFiltersGraphAction.tsx | 3 +- .../trails/Breakdown/BreakdownSearchScene.tsx | 3 +- .../trails/Breakdown/LabelBreakdownScene.tsx | 8 +- .../features/trails/Breakdown/SortByScene.tsx | 6 +- public/app/features/trails/DataTrailCard.tsx | 4 +- .../app/features/trails/DataTrailSettings.tsx | 4 +- .../app/features/trails/DataTrailsHistory.tsx | 5 +- public/app/features/trails/MetricScene.tsx | 12 +- .../trails/MetricSelect/MetricSelectScene.tsx | 19 +- public/app/features/trails/MetricsHeader.tsx | 11 +- .../app/features/trails/TrailStore/utils.tsx | 3 +- .../FilterByValueFilterEditor.tsx | 11 +- .../FilterByValueTransformerEditor.tsx | 13 +- .../ValueMatchers/BasicMatcherEditor.tsx | 3 +- .../ValueMatchers/RangeMatcherEditor.tsx | 9 +- .../ValueMatchers/RegexMatcherEditor.tsx | 3 +- .../calculateHeatmap/editor/AxisEditor.tsx | 3 +- .../ConfigFromQueryTransformerEditor.tsx | 17 +- .../BinaryOperationOptionsEditor.tsx | 16 +- .../CalculateFieldTransformerEditor.tsx | 17 +- .../CumulativeOptionsEditor.tsx | 10 +- .../IndexOptionsEditor.tsx | 10 +- .../ReduceRowOptionsEditor.tsx | 12 +- .../UnaryOperationEditor.tsx | 8 +- .../WindowOptionsEditor.tsx | 19 +- .../editors/ConcatenateTransformerEditor.tsx | 16 +- .../ConvertFieldTypeTransformerEditor.tsx | 30 +- .../editors/EnumMappingEditor.tsx | 7 +- .../transformers/editors/EnumMappingRow.tsx | 8 +- .../editors/FilterByNameTransformerEditor.tsx | 16 +- .../editors/FormatStringTransformerEditor.tsx | 8 +- .../editors/FormatTimeTransformerEditor.tsx | 20 +- .../editors/GroupByTransformerEditor.tsx | 11 +- .../GroupToNestedTableTransformerEditor.tsx | 16 +- .../GroupingToMatrixTransformerEditor.tsx | 15 +- .../editors/HistogramTransformerEditor.tsx | 3 +- .../editors/JoinByFieldTransformerEditor.tsx | 15 +- .../LabelsToFieldsTransformerEditor.tsx | 11 +- .../editors/LimitTransformerEditor.tsx | 3 +- .../editors/MergeTransformerEditor.tsx | 9 +- .../OrganizeFieldsTransformerEditor.tsx | 11 +- .../editors/ReduceTransformerEditor.tsx | 24 +- .../editors/RenameByRegexTransformer.tsx | 18 +- .../editors/SortByTransformerEditor.tsx | 11 +- .../editors/TransposeTransformerEditor.tsx | 5 +- .../ExtractFieldsTransformerEditor.tsx | 11 +- .../components/JSONPathEditor.tsx | 22 +- .../FieldToConfigMappingEditor.tsx | 23 +- .../JoinByLabelsTransformerEditor.tsx | 24 +- .../PartitionByValuesEditor.tsx | 17 +- .../PrepareTimeSeriesEditor.tsx | 59 ++- .../regression/regressionEditor.tsx | 27 +- .../TimeSeriesTableTransformEditor.tsx | 11 +- .../app/features/users/TokenRevokedModal.tsx | 3 +- public/app/features/users/UsersActionBar.tsx | 12 +- .../variables/adhoc/picker/AdHocFilter.tsx | 6 +- .../variables/editor/ConfirmDeleteModal.tsx | 3 +- .../editor/LegacyVariableQueryEditor.tsx | 6 +- .../variables/editor/VariableEditorEditor.tsx | 36 +- .../variables/editor/VariableEditorList.tsx | 10 +- .../editor/VariableEditorListRow.tsx | 15 +- .../inspect/VariableUsagesButton.tsx | 3 +- .../inspect/VariablesDependenciesButton.tsx | 5 +- .../inspect/VariablesUnknownButton.tsx | 3 +- .../inspect/VariablesUnknownTable.tsx | 17 +- .../pickers/shared/VariableOptions.tsx | 2 +- .../query/QueryVariableRefreshSelect.tsx | 10 +- .../query/QueryVariableSortSelect.tsx | 6 +- .../textbox/TextBoxVariableEditor.tsx | 7 +- .../data-hover/DataHoverView.tsx | 5 +- public/locales/en-US/grafana.json | 418 ++++++++++++++++++ 81 files changed, 1218 insertions(+), 589 deletions(-) diff --git a/.betterer.results b/.betterer.results index 599827d5204..70e7333515a 100644 --- a/.betterer.results +++ b/.betterer.results @@ -5108,79 +5108,30 @@ exports[`better eslint`] = { [0, 0, 0, "Do not use any type assertions.", "0"] ], "public/app/features/serviceaccounts/ServiceAccountPage.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "3"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "4"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "5"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "6"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "7"] - ], - "public/app/features/serviceaccounts/ServiceAccountPermissions.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], "public/app/features/serviceaccounts/ServiceAccountTable.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "3"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "4"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "5"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"] ], "public/app/features/serviceaccounts/ServiceAccountsListPage.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "3"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "4"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "5"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "0"], + [0, 0, 0, "No untranslated strings. Wrap text with ", "1"] ], "public/app/features/serviceaccounts/components/CreateTokenModal.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "5"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "6"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "7"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "8"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "9"] - ], - "public/app/features/serviceaccounts/components/ServiceAccountProfile.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "5"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "6"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], "public/app/features/serviceaccounts/components/ServiceAccountProfileRow.tsx:5381": [ [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] ], - "public/app/features/serviceaccounts/components/ServiceAccountRoleRow.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] - ], "public/app/features/serviceaccounts/components/ServiceAccountTokensTable.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], [0, 0, 0, "No untranslated strings. Wrap text with ", "1"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "2"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "3"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "4"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "5"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "6"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "7"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "2"] ], "public/app/features/serviceaccounts/components/ServiceAccountsListItem.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "4"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "5"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "6"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"] ], "public/app/features/serviceaccounts/state/reducers.ts:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] @@ -5255,24 +5206,14 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "10"], [0, 0, 0, "Unexpected any. Specify a different type.", "11"] ], - "public/app/features/trails/Breakdown/AddToFiltersGraphAction.tsx:5381": [ - [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] - ], - "public/app/features/trails/Breakdown/BreakdownSearchScene.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] - ], "public/app/features/trails/Breakdown/LabelBreakdownScene.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], "public/app/features/trails/Breakdown/SearchInput.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], "public/app/features/trails/Breakdown/SortByScene.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], "public/app/features/trails/Breakdown/types.ts:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"] @@ -5284,73 +5225,33 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], "public/app/features/trails/DataTrailCard.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "1"] - ], - "public/app/features/trails/DataTrailSettings.tsx:5381": [ - [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] - ], - "public/app/features/trails/DataTrailsHistory.tsx:5381": [ [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] ], "public/app/features/trails/MetricScene.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "3"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "4"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], "public/app/features/trails/MetricSelect/MetricSelectScene.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "5"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "6"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "7"] - ], - "public/app/features/trails/MetricsHeader.tsx:5381": [ - [0, 0, 0, "No untranslated strings. Wrap text with ", "0"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "1"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "1"], + [0, 0, 0, "No untranslated strings. Wrap text with ", "2"] ], "public/app/features/trails/RelatedLogs/RelatedLogsScene.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], "public/app/features/trails/TrailStore/utils.tsx:5381": [ - [0, 0, 0, "No untranslated strings. Wrap text with ", "0"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "1"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] ], "public/app/features/trails/banners/NativeHistogramBanner.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], - "public/app/features/transformers/FilterByValueTransformer/FilterByValueFilterEditor.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"] - ], - "public/app/features/transformers/FilterByValueTransformer/FilterByValueTransformerEditor.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "2"] - ], "public/app/features/transformers/FilterByValueTransformer/ValueMatchers/BasicMatcherEditor.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "Unexpected any. Specify a different type.", "1"] + [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], "public/app/features/transformers/FilterByValueTransformer/ValueMatchers/NoopMatcherEditor.tsx:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], "public/app/features/transformers/FilterByValueTransformer/ValueMatchers/RangeMatcherEditor.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "2"], - [0, 0, 0, "Unexpected any. Specify a different type.", "3"] - ], - "public/app/features/transformers/FilterByValueTransformer/ValueMatchers/RegexMatcherEditor.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] + [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], "public/app/features/transformers/FilterByValueTransformer/ValueMatchers/types.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], @@ -5364,8 +5265,7 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], "public/app/features/transformers/calculateHeatmap/editor/AxisEditor.tsx:5381": [ - [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"] + [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"] ], "public/app/features/transformers/calculateHeatmap/editor/helper.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] @@ -5374,61 +5274,24 @@ exports[`better eslint`] = { [0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "1"] ], - "public/app/features/transformers/configFromQuery/ConfigFromQueryTransformerEditor.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"] - ], - "public/app/features/transformers/editors/CalculateFieldTransformerEditor/BinaryOperationOptionsEditor.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"] - ], - "public/app/features/transformers/editors/CalculateFieldTransformerEditor/CalculateFieldTransformerEditor.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"] - ], "public/app/features/transformers/editors/CalculateFieldTransformerEditor/CumulativeOptionsEditor.tsx:5381": [ - [0, 0, 0, "Do not use any type assertions.", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"] - ], - "public/app/features/transformers/editors/CalculateFieldTransformerEditor/IndexOptionsEditor.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"] + [0, 0, 0, "Do not use any type assertions.", "0"] ], "public/app/features/transformers/editors/CalculateFieldTransformerEditor/ReduceRowOptionsEditor.tsx:5381": [ [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"], - [0, 0, 0, "Do not use any type assertions.", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"] + [0, 0, 0, "Do not use any type assertions.", "1"] ], "public/app/features/transformers/editors/CalculateFieldTransformerEditor/UnaryOperationEditor.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "3"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "1"] ], "public/app/features/transformers/editors/CalculateFieldTransformerEditor/WindowOptionsEditor.tsx:5381": [ - [0, 0, 0, "Do not use any type assertions.", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "5"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "6"] + [0, 0, 0, "Do not use any type assertions.", "0"] ], "public/app/features/transformers/editors/CalculateFieldTransformerEditor/index.ts:5381": [ [0, 0, 0, "Do not re-export imported variable (\`CalculateFieldTransformerEditor\`)", "0"], [0, 0, 0, "Do not re-export imported variable (\`calculateFieldTransformRegistryItem\`)", "1"] ], - "public/app/features/transformers/editors/ConcatenateTransformerEditor.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"] - ], "public/app/features/transformers/editors/ConvertFieldTypeTransformerEditor.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], @@ -5439,121 +5302,55 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "6"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "7"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "8"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "9"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "10"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "11"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "12"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "13"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "14"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "15"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "16"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "9"] ], "public/app/features/transformers/editors/EnumMappingEditor.tsx:5381": [ [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"], - [0, 0, 0, "\'VerticalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "1"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "2"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "3"] + [0, 0, 0, "\'VerticalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "1"] ], "public/app/features/transformers/editors/EnumMappingRow.tsx:5381": [ - [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"] + [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"] ], "public/app/features/transformers/editors/FilterByNameTransformerEditor.tsx:5381": [ - [0, 0, 0, "\'@grafana/runtime/src/services\' import is restricted from being used by a pattern. Import from the public export instead.", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "5"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "6"] + [0, 0, 0, "\'@grafana/runtime/src/services\' import is restricted from being used by a pattern. Import from the public export instead.", "0"] ], "public/app/features/transformers/editors/FormatStringTransformerEditor.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], "public/app/features/transformers/editors/FormatTimeTransformerEditor.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "5"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] ], "public/app/features/transformers/editors/GroupByTransformerEditor.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"] ], "public/app/features/transformers/editors/GroupToNestedTableTransformerEditor.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"] - ], - "public/app/features/transformers/editors/GroupingToMatrixTransformerEditor.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"] ], "public/app/features/transformers/editors/HistogramTransformerEditor.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"] - ], - "public/app/features/transformers/editors/JoinByFieldTransformerEditor.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"] ], "public/app/features/transformers/editors/LabelsToFieldsTransformerEditor.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"] - ], - "public/app/features/transformers/editors/LimitTransformerEditor.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] - ], - "public/app/features/transformers/editors/MergeTransformerEditor.tsx:5381": [ - [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"] ], "public/app/features/transformers/editors/OrganizeFieldsTransformerEditor.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "2"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "1"] ], "public/app/features/transformers/editors/ReduceTransformerEditor.tsx:5381": [ - [0, 0, 0, "Do not use any type assertions.", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "5"] - ], - "public/app/features/transformers/editors/RenameByRegexTransformer.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"] + [0, 0, 0, "Do not use any type assertions.", "0"] ], "public/app/features/transformers/editors/SortByTransformerEditor.tsx:5381": [ - [0, 0, 0, "Do not use any type assertions.", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"] + [0, 0, 0, "Do not use any type assertions.", "0"] ], "public/app/features/transformers/editors/TransposeTransformerEditor.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"] ], "public/app/features/transformers/extractFields/ExtractFieldsTransformerEditor.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], @@ -5566,19 +5363,11 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "7"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "8"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "9"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "10"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "11"], - [0, 0, 0, "Unexpected any. Specify a different type.", "12"], - [0, 0, 0, "Unexpected any. Specify a different type.", "13"] + [0, 0, 0, "Unexpected any. Specify a different type.", "10"], + [0, 0, 0, "Unexpected any. Specify a different type.", "11"] ], "public/app/features/transformers/extractFields/components/JSONPathEditor.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "4"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "5"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "6"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] ], "public/app/features/transformers/extractFields/extractFields.ts:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], @@ -5592,11 +5381,7 @@ exports[`better eslint`] = { ], "public/app/features/transformers/fieldToConfigMapping/FieldToConfigMappingEditor.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], - [0, 0, 0, "Do not use any type assertions.", "1"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "2"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "3"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "4"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "5"] + [0, 0, 0, "Do not use any type assertions.", "1"] ], "public/app/features/transformers/fieldToConfigMapping/fieldToConfigMapping.ts:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], @@ -5610,12 +5395,7 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "5"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "6"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "7"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "8"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "9"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"] ], "public/app/features/transformers/lookupGazetteer/FieldLookupTransformerEditor.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], @@ -5630,28 +5410,11 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "5"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "6"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "7"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"] ], "public/app/features/transformers/prepareTimeSeries/PrepareTimeSeriesEditor.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "2"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "3"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "4"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "5"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "6"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "7"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "8"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "9"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "10"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "11"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "12"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "13"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "14"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "15"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "0"], + [0, 0, 0, "No untranslated strings. Wrap text with ", "1"] ], "public/app/features/transformers/prepareTimeSeries/prepareTimeSeries.test.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] @@ -5661,12 +5424,7 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "1"] ], "public/app/features/transformers/regression/regressionEditor.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "5"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], "public/app/features/transformers/spatial/optionsHelper.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], @@ -5683,30 +5441,18 @@ exports[`better eslint`] = { [0, 0, 0, "Do not use any type assertions.", "3"] ], "public/app/features/transformers/timeSeriesTable/TimeSeriesTableTransformEditor.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], "public/app/features/users/TokenRevokedModal.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], [0, 0, 0, "No untranslated strings. Wrap text with ", "1"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "2"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "3"] - ], - "public/app/features/users/UsersActionBar.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "1"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "2"] ], "public/app/features/variables/adapters.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"], [0, 0, 0, "Unexpected any. Specify a different type.", "2"] ], - "public/app/features/variables/adhoc/picker/AdHocFilter.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"] - ], "public/app/features/variables/adhoc/picker/AdHocFilterKey.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], @@ -5722,46 +5468,24 @@ exports[`better eslint`] = { "public/app/features/variables/datasource/actions.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], - "public/app/features/variables/editor/ConfirmDeleteModal.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] - ], - "public/app/features/variables/editor/LegacyVariableQueryEditor.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] - ], "public/app/features/variables/editor/VariableEditorContainer.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "1"] ], "public/app/features/variables/editor/VariableEditorEditor.tsx:5381": [ [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "4"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "5"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "6"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "7"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "8"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "9"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "10"], - [0, 0, 0, "Unexpected any. Specify a different type.", "11"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "1"], + [0, 0, 0, "Unexpected any. Specify a different type.", "2"] ], "public/app/features/variables/editor/VariableEditorList.tsx:5381": [ - [0, 0, 0, "No untranslated strings. Wrap text with ", "0"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "1"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "2"], - [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "3"], - [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "4"] + [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"], + [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "1"] ], "public/app/features/variables/editor/VariableEditorListRow.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "2"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "3"], - [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "4"], - [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "5"], - [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "6"], - [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "7"] + [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "0"], + [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "1"], + [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "2"], + [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "3"] ], "public/app/features/variables/editor/getVariableQueryEditor.tsx:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], @@ -5787,24 +5511,15 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "6"] ], "public/app/features/variables/inspect/VariableUsagesButton.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"] - ], - "public/app/features/variables/inspect/VariablesDependenciesButton.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "1"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], "public/app/features/variables/inspect/VariablesUnknownButton.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"] + [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] ], "public/app/features/variables/inspect/VariablesUnknownTable.tsx:5381": [ [0, 0, 0, "\'HorizontalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "0"], [0, 0, 0, "\'VerticalGroup\' import from \'@grafana/ui\' is restricted from being used by a pattern. Use Stack component instead.", "1"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "2"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "3"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "4"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "5"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "2"] ], "public/app/features/variables/inspect/utils.ts:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], @@ -5827,21 +5542,13 @@ exports[`better eslint`] = { [0, 0, 0, "Do not re-export imported variable (\`./OptionsPicker/OptionsPicker\`)", "0"] ], "public/app/features/variables/pickers/shared/VariableOptions.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "1"], - [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "2"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "0"], + [0, 0, 0, "Use data-testid for E2E selectors instead of aria-label", "1"] ], "public/app/features/variables/query/QueryVariableEditor.tsx:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"] ], - "public/app/features/variables/query/QueryVariableRefreshSelect.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"] - ], - "public/app/features/variables/query/QueryVariableSortSelect.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"] - ], "public/app/features/variables/query/VariableQueryRunner.ts:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Unexpected any. Specify a different type.", "1"] @@ -5921,10 +5628,6 @@ exports[`better eslint`] = { [0, 0, 0, "Unexpected any. Specify a different type.", "6"], [0, 0, 0, "Unexpected any. Specify a different type.", "7"] ], - "public/app/features/variables/textbox/TextBoxVariableEditor.tsx:5381": [ - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "1"] - ], "public/app/features/variables/types.ts:5381": [ [0, 0, 0, "Do not re-export imported variable (\`@grafana/data\`)", "0"], [0, 0, 0, "Do not re-export imported variable (\`VariableModel\`)", "1"], @@ -5947,9 +5650,6 @@ exports[`better eslint`] = { [0, 0, 0, "No untranslated strings. Wrap text with ", "0"], [0, 0, 0, "No untranslated strings. Wrap text with ", "1"] ], - "public/app/features/visualization/data-hover/DataHoverView.tsx:5381": [ - [0, 0, 0, "No untranslated strings. Wrap text with ", "0"] - ], "public/app/plugins/datasource/alertmanager/DataSource.ts:5381": [ [0, 0, 0, "Unexpected any. Specify a different type.", "0"] ], diff --git a/public/app/features/serviceaccounts/ServiceAccountPage.tsx b/public/app/features/serviceaccounts/ServiceAccountPage.tsx index 27246e3a4c9..6668ec5d768 100644 --- a/public/app/features/serviceaccounts/ServiceAccountPage.tsx +++ b/public/app/features/serviceaccounts/ServiceAccountPage.tsx @@ -6,6 +6,7 @@ import { NavModelItem, getTimeZone } from '@grafana/data'; import { Button, ConfirmModal, IconButton, Stack } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; import { contextSrv } from 'app/core/core'; +import { Trans, t } from 'app/core/internationalization'; import { AccessControlAction, ApiKey, ServiceAccountDTO, StoreState } from 'app/types'; import { ServiceAccountPermissions } from './ServiceAccountPermissions'; @@ -143,7 +144,9 @@ export const ServiceAccountPageUnconnected = ({ onClick={showDeleteServiceAccountModal(true)} disabled={!contextSrv.hasPermission(AccessControlAction.ServiceAccountsDelete)} > - Delete service account + + Delete service account + {serviceAccount.isDisabled ? ( ) : ( )} @@ -180,7 +187,9 @@ export const ServiceAccountPageUnconnected = ({ )} -

Tokens

+

+ Tokens +

{!serviceAccount.isExternal && ( )}
@@ -207,7 +218,10 @@ export const ServiceAccountPageUnconnected = ({ onRoleChange(newRole, original)} @@ -210,17 +211,17 @@ const getActionsCell = ( {contextSrv.hasPermission(AccessControlAction.ServiceAccountsWrite) && !original.tokens && ( )} {contextSrv.hasPermissionInMetadata(AccessControlAction.ServiceAccountsWrite, original) && (original.isDisabled ? ( ) : ( ))} diff --git a/public/app/features/serviceaccounts/ServiceAccountsListPage.tsx b/public/app/features/serviceaccounts/ServiceAccountsListPage.tsx index 5b8ede18148..bfdd29a08a5 100644 --- a/public/app/features/serviceaccounts/ServiceAccountsListPage.tsx +++ b/public/app/features/serviceaccounts/ServiceAccountsListPage.tsx @@ -197,7 +197,9 @@ export const ServiceAccountsListPageUnconnected = ({ <> {!noServiceAccountsCreated && contextSrv.hasPermission(AccessControlAction.ServiceAccountsCreate) && ( - Add service account + + Add service account + )} @@ -208,7 +210,10 @@ export const ServiceAccountsListPageUnconnected = ({ @@ -277,13 +282,19 @@ export const ServiceAccountsListPageUnconnected = ({ : '' }?`} confirmText="Delete" - title="Delete service account" + title={t( + 'serviceaccounts.service-accounts-list-page-unconnected.title-delete-service-account', + 'Delete service account' + )} onConfirm={onServiceAccountRemove} onDismiss={onRemoveModalClose} /> - + {isWithExpirationDate && ( - + ) : ( <>
@@ -143,16 +147,18 @@ export const CreateTokenModal = ({ isOpen, token, serviceAccountLogin, onCreateT icon="copy" getText={() => token} > - Copy clipboard + Copy to clipboard
token} onClipboardCopy={onCloseInternal}> - Copy to clipboard and close + + Copy to clipboard and close + diff --git a/public/app/features/serviceaccounts/components/ServiceAccountProfile.tsx b/public/app/features/serviceaccounts/components/ServiceAccountProfile.tsx index 27e17a4b6cc..9b86fd23956 100644 --- a/public/app/features/serviceaccounts/components/ServiceAccountProfile.tsx +++ b/public/app/features/serviceaccounts/components/ServiceAccountProfile.tsx @@ -5,6 +5,7 @@ import { GrafanaTheme2, OrgRole, TimeZone, dateTimeFormat } from '@grafana/data' import { Label, TextLink, useStyles2 } from '@grafana/ui'; import { fetchRoleOptions } from 'app/core/components/RolePicker/api'; import { contextSrv } from 'app/core/core'; +import { Trans, t } from 'app/core/internationalization'; import { AccessControlAction, Role, ServiceAccountDTO } from 'app/types'; import { ServiceAccountProfileRow } from './ServiceAccountProfileRow'; @@ -47,38 +48,46 @@ export function ServiceAccountProfile({ serviceAccount, timeZone, onChange }: Pr return (
-

Information

+

+ Information +

{serviceAccount.id && ( )} - + {serviceAccount.isExternal && serviceAccount.requiredBy && ( - - - - + + + + @@ -96,7 +105,11 @@ interface TokenExpirationProps { const TokenExpiration = ({ timeZone, token }: TokenExpirationProps) => { const styles = useStyles2(getStyles); if (!token.expiration) { - return Never; + return ( + + Never + + ); } if (token.secondsUntilExpiration) { return ( diff --git a/public/app/features/serviceaccounts/components/ServiceAccountsListItem.tsx b/public/app/features/serviceaccounts/components/ServiceAccountsListItem.tsx index 34f35945b43..d5d9fbe02ce 100644 --- a/public/app/features/serviceaccounts/components/ServiceAccountsListItem.tsx +++ b/public/app/features/serviceaccounts/components/ServiceAccountsListItem.tsx @@ -7,6 +7,7 @@ import { Button, Icon, IconButton, Stack, useStyles2 } from '@grafana/ui'; import { SkeletonComponent, attachSkeleton } from '@grafana/ui/unstable'; import { UserRolePicker } from 'app/core/components/RolePicker/UserRolePicker'; import { contextSrv } from 'app/core/core'; +import { t, Trans } from 'app/core/internationalization'; import { OrgRolePicker } from 'app/features/admin/OrgRolePicker'; import { AccessControlAction, Role, ServiceAccountDTO } from 'app/types'; @@ -91,7 +92,7 @@ const ServiceAccountListItemComponent = memo( ) : ( diff --git a/public/app/features/transformers/editors/FilterByNameTransformerEditor.tsx b/public/app/features/transformers/editors/FilterByNameTransformerEditor.tsx index f8035a86f0b..52df4e66431 100644 --- a/public/app/features/transformers/editors/FilterByNameTransformerEditor.tsx +++ b/public/app/features/transformers/editors/FilterByNameTransformerEditor.tsx @@ -14,6 +14,7 @@ import { import { FilterFieldsByNameTransformerOptions } from '@grafana/data/internal'; import { getTemplateSrv } from '@grafana/runtime/src/services'; import { Input, FilterPill, InlineFieldRow, InlineField, InlineSwitch, Select } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; import { getTransformationContent } from '../docs/getTransformationContent'; @@ -198,14 +199,14 @@ export class FilterByNameTransformerEditor extends React.PureComponent< const { options, selected, isRegexValid } = this.state; return (
- - + + {this.state.byVariable ? ( - + this.setState({ regex: e.currentTarget.value })} onBlur={this.onInputBlur} diff --git a/public/app/features/transformers/editors/FormatStringTransformerEditor.tsx b/public/app/features/transformers/editors/FormatStringTransformerEditor.tsx index cf14f69a044..2932f54ab13 100644 --- a/public/app/features/transformers/editors/FormatStringTransformerEditor.tsx +++ b/public/app/features/transformers/editors/FormatStringTransformerEditor.tsx @@ -16,6 +16,7 @@ import { FormatStringOutput, FormatStringTransformerOptions } from '@grafana/dat import { Select, InlineFieldRow, InlineField } from '@grafana/ui'; import { FieldNamePicker } from '@grafana/ui/internal'; import { NumberInput } from 'app/core/components/OptionsUI/NumberInput'; +import { t } from 'app/core/internationalization'; const fieldNamePickerSettings: StandardEditorsRegistryItem = { settings: { @@ -90,14 +91,17 @@ function FormatStringTransfomerEditor({ /> - + @@ -95,7 +102,14 @@ export function FormatTimeTransfomerEditor({ > - + + + - + - + - + diff --git a/public/app/features/transformers/editors/MergeTransformerEditor.tsx b/public/app/features/transformers/editors/MergeTransformerEditor.tsx index c81f59bcf9b..dd6c02481be 100644 --- a/public/app/features/transformers/editors/MergeTransformerEditor.tsx +++ b/public/app/features/transformers/editors/MergeTransformerEditor.tsx @@ -7,13 +7,20 @@ import { } from '@grafana/data'; import { MergeTransformerOptions } from '@grafana/data/internal'; import { FieldValidationMessage } from '@grafana/ui'; +import { Trans } from 'app/core/internationalization'; import { getTransformationContent } from '../docs/getTransformationContent'; export const MergeTransformerEditor = ({ input, options, onChange }: TransformerUIProps) => { if (input.length <= 1) { // Show warning that merge is useless only apply on a single frame - return Merge has no effect when applied on a single frame.; + return ( + + + Merge has no effect when applied on a single frame. + + + ); } return null; }; diff --git a/public/app/features/transformers/editors/OrganizeFieldsTransformerEditor.tsx b/public/app/features/transformers/editors/OrganizeFieldsTransformerEditor.tsx index b253066abbf..e938af3e98b 100644 --- a/public/app/features/transformers/editors/OrganizeFieldsTransformerEditor.tsx +++ b/public/app/features/transformers/editors/OrganizeFieldsTransformerEditor.tsx @@ -22,6 +22,7 @@ import { Text, Box, } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; import { getTransformationContent } from '../docs/getTransformationContent'; import { useAllFieldNamesFromDataFrames } from '../utils'; @@ -164,7 +165,15 @@ const DraggableFieldName = ({ - + - + - + { return ( - + onChange({ ...options, firstFieldName: e.currentTarget.value })} width={25} @@ -24,7 +25,7 @@ export const TransposeTransfomerEditor = ({ options, onChange }: TransformerUIPr onChange({ ...options, restFieldsName: e.currentTarget.value })} width={25} diff --git a/public/app/features/transformers/extractFields/ExtractFieldsTransformerEditor.tsx b/public/app/features/transformers/extractFields/ExtractFieldsTransformerEditor.tsx index 04ecc1ad0da..957e48d49d7 100644 --- a/public/app/features/transformers/extractFields/ExtractFieldsTransformerEditor.tsx +++ b/public/app/features/transformers/extractFields/ExtractFieldsTransformerEditor.tsx @@ -11,6 +11,7 @@ import { } from '@grafana/data'; import { InlineField, InlineFieldRow, Select, InlineSwitch, Input, Combobox, ComboboxOption } from '@grafana/ui'; import { FieldNamePicker } from '@grafana/ui/internal'; +import { t } from 'app/core/internationalization'; import { getTransformationContent } from '../docs/getTransformationContent'; @@ -124,12 +125,18 @@ export const extractFieldsTransformerEditor = ({ )} {options.format === FieldExtractorID.Delimiter && ( - + diff --git a/public/app/features/transformers/extractFields/components/JSONPathEditor.tsx b/public/app/features/transformers/extractFields/components/JSONPathEditor.tsx index a25ab5367e6..a89b7ae8237 100644 --- a/public/app/features/transformers/extractFields/components/JSONPathEditor.tsx +++ b/public/app/features/transformers/extractFields/components/JSONPathEditor.tsx @@ -3,6 +3,7 @@ import { useState } from 'react'; import * as React from 'react'; import { Button, InlineField, InlineFieldRow, IconButton, Input } from '@grafana/ui'; +import { t, Trans } from 'app/core/internationalization'; import { JSONPath } from '../types'; @@ -51,15 +52,18 @@ export function JSONPathEditor({ options, onChange }: Props) { paths.map((path: JSONPath, key: number) => (
  • - + ) => onJSONPathChange(event, key, 'path')} value={path.path} - placeholder='A valid json path, e.g. "object.value1" or "object.value2[0]"' + placeholder={t( + 'transformers.jsonpath-editor.placeholder-valid-objectvalue', + 'A valid json path, e.g. "object.value1" or "object.value2[0]"' + )} /> - + - removeJSONPath(key)} name={'trash-alt'} tooltip="Remove path" /> + removeJSONPath(key)} + name={'trash-alt'} + tooltip={t('transformers.jsonpath-editor.tooltip-remove-path', 'Remove path')} + />
  • ))} @@ -96,7 +104,9 @@ const getTooltips = () => {
    A valid path of an json object.
    - JSON Value: + + JSON Value: +
               
    diff --git a/public/app/features/transformers/fieldToConfigMapping/FieldToConfigMappingEditor.tsx b/public/app/features/transformers/fieldToConfigMapping/FieldToConfigMappingEditor.tsx
    index be8edf7be09..d57d3f4157e 100644
    --- a/public/app/features/transformers/fieldToConfigMapping/FieldToConfigMappingEditor.tsx
    +++ b/public/app/features/transformers/fieldToConfigMapping/FieldToConfigMappingEditor.tsx
    @@ -3,6 +3,7 @@ import { capitalize } from 'lodash';
     
     import { DataFrame, getFieldDisplayName, GrafanaTheme2, ReducerID, SelectableValue } from '@grafana/data';
     import { Select, StatsPicker, useStyles2 } from '@grafana/ui';
    +import { Trans } from 'app/core/internationalization';
     
     import {
       configMapHandlers,
    @@ -85,10 +86,24 @@ export function FieldToConfigMappingEditor({ frame, mappings, onChange, withRedu
         
    - + {serviceAccount.requiredBy} diff --git a/public/app/features/serviceaccounts/components/ServiceAccountRoleRow.tsx b/public/app/features/serviceaccounts/components/ServiceAccountRoleRow.tsx index bdbb0864e7a..2768644b771 100644 --- a/public/app/features/serviceaccounts/components/ServiceAccountRoleRow.tsx +++ b/public/app/features/serviceaccounts/components/ServiceAccountRoleRow.tsx @@ -1,6 +1,7 @@ import { Label } from '@grafana/ui'; import { UserRolePicker } from 'app/core/components/RolePicker/UserRolePicker'; import { contextSrv } from 'app/core/core'; +import { t } from 'app/core/internationalization'; import { OrgRolePicker } from 'app/features/admin/OrgRolePicker'; import { AccessControlAction, OrgRole, Role, ServiceAccountDTO } from 'app/types'; @@ -38,7 +39,7 @@ export const ServiceAccountRoleRow = ({ label, serviceAccount, roleOptions, onRo
    NameExpiresCreatedLast used at + Name + + Expires + + Created + + Last used at +
    onRoleChange(newRole, serviceAccount)} @@ -102,7 +103,7 @@ const ServiceAccountListItemComponent = memo(
    @@ -122,17 +123,17 @@ const ServiceAccountListItemComponent = memo( disabled={serviceAccount.isDisabled} className={styles.actionButton} > - Add token + Add token )} {contextSrv.hasPermissionInMetadata(AccessControlAction.ServiceAccountsWrite, serviceAccount) && (serviceAccount.isDisabled ? ( ) : ( ))} {contextSrv.hasPermissionInMetadata(AccessControlAction.ServiceAccountsDelete, serviceAccount) && ( diff --git a/public/app/features/trails/Breakdown/AddToFiltersGraphAction.tsx b/public/app/features/trails/Breakdown/AddToFiltersGraphAction.tsx index faf7ef9542b..091159b1b35 100644 --- a/public/app/features/trails/Breakdown/AddToFiltersGraphAction.tsx +++ b/public/app/features/trails/Breakdown/AddToFiltersGraphAction.tsx @@ -7,6 +7,7 @@ import { AdHocFiltersVariable, } from '@grafana/scenes'; import { Button } from '@grafana/ui'; +import { Trans } from 'app/core/internationalization'; import { reportExploreMetrics } from '../interactions'; import { VAR_OTEL_AND_METRIC_FILTERS, VAR_OTEL_GROUP_LEFT, VAR_OTEL_RESOURCES } from '../shared'; @@ -87,7 +88,7 @@ export class AddToFiltersGraphAction extends SceneObjectBase - Add to filters + Add to filters ); }; diff --git a/public/app/features/trails/Breakdown/BreakdownSearchScene.tsx b/public/app/features/trails/Breakdown/BreakdownSearchScene.tsx index e0a145416ad..f64aa66e458 100644 --- a/public/app/features/trails/Breakdown/BreakdownSearchScene.tsx +++ b/public/app/features/trails/Breakdown/BreakdownSearchScene.tsx @@ -2,6 +2,7 @@ import { ChangeEvent } from 'react'; import { BusEventBase } from '@grafana/data'; import { SceneComponentProps, SceneObjectBase, SceneObjectState } from '@grafana/scenes'; +import { t } from 'app/core/internationalization'; import { ByFrameRepeater } from './ByFrameRepeater'; import { LabelBreakdownScene } from './LabelBreakdownScene'; @@ -34,7 +35,7 @@ export class BreakdownSearchScene extends SceneObjectBase ); }; diff --git a/public/app/features/trails/Breakdown/LabelBreakdownScene.tsx b/public/app/features/trails/Breakdown/LabelBreakdownScene.tsx index adc86af8f1c..68205f4ace9 100644 --- a/public/app/features/trails/Breakdown/LabelBreakdownScene.tsx +++ b/public/app/features/trails/Breakdown/LabelBreakdownScene.tsx @@ -28,7 +28,7 @@ import { } from '@grafana/scenes'; import { DataQuery, SortOrder, TooltipDisplayMode } from '@grafana/schema'; import { Alert, Button, Field, LoadingPlaceholder, useStyles2 } from '@grafana/ui'; -import { Trans } from 'app/core/internationalization'; +import { Trans, t } from 'app/core/internationalization'; import { BreakdownLabelSelector } from '../BreakdownLabelSelector'; import { DataTrail } from '../DataTrail'; @@ -374,14 +374,14 @@ export class LabelBreakdownScene extends SceneObjectBase - + )} {body instanceof LayoutSwitcher && ( - + )} @@ -585,7 +585,7 @@ function buildNormalLayout( children: [ new SceneFlexItem({ body: new SceneReactObject({ - reactNode: , + reactNode: , }), }), ], diff --git a/public/app/features/trails/Breakdown/SortByScene.tsx b/public/app/features/trails/Breakdown/SortByScene.tsx index 8454dfdc63b..c3272bc6818 100644 --- a/public/app/features/trails/Breakdown/SortByScene.tsx +++ b/public/app/features/trails/Breakdown/SortByScene.tsx @@ -3,6 +3,7 @@ import { css } from '@emotion/css'; import { BusEventBase, GrafanaTheme2, SelectableValue } from '@grafana/data'; import { SceneComponentProps, SceneObjectBase, SceneObjectState } from '@grafana/scenes'; import { IconButton, Select, Field, useStyles2 } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; import { Trans } from '../../../core/internationalization'; import { getSortByPreference, setSortByPreference } from '../services/store'; @@ -79,7 +80,10 @@ export class SortByScene extends SceneObjectBase { name={'info-circle'} size="sm" variant={'secondary'} - tooltip="Sorts values using standard or smart time series calculations." + tooltip={t( + 'trails.sort-by-scene.tooltip-sorts-values-using-standard-smart-series', + 'Sorts values using standard or smart time series calculations.' + )} />
    } diff --git a/public/app/features/trails/DataTrailCard.tsx b/public/app/features/trails/DataTrailCard.tsx index 75967191964..d752eb5088a 100644 --- a/public/app/features/trails/DataTrailCard.tsx +++ b/public/app/features/trails/DataTrailCard.tsx @@ -4,7 +4,7 @@ import { useMemo } from 'react'; import { dateTimeFormat, GrafanaTheme2 } from '@grafana/data'; import { AdHocFiltersVariable, sceneGraph } from '@grafana/scenes'; import { Card, IconButton, useStyles2 } from '@grafana/ui'; -import { Trans } from 'app/core/internationalization'; +import { Trans, t } from 'app/core/internationalization'; import { DataTrail } from './DataTrail'; import { getTrailStore, DataTrailBookmark } from './TrailStore/TrailStore'; @@ -79,7 +79,7 @@ export function DataTrailCard(props: Props) { key="delete" name="trash-alt" className={styles.secondary} - tooltip="Remove bookmark" + tooltip={t('trails.data-trail-card.deleteButton-tooltip-remove-bookmark', 'Remove bookmark')} onClick={onDelete} data-testid="deleteButton" /> diff --git a/public/app/features/trails/DataTrailSettings.tsx b/public/app/features/trails/DataTrailSettings.tsx index 7007b511ad0..88fd63adc96 100644 --- a/public/app/features/trails/DataTrailSettings.tsx +++ b/public/app/features/trails/DataTrailSettings.tsx @@ -50,7 +50,9 @@ export class DataTrailSettings extends SceneObjectBase { return ( /* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
    evt.stopPropagation()}> -
    Settings
    +
    + Settings +
    {topScene instanceof MetricScene && (
    diff --git a/public/app/features/trails/DataTrailsHistory.tsx b/public/app/features/trails/DataTrailsHistory.tsx index 81e20a8b29c..694d73918d1 100644 --- a/public/app/features/trails/DataTrailsHistory.tsx +++ b/public/app/features/trails/DataTrailsHistory.tsx @@ -16,6 +16,7 @@ import { } from '@grafana/scenes'; import { Stack, Tooltip, useStyles2 } from '@grafana/ui'; import { appEvents } from 'app/core/app_events'; +import { Trans } from 'app/core/internationalization'; import { RecordHistoryEntryEvent } from 'app/types/events'; import { DataTrail, DataTrailState, getTopSceneFor } from './DataTrail'; @@ -305,7 +306,9 @@ export class DataTrailHistory extends SceneObjectBase { return (
    -
    History
    +
    + History +
    {steps.map((step, index) => { let stepType = step.type; diff --git a/public/app/features/trails/MetricScene.tsx b/public/app/features/trails/MetricScene.tsx index 8014f3c2bc5..4483936e390 100644 --- a/public/app/features/trails/MetricScene.tsx +++ b/public/app/features/trails/MetricScene.tsx @@ -13,6 +13,7 @@ import { SceneVariableSet, } from '@grafana/scenes'; import { Box, Icon, LinkButton, Stack, Tab, TabsBar, ToolbarButton, Tooltip, useStyles2 } from '@grafana/ui'; +import { t, Trans } from 'app/core/internationalization'; import { getExploreUrl } from '../../core/utils/explore'; @@ -182,18 +183,21 @@ export class MetricActionBar extends SceneObjectBase { { reportExploreMetrics('selected_metric_action_clicked', { action: 'unselect' }); trail.publishEvent(new MetricSelectedEvent(undefined)); }} > - Select new metric + Select new metric @@ -215,7 +219,7 @@ export class MetricActionBar extends SceneObjectBase { variant={'secondary'} onClick={() => reportExploreMetrics('selected_metric_action_clicked', { action: 'open_from_embedded' })} > - Open + Open )} diff --git a/public/app/features/trails/MetricSelect/MetricSelectScene.tsx b/public/app/features/trails/MetricSelect/MetricSelectScene.tsx index 9cea458adaa..ecb6d767529 100644 --- a/public/app/features/trails/MetricSelect/MetricSelectScene.tsx +++ b/public/app/features/trails/MetricSelect/MetricSelectScene.tsx @@ -26,7 +26,7 @@ import { VariableDependencyConfig, } from '@grafana/scenes'; import { Alert, Badge, Field, Icon, IconButton, InlineSwitch, Input, Select, Tooltip, useStyles2 } from '@grafana/ui'; -import { Trans } from 'app/core/internationalization'; +import { Trans, t } from 'app/core/internationalization'; import { MetricScene } from '../MetricScene'; import { StatusWrapper } from '../StatusWrapper'; @@ -523,6 +523,10 @@ export class MetricSelectScene extends SceneObjectBase i const isLoading = metricNamesLoading && children.length === 0; + const unableToRetrieveMetricNames = t( + 'trails.metric-select-scene.unable-to-retrieve-metric-names', + 'Unable to retrieve metric names' + ); const blockingMessage = isLoading ? undefined : missingOtelTargets @@ -535,7 +539,7 @@ export class MetricSelectScene extends SceneObjectBase i -

    Unable to retrieve metric names

    +

    {unableToRetrieveMetricNames}

    {metricNamesWarning}

    } @@ -549,7 +553,7 @@ export class MetricSelectScene extends SceneObjectBase i
    } value={metricSearch} onChange={model.onSearchQueryChange} @@ -616,7 +620,7 @@ export class MetricSelectScene extends SceneObjectBase i @@ -625,14 +629,17 @@ export class MetricSelectScene extends SceneObjectBase i )}
    {metricNamesError && ( - +
    We are unable to connect to your data source. Double check your data source URL and credentials.
    ({metricNamesError})
    )} {metricNamesWarning && !warningDismissed && ( ( - Metrics - Explore your Prometheus-compatible metrics without writing a query + + Metrics + + + + Explore your Prometheus-compatible metrics without writing a query + + ); diff --git a/public/app/features/trails/TrailStore/utils.tsx b/public/app/features/trails/TrailStore/utils.tsx index 8c1b84d1900..7975fbb3085 100644 --- a/public/app/features/trails/TrailStore/utils.tsx +++ b/public/app/features/trails/TrailStore/utils.tsx @@ -1,4 +1,5 @@ import { LinkButton, Stack } from '@grafana/ui'; +import { Trans } from 'app/core/internationalization'; import { createSuccessNotification } from '../../../core/copy/appNotification'; import { HOME_ROUTE } from '../shared'; @@ -12,7 +13,7 @@ export function createBookmarkSavedNotification() { You can view bookmarks under Explore > Metrics
    - View bookmarks + View bookmarks ); diff --git a/public/app/features/transformers/FilterByValueTransformer/FilterByValueFilterEditor.tsx b/public/app/features/transformers/FilterByValueTransformer/FilterByValueFilterEditor.tsx index 1b2f85c51da..51228024888 100644 --- a/public/app/features/transformers/FilterByValueTransformer/FilterByValueFilterEditor.tsx +++ b/public/app/features/transformers/FilterByValueTransformer/FilterByValueFilterEditor.tsx @@ -3,6 +3,7 @@ import { useCallback } from 'react'; import { Field, SelectableValue, valueMatchers } from '@grafana/data'; import { FilterByValueFilter } from '@grafana/data/internal'; import { Button, Select, InlineField, InlineFieldRow, Box } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; import { valueMatchersUI } from './ValueMatchers/valueMatchersUI'; @@ -76,25 +77,25 @@ export const FilterByValueFilterEditor = (props: Props) => { return ( - + - + diff --git a/public/app/features/transformers/FilterByValueTransformer/FilterByValueTransformerEditor.tsx b/public/app/features/transformers/FilterByValueTransformer/FilterByValueTransformerEditor.tsx index 57b42e72d32..09cdb5f67c4 100644 --- a/public/app/features/transformers/FilterByValueTransformer/FilterByValueTransformerEditor.tsx +++ b/public/app/features/transformers/FilterByValueTransformer/FilterByValueTransformerEditor.tsx @@ -21,6 +21,7 @@ import { FilterByValueType, } from '@grafana/data/internal'; import { Button, RadioButtonGroup, InlineField, Box } from '@grafana/ui'; +import { t, Trans } from 'app/core/internationalization'; import { getTransformationContent } from '../docs/getTransformationContent'; @@ -101,12 +102,18 @@ export const FilterByValueTransformerEditor = (props: TransformerUIProps - +
    - +
    @@ -122,7 +129,7 @@ export const FilterByValueTransformerEditor = (props: TransformerUIProps ))}
    diff --git a/public/app/features/transformers/FilterByValueTransformer/ValueMatchers/BasicMatcherEditor.tsx b/public/app/features/transformers/FilterByValueTransformer/ValueMatchers/BasicMatcherEditor.tsx index 6cb7328c59b..780a52ec9a1 100644 --- a/public/app/features/transformers/FilterByValueTransformer/ValueMatchers/BasicMatcherEditor.tsx +++ b/public/app/features/transformers/FilterByValueTransformer/ValueMatchers/BasicMatcherEditor.tsx @@ -2,6 +2,7 @@ import { useCallback, useState } from 'react'; import * as React from 'react'; import { ValueMatcherID, BasicValueMatcherOptions } from '@grafana/data'; +import { t } from 'app/core/internationalization'; import { SuggestionsInput } from '../../suggestionsInput/SuggestionsInput'; import { getVariableSuggestions, numberOrVariableValidator } from '../../utils'; @@ -33,7 +34,7 @@ export function basicMatcherEditor( value={value} error={'Value needs to be a number or a variable'} onChange={onChangeVariableValue} - placeholder="Value or variable" + placeholder={t('transformers.basic-matcher-editor.placeholder-value-or-variable', 'Value or variable')} suggestions={getVariableSuggestions()} /> ); diff --git a/public/app/features/transformers/FilterByValueTransformer/ValueMatchers/RangeMatcherEditor.tsx b/public/app/features/transformers/FilterByValueTransformer/ValueMatchers/RangeMatcherEditor.tsx index 0dd2c09ff92..36fbc5c07ec 100644 --- a/public/app/features/transformers/FilterByValueTransformer/ValueMatchers/RangeMatcherEditor.tsx +++ b/public/app/features/transformers/FilterByValueTransformer/ValueMatchers/RangeMatcherEditor.tsx @@ -3,6 +3,7 @@ import * as React from 'react'; import { ValueMatcherID, RangeValueMatcherOptions } from '@grafana/data'; import { InlineLabel } from '@grafana/ui'; +import { t, Trans } from 'app/core/internationalization'; import { SuggestionsInput } from '../../suggestionsInput/SuggestionsInput'; import { getVariableSuggestions, numberOrVariableValidator } from '../../utils'; @@ -50,16 +51,18 @@ export function rangeMatcherEditor( value={String(options.from)} invalid={isInvalid.from} error={'Value needs to be a number or a variable'} - placeholder="From" + placeholder={t('transformers.range-matcher-editor.placeholder-from', 'From')} onChange={(val) => onChangeOptionsSuggestions(val, 'from')} suggestions={suggestions} /> - and + + and + onChangeOptionsSuggestions(val, 'to')} /> diff --git a/public/app/features/transformers/FilterByValueTransformer/ValueMatchers/RegexMatcherEditor.tsx b/public/app/features/transformers/FilterByValueTransformer/ValueMatchers/RegexMatcherEditor.tsx index 451bcf65999..09fc5936cda 100644 --- a/public/app/features/transformers/FilterByValueTransformer/ValueMatchers/RegexMatcherEditor.tsx +++ b/public/app/features/transformers/FilterByValueTransformer/ValueMatchers/RegexMatcherEditor.tsx @@ -2,6 +2,7 @@ import { useCallback, useState } from 'react'; import * as React from 'react'; import { ValueMatcherID, BasicValueMatcherOptions } from '@grafana/data'; +import { t } from 'app/core/internationalization'; import { SuggestionsInput } from '../../suggestionsInput/SuggestionsInput'; import { getVariableSuggestions } from '../../utils'; @@ -32,7 +33,7 @@ export function regexMatcherEditor( invalid={isInvalid} value={value} onChange={onChangeVariableValue} - placeholder="Value or variable" + placeholder={t('transformers.regex-matcher-editor.placeholder-value-or-variable', 'Value or variable')} suggestions={getVariableSuggestions()} /> ); diff --git a/public/app/features/transformers/calculateHeatmap/editor/AxisEditor.tsx b/public/app/features/transformers/calculateHeatmap/editor/AxisEditor.tsx index c45de35235b..4ead9f3ea94 100644 --- a/public/app/features/transformers/calculateHeatmap/editor/AxisEditor.tsx +++ b/public/app/features/transformers/calculateHeatmap/editor/AxisEditor.tsx @@ -4,6 +4,7 @@ import { SelectableValue, StandardEditorProps, VariableOrigin } from '@grafana/d import { getTemplateSrv } from '@grafana/runtime'; import { HeatmapCalculationBucketConfig, HeatmapCalculationMode } from '@grafana/schema'; import { HorizontalGroup, RadioButtonGroup, ScaleDistribution } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; import { SuggestionsInput } from '../../suggestionsInput/SuggestionsInput'; import { numberOrVariableValidator } from '../../utils'; @@ -82,7 +83,7 @@ export const AxisEditor = ({ value, onChange, item }: StandardEditorProps { onValueChange({ ...value, value: text }); }} diff --git a/public/app/features/transformers/configFromQuery/ConfigFromQueryTransformerEditor.tsx b/public/app/features/transformers/configFromQuery/ConfigFromQueryTransformerEditor.tsx index 87ffe52cbb3..e21d28bbd68 100644 --- a/public/app/features/transformers/configFromQuery/ConfigFromQueryTransformerEditor.tsx +++ b/public/app/features/transformers/configFromQuery/ConfigFromQueryTransformerEditor.tsx @@ -10,6 +10,7 @@ import { TransformerCategory, } from '@grafana/data'; import { fieldMatchersUI, InlineField, InlineFieldRow, Select, useStyles2 } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; import { getTransformationContent } from '../docs/getTransformationContent'; import { FieldToConfigMappingEditor } from '../fieldToConfigMapping/FieldToConfigMappingEditor'; @@ -54,17 +55,27 @@ export function ConfigFromQueryTransformerEditor({ input, onChange, options }: P return ( <> - + - + - + - + - + diff --git a/public/app/features/transformers/editors/CalculateFieldTransformerEditor/CumulativeOptionsEditor.tsx b/public/app/features/transformers/editors/CalculateFieldTransformerEditor/CumulativeOptionsEditor.tsx index 5d8eb17ea1d..815484ecf5e 100644 --- a/public/app/features/transformers/editors/CalculateFieldTransformerEditor/CumulativeOptionsEditor.tsx +++ b/public/app/features/transformers/editors/CalculateFieldTransformerEditor/CumulativeOptionsEditor.tsx @@ -1,6 +1,7 @@ import { ReducerID, SelectableValue } from '@grafana/data'; import { CalculateFieldMode, CalculateFieldTransformerOptions, CumulativeOptions } from '@grafana/data/internal'; import { InlineField, Select, StatsPicker } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; import { LABEL_WIDTH } from './constants'; @@ -36,16 +37,19 @@ export const CumulativeOptionsEditor = (props: { return ( <> - + - + - + - + - + + + )}
    diff --git a/public/app/features/transformers/editors/ConvertFieldTypeTransformerEditor.tsx b/public/app/features/transformers/editors/ConvertFieldTypeTransformerEditor.tsx index e331388cb3e..fe58688236e 100644 --- a/public/app/features/transformers/editors/ConvertFieldTypeTransformerEditor.tsx +++ b/public/app/features/transformers/editors/ConvertFieldTypeTransformerEditor.tsx @@ -15,6 +15,7 @@ import { import { ConvertFieldTypeOptions, ConvertFieldTypeTransformerOptions } from '@grafana/data/internal'; import { Button, InlineField, InlineFieldRow, Input, Select } from '@grafana/ui'; import { allFieldTypeIconOptions, FieldNamePicker } from '@grafana/ui/internal'; +import { t } from 'app/core/internationalization'; import { findField } from 'app/features/dimensions'; import { getTransformationContent } from '../docs/getTransformationContent'; @@ -150,7 +151,7 @@ export const ConvertFieldTypeTransformerEditor = ({ {c.destinationType === FieldType.time && ( {(c.joinWith?.length || targetField?.type === FieldType.other) && ( - + )} {targetField?.type === FieldType.time && ( <> - + - +
    - - - {withReducers && } - {hasAdditionalSettings && } + + + {withReducers && ( + + )} + {hasAdditionalSettings && ( + + )} diff --git a/public/app/features/transformers/joinByLabels/JoinByLabelsTransformerEditor.tsx b/public/app/features/transformers/joinByLabels/JoinByLabelsTransformerEditor.tsx index 7f1ff442f37..a11dc511dcb 100644 --- a/public/app/features/transformers/joinByLabels/JoinByLabelsTransformerEditor.tsx +++ b/public/app/features/transformers/joinByLabels/JoinByLabelsTransformerEditor.tsx @@ -9,6 +9,7 @@ import { TransformerCategory, } from '@grafana/data'; import { Alert, HorizontalGroup, InlineField, InlineFieldRow, Select, ValuePicker } from '@grafana/ui'; +import { t, Trans } from 'app/core/internationalization'; import { getTransformationContent } from '../docs/getTransformationContent'; import { getDistinctLabels } from '../utils'; @@ -29,9 +30,23 @@ export function JoinByLabelsTransformerEditor({ input, options, onChange }: Prop } if (!input.length) { - warn = No input (or labels) found; + warn = ( + + + No input (or labels) found + + + ); } else if (distinct.size === 0) { - warn = The input does not contain any labels; + warn = ( + + + The input does not contain any labels + + + ); } // Show the selected values @@ -97,7 +112,10 @@ export function JoinByLabelsTransformerEditor({ input, options, onChange }: Prop invalid={!Boolean(options.value?.length)} label={'Value'} labelWidth={labelWidth} - tooltip="Select the label indicating the values name" + tooltip={t( + 'transformers.join-by-labels-transformer-editor.tooltip-select-label-indicating-values', + 'Select the label indicating the values name' + )} > - +
    {(formats.find((v) => v.value === options.format) || formats[0]).info}
    diff --git a/public/app/features/transformers/regression/regressionEditor.tsx b/public/app/features/transformers/regression/regressionEditor.tsx index 4044035562d..85207f4b75d 100644 --- a/public/app/features/transformers/regression/regressionEditor.tsx +++ b/public/app/features/transformers/regression/regressionEditor.tsx @@ -12,6 +12,7 @@ import { import { InlineField, Select } from '@grafana/ui'; import { FieldNamePicker } from '@grafana/ui/internal'; import { NumberInput } from 'app/core/components/OptionsUI/NumberInput'; +import { t } from 'app/core/internationalization'; import { getTransformationContent } from '../docs/getTransformationContent'; @@ -74,7 +75,10 @@ export const RegressionTransformerEditor = ({ return ( <> - + - + - + - + { @@ -112,7 +126,10 @@ export const RegressionTransformerEditor = ({ > {options.modelType === ModelType.polynomial && ( - + value={options.degree ?? DEFAULTS.degree} options={[ diff --git a/public/app/features/transformers/timeSeriesTable/TimeSeriesTableTransformEditor.tsx b/public/app/features/transformers/timeSeriesTable/TimeSeriesTableTransformEditor.tsx index b8387e6889a..7e09fc1d1c5 100644 --- a/public/app/features/transformers/timeSeriesTable/TimeSeriesTableTransformEditor.tsx +++ b/public/app/features/transformers/timeSeriesTable/TimeSeriesTableTransformEditor.tsx @@ -12,6 +12,7 @@ import { isTimeSeriesField, } from '@grafana/data'; import { InlineFieldRow, InlineField, StatsPicker, Select, InlineLabel } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; import { getTransformationContent } from '../docs/getTransformationContent'; @@ -89,7 +90,7 @@ export function TimeSeriesTableTransformEditor({ {`Trend #${refId}`}
    - - + + @@ -95,7 +99,7 @@ export function VariableEditorList({ onClick={onAdd} icon="plus" > - New variable + New variable diff --git a/public/app/features/variables/editor/VariableEditorListRow.tsx b/public/app/features/variables/editor/VariableEditorListRow.tsx index 7c5b6490c57..545b96327f7 100644 --- a/public/app/features/variables/editor/VariableEditorListRow.tsx +++ b/public/app/features/variables/editor/VariableEditorListRow.tsx @@ -6,6 +6,7 @@ import { GrafanaTheme2, TypedVariableModel } from '@grafana/data'; import { selectors } from '@grafana/e2e-selectors'; import { reportInteraction } from '@grafana/runtime'; import { Button, Icon, IconButton, useStyles2, useTheme2 } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; import { hasOptions } from '../guard'; import { VariableUsagesButton } from '../inspect/VariableUsagesButton'; @@ -88,7 +89,7 @@ export function VariableEditorListRow({ propsOnDuplicate(identifier); }} name="copy" - tooltip="Duplicate variable" + tooltip={t('variables.variable-editor-list-row.tooltip-duplicate-variable', 'Duplicate variable')} aria-label={selectors.pages.Dashboard.Settings.Variables.List.tableRowDuplicateButtons(variable.name)} />
    @@ -138,7 +139,10 @@ function VariableCheckIndicator({ passed }: VariableCheckIndicatorProps): ReactE ); } @@ -147,7 +151,10 @@ function VariableCheckIndicator({ passed }: VariableCheckIndicatorProps): ReactE ); } diff --git a/public/app/features/variables/inspect/VariableUsagesButton.tsx b/public/app/features/variables/inspect/VariableUsagesButton.tsx index ca1f9e40c79..d40e83ff610 100644 --- a/public/app/features/variables/inspect/VariableUsagesButton.tsx +++ b/public/app/features/variables/inspect/VariableUsagesButton.tsx @@ -2,6 +2,7 @@ import { useMemo } from 'react'; import { reportInteraction } from '@grafana/runtime'; import { IconButton } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; import { NetworkGraphModal } from './NetworkGraphModal'; import { UsagesToNetwork } from './utils'; @@ -35,7 +36,7 @@ export const VariableUsagesButton = ({ id, usages, isAdhoc }: Props) => { showModal(); }} name="code-branch" - tooltip="Show usages" + tooltip={t('variables.variable-usages-button.tooltip-show-usages', 'Show usages')} /> ); }} diff --git a/public/app/features/variables/inspect/VariablesDependenciesButton.tsx b/public/app/features/variables/inspect/VariablesDependenciesButton.tsx index a341637feb4..8901134e07f 100644 --- a/public/app/features/variables/inspect/VariablesDependenciesButton.tsx +++ b/public/app/features/variables/inspect/VariablesDependenciesButton.tsx @@ -3,6 +3,7 @@ import { useMemo } from 'react'; import { TypedVariableModel } from '@grafana/data'; import { reportInteraction } from '@grafana/runtime'; import { Button } from '@grafana/ui'; +import { t, Trans } from 'app/core/internationalization'; import { NetworkGraphModal } from './NetworkGraphModal'; import { createDependencyEdges, createDependencyNodes, filterNodesWithDependencies } from './utils'; @@ -22,7 +23,7 @@ export const VariablesDependenciesButton = ({ variables }: Props) => { return ( @@ -36,7 +37,7 @@ export const VariablesDependenciesButton = ({ variables }: Props) => { icon="channel-add" variant="secondary" > - Show dependencies + Show dependencies ); }} diff --git a/public/app/features/variables/inspect/VariablesUnknownButton.tsx b/public/app/features/variables/inspect/VariablesUnknownButton.tsx index ca60f473528..2c73b49b948 100644 --- a/public/app/features/variables/inspect/VariablesUnknownButton.tsx +++ b/public/app/features/variables/inspect/VariablesUnknownButton.tsx @@ -1,6 +1,7 @@ import { useMemo } from 'react'; import { IconButton } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; import { NetworkGraphModal } from './NetworkGraphModal'; import { UsagesToNetwork } from './utils'; @@ -31,7 +32,7 @@ export const VariablesUnknownButton = ({ id, usages }: Props) => { showModal()} name="code-branch" - tooltip="Show usages" + tooltip={t('variables.variables-unknown-button.VariablesUnknownButton-tooltip-show-usages', 'Show usages')} data-testid="VariablesUnknownButton" /> ); diff --git a/public/app/features/variables/inspect/VariablesUnknownTable.tsx b/public/app/features/variables/inspect/VariablesUnknownTable.tsx index f197b584267..2c0dce367c7 100644 --- a/public/app/features/variables/inspect/VariablesUnknownTable.tsx +++ b/public/app/features/variables/inspect/VariablesUnknownTable.tsx @@ -5,6 +5,7 @@ import { useAsync } from 'react-use'; import { GrafanaTheme2 } from '@grafana/data'; import { reportInteraction } from '@grafana/runtime'; import { CollapsableSection, HorizontalGroup, Icon, Spinner, Tooltip, useStyles2, VerticalGroup } from '@grafana/ui'; +import { Trans } from 'app/core/internationalization'; import { DashboardModel } from '../../dashboard/state/DashboardModel'; import { VariableModel } from '../types'; @@ -57,7 +58,9 @@ export function VariablesUnknownTable({ variables, dashboard }: VariablesUnknown {loading && ( - Loading... + + Loading... + @@ -86,7 +89,13 @@ function CollapseLabel(): ReactElement { } function NoUnknowns(): ReactElement { - return No renamed or missing variables found.; + return ( + + + No renamed or missing variables found. + + + ); } function UnknownTable({ usages }: { usages: UsagesToNetwork[] }): ReactElement { @@ -95,7 +104,9 @@ function UnknownTable({ usages }: { usages: UsagesToNetwork[] }): ReactElement {
    FieldUse asSelectAdditional settings + Field + + Use as + + Select + + + Additional settings + +
    VariableDefinition + Variable + + Definition +
    - + diff --git a/public/app/features/variables/pickers/shared/VariableOptions.tsx b/public/app/features/variables/pickers/shared/VariableOptions.tsx index b31905f8b1b..041291a2ffd 100644 --- a/public/app/features/variables/pickers/shared/VariableOptions.tsx +++ b/public/app/features/variables/pickers/shared/VariableOptions.tsx @@ -121,7 +121,7 @@ class VariableOptions extends PureComponent { role="checkbox" aria-checked={selectedValues.length > 1 ? 'mixed' : 'false'} onClick={this.onToggleAll} - aria-label="Toggle all values" + aria-label={t('variables.variable-options.aria-label-toggle-all-values', 'Toggle all values')} data-placement="top" > void; @@ -32,7 +33,14 @@ export function QueryVariableRefreshSelect({ onChange, refresh, testId }: PropsW ); return ( - + - Text options + + Text options + ( - + - - - {showIconPicker && } + + + {showIconPicker && ( + + )} @@ -125,7 +134,7 @@ export function ValueMappingsEditorModal({ value, onChange, onClose, showIconPic diff --git a/public/app/features/explore/TraceView/components/TracePageHeader/SearchBar/TracePageSearchBar.tsx b/public/app/features/explore/TraceView/components/TracePageHeader/SearchBar/TracePageSearchBar.tsx index ef2fb3bbff6..6590e40feda 100644 --- a/public/app/features/explore/TraceView/components/TracePageHeader/SearchBar/TracePageSearchBar.tsx +++ b/public/app/features/explore/TraceView/components/TracePageHeader/SearchBar/TracePageSearchBar.tsx @@ -18,6 +18,7 @@ import { memo, Dispatch, SetStateAction, useMemo } from 'react'; import { GrafanaTheme2 } from '@grafana/data'; import { Button, Switch, useStyles2 } from '@grafana/ui'; import { getButtonStyles } from '@grafana/ui/internal'; +import { Trans } from 'app/core/internationalization'; import { SearchProps } from '../../../useSearch'; import { Trace } from '../../types'; @@ -83,7 +84,7 @@ export default memo(function TracePageSearchBar(props: TracePageSearchBarProps) aria-label="Clear filters button" onClick={clear} > - Clear + Clear
    - Show matches only + Show matches only
    @@ -114,7 +115,7 @@ export default memo(function TracePageSearchBar(props: TracePageSearchBarProps) variant="secondary" fill="text" > - Show critical path only + Show critical path only
    diff --git a/public/app/features/expressions/ExpressionQueryEditor.tsx b/public/app/features/expressions/ExpressionQueryEditor.tsx index fdb6c9b7343..f2c29c0eef0 100644 --- a/public/app/features/expressions/ExpressionQueryEditor.tsx +++ b/public/app/features/expressions/ExpressionQueryEditor.tsx @@ -2,6 +2,7 @@ import { useCallback, useEffect, useRef } from 'react'; import { DataSourceApi, QueryEditorProps, SelectableValue } from '@grafana/data'; import { InlineField, Select } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; import { ClassicConditions } from './components/ClassicConditions'; import { Math } from './components/Math'; @@ -103,7 +104,10 @@ export function ExpressionQueryEditor(props: Props) { return (
    - + ); @@ -97,15 +100,15 @@ export const Reduce = ({ labelWidth = 'auto', onChange, app, refIds, query }: Pr <> {strictModeNotification()} - + - + - + - + diff --git a/public/app/features/expressions/components/Threshold.tsx b/public/app/features/expressions/components/Threshold.tsx index 6d0d43eb7e9..8f4782241dc 100644 --- a/public/app/features/expressions/components/Threshold.tsx +++ b/public/app/features/expressions/components/Threshold.tsx @@ -93,7 +93,7 @@ export const Threshold = ({ labelWidth, onChange, refIds, query, onError, useHys return ( <> - +
    Variable + Variable +
    Link + Link + {link.title} diff --git a/public/locales/en-US/grafana.json b/public/locales/en-US/grafana.json index f0f84ff36a0..0868a4cdbd0 100644 --- a/public/locales/en-US/grafana.json +++ b/public/locales/en-US/grafana.json @@ -4327,6 +4327,73 @@ "title": "You haven't created any service accounts yet" } }, + "serviceaccounts": { + "create-token-modal": { + "close": "Close", + "copy-clipboard": "Copy to clipboard", + "copy-to-clipboard-and-close": "Copy to clipboard and close", + "description-name-to-easily-identify-the-token": "Name to easily identify the token", + "generate-token": "Generate token", + "label-display-name": "Display name", + "label-expiration": "Expiration", + "label-expiration-date": "Expiration date", + "label-token": "Token" + }, + "get-actions-cell": { + "add-token": "Add token", + "disable": "Disable", + "enable": "Enable" + }, + "get-role-cell": { + "aria-label-role": "Role" + }, + "service-account-list-item": { + "add-token": "Add token", + "aria-label-role": "Role", + "disable": "Disable", + "enable": "Enable", + "title-tokens": "Tokens" + }, + "service-account-page-unconnected": { + "add-service-account-token": "Add service account token", + "delete-service-account": "Delete service account", + "disable-service-account": "Disable service account", + "enable-service-account": "Enable service account", + "title-delete-service-account": "Delete service account", + "title-disable-service-account": "Disable service account", + "tokens": "Tokens" + }, + "service-account-permissions": { + "title-permissions": "Permissions" + }, + "service-account-profile": { + "information": "Information", + "label-creation-date": "Creation date", + "label-id": "ID", + "label-name": "Name", + "label-numerical-identifier": "Numerical identifier", + "label-roles": "Roles", + "used-by": "Used by" + }, + "service-account-role-row": { + "aria-label-role": "Role" + }, + "service-account-tokens-table": { + "created": "Created", + "expires": "Expires", + "last-used-at": "Last used at", + "name": "Name" + }, + "service-accounts-list-page-unconnected": { + "add-service-account": "Add service account", + "placeholder-search-service-account-by-name": "Search service account by name", + "title-delete-service-account": "Delete service account", + "title-disable-service-account": "Disable service account" + }, + "token-expiration": { + "never": "Never" + } + }, "share-dashboard": { "menu": { "export-json-title": "Export as JSON", @@ -4707,24 +4774,67 @@ } }, "trails": { + "add-to-filters-graph-action": { + "add-to-filters": "Add to filters" + }, "bookmarks": { "or-view-bookmarks": "Or view bookmarks" }, + "breakdown-search-scene": { + "placeholder-search-for-value": "Search for value" + }, + "build-normal-layout": { + "text-loading": "Loading..." + }, "card": { "date-created": "Date created: " }, + "create-bookmark-saved-notification": { + "view-bookmarks": "View bookmarks" + }, + "data-trail-card": { + "deleteButton-tooltip-remove-bookmark": "Remove bookmark" + }, + "data-trail-history": { + "history": "History" + }, + "data-trail-settings": { + "render-popover": { + "settings": "Settings" + } + }, "home": { "learn-more": "Learn more", "lets-start": "Let's start!", "start-your-metrics-exploration": "Start your metrics exploration!", "subtitle": "Explore your Prometheus-compatible metrics without writing a query." }, + "label-breakdown-scene": { + "label-search": "Search", + "label-view": "View" + }, + "metric-action-bar": { + "open": "Open", + "select-new-metric": "Select new metric", + "tooltip-open-in-explore": "Open in explore", + "tooltip-remove-existing-metric-choose": "Remove existing metric and choose a new metric" + }, "metric-select": { "filter-by": "Filter by", "native-histogram": "Native Histogram", "new-badge": "New", "otel-switch": "This switch enables filtering by OTel resources for OTel native data sources." }, + "metric-select-scene": { + "label-otel-experience": "OTel experience", + "placeholder-search-metrics": "Search metrics", + "title-unable-to-retrieve-all-metric-names": "Unable to retrieve all metric names", + "unable-to-retrieve-metric-names": "Unable to retrieve metric names" + }, + "metrics-header": { + "explore-prometheuscompatible-metrics-without-writing-query": "Explore your Prometheus-compatible metrics without writing a query", + "metrics": "Metrics" + }, "native-histogram-banner": { "ch-heatmap": "Classic Histogram displayed as heatmap:", "ch-histogram": "Classic Histogram displayed as histogram:", @@ -4745,6 +4855,9 @@ "settings": { "always-keep-selected-metric-graph-in-view": "Always keep selected metric graph in-view", "show-previews-of-metric-graphs": "Show previews of metric graphs" + }, + "sort-by-scene": { + "tooltip-sorts-values-using-standard-smart-series": "Sorts values using standard or smart time series calculations." } }, "transformations": { @@ -4753,6 +4866,236 @@ "add-transformation-header": "Start transforming data" } }, + "transformers": { + "axis-editor": { + "placeholder-auto": "Auto" + }, + "basic-matcher-editor": { + "placeholder-value-or-variable": "Value or variable" + }, + "binary-operation-options-editor": { + "label-operation": "Operation", + "placeholder-field-or-number": "Field or number", + "placeholder-fields-or-number": "Field(s) or number" + }, + "calculate-field-transformer-editor": { + "label-alias": "Alias", + "label-mode": "Mode", + "label-replace-all-fields": "Replace all fields" + }, + "concatenate-transformer-editor": { + "label-label": "Label", + "label-name": "Name", + "placeholder-frame": "Frame" + }, + "config-from-query-transformer-editor": { + "label-apply-to": "Apply to", + "label-apply-to-options": "Apply to options", + "label-config-query": "Config query" + }, + "convert-field-type-transformer-editor": { + "label-date-format": "Date format", + "label-input-format": "Input format", + "label-join-with": "Join with", + "label-set-timezone": "Set timezone", + "tooltip-explicit-separator-joining-array-values": "Use an explicit separator when joining array values", + "tooltip-specify-the-output-format": "Specify the output format.", + "tooltip-timezone-manually": "Set the timezone of the date manually" + }, + "cumulative-options-editor": { + "label-calculation": "Calculation", + "label-field": "Field", + "placeholder-field": "Field" + }, + "draggable-field-name": { + "title-drag-and-drop-to-reorder": "Drag and drop to reorder" + }, + "enum-mapping-editor": { + "add-enum-value": "Add enum value", + "generate-enum-values-from-data": "Generate enum values from data" + }, + "enum-mapping-row": { + "remove-enum-row-aria-label-delete-enum-row": "Delete enum row", + "remove-enum-row-tooltip-delete": "Delete" + }, + "extract-fields-transformer-editor": { + "label-delimiter": "Delimiter", + "placeholder-select-delimiter": "Select delimiter..." + }, + "field-to-config-mapping-editor": { + "additional-settings": "Additional settings", + "field": "Field", + "select": "Select", + "use-as": "Use as" + }, + "filter-by-name-transformer-editor": { + "label-from-variable": "From variable", + "label-identifier": "Identifier", + "label-use-variable": "Use variable", + "label-variable": "Variable", + "placeholder-regular-expression-pattern": "Regular expression pattern" + }, + "filter-by-value-filter-editor": { + "label-field": "Field", + "label-match": "Match", + "label-value": "Value", + "placeholder-field-name": "Field name", + "placeholder-select-test": "Select test" + }, + "filter-by-value-transformer-editor": { + "add-condition": "Add condition", + "label-conditions": "Conditions", + "label-filter-type": "Filter type" + }, + "format-string-transfomer-editor": { + "label-format": "Format", + "label-substring-range": "Substring range" + }, + "format-time-transfomer-editor": { + "label-format": "Format", + "label-set-timezone": "Set timezone", + "label-time-field": "Time field", + "tooltip-timezone-manually": "Set the timezone of the date manually" + }, + "get-tooltips": { + "json-value": "JSON Value:" + }, + "group-by-field-configuration": { + "placeholder-ignored": "Ignored", + "placeholder-select-stats": "Select stats" + }, + "group-to-nested-table-transformer-editor": { + "label-show-field-names-in-nested-tables": "Show field names in nested tables" + }, + "grouping-to-matrix-transformer-editor": { + "label-cell-value": "Cell value", + "label-column": "Column", + "label-empty-value": "Empty value", + "label-row": "Row" + }, + "histogram-transformer-editor": { + "placeholder-default": "Default: 30" + }, + "index-options-editor": { + "label-as-percentile": "As percentile", + "tooltip-transform-index-percentile": "Transform the row index as a percentile." + }, + "join-by-labels-transformer-editor": { + "info": { + "input-contain-labels": "The input does not contain any labels", + "no-input-or-labels-found": "No input (or labels) found", + "title-no-input-found": "No input found", + "title-no-labels-found": "No labels found" + }, + "tooltip-select-label-indicating-values": "Select the label indicating the values name" + }, + "jsonpath-editor": { + "add-path": "Add path", + "label-alias": "Alias", + "label-field": "Field", + "placeholder-valid-objectvalue": "A valid json path, e.g. \"object.value1\" or \"object.value2[0]\"", + "tooltip-remove-path": "Remove path" + }, + "labels-as-fields-transformer-editor": { + "placeholder-optional-select-label": "(Optional) Select label", + "tooltip-replace-value-field-label": "Replace the value field name with a label" + }, + "limit-transformer-editor": { + "placeholder-value-or-variable": "Value or variable" + }, + "long-info": { + "ascending-order-duplicates": "Time in ascending order, but may have duplicates", + "multiple-value-fields-may-exist": "Multiple value fields may exist", + "single-frame": "Single frame", + "st-field-is-time": "1st field is time field" + }, + "merge-transformer-editor": { + "merge-effect-applied-single-frame": "Merge has no effect when applied on a single frame." + }, + "multi-info": { + "all-values-are-numeric": "All values are numeric", + "multiple-frames": "Multiple frames", + "string-values-are-represented-as-labels": "String values are represented as labels", + "time-in-ascending-order": "Time in ascending order" + }, + "partition-by-values-editor": { + "label-field": "Field", + "label-select-field": "Select field", + "partition-values-works-single-frame": "Partition by values only works with a single frame." + }, + "prepare-time-series-editor": { + "label-format": "Format", + "label-info": "Info" + }, + "range-matcher-editor": { + "and": "and", + "placeholder-from": "From", + "placeholder-to": "To" + }, + "reduce-row-options-editor": { + "label-calculation": "Calculation", + "label-operation": "Operation" + }, + "reduce-transformer-editor": { + "label-calculations": "Calculations", + "label-include-time": "Include time", + "label-labels-to-fields": "Labels to fields", + "label-mode": "Mode", + "placeholder-choose-stat": "Choose stat" + }, + "regex-matcher-editor": { + "placeholder-value-or-variable": "Value or variable" + }, + "regression-transformer-editor": { + "label-degree": "Degree", + "label-model-type": "Model type", + "label-predicted-points": "Predicted points", + "label-x-field": "X field", + "label-y-field": "Y field" + }, + "rename-by-regex-transformer-editor": { + "label-match": "Match", + "label-replace": "Replace", + "placeholder-regular-expression-pattern": "Regular expression pattern", + "placeholder-replacement-pattern": "Replacement pattern" + }, + "series-to-fields-transformer-editor": { + "label-field": "Field", + "label-mode": "Mode" + }, + "sort-by-transformer-editor": { + "label-field": "Field", + "label-reverse": "Reverse", + "placeholder-select-field": "Select field" + }, + "time-series-table-transform-editor": { + "label-stat": "Stat", + "label-time-field": "Time field", + "tooltip-statistic-should-calculated-series": "The statistic that should be calculated for this time series." + }, + "transpose-transfomer-editor": { + "placeholder-field": "Field", + "placeholder-value": "Value" + }, + "unary-operation-editor": { + "label-operation": "Operation", + "placeholder-field": "Field" + }, + "wide-info": { + "multiple-value-fields-of-any-type": "Multiple value fields of any type", + "single-frame": "Single frame", + "st-field-is-shared-time": "1st field is shared time field", + "time-in-ascending-order": "Time in ascending order" + }, + "window-options-editor": { + "label-calculation": "Calculation", + "label-field": "Field", + "label-type": "Type", + "label-window-size-mode": "Window size mode", + "placeholder-auto": "Auto", + "placeholder-field": "Field" + } + }, "upgrade-box": { "discovery-text": "You’ve discovered a Pro feature!", "discovery-text-continued": "Get the Grafana Pro plan to access {{featureName}}.", @@ -4794,6 +5137,13 @@ "users": { "empty-state": { "message": "No users found" + }, + "token-revoked-modal": { + "sign-in": "Sign in" + }, + "users-action-bar-unconnected": { + "invite": "Invite", + "placeholder-search-login-email": "Search user by login, email or name" } }, "users-access-list": { @@ -4820,17 +5170,85 @@ } }, "variables": { + "ad-hoc-filter": { + "label-and": "AND" + }, + "confirm-delete-modal": { + "title-delete-variable": "Delete variable" + }, "empty-state": { "button-title": "Add variable", "info-box-content": "Variables enable more interactive and dynamic dashboards. Instead of hard-coding things like server or sensor names in your metric queries you can use variables in their place. Variables are shown as list boxes at the top of the dashboard. These drop-down lists make it easy to change the data being displayed in your dashboard.", "info-box-content-2": "Check out the <2>Templates and variables documentation for more information.", "title": "There are no variables added yet" }, + "legacy-variable-query-editor": { + "placeholder-metric-name-or-tags-query": "Metric name or tags query" + }, + "no-unknowns": { + "no-renamed-or-missing-variables-found": "No renamed or missing variables found." + }, + "query-variable-refresh-select": { + "description-update-values-variable": "When to update the values of this variable", + "label-refresh": "Refresh" + }, + "query-variable-sort-select": { + "description-values-variable": "How to sort the values of this variable" + }, + "text-box-variable-editor": { + "placeholder-default-value-if-any": "default value, if any", + "text-options": "Text options" + }, "unknown-table": { "loading": "Loading...", "no-unknowns": "No renamed or missing variables found.", "renamed-or-missing-variables": "Renamed or missing variables", "variable": "Variable" + }, + "variable-check-indicator": { + "title-variable-referenced-dashboard": "This variable is not referenced by any variable or dashboard.", + "title-variable-referenced-other-variables-dashboard": "This variable is referenced by other variables or dashboard." + }, + "variable-editor-editor-un-connected": { + "apply": "Apply", + "aria-label-variable-editor-form": "Variable editor Form", + "delete": "Delete", + "description-optional-display-name": "Optional display name", + "description-template-variable-characters": "The name of the template variable. (Max. 50 characters)", + "general": "General", + "placeholder-descriptive-text": "Descriptive text", + "placeholder-label-name": "Label name", + "placeholder-variable-name": "Variable name" + }, + "variable-editor-list": { + "definition": "Definition", + "new-variable": "New variable", + "variable": "Variable" + }, + "variable-editor-list-row": { + "tooltip-duplicate-variable": "Duplicate variable", + "tooltip-remove-variable": "Remove variable" + }, + "variable-options": { + "aria-label-toggle-all-values": "Toggle all values" + }, + "variable-usages-button": { + "tooltip-show-usages": "Show usages" + }, + "variables-dependencies-button": { + "show-dependencies": "Show dependencies", + "title-dependencies": "Dependencies" + }, + "variables-unknown-button": { + "VariablesUnknownButton-tooltip-show-usages": "Show usages" + }, + "variables-unknown-table": { + "loading": "Loading..." + } + }, + "visualization": { + "data-hover-view": { + "link": "Link" } } } From a13d90db45f1ae648563ed5b123b3bcf844d66ae Mon Sep 17 00:00:00 2001 From: Tom Ratcliffe Date: Tue, 25 Mar 2025 10:59:18 +0000 Subject: [PATCH 009/100] Alerting: Fix display of `Normal (Updated)` in alert history (#102476) * Fix display of `Normal (Updated)` in alert history * Update useRuleHistoryRecords.test.tsx * Update regex --- .../useRuleHistoryRecords.test.tsx | 16 +++++++------- .../state-history/useRuleHistoryRecords.tsx | 21 +++++++++++++------ .../alerting/unified/mocks/grafanaRulerApi.ts | 10 ++++----- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/public/app/features/alerting/unified/components/rules/state-history/useRuleHistoryRecords.test.tsx b/public/app/features/alerting/unified/components/rules/state-history/useRuleHistoryRecords.test.tsx index 17346ae6434..bea142fa90f 100644 --- a/public/app/features/alerting/unified/components/rules/state-history/useRuleHistoryRecords.test.tsx +++ b/public/app/features/alerting/unified/components/rules/state-history/useRuleHistoryRecords.test.tsx @@ -48,17 +48,19 @@ describe('logRecordsToDataFrame', () => { const frame = logRecordsToDataFrame(JSON.stringify(instanceLabels), records, [], theme); const stateField = frame.fields[1]; - expect(stateField.config.mappings).toHaveLength(1); + expect(stateField.config.mappings).toHaveLength(3); expect(stateField.config.mappings![0].options).toMatchObject({ - Alerting: { - color: theme.colors.error.main, - }, + pattern: '/^normal/i', + result: { color: theme.colors.success.main }, + }); + expect(stateField.config.mappings![1].options).toMatchObject({ + pattern: '/Alerting/', + result: { color: theme.colors.error.main }, + }); + expect(stateField.config.mappings![2].options).toMatchObject({ Pending: { color: theme.colors.warning.main, }, - Normal: { - color: theme.colors.success.main, - }, NoData: { color: theme.colors.info.main, }, diff --git a/public/app/features/alerting/unified/components/rules/state-history/useRuleHistoryRecords.tsx b/public/app/features/alerting/unified/components/rules/state-history/useRuleHistoryRecords.tsx index 613938eebb5..2dc9a5abf94 100644 --- a/public/app/features/alerting/unified/components/rules/state-history/useRuleHistoryRecords.tsx +++ b/public/app/features/alerting/unified/components/rules/state-history/useRuleHistoryRecords.tsx @@ -119,18 +119,27 @@ export function logRecordsToDataFrame( color: { mode: 'thresholds' }, custom: { fillOpacity: 100 }, mappings: [ + { + type: MappingType.RegexToText, + options: { + // Map as a regex so we capture `Normal`, and `Normal (Updated)` + pattern: '/^normal/i', + result: { color: theme.colors.success.main }, + }, + }, + { + type: MappingType.RegexToText, + options: { + pattern: '/Alerting/', + result: { color: theme.colors.error.main }, + }, + }, { type: MappingType.ValueToText, options: { - Alerting: { - color: theme.colors.error.main, - }, Pending: { color: theme.colors.warning.main, }, - Normal: { - color: theme.colors.success.main, - }, NoData: { color: theme.colors.info.main, }, diff --git a/public/app/features/alerting/unified/mocks/grafanaRulerApi.ts b/public/app/features/alerting/unified/mocks/grafanaRulerApi.ts index 35734bb7b47..a2fc3a99764 100644 --- a/public/app/features/alerting/unified/mocks/grafanaRulerApi.ts +++ b/public/app/features/alerting/unified/mocks/grafanaRulerApi.ts @@ -91,14 +91,14 @@ export const namespaces: Record = { //-------------------- for alert history tests we reuse these constants -------------------- export const time_0 = 1718368710000; -// time1 + 30 seg -export const time_plus_30 = 1718368740000; // time1 + 5 seg -export const time_plus_5 = 1718368715000; +export const time_plus_5 = time_0 + 5 * 1000; // time1 + 15 seg -export const time_plus_15 = 1718368725000; +export const time_plus_15 = time_0 + 15 * 1000; // time1 + 10 seg -export const time_plus_10 = 1718368720000; +export const time_plus_10 = time_0 + 10 * 1000; +// time1 + 30 seg +export const time_plus_30 = time_0 + 30 * 1000; // returns 4 transitions. times is an array of 4 timestamps. export const getHistoryResponse = (times: number[]) => ({ From c34394f38536d9a275b67da848eeb74aa913853b Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Tue, 25 Mar 2025 12:31:06 +0100 Subject: [PATCH 010/100] Zanzana: Support subresources for typed resources (#102470) * Zanzana: Support subresources for folders * refactor * fix subresource requests * implement listing for folders subresources * teams subresources PoC * re-enable tests * use team resource def from iam * fix tests * remove unused code * refactor: rename to subresource * split resource schema * update workspaces * rename folder relation to subresource * refactor: rename folder resources to subresources * update readme * fix listing * rename params in subresource filter --- .../accesscontrol/dualwrite/collectors.go | 9 +- .../dualwrite/resource_reconciler.go | 2 +- pkg/services/authz/zanzana/common/info.go | 17 ++-- pkg/services/authz/zanzana/common/tuple.go | 87 ++++++++++++------- pkg/services/authz/zanzana/schema/README.md | 11 ++- pkg/services/authz/zanzana/schema/schema.go | 6 ++ .../authz/zanzana/schema/schema_resource.fga | 18 ---- .../zanzana/schema/schema_subresource.fga | 30 +++++++ .../authz/zanzana/server/server_check.go | 39 ++++++++- .../authz/zanzana/server/server_check_test.go | 20 +++++ .../authz/zanzana/server/server_list.go | 32 ++++++- .../authz/zanzana/server/server_list_test.go | 19 ++++ .../authz/zanzana/server/server_test.go | 54 +++++++----- pkg/services/authz/zanzana/zanzana.go | 24 ++--- 14 files changed, 268 insertions(+), 100 deletions(-) create mode 100644 pkg/services/authz/zanzana/schema/schema_subresource.fga diff --git a/pkg/services/accesscontrol/dualwrite/collectors.go b/pkg/services/accesscontrol/dualwrite/collectors.go index 871df2edf3f..1580b151b09 100644 --- a/pkg/services/accesscontrol/dualwrite/collectors.go +++ b/pkg/services/accesscontrol/dualwrite/collectors.go @@ -167,8 +167,7 @@ func managedPermissionsCollector(store db.DB, kind string) legacyTupleCollector tuples[tuple.Object] = make(map[string]*openfgav1.TupleKey) } - // For resource actions on folders we need to merge the tuples into one with combined - // group_resources. + // For resource actions on folders we need to merge the tuples into one with combined subresources. if zanzana.IsFolderResourceTuple(tuple) { key := tupleStringWithoutCondition(tuple) if t, ok := tuples[tuple.Object][key]; ok { @@ -386,8 +385,7 @@ func rolePermissionsCollector(store db.DB) legacyTupleCollector { tuples[tuple.Object] = make(map[string]*openfgav1.TupleKey) } - // For resource actions on folders we need to merge the tuples into one with combined - // group_resources. + // For resource actions on folders we need to merge the tuples into one with combined subresources. if zanzana.IsFolderResourceTuple(tuple) { key := tupleStringWithoutCondition(tuple) if t, ok := tuples[tuple.Object][key]; ok { @@ -449,8 +447,7 @@ func fixedRolePermissionsCollector(store db.DB) legacyTupleCollector { tuples[tuple.Object] = make(map[string]*openfgav1.TupleKey) } - // For resource actions on folders we need to merge the tuples into one with combined - // group_resources. + // For resource actions on folders we need to merge the tuples into one with combined subresources. if zanzana.IsFolderResourceTuple(tuple) { key := tupleStringWithoutCondition(tuple) if t, ok := tuples[tuple.Object][key]; ok { diff --git a/pkg/services/accesscontrol/dualwrite/resource_reconciler.go b/pkg/services/accesscontrol/dualwrite/resource_reconciler.go index af505837569..63a4f8b25eb 100644 --- a/pkg/services/accesscontrol/dualwrite/resource_reconciler.go +++ b/pkg/services/accesscontrol/dualwrite/resource_reconciler.go @@ -62,7 +62,7 @@ func (r resourceReconciler) reconcile(ctx context.Context, namespace string) err continue } - // 4. For folder resource tuples we also need to compare the stored group_resources + // 4. For folder resource tuples we also need to compare the stored subresources if zanzana.IsFolderResourceTuple(t) && t.String() != stored.String() { deletes = append(deletes, &openfgav1.TupleKeyWithoutCondition{ User: t.User, diff --git a/pkg/services/authz/zanzana/common/info.go b/pkg/services/authz/zanzana/common/info.go index 54fb8f2a35a..65531c0129a 100644 --- a/pkg/services/authz/zanzana/common/info.go +++ b/pkg/services/authz/zanzana/common/info.go @@ -1,10 +1,11 @@ package common import ( + authzv1 "github.com/grafana/authlib/authz/proto/v1" "google.golang.org/protobuf/types/known/structpb" - authzv1 "github.com/grafana/authlib/authz/proto/v1" folderalpha1 "github.com/grafana/grafana/pkg/apis/folder/v0alpha1" + iamalpha1 "github.com/grafana/grafana/pkg/apis/iam/v0alpha1" authzextv1 "github.com/grafana/grafana/pkg/services/authz/proto/v1" ) @@ -19,6 +20,11 @@ var typedResources = map[string]typeInfo{ folderalpha1.FolderResourceInfo.GroupResource().Resource, "", ): {Type: "folder", Relations: RelationsFolder}, + FormatGroupResource( + iamalpha1.TeamResourceInfo.GroupResource().Group, + iamalpha1.TeamResourceInfo.GroupResource().Resource, + "", + ): {Type: "team", Relations: RelationsFolder}, } func getTypeInfo(group, resource string) (typeInfo, bool) { @@ -133,13 +139,10 @@ func (r ResourceInfo) Type() string { } func (r ResourceInfo) Context() *structpb.Struct { - if !r.IsGeneric() { - return nil - } - return &structpb.Struct{ Fields: map[string]*structpb.Value{ "requested_group": structpb.NewStringValue(r.GroupResource()), + "subresource": structpb.NewStringValue(r.GroupResource()), }, } } @@ -147,3 +150,7 @@ func (r ResourceInfo) Context() *structpb.Struct { func (r ResourceInfo) IsValidRelation(relation string) bool { return isValidRelation(relation, r.relations) } + +func (r ResourceInfo) HasSubresource() bool { + return r.subresource != "" +} diff --git a/pkg/services/authz/zanzana/common/tuple.go b/pkg/services/authz/zanzana/common/tuple.go index c238ac0f0f9..c1fa549286d 100644 --- a/pkg/services/authz/zanzana/common/tuple.go +++ b/pkg/services/authz/zanzana/common/tuple.go @@ -30,6 +30,7 @@ const ( TypeFolderPrefix string = TypeFolder + ":" TypeResourcePrefix string = TypeResource + ":" TypeGroupResoucePrefix string = TypeGroupResouce + ":" + TypeTeamPrefix string = TypeTeam + ":" ) const ( @@ -50,16 +51,16 @@ const ( RelationGetPermissions string = "get_permissions" RelationSetPermissions string = "set_permissions" - RelationFolderResourceSetView string = "resource_" + RelationSetView - RelationFolderResourceSetEdit string = "resource_" + RelationSetEdit - RelationFolderResourceSetAdmin string = "resource_" + RelationSetAdmin + RelationSubresourceSetView string = "resource_" + RelationSetView + RelationSubresourceSetEdit string = "resource_" + RelationSetEdit + RelationSubresourceSetAdmin string = "resource_" + RelationSetAdmin - RelationFolderResourceGet string = "resource_" + RelationGet - RelationFolderResourceUpdate string = "resource_" + RelationUpdate - RelationFolderResourceCreate string = "resource_" + RelationCreate - RelationFolderResourceDelete string = "resource_" + RelationDelete - RelationFolderResourceGetPermissions string = "resource_" + RelationGetPermissions - RelationFolderResourceSetPermissions string = "resource_" + RelationSetPermissions + RelationSubresourceGet string = "resource_" + RelationGet + RelationSubresourceUpdate string = "resource_" + RelationUpdate + RelationSubresourceCreate string = "resource_" + RelationCreate + RelationSubresourceDelete string = "resource_" + RelationDelete + RelationSubresourceGetPermissions string = "resource_" + RelationGetPermissions + RelationSubresourceSetPermissions string = "resource_" + RelationSetPermissions ) // RelationsGroupResource are relations that can be added on type "group_resource". @@ -81,19 +82,19 @@ var RelationsResource = []string{ RelationSetPermissions, } -// RelationsFolderResource are relations that can be added on type "folder" for child resources. -var RelationsFolderResource = []string{ - RelationFolderResourceGet, - RelationFolderResourceUpdate, - RelationFolderResourceCreate, - RelationFolderResourceDelete, - RelationFolderResourceGetPermissions, - RelationFolderResourceSetPermissions, +// RelationsSubresource are relations that can be added on typed resources for subresources. +var RelationsSubresource = []string{ + RelationSubresourceGet, + RelationSubresourceUpdate, + RelationSubresourceCreate, + RelationSubresourceDelete, + RelationSubresourceGetPermissions, + RelationSubresourceSetPermissions, } // RelationsFolder are relations that can be added on type "folder". var RelationsFolder = append( - RelationsFolderResource, + RelationsSubresource, RelationGet, RelationUpdate, RelationCreate, @@ -130,8 +131,8 @@ func IsGroupResourceRelation(relation string) bool { return isValidRelation(relation, RelationsGroupResource) } -func IsFolderResourceRelation(relation string) bool { - return isValidRelation(relation, RelationsFolderResource) +func IsSubresourceRelation(relation string) bool { + return isValidRelation(relation, RelationsSubresource) } func isValidRelation(relation string, valid []string) bool { @@ -143,7 +144,7 @@ func isValidRelation(relation string, valid []string) bool { return false } -func FolderResourceRelation(relation string) string { +func SubresourceRelation(relation string) string { return TypeResource + "_" + relation } @@ -159,6 +160,10 @@ func NewFolderIdent(name string) string { return TypeFolderPrefix + name } +func NewTeamIdent(name string) string { + return TypeTeamPrefix + name +} + func NewGroupResourceIdent(group, resource, subresource string) string { return TypeGroupResoucePrefix + FormatGroupResource(group, resource, subresource) } @@ -193,21 +198,21 @@ func NewResourceTuple(subject, relation, group, resource, subresource, name stri } } -func isFolderResourceRelationSet(relation string) bool { - return relation == RelationFolderResourceSetView || - relation == RelationFolderResourceSetEdit || - relation == RelationFolderResourceSetAdmin +func isSubresourceRelationSet(relation string) bool { + return relation == RelationSubresourceSetView || + relation == RelationSubresourceSetEdit || + relation == RelationSubresourceSetAdmin } func NewFolderResourceTuple(subject, relation, group, resource, subresource, folder string) *openfgav1.TupleKey { - relation = FolderResourceRelation(relation) + relation = SubresourceRelation(relation) var condition *openfgav1.RelationshipCondition - if !isFolderResourceRelationSet(relation) { + if !isSubresourceRelationSet(relation) { condition = &openfgav1.RelationshipCondition{ - Name: "folder_group_filter", + Name: "subresource_filter", Context: &structpb.Struct{ Fields: map[string]*structpb.Value{ - "group_resources": structpb.NewListValue(&structpb.ListValue{ + "subresources": structpb.NewListValue(&structpb.ListValue{ Values: []*structpb.Value{structpb.NewStringValue(FormatGroupResource(group, resource, subresource))}, }), }, @@ -223,6 +228,30 @@ func NewFolderResourceTuple(subject, relation, group, resource, subresource, fol } } +func NewTeamResourceTuple(subject, relation, group, resource, subresource, name string) *openfgav1.TupleKey { + relation = SubresourceRelation(relation) + var condition *openfgav1.RelationshipCondition + if !isSubresourceRelationSet(relation) { + condition = &openfgav1.RelationshipCondition{ + Name: "subresource_filter", + Context: &structpb.Struct{ + Fields: map[string]*structpb.Value{ + "subresources": structpb.NewListValue(&structpb.ListValue{ + Values: []*structpb.Value{structpb.NewStringValue(FormatGroupResource(group, resource, subresource))}, + }), + }, + }, + } + } + + return &openfgav1.TupleKey{ + User: subject, + Relation: relation, + Object: NewTeamIdent(name), + Condition: condition, + } +} + func NewGroupResourceTuple(subject, relation, group, resource, subresource string) *openfgav1.TupleKey { return &openfgav1.TupleKey{ User: subject, diff --git a/pkg/services/authz/zanzana/schema/README.md b/pkg/services/authz/zanzana/schema/README.md index 3a41e96a11a..55425c151e7 100644 --- a/pkg/services/authz/zanzana/schema/README.md +++ b/pkg/services/authz/zanzana/schema/README.md @@ -16,7 +16,7 @@ them. This is because we want to store the folder tree relations. To grant a user access to a specific folder we store `{ “user”: “user:1”, relation: “read”, object:”folder:” }` To grant a user access to sub resources of a folder we store ``{ “user”: “user:1”, relation: “resource_read”, object:”folder:”}` with additional context. -This context holds all GroupResources in a list e.g. `{ "group_resources": ["dashboard.grafana.app/dashboards", "alerting.grafana.app/rules" ] }`. +This context holds all GroupResources in a list e.g. `{ "subresources": ["dashboard.grafana.app/dashboards", "alerting.grafana.app/rules" ] }`. ## Resource level permissions @@ -33,6 +33,15 @@ To grant a user access to the subresource of the specific resource we store foll It's also possible to grant user access to all subresources for specific resource type. It can be done with following tuple: `{ “user”: “user:1”, relation: “read”, object:”resource:dashboard.grafana.app/dashboards/” }`. +For the typed resources (like folders, users, teams, etc) subresources work in a little bit different way. Since typed resources only have ID in the name, subresources are added to the `subresource_filter`. For example, to grant user access to folder subresource, following tuple will be created: + +``` +{ “user”: “user:1”, relation: “resource_read”, object:”folder:” } +context: { "subresource_filter": ["folder.grafana.app/folders/"] } +``` + +Note that relation is translated from `read` to `resource_read`. This is required to distinguish access between resource and its subresources. When check request is performed, we check if request contains subresource. If so, context filter and translated relation are used. + ## Managed permissions In the RBAC model managed permissions stored as a special "managed" role permissions. OpenFGA model allows to assign permissions directly to users, so it produces following tuples: diff --git a/pkg/services/authz/zanzana/schema/schema.go b/pkg/services/authz/zanzana/schema/schema.go index b4c3b7fcd53..3c50bf0836d 100644 --- a/pkg/services/authz/zanzana/schema/schema.go +++ b/pkg/services/authz/zanzana/schema/schema.go @@ -13,6 +13,8 @@ var ( folderDSL string //go:embed schema_resource.fga resourceDSL string + //go:embed schema_subresource.fga + subresourceDSL string ) var SchemaModules = []transformer.ModuleFile{ @@ -28,4 +30,8 @@ var SchemaModules = []transformer.ModuleFile{ Name: "schema_resource.fga", Contents: resourceDSL, }, + { + Name: "schema_subresource.fga", + Contents: subresourceDSL, + }, } diff --git a/pkg/services/authz/zanzana/schema/schema_resource.fga b/pkg/services/authz/zanzana/schema/schema_resource.fga index b9893b2a997..3372c0bff21 100644 --- a/pkg/services/authz/zanzana/schema/schema_resource.fga +++ b/pkg/services/authz/zanzana/schema/schema_resource.fga @@ -1,19 +1,5 @@ module resource -extend type folder - relations - define resource_view: [user, service-account, team#member, role#assignee] or resource_edit or resource_view from parent - define resource_edit: [user, service-account, team#member, role#assignee] or resource_admin or resource_edit from parent - define resource_admin: [user, service-account, team#member, role#assignee] or resource_admin from parent - - define resource_get: [user with folder_group_filter, service-account with folder_group_filter, team#member with folder_group_filter, role#assignee with folder_group_filter] or resource_view or resource_get from parent - define resource_create: [user with folder_group_filter, service-account with folder_group_filter, team#member with folder_group_filter, role#assignee with folder_group_filter] or resource_edit or resource_create from parent - define resource_update: [user with folder_group_filter, service-account with folder_group_filter, team#member with folder_group_filter, role#assignee with folder_group_filter] or resource_edit or resource_update from parent - define resource_delete: [user with folder_group_filter, service-account with folder_group_filter, team#member with folder_group_filter, role#assignee with folder_group_filter] or resource_edit or resource_delete from parent - - define resource_get_permissions: [user with folder_group_filter, service-account with folder_group_filter, team#member with folder_group_filter, role#assignee with folder_group_filter] or resource_admin or resource_get_permissions from parent - define resource_set_permissions: [user with folder_group_filter, service-account with folder_group_filter, team#member with folder_group_filter, role#assignee with folder_group_filter] or resource_admin or resource_set_permissions from parent - type group_resource relations define view: [user, service-account, render, team#member, role#assignee] or edit @@ -44,7 +30,3 @@ type resource condition group_filter(requested_group: string, group_resource: string) { requested_group == group_resource } - -condition folder_group_filter(requested_group: string, group_resources: list) { - requested_group in group_resources -} diff --git a/pkg/services/authz/zanzana/schema/schema_subresource.fga b/pkg/services/authz/zanzana/schema/schema_subresource.fga new file mode 100644 index 00000000000..ca53a8cc541 --- /dev/null +++ b/pkg/services/authz/zanzana/schema/schema_subresource.fga @@ -0,0 +1,30 @@ +module resource + +extend type folder + relations + define resource_view: [user, service-account, team#member, role#assignee] or resource_edit or resource_view from parent + define resource_edit: [user, service-account, team#member, role#assignee] or resource_admin or resource_edit from parent + define resource_admin: [user, service-account, team#member, role#assignee] or resource_admin from parent + + define resource_get: [user with subresource_filter, service-account with subresource_filter, team#member with subresource_filter, role#assignee with subresource_filter] or resource_view or resource_get from parent + define resource_create: [user with subresource_filter, service-account with subresource_filter, team#member with subresource_filter, role#assignee with subresource_filter] or resource_edit or resource_create from parent + define resource_update: [user with subresource_filter, service-account with subresource_filter, team#member with subresource_filter, role#assignee with subresource_filter] or resource_edit or resource_update from parent + define resource_delete: [user with subresource_filter, service-account with subresource_filter, team#member with subresource_filter, role#assignee with subresource_filter] or resource_edit or resource_delete from parent + + define resource_get_permissions: [user with subresource_filter, service-account with subresource_filter, team#member with subresource_filter, role#assignee with subresource_filter] or resource_admin or resource_get_permissions from parent + define resource_set_permissions: [user with subresource_filter, service-account with subresource_filter, team#member with subresource_filter, role#assignee with subresource_filter] or resource_admin or resource_set_permissions from parent + +extend type team + relations + define resource_view: [user, service-account, team#member, role#assignee] or resource_edit + define resource_edit: [user, service-account, team#member, role#assignee] or resource_admin + define resource_admin: [user, service-account, team#member, role#assignee] + + define resource_get: [user with subresource_filter, service-account with subresource_filter, team#member with subresource_filter, role#assignee with subresource_filter] or resource_view + define resource_create: [user with subresource_filter, service-account with subresource_filter, team#member with subresource_filter, role#assignee with subresource_filter] or resource_edit + define resource_update: [user with subresource_filter, service-account with subresource_filter, team#member with subresource_filter, role#assignee with subresource_filter] or resource_edit + define resource_delete: [user with subresource_filter, service-account with subresource_filter, team#member with subresource_filter, role#assignee with subresource_filter] or resource_edit + +condition subresource_filter(subresource: string, subresources: list) { + subresource in subresources +} diff --git a/pkg/services/authz/zanzana/server/server_check.go b/pkg/services/authz/zanzana/server/server_check.go index 838a39aba83..1c5094158d2 100644 --- a/pkg/services/authz/zanzana/server/server_check.go +++ b/pkg/services/authz/zanzana/server/server_check.go @@ -76,6 +76,39 @@ func (s *Server) checkTyped(ctx context.Context, subject, relation string, resou return &authzv1.CheckResponse{Allowed: false}, nil } + var ( + resourceIdent = resource.ResourceIdent() + resourceCtx = resource.Context() + subresourceRelation = common.SubresourceRelation(relation) + ) + + if resource.HasSubresource() { + // Check if subject has access as a subresource + res, err := s.openfga.Check(ctx, &openfgav1.CheckRequest{ + StoreId: store.ID, + AuthorizationModelId: store.ModelID, + TupleKey: &openfgav1.CheckRequestTupleKey{ + User: subject, + Relation: subresourceRelation, + Object: resourceIdent, + }, + Context: resourceCtx, + ContextualTuples: contextuals, + }) + + if err != nil { + return nil, err + } + + if res.GetAllowed() { + return &authzv1.CheckResponse{Allowed: res.GetAllowed()}, nil + } + } + + if resourceIdent == "" { + return &authzv1.CheckResponse{Allowed: false}, nil + } + // Check if subject has direct access to resource res, err := s.openfga.Check(ctx, &openfgav1.CheckRequest{ StoreId: store.ID, @@ -83,7 +116,7 @@ func (s *Server) checkTyped(ctx context.Context, subject, relation string, resou TupleKey: &openfgav1.CheckRequestTupleKey{ User: subject, Relation: relation, - Object: resource.ResourceIdent(), + Object: resourceIdent, }, ContextualTuples: contextuals, }) @@ -105,10 +138,10 @@ func (s *Server) checkGeneric(ctx context.Context, subject, relation string, res var ( folderIdent = resource.FolderIdent() resourceCtx = resource.Context() - folderRelation = common.FolderResourceRelation(relation) + folderRelation = common.SubresourceRelation(relation) ) - if folderIdent != "" && common.IsFolderResourceRelation(folderRelation) { + if folderIdent != "" && common.IsSubresourceRelation(folderRelation) { // Check if subject has access as a sub resource for the folder res, err := s.openfga.Check(ctx, &openfgav1.CheckRequest{ StoreId: store.ID, diff --git a/pkg/services/authz/zanzana/server/server_check_test.go b/pkg/services/authz/zanzana/server/server_check_test.go index 38cc1198e48..0f78a8712ea 100644 --- a/pkg/services/authz/zanzana/server/server_check_test.go +++ b/pkg/services/authz/zanzana/server/server_check_test.go @@ -152,4 +152,24 @@ func testCheck(t *testing.T, server *Server) { require.NoError(t, err) assert.False(t, res.GetAllowed()) }) + + t.Run("user:13 should be able to read folder status for all subfolders of folder 5", func(t *testing.T) { + res, err := server.Check(newContextWithNamespace(), newReq("user:13", utils.VerbGet, folderGroup, folderResource, statusSubresource, "", "5")) + require.NoError(t, err) + assert.True(t, res.GetAllowed()) + + res, err = server.Check(newContextWithNamespace(), newReq("user:13", utils.VerbGet, folderGroup, folderResource, statusSubresource, "", "6")) + require.NoError(t, err) + assert.True(t, res.GetAllowed()) + + res, err = server.Check(newContextWithNamespace(), newReq("user:13", utils.VerbGet, folderGroup, folderResource, statusSubresource, "", "4")) + require.NoError(t, err) + assert.False(t, res.GetAllowed()) + }) + + t.Run("user:14 should be able to read team subresources for team 1", func(t *testing.T) { + res, err := server.Check(newContextWithNamespace(), newReq("user:14", utils.VerbGet, "iam.grafana.app", "teams", statusSubresource, "", "1")) + require.NoError(t, err) + assert.True(t, res.GetAllowed()) + }) } diff --git a/pkg/services/authz/zanzana/server/server_list.go b/pkg/services/authz/zanzana/server/server_list.go index c435cbc90cb..ba864645d82 100644 --- a/pkg/services/authz/zanzana/server/server_list.go +++ b/pkg/services/authz/zanzana/server/server_list.go @@ -56,6 +56,31 @@ func (s *Server) listTyped(ctx context.Context, subject, relation string, resour return &authzv1.ListResponse{}, nil } + var ( + subresourceRelation = common.SubresourceRelation(relation) + resourceCtx = resource.Context() + ) + + var items []string + if resource.HasSubresource() && common.IsSubresourceRelation(subresourceRelation) { + // List requested subresources + res, err := s.listObjects(ctx, &openfgav1.ListObjectsRequest{ + StoreId: store.ID, + AuthorizationModelId: store.ModelID, + Type: resource.Type(), + Relation: subresourceRelation, + User: subject, + Context: resourceCtx, + ContextualTuples: contextuals, + }) + + if err != nil { + return nil, err + } + + items = append(items, typedObjects(resource.Type(), res.GetObjects())...) + } + // List all resources user has access too res, err := s.listObjects(ctx, &openfgav1.ListObjectsRequest{ StoreId: store.ID, @@ -68,21 +93,22 @@ func (s *Server) listTyped(ctx context.Context, subject, relation string, resour if err != nil { return nil, err } + items = append(items, typedObjects(resource.Type(), res.GetObjects())...) return &authzv1.ListResponse{ - Items: typedObjects(resource.Type(), res.GetObjects()), + Items: items, }, nil } func (s *Server) listGeneric(ctx context.Context, subject, relation string, resource common.ResourceInfo, contextuals *openfgav1.ContextualTupleKeys, store *storeInfo) (*authzv1.ListResponse, error) { var ( - folderRelation = common.FolderResourceRelation(relation) + folderRelation = common.SubresourceRelation(relation) resourceCtx = resource.Context() ) // 1. List all folders subject has access to resource type in var folders []string - if common.IsFolderResourceRelation(folderRelation) { + if common.IsSubresourceRelation(folderRelation) { res, err := s.listObjects(ctx, &openfgav1.ListObjectsRequest{ StoreId: store.ID, AuthorizationModelId: store.ModelID, diff --git a/pkg/services/authz/zanzana/server/server_list_test.go b/pkg/services/authz/zanzana/server/server_list_test.go index 92a115a8bed..02ca3ce9f37 100644 --- a/pkg/services/authz/zanzana/server/server_list_test.go +++ b/pkg/services/authz/zanzana/server/server_list_test.go @@ -118,4 +118,23 @@ func testList(t *testing.T, server *Server) { assert.Contains(t, res.GetFolders(), "5") assert.Contains(t, res.GetFolders(), "6") }) + + t.Run("user:13 should be able to list all subresources in folder 5 and 6", func(t *testing.T) { + res, err := server.List(newContextWithNamespace(), newList("user:13", folderGroup, folderResource, statusSubresource)) + require.NoError(t, err) + assert.Len(t, res.GetItems(), 2) + assert.Len(t, res.GetFolders(), 0) + + assert.Contains(t, res.GetItems(), "5") + assert.Contains(t, res.GetItems(), "6") + }) + + t.Run("user:14 should be able to list all subresources for team 1", func(t *testing.T) { + res, err := server.List(newContextWithNamespace(), newList("user:14", teamGroup, teamResource, statusSubresource)) + require.NoError(t, err) + assert.Len(t, res.GetItems(), 1) + assert.Len(t, res.GetFolders(), 0) + + assert.Contains(t, res.GetItems(), "1") + }) } diff --git a/pkg/services/authz/zanzana/server/server_test.go b/pkg/services/authz/zanzana/server/server_test.go index 8a1fd1786ea..42770152e5e 100644 --- a/pkg/services/authz/zanzana/server/server_test.go +++ b/pkg/services/authz/zanzana/server/server_test.go @@ -29,6 +29,9 @@ const ( folderGroup = "folder.grafana.app" folderResource = "folders" + teamGroup = "iam.grafana.app" + teamResource = "teams" + statusSubresource = "status" ) @@ -83,31 +86,38 @@ func setup(t *testing.T, testDB db.DB, cfg *setting.Cfg) *Server { require.NoError(t, err) // seed tuples + writes := &openfgav1.WriteRequestWrites{ + TupleKeys: []*openfgav1.TupleKey{ + common.NewResourceTuple("user:1", common.RelationGet, dashboardGroup, dashboardResource, "", "1"), + common.NewResourceTuple("user:1", common.RelationUpdate, dashboardGroup, dashboardResource, "", "1"), + common.NewGroupResourceTuple("user:2", common.RelationGet, dashboardGroup, dashboardResource, ""), + common.NewGroupResourceTuple("user:2", common.RelationUpdate, dashboardGroup, dashboardResource, ""), + common.NewResourceTuple("user:3", common.RelationSetView, dashboardGroup, dashboardResource, "", "1"), + common.NewFolderResourceTuple("user:4", common.RelationGet, dashboardGroup, dashboardResource, "", "1"), + common.NewFolderResourceTuple("user:4", common.RelationGet, dashboardGroup, dashboardResource, "", "3"), + common.NewFolderResourceTuple("user:5", common.RelationSetEdit, dashboardGroup, dashboardResource, "", "1"), + common.NewFolderTuple("user:6", common.RelationGet, "1"), + common.NewGroupResourceTuple("user:7", common.RelationGet, folderGroup, folderResource, ""), + common.NewFolderParentTuple("5", "4"), + common.NewFolderParentTuple("6", "5"), + common.NewFolderResourceTuple("user:8", common.RelationSetEdit, dashboardGroup, dashboardResource, "", "5"), + common.NewFolderResourceTuple("user:9", common.RelationCreate, dashboardGroup, dashboardResource, "", "5"), + common.NewResourceTuple("user:10", common.RelationGet, dashboardGroup, dashboardResource, statusSubresource, "10"), + common.NewResourceTuple("user:10", common.RelationGet, dashboardGroup, dashboardResource, statusSubresource, "11"), + common.NewGroupResourceTuple("user:11", common.RelationGet, dashboardGroup, dashboardResource, statusSubresource), + common.NewFolderResourceTuple("user:12", common.RelationGet, dashboardGroup, dashboardResource, statusSubresource, "5"), + common.NewFolderResourceTuple("user:13", common.RelationGet, folderGroup, folderResource, statusSubresource, "5"), + common.NewTeamResourceTuple("user:14", common.RelationGet, teamGroup, teamResource, statusSubresource, "1"), + }, + } + for _, w := range writes.TupleKeys { + t.Log(w.String()) + } + _, err = openfga.Write(context.Background(), &openfgav1.WriteRequest{ StoreId: storeInf.ID, AuthorizationModelId: storeInf.ModelID, - Writes: &openfgav1.WriteRequestWrites{ - TupleKeys: []*openfgav1.TupleKey{ - common.NewResourceTuple("user:1", common.RelationGet, dashboardGroup, dashboardResource, "", "1"), - common.NewResourceTuple("user:1", common.RelationUpdate, dashboardGroup, dashboardResource, "", "1"), - common.NewGroupResourceTuple("user:2", common.RelationGet, dashboardGroup, dashboardResource, ""), - common.NewGroupResourceTuple("user:2", common.RelationUpdate, dashboardGroup, dashboardResource, ""), - common.NewResourceTuple("user:3", common.RelationSetView, dashboardGroup, dashboardResource, "", "1"), - common.NewFolderResourceTuple("user:4", common.RelationGet, dashboardGroup, dashboardResource, "", "1"), - common.NewFolderResourceTuple("user:4", common.RelationGet, dashboardGroup, dashboardResource, "", "3"), - common.NewFolderResourceTuple("user:5", common.RelationSetEdit, dashboardGroup, dashboardResource, "", "1"), - common.NewFolderTuple("user:6", common.RelationGet, "1"), - common.NewGroupResourceTuple("user:7", common.RelationGet, folderGroup, folderResource, ""), - common.NewFolderParentTuple("5", "4"), - common.NewFolderParentTuple("6", "5"), - common.NewFolderResourceTuple("user:8", common.RelationSetEdit, dashboardGroup, dashboardResource, "", "5"), - common.NewFolderResourceTuple("user:9", common.RelationCreate, dashboardGroup, dashboardResource, "", "5"), - common.NewResourceTuple("user:10", common.RelationGet, dashboardGroup, dashboardResource, statusSubresource, "10"), - common.NewResourceTuple("user:10", common.RelationGet, dashboardGroup, dashboardResource, statusSubresource, "11"), - common.NewGroupResourceTuple("user:11", common.RelationGet, dashboardGroup, dashboardResource, statusSubresource), - common.NewFolderResourceTuple("user:12", common.RelationGet, dashboardGroup, dashboardResource, statusSubresource, "5"), - }, - }, + Writes: writes, }) require.NoError(t, err) return srv diff --git a/pkg/services/authz/zanzana/zanzana.go b/pkg/services/authz/zanzana/zanzana.go index 327618384af..45a39ac09f2 100644 --- a/pkg/services/authz/zanzana/zanzana.go +++ b/pkg/services/authz/zanzana/zanzana.go @@ -38,20 +38,20 @@ const ( RelationCreate = common.RelationCreate RelationDelete = common.RelationDelete - RelationFolderResourceSetView = common.RelationFolderResourceSetView - RelationFolderResourceSetEdit = common.RelationFolderResourceSetEdit - RelationFolderResourceSetAdmin = common.RelationFolderResourceSetAdmin + RelationSubresourceSetView = common.RelationSubresourceSetView + RelationSubresourceSetEdit = common.RelationSubresourceSetEdit + RelationSubresourceSetAdmin = common.RelationSubresourceSetAdmin - RelationFolderResourceRead = common.RelationFolderResourceGet - RelationFolderResourceWrite = common.RelationFolderResourceUpdate - RelationFolderResourceCreate = common.RelationFolderResourceCreate - RelationFolderResourceDelete = common.RelationFolderResourceDelete + RelationSubresourceRead = common.RelationSubresourceGet + RelationSubresourceWrite = common.RelationSubresourceUpdate + RelationSubresourceCreate = common.RelationSubresourceCreate + RelationSubresourceDelete = common.RelationSubresourceDelete ) var ( - RelationsFolder = common.RelationsFolder - RelationsResouce = common.RelationsResource - RelationsFolderResource = common.RelationsFolderResource + RelationsFolder = common.RelationsFolder + RelationsResouce = common.RelationsResource + RelationsSubresource = common.RelationsSubresource ) const ( @@ -118,8 +118,8 @@ func IsFolderResourceTuple(t *openfgav1.TupleKey) bool { } func MergeFolderResourceTuples(a, b *openfgav1.TupleKey) { - va := a.Condition.Context.Fields["group_resources"] - vb := b.Condition.Context.Fields["group_resources"] + va := a.Condition.Context.Fields["subresources"] + vb := b.Condition.Context.Fields["subresources"] va.GetListValue().Values = append(va.GetListValue().Values, vb.GetListValue().Values...) } From 0ffb7518cd24b7a18a171da6f5829c5b328e716a Mon Sep 17 00:00:00 2001 From: Steve Simpson Date: Tue, 25 Mar 2025 12:50:23 +0100 Subject: [PATCH 011/100] Alerting: Ignore external alert sending errors when shutting down. (#102705) --- pkg/services/ngalert/sender/notifier_ext.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/services/ngalert/sender/notifier_ext.go b/pkg/services/ngalert/sender/notifier_ext.go index 544ed4ae072..c1ef0f721fc 100644 --- a/pkg/services/ngalert/sender/notifier_ext.go +++ b/pkg/services/ngalert/sender/notifier_ext.go @@ -10,6 +10,7 @@ import ( "bytes" "context" "encoding/json" + "errors" "fmt" "io" "net/http" @@ -145,7 +146,8 @@ func (n *Manager) sendAll(alerts ...*Alert) bool { // Extension: added headers parameter. go func(client *http.Client, url string, headers http.Header) { - if err := n.sendOne(ctx, client, url, payload, headers); err != nil { + // Treat cancellations as a success, so that we don't increment error or dropped counters. + if err := n.sendOne(ctx, client, url, payload, headers); err != nil && !errors.Is(err, context.Canceled) { level.Error(n.logger).Log("alertmanager", url, "count", len(alerts), "msg", "Error sending alert", "err", err) n.metrics.errors.WithLabelValues(url).Inc() } else { From f73f88e0f32de21550cdb4c9d7fa2a6fd111a64e Mon Sep 17 00:00:00 2001 From: Andre Pereira Date: Tue, 25 Mar 2025 11:53:38 +0000 Subject: [PATCH 012/100] Tempo: Fix undefined access to error message (#102771) Nullish check when getting error --- .../app/plugins/datasource/tempo/datasource.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/public/app/plugins/datasource/tempo/datasource.ts b/public/app/plugins/datasource/tempo/datasource.ts index 5b91b5f25e9..a0da5493bd5 100644 --- a/public/app/plugins/datasource/tempo/datasource.ts +++ b/public/app/plugins/datasource/tempo/datasource.ts @@ -264,7 +264,7 @@ export class TempoDatasource extends DataSourceWithBackend response), catchError((error) => { - console.error('Failure in retrieving build information', error.data.message); + console.error('Failure in retrieving build information', error?.data?.message); return of({ error, data: { version: null } }); // unknown version }) ) @@ -468,7 +468,7 @@ export class TempoDatasource extends DataSourceWithBackend { return of({ status: 'error', - message: getErrorMessage(err.data.message, 'Unable to connect with Tempo'), + message: getErrorMessage(err?.data?.message, 'Unable to connect with Tempo'), }); }) ) @@ -896,7 +896,7 @@ export class TempoDatasource extends DataSourceWithBackend { return of({ status: 'error', - message: getErrorMessage(err.data.message, 'Test for streaming failed, consider disabling streaming'), + message: getErrorMessage(err?.data?.message, 'Test for streaming failed, consider disabling streaming'), }); }) ) From 75ce8db0e26339273836d3f237078d76d8f78106 Mon Sep 17 00:00:00 2001 From: Mariell Hoversholm Date: Tue, 25 Mar 2025 12:59:42 +0100 Subject: [PATCH 013/100] Provisioning: Align frontend more with designs (#102687) * feat: align frontend more with designs * feat: remove unnecessary fields * chore: remove imports * chore: move imports * fix: make label not spit out undefined * feat: update title of nav item * chore: make update-workspace * fix: don't wrap text with span unless required --------- Co-authored-by: Roberto Jimenez Sanchez --- .../grafana-ui/src/components/Forms/Field.tsx | 24 ++- pkg/services/navtree/navtreeimpl/admin.go | 2 +- .../GettingStarted/EnhancedFeatures.tsx | 101 +++++---- .../GettingStarted/FeatureCard.tsx | 12 +- .../GettingStarted/FeaturesList.tsx | 38 ++-- .../GettingStarted/GettingStartedPage.tsx | 2 +- .../Shared/ConnectRepositoryButton.tsx | 2 +- .../Shared/TokenPermissionsInfo.tsx | 57 +++-- .../provisioning/Wizard/BootstrapStep.tsx | 2 +- .../provisioning/Wizard/ConnectPage.tsx | 5 +- .../provisioning/Wizard/ConnectStep.tsx | 38 ++-- .../provisioning/Wizard/FinishStep.tsx | 195 +++++++++--------- .../Wizard/ProvisioningWizard.tsx | 2 +- .../features/provisioning/Wizard/actions.ts | 8 +- 14 files changed, 270 insertions(+), 218 deletions(-) diff --git a/packages/grafana-ui/src/components/Forms/Field.tsx b/packages/grafana-ui/src/components/Forms/Field.tsx index 10db5c83bfc..461159963c6 100644 --- a/packages/grafana-ui/src/components/Forms/Field.tsx +++ b/packages/grafana-ui/src/components/Forms/Field.tsx @@ -15,6 +15,8 @@ export interface FieldProps extends HTMLAttributes { children: React.ReactElement; /** Label for the field */ label?: React.ReactNode; + /** Forcibly use a Label, despite passing a non-string node. */ + useLabel?: boolean; /** Description of the field */ description?: React.ReactNode; /** Indicates if field is in invalid state */ @@ -45,6 +47,7 @@ export const Field = React.forwardRef( ( { label, + useLabel, description, horizontal, invalid, @@ -63,14 +66,25 @@ export const Field = React.forwardRef( const styles = useStyles2(getFieldStyles); const inputId = htmlFor ?? getChildId(children); - const labelElement = - typeof label === 'string' ? ( + let labelElement: React.ReactNode; + if (typeof label === 'string') { + labelElement = ( - ) : ( - label ); + } else if (useLabel) { + labelElement = ( + + ); + } else { + labelElement = label; + } const childProps = deleteUndefinedProps({ invalid, disabled, loading }); return ( diff --git a/pkg/services/navtree/navtreeimpl/admin.go b/pkg/services/navtree/navtreeimpl/admin.go index c2a4ebd9406..f329d7a35b2 100644 --- a/pkg/services/navtree/navtreeimpl/admin.go +++ b/pkg/services/navtree/navtreeimpl/admin.go @@ -62,7 +62,7 @@ func (s *ServiceImpl) getAdminNode(c *contextmodel.ReqContext) (*navtree.NavLink } if hasAccess(ac.EvalPermission(ac.ActionSettingsRead, ac.ScopeSettingsAll)) && s.features.IsEnabled(ctx, featuremgmt.FlagProvisioning) { generalNodeLinks = append(generalNodeLinks, &navtree.NavLink{ - Text: "Provisioning", + Text: "Remote provisioning", Id: "provisioning", SubTitle: "Manage resources from remote repositories", Url: s.cfg.AppSubURL + "/admin/provisioning", diff --git a/public/app/features/provisioning/GettingStarted/EnhancedFeatures.tsx b/public/app/features/provisioning/GettingStarted/EnhancedFeatures.tsx index 5b1f961345b..a772158998b 100644 --- a/public/app/features/provisioning/GettingStarted/EnhancedFeatures.tsx +++ b/public/app/features/provisioning/GettingStarted/EnhancedFeatures.tsx @@ -1,6 +1,7 @@ import { css } from '@emotion/css'; -import { Box, Stack, Text, LinkButton, Icon, IconName } from '@grafana/ui'; +import { GrafanaTheme2 } from '@grafana/data'; +import { Box, Stack, Text, LinkButton, Icon, IconName, useStyles2 } from '@grafana/ui'; import { FeatureCard } from './FeatureCard'; @@ -29,46 +30,60 @@ interface EnhancedFeaturesProps { onSetupPublicAccess: () => void; } -export const EnhancedFeatures = ({ hasPublicAccess, hasImageRenderer, onSetupPublicAccess }: EnhancedFeaturesProps) => ( - - Unlock enhanced functionality for GitHub - - - } - action={ - !hasPublicAccess && ( - - Set up public access - - ) - } - showBorder - /> - - - - - } - action={ - !hasImageRenderer && ( - - Set up image rendering - - ) - } - /> - +export const EnhancedFeatures = ({ hasPublicAccess, hasImageRenderer, onSetupPublicAccess }: EnhancedFeaturesProps) => { + const style = useStyles2(getStyles); + + return ( + + Unlock enhanced functionality for GitHub + + + } + action={ + !hasPublicAccess && ( + + Set up public access + + ) + } + /> + +
    + + + + + + } + action={ + !hasImageRenderer && ( + + Set up image rendering + + ) + } + /> + + - -); + ); +}; + +function getStyles(theme: GrafanaTheme2) { + return { + separator: css({ + borderRight: `2px solid ${theme.colors.border.weak}`, + }), + }; +} diff --git a/public/app/features/provisioning/GettingStarted/FeatureCard.tsx b/public/app/features/provisioning/GettingStarted/FeatureCard.tsx index 92db7ac7609..b70ad55d880 100644 --- a/public/app/features/provisioning/GettingStarted/FeatureCard.tsx +++ b/public/app/features/provisioning/GettingStarted/FeatureCard.tsx @@ -1,5 +1,3 @@ -import { css } from '@emotion/css'; - import { Box, Stack, Text } from '@grafana/ui'; interface FeatureCardProps { @@ -7,17 +5,11 @@ interface FeatureCardProps { description: string; icon?: React.ReactNode; action?: React.ReactNode; - showBorder?: boolean; } -export const FeatureCard = ({ title, description, icon, action, showBorder = false }: FeatureCardProps) => ( +export const FeatureCard = ({ title, description, icon, action }: FeatureCardProps) => ( -
    +
    {icon} {title} diff --git a/public/app/features/provisioning/GettingStarted/FeaturesList.tsx b/public/app/features/provisioning/GettingStarted/FeaturesList.tsx index 10e8fb90206..8e66c9b4f77 100644 --- a/public/app/features/provisioning/GettingStarted/FeaturesList.tsx +++ b/public/app/features/provisioning/GettingStarted/FeaturesList.tsx @@ -4,14 +4,18 @@ import { Repository } from 'app/api/clients/provisioning'; import { ConnectRepositoryButton } from '../Shared/ConnectRepositoryButton'; interface FeatureItemProps { - children: React.ReactNode; + children: NonNullable; } -const FeatureItem = ({ children }: FeatureItemProps) => ( - - {children} - -); +const FeatureItem = ({ children }: FeatureItemProps) => { + // We use a stack here to ensure the icon and text are aligned correctly. + return ( + + + {children} + + ); +}; interface FeaturesListProps { repos?: Repository[]; @@ -48,17 +52,12 @@ export const FeaturesList = ({ return ( - Provisioning as-code directly from Grafana + Manage your dashboards with remote provisioning + Manage dashboards as code and provision updates automatically - Manage your dashboards as code and deploy them automatically from your GitHub repository or local storage - - - Review, discuss, and approve dashboard changes with your team before they go live using GitHub pull requests - - - Export your existing dashboards as code and store them in GitHub repositories for version control and - collaboration + Store dashboards in version-controlled storage for better organization and history tracking + Migrate existing dashboards to storage for provisioning {hasPublicAccess && ( Automatically provision and update your dashboards as soon as changes are pushed to your GitHub repository @@ -68,9 +67,12 @@ export const FeaturesList = ({ Visual previews in pull requests to review your changes before going live )} - - Learn more - + {false && ( + // We haven't gotten the design for this quite yet. + + Learn more + + )} {actions()} diff --git a/public/app/features/provisioning/GettingStarted/GettingStartedPage.tsx b/public/app/features/provisioning/GettingStarted/GettingStartedPage.tsx index dd264fbcfd1..bbb0c40c885 100644 --- a/public/app/features/provisioning/GettingStarted/GettingStartedPage.tsx +++ b/public/app/features/provisioning/GettingStarted/GettingStartedPage.tsx @@ -11,7 +11,7 @@ export default function GettingStartedPage({ items }: Props) { - Maximum repos exist ({state.repoCount}) + Maximum repositories exist ({state.repoCount}) ); } diff --git a/public/app/features/provisioning/Shared/TokenPermissionsInfo.tsx b/public/app/features/provisioning/Shared/TokenPermissionsInfo.tsx index fda4ddfd057..84893e99186 100644 --- a/public/app/features/provisioning/Shared/TokenPermissionsInfo.tsx +++ b/public/app/features/provisioning/Shared/TokenPermissionsInfo.tsx @@ -1,36 +1,69 @@ -import { ControlledCollapse, TextLink } from '@grafana/ui'; +import { css } from '@emotion/css'; + +import { GrafanaTheme2 } from '@grafana/data'; +import { TextLink, useStyles2 } from '@grafana/ui'; export function TokenPermissionsInfo() { + const styles = useStyles2(getStyles); + return ( - +
    - To create a new access token, navigate to{' '} + Go to{' '} - Personal access tokens - {' '} + GitHub Personal Access Tokens + + . Make sure to include these permissions under Repository:
    -

    Select the appropriate owner and repository. Then expand repository permissions, granting

    - +
    + + + + - + - + - + - +
    PermissionAccess
    ContentContents Read and write
    MetadataRead onlyRead-only
    Pull requests  Pull requests Read and write
    WebhooksRead and write   Read and write
    - +
    ); } + +function getStyles(theme: GrafanaTheme2) { + return { + container: css({ + marginBottom: theme.spacing(1), + backgroundColor: theme.colors.background.secondary, + border: `1px solid ${theme.colors.border.weak}`, + position: 'relative', + borderRadius: theme.shape.radius.default, + width: '100%', + display: 'flex', + flexDirection: 'column', + flex: '1 1 0', + padding: theme.spacing(theme.components.panel.padding), + }), + permissionTable: css({ + tableLayout: 'auto', + width: '40%', + }), + headerSeparator: css({ + borderBottom: `1px solid ${theme.colors.border.weak}`, + }), + }; +} diff --git a/public/app/features/provisioning/Wizard/BootstrapStep.tsx b/public/app/features/provisioning/Wizard/BootstrapStep.tsx index 25cc2da9f1a..1b45cd6c632 100644 --- a/public/app/features/provisioning/Wizard/BootstrapStep.tsx +++ b/public/app/features/provisioning/Wizard/BootstrapStep.tsx @@ -132,7 +132,7 @@ export function BootstrapStep({ onOptionSelect, settingsData, repoName }: Props) <> {Boolean(state.resourceCount) && ( - Dashboards will be unavailable while running this process. + Dashboards will be unavailable while running this process )} {Boolean(state.fileCount) && Boolean(state.resourceCount) && ( diff --git a/public/app/features/provisioning/Wizard/ConnectPage.tsx b/public/app/features/provisioning/Wizard/ConnectPage.tsx index 0d3ba0270d5..02a43a975be 100644 --- a/public/app/features/provisioning/Wizard/ConnectPage.tsx +++ b/public/app/features/provisioning/Wizard/ConnectPage.tsx @@ -6,7 +6,10 @@ export default function ConnectPage() { return ( diff --git a/public/app/features/provisioning/Wizard/ConnectStep.tsx b/public/app/features/provisioning/Wizard/ConnectStep.tsx index 66dfb059ea0..e273d28cb54 100644 --- a/public/app/features/provisioning/Wizard/ConnectStep.tsx +++ b/public/app/features/provisioning/Wizard/ConnectStep.tsx @@ -29,25 +29,28 @@ export function ConnectStep() { return ( - { - const repoType = value?.value; - setValue('repository.type', repoType); - setValue( - 'repository.workflows', - getWorkflowOptions(repoType).map((v) => v.value) - ); - }} - /> + + { + const repoType = value?.value; + setValue('repository.type', repoType); + setValue( + 'repository.workflows', + getWorkflowOptions(repoType).map((v) => v.value) + ); + }} + /> + {isGithub && ( <> @@ -60,7 +63,7 @@ export function ConnectStep() { { setValue('repository.token', ''); @@ -73,21 +76,22 @@ export function ConnectStep() { diff --git a/public/app/features/provisioning/Wizard/FinishStep.tsx b/public/app/features/provisioning/Wizard/FinishStep.tsx index 10a4f133ecc..a4f8be2b8c5 100644 --- a/public/app/features/provisioning/Wizard/FinishStep.tsx +++ b/public/app/features/provisioning/Wizard/FinishStep.tsx @@ -1,22 +1,18 @@ +import { css } from '@emotion/css'; import { useEffect } from 'react'; import { Controller, useFormContext } from 'react-hook-form'; -import { useNavigate } from 'react-router-dom-v5-compat'; -import { Alert, Field, FieldSet, Input, MultiCombobox, Stack, Switch, Text } from '@grafana/ui'; +import { GrafanaTheme2 } from '@grafana/data'; +import { Field, Input, MultiCombobox, Stack, Switch, useStyles2 } from '@grafana/ui'; import { getWorkflowOptions } from '../Config/ConfigForm'; import { checkPublicAccess, checkImageRenderer } from '../GettingStarted/features'; -import { GETTING_STARTED_URL } from '../constants'; import { WizardFormData } from './types'; export function FinishStep() { - const { - register, - watch, - control, - formState: { errors }, - } = useFormContext(); + const { register, watch, control, formState } = useFormContext(); + const { errors } = formState; const type = watch('repository.type'); const isGithub = type === 'github'; @@ -24,7 +20,18 @@ export function FinishStep() { const hasImageRenderer = checkImageRenderer(); // Enable sync by default const { setValue } = useFormContext(); - const navigate = useNavigate(); + const style = useStyles2(getStyles); + + if (!isPublic || !hasImageRenderer) { + if (formState.defaultValues?.repository) { + formState.defaultValues.repository.generateDashboardPreviews = false; + } + } + if (!isPublic) { + if (formState.defaultValues?.repository) { + // TODO: Disable webhooks by default + } + } // Set sync enabled by default useEffect(() => { @@ -33,107 +40,89 @@ export function FinishStep() { return ( -
    - {isGithub && isPublic && ( - - - Automatically provision and update your dashboards as soon as changes are pushed to your GitHub - repository. - - - )} - {isGithub && !isPublic && ( - Instructions} - onRemove={() => navigate(GETTING_STARTED_URL)} - > - Changes in git will eventually be pulled depending on the synchronization interval. - - )} - + {isGithub && ( + -
    -
    + )} + + + ( + { + onChange(val.map((v) => v.value)); + }} + {...field} + /> + )} + /> + + + {isGithub && false /* TODO */ && ( - { - return ( - { - onChange(val.map((v) => v.value)); - }} - {...field} - /> - ); - }} - /> + {/* TODO: Make an option for the switch to control */} + - {isGithub && ( - <> - {isPublic ? ( - - Preview links will be automatically added to pull requests when changes are made. - - ) : ( - navigate(GETTING_STARTED_URL)} - buttonContent={Instructions} - > - Preview links in pull requests will not be available until a public URL is configured. - - )} + )} - {!hasImageRenderer && ( - navigate(GETTING_STARTED_URL)} - buttonContent={Instructions} - > - The image renderer is not configured. Preview images will not be available. - - )} - - {hasImageRenderer && isPublic && ( - <> - Render before/after images and link them to the pull request. - } - > - - - - This will render dashboards into an image that can be access by a public URL - - - )} - - )} -
    + {isGithub && ( + + Enable dashboard previews in pull requests{' '} + + (Requires image rendering.{' '} + + Set up image rendering + + ) + + + } + description="Adds an image preview of dashboard changes in pull requests. Images of your Grafana dashboards will be shared in your Git repository and visible to anyone with repository access." + disabled={!hasImageRenderer || !isPublic} + > + + + )}
    ); } + +function getStyles(theme: GrafanaTheme2) { + return { + explanation: css({ + color: theme.colors.text.disabled, + fontStyle: 'italic', + }), + explanationLink: css({ + color: theme.colors.text.link, + fontStyle: 'italic', + }), + }; +} diff --git a/public/app/features/provisioning/Wizard/ProvisioningWizard.tsx b/public/app/features/provisioning/Wizard/ProvisioningWizard.tsx index a089dbcd2e9..68dff166ec3 100644 --- a/public/app/features/provisioning/Wizard/ProvisioningWizard.tsx +++ b/public/app/features/provisioning/Wizard/ProvisioningWizard.tsx @@ -12,7 +12,7 @@ import { WizardContent } from './WizardContent'; import { WizardFormData, WizardStep } from './types'; const steps: Array> = [ - { id: 'connection', name: 'Connect', title: 'Connect to repository', submitOnNext: true }, + { id: 'connection', name: 'Connect', title: 'Connect to external storage', submitOnNext: true }, { id: 'bootstrap', name: 'Bootstrap', title: 'Bootstrap repository', submitOnNext: true }, { id: 'migrate', name: 'Resources', title: 'Migrate resources', submitOnNext: false }, { id: 'pull', name: 'Resources', title: 'Pull resources', submitOnNext: false }, diff --git a/public/app/features/provisioning/Wizard/actions.ts b/public/app/features/provisioning/Wizard/actions.ts index b9abbad1585..aa1758c67cf 100644 --- a/public/app/features/provisioning/Wizard/actions.ts +++ b/public/app/features/provisioning/Wizard/actions.ts @@ -10,21 +10,21 @@ const migrateInstance: ModeOption = { target: 'instance', operation: 'migrate', label: 'Migrate instance to repository', - description: 'Save all Grafana resources to repository', + description: 'Save all Grafana resources in the repository', }; const pullInstance: ModeOption = { target: 'instance', operation: 'pull', label: 'Pull from repository to instance', - description: 'Pull resources from repository into this Grafana instance', + description: 'Pull resources from the repository into this Grafana instance', }; const pullFolder: ModeOption = { target: 'folder', operation: 'pull', label: 'Pull from repository to folder', - description: 'Pull repository resources into a specific folder', + description: 'Pull repository resources into a repository-managed Grafana folder', }; function getDisabledReason(action: ModeOption, resourceCount: number, folderConnected?: boolean) { @@ -80,7 +80,7 @@ export function getState( const state: SystemState = { resourceCount, - resourceCountString: counts.join(','), + resourceCountString: counts.join(',\n'), fileCount, actions: [], disabled: [], From 8dab99e1d4ba898af04058bfbfd861ae9ac44911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Jim=C3=A9nez=20S=C3=A1nchez?= Date: Tue, 25 Mar 2025 12:59:50 +0100 Subject: [PATCH 014/100] [Remote Provisioning] Remove resource and file delete buttons (#102767) * Remove delete file button in files tab * Remove delete resource button in resources tab --- .betterer.results | 12 ++---- .../features/provisioning/File/FilesView.tsx | 40 +---------------- .../Repository/RepositoryResources.tsx | 43 +------------------ 3 files changed, 8 insertions(+), 87 deletions(-) diff --git a/.betterer.results b/.betterer.results index 70e7333515a..d160169ff8c 100644 --- a/.betterer.results +++ b/.betterer.results @@ -4740,10 +4740,8 @@ exports[`better eslint`] = { ], "public/app/features/provisioning/File/FilesView.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "2"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "3"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "4"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "1"], + [0, 0, 0, "No untranslated strings. Wrap text with ", "2"] ], "public/app/features/provisioning/GettingStarted/EnhancedFeatures.tsx:5381": [ [0, 0, 0, "Do not use any type assertions.", "0"], @@ -4844,11 +4842,9 @@ exports[`better eslint`] = { ], "public/app/features/provisioning/Repository/RepositoryResources.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], - [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "1"], + [0, 0, 0, "No untranslated strings. Wrap text with ", "1"], [0, 0, 0, "No untranslated strings. Wrap text with ", "2"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "3"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "4"], - [0, 0, 0, "No untranslated strings. Wrap text with ", "5"] + [0, 0, 0, "No untranslated strings. Wrap text with ", "3"] ], "public/app/features/provisioning/Repository/RepositoryStatusPage.tsx:5381": [ [0, 0, 0, "No untranslated strings in text props. Wrap text with or use t()", "0"], diff --git a/public/app/features/provisioning/File/FilesView.tsx b/public/app/features/provisioning/File/FilesView.tsx index 499ec6e9cd9..93cf588241e 100644 --- a/public/app/features/provisioning/File/FilesView.tsx +++ b/public/app/features/provisioning/File/FilesView.tsx @@ -1,21 +1,7 @@ import { useState } from 'react'; -import { - Button, - CellProps, - Column, - ConfirmModal, - FilterInput, - InteractiveTable, - LinkButton, - Spinner, - Stack, -} from '@grafana/ui'; -import { - Repository, - useGetRepositoryFilesQuery, - useDeleteRepositoryFilesWithPathMutation, -} from 'app/api/clients/provisioning'; +import { CellProps, Column, FilterInput, InteractiveTable, LinkButton, Spinner, Stack } from '@grafana/ui'; +import { Repository, useGetRepositoryFilesQuery } from 'app/api/clients/provisioning'; import { PROVISIONING_URL } from '../constants'; import { FileDetails } from '../types'; @@ -29,10 +15,7 @@ type FileCell = CellProps(); const data = [...(query.data?.items ?? [])].filter((file) => file.path.toLowerCase().includes(searchQuery.toLowerCase()) ); @@ -72,9 +55,6 @@ export function FilesView({ repo }: FilesViewProps) { View )} History -
    ); }, @@ -91,22 +71,6 @@ export function FilesView({ repo }: FilesViewProps) { return ( - { - deleteFile({ - name: name, - path: pathToDelete!, - message: `Deleted from repo test UI`, - }); - setPathToDelete(''); - }} - onDismiss={() => setPathToDelete('')} - /> diff --git a/public/app/features/provisioning/Repository/RepositoryResources.tsx b/public/app/features/provisioning/Repository/RepositoryResources.tsx index 121bde0881b..aff409f9ec7 100644 --- a/public/app/features/provisioning/Repository/RepositoryResources.tsx +++ b/public/app/features/provisioning/Repository/RepositoryResources.tsx @@ -1,23 +1,7 @@ import { useMemo, useState } from 'react'; -import { - Column, - CellProps, - Link, - Stack, - Spinner, - FilterInput, - InteractiveTable, - LinkButton, - ConfirmModal, - Button, -} from '@grafana/ui'; -import { - Repository, - ResourceListItem, - useGetRepositoryResourcesQuery, - useDeleteRepositoryFilesWithPathMutation, -} from 'app/api/clients/provisioning'; +import { CellProps, Column, FilterInput, InteractiveTable, Link, LinkButton, Spinner, Stack } from '@grafana/ui'; +import { Repository, ResourceListItem, useGetRepositoryResourcesQuery } from 'app/api/clients/provisioning'; import { PROVISIONING_URL } from '../constants'; @@ -34,8 +18,6 @@ export function RepositoryResources({ repo }: RepoProps) { const name = repo.metadata?.name ?? ''; const query = useGetRepositoryResourcesQuery({ name }); const [searchQuery, setSearchQuery] = useState(''); - const [deleteFile, deleteFileStatus] = useDeleteRepositoryFilesWithPathMutation(); - const [pathToDelete, setPathToDelete] = useState(); const data = (query.data?.items ?? []).filter((Resource) => Resource.path.toLowerCase().includes(searchQuery.toLowerCase()) ); @@ -107,9 +89,6 @@ export function RepositoryResources({ repo }: RepoProps) { {resource === 'dashboards' && View} {resource === 'folders' && View} History - ); }, @@ -128,24 +107,6 @@ export function RepositoryResources({ repo }: RepoProps) { return ( - { - if (pathToDelete) { - deleteFile({ - name: name, - path: pathToDelete, - message: `Deleted from repo test UI`, - }); - setPathToDelete(''); - } - }} - onDismiss={() => setPathToDelete('')} - /> From 2570a29540a6c699e680e48a7722937117955021 Mon Sep 17 00:00:00 2001 From: Dominik Prokop Date: Tue, 25 Mar 2025 13:18:16 +0100 Subject: [PATCH 015/100] DashboardModel: Make sure uid is initialised correctly for k8s dashboards (#102764) DashboardModel: Make sure uid is initialised correctly --- .../serialization/transformSaveModelToScene.ts | 2 +- .../dashboard/state/DashboardModel.test.ts | 14 ++++++++++++++ .../app/features/dashboard/state/DashboardModel.ts | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.ts b/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.ts index 2584d091907..0c139f9fc11 100644 --- a/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.ts +++ b/public/app/features/dashboard-scene/serialization/transformSaveModelToScene.ts @@ -176,7 +176,7 @@ export function createDashboardSceneFromDashboardModel(oldModel: DashboardModel, let variables: SceneVariableSet | undefined; let annotationLayers: SceneDataLayerProvider[] = []; let alertStatesLayer: AlertStatesDataLayer | undefined; - const uid = dto.uid; + const uid = oldModel.uid; const serializerVersion = config.featureToggles.dashboardNewLayouts ? 'v2' : 'v1'; if (oldModel.templating?.list?.length) { diff --git a/public/app/features/dashboard/state/DashboardModel.test.ts b/public/app/features/dashboard/state/DashboardModel.test.ts index 3f52eda79af..bd78d083a74 100644 --- a/public/app/features/dashboard/state/DashboardModel.test.ts +++ b/public/app/features/dashboard/state/DashboardModel.test.ts @@ -47,6 +47,20 @@ describe('DashboardModel', () => { it('should have default properties', () => { expect(model.panels.length).toBe(0); }); + + it('should have uid if specified', () => { + const model = createDashboardModelFixture({ uid: '123' }); + expect(model.uid).toBe('123'); + }); + it('should have null uid if not specified in spec', () => { + const model = createDashboardModelFixture(); + expect(model.uid).toBe(null); + }); + + it('should have uid if specified in meta', () => { + const model = createDashboardModelFixture({}, { uid: '123' }); + expect(model.uid).toBe('123'); + }); }); describe('when storing original dashboard data', () => { diff --git a/public/app/features/dashboard/state/DashboardModel.ts b/public/app/features/dashboard/state/DashboardModel.ts index c54e1743f96..58063976f83 100644 --- a/public/app/features/dashboard/state/DashboardModel.ts +++ b/public/app/features/dashboard/state/DashboardModel.ts @@ -140,7 +140,7 @@ export class DashboardModel implements TimeModel { this.events = new EventBusSrv(); this.id = data.id || null; // UID is not there for newly created dashboards - this.uid = data.uid || null; + this.uid = data.uid || meta?.uid || null; this.revision = data.revision ?? undefined; this.title = data.title ?? 'No Title'; this.description = data.description; From f641ca92842065f792fdd5d55fffc3757e1c616e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20=C5=A0tibran=C3=BD?= Date: Tue, 25 Mar 2025 14:08:16 +0100 Subject: [PATCH 016/100] spanner: use emulator by default when running integration tests with Spanner (#102757) * spanner: when using GRAFANA_TEST_DB=spanner and no SPANNER_DB, use emulator by default. --- Makefile | 2 +- pkg/services/sqlstore/sqlutil/sqlutil.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9f022f833b2..1057564fab1 100644 --- a/Makefile +++ b/Makefile @@ -315,7 +315,7 @@ test-go-integration-memcached: ## Run integration tests for memcached cache. test-go-integration-spanner: ## Run integration tests for Spanner backend with flags. Uses spanner-emulator on localhost:9010 and localhost:9020. @if [ "${WIRE_TAGS}" != "enterprise" ]; then echo "Spanner integration test require enterprise setup"; exit 1; fi @echo "test backend integration spanner tests" - GRAFANA_TEST_DB=spanner SPANNER_DB=emulator \ + GRAFANA_TEST_DB=spanner \ $(GO) test $(GO_RACE_FLAG) $(GO_TEST_FLAGS) -p=1 -count=1 -v -run "^TestIntegration" -covermode=atomic -timeout=2m $(GO_INTEGRATION_TESTS) .PHONY: test-js diff --git a/pkg/services/sqlstore/sqlutil/sqlutil.go b/pkg/services/sqlstore/sqlutil/sqlutil.go index 4da6a8fddb5..d80104c55bd 100644 --- a/pkg/services/sqlstore/sqlutil/sqlutil.go +++ b/pkg/services/sqlstore/sqlutil/sqlutil.go @@ -161,7 +161,7 @@ func spannerTestDB() (*TestDB, error) { spannerDB := os.Getenv("SPANNER_DB") if spannerDB == "" { - return nil, errors.New("SPANNER_DB environment variable not set") + spannerDB = "emulator" } if spannerDB == "spannertest" { From f607f68920882ff1a326f9fb27276e3673747d31 Mon Sep 17 00:00:00 2001 From: Yulia Shanyrova Date: Tue, 25 Mar 2025 14:34:04 +0100 Subject: [PATCH 017/100] Plugins: Filter out raise issue link from custom links in plugin details (#102591) add raise issue link to be filtered from custom links for plugin details --- .../components/PluginDetailsPanel.test.tsx | 38 +++++++++++++++++-- .../admin/components/PluginDetailsPanel.tsx | 26 ++++++++++--- 2 files changed, 55 insertions(+), 9 deletions(-) diff --git a/public/app/features/plugins/admin/components/PluginDetailsPanel.test.tsx b/public/app/features/plugins/admin/components/PluginDetailsPanel.test.tsx index 37c484caf1c..9bfec128241 100644 --- a/public/app/features/plugins/admin/components/PluginDetailsPanel.test.tsx +++ b/public/app/features/plugins/admin/components/PluginDetailsPanel.test.tsx @@ -71,12 +71,16 @@ const mockPlugin: CatalogPlugin = { url: 'https://github.com/grafana/test-plugin/issues/new', }, ], + raiseAnIssueUrl: 'https://github.com/grafana/test-plugin/issues/new', + documentationUrl: 'https://test-plugin.com/docs', + licenseUrl: 'https://github.com/grafana/test-plugin/blob/main/LICENSE', grafanaDependency: '>=9.0.0', statusContext: 'stable', }, angularDetected: false, isFullyInstalled: true, accessControl: {}, + url: 'https://github.com/grafana/test-plugin', }; const mockInfo = [ @@ -137,10 +141,11 @@ describe('PluginDetailsPanel', () => { it('should render license, documentation, repository, raise issue links', () => { render(); - const repositoryLink = screen.getByText('Repository'); - const licenseLink = screen.getByText('License'); - const documentationLink = screen.getByText('Documentation'); - const raiseIssueLink = screen.getByText('Raise issue'); + const repositoryLink = screen.getByTestId('plugin-details-repository-link'); + const licenseLink = screen.getByTestId('plugin-details-license-link'); + const documentationLink = screen.getByTestId('plugin-details-documentation-link'); + const raiseIssueLink = screen.getByTestId('plugin-details-raise-issue-link'); + expect(repositoryLink).toBeInTheDocument(); expect(repositoryLink).toHaveAttribute('href', 'https://github.com/grafana/test-plugin'); expect(licenseLink).toBeInTheDocument(); @@ -150,4 +155,29 @@ describe('PluginDetailsPanel', () => { expect(raiseIssueLink).toBeInTheDocument(); expect(raiseIssueLink).toHaveAttribute('href', 'https://github.com/grafana/test-plugin/issues/new'); }); + + it('should not render license, documentation, repository, raise issue links in custom links', () => { + render(); + const repositoryLink = screen.getByTestId('plugin-details-repository-link'); + const licenseLink = screen.getByTestId('plugin-details-license-link'); + const documentationLink = screen.getByTestId('plugin-details-documentation-link'); + const raiseIssueLink = screen.getByTestId('plugin-details-raise-issue-link'); + const websiteLink = screen.getByText('Website'); + + const customLinks = screen.getByTestId('plugin-details-custom-links'); + + expect(customLinks).not.toContainElement(repositoryLink); + expect(customLinks).not.toContainElement(licenseLink); + expect(customLinks).not.toContainElement(documentationLink); + expect(customLinks).not.toContainElement(raiseIssueLink); + expect(customLinks).toContainElement(websiteLink); + + const regularLinks = screen.getByTestId('plugin-details-regular-links'); + + expect(regularLinks).toContainElement(repositoryLink); + expect(regularLinks).toContainElement(licenseLink); + expect(regularLinks).toContainElement(documentationLink); + expect(regularLinks).toContainElement(raiseIssueLink); + expect(regularLinks).not.toContainElement(websiteLink); + }); }); diff --git a/public/app/features/plugins/admin/components/PluginDetailsPanel.tsx b/public/app/features/plugins/admin/components/PluginDetailsPanel.tsx index 8440b37c76d..1421245d721 100644 --- a/public/app/features/plugins/admin/components/PluginDetailsPanel.tsx +++ b/public/app/features/plugins/admin/components/PluginDetailsPanel.tsx @@ -35,12 +35,18 @@ export function PluginDetailsPanel(props: Props): React.ReactElement | null { const normalizeURL = (url: string | undefined) => url?.replace(/\/$/, ''); const customLinks = plugin.details?.links?.filter((link) => { - const customLinksFiltered = ![plugin.url, plugin.details?.licenseUrl, plugin.details?.documentationUrl] + const customLinksFiltered = ![ + plugin.url, + plugin.details?.licenseUrl, + plugin.details?.documentationUrl, + plugin.details?.raiseAnIssueUrl, + ] .map(normalizeURL) .includes(normalizeURL(link.url)); return customLinksFiltered; }); - const shouldRenderLinks = plugin.url || plugin.details?.licenseUrl || plugin.details?.documentationUrl; + const shouldRenderLinks = + plugin.url || plugin.details?.licenseUrl || plugin.details?.documentationUrl || plugin.details?.raiseAnIssueUrl; const styles = useStyles2(getStyles); @@ -92,10 +98,17 @@ export function PluginDetailsPanel(props: Props): React.ReactElement | null { {shouldRenderLinks && ( <> - + {plugin.url && ( - + Repository )} @@ -106,6 +119,7 @@ export function PluginDetailsPanel(props: Props): React.ReactElement | null { fill="solid" icon="bug" target="_blank" + data-testid="plugin-details-raise-issue-link" > Raise an issue @@ -117,6 +131,7 @@ export function PluginDetailsPanel(props: Props): React.ReactElement | null { fill="solid" icon={'document-info'} target="_blank" + data-testid="plugin-details-license-link" > License @@ -128,6 +143,7 @@ export function PluginDetailsPanel(props: Props): React.ReactElement | null { fill="solid" icon={'list-ui-alt'} target="_blank" + data-testid="plugin-details-documentation-link" > Documentation @@ -137,7 +153,7 @@ export function PluginDetailsPanel(props: Props): React.ReactElement | null { )} {customLinks && customLinks?.length > 0 && ( - + Date: Tue, 25 Mar 2025 14:48:39 +0100 Subject: [PATCH 018/100] CI: Allow Bench conversion to fail (#102791) We shouldn't mark PRs and commits as X if they fail to convert logs with Bench. --- .github/workflows/pr-backend-coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-backend-coverage.yml b/.github/workflows/pr-backend-coverage.yml index 7935860c798..b210abcbd91 100644 --- a/.github/workflows/pr-backend-coverage.yml +++ b/.github/workflows/pr-backend-coverage.yml @@ -62,7 +62,7 @@ jobs: --report-output log \ --grafana-version "$(git rev-parse HEAD)" \ --suite-name grafana-oss-unit-tests \ - /tmp/unit.log + /tmp/unit.log || true concurrency: group: ${{ github.workflow }}-${{ github.ref }} From b792c31eddfaa94d5956f6afe541449c980e2cb4 Mon Sep 17 00:00:00 2001 From: Stephanie Hingtgen Date: Tue, 25 Mar 2025 07:53:13 -0600 Subject: [PATCH 019/100] Dashboard versions: disable show more when last page (#102655) --------- Co-authored-by: Dominik Prokop --- .../settings/VersionsEditView.test.tsx | 87 +++++++++++++++++++ .../settings/VersionsEditView.tsx | 10 ++- .../VersionsSettings.test.tsx | 58 ++++++++++--- .../DashboardSettings/VersionsSettings.tsx | 9 +- 4 files changed, 148 insertions(+), 16 deletions(-) diff --git a/public/app/features/dashboard-scene/settings/VersionsEditView.test.tsx b/public/app/features/dashboard-scene/settings/VersionsEditView.test.tsx index e6449d0d3f6..dc0c3619940 100644 --- a/public/app/features/dashboard-scene/settings/VersionsEditView.test.tsx +++ b/public/app/features/dashboard-scene/settings/VersionsEditView.test.tsx @@ -1,4 +1,5 @@ import { SceneTimeRange } from '@grafana/scenes'; +import { config } from '@grafana/runtime'; import { DashboardScene } from '../scene/DashboardScene'; import { activateFullSceneTree } from '../utils/test-utils'; @@ -108,6 +109,92 @@ describe('VersionsEditView', () => { expect(versionsView.state.isNewLatest).toBe(true); }); + + it('should correctly identify last page when partial page is returned without version 1', async () => { + jest.mocked(historySrv.getHistoryList).mockResolvedValueOnce({ + continueToken: '', + versions: [ + { + id: 4, + dashboardId: 1, + dashboardUID: '_U4zObQMz', + parentVersion: 3, + restoredFrom: 0, + version: 4, + created: '2017-02-22T17:43:01-08:00', + createdBy: 'admin', + message: '', + checked: false, + }, + { + id: 3, + dashboardId: 1, + dashboardUID: '_U4zObQMz', + parentVersion: 1, + restoredFrom: 1, + version: 3, + created: '2017-02-22T17:43:01-08:00', + createdBy: 'admin', + message: '', + checked: false, + }, + ], + }); + + versionsView.reset(); + versionsView.fetchVersions(); + await new Promise(process.nextTick); + + expect(versionsView.versions.length).toBeLessThan(VERSIONS_FETCH_LIMIT); + expect(versionsView.versions.find((rev) => rev.version === 1)).toBeUndefined(); + }); + + it('should correctly identify last page when kubernetesClientDashboardsFolders is enabled and continueToken is empty', async () => { + // @ts-ignore + config.featureToggles.kubernetesClientDashboardsFolders = true; + + jest.mocked(historySrv.getHistoryList).mockResolvedValueOnce({ + continueToken: '', + versions: [ + { + id: 4, + dashboardId: 1, + dashboardUID: '_U4zObQMz', + parentVersion: 3, + restoredFrom: 0, + version: 4, + created: '2017-02-22T17:43:01-08:00', + createdBy: 'admin', + message: '', + checked: false, + }, + { + id: 3, + dashboardId: 1, + dashboardUID: '_U4zObQMz', + parentVersion: 1, + restoredFrom: 1, + version: 3, + created: '2017-02-22T17:43:01-08:00', + createdBy: 'admin', + message: '', + checked: false, + }, + ], + }); + + versionsView.reset(); + versionsView.fetchVersions(); + await new Promise(process.nextTick); + + expect(versionsView.versions.length).toBeLessThan(VERSIONS_FETCH_LIMIT); + expect(versionsView.versions.find((rev) => rev.version === 1)).toBeUndefined(); + expect(versionsView.continueToken).toBe(''); + + // reset feature flag + // @ts-ignore + config.featureToggles.kubernetesClientDashboardsFolders = false; + }); }); }); diff --git a/public/app/features/dashboard-scene/settings/VersionsEditView.tsx b/public/app/features/dashboard-scene/settings/VersionsEditView.tsx index 96431929a4c..6eb427966cf 100644 --- a/public/app/features/dashboard-scene/settings/VersionsEditView.tsx +++ b/public/app/features/dashboard-scene/settings/VersionsEditView.tsx @@ -83,6 +83,10 @@ export class VersionsEditView extends SceneObjectBase imp return this._start; } + public get continueToken(): string { + return this._continueToken; + } + public getUrlKey(): string { return 'versions'; } @@ -202,7 +206,11 @@ function VersionsEditorSettingsListView({ model }: SceneComponentProps version.checked).length === 2; const showButtons = model.versions.length > 1; const hasMore = model.versions.length >= model.limit; - const isLastPage = model.versions.find((rev) => rev.version === 1); + // older versions may have been cleaned up in the db, so also check if the last page is less than the limit, if so, we are at the end + let isLastPage = model.versions.find((rev) => rev.version === 1) || model.versions.length % model.limit !== 0; + if (config.featureToggles.kubernetesClientDashboardsFolders) { + isLastPage = isLastPage || model.continueToken === ''; + } const viewModeCompare = ( <> diff --git a/public/app/features/dashboard/components/DashboardSettings/VersionsSettings.test.tsx b/public/app/features/dashboard/components/DashboardSettings/VersionsSettings.test.tsx index 16f8d84f237..f311d32d3f1 100644 --- a/public/app/features/dashboard/components/DashboardSettings/VersionsSettings.test.tsx +++ b/public/app/features/dashboard/components/DashboardSettings/VersionsSettings.test.tsx @@ -2,6 +2,7 @@ import { screen, waitFor, within } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { render } from 'test/test-utils'; +import { config } from '@grafana/runtime'; import { historySrv } from 'app/features/dashboard-scene/settings/version-history/HistorySrv'; import { createDashboardModelFixture } from '../../state/__fixtures__/dashboardFixtures'; @@ -56,8 +57,7 @@ describe('VersionSettings', () => { }); test('renders a header and a loading indicator followed by results in a table', async () => { - // @ts-ignore - historySrv.getHistoryList.mockResolvedValue(versions); + historySrv.getHistoryList = jest.fn().mockResolvedValue(versions); setup(); expect(screen.getByRole('heading', { name: /versions/i })).toBeInTheDocument(); @@ -75,8 +75,7 @@ describe('VersionSettings', () => { }); test('does not render buttons if versions === 1', async () => { - // @ts-ignore - historySrv.getHistoryList.mockResolvedValue({ + historySrv.getHistoryList = jest.fn().mockResolvedValue({ continueToken: versions.continueToken, versions: versions.versions.slice(0, 1), }); @@ -93,8 +92,7 @@ describe('VersionSettings', () => { }); test('does not render show more button if versions < VERSIONS_FETCH_LIMIT', async () => { - // @ts-ignore - historySrv.getHistoryList.mockResolvedValue({ + historySrv.getHistoryList = jest.fn().mockResolvedValue({ continueToken: versions.continueToken, versions: versions.versions.slice(0, VERSIONS_FETCH_LIMIT - 5), }); @@ -111,8 +109,7 @@ describe('VersionSettings', () => { }); test('renders buttons if versions >= VERSIONS_FETCH_LIMIT', async () => { - // @ts-ignore - historySrv.getHistoryList.mockResolvedValue({ + historySrv.getHistoryList = jest.fn().mockResolvedValue({ continueToken: versions.continueToken, versions: versions.versions.slice(0, VERSIONS_FETCH_LIMIT), }); @@ -134,8 +131,8 @@ describe('VersionSettings', () => { }); test('clicking show more appends results to the table', async () => { - historySrv.getHistoryList - // @ts-ignore + historySrv.getHistoryList = jest + .fn() .mockImplementationOnce(() => Promise.resolve({ continueToken: versions.continueToken, @@ -170,14 +167,47 @@ describe('VersionSettings', () => { }); }); + test('does not show more button when receiving partial page without version 1', async () => { + // Mock a partial page response (less than VERSIONS_FETCH_LIMIT) + historySrv.getHistoryList = jest.fn().mockResolvedValueOnce({ + continueToken: '', + versions: versions.versions.slice(0, VERSIONS_FETCH_LIMIT - 5), + }); + + setup(); + + await waitFor(() => expect(screen.getByRole('table')).toBeInTheDocument()); + + // Verify that show more button is not present since we got a partial page + expect(screen.queryByRole('button', { name: /show more versions/i })).not.toBeInTheDocument(); + // Verify that compare button is still present + expect(screen.getByRole('button', { name: /compare versions/i })).toBeInTheDocument(); + }); + + test('does not show more button when kubernetesClientDashboardsFolders is enabled and continueToken is empty', async () => { + config.featureToggles.kubernetesClientDashboardsFolders = true; + historySrv.getHistoryList = jest.fn().mockResolvedValueOnce({ + continueToken: '', + versions: versions.versions.slice(0, VERSIONS_FETCH_LIMIT - 1), + }); + + setup(); + + await waitFor(() => expect(screen.getByRole('table')).toBeInTheDocument()); + + expect(screen.queryByRole('button', { name: /show more versions/i })).not.toBeInTheDocument(); + expect(screen.getByRole('button', { name: /compare versions/i })).toBeInTheDocument(); + + config.featureToggles.kubernetesClientDashboardsFolders = false; + }); + test('selecting two versions and clicking compare button should render compare view', async () => { - // @ts-ignore - historySrv.getHistoryList.mockResolvedValue({ + historySrv.getHistoryList = jest.fn().mockResolvedValue({ continueToken: versions.continueToken, versions: versions.versions.slice(0, VERSIONS_FETCH_LIMIT), }); - historySrv.getDashboardVersion - // @ts-ignore + historySrv.getDashboardVersion = jest + .fn() .mockImplementationOnce(() => Promise.resolve(diffs.lhs)) .mockImplementationOnce(() => Promise.resolve(diffs.rhs)); diff --git a/public/app/features/dashboard/components/DashboardSettings/VersionsSettings.tsx b/public/app/features/dashboard/components/DashboardSettings/VersionsSettings.tsx index ac4a4e89de6..31ee8c9ba2e 100644 --- a/public/app/features/dashboard/components/DashboardSettings/VersionsSettings.tsx +++ b/public/app/features/dashboard/components/DashboardSettings/VersionsSettings.tsx @@ -125,7 +125,14 @@ export class VersionsSettings extends PureComponent { })); isLastPage() { - return this.state.versions.find((rev) => rev.version === 1); + if (config.featureToggles.kubernetesClientDashboardsFolders) { + return ( + this.state.versions.find((rev) => rev.version === 1) || + this.state.versions.length % this.limit !== 0 || + this.continueToken === '' + ); + } + return this.state.versions.find((rev) => rev.version === 1) || this.state.versions.length % this.limit !== 0; } onCheck = (ev: React.FormEvent, versionId: number) => { From 169b0eb5f5aa1bc681fb08794061764724da82f7 Mon Sep 17 00:00:00 2001 From: Eric Leijonmarck Date: Tue, 25 Mar 2025 13:55:59 +0000 Subject: [PATCH 020/100] Config: Removes setting `viewers_can_edit` (#102275) Revert "Revert "Config: Removes setting `viewers_can_edit` (#101767)" (#102191)" This reverts commit 56c896fa72529b86260f560ab14a906282a233fc. --- pkg/api/accesscontrol.go | 5 --- .../guardian/accesscontrol_guardian.go | 10 ------ .../guardian/accesscontrol_guardian_test.go | 35 +++---------------- pkg/services/queryhistory/api.go | 4 +-- .../scene/NavToolbarActions.tsx | 8 ++++- 5 files changed, 12 insertions(+), 50 deletions(-) diff --git a/pkg/api/accesscontrol.go b/pkg/api/accesscontrol.go index fba8973eaa3..8fec8c2d2f7 100644 --- a/pkg/api/accesscontrol.go +++ b/pkg/api/accesscontrol.go @@ -71,11 +71,6 @@ func (hs *HTTPServer) declareFixedRoles() error { Grants: []string{string(org.RoleEditor)}, } - //nolint:staticcheck // ViewersCanEdit is deprecated but still used for backward compatibility - if hs.Cfg.ViewersCanEdit { - datasourcesExplorerRole.Grants = append(datasourcesExplorerRole.Grants, string(org.RoleViewer)) - } - datasourcesReaderRole := ac.RoleRegistration{ Role: ac.RoleDTO{ Name: "fixed:datasources:reader", diff --git a/pkg/services/guardian/accesscontrol_guardian.go b/pkg/services/guardian/accesscontrol_guardian.go index e889118c6dd..88d29ec72b1 100644 --- a/pkg/services/guardian/accesscontrol_guardian.go +++ b/pkg/services/guardian/accesscontrol_guardian.go @@ -221,11 +221,6 @@ func (a *accessControlDashboardGuardian) CanEdit() (bool, error) { return false, ErrGuardianDashboardNotFound.Errorf("failed to check edit permissions for dashboard") } - //nolint:staticcheck // ViewersCanEdit is deprecated but still used for backward compatibility - if a.cfg.ViewersCanEdit { - return a.CanView() - } - return a.evaluate( accesscontrol.EvalPermission(dashboards.ActionDashboardsWrite, dashboards.ScopeDashboardsProvider.GetResourceScopeUID(a.dashboard.UID)), ) @@ -236,11 +231,6 @@ func (a *accessControlFolderGuardian) CanEdit() (bool, error) { return false, ErrGuardianFolderNotFound.Errorf("failed to check edit permissions for folder") } - //nolint:staticcheck // ViewersCanEdit is deprecated but still used for backward compatibility - if a.cfg.ViewersCanEdit { - return a.CanView() - } - return a.evaluate(accesscontrol.EvalPermission(dashboards.ActionFoldersWrite, dashboards.ScopeFoldersProvider.GetResourceScopeUID(a.folder.UID))) } diff --git a/pkg/services/guardian/accesscontrol_guardian_test.go b/pkg/services/guardian/accesscontrol_guardian_test.go index 2e37ca224e7..2171d2bbbac 100644 --- a/pkg/services/guardian/accesscontrol_guardian_test.go +++ b/pkg/services/guardian/accesscontrol_guardian_test.go @@ -36,11 +36,10 @@ var ( ) type accessControlGuardianTestCase struct { - desc string - dashboard *dashboards.Dashboard - permissions []accesscontrol.Permission - viewersCanEdit bool - expected bool + desc string + dashboard *dashboards.Dashboard + permissions []accesscontrol.Permission + expected bool } func TestAccessControlDashboardGuardian_CanSave(t *testing.T) { @@ -257,18 +256,6 @@ func TestAccessControlDashboardGuardian_CanEdit(t *testing.T) { }, expected: false, }, - { - desc: "should be able to edit dashboard with read action when viewer_can_edit is true", - dashboard: dashboard, - permissions: []accesscontrol.Permission{ - { - Action: dashboards.ActionDashboardsRead, - Scope: "dashboards:uid:1", - }, - }, - viewersCanEdit: true, - expected: true, - }, { desc: "should not be able to edit folder with folder write and dashboard wildcard scope", dashboard: fldr, @@ -324,25 +311,11 @@ func TestAccessControlDashboardGuardian_CanEdit(t *testing.T) { }, expected: false, }, - { - desc: "should be able to edit folder with folder read action when viewer_can_edit is true", - dashboard: fldr, - permissions: []accesscontrol.Permission{ - { - Action: dashboards.ActionFoldersRead, - Scope: folderUIDScope, - }, - }, - viewersCanEdit: true, - expected: true, - }, } for _, tt := range tests { t.Run(tt.desc, func(t *testing.T) { cfg := setting.NewCfg() - //nolint:staticcheck - cfg.ViewersCanEdit = tt.viewersCanEdit guardian := setupAccessControlGuardianTest(t, tt.dashboard, tt.permissions, cfg) can, err := guardian.CanEdit() diff --git a/pkg/services/queryhistory/api.go b/pkg/services/queryhistory/api.go index a3783357f4e..0b39e4c9f30 100644 --- a/pkg/services/queryhistory/api.go +++ b/pkg/services/queryhistory/api.go @@ -30,9 +30,7 @@ type CallbackHandler func(c *contextmodel.ReqContext) response.Response func (s *QueryHistoryService) permissionsMiddleware(handler CallbackHandler, errorMessage string) CallbackHandler { return func(c *contextmodel.ReqContext) response.Response { hasAccess := ac.HasAccess(s.accessControl, c) - // ViewersCanEdit is deprecated but still used for backward compatibility - //nolint:staticcheck - if c.GetOrgRole() == org.RoleViewer && !s.Cfg.ViewersCanEdit && !hasAccess(ac.EvalPermission(ac.ActionDatasourcesExplore)) { + if c.GetOrgRole() == org.RoleViewer && !hasAccess(ac.EvalPermission(ac.ActionDatasourcesExplore)) { return response.Error(http.StatusUnauthorized, errorMessage, nil) } return handler(c) diff --git a/public/app/features/dashboard-scene/scene/NavToolbarActions.tsx b/public/app/features/dashboard-scene/scene/NavToolbarActions.tsx index 6b6c0b54f50..de4951a315d 100644 --- a/public/app/features/dashboard-scene/scene/NavToolbarActions.tsx +++ b/public/app/features/dashboard-scene/scene/NavToolbarActions.tsx @@ -18,6 +18,7 @@ import { } from '@grafana/ui'; import { AppChromeUpdate } from 'app/core/components/AppChrome/AppChromeUpdate'; import { NavToolbarSeparator } from 'app/core/components/AppChrome/NavToolbar/NavToolbarSeparator'; +import grafanaConfig from 'app/core/config'; import { LS_PANEL_COPY_KEY } from 'app/core/constants'; import { contextSrv } from 'app/core/core'; import { Trans, t } from 'app/core/internationalization'; @@ -82,6 +83,11 @@ export function ToolbarActions({ dashboard }: Props) { const folderRepo = useSelector((state) => selectFolderRepository(state, meta.folderUid)); const isManaged = Boolean(dashboard.isManagedRepository() || folderRepo); + // Internal only; + // allows viewer editing without ability to save + // used for grafana play + const canEdit = grafanaConfig.viewersCanEdit; + if (!isEditingPanel) { // This adds the presence indicators in enterprise addDynamicActions(toolbarActions, dynamicDashNavActions.left, 'left-actions'); @@ -347,7 +353,7 @@ export function ToolbarActions({ dashboard }: Props) { toolbarActions.push({ group: 'main-buttons', - condition: !isEditing && dashboard.canEditDashboard() && !isViewingPanel && !isPlaying && editable, + condition: !isEditing && (dashboard.canEditDashboard() || canEdit) && !isViewingPanel && !isPlaying && editable, render: () => ( + } + /> + )} + + + layoutManager.onMaxColumnCountChanged(parseInt(value, 10))} + /> + + ); } function GridLayoutRows({ layoutManager }: { layoutManager: ResponsiveGridLayoutManager }) { - const { autoRows } = layoutManager.state.layout.useState(); + const { rowHeight, fillScreen } = layoutManager.useState(); + const [inputRef, setInputRef] = React.useState(null); + const [focusInput, setFocusInput] = React.useState(false); + const [customMinWidthError, setCustomMinWidthError] = React.useState(false); - const rowOptions: Array> = []; + useEffect(() => { + if (focusInput && inputRef) { + inputRef.focus(); + setFocusInput(false); + } + }, [focusInput, inputRef]); - for (const size of sizes) { - rowOptions.push({ - label: t('dashboard.responsive-layout.options.min', 'Min: {{size}}px', { size }), - value: `minmax(${size}px, auto)`, - }); - } + const minWidthOptions: Array> = [ + 'short' as const, + 'standard' as const, + 'tall' as const, + 'custom' as const, + ].map((value) => ({ + label: capitalize(value), + value, + })); - for (const size of sizes) { - rowOptions.push({ - label: t('dashboard.responsive-layout.options.fixed', 'Fixed: {{size}}px', { size }), - value: `${size}px`, - }); - } + const isStandardHeight = typeof rowHeight === 'string'; + const rowHeightLabel = rowHeight + ? t('dashboard.responsive-layout.options.min-height', 'Row height') + : t('dashboard.responsive-layout.options.min-height-custom', 'Custom row height'); + + const onCustomHeightChanged = (e: React.ChangeEvent) => { + const pixels = parseInt(e.target.value, 10); + if (isNaN(pixels) || pixels < 50 || pixels > 2000) { + setCustomMinWidthError(true); + return; + } else if (customMinWidthError) { + setCustomMinWidthError(false); + } + + layoutManager.onRowHeightChanged(pixels); + }; + + const onNamedMinHeightChanged = (value: ComboboxOption) => { + if (value.value === 'custom') { + setFocusInput(true); + } + layoutManager.onRowHeightChanged(value.value); + }; + + const onClearCustomRowHeight = () => { + if (customMinWidthError) { + setCustomMinWidthError(false); + } + + layoutManager.onRowHeightChanged('standard'); + }; return ( - setInputRef(ref)} + width={18} + type="number" + min={50} + max={2000} + invalid={customMinWidthError} + suffix={ + + } + /> + )} + + + layoutManager.onFillScreenChanged(!fillScreen)} /> + + ); } diff --git a/public/app/features/dashboard-scene/serialization/layoutSerializers/ResponsiveGridLayoutSerializer.ts b/public/app/features/dashboard-scene/serialization/layoutSerializers/ResponsiveGridLayoutSerializer.ts index 72a04194f82..9159ca0943b 100644 --- a/public/app/features/dashboard-scene/serialization/layoutSerializers/ResponsiveGridLayoutSerializer.ts +++ b/public/app/features/dashboard-scene/serialization/layoutSerializers/ResponsiveGridLayoutSerializer.ts @@ -2,7 +2,16 @@ import { DashboardV2Spec, ResponsiveGridLayoutItemKind } from '@grafana/schema/d import { ResponsiveGridItem } from '../../scene/layout-responsive-grid/ResponsiveGridItem'; import { ResponsiveGridLayout } from '../../scene/layout-responsive-grid/ResponsiveGridLayout'; -import { ResponsiveGridLayoutManager } from '../../scene/layout-responsive-grid/ResponsiveGridLayoutManager'; +import { + AUTO_GRID_DEFAULT_COLUMN_WIDTH, + AUTO_GRID_DEFAULT_MAX_COLUMN_COUNT, + AUTO_GRID_DEFAULT_ROW_HEIGHT, + AutoGridColumnWidth, + AutoGridRowHeight, + getAutoRowsTemplate, + getTemplateColumnsTemplate, + ResponsiveGridLayoutManager, +} from '../../scene/layout-responsive-grid/ResponsiveGridLayoutManager'; import { DashboardLayoutManager, LayoutManagerSerializer } from '../../scene/types/DashboardLayoutManager'; import { dashboardSceneGraph } from '../../utils/dashboardSceneGraph'; import { getGridItemKeyForPanelId } from '../../utils/utils'; @@ -14,10 +23,10 @@ export class ResponsiveGridLayoutSerializer implements LayoutManagerSerializer { return { kind: 'ResponsiveGridLayout', spec: { - col: - layoutManager.state.layout.state.templateColumns?.toString() ?? - ResponsiveGridLayoutManager.defaultCSS.templateColumns, - row: layoutManager.state.layout.state.autoRows?.toString() ?? ResponsiveGridLayoutManager.defaultCSS.autoRows, + maxColumnCount: layoutManager.state.maxColumnCount, + fillScreen: layoutManager.state.fillScreen, + ...serializeAutoGridColumnWidth(layoutManager.state.columnWidth), + ...serializeAutoGridRowHeight(layoutManager.state.rowHeight), items: layoutManager.state.layout.state.children.map((child) => { if (!(child instanceof ResponsiveGridItem)) { throw new Error('Expected ResponsiveGridItem'); @@ -73,11 +82,35 @@ export class ResponsiveGridLayoutSerializer implements LayoutManagerSerializer { }); return new ResponsiveGridLayoutManager({ + maxColumnCount: layout.spec.maxColumnCount, + columnWidth: layout.spec.columnWidthMode === 'custom' ? layout.spec.columnWidth : layout.spec.columnWidthMode, + rowHeight: layout.spec.rowHeightMode === 'custom' ? layout.spec.rowHeight : layout.spec.rowHeightMode, + fillScreen: layout.spec.fillScreen, layout: new ResponsiveGridLayout({ - templateColumns: layout.spec.col, - autoRows: layout.spec.row, + templateColumns: getTemplateColumnsTemplate( + layout.spec.maxColumnCount ?? AUTO_GRID_DEFAULT_MAX_COLUMN_COUNT, + layout.spec.columnWidth ?? AUTO_GRID_DEFAULT_COLUMN_WIDTH + ), + autoRows: getAutoRowsTemplate( + layout.spec.rowHeight ?? AUTO_GRID_DEFAULT_ROW_HEIGHT, + layout.spec.fillScreen ?? false + ), children, }), }); } } + +function serializeAutoGridColumnWidth(columnWidth: AutoGridColumnWidth) { + return { + columnWidthMode: typeof columnWidth === 'number' ? 'custom' : columnWidth, + columnWidth: typeof columnWidth === 'number' ? columnWidth : undefined, + }; +} + +function serializeAutoGridRowHeight(rowHeight: AutoGridRowHeight) { + return { + rowHeightMode: typeof rowHeight === 'number' ? 'custom' : rowHeight, + rowHeight: typeof rowHeight === 'number' ? rowHeight : undefined, + }; +} diff --git a/public/app/features/dashboard-scene/serialization/layoutSerializers/RowsLayoutSerializer.test.ts b/public/app/features/dashboard-scene/serialization/layoutSerializers/RowsLayoutSerializer.test.ts index 4d5429e1b34..82d24caefff 100644 --- a/public/app/features/dashboard-scene/serialization/layoutSerializers/RowsLayoutSerializer.test.ts +++ b/public/app/features/dashboard-scene/serialization/layoutSerializers/RowsLayoutSerializer.test.ts @@ -46,8 +46,9 @@ describe('deserialization', () => { layout: { kind: 'ResponsiveGridLayout', spec: { - row: 'minmax(min-content, max-content)', - col: 'repeat(auto-fit, minmax(400px, 1fr))', + columnWidthMode: 'standard', + rowHeightMode: 'standard', + maxColumnCount: 4, items: [], }, }, @@ -75,8 +76,9 @@ describe('deserialization', () => { layout: { kind: 'ResponsiveGridLayout', spec: { - row: 'minmax(min-content, max-content)', - col: 'repeat(auto-fit, minmax(400px, 1fr))', + columnWidthMode: 'standard', + rowHeightMode: 'standard', + maxColumnCount: 4, items: [], }, }, @@ -233,11 +235,10 @@ describe('serialization', () => { title: 'Row 1', isCollapsed: false, layout: new ResponsiveGridLayoutManager({ - layout: new ResponsiveGridLayout({ - children: [], - templateColumns: 'repeat(auto-fit, minmax(400px, 1fr))', - autoRows: 'minmax(min-content, max-content)', - }), + columnWidth: 'standard', + rowHeight: 'standard', + maxColumnCount: 4, + layout: new ResponsiveGridLayout({}), }), }), new RowItem({ @@ -269,8 +270,12 @@ describe('serialization', () => { layout: { kind: 'ResponsiveGridLayout', spec: { - row: 'minmax(min-content, max-content)', - col: 'repeat(auto-fit, minmax(400px, 1fr))', + columnWidth: undefined, + rowHeight: undefined, + fillScreen: false, + rowHeightMode: 'standard', + columnWidthMode: 'standard', + maxColumnCount: 4, items: [], }, }, diff --git a/public/app/features/dashboard-scene/serialization/layoutSerializers/TabsLayoutSerializer.test.ts b/public/app/features/dashboard-scene/serialization/layoutSerializers/TabsLayoutSerializer.test.ts index e1e0fc7901e..35214720bce 100644 --- a/public/app/features/dashboard-scene/serialization/layoutSerializers/TabsLayoutSerializer.test.ts +++ b/public/app/features/dashboard-scene/serialization/layoutSerializers/TabsLayoutSerializer.test.ts @@ -28,7 +28,13 @@ describe('deserialization', () => { tabs: [ { kind: 'TabsLayoutTab', - spec: { title: 'Tab 1', layout: { kind: 'ResponsiveGridLayout', spec: { row: '', col: '', items: [] } } }, + spec: { + title: 'Tab 1', + layout: { + kind: 'ResponsiveGridLayout', + spec: { columnWidthMode: 'standard', rowHeightMode: 'standard', maxColumnCount: 4, items: [] }, + }, + }, }, ], }, @@ -64,7 +70,13 @@ describe('deserialization', () => { tabs: [ { kind: 'TabsLayoutTab', - spec: { title: 'Tab 1', layout: { kind: 'ResponsiveGridLayout', spec: { row: '', col: '', items: [] } } }, + spec: { + title: 'Tab 1', + layout: { + kind: 'ResponsiveGridLayout', + spec: { columnWidthMode: 'standard', rowHeightMode: 'standard', maxColumnCount: 4, items: [] }, + }, + }, }, { kind: 'TabsLayoutTab', spec: { title: 'Tab 2', layout: { kind: 'GridLayout', spec: { items: [] } } } }, ], diff --git a/public/app/features/dashboard-scene/serialization/transformSaveModelSchemaV2ToScene.test.ts b/public/app/features/dashboard-scene/serialization/transformSaveModelSchemaV2ToScene.test.ts index e1bd8b6fe0f..fd16165b8bd 100644 --- a/public/app/features/dashboard-scene/serialization/transformSaveModelSchemaV2ToScene.test.ts +++ b/public/app/features/dashboard-scene/serialization/transformSaveModelSchemaV2ToScene.test.ts @@ -507,8 +507,10 @@ describe('transformSaveModelSchemaV2ToScene', () => { dashboard.spec.layout = { kind: 'ResponsiveGridLayout', spec: { - col: 'colString', - row: 'rowString', + maxColumnCount: 4, + columnWidthMode: 'custom', + columnWidth: 100, + rowHeightMode: 'standard', items: [ { kind: 'ResponsiveGridLayoutItem', @@ -525,8 +527,9 @@ describe('transformSaveModelSchemaV2ToScene', () => { const scene = transformSaveModelSchemaV2ToScene(dashboard); const layoutManager = scene.state.body as ResponsiveGridLayoutManager; expect(layoutManager.descriptor.kind).toBe('ResponsiveGridLayout'); - expect(layoutManager.state.layout.state.templateColumns).toBe('colString'); - expect(layoutManager.state.layout.state.autoRows).toBe('rowString'); + expect(layoutManager.state.maxColumnCount).toBe(4); + expect(layoutManager.state.columnWidth).toBe(100); + expect(layoutManager.state.rowHeight).toBe('standard'); expect(layoutManager.state.layout.state.children.length).toBe(1); const gridItem = layoutManager.state.layout.state.children[0] as ResponsiveGridItem; expect(gridItem.state.body.state.key).toBe('panel-1'); @@ -545,8 +548,9 @@ describe('transformSaveModelSchemaV2ToScene', () => { layout: { kind: 'ResponsiveGridLayout', spec: { - col: 'colString', - row: 'rowString', + maxColumnCount: 4, + columnWidthMode: 'standard', + rowHeightMode: 'standard', items: [ { kind: 'ResponsiveGridLayoutItem', @@ -571,8 +575,9 @@ describe('transformSaveModelSchemaV2ToScene', () => { expect(layoutManager.state.tabs.length).toBe(1); expect(layoutManager.state.tabs[0].state.title).toBe('tab1'); const gridLayoutManager = layoutManager.state.tabs[0].state.layout as ResponsiveGridLayoutManager; - expect(gridLayoutManager.state.layout.state.templateColumns).toBe('colString'); - expect(gridLayoutManager.state.layout.state.autoRows).toBe('rowString'); + expect(gridLayoutManager.state.maxColumnCount).toBe(4); + expect(gridLayoutManager.state.columnWidth).toBe('standard'); + expect(gridLayoutManager.state.rowHeight).toBe('standard'); expect(gridLayoutManager.state.layout.state.children.length).toBe(1); const gridItem = gridLayoutManager.state.layout.state.children[0] as ResponsiveGridItem; expect(gridItem.state.body.state.key).toBe('panel-1'); @@ -592,8 +597,9 @@ describe('transformSaveModelSchemaV2ToScene', () => { layout: { kind: 'ResponsiveGridLayout', spec: { - col: 'colString', - row: 'rowString', + maxColumnCount: 4, + columnWidthMode: 'standard', + rowHeightMode: 'standard', items: [ { kind: 'ResponsiveGridLayoutItem', @@ -645,6 +651,9 @@ describe('transformSaveModelSchemaV2ToScene', () => { expect(layoutManager.state.rows.length).toBe(2); const row1Manager = layoutManager.state.rows[0].state.layout as ResponsiveGridLayoutManager; expect(row1Manager.descriptor.kind).toBe('ResponsiveGridLayout'); + expect(row1Manager.state.maxColumnCount).toBe(4); + expect(row1Manager.state.columnWidth).toBe('standard'); + expect(row1Manager.state.rowHeight).toBe('standard'); const row1GridItem = row1Manager.state.layout.state.children[0] as ResponsiveGridItem; expect(row1GridItem.state.body.state.key).toBe('panel-1'); diff --git a/public/app/features/dashboard-scene/serialization/transformSceneToSaveModelSchemaV2.test.ts b/public/app/features/dashboard-scene/serialization/transformSceneToSaveModelSchemaV2.test.ts index ff1df0ded25..403432cf8ba 100644 --- a/public/app/features/dashboard-scene/serialization/transformSceneToSaveModelSchemaV2.test.ts +++ b/public/app/features/dashboard-scene/serialization/transformSceneToSaveModelSchemaV2.test.ts @@ -631,9 +631,11 @@ describe('dynamic layouts', () => { const scene = setupDashboardScene( getMinimalSceneState( new ResponsiveGridLayoutManager({ + columnWidth: 100, + rowHeight: 'standard', + maxColumnCount: 4, + fillScreen: true, layout: new ResponsiveGridLayout({ - autoRows: 'rowString', - templateColumns: 'colString', children: [ new ResponsiveGridItem({ body: new VizPanel({}), @@ -649,8 +651,12 @@ describe('dynamic layouts', () => { const result = transformSceneToSaveModelSchemaV2(scene); expect(result.layout.kind).toBe('ResponsiveGridLayout'); const respGridLayout = result.layout.spec as ResponsiveGridLayoutSpec; - expect(respGridLayout.col).toBe('colString'); - expect(respGridLayout.row).toBe('rowString'); + expect(respGridLayout.columnWidthMode).toBe('custom'); + expect(respGridLayout.columnWidth).toBe(100); + expect(respGridLayout.rowHeightMode).toBe('standard'); + expect(respGridLayout.rowHeight).toBeUndefined(); + expect(respGridLayout.maxColumnCount).toBe(4); + expect(respGridLayout.fillScreen).toBe(true); expect(respGridLayout.items.length).toBe(2); expect(respGridLayout.items[0].kind).toBe('ResponsiveGridLayoutItem'); }); diff --git a/public/locales/en-US/grafana.json b/public/locales/en-US/grafana.json index 0868a4cdbd0..bf22d37294e 100644 --- a/public/locales/en-US/grafana.json +++ b/public/locales/en-US/grafana.json @@ -1528,13 +1528,21 @@ }, "name": "Auto grid", "options": { - "columns": "Columns", - "fixed": "Fixed: {{size}}px", - "min": "Min: {{size}}px", - "one-column": "1 column", - "rows": "Rows", - "three-columns": "3 columns", - "two-columns": "2 columns" + "custom-min-height": { + "clear": "Clear" + }, + "custom-min-width": { + "clear": "Clear" + }, + "height-fill": "Fill screen", + "max-columns": "Max columns", + "min-height": "Row height", + "min-height-custom": "Custom row height", + "min-height-error": "A number between 50 and 2000 is required", + "min-width": "Min column width", + "min-width-custom": "Custom min width", + "min-width-custom-clear": "Back to standard min column width", + "min-width-error": "A number between 50 and 2000 is required" } }, "rows-layout": { From 13058d27157aeb95e04fa98471797ec7442bbe81 Mon Sep 17 00:00:00 2001 From: Isabel Matwawana <76437239+imatwawana@users.noreply.github.com> Date: Tue, 25 Mar 2025 12:15:15 -0400 Subject: [PATCH 028/100] Docs: bar gauge visualization refactor (#102747) * Added Config options heading and bumped heading levels * Added empty Text size options section and updated Value options * Updated bar gauge section * Added missing options and removed screenshot * Fixed Bar gauge options * Added descriptions for Text size section * Added links to text size section * Fixed text size section --- .../visualizations/bar-gauge/index.md | 150 ++++++------------ 1 file changed, 45 insertions(+), 105 deletions(-) diff --git a/docs/sources/panels-visualizations/visualizations/bar-gauge/index.md b/docs/sources/panels-visualizations/visualizations/bar-gauge/index.md index 3fd9b5c24ea..72862007d31 100644 --- a/docs/sources/panels-visualizations/visualizations/bar-gauge/index.md +++ b/docs/sources/panels-visualizations/visualizations/bar-gauge/index.md @@ -91,142 +91,82 @@ The bar gauge visualization also supports multiple records (rows) in the dataset By default, the visualization is configured to [calculate](#value-options) a single value per column or series and to display only the last set of data. However, it derives the minimum and maximum from the full dataset even if those values aren’t visible. In this example, that means only the last row of data is displayed in the gauges and the minimum and maximum values are defined as 2 and 20, pulled from the whole dataset. -If you want to show one gauge per cell you can change the [Show](#show) setting from [Calculate](#calculate) to [All values](#all-values) and each bar is labeled by concatenating the text column with each value's column name. +If you want to show one gauge per cell you can change the **Show** setting from **Calculate** to **All values** and each bar is labeled by concatenating the text column with each value's column name. ![Bar gauge with multiple rows of data displaying all the values](/media/docs/grafana/panels-visualizations/screenshot-grafana-12.1-bargauge-example5.png) -## Panel options +For more information on these settings, refer to [Value options](#value-options). + +## Configuration options + +{{< docs/shared lookup="visualizations/config-options-intro.md" source="grafana" version="" >}} + +### Panel options {{< docs/shared lookup="visualizations/panel-options.md" source="grafana" version="" >}} -## Value options +### Value options Use the following options to refine how your visualization displays the value: -### Show + -Choose how Grafana displays your data. +| Option | Description | +| ------ | ----------- | +| Show | Set how Grafana displays your data. Choose from:
    • **Calculate** - Show a calculated value based on all rows.
    • **All values** - Show a separate value for every row. If you select this option, then you can also limit the number of rows to display.
    | +| Calculation | If you chose **Calculate** as your **Show** option, select a reducer function that Grafana will use to reduce many fields to a single value. For a list of available calculations, refer to [Calculation types](ref:calculation-types). | +| Limit | If you chose **All values** as your **Show** option, enter the maximum number of rows to display. The default is 5,000. | +| Fields | Select the fields display in the panel. | -#### Calculate + -Show a calculated value based on all rows. +### Bar gauge options -- **Calculation -** Select a reducer function that Grafana will use to reduce many fields to a single value. For a list of available calculations, refer to [Calculation types](ref:calculation-types). -- **Fields -** Select the fields display in the panel. +Adjust how the gauge is displayed. -#### All values + -Show a separate stat for every row. If you select this option, then you can also limit the number of rows to display. +| Option | Description | +| ------ | ----------- | +| Orientation | Choose a stacking direction:
    • **Auto** - Grafana determines the best orientation.
    • **Horizontal** - Bars stretch horizontally, left to right.
    • **Vertical** - Bars stretch vertically, bottom to top.
    | +| Display mode | Choose a display mode:
    • **Gradient** - Threshold levels define a gradient.
    • **Retro LCD** - The bar is split into sections that are lit or unlit.
    • **Basic** - Single color based on the matching threshold.
    | +| Value display | Choose a value display mode:
    • **Value color** - Value color is determined by value.
    • **Text color** - Value color is default text color.
    • **Hidden** - Values are hidden.
    | +| Name placement | Set the name placement mode when the bar gauge orientation is **Auto** or **Horizontal**. Choose from:
    • **Auto** - Grafana determines the best placement.
    • **Top** - Names are placed on top of each bar gauge.
    • **Left** - Names are placed to the left of each bar gauge.
    • **Hidden** - Names are hidden.

    When the bar gauge is in the vertical orientation, choose from **Auto** (names are always placed at the bottom of each bar) or **Hidden**.

    | +| Show unfilled area | Select if you want to render the unfilled region of the bars as dark gray. Not applicable to **Retro LCD** display mode. | +| Bar size | Choose a bar size mode:
    • **Auto** - Grafana determines the best bar size.
    • **Manual** - Manually configure the bar size.
    | +| Min width | Limit the minimum width of the bar column when the gauge is oriented vertically or is in **Auto** mode. Automatically shows the x-axis scroll bar when there's a large amount of data.

    This option only applies when the **Bar size** mode is set to **Manual**.

    | +| Min height | Limit the minimum height of the bar row when the bar gauge is oriented horizontally or is in **Auto** mode. Automatically shows the y-axis scroll bar when there's a large amount of data.

    This option only applies when the **Bar size** mode is set to **Manual**.

    | +| Max height | Limit the maximum height of the bar row when the bar gauge is oriented horizontally or is in **Auto** mode. Automatically shows the y-axis scroll bar when there's a large amount of data.

    This option only applies when the **Bar size** mode is set to **Manual**.

    | -- **Limit -** The maximum number of rows to display. Default is 5,000. -- **Fields -** Select the fields display in the panel. + -## Bar gauge options - -Adjust how the bar gauge is displayed. - -### Orientation - -Choose a stacking direction. - -- **Auto -** Grafana determines the best orientation. -- **Horizontal -** Bars stretch horizontally, left to right. -- **Vertical -** Bars stretch vertically, bottom to top. - -### Display mode - -Choose a display mode. - -- **Gradient -** Threshold levels define a gradient. -- **Retro LCD -** The gauge is split into small cells that are lit or unlit. -- **Basic -** Single color based on the matching threshold. - -### Value display - -Choose a value display mode. - -- **Value color -** Value color is determined by value. -- **Text color -** Value color is default text color. -- **Hidden -** Values are hidden. - -### Name placement - -Choose a name placement mode. - -{{% admonition type="note" %}} -This option only applies when the orientation of the bar gauge is horizontal. When the bar gauge is in the vertical orientation, names are always placed at the bottom of each bar gauge. -{{% /admonition %}} - -- **Auto -** Grafana determines the best placement. -- **Top -** Names are placed on top of each bar gauge. -- **Left -** Names are placed to the left of each bar gauge. -- **Hidden -** Names are hidden on each bar gauge. - -### Show unfilled area - -Select this if you want to render the unfilled region of the bars as dark gray. Not applicable to Retro LCD display mode. - -### Bar size - -Choose a bar size mode. - -- **Auto -** Grafana determines the best bar gauge size. -- **Manual -** Manually configure the bar gauge size. - -### Min width - -Limit the minimum width of the bar column when the gauge is oriented vertically. - -Automatically show x-axis scrollbar when there's a large amount of data. - -{{% admonition type="note" %}} -This option only applies when bar size is set to manual. -{{% /admonition %}} - -### Min height - -Limit the minimum height of the bar row when the gauge is oriented horizontally. - -Automatically show y-axis scrollbar when there's a large amount of data. - -{{% admonition type="note" %}} -This option only applies when bar size is set to manual. -{{% /admonition %}} - -### Max height - -Limit the maximum height of the bar row when the gauge is oriented horizontally. - -Automatically show y-axis scrollbar when there's a large amount of data. - -{{% admonition type="note" %}} -This option only applies when bar size is set to manual. -{{% /admonition %}} - -## Legend options +### Legend options {{< docs/shared lookup="visualizations/legend-options-1.md" source="grafana" version="" >}} -## Standard options +### Text size options + +Set the sizes of the following text elements in pixels: + +- **Title** - Bar name +- **Value** - Bar value + +### Standard options {{< docs/shared lookup="visualizations/standard-options.md" source="grafana" version="" >}} -## Data links and actions +### Data links and actions {{< docs/shared lookup="visualizations/datalink-options-1.md" source="grafana" version="" >}} -## Value mappings +### Value mappings {{< docs/shared lookup="visualizations/value-mappings-options.md" source="grafana" version="" >}} -## Thresholds +### Thresholds {{< docs/shared lookup="visualizations/thresholds-options-2.md" source="grafana" version="" >}} -Last, colors of the bar gauge thresholds can be configured as described above. - -![Bar gauge with colored thresholds configured](/media/docs/grafana/panels-visualizations/screenshot-grafana-12.1-bargauge-example6.png) - -## Field overrides +### Field overrides {{< docs/shared lookup="visualizations/overrides-options.md" source="grafana" version="" >}} From 0f6aff20570ad12b3c770777c448137327ba3733 Mon Sep 17 00:00:00 2001 From: Kyle Brandt Date: Tue, 25 Mar 2025 12:19:52 -0400 Subject: [PATCH 029/100] SQL Expressions: allow ParenSelect in queries (#102807) sql_expressions: allow ParenSelect --- pkg/expr/sql/parser_allow.go | 2 +- pkg/expr/sql/parser_allow_test.go | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/expr/sql/parser_allow.go b/pkg/expr/sql/parser_allow.go index f05d410d9ef..0ce68087161 100644 --- a/pkg/expr/sql/parser_allow.go +++ b/pkg/expr/sql/parser_allow.go @@ -96,7 +96,7 @@ func allowedNode(node sqlparser.SQLNode) (b bool) { case *sqlparser.JoinTableExpr, sqlparser.JoinCondition: return - case *sqlparser.Select, sqlparser.SelectExprs: + case *sqlparser.Select, sqlparser.SelectExprs, *sqlparser.ParenSelect: return case *sqlparser.SetOp: diff --git a/pkg/expr/sql/parser_allow_test.go b/pkg/expr/sql/parser_allow_test.go index abb997d73c1..6c529c3f69e 100644 --- a/pkg/expr/sql/parser_allow_test.go +++ b/pkg/expr/sql/parser_allow_test.go @@ -32,6 +32,11 @@ func TestAllowQuery(t *testing.T) { q: example_all_allowed_functions, err: nil, }, + { + name: "paren select allowed", + q: `(SELECT * FROM a_table) UNION ALL (SELECT * FROM a_table2)`, + err: nil, + }, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { From 7c2890384ab820fd7153a4d916b0abb19285efa0 Mon Sep 17 00:00:00 2001 From: Stephanie Hingtgen Date: Tue, 25 Mar 2025 10:32:49 -0600 Subject: [PATCH 030/100] K8s: Dashboards: Set v1alpha1 as priority (#102729) --- pkg/api/dashboard.go | 6 +-- pkg/api/dtos/dashboard.go | 4 +- .../datamigrations/to_unified_storage.go | 2 +- pkg/registry/apis/dashboard/large_test.go | 8 ++-- .../apis/dashboard/legacy/sql_dashboards.go | 2 +- .../dashboard/legacy/sql_dashboards_test.go | 8 ++-- pkg/registry/apis/dashboard/legacy/storage.go | 2 +- .../apis/dashboard/legacy/storage_test.go | 2 +- pkg/registry/apis/dashboard/legacy/types.go | 2 +- .../dashboard/legacysearcher/search_client.go | 2 +- .../legacysearcher/search_client_test.go | 2 +- pkg/registry/apis/dashboard/register.go | 3 +- pkg/registry/apis/dashboard/register_test.go | 24 +++++----- .../apiserver/standalone/runtime_test.go | 4 +- pkg/services/authz/zanzana/common/tuple.go | 2 +- pkg/services/authz/zanzana/translations.go | 2 +- .../dashboards/service/dashboard_service.go | 11 ++--- .../service/dashboard_service_test.go | 24 +++++----- .../dashboardversion/dashverimpl/dashver.go | 4 +- pkg/services/folder/folderimpl/folder.go | 2 +- .../provisioning/dashboards/dashboard.go | 2 +- pkg/storage/legacysql/dualwrite/utils.go | 2 +- pkg/storage/unified/apistore/prepare_test.go | 44 +++++++++---------- pkg/storage/unified/resource/search.go | 6 +-- pkg/storage/unified/search/dashboard.go | 4 +- 25 files changed, 87 insertions(+), 87 deletions(-) diff --git a/pkg/api/dashboard.go b/pkg/api/dashboard.go index 4406b5d8891..90ae9d41ddf 100644 --- a/pkg/api/dashboard.go +++ b/pkg/api/dashboard.go @@ -13,7 +13,7 @@ import ( "strings" claims "github.com/grafana/authlib/types" - dashboardsV0 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1" + dashboardsV1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1alpha1" "github.com/grafana/grafana/pkg/api/apierrors" "github.com/grafana/grafana/pkg/api/dtos" "github.com/grafana/grafana/pkg/api/response" @@ -168,7 +168,7 @@ func (hs *HTTPServer) GetDashboard(c *contextmodel.ReqContext) response.Response creator = hs.getIdentityName(ctx, dash.OrgID, dash.CreatedBy) } - annotationPermissions := &dashboardsV0.AnnotationPermission{} + annotationPermissions := &dashboardsV1.AnnotationPermission{} if hs.Features.IsEnabled(ctx, featuremgmt.FlagAnnotationPermissionUpdate) { hs.getAnnotationPermissionsByScope(c, &annotationPermissions.Dashboard, dashboards.ScopeDashboardsProvider.GetResourceScopeUID(dash.UID)) } else { @@ -276,7 +276,7 @@ func (hs *HTTPServer) GetDashboard(c *contextmodel.ReqContext) response.Response return response.JSON(http.StatusOK, dto) } -func (hs *HTTPServer) getAnnotationPermissionsByScope(c *contextmodel.ReqContext, actions *dashboardsV0.AnnotationActions, scope string) { +func (hs *HTTPServer) getAnnotationPermissionsByScope(c *contextmodel.ReqContext, actions *dashboardsV1.AnnotationActions, scope string) { ctx, span := tracer.Start(c.Req.Context(), "api.getAnnotationPermissionsByScope") defer span.End() c.Req = c.Req.WithContext(ctx) diff --git a/pkg/api/dtos/dashboard.go b/pkg/api/dtos/dashboard.go index 8bda1591b8b..ee0f67b798f 100644 --- a/pkg/api/dtos/dashboard.go +++ b/pkg/api/dtos/dashboard.go @@ -3,7 +3,7 @@ package dtos import ( "time" - dashboardsV0 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1" + dashboardsV1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1alpha1" "github.com/grafana/grafana/pkg/components/simplejson" ) @@ -34,7 +34,7 @@ type DashboardMeta struct { FolderUrl string `json:"folderUrl"` Provisioned bool `json:"provisioned"` ProvisionedExternalId string `json:"provisionedExternalId"` - AnnotationsPermissions *dashboardsV0.AnnotationPermission `json:"annotationsPermissions"` + AnnotationsPermissions *dashboardsV1.AnnotationPermission `json:"annotationsPermissions"` PublicDashboardEnabled bool `json:"publicDashboardEnabled,omitempty"` } diff --git a/pkg/cmd/grafana-cli/commands/datamigrations/to_unified_storage.go b/pkg/cmd/grafana-cli/commands/datamigrations/to_unified_storage.go index faae73c2ba8..a0bdd85d0af 100644 --- a/pkg/cmd/grafana-cli/commands/datamigrations/to_unified_storage.go +++ b/pkg/cmd/grafana-cli/commands/datamigrations/to_unified_storage.go @@ -11,7 +11,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "k8s.io/apimachinery/pkg/runtime/schema" - dashboard "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1" + dashboard "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1alpha1" folders "github.com/grafana/grafana/pkg/apis/folder/v0alpha1" authlib "github.com/grafana/authlib/types" diff --git a/pkg/registry/apis/dashboard/large_test.go b/pkg/registry/apis/dashboard/large_test.go index cd05b704c0c..cfeb2b2da58 100644 --- a/pkg/registry/apis/dashboard/large_test.go +++ b/pkg/registry/apis/dashboard/large_test.go @@ -10,7 +10,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" - dashboardv0alpha1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1" + dashboardv1alpha1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1alpha1" ) func TestLargeDashboardSupport(t *testing.T) { @@ -21,7 +21,7 @@ func TestLargeDashboardSupport(t *testing.T) { f, err := os.ReadFile(devdash) require.NoError(t, err) - dash := &dashboardv0alpha1.Dashboard{ + dash := &dashboardv1alpha1.Dashboard{ ObjectMeta: v1.ObjectMeta{ Name: "test", Namespace: "test", @@ -38,7 +38,7 @@ func TestLargeDashboardSupport(t *testing.T) { scheme := runtime.NewScheme() - err = dashboardv0alpha1.AddToScheme(scheme) + err = dashboardv1alpha1.AddToScheme(scheme) require.NoError(t, err) largeObject := NewDashboardLargeObjectSupport(scheme) @@ -56,7 +56,7 @@ func TestLargeDashboardSupport(t *testing.T) { }`, string(small)) // Now make it big again - rehydratedDash := &dashboardv0alpha1.Dashboard{ + rehydratedDash := &dashboardv1alpha1.Dashboard{ ObjectMeta: v1.ObjectMeta{ Name: "test", Namespace: "test", diff --git a/pkg/registry/apis/dashboard/legacy/sql_dashboards.go b/pkg/registry/apis/dashboard/legacy/sql_dashboards.go index bc9b5a2c4e0..872ba948ab3 100644 --- a/pkg/registry/apis/dashboard/legacy/sql_dashboards.go +++ b/pkg/registry/apis/dashboard/legacy/sql_dashboards.go @@ -15,7 +15,7 @@ import ( claims "github.com/grafana/authlib/types" dashboardOG "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard" - dashboard "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1" + dashboard "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1alpha1" "github.com/grafana/grafana/pkg/apimachinery/apis/common/v0alpha1" "github.com/grafana/grafana/pkg/apimachinery/identity" "github.com/grafana/grafana/pkg/apimachinery/utils" diff --git a/pkg/registry/apis/dashboard/legacy/sql_dashboards_test.go b/pkg/registry/apis/dashboard/legacy/sql_dashboards_test.go index efa4ffde96f..fbb6d8f6b09 100644 --- a/pkg/registry/apis/dashboard/legacy/sql_dashboards_test.go +++ b/pkg/registry/apis/dashboard/legacy/sql_dashboards_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - dashboard "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1" + dashboard "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1alpha1" common "github.com/grafana/grafana/pkg/apimachinery/apis/common/v0alpha1" "github.com/grafana/grafana/pkg/apimachinery/identity" "github.com/grafana/grafana/pkg/apimachinery/utils" @@ -132,7 +132,7 @@ func TestBuildSaveDashboardCommand(t *testing.T) { } dash := &dashboard.Dashboard{ TypeMeta: metav1.TypeMeta{ - APIVersion: "dashboard.grafana.app/v0alpha1", + APIVersion: "dashboard.grafana.app/v1alpha1", }, ObjectMeta: metav1.ObjectMeta{ Name: "test-dash", @@ -170,7 +170,7 @@ func TestBuildSaveDashboardCommand(t *testing.T) { &dashboards.Dashboard{ ID: 1234, Version: 2, - APIVersion: "dashboard.grafana.app/v0alpha1", + APIVersion: "dashboard.grafana.app/v1alpha1", }, nil).Once() cmd, created, err = access.buildSaveDashboardCommand(ctx, 1, dash) require.NoError(t, err) @@ -179,7 +179,7 @@ func TestBuildSaveDashboardCommand(t *testing.T) { require.Equal(t, "test-dash", cmd.Dashboard.Get("uid").MustString()) require.Equal(t, cmd.Dashboard.Get("id").MustInt64(), int64(1234)) // should set to existing ID require.Equal(t, cmd.Dashboard.Get("version").MustFloat64(), float64(2)) // version must be set - otherwise seen as a new dashboard in NewDashboardFromJson - require.Equal(t, cmd.APIVersion, "v0alpha1") // should trim prefix + require.Equal(t, cmd.APIVersion, "v1alpha1") // should trim prefix require.Equal(t, cmd.OrgID, int64(1)) require.True(t, cmd.Overwrite) } diff --git a/pkg/registry/apis/dashboard/legacy/storage.go b/pkg/registry/apis/dashboard/legacy/storage.go index 4e00cd6d803..021ee6796a3 100644 --- a/pkg/registry/apis/dashboard/legacy/storage.go +++ b/pkg/registry/apis/dashboard/legacy/storage.go @@ -9,7 +9,7 @@ import ( claims "github.com/grafana/authlib/types" - dashboard "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1" + dashboard "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1alpha1" "github.com/grafana/grafana/pkg/apimachinery/utils" "github.com/grafana/grafana/pkg/services/dashboards" "github.com/grafana/grafana/pkg/storage/unified/resource" diff --git a/pkg/registry/apis/dashboard/legacy/storage_test.go b/pkg/registry/apis/dashboard/legacy/storage_test.go index cbe204c4015..37de58c5c75 100644 --- a/pkg/registry/apis/dashboard/legacy/storage_test.go +++ b/pkg/registry/apis/dashboard/legacy/storage_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - dashboard "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1" + dashboard "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1alpha1" "github.com/grafana/grafana/pkg/apimachinery/identity" "github.com/grafana/grafana/pkg/apimachinery/utils" "github.com/grafana/grafana/pkg/services/dashboards" diff --git a/pkg/registry/apis/dashboard/legacy/types.go b/pkg/registry/apis/dashboard/legacy/types.go index 3bd8786afd9..3b84c86d90c 100644 --- a/pkg/registry/apis/dashboard/legacy/types.go +++ b/pkg/registry/apis/dashboard/legacy/types.go @@ -3,7 +3,7 @@ package legacy import ( "context" - dashboard "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1" + dashboard "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1alpha1" "github.com/grafana/grafana/pkg/storage/unified/resource" ) diff --git a/pkg/registry/apis/dashboard/legacysearcher/search_client.go b/pkg/registry/apis/dashboard/legacysearcher/search_client.go index be67dcddb9c..c26f1c5c6ca 100644 --- a/pkg/registry/apis/dashboard/legacysearcher/search_client.go +++ b/pkg/registry/apis/dashboard/legacysearcher/search_client.go @@ -11,7 +11,7 @@ import ( "k8s.io/apimachinery/pkg/selection" claims "github.com/grafana/authlib/types" - dashboard "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1" + dashboard "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1alpha1" "github.com/grafana/grafana/pkg/apimachinery/identity" "github.com/grafana/grafana/pkg/apimachinery/utils" folderv0alpha1 "github.com/grafana/grafana/pkg/apis/folder/v0alpha1" diff --git a/pkg/registry/apis/dashboard/legacysearcher/search_client_test.go b/pkg/registry/apis/dashboard/legacysearcher/search_client_test.go index 700fad7a2ce..b7164f94591 100644 --- a/pkg/registry/apis/dashboard/legacysearcher/search_client_test.go +++ b/pkg/registry/apis/dashboard/legacysearcher/search_client_test.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/selection" - dashboard "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1" + dashboard "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1alpha1" "github.com/grafana/grafana/pkg/apimachinery/identity" "github.com/grafana/grafana/pkg/apimachinery/utils" "github.com/grafana/grafana/pkg/services/dashboards" diff --git a/pkg/registry/apis/dashboard/register.go b/pkg/registry/apis/dashboard/register.go index c8a7b6f9f55..e420f9b8e63 100644 --- a/pkg/registry/apis/dashboard/register.go +++ b/pkg/registry/apis/dashboard/register.go @@ -118,10 +118,9 @@ func (b *DashboardsAPIBuilder) GetGroupVersions() []schema.GroupVersion { } } - // TODO (@radiohead): should we switch to v1alpha1 by default? return []schema.GroupVersion{ - v0alpha1.DashboardResourceInfo.GroupVersion(), v1alpha1.DashboardResourceInfo.GroupVersion(), + v0alpha1.DashboardResourceInfo.GroupVersion(), v2alpha1.DashboardResourceInfo.GroupVersion(), } } diff --git a/pkg/registry/apis/dashboard/register_test.go b/pkg/registry/apis/dashboard/register_test.go index e4a0320a902..2bea09b35f9 100644 --- a/pkg/registry/apis/dashboard/register_test.go +++ b/pkg/registry/apis/dashboard/register_test.go @@ -24,7 +24,7 @@ func TestDashboardAPIBuilder_Validate(t *testing.T) { zeroInt64 := int64(0) tests := []struct { name string - inputObj *v0alpha1.Dashboard + inputObj *v1alpha1.Dashboard deletionOptions metav1.DeleteOptions dashboardResponse *dashboards.DashboardProvisioning dashboardErrorResponse error @@ -33,7 +33,7 @@ func TestDashboardAPIBuilder_Validate(t *testing.T) { }{ { name: "should return an error if data is found", - inputObj: &v0alpha1.Dashboard{ + inputObj: &v1alpha1.Dashboard{ Spec: common.Unstructured{}, TypeMeta: metav1.TypeMeta{ Kind: "Dashboard", @@ -52,7 +52,7 @@ func TestDashboardAPIBuilder_Validate(t *testing.T) { }, { name: "should return an error if unable to check", - inputObj: &v0alpha1.Dashboard{ + inputObj: &v1alpha1.Dashboard{ Spec: common.Unstructured{}, TypeMeta: metav1.TypeMeta{ Kind: "Dashboard", @@ -71,7 +71,7 @@ func TestDashboardAPIBuilder_Validate(t *testing.T) { }, { name: "should be okay if error is provisioned dashboard not found", - inputObj: &v0alpha1.Dashboard{ + inputObj: &v1alpha1.Dashboard{ Spec: common.Unstructured{}, TypeMeta: metav1.TypeMeta{ Kind: "Dashboard", @@ -90,7 +90,7 @@ func TestDashboardAPIBuilder_Validate(t *testing.T) { }, { name: "Should still run the check for delete if grace period is not 0", - inputObj: &v0alpha1.Dashboard{ + inputObj: &v1alpha1.Dashboard{ Spec: common.Unstructured{}, TypeMeta: metav1.TypeMeta{ Kind: "Dashboard", @@ -109,7 +109,7 @@ func TestDashboardAPIBuilder_Validate(t *testing.T) { }, { name: "should not run the check for delete if grace period is set to 0", - inputObj: &v0alpha1.Dashboard{ + inputObj: &v1alpha1.Dashboard{ Spec: common.Unstructured{}, TypeMeta: metav1.TypeMeta{ Kind: "Dashboard", @@ -137,10 +137,10 @@ func TestDashboardAPIBuilder_Validate(t *testing.T) { err := b.Validate(context.Background(), admission.NewAttributesRecord( tt.inputObj, nil, - v0alpha1.DashboardResourceInfo.GroupVersionKind(), + v1alpha1.DashboardResourceInfo.GroupVersionKind(), "stacks-123", tt.inputObj.Name, - v0alpha1.DashboardResourceInfo.GroupVersionResource(), + v1alpha1.DashboardResourceInfo.GroupVersionResource(), "", admission.Operation("DELETE"), &tt.deletionOptions, @@ -170,22 +170,22 @@ func TestDashboardAPIBuilder_GetGroupVersions(t *testing.T) { expected []schema.GroupVersion }{ { - name: "should return v0alpha1 by default", + name: "should return v1alpha1 by default", enabledFeatures: []string{}, expected: []schema.GroupVersion{ - v0alpha1.DashboardResourceInfo.GroupVersion(), v1alpha1.DashboardResourceInfo.GroupVersion(), + v0alpha1.DashboardResourceInfo.GroupVersion(), v2alpha1.DashboardResourceInfo.GroupVersion(), }, }, { - name: "should return v0alpha1 as the default if some other feature is enabled", + name: "should return v1alpha1 as the default if some other feature is enabled", enabledFeatures: []string{ featuremgmt.FlagKubernetesDashboards, }, expected: []schema.GroupVersion{ - v0alpha1.DashboardResourceInfo.GroupVersion(), v1alpha1.DashboardResourceInfo.GroupVersion(), + v0alpha1.DashboardResourceInfo.GroupVersion(), v2alpha1.DashboardResourceInfo.GroupVersion(), }, }, diff --git a/pkg/services/apiserver/standalone/runtime_test.go b/pkg/services/apiserver/standalone/runtime_test.go index e07db7b62a6..d5c756031d3 100644 --- a/pkg/services/apiserver/standalone/runtime_test.go +++ b/pkg/services/apiserver/standalone/runtime_test.go @@ -8,11 +8,11 @@ import ( ) func TestReadRuntimeCOnfig(t *testing.T) { - out, err := ReadRuntimeConfig("all/all=true,dashboard.grafana.app/v0alpha1=false") + out, err := ReadRuntimeConfig("all/all=true,dashboard.grafana.app/v1alpha1=false") require.NoError(t, err) require.Equal(t, []RuntimeConfig{ {Group: "all", Version: "all", Enabled: true}, - {Group: "dashboard.grafana.app", Version: "v0alpha1", Enabled: false}, + {Group: "dashboard.grafana.app", Version: "v1alpha1", Enabled: false}, }, out) require.Equal(t, "all/all=true", fmt.Sprintf("%v", out[0])) diff --git a/pkg/services/authz/zanzana/common/tuple.go b/pkg/services/authz/zanzana/common/tuple.go index c1fa549286d..1369487e77a 100644 --- a/pkg/services/authz/zanzana/common/tuple.go +++ b/pkg/services/authz/zanzana/common/tuple.go @@ -6,7 +6,7 @@ import ( openfgav1 "github.com/openfga/api/proto/openfga/v1" "google.golang.org/protobuf/types/known/structpb" - dashboardalpha1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1" + dashboardalpha1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1alpha1" "github.com/grafana/grafana/pkg/apimachinery/utils" authzextv1 "github.com/grafana/grafana/pkg/services/authz/proto/v1" ) diff --git a/pkg/services/authz/zanzana/translations.go b/pkg/services/authz/zanzana/translations.go index 993f48e3c6c..457c75bdd82 100644 --- a/pkg/services/authz/zanzana/translations.go +++ b/pkg/services/authz/zanzana/translations.go @@ -1,7 +1,7 @@ package zanzana import ( - dashboardalpha1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1" + dashboardalpha1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1alpha1" folderalpha1 "github.com/grafana/grafana/pkg/apis/folder/v0alpha1" ) diff --git a/pkg/services/dashboards/service/dashboard_service.go b/pkg/services/dashboards/service/dashboard_service.go index d85dd62405b..77d508b9aac 100644 --- a/pkg/services/dashboards/service/dashboard_service.go +++ b/pkg/services/dashboards/service/dashboard_service.go @@ -25,6 +25,7 @@ import ( "github.com/grafana/grafana-plugin-sdk-go/backend/gtime" "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard" dashboardv0alpha1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1" + dashboardv1alpha1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1alpha1" "github.com/grafana/grafana/pkg/apimachinery/identity" "github.com/grafana/grafana/pkg/apimachinery/utils" folderv0alpha1 "github.com/grafana/grafana/pkg/apis/folder/v0alpha1" @@ -368,7 +369,7 @@ func ProvideDashboardServiceImpl( serverLockService *serverlock.ServerLockService, kvstore kvstore.KVStore, ) (*DashboardServiceImpl, error) { - k8sHandler := client.NewK8sHandler(dual, request.GetNamespaceMapper(cfg), dashboardv0alpha1.DashboardResourceInfo.GroupVersionResource(), restConfigProvider.GetRestConfig, dashboardStore, userService, resourceClient, sorter) + k8sHandler := client.NewK8sHandler(dual, request.GetNamespaceMapper(cfg), dashboardv1alpha1.DashboardResourceInfo.GroupVersionResource(), restConfigProvider.GetRestConfig, dashboardStore, userService, resourceClient, sorter) dashSvc := &DashboardServiceImpl{ cfg: cfg, @@ -2050,13 +2051,13 @@ func (dr *DashboardServiceImpl) searchDashboardsThroughK8sRaw(ctx context.Contex switch query.Type { case "": // When no type specified, search for dashboards - request.Options.Key, err = resource.AsResourceKey(namespace, dashboardv0alpha1.DASHBOARD_RESOURCE) + request.Options.Key, err = resource.AsResourceKey(namespace, dashboardv1alpha1.DASHBOARD_RESOURCE) // Currently a search query is across folders and dashboards if err == nil { federate, err = resource.AsResourceKey(namespace, folderv0alpha1.RESOURCE) } case searchstore.TypeDashboard, searchstore.TypeAnnotation: - request.Options.Key, err = resource.AsResourceKey(namespace, dashboardv0alpha1.DASHBOARD_RESOURCE) + request.Options.Key, err = resource.AsResourceKey(namespace, dashboardv1alpha1.DASHBOARD_RESOURCE) case searchstore.TypeFolder, searchstore.TypeAlertFolder: request.Options.Key, err = resource.AsResourceKey(namespace, folderv0alpha1.RESOURCE) default: @@ -2212,7 +2213,7 @@ func (dr *DashboardServiceImpl) UnstructuredToLegacyDashboard(ctx context.Contex FolderUID: obj.GetFolder(), Version: int(dashVersion), Data: simplejson.NewFromAny(spec), - APIVersion: strings.TrimPrefix(item.GetAPIVersion(), dashboardv0alpha1.GROUP+"/"), + APIVersion: strings.TrimPrefix(item.GetAPIVersion(), dashboardv1alpha1.GROUP+"/"), } out.Created = obj.GetCreationTimestamp().Time @@ -2306,7 +2307,7 @@ func LegacySaveCommandToUnstructured(cmd *dashboards.SaveDashboardCommand, names finalObj.Object["spec"] = obj finalObj.SetName(uid) finalObj.SetNamespace(namespace) - finalObj.SetGroupVersionKind(dashboardv0alpha1.DashboardResourceInfo.GroupVersionKind()) + finalObj.SetGroupVersionKind(dashboardv1alpha1.DashboardResourceInfo.GroupVersionKind()) meta, err := utils.MetaAccessor(finalObj) if err != nil { diff --git a/pkg/services/dashboards/service/dashboard_service_test.go b/pkg/services/dashboards/service/dashboard_service_test.go index 82600d9f2cd..198c1e0b296 100644 --- a/pkg/services/dashboards/service/dashboard_service_test.go +++ b/pkg/services/dashboards/service/dashboard_service_test.go @@ -14,7 +14,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - dashboardv0alpha1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1" + dashboardv1alpha1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1alpha1" "github.com/grafana/grafana/pkg/apimachinery/identity" "github.com/grafana/grafana/pkg/apimachinery/utils" "github.com/grafana/grafana/pkg/components/simplejson" @@ -545,8 +545,8 @@ func TestGetProvisionedDashboardData(t *testing.T) { k8sCliMock.On("GetNamespace", mock.Anything, mock.Anything).Return("default") k8sCliMock.On("Get", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&unstructured.Unstructured{ Object: map[string]interface{}{ - "apiVersion": dashboardv0alpha1.DashboardResourceInfo.GroupVersion().String(), - "kind": dashboardv0alpha1.DashboardResourceInfo.GroupVersionKind().Kind, + "apiVersion": dashboardv1alpha1.DashboardResourceInfo.GroupVersion().String(), + "kind": dashboardv1alpha1.DashboardResourceInfo.GroupVersionKind().Kind, "metadata": map[string]interface{}{ "name": "uid", "labels": map[string]interface{}{ @@ -651,8 +651,8 @@ func TestGetProvisionedDashboardDataByDashboardID(t *testing.T) { provisioningTimestamp := int64(1234567) k8sCliMock.On("GetNamespace", mock.Anything, mock.Anything).Return("default") k8sCliMock.On("Get", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&unstructured.Unstructured{Object: map[string]interface{}{ - "apiVersion": dashboardv0alpha1.DashboardResourceInfo.GroupVersion().String(), - "kind": dashboardv0alpha1.DashboardResourceInfo.GroupVersionKind().Kind, + "apiVersion": dashboardv1alpha1.DashboardResourceInfo.GroupVersion().String(), + "kind": dashboardv1alpha1.DashboardResourceInfo.GroupVersionKind().Kind, "metadata": map[string]interface{}{ "name": "uid", "labels": map[string]interface{}{ @@ -745,8 +745,8 @@ func TestGetProvisionedDashboardDataByDashboardUID(t *testing.T) { provisioningTimestamp := int64(1234567) k8sCliMock.On("GetNamespace", mock.Anything, mock.Anything).Return("default") k8sCliMock.On("Get", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&unstructured.Unstructured{Object: map[string]interface{}{ - "apiVersion": dashboardv0alpha1.DashboardResourceInfo.GroupVersion().String(), - "kind": dashboardv0alpha1.DashboardResourceInfo.GroupVersionKind().Kind, + "apiVersion": dashboardv1alpha1.DashboardResourceInfo.GroupVersion().String(), + "kind": dashboardv1alpha1.DashboardResourceInfo.GroupVersionKind().Kind, "metadata": map[string]interface{}{ "name": "uid", "labels": map[string]interface{}{ @@ -978,8 +978,8 @@ func TestDeleteOrphanedProvisionedDashboards(t *testing.T) { k8sCliMock.On("GetNamespace", mock.Anything, mock.Anything).Return("default") k8sCliMock.On("Get", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&unstructured.Unstructured{ Object: map[string]interface{}{ - "apiVersion": dashboardv0alpha1.DashboardResourceInfo.GroupVersion().String(), - "kind": dashboardv0alpha1.DashboardResourceInfo.GroupVersionKind().Kind, + "apiVersion": dashboardv1alpha1.DashboardResourceInfo.GroupVersion().String(), + "kind": dashboardv1alpha1.DashboardResourceInfo.GroupVersionKind().Kind, "metadata": map[string]interface{}{ "name": "uid", "labels": map[string]interface{}{ @@ -1123,7 +1123,7 @@ func TestUnprovisionDashboard(t *testing.T) { }} k8sCliMock.On("Get", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(dash, nil) dashWithoutAnnotations := &unstructured.Unstructured{Object: map[string]any{ - "apiVersion": "dashboard.grafana.app/v0alpha1", + "apiVersion": "dashboard.grafana.app/v1alpha1", "kind": "Dashboard", "metadata": map[string]any{ "name": "uid", @@ -2628,8 +2628,8 @@ func TestK8sDashboardCleanupJob(t *testing.T) { func createTestUnstructuredDashboard(uid, title string, resourceVersion string) unstructured.Unstructured { return unstructured.Unstructured{ Object: map[string]interface{}{ - "apiVersion": dashboardv0alpha1.DashboardResourceInfo.GroupVersion().String(), - "kind": dashboardv0alpha1.DashboardResourceInfo.GroupVersionKind().Kind, + "apiVersion": dashboardv1alpha1.DashboardResourceInfo.GroupVersion().String(), + "kind": dashboardv1alpha1.DashboardResourceInfo.GroupVersionKind().Kind, "metadata": map[string]interface{}{ "name": uid, "deletionTimestamp": "2023-01-01T00:00:00Z", diff --git a/pkg/services/dashboardversion/dashverimpl/dashver.go b/pkg/services/dashboardversion/dashverimpl/dashver.go index c054154a72d..58c2d4f71df 100644 --- a/pkg/services/dashboardversion/dashverimpl/dashver.go +++ b/pkg/services/dashboardversion/dashverimpl/dashver.go @@ -11,7 +11,7 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1" + "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1alpha1" "github.com/grafana/grafana/pkg/apimachinery/utils" "github.com/grafana/grafana/pkg/components/simplejson" "github.com/grafana/grafana/pkg/infra/db" @@ -55,7 +55,7 @@ func ProvideService(cfg *setting.Cfg, db db.DB, dashboardService dashboards.Dash k8sclient: client.NewK8sHandler( dual, request.GetNamespaceMapper(cfg), - v0alpha1.DashboardResourceInfo.GroupVersionResource(), + v1alpha1.DashboardResourceInfo.GroupVersionResource(), restConfigProvider.GetRestConfig, dashboardStore, userService, diff --git a/pkg/services/folder/folderimpl/folder.go b/pkg/services/folder/folderimpl/folder.go index f0e931397ed..3e80157a0cc 100644 --- a/pkg/services/folder/folderimpl/folder.go +++ b/pkg/services/folder/folderimpl/folder.go @@ -18,7 +18,7 @@ import ( "github.com/grafana/dskit/concurrency" - dashboardalpha1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1" + dashboardalpha1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1alpha1" "github.com/grafana/grafana/pkg/apimachinery/identity" "github.com/grafana/grafana/pkg/apis/folder/v0alpha1" "github.com/grafana/grafana/pkg/bus" diff --git a/pkg/services/provisioning/dashboards/dashboard.go b/pkg/services/provisioning/dashboards/dashboard.go index 11bb29d169b..0c7d92d6915 100644 --- a/pkg/services/provisioning/dashboards/dashboard.go +++ b/pkg/services/provisioning/dashboards/dashboard.go @@ -6,7 +6,7 @@ import ( "os" "time" - dashboard "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1" + dashboard "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1alpha1" "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/services/dashboards" "github.com/grafana/grafana/pkg/services/folder" diff --git a/pkg/storage/legacysql/dualwrite/utils.go b/pkg/storage/legacysql/dualwrite/utils.go index 971f0677561..c45670ee09e 100644 --- a/pkg/storage/legacysql/dualwrite/utils.go +++ b/pkg/storage/legacysql/dualwrite/utils.go @@ -4,7 +4,7 @@ import ( "golang.org/x/net/context" "k8s.io/apimachinery/pkg/runtime/schema" - dashboard "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1" + dashboard "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1alpha1" folders "github.com/grafana/grafana/pkg/apis/folder/v0alpha1" ) diff --git a/pkg/storage/unified/apistore/prepare_test.go b/pkg/storage/unified/apistore/prepare_test.go index 1c17a9806c2..ef5d1b6c3e3 100644 --- a/pkg/storage/unified/apistore/prepare_test.go +++ b/pkg/storage/unified/apistore/prepare_test.go @@ -16,7 +16,7 @@ import ( "k8s.io/apiserver/pkg/storage" authtypes "github.com/grafana/authlib/types" - "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1" + "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1alpha1" "github.com/grafana/grafana/pkg/apimachinery/identity" "github.com/grafana/grafana/pkg/apimachinery/utils" ) @@ -25,11 +25,11 @@ var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) func TestPrepareObjectForStorage(t *testing.T) { - _ = v0alpha1.AddToScheme(scheme) + _ = v1alpha1.AddToScheme(scheme) node, err := snowflake.NewNode(rand.Int63n(1024)) require.NoError(t, err) s := &Storage{ - codec: apitesting.TestCodec(codecs, v0alpha1.DashboardResourceInfo.GroupVersion()), + codec: apitesting.TestCodec(codecs, v1alpha1.DashboardResourceInfo.GroupVersion()), snowflake: node, opts: StorageOptions{ EnableFolderSupport: true, @@ -48,14 +48,14 @@ func TestPrepareObjectForStorage(t *testing.T) { }) t.Run("Error on missing name", func(t *testing.T) { - dashboard := v0alpha1.Dashboard{} + dashboard := v1alpha1.Dashboard{} _, err := s.prepareObjectForStorage(ctx, dashboard.DeepCopyObject()) require.Error(t, err) require.Contains(t, err.Error(), "missing name") }) t.Run("Error on non-empty resource version", func(t *testing.T) { - dashboard := v0alpha1.Dashboard{} + dashboard := v1alpha1.Dashboard{} dashboard.Name = "test-name" dashboard.ResourceVersion = "123" _, err := s.prepareObjectForStorage(ctx, dashboard.DeepCopyObject()) @@ -64,13 +64,13 @@ func TestPrepareObjectForStorage(t *testing.T) { }) t.Run("Generate UID and leave deprecated ID empty, if not required", func(t *testing.T) { - dashboard := v0alpha1.Dashboard{} + dashboard := v1alpha1.Dashboard{} dashboard.Name = "test-name" encodedData, err := s.prepareObjectForStorage(ctx, dashboard.DeepCopyObject()) require.NoError(t, err) - newObject, _, err := s.codec.Decode(encodedData, nil, &v0alpha1.Dashboard{}) + newObject, _, err := s.codec.Decode(encodedData, nil, &v1alpha1.Dashboard{}) require.NoError(t, err) obj, err := utils.MetaAccessor(newObject) require.NoError(t, err) @@ -87,7 +87,7 @@ func TestPrepareObjectForStorage(t *testing.T) { }) t.Run("Should keep manager info", func(t *testing.T) { - dashboard := v0alpha1.Dashboard{} + dashboard := v1alpha1.Dashboard{} dashboard.Name = "test-name" obj := dashboard.DeepCopyObject() meta, err := utils.MetaAccessor(obj) @@ -106,7 +106,7 @@ func TestPrepareObjectForStorage(t *testing.T) { encodedData, err := s.prepareObjectForStorage(ctx, obj) require.NoError(t, err) - newObject, _, err := s.codec.Decode(encodedData, nil, &v0alpha1.Dashboard{}) + newObject, _, err := s.codec.Decode(encodedData, nil, &v1alpha1.Dashboard{}) require.NoError(t, err) meta, err = utils.MetaAccessor(newObject) require.NoError(t, err) @@ -123,7 +123,7 @@ func TestPrepareObjectForStorage(t *testing.T) { }) t.Run("Update should manage incrementing generation and metadata", func(t *testing.T) { - dashboard := v0alpha1.Dashboard{} + dashboard := v1alpha1.Dashboard{} dashboard.Name = "test-name" obj := dashboard.DeepCopyObject() meta, err := utils.MetaAccessor(obj) @@ -133,7 +133,7 @@ func TestPrepareObjectForStorage(t *testing.T) { encodedData, err := s.prepareObjectForStorage(ctx, obj) require.NoError(t, err) - insertedObject, _, err := s.codec.Decode(encodedData, nil, &v0alpha1.Dashboard{}) + insertedObject, _, err := s.codec.Decode(encodedData, nil, &v1alpha1.Dashboard{}) require.NoError(t, err) meta, err = utils.MetaAccessor(insertedObject) require.NoError(t, err) @@ -153,8 +153,8 @@ func TestPrepareObjectForStorage(t *testing.T) { updatedObject := insertedObject.DeepCopyObject() meta, err = utils.MetaAccessor(updatedObject) require.NoError(t, err) - err = meta.SetStatus(v0alpha1.DashboardStatus{ - Conversion: &v0alpha1.DashboardConversionStatus{ + err = meta.SetStatus(v1alpha1.DashboardStatus{ + Conversion: &v1alpha1.DashboardConversionStatus{ Failed: true, Error: "test", }, @@ -169,7 +169,7 @@ func TestPrepareObjectForStorage(t *testing.T) { require.Equal(t, int64(1), meta.GetGeneration()) // Change the folder -- the generation should increase and the updatedBy metadata - dashboard2 := &v0alpha1.Dashboard{ObjectMeta: v1.ObjectMeta{ + dashboard2 := &v1alpha1.Dashboard{ObjectMeta: v1.ObjectMeta{ Name: dashboard.Name, }} // TODO... deep copy, See: https://github.com/grafana/grafana/pull/102258 meta2, err := utils.MetaAccessor(dashboard2) @@ -183,12 +183,12 @@ func TestPrepareObjectForStorage(t *testing.T) { s.opts.RequireDeprecatedInternalID = true t.Run("Should generate internal id", func(t *testing.T) { - dashboard := v0alpha1.Dashboard{} + dashboard := v1alpha1.Dashboard{} dashboard.Name = "test-name" encodedData, err := s.prepareObjectForStorage(ctx, dashboard.DeepCopyObject()) require.NoError(t, err) - newObject, _, err := s.codec.Decode(encodedData, nil, &v0alpha1.Dashboard{}) + newObject, _, err := s.codec.Decode(encodedData, nil, &v1alpha1.Dashboard{}) require.NoError(t, err) obj, err := utils.MetaAccessor(newObject) require.NoError(t, err) @@ -198,7 +198,7 @@ func TestPrepareObjectForStorage(t *testing.T) { }) t.Run("Should use deprecated ID if given it", func(t *testing.T) { - dashboard := v0alpha1.Dashboard{} + dashboard := v1alpha1.Dashboard{} dashboard.Name = "test-name" obj := dashboard.DeepCopyObject() meta, err := utils.MetaAccessor(obj) @@ -207,7 +207,7 @@ func TestPrepareObjectForStorage(t *testing.T) { encodedData, err := s.prepareObjectForStorage(ctx, obj) require.NoError(t, err) - newObject, _, err := s.codec.Decode(encodedData, nil, &v0alpha1.Dashboard{}) + newObject, _, err := s.codec.Decode(encodedData, nil, &v1alpha1.Dashboard{}) require.NoError(t, err) meta, err = utils.MetaAccessor(newObject) require.NoError(t, err) @@ -215,11 +215,11 @@ func TestPrepareObjectForStorage(t *testing.T) { }) t.Run("calculate generation", func(t *testing.T) { - dash := &v0alpha1.Dashboard{ + dash := &v1alpha1.Dashboard{ ObjectMeta: v1.ObjectMeta{ Name: "test", }, - Spec: v0alpha1.DashboardSpec{ + Spec: v1alpha1.DashboardSpec{ Object: map[string]interface{}{ "hello": "world", }, @@ -265,8 +265,8 @@ func TestPrepareObjectForStorage(t *testing.T) { b.Labels = map[string]string{ "a": "b", } - b.Status = v0alpha1.DashboardStatus{ - Conversion: &v0alpha1.DashboardConversionStatus{ + b.Status = v1alpha1.DashboardStatus{ + Conversion: &v1alpha1.DashboardConversionStatus{ Failed: true, }, } diff --git a/pkg/storage/unified/resource/search.go b/pkg/storage/unified/resource/search.go index 196b33e2492..921b09047c4 100644 --- a/pkg/storage/unified/resource/search.go +++ b/pkg/storage/unified/resource/search.go @@ -16,7 +16,7 @@ import ( "golang.org/x/sync/errgroup" "k8s.io/apimachinery/pkg/runtime/schema" - dashboardv0alpha1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1" + dashboardv1alpha1 "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1alpha1" folderv0alpha1 "github.com/grafana/grafana/pkg/apis/folder/v0alpha1" "github.com/grafana/authlib/types" @@ -689,8 +689,8 @@ func AsResourceKey(ns string, t string) (*ResourceKey, error) { case "dashboards", "dashboard": return &ResourceKey{ Namespace: ns, - Group: dashboardv0alpha1.GROUP, - Resource: dashboardv0alpha1.DASHBOARD_RESOURCE, + Group: dashboardv1alpha1.GROUP, + Resource: dashboardv1alpha1.DASHBOARD_RESOURCE, }, nil // NOT really supported in the dashboard search UI, but useful for manual testing diff --git a/pkg/storage/unified/search/dashboard.go b/pkg/storage/unified/search/dashboard.go index 65655661fce..62b8125726c 100644 --- a/pkg/storage/unified/search/dashboard.go +++ b/pkg/storage/unified/search/dashboard.go @@ -8,7 +8,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1" + "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v1alpha1" "github.com/grafana/grafana/pkg/apimachinery/utils" "github.com/grafana/grafana/pkg/services/store/kind/dashboard" "github.com/grafana/grafana/pkg/storage/unified/resource" @@ -208,7 +208,7 @@ func DashboardBuilder(namespaced resource.NamespacedDocumentSupplier) (resource. } } return resource.DocumentBuilderInfo{ - GroupResource: v0alpha1.DashboardResourceInfo.GroupResource(), + GroupResource: v1alpha1.DashboardResourceInfo.GroupResource(), Fields: fields, Namespaced: namespaced, }, err From 4dccc03fa2d8ecb563c92c5102834c6be3910320 Mon Sep 17 00:00:00 2001 From: Jacob Valdez Date: Tue, 25 Mar 2025 13:37:26 -0500 Subject: [PATCH 031/100] Docs: updating admonition shortcodes in plugin management (#102817) --- .../administration/plugin-management/index.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/sources/administration/plugin-management/index.md b/docs/sources/administration/plugin-management/index.md index 1f43832b69b..bdd619f8ef3 100644 --- a/docs/sources/administration/plugin-management/index.md +++ b/docs/sources/administration/plugin-management/index.md @@ -60,9 +60,9 @@ Customize access to app plugins with [RBAC](../roles-and-permissions/access-cont By default, the Viewer, Editor and Admin roles have access to all app plugins that their Organization role allows them to access. Access is granted by the `fixed:plugins.app:reader` role. -{{% admonition type="note" %}} +{{< admonition type="note" >}} To prevent users from seeing an app plugin, refer to [these permissions scenarios](../roles-and-permissions/access-control/plan-rbac-rollout-strategy/#prevent-viewers-from-accessing-an-app-plugin). -{{% /admonition %}} +{{< /admonition >}} ## Plugin catalog @@ -74,9 +74,9 @@ The following access rules apply depending on the user role: - If you are a **Server Admin**, you can't configure app plugins, but you can install, uninstall, or update them. - If you are both **Org Admin** and **Server Admin**, you can configure app plugins and also install, uninstall, or update them. -{{% admonition type="note" %}} +{{< admonition type="note" >}} The Grafana plugin catalog is designed to work with a single Grafana server instance only. Support for Grafana clusters is planned for future Grafana releases. -{{% /admonition %}} +{{< /admonition >}}
    - Condition + Condition Display textColorIcon + Display text + + Color + + Icon +
    - - + + diff --git a/public/app/features/invites/SignupInvited.tsx b/public/app/features/invites/SignupInvited.tsx index f9e5027e482..7290e201460 100644 --- a/public/app/features/invites/SignupInvited.tsx +++ b/public/app/features/invites/SignupInvited.tsx @@ -9,6 +9,7 @@ import { Button, Field, Input, useStyles2 } from '@grafana/ui'; import { Form } from 'app/core/components/Form/Form'; import { Page } from 'app/core/components/Page/Page'; import { getConfig } from 'app/core/config'; +import { t, Trans } from 'app/core/internationalization'; import { w3cStandardEmailValidator } from '../admin/utils'; @@ -76,8 +77,13 @@ export const SignupInvitedPage = () => {
    {({ register, errors }) => ( <> - + { })} /> - - + + - - + + - + - + )} diff --git a/public/app/features/live/LiveConnectionWarning.tsx b/public/app/features/live/LiveConnectionWarning.tsx index fcc9f4f7511..bd03a990f55 100644 --- a/public/app/features/live/LiveConnectionWarning.tsx +++ b/public/app/features/live/LiveConnectionWarning.tsx @@ -5,6 +5,7 @@ import { Unsubscribable } from 'rxjs'; import { GrafanaTheme2, OrgRole } from '@grafana/data'; import { config, getGrafanaLiveSrv } from '@grafana/runtime'; import { Alert, stylesFactory } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; import { contextSrv } from 'app/core/services/context_srv'; export interface Props {} @@ -52,7 +53,14 @@ export class LiveConnectionWarning extends PureComponent { return (
    - +
    ); } diff --git a/public/app/features/live/dashboard/DashboardChangedModal.tsx b/public/app/features/live/dashboard/DashboardChangedModal.tsx index 9be8bb1af63..3689efe482d 100644 --- a/public/app/features/live/dashboard/DashboardChangedModal.tsx +++ b/public/app/features/live/dashboard/DashboardChangedModal.tsx @@ -3,6 +3,7 @@ import { css } from '@emotion/css'; import { GrafanaTheme2 } from '@grafana/data'; import { locationService } from '@grafana/runtime'; import { Button, Modal, useStyles2 } from '@grafana/ui'; +import { t, Trans } from 'app/core/internationalization'; import { dashboardWatcher } from './dashboardWatcher'; import { DashboardEvent, DashboardEventAction } from './types'; @@ -28,7 +29,7 @@ export function DashboardChangedModal({ onDismiss, event }: Props) { return ( {}} @@ -40,10 +41,10 @@ export function DashboardChangedModal({ onDismiss, event }: Props) { diff --git a/public/app/features/logs/components/InfiniteScroll.tsx b/public/app/features/logs/components/InfiniteScroll.tsx index d75327e0a2e..e31eea0b149 100644 --- a/public/app/features/logs/components/InfiniteScroll.tsx +++ b/public/app/features/logs/components/InfiniteScroll.tsx @@ -211,7 +211,7 @@ const styles = { const outOfRangeMessage = (
    - End of the selected time range. + End of the selected time range.
    ); diff --git a/public/app/features/logs/components/LogDetails.tsx b/public/app/features/logs/components/LogDetails.tsx index 807320d5829..a2582b184be 100644 --- a/public/app/features/logs/components/LogDetails.tsx +++ b/public/app/features/logs/components/LogDetails.tsx @@ -3,7 +3,7 @@ import { PureComponent } from 'react'; import { CoreApp, DataFrame, DataFrameType, Field, LinkModel, LogRowModel } from '@grafana/data'; import { PopoverContent, Themeable2, withTheme2 } from '@grafana/ui'; -import { Trans } from 'app/core/internationalization'; +import { Trans, t } from 'app/core/internationalization'; import { calculateLogsLabelStats, calculateStats } from '../utils'; @@ -83,7 +83,7 @@ class UnThemedLogDetails extends PureComponent { return (
    {showDuplicates &&
    EmailName + Email + + Name +
    } - +
    @@ -91,7 +91,11 @@ class UnThemedLogDetails extends PureComponent { {displayedFields && displayedFields.length > 0 && ( <> - @@ -108,7 +112,11 @@ class UnThemedLogDetails extends PureComponent { )} {(labelsAvailable || fieldsAvailable) && ( - @@ -161,7 +169,11 @@ class UnThemedLogDetails extends PureComponent { {fieldsWithLinksAvailable && ( - @@ -211,7 +223,7 @@ class UnThemedLogDetails extends PureComponent { {!fieldsAvailable && !labelsAvailable && !fieldsWithLinksAvailable && ( - diff --git a/public/app/features/logs/components/LogDetailsBody.tsx b/public/app/features/logs/components/LogDetailsBody.tsx index 0cc844e246d..19a69bf7d90 100644 --- a/public/app/features/logs/components/LogDetailsBody.tsx +++ b/public/app/features/logs/components/LogDetailsBody.tsx @@ -4,6 +4,7 @@ import memoizeOne from 'memoize-one'; import { CoreApp, GrafanaTheme2, LogRowModel } from '@grafana/data'; import { reportInteraction } from '@grafana/runtime'; import { IconButton, Themeable2 } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; import { getLogRowStyles } from './getLogRowStyles'; @@ -65,9 +66,18 @@ export const LogDetailsBody = (props: Props) => { const toggleFieldButton = displayedFields != null && displayedFields.includes(LOG_LINE_BODY_FIELD_NAME) ? ( - + ) : ( - + ); return ( diff --git a/public/app/features/logs/components/LogDetailsRow.tsx b/public/app/features/logs/components/LogDetailsRow.tsx index 39a7795483e..9e4b39a4202 100644 --- a/public/app/features/logs/components/LogDetailsRow.tsx +++ b/public/app/features/logs/components/LogDetailsRow.tsx @@ -24,6 +24,7 @@ import { Tooltip, withTheme2, } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; import { logRowToSingleRowDataFrame } from '../logsModel'; import { getLabelTypeFromRow } from '../utils'; @@ -244,7 +245,7 @@ class UnThemedLogDetailsRow extends PureComponent {
    val} - title="Copy value to clipboard" + title={t('logs.un-themed-log-details-row.title-copy-value-to-clipboard', 'Copy value to clipboard')} fill="text" variant="secondary" icon="copy" @@ -304,9 +305,21 @@ class UnThemedLogDetailsRow extends PureComponent { const toggleFieldButton = displayedFields && parsedKeys != null && displayedFields.includes(parsedKeys[0]) ? ( - + ) : ( - + ); return ( @@ -335,7 +348,7 @@ class UnThemedLogDetailsRow extends PureComponent { { diff --git a/public/app/features/logs/components/LogRowMenuCell.tsx b/public/app/features/logs/components/LogRowMenuCell.tsx index 7a5527b7032..7e3e45372ba 100644 --- a/public/app/features/logs/components/LogRowMenuCell.tsx +++ b/public/app/features/logs/components/LogRowMenuCell.tsx @@ -13,6 +13,7 @@ import { import { LogRowContextOptions, LogRowModel } from '@grafana/data'; import { DataQuery } from '@grafana/schema'; import { ClipboardButton, IconButton, PopoverContent } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; import { handleOpenLogsContextClick } from '../utils'; @@ -110,9 +111,9 @@ export const LogRowMenuCell = memo( size="md" name="gf-pin" onClick={() => onUnpinLine && onUnpinLine(row)} - tooltip="Unpin line" + tooltip={t('logs.log-row-menu-cell.tooltip-unpin-line', 'Unpin line')} tooltipPlacement="top" - aria-label="Unpin line" + aria-label={t('logs.log-row-menu-cell.aria-label-unpin-line', 'Unpin line')} tabIndex={0} /> )} @@ -124,9 +125,9 @@ export const LogRowMenuCell = memo( size="md" name="gf-show-context" onClick={onShowContextClick} - tooltip="Show context" + tooltip={t('logs.log-row-menu-cell.tooltip-show-context', 'Show context')} tooltipPlacement="top" - aria-label="Show context" + aria-label={t('logs.log-row-menu-cell.aria-label-show-context', 'Show context')} tabIndex={0} /> )} @@ -137,7 +138,7 @@ export const LogRowMenuCell = memo( fill="text" size="md" getText={getLogText} - tooltip="Copy to clipboard" + tooltip={t('logs.log-row-menu-cell.tooltip-copy-to-clipboard', 'Copy to clipboard')} tooltipPlacement="top" tabIndex={0} /> @@ -147,9 +148,9 @@ export const LogRowMenuCell = memo( size="md" name="gf-pin" onClick={() => onUnpinLine && onUnpinLine(row)} - tooltip="Unpin line" + tooltip={t('logs.log-row-menu-cell.tooltip-unpin-line', 'Unpin line')} tooltipPlacement="top" - aria-label="Unpin line" + aria-label={t('logs.log-row-menu-cell.aria-label-unpin-line', 'Unpin line')} tabIndex={0} /> )} @@ -161,14 +162,14 @@ export const LogRowMenuCell = memo( onClick={() => onPinLine && onPinLine(row)} tooltip={pinLineButtonTooltipTitle ?? 'Pin line'} tooltipPlacement="top" - aria-label="Pin line" + aria-label={t('logs.log-row-menu-cell.aria-label-pin-line', 'Pin line')} tabIndex={0} /> )} {onPermalinkClick && row.rowId !== undefined && row.uid && ( { return (
    - +
    ); diff --git a/public/app/features/logs/components/log-context/LogRowContextModal.tsx b/public/app/features/logs/components/log-context/LogRowContextModal.tsx index 60cb0d6a092..6e62f0e5bea 100644 --- a/public/app/features/logs/components/log-context/LogRowContextModal.tsx +++ b/public/app/features/logs/components/log-context/LogRowContextModal.tsx @@ -20,6 +20,7 @@ import { import { config, reportInteraction } from '@grafana/runtime'; import { DataQuery, TimeZone } from '@grafana/schema'; import { Button, Modal, useTheme2 } from '@grafana/ui'; +import { t, Trans } from 'app/core/internationalization'; import store from 'app/core/store'; import { SETTINGS_KEYS } from 'app/features/explore/Logs/utils/logs'; import { splitOpen } from 'app/features/explore/state/main'; @@ -495,7 +496,7 @@ export const LogRowContextModal: React.FunctionComponent
    )} - {loadingStateAbove === LoadingState.Error &&
    Error loading log more logs.
    } - {loadingStateAbove === LoadingState.Done &&
    No more logs available.
    } + {loadingStateAbove === LoadingState.Error && ( +
    + + Error loading more logs. + +
    + )} + {loadingStateAbove === LoadingState.Done && ( +
    + No more logs available. +
    + )}
    @@ -594,8 +605,18 @@ export const LogRowContextModal: React.FunctionComponent )} - {loadingStateBelow === LoadingState.Error &&
    Error loading log more logs.
    } - {loadingStateBelow === LoadingState.Done &&
    No more logs available.
    } + {loadingStateBelow === LoadingState.Error && ( +
    + + Error loading more logs. + +
    + )} + {loadingStateBelow === LoadingState.Done && ( +
    + No more logs available. +
    + )}
    @@ -632,7 +653,7 @@ export const LogRowContextModal: React.FunctionComponent - Open in split view + Open in split view )} diff --git a/public/app/features/manage-dashboards/DashboardImportPage.tsx b/public/app/features/manage-dashboards/DashboardImportPage.tsx index fa5a4285804..bfebb0cec81 100644 --- a/public/app/features/manage-dashboards/DashboardImportPage.tsx +++ b/public/app/features/manage-dashboards/DashboardImportPage.tsx @@ -127,6 +127,7 @@ class UnthemedDashboardImport extends PureComponent { const styles = importStyles(this.props.theme); const GcomDashboardsLink = () => ( + // eslint-disable-next-line @grafana/no-untranslated-strings grafana.com/dashboards diff --git a/public/app/features/manage-dashboards/components/ImportDashboardForm.tsx b/public/app/features/manage-dashboards/components/ImportDashboardForm.tsx index 975bc755543..643e4860175 100644 --- a/public/app/features/manage-dashboards/components/ImportDashboardForm.tsx +++ b/public/app/features/manage-dashboards/components/ImportDashboardForm.tsx @@ -5,6 +5,7 @@ import { selectors } from '@grafana/e2e-selectors'; import { ExpressionDatasourceRef } from '@grafana/runtime/internal'; import { Button, Field, FormFieldErrors, FormsOnSubmit, Stack, Input, Legend } from '@grafana/ui'; import { FolderPicker } from 'app/core/components/Select/FolderPicker'; +import { Trans, t } from 'app/core/internationalization'; import { DataSourcePicker } from 'app/features/datasources/components/picker/DataSourcePicker'; import { @@ -57,8 +58,14 @@ export const ImportDashboardForm = ({ return ( <> - Options - + + Options + + - + ( onChange({ uid, title })} value={value.uid} /> @@ -78,7 +85,7 @@ export const ImportDashboardForm = ({ /> await validateUid(v) })} - addonAfter={!uidReset && } + addonAfter={ + !uidReset && ( + + ) + } /> ) : ( await validateUid(v) })} /> @@ -145,13 +158,16 @@ export const ImportDashboardForm = ({ })} @@ -167,7 +183,7 @@ export const ImportDashboardForm = ({ {getButtonText(errors)} diff --git a/public/app/features/manage-dashboards/components/ImportDashboardOverview.tsx b/public/app/features/manage-dashboards/components/ImportDashboardOverview.tsx index f00e1c4ce55..1bb3c08025a 100644 --- a/public/app/features/manage-dashboards/components/ImportDashboardOverview.tsx +++ b/public/app/features/manage-dashboards/components/ImportDashboardOverview.tsx @@ -5,6 +5,7 @@ import { dateTimeFormat } from '@grafana/data'; import { locationService, reportInteraction } from '@grafana/runtime'; import { Box, Legend } from '@grafana/ui'; import { Form } from 'app/core/components/Form/Form'; +import { Trans } from 'app/core/internationalization'; import { StoreState } from 'app/types'; import { clearLoadedDashboard, importDashboard } from '../state/actions'; @@ -82,11 +83,19 @@ class ImportDashboardOverviewUnConnected extends PureComponent {
    + Log line
    + Fields
    + Links
    + No details available
    - + - + diff --git a/public/app/features/manage-dashboards/components/SnapshotListTable.tsx b/public/app/features/manage-dashboards/components/SnapshotListTable.tsx index 10554a440f0..5485357cffd 100644 --- a/public/app/features/manage-dashboards/components/SnapshotListTable.tsx +++ b/public/app/features/manage-dashboards/components/SnapshotListTable.tsx @@ -103,7 +103,7 @@ export const SnapshotListTable = () => { setRemoveSnapshot(undefined)} diff --git a/public/app/features/migrate-to-cloud/onprem/NameCell.tsx b/public/app/features/migrate-to-cloud/onprem/NameCell.tsx index d0ec49a770b..8858c2f611c 100644 --- a/public/app/features/migrate-to-cloud/onprem/NameCell.tsx +++ b/public/app/features/migrate-to-cloud/onprem/NameCell.tsx @@ -126,7 +126,9 @@ function FolderInfo({ data }: { data: ResourceTableItem }) { if (isError) { return ( <> - Unable to load folder + + Unable to load folder + Folder {data.refId} ); diff --git a/public/app/features/notifications/StoredNotifications.tsx b/public/app/features/notifications/StoredNotifications.tsx index be0e504a3bf..95d08fe16bc 100644 --- a/public/app/features/notifications/StoredNotifications.tsx +++ b/public/app/features/notifications/StoredNotifications.tsx @@ -75,7 +75,7 @@ export function StoredNotifications() { onChange={(event: React.ChangeEvent) => handleAllCheckboxToggle(event.target.checked)} />
      diff --git a/public/app/features/panel/components/PanelDataErrorView.tsx b/public/app/features/panel/components/PanelDataErrorView.tsx index c8aed627344..03af23156b8 100644 --- a/public/app/features/panel/components/PanelDataErrorView.tsx +++ b/public/app/features/panel/components/PanelDataErrorView.tsx @@ -12,6 +12,7 @@ import { PanelDataErrorViewProps, locationService } from '@grafana/runtime'; import { usePanelContext, useStyles2 } from '@grafana/ui'; import { CardButton } from 'app/core/components/CardButton'; import { LS_VISUALIZATION_SELECT_TAB_KEY } from 'app/core/constants'; +import { Trans } from 'app/core/internationalization'; import store from 'app/core/store'; import { toggleVizPicker } from 'app/features/dashboard/components/PanelEditor/state/reducers'; import { VisualizationSelectPaneTab } from 'app/features/dashboard/components/PanelEditor/types'; @@ -81,10 +82,12 @@ export function PanelDataErrorView(props: PanelDataErrorViewProps) { )} - Switch to table + Switch to table - Open visualization suggestions + + Open visualization suggestions + )} diff --git a/public/app/features/panel/components/PanelRenderer.tsx b/public/app/features/panel/components/PanelRenderer.tsx index bfffdd6ecfb..5c7c52ba771 100644 --- a/public/app/features/panel/components/PanelRenderer.tsx +++ b/public/app/features/panel/components/PanelRenderer.tsx @@ -12,6 +12,7 @@ import { import { getTemplateSrv, PanelRendererProps } from '@grafana/runtime'; import { ErrorBoundaryAlert, usePanelContext, useTheme2 } from '@grafana/ui'; import { appEvents } from 'app/core/core'; +import { Trans } from 'app/core/internationalization'; import { importPanelPlugin, syncGetPanelPlugin } from '../../plugins/importPanelPlugin'; @@ -68,7 +69,11 @@ export function PanelRenderer

      (prop } if (!plugin || !plugin.hasPluginId(pluginId)) { - return

      Loading plugin panel...
      ; + return ( +
      + Loading plugin panel... +
      + ); } if (!plugin.panel) { @@ -76,7 +81,11 @@ export function PanelRenderer

      (prop } if (!dataWithOverrides) { - return

      No panel data
      ; + return ( +
      + No panel data +
      + ); } const PanelComponent = plugin.panel; diff --git a/public/app/features/panel/components/VizTypePicker/PanelTypeCard.tsx b/public/app/features/panel/components/VizTypePicker/PanelTypeCard.tsx index a3ab2e950ed..d071937140b 100644 --- a/public/app/features/panel/components/VizTypePicker/PanelTypeCard.tsx +++ b/public/app/features/panel/components/VizTypePicker/PanelTypeCard.tsx @@ -7,6 +7,7 @@ import { GrafanaTheme2, isUnsignedPluginSignature, PanelPluginMeta, PluginState import { selectors } from '@grafana/e2e-selectors'; import { IconButton, PluginSignatureBadge, useStyles2 } from '@grafana/ui'; import { SkeletonComponent, attachSkeleton } from '@grafana/ui/unstable'; +import { t } from 'app/core/internationalization'; import { PluginStateInfo } from 'app/features/plugins/components/PluginStateInfo'; interface Props { @@ -71,8 +72,11 @@ const PanelTypeCardComponent = ({ onDelete(); }} className={styles.deleteButton} - aria-label="Delete button on panel type card" - tooltip="Delete" + aria-label={t( + 'panel.panel-type-card.aria-label-delete-button-on-panel-type-card', + 'Delete button on panel type card' + )} + tooltip={t('panel.panel-type-card.tooltip-delete', 'Delete')} /> )} diff --git a/public/app/features/panel/components/VizTypePicker/VisualizationSuggestions.tsx b/public/app/features/panel/components/VizTypePicker/VisualizationSuggestions.tsx index 212e97d24c8..7a9628e807f 100644 --- a/public/app/features/panel/components/VizTypePicker/VisualizationSuggestions.tsx +++ b/public/app/features/panel/components/VizTypePicker/VisualizationSuggestions.tsx @@ -5,6 +5,7 @@ import AutoSizer from 'react-virtualized-auto-sizer'; import { GrafanaTheme2, PanelData, PanelModel, VisualizationSuggestion } from '@grafana/data'; import { useStyles2 } from '@grafana/ui'; +import { Trans } from 'app/core/internationalization'; import { getAllSuggestions } from '../../state/getAllSuggestions'; @@ -47,7 +48,9 @@ export function VisualizationSuggestions({ searchQuery, onChange, data, panel, t return (
      -
      Based on current data
      +
      + Based on current data +
      {filteredSuggestions.map((suggestion, index) => ( @@ -60,7 +63,11 @@ export function VisualizationSuggestions({ searchQuery, onChange, data, panel, t /> ))} {searchQuery && filteredSuggestions.length === 0 && ( -
      No results matched your query
      +
      + + No results matched your query + +
      )}
      diff --git a/public/app/features/panel/components/VizTypePicker/VizTypePicker.tsx b/public/app/features/panel/components/VizTypePicker/VizTypePicker.tsx index 302126277c7..a30702dd1cd 100644 --- a/public/app/features/panel/components/VizTypePicker/VizTypePicker.tsx +++ b/public/app/features/panel/components/VizTypePicker/VizTypePicker.tsx @@ -3,6 +3,7 @@ import { useMemo } from 'react'; import { GrafanaTheme2 } from '@grafana/data'; import { EmptySearchResult, useStyles2 } from '@grafana/ui'; +import { Trans } from 'app/core/internationalization'; import { filterPluginList, getAllPanelPluginMeta } from '../../state/util'; @@ -29,7 +30,13 @@ export function VizTypePicker({ pluginId, searchQuery, onChange, trackSearch }: }, [pluginsList, searchQuery, pluginId, trackSearch]); if (filteredPluginTypes.length === 0) { - return Could not find anything matching your query; + return ( + + + Could not find anything matching your query + + + ); } return ( diff --git a/public/app/features/plugins/admin/components/AppConfigWrapper.tsx b/public/app/features/plugins/admin/components/AppConfigWrapper.tsx index 0bc8bcc5562..07ae94fae11 100644 --- a/public/app/features/plugins/admin/components/AppConfigWrapper.tsx +++ b/public/app/features/plugins/admin/components/AppConfigWrapper.tsx @@ -6,6 +6,7 @@ import { PureComponent } from 'react'; import { PluginMeta, AppPlugin, deprecationWarning } from '@grafana/data'; import { AngularComponent, getAngularLoader, getBackendSrv } from '@grafana/runtime'; import { Button } from '@grafana/ui'; +import { Trans } from 'app/core/internationalization'; interface Props { app: AppPlugin; @@ -74,17 +75,17 @@ export class AppConfigCtrlWrapper extends PureComponent {
      {!model.enabled && ( )} {model.enabled && ( )} {model.enabled && ( )}
      diff --git a/public/app/features/plugins/admin/components/Badges/PluginAngularBadge.tsx b/public/app/features/plugins/admin/components/Badges/PluginAngularBadge.tsx index 47244f2e64b..95762117f94 100644 --- a/public/app/features/plugins/admin/components/Badges/PluginAngularBadge.tsx +++ b/public/app/features/plugins/admin/components/Badges/PluginAngularBadge.tsx @@ -6,6 +6,7 @@ export function PluginAngularBadge(): React.ReactElement { return ( ); } diff --git a/public/app/features/plugins/admin/components/Badges/PluginDisabledBadge.tsx b/public/app/features/plugins/admin/components/Badges/PluginDisabledBadge.tsx index 70c30c148e3..f9c27841bef 100644 --- a/public/app/features/plugins/admin/components/Badges/PluginDisabledBadge.tsx +++ b/public/app/features/plugins/admin/components/Badges/PluginDisabledBadge.tsx @@ -2,12 +2,20 @@ import * as React from 'react'; import { PluginErrorCode } from '@grafana/data'; import { Badge } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; type Props = { error?: PluginErrorCode }; export function PluginDisabledBadge({ error }: Props): React.ReactElement { const tooltip = errorCodeToTooltip(error); - return ; + return ( + + ); } function errorCodeToTooltip(error?: PluginErrorCode): string | undefined { diff --git a/public/app/features/plugins/admin/components/Badges/PluginEnterpriseBadge.tsx b/public/app/features/plugins/admin/components/Badges/PluginEnterpriseBadge.tsx index 29f78ca9688..1a0fbf4dab6 100644 --- a/public/app/features/plugins/admin/components/Badges/PluginEnterpriseBadge.tsx +++ b/public/app/features/plugins/admin/components/Badges/PluginEnterpriseBadge.tsx @@ -2,6 +2,7 @@ import * as React from 'react'; import { featureEnabled } from '@grafana/runtime'; import { Badge, PluginSignatureBadge, Stack, useStyles2 } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; import { CatalogPlugin } from '../../types'; @@ -13,7 +14,7 @@ export function PluginEnterpriseBadge({ plugin }: Props): React.ReactElement { const customBadgeStyles = useStyles2(getBadgeColor); if (featureEnabled('enterprise.plugins')) { - return ; + return ; } return ( @@ -22,11 +23,14 @@ export function PluginEnterpriseBadge({ plugin }: Props): React.ReactElement { ); diff --git a/public/app/features/plugins/admin/components/Badges/PluginInstallBadge.tsx b/public/app/features/plugins/admin/components/Badges/PluginInstallBadge.tsx index 2b59203fda6..bcaf0b15d54 100644 --- a/public/app/features/plugins/admin/components/Badges/PluginInstallBadge.tsx +++ b/public/app/features/plugins/admin/components/Badges/PluginInstallBadge.tsx @@ -1,10 +1,17 @@ import * as React from 'react'; import { Badge, useStyles2 } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; import { getBadgeColor } from './sharedStyles'; export function PluginInstalledBadge(): React.ReactElement { const customBadgeStyles = useStyles2(getBadgeColor); - return ; + return ( + + ); } diff --git a/public/app/features/plugins/admin/components/Badges/PluginUpdateAvailableBadge.tsx b/public/app/features/plugins/admin/components/Badges/PluginUpdateAvailableBadge.tsx index 1dfb63e38bb..4a782d9b106 100644 --- a/public/app/features/plugins/admin/components/Badges/PluginUpdateAvailableBadge.tsx +++ b/public/app/features/plugins/admin/components/Badges/PluginUpdateAvailableBadge.tsx @@ -3,6 +3,7 @@ import * as React from 'react'; import { GrafanaTheme2 } from '@grafana/data'; import { useStyles2 } from '@grafana/ui'; +import { Trans } from 'app/core/internationalization'; import { CatalogPlugin } from '../../types'; @@ -12,7 +13,11 @@ type Props = { export function PluginUpdateAvailableBadge({ plugin }: Props): React.ReactElement | null { const styles = useStyles2(getStyles); - return

      Update available!

      ; + return ( +

      + Update available! +

      + ); } export const getStyles = (theme: GrafanaTheme2) => { diff --git a/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithApp.tsx b/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithApp.tsx index 4ca6080d7c7..6624a17b4e2 100644 --- a/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithApp.tsx +++ b/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithApp.tsx @@ -4,6 +4,7 @@ import { PluginMeta } from '@grafana/data'; import { reportInteraction } from '@grafana/runtime'; import { Button } from '@grafana/ui'; import { contextSrv } from 'app/core/core'; +import { Trans } from 'app/core/internationalization'; import { AccessControlAction } from 'app/types'; import { updatePluginSettings } from '../../api'; @@ -59,13 +60,13 @@ export function GetStartedWithApp({ plugin }: Props): React.ReactElement | null <> {!enabled && ( )} {enabled && !autoEnabled && ( )} diff --git a/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithDataSource.tsx b/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithDataSource.tsx index 640560d62f5..1aa3a12d410 100644 --- a/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithDataSource.tsx +++ b/public/app/features/plugins/admin/components/GetStartedWithPlugin/GetStartedWithDataSource.tsx @@ -4,6 +4,7 @@ import * as React from 'react'; import { DataSourcePluginMeta } from '@grafana/data'; import { config } from '@grafana/runtime'; import { Button } from '@grafana/ui'; +import { Trans } from 'app/core/internationalization'; import { ROUTES } from 'app/features/connections/constants'; import { addDataSource } from 'app/features/datasources/state'; import { useDispatch } from 'app/types'; @@ -41,7 +42,7 @@ export function GetStartedWithDataSource({ plugin }: Props): React.ReactElement disabledButton ? "The plugin isn't usable yet, it may take some time to complete the installation." : undefined } > - Add new data source + Add new data source ); } diff --git a/public/app/features/plugins/admin/components/InstallControls/InstallControlsWarning.tsx b/public/app/features/plugins/admin/components/InstallControls/InstallControlsWarning.tsx index 8690a4f4a5f..fb6dea40d6d 100644 --- a/public/app/features/plugins/admin/components/InstallControls/InstallControlsWarning.tsx +++ b/public/app/features/plugins/admin/components/InstallControls/InstallControlsWarning.tsx @@ -4,6 +4,7 @@ import { GrafanaTheme2, PluginType } from '@grafana/data'; import { config, featureEnabled } from '@grafana/runtime'; import { HorizontalGroup, LinkButton, useStyles2, Alert } from '@grafana/ui'; import { contextSrv } from 'app/core/core'; +import { t, Trans } from 'app/core/internationalization'; import { AccessControlAction } from 'app/types'; import { getExternalManageLink } from '../../helpers'; @@ -27,7 +28,10 @@ export const InstallControlsWarning = ({ plugin, pluginStatus, latestCompatibleV return ( ); @@ -37,7 +41,11 @@ export const InstallControlsWarning = ({ plugin, pluginStatus, latestCompatibleV return ( - No valid Grafana Enterprise license detected. + + + No valid Grafana Enterprise license detected. + + - Learn more + Learn more @@ -85,7 +93,10 @@ export const InstallControlsWarning = ({ plugin, pluginStatus, latestCompatibleV return ( ); diff --git a/public/app/features/plugins/admin/components/PluginActions.tsx b/public/app/features/plugins/admin/components/PluginActions.tsx index 3403071f42a..8741929bd7d 100644 --- a/public/app/features/plugins/admin/components/PluginActions.tsx +++ b/public/app/features/plugins/admin/components/PluginActions.tsx @@ -3,6 +3,7 @@ import { useState } from 'react'; import { GrafanaTheme2, PluginErrorCode } from '@grafana/data'; import { Icon, Stack, useStyles2 } from '@grafana/ui'; +import { Trans } from 'app/core/internationalization'; import { GetStartedWithPlugin } from '../components/GetStartedWithPlugin'; import { InstallControlsButton } from '../components/InstallControls'; @@ -51,7 +52,9 @@ export const PluginActions = ({ plugin }: Props) => { {needReload && ( - Refresh the page to see the changes + + Refresh the page to see the changes + )} diff --git a/public/app/features/plugins/admin/components/PluginDashboards.tsx b/public/app/features/plugins/admin/components/PluginDashboards.tsx index 8b222d11f0f..37fd46cd3bb 100644 --- a/public/app/features/plugins/admin/components/PluginDashboards.tsx +++ b/public/app/features/plugins/admin/components/PluginDashboards.tsx @@ -4,6 +4,7 @@ import { PureComponent } from 'react'; import { AppEvents, PluginMeta, DataSourceApi } from '@grafana/data'; import { getBackendSrv } from '@grafana/runtime'; import { appEvents } from 'app/core/core'; +import { Trans } from 'app/core/internationalization'; import DashboardsTable from 'app/features/datasources/components/DashboardsTable'; import { PluginDashboard } from 'app/types'; @@ -96,10 +97,20 @@ export class PluginDashboards extends PureComponent { render() { const { loading, dashboards } = this.state; if (loading) { - return
      loading...
      ; + return ( +
      + Loading... +
      + ); } if (!dashboards || !dashboards.length) { - return
      No dashboards are included with this plugin
      ; + return ( +
      + + No dashboards are included with this plugin + +
      + ); } return ; diff --git a/public/app/features/plugins/admin/components/PluginDetailsBody.tsx b/public/app/features/plugins/admin/components/PluginDetailsBody.tsx index bd2999a6a0b..cc5c58f8bd7 100644 --- a/public/app/features/plugins/admin/components/PluginDetailsBody.tsx +++ b/public/app/features/plugins/admin/components/PluginDetailsBody.tsx @@ -5,6 +5,7 @@ import { AppPlugin, GrafanaTheme2, PluginContextProvider, UrlQueryMap, PluginTyp import { config } from '@grafana/runtime'; import { PageInfoItem } from '@grafana/runtime/internal'; import { CellProps, Column, InteractiveTable, Stack, useStyles2 } from '@grafana/ui'; +import { Trans } from 'app/core/internationalization'; import { Changelog } from '../components/Changelog'; import { PluginDetailsPanel } from '../components/PluginDetailsPanel'; @@ -160,7 +161,9 @@ export function PluginDetailsBody({ plugin, queryParams, pageId, info, showDetai return (
      -

      Page not found.

      +

      + Page not found. +

      ); } diff --git a/public/app/features/plugins/admin/components/PluginDetailsDeprecatedWarning.tsx b/public/app/features/plugins/admin/components/PluginDetailsDeprecatedWarning.tsx index 3a268e31abb..b94645f994e 100644 --- a/public/app/features/plugins/admin/components/PluginDetailsDeprecatedWarning.tsx +++ b/public/app/features/plugins/admin/components/PluginDetailsDeprecatedWarning.tsx @@ -3,6 +3,7 @@ import * as React from 'react'; import { renderMarkdown } from '@grafana/data'; import { Alert } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; import { CatalogPlugin } from '../types'; @@ -17,7 +18,12 @@ export function PluginDetailsDeprecatedWarning(props: Props): React.ReactElement const isWarningVisible = plugin.isDeprecated && !dismissed; return isWarningVisible ? ( - setDismissed(true)}> + setDismissed(true)} + >

      This {plugin.type} plugin is{' '} - + That plugin cannot be found. Please check the url is correct or
      go to the
      plugin catalog. diff --git a/public/app/features/plugins/admin/components/PluginDetailsPanel.tsx b/public/app/features/plugins/admin/components/PluginDetailsPanel.tsx index da3cc58ddaf..e8989a1b92e 100644 --- a/public/app/features/plugins/admin/components/PluginDetailsPanel.tsx +++ b/public/app/features/plugins/admin/components/PluginDetailsPanel.tsx @@ -229,6 +229,7 @@ export function PluginDetailsPanel(props: Props): React.ReactElement | null { This feature is for reporting malicious or harmful behaviour within plugins. For plugin concerns, email us at:{' '} + {/* eslint-disable-next-line @grafana/no-untranslated-strings */} integrations@grafana.com diff --git a/public/app/features/plugins/admin/components/PluginDetailsSignature.tsx b/public/app/features/plugins/admin/components/PluginDetailsSignature.tsx index 92add56cc6d..f0d738d46bc 100644 --- a/public/app/features/plugins/admin/components/PluginDetailsSignature.tsx +++ b/public/app/features/plugins/admin/components/PluginDetailsSignature.tsx @@ -3,6 +3,7 @@ import * as React from 'react'; import { PluginErrorCode, PluginSignatureStatus } from '@grafana/data'; import { selectors } from '@grafana/e2e-selectors'; import { Alert } from '@grafana/ui'; +import { t, Trans } from 'app/core/internationalization'; import { CatalogPlugin } from '../types'; @@ -25,7 +26,7 @@ export function PluginDetailsSignature({ className, plugin }: Props): React.Reac return ( @@ -41,7 +42,9 @@ export function PluginDetailsSignature({ className, plugin }: Props): React.Reac target="_blank" rel="noreferrer" > - Read more about plugins signing. + + Read more about plugins signing. + ); diff --git a/public/app/features/plugins/admin/components/PluginListItemBadges.test.tsx b/public/app/features/plugins/admin/components/PluginListItemBadges.test.tsx index b6afda55066..f03fc3a4d46 100644 --- a/public/app/features/plugins/admin/components/PluginListItemBadges.test.tsx +++ b/public/app/features/plugins/admin/components/PluginListItemBadges.test.tsx @@ -65,7 +65,7 @@ describe('PluginListItemBadges', () => { config.licenseInfo.enabledFeatures = {}; render(); expect(screen.getByText(/enterprise/i)).toBeVisible(); - expect(screen.getByLabelText(/lock icon/i)).toBeInTheDocument(); + expect(screen.getByLabelText(/enterprise/i)).toBeInTheDocument(); }); it('renders a error badge (when plugin has an error)', () => { diff --git a/public/app/features/plugins/admin/components/PluginSignatureDetailsBadge.tsx b/public/app/features/plugins/admin/components/PluginSignatureDetailsBadge.tsx index 945d6c2ee41..4aa83461df9 100644 --- a/public/app/features/plugins/admin/components/PluginSignatureDetailsBadge.tsx +++ b/public/app/features/plugins/admin/components/PluginSignatureDetailsBadge.tsx @@ -4,6 +4,7 @@ import * as React from 'react'; import { GrafanaTheme2, PluginSignatureType } from '@grafana/data'; import { useStyles2, Icon, Badge, IconName } from '@grafana/ui'; +import { Trans } from 'app/core/internationalization'; const SIGNATURE_ICONS: Record = { [PluginSignatureType.grafana]: 'grafana', @@ -40,7 +41,11 @@ export function PluginSignatureDetailsBadge({ signatureType, signatureOrg = '' } - Signed by: {signatureOrg} + + + Signed by: {{ signatureOrg }} + + ); diff --git a/public/app/features/plugins/admin/components/PluginUsage.tsx b/public/app/features/plugins/admin/components/PluginUsage.tsx index 559a9a18ea7..0a81fa71443 100644 --- a/public/app/features/plugins/admin/components/PluginUsage.tsx +++ b/public/app/features/plugins/admin/components/PluginUsage.tsx @@ -8,6 +8,7 @@ import { GrafanaTheme2, PluginMeta, PluginType } from '@grafana/data'; import { config } from '@grafana/runtime'; import { Alert, Spinner, useStyles2 } from '@grafana/ui'; import EmptyListCTA from 'app/core/components/EmptyListCTA/EmptyListCTA'; +import { t } from 'app/core/internationalization'; import { SearchResultsTable } from 'app/features/search/page/components/SearchResultsTable'; import { getGrafanaSearcher } from 'app/features/search/service/searcher'; import { SearchQuery } from 'app/features/search/service/types'; @@ -69,7 +70,14 @@ export function PluginUsage({ plugin }: Props) { if (!config.featureToggles.panelTitleSearch) { return ( - + Plugin usage requires the new search index to find usage across dashboards ); diff --git a/public/app/features/plugins/admin/components/SearchField.tsx b/public/app/features/plugins/admin/components/SearchField.tsx index f8e42fe3c84..f0861aeddb6 100644 --- a/public/app/features/plugins/admin/components/SearchField.tsx +++ b/public/app/features/plugins/admin/components/SearchField.tsx @@ -3,6 +3,7 @@ import * as React from 'react'; import { useDebounce } from 'react-use'; import { FilterInput } from '@grafana/ui'; +import { t } from 'app/core/internationalization'; interface Props { value?: string; @@ -41,7 +42,7 @@ export const SearchField = ({ value, onSearch }: Props) => { onSearch(e.currentTarget.value); } }} - placeholder="Search Grafana plugins" + placeholder={t('plugins.search-field.placeholder-search-grafana-plugins', 'Search Grafana plugins')} onChange={(value) => { setQuery(value); }} diff --git a/public/app/features/plugins/admin/components/VersionInstallButton.tsx b/public/app/features/plugins/admin/components/VersionInstallButton.tsx index 7792ffc06a8..ba25cd73a12 100644 --- a/public/app/features/plugins/admin/components/VersionInstallButton.tsx +++ b/public/app/features/plugins/admin/components/VersionInstallButton.tsx @@ -47,7 +47,14 @@ export const VersionInstallButton = ({ }, [installedVersion, version.version]); if (version.version === installedVersion) { - return ; + return ( + + ); } const performInstallation = () => { diff --git a/public/app/features/plugins/admin/components/VersionList.tsx b/public/app/features/plugins/admin/components/VersionList.tsx index 2e79b0d43c1..3e12c7d2441 100644 --- a/public/app/features/plugins/admin/components/VersionList.tsx +++ b/public/app/features/plugins/admin/components/VersionList.tsx @@ -4,6 +4,7 @@ import { useEffect, useState } from 'react'; import { dateTimeFormatTimeAgo, GrafanaTheme2 } from '@grafana/data'; import { config } from '@grafana/runtime'; import { useStyles2 } from '@grafana/ui'; +import { Trans } from 'app/core/internationalization'; import { getLatestCompatibleVersion } from '../helpers'; import { Version } from '../types'; @@ -28,7 +29,11 @@ export const VersionList = ({ pluginId, versions = [], installedVersion, disable }, [installedVersion]); if (versions.length === 0) { - return

      No version history was found.

      ; + return ( +

      + No version history was found. +

      + ); } const onInstallClick = () => { @@ -39,10 +44,16 @@ export const VersionList = ({ pluginId, versions = [], installedVersion, disable
    Published by + + Published by + + {meta.orgName}
    Updated on + + Updated on + + {dateTimeFormat(meta.updatedAt)}
    - + - - + + diff --git a/public/app/features/plugins/admin/pages/Browse.tsx b/public/app/features/plugins/admin/pages/Browse.tsx index cf8668a86d5..c6afd06ad5c 100644 --- a/public/app/features/plugins/admin/pages/Browse.tsx +++ b/public/app/features/plugins/admin/pages/Browse.tsx @@ -6,6 +6,7 @@ import { SelectableValue, GrafanaTheme2, PluginType } from '@grafana/data'; import { locationSearchToObject } from '@grafana/runtime'; import { Select, RadioButtonGroup, useStyles2, Tooltip, Field } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; +import { t } from 'app/core/internationalization'; import { getNavModel } from 'app/core/selectors/navModel'; import { ROUTES as CONNECTIONS_ROUTES } from 'app/features/connections/constants'; import { useSelector } from 'app/types'; @@ -95,14 +96,14 @@ export default function Browse() { - + {/* Filter by type */} - +
    Version + Version + Last updatedGrafana Dependency + Last updated + + Grafana dependency +
    @@ -54,7 +56,13 @@ class UserSessions extends PureComponent { {sessions.map((session: UserSession, index) => ( - {session.isActive ? : } + {session.isActive ? ( + + ) : ( + + )}
    Now{session.seenAt} + Now + {session.seenAt}{formatDate(session.createdAt, { dateStyle: 'long' })} {session.clientIp} diff --git a/public/app/features/profile/UserTeams.tsx b/public/app/features/profile/UserTeams.tsx index f95bf1c24e5..9f3010045e1 100644 --- a/public/app/features/profile/UserTeams.tsx +++ b/public/app/features/profile/UserTeams.tsx @@ -1,6 +1,7 @@ import { PureComponent } from 'react'; import { LoadingPlaceholder } from '@grafana/ui'; +import { t, Trans } from 'app/core/internationalization'; import { Team } from 'app/types'; export interface Props { @@ -13,7 +14,7 @@ export class UserTeams extends PureComponent { const { isLoading, teams } = this.props; if (isLoading) { - return ; + return ; } if (teams.length === 0) { @@ -22,14 +23,25 @@ export class UserTeams extends PureComponent { return (
    -

    Teams

    - +

    + Teams +

    +
    - - + + + diff --git a/public/app/features/query/components/QueryEditorRowHeader.tsx b/public/app/features/query/components/QueryEditorRowHeader.tsx index e37ed72e568..1e129f99805 100644 --- a/public/app/features/query/components/QueryEditorRowHeader.tsx +++ b/public/app/features/query/components/QueryEditorRowHeader.tsx @@ -5,6 +5,7 @@ import { ReactNode, useState } from 'react'; import { DataQuery, DataSourceInstanceSettings, GrafanaTheme2 } from '@grafana/data'; import { selectors } from '@grafana/e2e-selectors'; import { FieldValidationMessage, Icon, Input, useStyles2 } from '@grafana/ui'; +import { t, Trans } from 'app/core/internationalization'; import { DataSourcePicker } from 'app/features/datasources/components/picker/DataSourcePicker'; export interface Props { @@ -90,7 +91,7 @@ export const QueryEditorRowHeader = (props: Props(props: Props{renderExtras()}} - {hidden && Hidden} + {hidden && ( + + Hidden + + )} {collapsedText &&
    {collapsedText}
    } diff --git a/public/app/features/query/components/QueryGroup.tsx b/public/app/features/query/components/QueryGroup.tsx index 278b05ffb8f..9463937cbe5 100644 --- a/public/app/features/query/components/QueryGroup.tsx +++ b/public/app/features/query/components/QueryGroup.tsx @@ -19,6 +19,7 @@ import { DataQuery } from '@grafana/schema'; import { Button, HorizontalGroup, InlineFormLabel, Modal, ScrollContainer, stylesFactory } from '@grafana/ui'; import { PluginHelp } from 'app/core/components/PluginHelp/PluginHelp'; import config from 'app/core/config'; +import { Trans, t } from 'app/core/internationalization'; import { backendSrv } from 'app/core/services/backend_srv'; import { addQuery, queryIsEmpty } from 'app/core/utils/query'; import { DataSourceModal } from 'app/features/datasources/components/picker/DataSourceModal'; @@ -303,7 +304,7 @@ export class QueryGroup extends PureComponent { variant="secondary" data-testid={selectors.components.QueryTab.addQuery} > - Add query + Add query )} {config.expressionsEnabled && this.isExpressionsSupported(dsSettings) && ( @@ -339,7 +340,11 @@ export class QueryGroup extends PureComponent {
    {this.renderQueries(dsSettings)}
    {this.renderAddQueryRow(dsSettings, styles)} {isHelpOpen && ( - + )} @@ -409,7 +414,7 @@ export function QueryGroupTopSection({
    - Data source + Data source
    setIsHelpOpen(true)} data-testid="query-tab-help-button" /> @@ -448,7 +456,7 @@ export function QueryGroupTopSection({ onClick={onOpenQueryInspector} aria-label={selectors.components.QueryTab.queryInspectorButton} > - Query inspector + Query inspector
    )} @@ -466,7 +474,11 @@ export function QueryGroupTopSection({ )}
    {isHelpOpen && ( - setIsHelpOpen(false)}> + setIsHelpOpen(false)} + > )} diff --git a/public/app/features/query/components/QueryGroupOptions.tsx b/public/app/features/query/components/QueryGroupOptions.tsx index c949e1767b2..3a13aa60ef4 100644 --- a/public/app/features/query/components/QueryGroupOptions.tsx +++ b/public/app/features/query/components/QueryGroupOptions.tsx @@ -4,6 +4,7 @@ import React, { useState, ChangeEvent, FocusEvent, useCallback } from 'react'; import { rangeUtil, PanelData, DataSourceApi, GrafanaTheme2 } from '@grafana/data'; import { Input, InlineSwitch, useStyles2, InlineLabel } from '@grafana/ui'; import { QueryOperationRow } from 'app/core/components/QueryOperationRow/QueryOperationRow'; +import { Trans, t } from 'app/core/internationalization'; import { QueryGroupOptions } from 'app/types'; interface Props { @@ -159,11 +160,14 @@ export const QueryGroupOptionsEditor = React.memo(({ options, dataSource, data, return ( <> - Cache timeout + + Cache timeout + - Cache TTL + + Cache TTL + } > - Max data points + + Max data points + = - Width of panel + + + Width of panel + + )} @@ -246,7 +258,7 @@ export const QueryGroupOptionsEditor = React.memo(({ options, dataSource, data, } htmlFor="min-interval-input" > - Min interval + Min interval } > - Interval + Interval {realInterval} = - Time range / max data points + + + Time range / max data points + + ); }; @@ -299,7 +315,7 @@ export const QueryGroupOptionsEditor = React.memo(({ options, dataSource, data, } > - Relative time + Relative time } > - Time shift + Time shift - Hide time info + Hide time info { const node: NavModelItem = { @@ -18,22 +19,26 @@ export const TestStuffPage = () => { return ( - Application notifications (toasts) testing + + + Application notifications (toasts) testing + + diff --git a/public/app/features/search/page/components/SearchResultsTable.tsx b/public/app/features/search/page/components/SearchResultsTable.tsx index cd6b0564436..6ffd0e76b70 100644 --- a/public/app/features/search/page/components/SearchResultsTable.tsx +++ b/public/app/features/search/page/components/SearchResultsTable.tsx @@ -10,7 +10,7 @@ import { Field, GrafanaTheme2 } from '@grafana/data'; import { TableCellHeight } from '@grafana/schema'; import { useStyles2, useTheme2 } from '@grafana/ui'; import { useTableStyles, TableCell } from '@grafana/ui/internal'; -import { Trans } from 'app/core/internationalization'; +import { Trans, t } from 'app/core/internationalization'; import { useCustomFlexLayout } from 'app/features/browse-dashboards/components/customFlexTableLayout'; import { useSearchKeyboardNavigation } from '../../hooks/useSearchKeyboardSelection'; @@ -171,13 +171,17 @@ export const SearchResultsTable = React.memo( if (!rows.length) { return (
    - No values + No values
    ); } return ( -
    +
    {headerGroups.map((headerGroup) => { const { key, ...headerGroupProps } = headerGroup.getHeaderGroupProps({ style: { width }, diff --git a/public/app/features/search/page/components/columns.tsx b/public/app/features/search/page/components/columns.tsx index 3f982658dd0..6edcbe90745 100644 --- a/public/app/features/search/page/components/columns.tsx +++ b/public/app/features/search/page/components/columns.tsx @@ -13,7 +13,7 @@ import { import { config, getDataSourceSrv } from '@grafana/runtime'; import { Checkbox, Icon, IconName, TagList, Text, Tooltip } from '@grafana/ui'; import appEvents from 'app/core/app_events'; -import { t } from 'app/core/internationalization'; +import { t, Trans } from 'app/core/internationalization'; import { formatDate, formatDuration } from 'app/core/internationalization/dates'; import { PluginIconName } from 'app/features/plugins/admin/types'; import { ShowModalReactEvent } from 'app/types/events'; @@ -280,7 +280,11 @@ export const generateColumns = ( }; columns.push({ - Header: () =>
    Score
    , + Header: () => ( +
    + Score +
    + ), Cell: (p) => { const { key, ...cellProps } = p.cellProps; return ( diff --git a/public/app/features/support-bundles/SupportBundles.tsx b/public/app/features/support-bundles/SupportBundles.tsx index be9cb8d6c63..d7c02d1d9b6 100644 --- a/public/app/features/support-bundles/SupportBundles.tsx +++ b/public/app/features/support-bundles/SupportBundles.tsx @@ -5,6 +5,7 @@ import { dateTimeFormat } from '@grafana/data'; import { LinkButton, Spinner, IconButton } from '@grafana/ui'; import { Page } from 'app/core/components/Page/Page'; import { contextSrv } from 'app/core/core'; +import { Trans, t } from 'app/core/internationalization'; import { AccessControlAction, StoreState } from 'app/types'; import { loadBundles, removeBundle, checkBundles } from './state/actions'; @@ -18,7 +19,7 @@ const subTitle = ( const NewBundleButton = ( - New support bundle + New support bundle ); @@ -63,9 +64,15 @@ const SupportBundlesUnconnected = ({ supportBundles, isLoading, loadBundles, rem
    - NameEmailMembers + Name + + Email + + Members +
    - - - + + + diff --git a/public/app/features/support-bundles/SupportBundlesCreate.tsx b/public/app/features/support-bundles/SupportBundlesCreate.tsx index c26992e8780..002f4554d15 100644 --- a/public/app/features/support-bundles/SupportBundlesCreate.tsx +++ b/public/app/features/support-bundles/SupportBundlesCreate.tsx @@ -4,6 +4,7 @@ import { connect, ConnectedProps } from 'react-redux'; import { Button, Field, Checkbox, LinkButton, Stack, Alert } from '@grafana/ui'; import { Form } from 'app/core/components/Form/Form'; import { Page } from 'app/core/components/Page/Page'; +import { Trans } from 'app/core/internationalization'; import { StoreState } from 'app/types'; import { loadSupportBundleCollectors, createSupportBundle } from './state/actions'; @@ -81,9 +82,11 @@ export const SupportBundlesCreateUnconnected = ({ ); })} - + - Cancel + Cancel diff --git a/public/app/features/trails/RelatedLogs/RelatedLogsScene.tsx b/public/app/features/trails/RelatedLogs/RelatedLogsScene.tsx index e5f28ae9d5f..8ccd6460571 100644 --- a/public/app/features/trails/RelatedLogs/RelatedLogsScene.tsx +++ b/public/app/features/trails/RelatedLogs/RelatedLogsScene.tsx @@ -17,7 +17,7 @@ import { type SceneVariable, } from '@grafana/scenes'; import { Stack, LinkButton } from '@grafana/ui'; -import { Trans } from 'app/core/internationalization'; +import { Trans, t } from 'app/core/internationalization'; import { MetricsLogsConnector } from '../Integrations/logs/base'; import { createLabelsCrossReferenceConnector } from '../Integrations/logs/labelsCrossReference'; @@ -170,7 +170,10 @@ export class RelatedLogsScene extends SceneObjectBase { reportExploreMetrics('related_logs_action_clicked', { action: 'open_explore_logs' })} diff --git a/public/app/features/users/TokenRevokedModal.tsx b/public/app/features/users/TokenRevokedModal.tsx index b7c6fdc2c12..a645e4e72a4 100644 --- a/public/app/features/users/TokenRevokedModal.tsx +++ b/public/app/features/users/TokenRevokedModal.tsx @@ -3,7 +3,7 @@ import { css, cx } from '@emotion/css'; import { GrafanaTheme2 } from '@grafana/data'; import { Button, InfoBox, Portal, useStyles2, useTheme2 } from '@grafana/ui'; import { getModalStyles } from '@grafana/ui/internal'; -import { Trans } from 'app/core/internationalization'; +import { Trans, t } from 'app/core/internationalization'; interface Props { maxConcurrentSessions?: number; @@ -23,7 +23,14 @@ export const TokenRevokedModal = (props: Props) => { return (
    - +

    Your session token was automatically revoked because you have reached diff --git a/public/locales/en-US/grafana.json b/public/locales/en-US/grafana.json index c265f3d9e97..a3c825b2124 100644 --- a/public/locales/en-US/grafana.json +++ b/public/locales/en-US/grafana.json @@ -34,6 +34,19 @@ "save-button": "Save" } }, + "actions": { + "action-editor": { + "label-headers": "Headers", + "label-url": "URL", + "placeholder-url": "URL" + }, + "params-editor": { + "aria-label-add": "Add", + "aria-label-delete": "Delete", + "placeholder-key": "Key", + "placeholder-value": "Value" + } + }, "admin": { "add-to-org-modal": { "label-organization": "Organization", @@ -870,11 +883,21 @@ } }, "annotations": { + "annotation-field-mapper": { + "annotation": "Annotation", + "first-value": "First value", + "from": "From" + }, "empty-state": { "button-title": "Add annotation query", "info-box-content": "<0>Annotations provide a way to integrate event data into your graphs. They are visualized as vertical lines and icons on all graph panels. When you hover over an annotation icon you can get event text & tags for the event. You can add annotation events directly from grafana by holding CTRL or CMD + click on graph (or drag region). These will be stored in Grafana's annotation database.", "info-box-content-2": "Checkout the <2>Annotations documentation for more information.", "title": "There are no custom annotation queries added yet" + }, + "standard-annotation-query-editor": { + "no-events-found": "No events found", + "test-annotation-query": "Test annotation query", + "title-query-result": "Query result" } }, "api-keys": { @@ -1178,6 +1201,13 @@ "sub-text": "<0>Define text that will describe the correlation.", "title": "Define correlation label (Step 1 of 3)" }, + "configure-correlation-target-form": { + "aria-label-correlation-type": "Correlation type" + }, + "empty-correlations-cta": { + "please-contact-administrator-create-correlations": "Please contact your administrator to create new correlations.", + "there-are-no-correlations-configured-yet": "There are no correlations configured yet." + }, "empty-state": { "button-title": "Add correlation", "pro-tip": "You can also define correlations via datasource provisioning", @@ -1935,6 +1965,141 @@ "message": "No data sources found" } }, + "datasources": { + "alerting-enabled": { + "text-alerting-not-supported": "Alerting not supported", + "text-alerting-supported": "Alerting supported" + }, + "basic-settings": { + "aria-label-datasource-settings-page-basic": "Datasource settings page basic settings", + "basic-settings-name-placeholder-name": "Name", + "label-default": "Default", + "label-name": "Name" + }, + "button-row": { + "delete": "Delete", + "test": "Test" + }, + "cloud-info-box": { + "title-includes-active-metrics-storage": "The free plan includes 10k active metrics and 50gb storage." + }, + "dashboards-table": { + "aria-label-delete-dashboard": "Delete dashboard", + "import": "Import" + }, + "data-source-categories": { + "find-more-data-source-plugins": "Find more data source plugins" + }, + "data-source-load-error": { + "back": "Back", + "delete": "Delete" + }, + "data-source-missing-rights-message": { + "title-missing-rights": "Missing rights" + }, + "data-source-picker": { + "aria-label-select-a-data-source": "Select a data source" + }, + "data-source-plugin-state": { + "plugin-state": "Plugin state" + }, + "data-source-read-only-message": { + "title-provisioned-data-source": "Provisioned data source" + }, + "data-sources-list-card": { + "build-a-dashboard": "Build a dashboard", + "explore": "Explore" + }, + "edit-data-source-actions": { + "build-a-dashboard": "Build a dashboard", + "explore-data": "Explore data" + }, + "footer": { + "add-csv-or-spreadsheet": "Add csv or spreadsheet" + }, + "new-data-source-view": { + "cancel": "Cancel", + "placeholder-filter-by-name-or-type": "Filter by name or type" + } + }, + "dimensions": { + "file-dropzone-custom-children": { + "upload": "Upload" + }, + "file-uploader": { + "preview": { + "label-preview": "Preview" + } + }, + "folder-picker-tab": { + "placeholder-search": "Search" + }, + "resource-dimension-editor": { + "label-field": "Field", + "label-source": "Source" + }, + "resource-picker": { + "render-small-resource-picker": { + "set-icon": "Set icon" + } + }, + "resource-picker-popover": { + "cancel": "Cancel", + "folder": "Folder", + "select": "Select", + "url": "URL" + }, + "scalar-dimension-editor": { + "label-limit": "Limit", + "label-value": "Value" + }, + "scale-dimension-editor": { + "label-max": "Max", + "label-min": "Min", + "label-value": "Value" + }, + "text-dimension-editor": { + "label-field": "Field", + "label-source": "Source", + "label-template": "Template" + }, + "thresholds-editor": { + "add-threshold": "Add threshold", + "description-percentage-means-thresholds-relative": "Percentage means thresholds relative to min & max", + "thresholds-mode": "Thresholds mode" + }, + "urlpicker-tab": { + "label-preview": "Preview" + }, + "value-mapping-edit-row": { + "duplicate-value-mapping-aria-label-duplicate-value-mapping": "Duplicate value mapping", + "duplicate-value-mapping-tooltip-duplicate": "Duplicate", + "placeholder-exact-value-to-match": "Exact value to match", + "placeholder-from": "From", + "placeholder-optional-display-text": "Optional display text", + "placeholder-regular-expression": "Regular expression", + "placeholder-to": "To", + "remove-value-mapping-aria-label-delete-value-mapping": "Delete value mapping", + "remove-value-mapping-tooltip-delete": "Delete", + "set-color": "Set color", + "tooltip-remove-color": "Remove color", + "tooltip-remove-icon": "Remove icon" + }, + "value-mappings-editor": { + "add-value-mappings": "Add value mappings", + "edit-value-mappings": "Edit value mappings", + "title-value-mappings": "Value mappings" + }, + "value-mappings-editor-modal": { + "cancel": "Cancel", + "color": "Color", + "condition": "Condition", + "display-text": "Display text", + "icon": "Icon", + "label-add-a-new-mapping": "Add a new mapping", + "update": "Update" + } + }, "embed": { "share": { "time-range-description": "Change the current relative time range to an absolute time range", @@ -1962,6 +2127,7 @@ "basic-extensions": { "aria-label-add": "Add" }, + "clear": "Clear", "confirm-navigation-modal": { "cancel": "Cancel", "open": "Open", @@ -2235,6 +2401,8 @@ "query-inspector-button": "Query inspector", "query-inspector-button-aria-label": "Query inspector" }, + "show-critical-path-only": "Show critical path only", + "show-matches-only": "Show matches only", "span-bar-section": { "title-span-bar": "Span bar" }, @@ -2374,6 +2542,35 @@ "export-as-json-tooltip": "Export" } }, + "expressions": { + "classic-conditions": { + "label-conditions": "Conditions" + }, + "expression-query-editor": { + "label-operation": "Operation" + }, + "math": { + "available-math-functions": "Available math functions" + }, + "reduce": { + "label-function": "Function", + "label-input": "Input", + "label-mode": "Mode", + "replace-with-number": { + "label-replace-with": "Replace with" + } + }, + "resample": { + "label-downsample": "Downsample", + "label-input": "Input", + "label-resample-to": "Resample to", + "label-upsample": "Upsample", + "tooltip-s-m-h": "10s, 1m, 30m, 1h" + }, + "threshold": { + "label-input": "Input" + } + }, "folder-filter": { "clear-folder-button": "Clear folders" }, @@ -2409,6 +2606,18 @@ "requires-license": "Requires a Grafana Enterprise license", "title": "Enterprise" }, + "gops": { + "config-card": { + "text-loading-configuration": "Loading configuration...." + }, + "configure-irm": { + "configure": "Configure", + "irm-apps": "IRM apps" + }, + "essentials": { + "title-essentials": "Essentials" + } + }, "grafana": { "dashboard": { "edit-pane": { @@ -2767,6 +2976,13 @@ "troubleshooting-help": "To request troubleshooting help, send a snapshot of this panel to Grafana Labs Technical Support. The snapshot contains query response data and panel settings." }, "inspector": { + "inspect-data-tab": { + "no-data": "No data" + }, + "inspect-jsontab": { + "apply": "Apply", + "support": "Support" + }, "query": { "collapse-all": "Collapse all", "copy-to-clipboard": "Copy to clipboard", @@ -2774,6 +2990,29 @@ "expand-all": "Expand all", "no-data": "No request and response collected yet. Hit refresh button", "refresh": "Refresh" + }, + "query-inspector": { + "query-inspector": "Query inspector", + "text-loading-query-inspector": "Loading query inspector..." + } + }, + "invites": { + "invitee-row": { + "aria-label-revoke-invite": "Revoke invite" + }, + "invitees-table": { + "email": "Email", + "name": "Name" + }, + "signup-invited-page": { + "label-email": "Email", + "label-name": "Name", + "label-password": "Password", + "label-username": "Username", + "placeholder-name-optional": "Name (optional)", + "placeholder-password": "Password", + "placeholder-username": "Username", + "sign-up": "Sign up" } }, "ldap-drawer": { @@ -3005,6 +3244,16 @@ "render-image-error-description": "An error occurred when generating the image" } }, + "live": { + "dashboard-changed-modal": { + "continue-editing": "Continue editing", + "discard-local-changes": "Discard local changes", + "title-dashboard-changed": "Dashboard changed" + }, + "live-connection-warning": { + "title-connection-to-server-is-lost": "Connection to server is lost..." + } + }, "lock-icon": "lock icon", "login": { "divider": { @@ -3056,12 +3305,22 @@ "load-older": "Loading older logs...", "older-logs": "Older logs" }, + "log-context-buttons": { + "center-matched-line": "Center matched line", + "label-wrap-lines": "Wrap lines" + }, "log-details": { "fields": "Fields", "links": "Links", "log-line": "Log line", "no-details": "No details available" }, + "log-details-body": { + "toggle-field-button": { + "tooltip-hide-log-line": "Hide log line", + "tooltip-show-log-line": "Show log line" + } + }, "log-line-menu": { "copy-link": "Copy link to log line", "copy-log": "Copy log line", @@ -3070,6 +3329,22 @@ "show-context": "Show context", "unpin-from-outline": "Unpin log" }, + "log-row-context-modal": { + "error-loading-log-more-logs": "Error loading more logs.", + "no-more-logs-available": "No more logs available.", + "open-in-split-view": "Open in split view", + "title-log-context": "Log context" + }, + "log-row-menu-cell": { + "aria-label-copy-shortlink": "Copy shortlink", + "aria-label-pin-line": "Pin line", + "aria-label-show-context": "Show context", + "aria-label-unpin-line": "Unpin line", + "tooltip-copy-shortlink": "Copy shortlink", + "tooltip-copy-to-clipboard": "Copy to clipboard", + "tooltip-show-context": "Show context", + "tooltip-unpin-line": "Unpin line" + }, "log-row-message": { "ellipsis": "… ", "more": "more", @@ -3092,11 +3367,49 @@ "scroll-top": "Scroll to top", "start-of-range": "Start of range" }, + "out-of-range-message": { + "end-of-the-selected-time-range": "End of the selected time range." + }, "popover-menu": { "copy": "Copy selection", "disable-menu": "Disable menu", "line-contains": "Add as line contains filter", "line-contains-not": "Add as line does not contain filter" + }, + "un-themed-log-details": { + "aria-label-data-links": "Data links", + "aria-label-fields": "Fields", + "aria-label-log-level": "Log level", + "aria-label-no-details": "No details" + }, + "un-themed-log-details-row": { + "title-copy-value-to-clipboard": "Copy value to clipboard", + "toggle-field-button": { + "tooltip-field-instead-message": "Show this field instead of the message", + "tooltip-hide-this-field": "Hide this field" + }, + "tooltip-adhoc-statistics": "Ad-hoc statistics", + "tooltip-hide-adhoc-statistics": "Hide ad-hoc statistics" + } + }, + "manage-dashboards": { + "import-dashboard-form": { + "cancel": "Cancel", + "change-uid": "Change uid", + "description-library-panels-imported": "List of new library panels that will get imported.", + "label-existing-library-panels": "Existing library panels", + "label-folder": "Folder", + "label-name": "Name", + "label-new-library-panels": "New library panels", + "label-unique-identifier-uid": "Unique identifier (UID)", + "options": "Options" + }, + "import-dashboard-overview-un-connected": { + "published-by": "Published by", + "updated-on": "Updated on" + }, + "snapshot-list-table": { + "title-delete": "Delete" } }, "migrate-to-cloud": { @@ -3159,6 +3472,9 @@ "error": "There was an error disconnecting", "title": "Disconnect from cloud stack" }, + "folder-info": { + "unable-to-load-folder": "Unable to load folder" + }, "get-started": { "body": "The migration process must be started from your self-managed Grafana instance.", "configure-pdc-link": "Configure PDC for this stack", @@ -3712,6 +4028,9 @@ "title": "You're all caught up!" }, "starred-dashboard": "Dashboard starred", + "stored-notifications": { + "dismiss-notifications": "Dismiss notifications" + }, "unstarred-dashboard": "Dashboard unstarred" }, "oauth": { @@ -3767,6 +4086,25 @@ "show-legend": "Show legend", "unlink-library-panel": "Unlink library panel", "view": "View" + }, + "panel-data-error-view": { + "open-visualization-suggestions": "Open visualization suggestions", + "switch-to-table": "Switch to table" + }, + "panel-renderer": { + "loading-plugin-panel": "Loading plugin panel...", + "no-panel-data": "No panel data" + }, + "panel-type-card": { + "aria-label-delete-button-on-panel-type-card": "Delete button on panel type card", + "tooltip-delete": "Delete" + }, + "visualization-suggestions": { + "based-on-current-data": "Based on current data", + "no-results-matched-your-query": "No results matched your query" + }, + "viz-type-picker": { + "could-anything-matching-query": "Could not find anything matching your query" } }, "panel-search": { @@ -3838,6 +4176,37 @@ } }, "plugins": { + "angular-deprecation-notice": { + "deprecation-notice-migration-advice": "Read our deprecation notice and migration advice.", + "try-migration": "Try migration" + }, + "angular-deprecation-plugin-notice": { + "deprecation-notice-migration-advice": "Read our deprecation notice and migration advice.", + "title-angular-plugin": "Angular plugin", + "view-plugin-details": "View plugin details" + }, + "angular-migration-notice": { + "report-issue": "Report issue", + "revert-migration": "Revert migration" + }, + "app-config-ctrl-wrapper": { + "disable": "Disable", + "enable": "Enable", + "update": "Update" + }, + "app-root-page": { + "access-denied": { + "permission": "You do not have permission to see this page.", + "title-access-denied": "Access denied" + }, + "no-root-app-page-component-found": "No root app page component found" + }, + "browse": { + "aria-label-plugin-type-filter": "Plugin type filter", + "label-search": "Search", + "label-state": "State", + "label-type": "Type" + }, "catalog": { "no-updates-available": "No updates available", "update-all": { @@ -3918,9 +4287,83 @@ "sort-list": "Sort Plugins List", "state": "State" }, + "get-started-with-app": { + "disable": "Disable", + "enable": "Enable" + }, + "get-started-with-data-source": { + "add-new-data-source": "Add new data source" + }, + "install-controls-warning": { + "learn-more": "Learn more", + "no-valid-grafana-enterprise-license-detected": "No valid Grafana Enterprise license detected.", + "title-plugin-doesnt-support-version-grafana": "This plugin doesn't support your version of Grafana.", + "title-renderer-plugins-cannot-managed-plugin-catalog": "Renderer plugins cannot be managed by the Plugin Catalog." + }, + "log-view-filters": { + "label-extension": "Extension", + "label-plugin-id": "Plugin Id", + "label-severity": "Severity" + }, + "not-found-plugin": { + "title-plugin-not-found": "Plugin not found" + }, + "plugin-actions": { + "refresh-changes": "Refresh the page to see the changes" + }, + "plugin-dashboards": { + "dashboards-included-plugin": "No dashboards are included with this plugin", + "loading": "Loading..." + }, + "plugin-deprecated-badge": { + "text-deprecated": "Deprecated", + "tooltip-plugin-deprecated-longer-receives-updates": "This plugin is deprecated and no longer receives updates." + }, + "plugin-details-body": { + "page-not-found": "Page not found." + }, + "plugin-details-deprecated-warning": { + "title-deprecated": "Deprecated" + }, + "plugin-details-signature": { + "read-more-about-plugins-signing": "Read more about plugins signing.", + "title-invalid-plugin-signature": "Invalid plugin signature" + }, + "plugin-disabled-badge": { + "text-disabled": "Disabled" + }, + "plugin-enterprise-badge": { + "aria-label-enterprise": "Enterprise", + "text-enterprise": "Enterprise", + "title-requires-a-grafana-enterprise-license": "Requires a Grafana Enterprise license" + }, "plugin-help": { "error": "An error occurred when loading help.", "not-found": "No query help could be found." + }, + "plugin-installed-badge": { + "text-installed": "Installed" + }, + "plugin-signature-details-badge": { + "signed-by": "Signed by: {{signatureOrg}}" + }, + "plugin-update-available-badge": { + "update-available": "Update available!" + }, + "plugin-usage": { + "title-missing-feature-toggle-panel-title-search": "Missing feature toggle: {{toggle}}" + }, + "search-field": { + "placeholder-search-grafana-plugins": "Search Grafana plugins" + }, + "version-install-button": { + "text-installed": "Installed" + }, + "version-list": { + "grafana-dependency": "Grafana dependency", + "last-updated": "Last updated", + "no-version-history-was-found": "No version history was found.", + "version": "Version" } }, "profile": { @@ -3939,7 +4382,22 @@ "passwords-must-match": "Passwords must match", "strong-password-validation-register": "Password does not comply with the strong password policy" }, - "change-theme": "Change theme" + "change-theme": "Change theme", + "user-organizations": { + "text-loading-organizations": "Loading organizations..." + }, + "user-sessions": { + "now": "Now", + "sessions": "Sessions" + }, + "user-teams": { + "aria-label-user-teams-table": "User teams table", + "email": "Email", + "members": "Members", + "name": "Name", + "teams": "Teams", + "text-loading-teams": "Loading teams..." + } }, "public-dashboard": { "acknowledgment-checkboxes": { @@ -4128,6 +4586,43 @@ "role-label": "Role" } }, + "query": { + "query-editor-row-header": { + "hidden": "Hidden", + "query-name-div-title-edit-query-name": "Edit query name" + }, + "query-group": { + "add-query": "Add query", + "title-data-source-help": "Data source help" + }, + "query-group-options-editor": { + "hide-time-info": "Hide time info", + "Query options-title-query-options": "Query options", + "relative-time": "Relative time", + "render-cache-timeout-option": { + "cache-timeout": "Cache timeout" + }, + "render-interval-option": { + "interval": "Interval", + "min-interval": "Min interval", + "time-range-max-data-points": "Time range / max data points" + }, + "render-max-data-points-option": { + "max-data-points": "Max data points", + "width-of-panel": "Width of panel" + }, + "render-query-caching-ttloption": { + "cache-ttl": "Cache TTL" + }, + "time-shift": "Time shift" + }, + "query-group-top-section": { + "data-source": "Data source", + "query-inspector": "Query inspector", + "query-tab-help-button-title-open-data-source-help": "Open data source help", + "title-data-source-help": "Data source help" + } + }, "query-operation": { "header": { "collapse-row": "Collapse query row", @@ -4237,6 +4732,14 @@ "reload-button": "Reload", "title": "Unable to find application file" }, + "sandbox": { + "test-stuff-page": { + "application-notifications-toasts-testing": "Application notifications (toasts) testing", + "error": "Error", + "success": "Success", + "warning": "Warning" + } + }, "save-dashboards": { "message-length": { "info": "The message is {{messageLength}} characters, which exceeds the maximum length of 500 characters. Please shorten it before saving.", @@ -4299,6 +4802,9 @@ "new-dashboard": "New dashboard", "new-folder": "New folder" }, + "generate-columns": { + "score": "Score" + }, "results-table": { "datasource-header": "Data source", "deleted-less-than-1-min": "< 1 min", @@ -4313,6 +4819,10 @@ "search-input": { "include-panels-placeholder": "Search for dashboards, folders, and panels", "placeholder": "Search for dashboards and folders" + }, + "search-results-table": { + "aria-label-search-results-table": "Search results table", + "no-data": "No values" } }, "select": { @@ -4663,6 +5173,22 @@ "url-column-header": "Snapshot url", "view-button": "View" }, + "support-bundles": { + "new-bundle-button": { + "new-support-bundle": "New support bundle" + }, + "support-bundles-create-unconnected": { + "cancel": "Cancel", + "create": "Create" + }, + "support-bundles-unconnected": { + "created-on": "Created on", + "download": "Download", + "expires": "Expires", + "requested-by": "Requested by", + "tooltip-remove-bundle": "Remove bundle" + } + }, "table": { "container": { "content": "Showing too many columns in a single table may impact performance and make data harder to read. Consider refining your queries.", @@ -4868,6 +5394,9 @@ "recent-metrics": { "or-view-a-recent-exploration": "Or view a recent exploration" }, + "related-logs-scene": { + "tooltip-navigate-to-the-explore-logs-app": "Navigate to the Explore Logs app" + }, "settings": { "always-keep-selected-metric-graph-in-view": "Always keep selected metric graph in-view", "show-previews-of-metric-graphs": "Show previews of metric graphs" @@ -5155,7 +5684,8 @@ "message": "No users found" }, "token-revoked-modal": { - "sign-in": "Sign in" + "sign-in": "Sign in", + "title-you-have-been-automatically-signed-out": "You have been automatically signed out" }, "users-action-bar-unconnected": { "invite": "Invite",

    Created onRequested byExpires + Created on + + Requested by + + Expires + @@ -85,7 +92,7 @@ const SupportBundlesUnconnected = ({ supportBundles, isLoading, loadBundles, rem target={'_self'} href={`/api/support-bundles/${bundle.uid}`} > - Download + Download @@ -94,7 +101,7 @@ const SupportBundlesUnconnected = ({ supportBundles, isLoading, loadBundles, rem onClick={() => removeBundle(bundle.uid)} name="trash-alt" variant="destructive" - tooltip="Remove bundle" + tooltip={t('support-bundles.support-bundles-unconnected.tooltip-remove-bundle', 'Remove bundle')} /> )}