mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
NestedFolders: make sure DashboardPage code is feature toggled correctly (#68602)
make sure DashboardPage code is feature toggled correctly
This commit is contained in:
parent
1e6eae3913
commit
bbb6795757
@ -4,7 +4,7 @@ import { connect, ConnectedProps } from 'react-redux';
|
||||
|
||||
import { NavModel, NavModelItem, TimeRange, PageLayoutType, locationUtil } from '@grafana/data';
|
||||
import { selectors } from '@grafana/e2e-selectors';
|
||||
import { locationService } from '@grafana/runtime';
|
||||
import { config, locationService } from '@grafana/runtime';
|
||||
import { Themeable2, withTheme2 } from '@grafana/ui';
|
||||
import { notifyApp } from 'app/core/actions';
|
||||
import { Page } from 'app/core/components/Page/Page';
|
||||
@ -439,12 +439,22 @@ function updateStatePageNavFromProps(props: Props, state: State): State {
|
||||
|
||||
// Check if folder changed
|
||||
const { folderTitle, folderUid } = dashboard.meta;
|
||||
const folderNavModel = folderUid ? getNavModel(navIndex, `folder-dashboards-${folderUid}`).main : undefined;
|
||||
if (folderTitle && folderUid && pageNav && pageNav.parentItem?.text !== folderTitle) {
|
||||
pageNav = {
|
||||
...pageNav,
|
||||
parentItem: folderNavModel,
|
||||
};
|
||||
if (config.featureToggles.nestedFolders) {
|
||||
const folderNavModel = folderUid ? getNavModel(navIndex, `folder-dashboards-${folderUid}`).main : undefined;
|
||||
pageNav = {
|
||||
...pageNav,
|
||||
parentItem: folderNavModel,
|
||||
};
|
||||
} else {
|
||||
pageNav = {
|
||||
...pageNav,
|
||||
parentItem: {
|
||||
text: folderTitle,
|
||||
url: `/dashboards/f/${dashboard.meta.folderUid}`,
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if (props.route.routeName === DashboardRoutes.Path) {
|
||||
|
Loading…
Reference in New Issue
Block a user