diff --git a/packages/grafana-ui/src/components/Badge/Badge.tsx b/packages/grafana-ui/src/components/Badge/Badge.tsx index efbaab0dbfb..abe7ab23699 100644 --- a/packages/grafana-ui/src/components/Badge/Badge.tsx +++ b/packages/grafana-ui/src/components/Badge/Badge.tsx @@ -9,7 +9,7 @@ import tinycolor from 'tinycolor2'; import { css } from 'emotion'; import { HorizontalGroup } from '..'; -export type BadgeColor = 'blue' | 'red' | 'green' | 'orange'; +export type BadgeColor = 'blue' | 'red' | 'green' | 'orange' | 'purple'; export interface BadgeProps { text: string; diff --git a/packages/grafana-ui/src/components/InfoBox/FeatureInfoBox.tsx b/packages/grafana-ui/src/components/InfoBox/FeatureInfoBox.tsx index 43845d3e536..6573aab3f8b 100644 --- a/packages/grafana-ui/src/components/InfoBox/FeatureInfoBox.tsx +++ b/packages/grafana-ui/src/components/InfoBox/FeatureInfoBox.tsx @@ -9,6 +9,7 @@ interface FeatureInfoBox extends Omit(({ title, featureState, ...otherProps }, ref) => { const theme = useTheme(); diff --git a/pkg/services/sqlstore/sqlstore.go b/pkg/services/sqlstore/sqlstore.go index 52b40267cff..e7d578edb87 100644 --- a/pkg/services/sqlstore/sqlstore.go +++ b/pkg/services/sqlstore/sqlstore.go @@ -101,6 +101,11 @@ func (ss *SqlStore) Init() error { ss.addUserQueryAndCommandHandlers() ss.addAlertNotificationUidByIdHandler() + err = ss.logOrgsNotice() + if err != nil { + return err + } + if ss.skipEnsureDefaultOrgAndUser { return nil } @@ -108,6 +113,30 @@ func (ss *SqlStore) Init() error { return ss.ensureMainOrgAndAdminUser() } +func (ss *SqlStore) logOrgsNotice() error { + type targetCount struct { + Count int64 + } + + return ss.WithDbSession(context.Background(), func(session *DBSession) error { + resp := make([]*targetCount, 0) + if err := session.SQL("select count(id) as Count from org").Find(&resp); err != nil { + return err + } + + if resp[0].Count > 1 { + ss.log.Warn(`[Deprecation notice]`) + ss.log.Warn(`Fewer than 1% of Grafana installations use organizations, and we feel that most of those`) + ss.log.Warn(`users would have a better experience using Teams instead. As such, we are considering de-emphasizing`) + ss.log.Warn(`and eventually deprecating Organizations in a future Grafana release. If you would like to provide`) + ss.log.Warn(`feedback or describe your need, please do so in the issue linked below`) + ss.log.Warn(`https://github.com/grafana/grafana/issues/24588`) + } + + return nil + }) +} + func (ss *SqlStore) ensureMainOrgAndAdminUser() error { err := ss.InTransaction(context.Background(), func(ctx context.Context) error { systemUserCountQuery := models.GetSystemUserCountStatsQuery{} diff --git a/public/app/features/admin/AdminListOrgsPage.tsx b/public/app/features/admin/AdminListOrgsPage.tsx index 791598b270e..67bb2deacd8 100644 --- a/public/app/features/admin/AdminListOrgsPage.tsx +++ b/public/app/features/admin/AdminListOrgsPage.tsx @@ -3,7 +3,7 @@ import { getNavModel } from 'app/core/selectors/navModel'; import Page from 'app/core/components/Page/Page'; import { useSelector } from 'react-redux'; import { StoreState } from 'app/types/store'; -import { LinkButton } from '@grafana/ui'; +import { LinkButton, InfoBox, VerticalGroup } from '@grafana/ui'; import { getBackendSrv } from '@grafana/runtime'; import { AdminOrgsTable } from './AdminOrgsTable'; import useAsyncFn from 'react-use/lib/useAsyncFn'; @@ -29,6 +29,21 @@ export const AdminListOrgsPages: FC = () => { <>
+ + +

+ Fewer than 1% of Grafana installations use organizations, and we think that most of those would have a + better experience with Teams instead. As such, we are considering de-emphasizing and eventually + deprecating Organizations in a future Grafana release. If you would like to provide feedback or + describe your need, please do so{' '} + + here + + .{' '} +

+
+
+
New org