From eee9b94cc24b90c82cfc61c1ed6c38907055a08e Mon Sep 17 00:00:00 2001 From: Alex P Date: Thu, 29 Mar 2018 10:50:22 -0700 Subject: [PATCH] Use ConfirmButton when deleting a InfluxDB Connection --- ui/src/sources/components/InfluxTable.js | 216 ++++++++++++----------- ui/src/style/unsorted.scss | 24 ++- 2 files changed, 128 insertions(+), 112 deletions(-) diff --git a/ui/src/sources/components/InfluxTable.js b/ui/src/sources/components/InfluxTable.js index 617484c4bc..476f8caef3 100644 --- a/ui/src/sources/components/InfluxTable.js +++ b/ui/src/sources/components/InfluxTable.js @@ -7,6 +7,7 @@ import Authorized, {EDITOR_ROLE} from 'src/auth/Authorized' import Dropdown from 'shared/components/Dropdown' import QuestionMarkTooltip from 'shared/components/QuestionMarkTooltip' +import ConfirmButton from 'shared/components/ConfirmButton' const kapacitorDropdown = ( kapacitors, @@ -96,117 +97,124 @@ const InfluxTable = ({ handleDeleteKapacitor, isUsingAuth, me, -}) => ( -
-
-
-
-

- {isUsingAuth ? ( - - Connections for {me.currentOrganization.name} - - ) : ( - Connections - )} -

- - - Add Connection - - -
-
- - - - - - - - - {sources.map(s => { - return ( - - - + + + ) + })} + +
- InfluxDB Connection - - Kapacitor Connection{' '} - Kapacitor Connections are
scoped per InfluxDB Connection.
Only one can be active at a time.

' - } - /> -
- {s.id === source.id ? ( -
- Connected -
- ) : ( - - Connect - - )} -
-
- {s.name}} - > +}) => { + const wrappedDelete = s => () => { + handleDeleteSource(s) + } + return ( +
+
+
+
+

+ {isUsingAuth ? ( + + Connections for {me.currentOrganization.name} + + ) : ( + Connections + )} +

+ + + Add Connection + + +
+
+ + + + + + + + + {sources.map(s => { + return ( + + + + - - - - ) - })} - -
+ InfluxDB Connection + + Kapacitor Connection{' '} + Kapacitor Connections are
scoped per InfluxDB Connection.
Only one can be active at a time.

' + } + /> +
+ {s.id === source.id ? ( +
+ Connected +
+ ) : ( + Connect + + )} +
+
+ {s.name} } > - {s.name} - {s.default ? ' (Default)' : null} - + + {s.name} + {s.default ? ' (Default)' : null} + + +
+ {s.url} +
+ + - - {s.url} - - - - Delete Connection - - - - {kapacitorDropdown( - s.kapacitors, - s, - router, - setActiveKapacitor, - handleDeleteKapacitor - )} -
+
+ {kapacitorDropdown( + s.kapacitors, + s, + router, + setActiveKapacitor, + handleDeleteKapacitor + )} +
+
- -) + ) +} const {array, bool, func, shape, string} = PropTypes diff --git a/ui/src/style/unsorted.scss b/ui/src/style/unsorted.scss index 0d819a428c..d7eb036d7f 100644 --- a/ui/src/style/unsorted.scss +++ b/ui/src/style/unsorted.scss @@ -203,7 +203,7 @@ br { margin-bottom: 4px; &.intro { - @include gradient-h($c-pool,$c-star); + @include gradient-h($c-pool, $c-star); color: $g20-white; } @@ -306,7 +306,7 @@ $tick-script-overlay-margin: 30px; ----------------------------------------------------------------------------- */ .icon.download.dlcsv:before { - content: "\e91d"; + content: '\e91d'; font-weight: bold; color: #bec2cc; } @@ -403,23 +403,23 @@ $dash-editable-header-padding: 7px; .page-header__left.page-header__dash-editable, .dashboard-title, -.dashboard-title input[type="text"].form-control.dashboard-title--input, +.dashboard-title input[type='text'].form-control.dashboard-title--input, .dashboard-title h1 { flex: 1 0 0; } .dashboard-title { display: flex; - input[type="text"].form-control.dashboard-title--input, - input[type="text"].form-control.dashboard-title--input:focus, + input[type='text'].form-control.dashboard-title--input, + input[type='text'].form-control.dashboard-title--input:focus, h1 { font-size: $page-header-size; font-weight: $page-header-weight; padding: 0 $dash-editable-header-padding; } - input[type="text"].form-control.dashboard-title--input, - input[type="text"].form-control.dashboard-title--input:focus { + input[type='text'].form-control.dashboard-title--input, + input[type='text'].form-control.dashboard-title--input:focus { font-size: $page-header-size; font-weight: $page-header-weight; } @@ -439,7 +439,7 @@ $dash-editable-header-padding: 7px; border-color 0.25s ease; &:after { - content: "\f058"; + content: '\f058'; font-family: 'icomoon'; position: absolute; font-size: 15px; @@ -550,3 +550,11 @@ div.dropdown.dropdown-stretch > div.dropdown-toggle, div.dropdown.dropdown-stretch > button.dropdown-toggle { width: 100%; } + +/* + Delete Source + ----------------------------------------------------------------------------- +*/ +.delete-source { + display: inline-block; +}