Commit 186ed1a3 by Johannes Schill

chore: Fix typings and add Page-component to FolderPermissions #14762

parent ab62a09f
...@@ -4,7 +4,9 @@ exports[`Render should render alert rules 1`] = ` ...@@ -4,7 +4,9 @@ exports[`Render should render alert rules 1`] = `
<Page <Page
navModel={Object {}} navModel={Object {}}
> >
<PageContents> <PageContents
isLoading={false}
>
<div <div
className="page-action-bar" className="page-action-bar"
> >
...@@ -156,7 +158,9 @@ exports[`Render should render component 1`] = ` ...@@ -156,7 +158,9 @@ exports[`Render should render component 1`] = `
<Page <Page
navModel={Object {}} navModel={Object {}}
> >
<PageContents> <PageContents
isLoading={false}
>
<div <div
className="page-action-bar" className="page-action-bar"
> >
......
...@@ -21,7 +21,7 @@ import { getNavModel } from 'app/core/selectors/navModel'; ...@@ -21,7 +21,7 @@ import { getNavModel } from 'app/core/selectors/navModel';
import { getRouteParamsId } from 'app/core/selectors/location'; import { getRouteParamsId } from 'app/core/selectors/location';
// Types // Types
import { NavModel, Plugin } from 'app/types/'; import { NavModel, Plugin, StoreState } from 'app/types/';
import { DataSourceSettings } from '@grafana/ui/src/types/'; import { DataSourceSettings } from '@grafana/ui/src/types/';
import { getDataSourceLoadingNav } from '../state/navModel'; import { getDataSourceLoadingNav } from '../state/navModel';
...@@ -232,7 +232,7 @@ export class DataSourceSettingsPage extends PureComponent<Props, State> { ...@@ -232,7 +232,7 @@ export class DataSourceSettingsPage extends PureComponent<Props, State> {
} }
} }
function mapStateToProps(state) { function mapStateToProps(state: StoreState) {
const pageId = getRouteParamsId(state.location); const pageId = getRouteParamsId(state.location);
const dataSource = getDataSource(state.dataSources, pageId); const dataSource = getDataSource(state.dataSources, pageId);
......
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { hot } from 'react-hot-loader'; import { hot } from 'react-hot-loader';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import PageHeader from 'app/core/components/PageHeader/PageHeader'; import Page from 'app/core/components/Page/Page';
import { Tooltip } from '@grafana/ui'; import { Tooltip } from '@grafana/ui';
import SlideDown from 'app/core/components/Animations/SlideDown'; import SlideDown from 'app/core/components/Animations/SlideDown';
import { getNavModel } from 'app/core/selectors/navModel'; import { getNavModel } from 'app/core/selectors/navModel';
...@@ -35,7 +35,7 @@ export interface State { ...@@ -35,7 +35,7 @@ export interface State {
} }
export class FolderPermissions extends PureComponent<Props, State> { export class FolderPermissions extends PureComponent<Props, State> {
constructor(props) { constructor(props: Props) {
super(props); super(props);
this.state = { this.state = {
...@@ -73,15 +73,14 @@ export class FolderPermissions extends PureComponent<Props, State> { ...@@ -73,15 +73,14 @@ export class FolderPermissions extends PureComponent<Props, State> {
const { isAdding } = this.state; const { isAdding } = this.state;
if (folder.id === 0) { if (folder.id === 0) {
return <PageHeader model={navModel} />; return <Page navModel={navModel}><Page.Contents isLoading={true}><span></span></Page.Contents></Page>;
} }
const folderInfo = { title: folder.title, url: folder.url, id: folder.id }; const folderInfo = { title: folder.title, url: folder.url, id: folder.id };
return ( return (
<div> <Page navModel={navModel}>
<PageHeader model={navModel} /> <Page.Contents>
<div className="page-container page-body">
<div className="page-action-bar"> <div className="page-action-bar">
<h3 className="page-sub-heading">Folder Permissions</h3> <h3 className="page-sub-heading">Folder Permissions</h3>
<Tooltip placement="auto" content={<PermissionsInfo />}> <Tooltip placement="auto" content={<PermissionsInfo />}>
...@@ -104,8 +103,8 @@ export class FolderPermissions extends PureComponent<Props, State> { ...@@ -104,8 +103,8 @@ export class FolderPermissions extends PureComponent<Props, State> {
isFetching={false} isFetching={false}
folderInfo={folderInfo} folderInfo={folderInfo}
/> />
</div> </Page.Contents>
</div> </Page>
); );
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment