mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
TopNav: Fix pages import dashboard and create new folder (#56182)
This commit is contained in:
parent
bcd1c48a4d
commit
dba0baec69
@ -1,6 +1,8 @@
|
||||
import React, { PureComponent } from 'react';
|
||||
import { connect, ConnectedProps } from 'react-redux';
|
||||
|
||||
import { NavModelItem } from '@grafana/data';
|
||||
import { config } from '@grafana/runtime';
|
||||
import { Button, Input, Form, Field } from '@grafana/ui';
|
||||
import { Page } from 'app/core/components/Page/Page';
|
||||
|
||||
@ -39,11 +41,17 @@ export class NewDashboardsFolder extends PureComponent<Props> {
|
||||
});
|
||||
};
|
||||
|
||||
pageNav: NavModelItem = {
|
||||
text: 'Create a new folder',
|
||||
subTitle: 'Folders provide a way to group dashboards and alert rules.',
|
||||
breadcrumbs: [{ title: 'Dashboards', url: 'dashboards' }],
|
||||
};
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Page navId="dashboards/folder/new">
|
||||
<Page navId="dashboards/browse" pageNav={this.pageNav}>
|
||||
<Page.Contents>
|
||||
<h3>New dashboard folder</h3>
|
||||
{!config.featureToggles.topnav && <h3>New dashboard folder</h3>}
|
||||
<Form defaultValues={initialFormModel} onSubmit={this.onSubmit}>
|
||||
{({ register, errors }) => (
|
||||
<>
|
||||
|
@ -2,7 +2,7 @@ import { css } from '@emotion/css';
|
||||
import React, { FormEvent, PureComponent } from 'react';
|
||||
import { connect, ConnectedProps } from 'react-redux';
|
||||
|
||||
import { AppEvents, GrafanaTheme2, LoadingState } from '@grafana/data';
|
||||
import { AppEvents, GrafanaTheme2, LoadingState, NavModelItem } from '@grafana/data';
|
||||
import { selectors } from '@grafana/e2e-selectors';
|
||||
import { reportInteraction } from '@grafana/runtime';
|
||||
import {
|
||||
@ -187,11 +187,17 @@ class UnthemedDashboardImport extends PureComponent<Props> {
|
||||
);
|
||||
}
|
||||
|
||||
pageNav: NavModelItem = {
|
||||
text: 'Import dashboard',
|
||||
subTitle: 'Import dashboard from file or Grafana.com"',
|
||||
breadcrumbs: [{ title: 'Dashboards', url: 'dashboards' }],
|
||||
};
|
||||
|
||||
render() {
|
||||
const { loadingState } = this.props;
|
||||
|
||||
return (
|
||||
<Page navId="dashboards/import">
|
||||
<Page navId="dashboards/browse" pageNav={this.pageNav}>
|
||||
<Page.Contents>
|
||||
{loadingState === LoadingState.Loading && (
|
||||
<VerticalGroup justify="center">
|
||||
|
Loading…
Reference in New Issue
Block a user