mirror of
https://github.com/grafana/grafana.git
synced 2025-08-06 20:59:35 +08:00
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:
@ -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">
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user