Skip to content

Commit

Permalink
Fix: hide DashboardControlBar in home page #11
Browse files Browse the repository at this point in the history
  • Loading branch information
luckylooky2 committed Jun 27, 2024
1 parent ccb6d3a commit e9a3825
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions public/app/core/components/AppChrome/AppChrome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useMediaQueryChange } from 'app/core/hooks/useMediaQueryChange';
import store from 'app/core/store';
import { useLoadNextChildrenPage } from 'app/features/browse-dashboards/state';
import { CommandPalette } from 'app/features/commandPalette/CommandPalette';
import { determineUrl } from 'app/features/dashboard/utils/42cluster';
import { determineUrl, DASHBOARD, LOGIN } from 'app/features/dashboard/utils/42cluster';
import { KioskMode } from 'app/types';

import { AppChromeMenu } from './AppChromeMenu';
Expand All @@ -30,7 +30,8 @@ export function AppChrome({ children }: Props) {
const searchBarHidden = state.searchBarHidden || state.kioskMode === KioskMode.TV;
const theme = useTheme2();
const styles = useStyles2(getStyles);
const [dashboardUrl, loginUrl] = determineUrl();
const dashboardUrl = determineUrl(DASHBOARD);
const loginUrl = determineUrl(LOGIN);
const isDashboardPage = window.location.pathname.startsWith(dashboardUrl);
const isLogin = window.location.pathname.startsWith(loginUrl);
// should render when kiosk mode is full while only at dashboard page
Expand Down
3 changes: 2 additions & 1 deletion public/app/features/dashboard/containers/DashboardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { liveTimer } from '../dashgrid/liveTimer';
import { getTimeSrv } from '../services/TimeSrv';
import { cleanUpDashboardAndVariables } from '../state/actions';
import { initDashboard } from '../state/initDashboard';
import { determineUrl, ROOT } from '../utils/42cluster';

import DashboardControlBar from './DashboardControlBar';
import { DashboardPageRouteParams, DashboardPageRouteSearchParams } from './types';
Expand Down Expand Up @@ -315,7 +316,7 @@ export class UnthemedDashboardPage extends PureComponent<Props, State> {
const showSubMenu = !editPanel && !kioskMode && !this.props.queryParams.editview;

const showToolbar = kioskMode !== KioskMode.Full && !queryParams.editview;
const isHome = window.location.pathname === '/';
const isHome = window.location.pathname === determineUrl(ROOT);

const pageClassName = cx({
'panel-in-fullscreen': Boolean(viewPanel),
Expand Down

0 comments on commit e9a3825

Please sign in to comment.