PageLayouts: Updates dashboard section routes with navId (#52175)

* First stab at new page layouts behind feature toggle

* Simplifying PageHeader

* Progress on a new model that can more easily support new and old page layouts

* Progress

* rename folder

* Progress

* Minor change

* fixes

* Fixing tests

* Make breadcrumbs work

* Add tests for old Page component

* Adding tests for new Page component and behavior

* fixing page header test

* Fixed test

* Moving user profile routes to navId

* PageLayouts: Updates dashboards routes with navId

* added missing navId

* AppChrome outside route

* Renaming folder

* Minor fix

* Updated

* Fixing StoragePage

* Updated

* Updating translation ids

* Updated snapshot

* update nav translation ids (yes this is confusing)

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: joshhunt <josh@trtr.co>
This commit is contained in:
Torkel Ödegaard
2022-07-20 17:26:52 +02:00
committed by GitHub
parent 320262c3db
commit 77f7e8dafc
23 changed files with 80 additions and 218 deletions

View File

@ -22,7 +22,6 @@ import {
import appEvents from 'app/core/app_events';
import { Page } from 'app/core/components/Page/Page';
import { GrafanaRouteComponentProps } from 'app/core/navigation/types';
import { getNavModel } from 'app/core/selectors/navModel';
import { StoreState } from 'app/types';
import { cleanUpAction } from '../../core/actions/cleanUp';
@ -40,7 +39,6 @@ type OwnProps = Themeable2 & GrafanaRouteComponentProps<{}, DashboardImportPageR
const IMPORT_STARTED_EVENT_NAME = 'dashboard_import_loaded';
const mapStateToProps = (state: StoreState) => ({
navModel: getNavModel(state.navIndex, 'import', undefined, true),
loadingState: state.importDashboard.state,
});
@ -189,10 +187,10 @@ class UnthemedDashboardImport extends PureComponent<Props> {
}
render() {
const { loadingState, navModel } = this.props;
const { loadingState } = this.props;
return (
<Page navModel={navModel}>
<Page navId="dashboards/import">
<Page.Contents>
{loadingState === LoadingState.Loading && (
<VerticalGroup justify="center">

View File

@ -1,23 +1,12 @@
import React, { FC } from 'react';
import { MapStateToProps, connect } from 'react-redux';
import React from 'react';
import { NavModel } from '@grafana/data';
import { Page } from 'app/core/components/Page/Page';
import { getNavModel } from 'app/core/selectors/navModel';
import { StoreState } from 'app/types';
import { GrafanaRouteComponentProps } from '../../core/navigation/types';
import { SnapshotListTable } from './components/SnapshotListTable';
interface ConnectedProps {
navModel: NavModel;
}
interface Props extends ConnectedProps, GrafanaRouteComponentProps {}
export const SnapshotListPage: FC<Props> = ({ navModel, location }) => {
export const SnapshotListPage = ({}) => {
return (
<Page navModel={navModel}>
<Page navId="dashboards/snapshots">
<Page.Contents>
<SnapshotListTable />
</Page.Contents>
@ -25,8 +14,4 @@ export const SnapshotListPage: FC<Props> = ({ navModel, location }) => {
);
};
const mapStateToProps: MapStateToProps<ConnectedProps, {}, StoreState> = (state: StoreState) => ({
navModel: getNavModel(state.navIndex, 'snapshots'),
});
export default connect(mapStateToProps)(SnapshotListPage);
export default SnapshotListPage;