Merge pull request #3012 from influxdata/misc-polish

Misc. Polish
pull/3017/merge
Alex Paxton 2018-03-19 18:21:30 -07:00 committed by GitHub
commit 1fdfb495f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 74 additions and 55 deletions

View File

@ -83,7 +83,8 @@ const AllUsersTableRow = ({
confirmText={removeWarning} confirmText={removeWarning}
confirmAction={wrappedDelete} confirmAction={wrappedDelete}
size="btn-xs" size="btn-xs"
text="Remove" type="btn-danger"
text="Delete"
customClass="table--show-on-row-hover" customClass="table--show-on-row-hover"
/> />
</td> </td>

View File

@ -80,7 +80,6 @@ class ProvidersTable extends Component {
<div className="fancytable--th provider--redirect"> <div className="fancytable--th provider--redirect">
Organization Organization
</div> </div>
<div className="fancytable--th" />
<div className="fancytable--th provider--delete" /> <div className="fancytable--th provider--delete" />
</div> </div>
{mappings.map((mapping, i) => {mappings.map((mapping, i) =>

View File

@ -71,13 +71,15 @@ class ProvidersTableRow extends Component {
const isDefaultMapping = DEFAULT_MAPPING_ID === mapping.id const isDefaultMapping = DEFAULT_MAPPING_ID === mapping.id
return ( return (
<div className="fancytable--row"> <div className="fancytable--row">
<Dropdown <div className="fancytable--td provider--scheme">
items={schemes} <Dropdown
onChoose={this.handleChooseScheme} items={schemes}
selected={scheme} onChoose={this.handleChooseScheme}
className="fancytable--td provider--scheme" selected={scheme}
disabled={isDefaultMapping} className="dropdown-stretch"
/> disabled={isDefaultMapping}
/>
</div>
<InputClickToEdit <InputClickToEdit
value={provider} value={provider}
wrapperClass="fancytable--td provider--provider" wrapperClass="fancytable--td provider--provider"

View File

@ -83,12 +83,14 @@ class ProvidersTableRowNew extends PureComponent<Props, State> {
return ( return (
<div className="fancytable--row"> <div className="fancytable--row">
<Dropdown <div className="fancytable--td provider--scheme">
items={schemes} <Dropdown
onChoose={this.handleChooseScheme} items={schemes}
selected={scheme} onChoose={this.handleChooseScheme}
className={'fancytable--td provider--scheme'} selected={scheme}
/> className="dropdown-stretch"
/>
</div>
<InputClickToEdit <InputClickToEdit
value={provider} value={provider}
wrapperClass="fancytable--td provider--provider" wrapperClass="fancytable--td provider--provider"

View File

@ -146,7 +146,6 @@ export class Dropdown extends Component {
const {isOpen, searchTerm, filteredItems, highlightedItemIndex} = this.state const {isOpen, searchTerm, filteredItems, highlightedItemIndex} = this.state
const menuItems = useAutoComplete ? filteredItems : items const menuItems = useAutoComplete ? filteredItems : items
const disabledClass = disabled ? 'disabled' : null
return ( return (
<div <div
@ -165,7 +164,7 @@ export class Dropdown extends Component {
buttonSize={buttonSize} buttonSize={buttonSize}
buttonColor={buttonColor} buttonColor={buttonColor}
toggleStyle={toggleStyle} toggleStyle={toggleStyle}
disabledClass={disabledClass} disabled={disabled}
onFilterChange={this.handleFilterChange} onFilterChange={this.handleFilterChange}
onFilterKeyPress={this.handleFilterKeyPress} onFilterKeyPress={this.handleFilterKeyPress}
/> />
@ -176,7 +175,7 @@ export class Dropdown extends Component {
buttonSize={buttonSize} buttonSize={buttonSize}
buttonColor={buttonColor} buttonColor={buttonColor}
toggleStyle={toggleStyle} toggleStyle={toggleStyle}
disabledClass={disabledClass} disabled={disabled}
/>} />}
{isOpen && menuItems.length {isOpen && menuItems.length
? <DropdownMenu ? <DropdownMenu

View File

@ -2,16 +2,20 @@ import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import classnames from 'classnames' import classnames from 'classnames'
const disabledClass = disabled => (disabled ? ' disabled' : '')
const DropdownHead = ({ const DropdownHead = ({
iconName, iconName,
selected, selected,
buttonSize, buttonSize,
toggleStyle, toggleStyle,
buttonColor, buttonColor,
disabledClass, disabled,
}) => }) =>
<div <div
className={`btn dropdown-toggle ${buttonSize} ${buttonColor} ${disabledClass}`} className={`btn dropdown-toggle ${buttonSize} ${buttonColor}${disabledClass(
disabled
)}`}
style={toggleStyle} style={toggleStyle}
> >
{iconName && <span className={classnames('icon', {[iconName]: true})} />} {iconName && <span className={classnames('icon', {[iconName]: true})} />}
@ -21,15 +25,15 @@ const DropdownHead = ({
<span className="caret" /> <span className="caret" />
</div> </div>
const {string, shape} = PropTypes const {bool, string, shape} = PropTypes
DropdownHead.propTypes = { DropdownHead.propTypes = {
iconName: string, iconName: string,
selected: string, selected: string.isRequired,
buttonSize: string, buttonSize: string.isRequired,
toggleStyle: shape(), toggleStyle: shape(),
buttonColor: string, buttonColor: string.isRequired,
disabledClass: string, disabled: bool,
} }
export default DropdownHead export default DropdownHead

View File

@ -1,17 +1,21 @@
import React from 'react' import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
const disabledClass = disabled => (disabled ? ' disabled' : '')
const DropdownInput = ({ const DropdownInput = ({
searchTerm, searchTerm,
buttonSize, buttonSize,
buttonColor, buttonColor,
toggleStyle, toggleStyle,
disabledClass, disabled,
onFilterChange, onFilterChange,
onFilterKeyPress, onFilterKeyPress,
}) => }) =>
<div <div
className={`dropdown-autocomplete dropdown-toggle ${buttonSize} ${buttonColor} ${disabledClass}`} className={`dropdown-autocomplete dropdown-toggle ${buttonSize} ${buttonColor}${disabledClass(
disabled
)}`}
style={toggleStyle} style={toggleStyle}
> >
<input <input
@ -29,14 +33,14 @@ const DropdownInput = ({
export default DropdownInput export default DropdownInput
const {func, shape, string} = PropTypes const {bool, func, shape, string} = PropTypes
DropdownInput.propTypes = { DropdownInput.propTypes = {
searchTerm: string, searchTerm: string,
buttonSize: string, buttonSize: string,
buttonColor: string, buttonColor: string,
toggleStyle: shape({}), toggleStyle: shape({}),
disabledClass: string, disabled: bool,
onFilterChange: func, onFilterChange: func.isRequired,
onFilterKeyPress: func, onFilterKeyPress: func.isRequired,
} }

View File

@ -27,19 +27,18 @@ class Tag extends Component {
render() { render() {
const {item} = this.props const {item} = this.props
return ( return (
<span key={item} className="input-tag-item"> <span key={item} className="input-tag--item">
<span> <span>
{item.text || item.name || item} {item.text || item.name || item}
</span> </span>
{ <ConfirmButton
<ConfirmButton icon="remove"
icon="remove" size="btn-xs"
size="btn-xs" customClass="input-tag--remove"
customClass="btn-xxs" square={true}
confirmText="Remove user from organization?" confirmText="Remove user from organization?"
confirmAction={this.handleClickDelete(item)} confirmAction={this.handleClickDelete(item)}
/> />
}
</span> </span>
) )
} }

View File

@ -3,29 +3,33 @@
--------------------------------------------- ---------------------------------------------
*/ */
$input-tag-item-height: 24px; $input-tag--item-height: 24px;
.input-tag-list { .input-tag-list {
margin: 1px -1px; margin: 1px -1px;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
// Special rule for alert handlers config
.tag-input + .input-tag-list { .tag-input + .input-tag-list {
padding: 0 11px; padding: 0 11px;
margin: 4px -1px; margin: 4px -1px;
} }
.input-tag-item, .input-tag--item,
.tags-add { .tags-add {
height: $input-tag-item-height; height: $input-tag--item-height;
line-height: $input-tag-item-height; line-height: $input-tag--item-height;
border-radius: 3px; border-radius: 3px;
margin: 1px; margin: 1px;
} }
.input-tag-item { .input-tag--item {
display: flex;
align-items: center;
flex-wrap: nowrap;
white-space: nowrap; white-space: nowrap;
padding: 0 9px; padding: 0 0 0 9px;
font-size: 12px; font-size: 12px;
font-weight: 600; font-weight: 600;
background-color: $g5-pepper; background-color: $g5-pepper;
@ -33,22 +37,22 @@ $input-tag-item-height: 24px;
cursor: default; cursor: default;
} }
.input-tag-item .icon { .btn.confirm-button.input-tag--remove {
transition: color 0.25s ease; margin-left: 2px;
margin-left: 6px; color: $g8-storm;
position: relative; background-color: transparent;
top: -0.5px;
&:hover { &:hover {
background-color: transparent;
color: $c-dreamsicle; color: $c-dreamsicle;
cursor: pointer;
} }
} }
// Optional Add Tags Button // Optional Add Tags Button
.tags-add { .tags-add {
position: relative; position: relative;
width: $input-tag-item-height; width: $input-tag--item-height;
background-color: $c-pool; background-color: $c-pool;
color: $g20-white; color: $g20-white;
text-align: center; text-align: center;

View File

@ -79,7 +79,8 @@ $table--highlight-color: $g4-onyx;
.table.table-highlight > tbody > tr:hover {background-color: $table--highlight-color;} .table.table-highlight > tbody > tr:hover {background-color: $table--highlight-color;}
.table > tbody > tr .table--show-on-row-hover {visibility: hidden;} .table > tbody > tr .table--show-on-row-hover {visibility: hidden;}
.table > tbody > tr:hover .table--show-on-row-hover {visibility: visible;} .table > tbody > tr:hover .table--show-on-row-hover,
.table > tbody > tr .table--show-on-row-hover.active {visibility: visible;}
// For use in a Status column // For use in a Status column

View File

@ -391,6 +391,10 @@ $tick-script-overlay-margin: 30px;
margin-left: 6px; margin-left: 6px;
} }
.dropdown.dashboard-switcher .dropdown-item {
white-space: nowrap;
}
/* /*
Dashboard Name Editing Dashboard Name Editing
----------------------------------------------------------------------------- -----------------------------------------------------------------------------