From a43ede70bc9268aed64a9df0240157bf8ccab9d1 Mon Sep 17 00:00:00 2001 From: Peter Holmberg Date: Mon, 1 Oct 2018 14:02:13 +0200 Subject: [PATCH] added default prop instead of specifying prop --- public/app/core/components/OrgActionBar/OrgActionBar.tsx | 4 ++++ public/app/features/datasources/DataSourcesListPage.test.tsx | 3 +++ public/app/features/plugins/PluginListPage.tsx | 1 - 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/public/app/core/components/OrgActionBar/OrgActionBar.tsx b/public/app/core/components/OrgActionBar/OrgActionBar.tsx index 52d74569639..f3112ffaefd 100644 --- a/public/app/core/components/OrgActionBar/OrgActionBar.tsx +++ b/public/app/core/components/OrgActionBar/OrgActionBar.tsx @@ -11,6 +11,10 @@ export interface Props { } export default class OrgActionBar extends PureComponent { + static defaultProps = { + showLayoutMode: true, + }; + render() { const { searchQuery, layoutMode, setLayoutMode, linkButton, setSearchQuery, showLayoutMode } = this.props; diff --git a/public/app/features/datasources/DataSourcesListPage.test.tsx b/public/app/features/datasources/DataSourcesListPage.test.tsx index fed7954d716..96f6c304b16 100644 --- a/public/app/features/datasources/DataSourcesListPage.test.tsx +++ b/public/app/features/datasources/DataSourcesListPage.test.tsx @@ -12,6 +12,9 @@ const setup = (propOverrides?: object) => { loadDataSources: jest.fn(), navModel: {} as NavModel, dataSourcesCount: 0, + searchQuery: '', + setDataSourcesSearchQuery: jest.fn(), + setDataSourcesLayoutMode: jest.fn(), }; Object.assign(props, propOverrides); diff --git a/public/app/features/plugins/PluginListPage.tsx b/public/app/features/plugins/PluginListPage.tsx index 22ff0be367f..c24d44d6826 100644 --- a/public/app/features/plugins/PluginListPage.tsx +++ b/public/app/features/plugins/PluginListPage.tsx @@ -42,7 +42,6 @@ export class PluginListPage extends PureComponent {
setPluginsLayoutMode(mode)} setSearchQuery={query => setPluginsSearchQuery(query)}