Fix DB manager table column sizing

The delete RP button was not rendered if
there was only one RP for that RP's database.
This caused the table columns to render in different
sizes.  Hiding the button keep the same functionality but
preserves the sizing for the table.
pull/1063/head
Andrew Watkins 2017-03-24 13:51:49 -07:00
parent 89f1d0b4b4
commit eb3454802a
1 changed files with 9 additions and 14 deletions

View File

@ -34,6 +34,7 @@ class DatabaseRow extends Component {
retentionPolicy,
database,
onDelete,
isDeletable,
isRFDisplayed,
} = this.props
const {isEditing, isDeleting} = this.state
@ -107,26 +108,20 @@ class DatabaseRow extends Component {
<td className="text-right">
{
isDeleting ?
<YesNoButtons onConfirm={() => onDelete(database, retentionPolicy)} onCancel={this.handleEndDelete} /> :
this.renderDeleteButton()
<YesNoButtons
onConfirm={() => onDelete(database, retentionPolicy)}
onCancel={this.handleEndDelete} /> :
<button
className="btn btn-xs btn-danger admin-table--delete"
style={isDeletable ? {} : {visibility: 'hidden'}}
onClick={this.handleStartDelete}>{`Delete ${name}`}
</button>
}
</td>
</tr>
)
}
renderDeleteButton() {
if (!this.props.isDeletable) {
return
}
return (
<button className="btn btn-xs btn-danger admin-table--delete" onClick={this.handleStartDelete}>
{`Delete ${name}`}
</button>
)
}
handleClickOutside() {
const {database, retentionPolicy, onRemove} = this.props
if (retentionPolicy.isNew) {