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
parent
89f1d0b4b4
commit
eb3454802a
|
@ -34,6 +34,7 @@ class DatabaseRow extends Component {
|
||||||
retentionPolicy,
|
retentionPolicy,
|
||||||
database,
|
database,
|
||||||
onDelete,
|
onDelete,
|
||||||
|
isDeletable,
|
||||||
isRFDisplayed,
|
isRFDisplayed,
|
||||||
} = this.props
|
} = this.props
|
||||||
const {isEditing, isDeleting} = this.state
|
const {isEditing, isDeleting} = this.state
|
||||||
|
@ -107,26 +108,20 @@ class DatabaseRow extends Component {
|
||||||
<td className="text-right">
|
<td className="text-right">
|
||||||
{
|
{
|
||||||
isDeleting ?
|
isDeleting ?
|
||||||
<YesNoButtons onConfirm={() => onDelete(database, retentionPolicy)} onCancel={this.handleEndDelete} /> :
|
<YesNoButtons
|
||||||
this.renderDeleteButton()
|
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>
|
</td>
|
||||||
</tr>
|
</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() {
|
handleClickOutside() {
|
||||||
const {database, retentionPolicy, onRemove} = this.props
|
const {database, retentionPolicy, onRemove} = this.props
|
||||||
if (retentionPolicy.isNew) {
|
if (retentionPolicy.isNew) {
|
||||||
|
|
Loading…
Reference in New Issue