diff --git a/ui/src/dashboards/components/DashboardHeader.tsx b/ui/src/dashboards/components/DashboardHeader.tsx index ffd30051d..66410d754 100644 --- a/ui/src/dashboards/components/DashboardHeader.tsx +++ b/ui/src/dashboards/components/DashboardHeader.tsx @@ -54,6 +54,7 @@ interface Props { onRenameDashboard: (name: string) => Promise dashboardLinks: DashboardsModels.DashboardSwitcherLinks isHidden: boolean + children?: JSX.Element } @ErrorHandling @@ -105,6 +106,7 @@ class DashboardHeader extends Component { onSetTimeZone, onManualRefresh, handleChooseAutoRefresh, + children, } = this.props const {selected} = this.state @@ -134,6 +136,7 @@ class DashboardHeader extends Component { shape={ButtonShape.Square} titleText="Enter Full-Screen Presentation Mode" /> + {children} ) diff --git a/ui/src/dashboards/containers/DashboardPage.tsx b/ui/src/dashboards/containers/DashboardPage.tsx index f4994dce9..b55fbd96c 100644 --- a/ui/src/dashboards/containers/DashboardPage.tsx +++ b/ui/src/dashboards/containers/DashboardPage.tsx @@ -59,10 +59,18 @@ import * as QueriesModels from 'src/types/queries' import * as SourcesModels from 'src/types/sources' import * as TempVarsModels from 'src/types/tempVars' import {NewDefaultCell} from 'src/types/dashboards' -import {NotificationAction, TimeZones, RefreshRate} from 'src/types' +import { + NotificationAction, + TimeZones, + RefreshRate, + Me, + Links as CommonLinks, +} from 'src/types' import {AnnotationsDisplaySetting} from 'src/types/annotations' import {Links} from 'src/types/flux' import {createTimeRangeTemplates} from 'src/shared/utils/templates' +import UserNavBlock from 'src/side_nav/components/UserNavBlock' +import {READER_ROLE} from 'src/auth/Authorized' interface OwnProps extends ManualRefreshProps, WithRouterProps { source: SourcesModels.Source @@ -119,6 +127,9 @@ type ReduxDispatchProps = ResolveThunks<{ updateTemplateQueryParams: typeof dashboardActions.updateTemplateQueryParams updateQueryParams: typeof dashboardActions.updateQueryParams updateTimeRangeQueryParams: typeof dashboardActions.updateTimeRangeQueryParams + logoutLink?: string + me: Me + links: CommonLinks }> type Props = OwnProps & ReduxStateProps & ReduxDispatchProps @@ -270,6 +281,9 @@ class DashboardPage extends Component { showTemplateVariableControlBar, handleClickPresentationButton, toggleTemplateVariableControlBar, + me, + logoutLink, + links, } = this.props const {dashboardTime, upperDashboardTime} = createTimeRangeTemplates( @@ -335,7 +349,16 @@ class DashboardPage extends Component { onToggleShowTempVarControls={toggleTemplateVariableControlBar} onToggleShowAnnotationControls={this.toggleAnnotationControls} handleClickPresentationButton={handleClickPresentationButton} - /> + > + {isUsingAuth && me.role === READER_ROLE ? ( + + ) : undefined} + {!inPresentationMode && showTemplateVariableControlBar && ( { annotations: {displaySetting}, dashboardUI: {dashboards, cellQueryStatuses, zoomedTimeRange}, sources, - auth: {me, isUsingAuth}, + auth: {me, isUsingAuth, logoutLink}, cellEditorOverlay: {timeRange: editorTimeRange}, } = state @@ -628,7 +651,10 @@ const mstp = (state: any, {params: {dashboardID}}) => { editorTimeRange, showTemplateVariableControlBar, annotationsDisplaySetting: displaySetting, - } as ReduxStateProps + logoutLink, + me, + links, + } } const mdtp = {