From d593a7ff959ecbd45b7e052038485de57c521a57 Mon Sep 17 00:00:00 2001 From: Jade McGough Date: Wed, 26 Apr 2017 14:06:20 -0700 Subject: [PATCH 1/3] prettier --- ui/src/sources/components/SourceForm.js | 124 +++++++++++++++++++----- 1 file changed, 98 insertions(+), 26 deletions(-) diff --git a/ui/src/sources/components/SourceForm.js b/ui/src/sources/components/SourceForm.js index 4dd228a7f..bbb4f615c 100644 --- a/ui/src/sources/components/SourceForm.js +++ b/ui/src/sources/components/SourceForm.js @@ -3,11 +3,7 @@ import classNames from 'classnames' import {insecureSkipVerifyText} from 'src/shared/copy/tooltipText' import _ from 'lodash' -const { - bool, - func, - shape, -} = PropTypes +const {bool, func, shape} = PropTypes export const SourceForm = React.createClass({ propTypes: { @@ -28,7 +24,9 @@ export const SourceForm = React.createClass({ password: this.sourcePassword.value, 'default': this.sourceDefault.checked, telegraf: this.sourceTelegraf.value, - insecureSkipVerify: this.sourceInsecureSkipVerify ? this.sourceInsecureSkipVerify.checked : false, + insecureSkipVerify: this.sourceInsecureSkipVerify + ? this.sourceInsecureSkipVerify.checked + : false, metaUrl: this.metaUrl && this.metaUrl.value.trim(), } @@ -56,50 +54,124 @@ export const SourceForm = React.createClass({ return (

Connection Details

-
+
- this.sourceURL = r} className="form-control" id="connect-string" placeholder="http://localhost:8086" onChange={onInputChange} value={source.url || ''} onBlur={this.handleBlurSourceURL}> + this.sourceURL = r} + className="form-control" + id="connect-string" + placeholder="http://localhost:8086" + onChange={onInputChange} + value={source.url || ''} + onBlur={this.handleBlurSourceURL} + />
- this.sourceName = r} className="form-control" id="name" placeholder="Influx 1" onChange={onInputChange} value={source.name || ''}> + this.sourceName = r} + className="form-control" + id="name" + placeholder="Influx 1" + onChange={onInputChange} + value={source.name || ''} + />
- this.sourceUsername = r} className="form-control" id="username" onChange={onInputChange} value={source.username || ''}> + this.sourceUsername = r} + className="form-control" + id="username" + onChange={onInputChange} + value={source.username || ''} + />
- this.sourcePassword = r} className="form-control" id="password" onChange={onInputChange} value={source.password || ''}> + this.sourcePassword = r} + className="form-control" + id="password" + onChange={onInputChange} + value={source.password || ''} + />
- {_.get(source, 'type', '').includes('enterprise') ? -
+ {_.get(source, 'type', '').includes('enterprise') + ?
- this.metaUrl = r} className="form-control" id="meta-url" placeholder="http://localhost:8091" onChange={onInputChange} value={source.metaUrl || ''}> -
: null} + this.metaUrl = r} + className="form-control" + id="meta-url" + placeholder="http://localhost:8091" + onChange={onInputChange} + value={source.metaUrl || ''} + /> +
+ : null}
- this.sourceTelegraf = r} className="form-control" id="telegraf" onChange={onInputChange} value={source.telegraf || 'telegraf'}> + this.sourceTelegraf = r} + className="form-control" + id="telegraf" + onChange={onInputChange} + value={source.telegraf || 'telegraf'} + />
- this.sourceDefault = r} /> - + this.sourceDefault = r} + /> +
- {_.get(source, 'url', '').startsWith('https') ? -
-
- this.sourceInsecureSkipVerify = r} /> - + {_.get(source, 'url', '').startsWith('https') + ?
+
+ this.sourceInsecureSkipVerify = r} + /> + +
+
- -
: null} + : null}
- +
From cd0b5016f18a1063d5c35cdd83dd64691dabb88f Mon Sep 17 00:00:00 2001 From: Jade McGough Date: Wed, 26 Apr 2017 14:08:51 -0700 Subject: [PATCH 2/3] require a connection string and name when creating a connection --- ui/src/sources/components/SourceForm.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/src/sources/components/SourceForm.js b/ui/src/sources/components/SourceForm.js index bbb4f615c..a5813f321 100644 --- a/ui/src/sources/components/SourceForm.js +++ b/ui/src/sources/components/SourceForm.js @@ -69,6 +69,7 @@ export const SourceForm = React.createClass({ onChange={onInputChange} value={source.url || ''} onBlur={this.handleBlurSourceURL} + required={true} />
@@ -82,6 +83,7 @@ export const SourceForm = React.createClass({ placeholder="Influx 1" onChange={onInputChange} value={source.name || ''} + required={true} />
From 32c6d07d62b49ebfedce16e62949925b13227a42 Mon Sep 17 00:00:00 2001 From: Jade McGough Date: Wed, 26 Apr 2017 14:12:57 -0700 Subject: [PATCH 3/3] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 29bd71c3a..ec14de524 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ 1. [#1318](https://github.com/influxdata/chronograf/issues/1318): Fix JWT refresh for auth-durations of zero and less than five minutes 1. [#1332](https://github.com/influxdata/chronograf/pull/1332): Remove table toggle from dashboard visualization 1. [#1335](https://github.com/influxdata/chronograf/pull/1335): Improve UX for sanitized kapacitor settings + 1. [#1338](https://github.com/influxdata/chronograf/pull/1338): Require url and name when adding a new source ### Features 1. [#1232](https://github.com/influxdata/chronograf/pull/1232): Fuse the query builder and raw query editor