Public Dashboards: Add Public Tag to Dashboard Title (#52351)

Adds Public tag to dashboard title when it has an enabled public dashboard
This commit is contained in:
owensmallwood
2022-07-19 17:44:41 -06:00
committed by GitHub
parent acd85314b3
commit 3bc13e2335
13 changed files with 143 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ import { useLocation } from 'react-router-dom';
import { locationUtil, textUtil } from '@grafana/data';
import { locationService } from '@grafana/runtime';
import { ButtonGroup, ModalsController, ToolbarButton, PageToolbar, useForceUpdate } from '@grafana/ui';
import { ButtonGroup, ModalsController, ToolbarButton, PageToolbar, useForceUpdate, Tag } from '@grafana/ui';
import { AppChromeUpdate } from 'app/core/components/AppChrome/AppChromeUpdate';
import { NavToolbarSeparator } from 'app/core/components/AppChrome/NavToolbarSeparator';
import config from 'app/core/config';
@@ -154,6 +154,10 @@ export const DashNav = React.memo<Props>((props) => {
);
}
if (dashboard.meta.publicDashboardEnabled) {
buttons.push(<Tag name="Public" colorIndex={5}></Tag>);
}
if (dashboard.uid && config.featureToggles.dashboardComments) {
buttons.push(
<ModalsController key="button-dashboard-comments">