mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Dashboards: Prevent template variables from resolving twice (#66372)
This commit is contained in:
parent
2991d4c213
commit
38ee910e39
@ -47,31 +47,32 @@ export function AppChrome({ children }: Props) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Chromeless routes are without topNav, mega menu, search & command palette
|
// Chromeless routes are without topNav, mega menu, search & command palette
|
||||||
if (state.chromeless) {
|
// We check chromeless twice here instead of having a separate path so {children}
|
||||||
return (
|
// doesn't get re-mounted when chromeless goes from true to false.
|
||||||
<main className="main-view">
|
|
||||||
<div className={contentClass}>{children}</div>
|
|
||||||
</main>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<main className="main-view">
|
<main className="main-view">
|
||||||
<div className={cx(styles.topNav)}>
|
{!state.chromeless && (
|
||||||
{!searchBarHidden && <TopSearchBar />}
|
<div className={cx(styles.topNav)}>
|
||||||
<NavToolbar
|
{!searchBarHidden && <TopSearchBar />}
|
||||||
searchBarHidden={searchBarHidden}
|
<NavToolbar
|
||||||
sectionNav={state.sectionNav}
|
searchBarHidden={searchBarHidden}
|
||||||
pageNav={state.pageNav}
|
sectionNav={state.sectionNav}
|
||||||
actions={state.actions}
|
pageNav={state.pageNav}
|
||||||
onToggleSearchBar={chrome.onToggleSearchBar}
|
actions={state.actions}
|
||||||
onToggleMegaMenu={chrome.onToggleMegaMenu}
|
onToggleSearchBar={chrome.onToggleSearchBar}
|
||||||
onToggleKioskMode={chrome.onToggleKioskMode}
|
onToggleMegaMenu={chrome.onToggleMegaMenu}
|
||||||
/>
|
onToggleKioskMode={chrome.onToggleKioskMode}
|
||||||
</div>
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
<div className={contentClass}>{children}</div>
|
<div className={contentClass}>{children}</div>
|
||||||
<MegaMenu searchBarHidden={searchBarHidden} onClose={() => chrome.setMegaMenu(false)} />
|
{!state.chromeless && (
|
||||||
<CommandPalette />
|
<>
|
||||||
|
<MegaMenu searchBarHidden={searchBarHidden} onClose={() => chrome.setMegaMenu(false)} />
|
||||||
|
<CommandPalette />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</main>
|
</main>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -73,6 +73,7 @@ export class AppChromeService {
|
|||||||
// Some updates can have new instance of sectionNav or pageNav but with same values
|
// Some updates can have new instance of sectionNav or pageNav but with same values
|
||||||
if (newState.sectionNav !== current.sectionNav || newState.pageNav !== current.pageNav) {
|
if (newState.sectionNav !== current.sectionNav || newState.pageNav !== current.pageNav) {
|
||||||
if (
|
if (
|
||||||
|
newState.actions === current.actions &&
|
||||||
navItemsAreTheSame(newState.sectionNav, current.sectionNav) &&
|
navItemsAreTheSame(newState.sectionNav, current.sectionNav) &&
|
||||||
navItemsAreTheSame(newState.pageNav, current.pageNav)
|
navItemsAreTheSame(newState.pageNav, current.pageNav)
|
||||||
) {
|
) {
|
||||||
|
Loading…
Reference in New Issue
Block a user