From b944622fbfa1d6ea895ab91151c7e96e35b42337 Mon Sep 17 00:00:00 2001 From: Alex P Date: Tue, 19 Jun 2018 15:46:58 -0700 Subject: [PATCH] Implement PageHeader in SourceForm --- ui/src/sources/containers/SourcePage.tsx | 34 +++++++++++------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/ui/src/sources/containers/SourcePage.tsx b/ui/src/sources/containers/SourcePage.tsx index 2d2edf3148..e43a52ef50 100644 --- a/ui/src/sources/containers/SourcePage.tsx +++ b/ui/src/sources/containers/SourcePage.tsx @@ -18,7 +18,7 @@ import {connect} from 'react-redux' import Notifications from 'src/shared/components/Notifications' import SourceForm from 'src/sources/components/SourceForm' import FancyScrollbar from 'src/shared/components/FancyScrollbar' -import SourceIndicator from 'src/shared/components/SourceIndicator' +import PageHeader from 'src/shared/components/PageHeader' import {DEFAULT_SOURCE} from 'src/shared/constants' import {Source} from 'src/types' @@ -91,24 +91,7 @@ class SourcePage extends PureComponent { return (
-
-
-
-
-

- {editMode - ? 'Configure InfluxDB Connection' - : 'Add a New InfluxDB Connection'} -

-
- {isInitialSource ? null : ( -
- -
- )} -
-
-
+
@@ -131,6 +114,7 @@ class SourcePage extends PureComponent {
) } + private handleSubmit = (e: MouseEvent): void => { e.preventDefault() const {isCreated, editMode} = this.state @@ -140,10 +124,12 @@ class SourcePage extends PureComponent { } this.setState(this.normalizeSource, this.updateSource) } + private gotoPurgatory = (): void => { const {router} = this.props router.push('/purgatory') } + private normalizeSource({source}) { const url = source.url.trim() if (source.url.startsWith('http')) { @@ -261,6 +247,16 @@ class SourcePage extends PureComponent { this.setState(this.normalizeSource, this.createSourceOnBlur) } + + private get pageTitle(): string { + const {editMode} = this.state + + if (editMode) { + return 'Configure InfluxDB Connection' + } + + return 'Add a New InfluxDB Connection' + } } const mdtp = {