From 186ed1a333ca9d13613baeb412cc7ce4fe277a5a Mon Sep 17 00:00:00 2001 From: Johannes Schill Date: Mon, 28 Jan 2019 22:41:15 +0100 Subject: [PATCH] chore: Fix typings and add Page-component to FolderPermissions #14762 --- .../__snapshots__/AlertRuleList.test.tsx.snap | 8 ++++++-- .../settings/DataSourceSettingsPage.tsx | 4 ++-- public/app/features/folders/FolderPermissions.tsx | 15 +++++++-------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/public/app/features/alerting/__snapshots__/AlertRuleList.test.tsx.snap b/public/app/features/alerting/__snapshots__/AlertRuleList.test.tsx.snap index c5fcefc2539..9270cda93e3 100644 --- a/public/app/features/alerting/__snapshots__/AlertRuleList.test.tsx.snap +++ b/public/app/features/alerting/__snapshots__/AlertRuleList.test.tsx.snap @@ -4,7 +4,9 @@ exports[`Render should render alert rules 1`] = ` - +
@@ -156,7 +158,9 @@ exports[`Render should render component 1`] = ` - +
diff --git a/public/app/features/datasources/settings/DataSourceSettingsPage.tsx b/public/app/features/datasources/settings/DataSourceSettingsPage.tsx index bb784fd928b..ff840390cf5 100644 --- a/public/app/features/datasources/settings/DataSourceSettingsPage.tsx +++ b/public/app/features/datasources/settings/DataSourceSettingsPage.tsx @@ -21,7 +21,7 @@ import { getNavModel } from 'app/core/selectors/navModel'; import { getRouteParamsId } from 'app/core/selectors/location'; // Types -import { NavModel, Plugin } from 'app/types/'; +import { NavModel, Plugin, StoreState } from 'app/types/'; import { DataSourceSettings } from '@grafana/ui/src/types/'; import { getDataSourceLoadingNav } from '../state/navModel'; @@ -232,7 +232,7 @@ export class DataSourceSettingsPage extends PureComponent { } } -function mapStateToProps(state) { +function mapStateToProps(state: StoreState) { const pageId = getRouteParamsId(state.location); const dataSource = getDataSource(state.dataSources, pageId); diff --git a/public/app/features/folders/FolderPermissions.tsx b/public/app/features/folders/FolderPermissions.tsx index 78cb2170785..51cad0d6c0f 100644 --- a/public/app/features/folders/FolderPermissions.tsx +++ b/public/app/features/folders/FolderPermissions.tsx @@ -1,7 +1,7 @@ import React, { PureComponent } from 'react'; import { hot } from 'react-hot-loader'; 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 SlideDown from 'app/core/components/Animations/SlideDown'; import { getNavModel } from 'app/core/selectors/navModel'; @@ -35,7 +35,7 @@ export interface State { } export class FolderPermissions extends PureComponent { - constructor(props) { + constructor(props: Props) { super(props); this.state = { @@ -73,15 +73,14 @@ export class FolderPermissions extends PureComponent { const { isAdding } = this.state; if (folder.id === 0) { - return ; + return ; } const folderInfo = { title: folder.title, url: folder.url, id: folder.id }; return ( -
- -
+ +

Folder Permissions

}> @@ -104,8 +103,8 @@ export class FolderPermissions extends PureComponent { isFetching={false} folderInfo={folderInfo} /> -
-
+ + ); } }