diff --git a/ui/src/admin/components/DatabaseManager.js b/ui/src/admin/components/DatabaseManager.js
index bd2dd53cd..34e10f6c9 100644
--- a/ui/src/admin/components/DatabaseManager.js
+++ b/ui/src/admin/components/DatabaseManager.js
@@ -17,6 +17,7 @@ const DatabaseManager = ({
onCancelRetentionPolicy,
onCreateRetentionPolicy,
onUpdateRetentionPolicy,
+ onRemoveRetentionPolicy,
}) => {
return (
@@ -43,6 +44,7 @@ const DatabaseManager = ({
onCancelRetentionPolicy={onCancelRetentionPolicy}
onCreateRetentionPolicy={onCreateRetentionPolicy}
onUpdateRetentionPolicy={onUpdateRetentionPolicy}
+ onRemoveRetentionPolicy={onRemoveRetentionPolicy}
/>
)
}
@@ -73,6 +75,7 @@ DatabaseManager.propTypes = {
onCancelRetentionPolicy: func,
onCreateRetentionPolicy: func,
onUpdateRetentionPolicy: func,
+ onRemoveRetentionPolicy: func,
}
export default DatabaseManager
diff --git a/ui/src/admin/components/DatabaseRow.js b/ui/src/admin/components/DatabaseRow.js
index 878acb625..519da0812 100644
--- a/ui/src/admin/components/DatabaseRow.js
+++ b/ui/src/admin/components/DatabaseRow.js
@@ -18,9 +18,17 @@ class DatabaseRow extends Component {
this.getInputValues = ::this.getInputValues
}
+ componentWillMount() {
+ if (this.props.retentionPolicy.isNew) {
+ this.setState({isEditing: true})
+ }
+ }
+
render() {
const {
+ onRemove,
retentionPolicy: {name, duration, replication, isDefault, isNew},
+ retentionPolicy,
database,
} = this.props
@@ -67,11 +75,11 @@ class DatabaseRow extends Component {
ref={(r) => this.replication = r}
/>
-
+
onRemove(database, retentionPolicy) : this.handleEndEdit}
/>
|
@@ -131,12 +139,12 @@ class DatabaseRow extends Component {
handleKeyDown(e) {
const {key} = e
- const {retentionPolicy, database, onCancel} = this.props
+ const {retentionPolicy, database, onRemove} = this.props
if (key === 'Escape') {
if (retentionPolicy.isNew) {
- onCancel(database, retentionPolicy)
+ onRemove(database, retentionPolicy)
return
}
@@ -189,7 +197,7 @@ DatabaseRow.propTypes = {
isEditing: bool,
}),
database: shape(),
- onCancel: func,
+ onRemove: func,
onCreate: func,
onUpdate: func,
notify: func,
diff --git a/ui/src/admin/components/DatabaseTable.js b/ui/src/admin/components/DatabaseTable.js
index afe677987..3610f15d7 100644
--- a/ui/src/admin/components/DatabaseTable.js
+++ b/ui/src/admin/components/DatabaseTable.js
@@ -19,6 +19,7 @@ const DatabaseTable = ({
onAddRetentionPolicy,
onCreateRetentionPolicy,
onUpdateRetentionPolicy,
+ onRemoveRetentionPolicy,
}) => {
return (
@@ -53,6 +54,7 @@ const DatabaseTable = ({
retentionPolicy={rp}
onCreate={onCreateRetentionPolicy}
onUpdate={onUpdateRetentionPolicy}
+ onRemove={onRemoveRetentionPolicy}
/>
)
})
@@ -77,6 +79,7 @@ DatabaseTable.propTypes = {
onCancelRetentionPolicy: func,
onCreateRetentionPolicy: func,
onUpdateRetentionPolicy: func,
+ onRemoveRetentionPolicy: func,
}
const DatabaseTableHeader = ({
diff --git a/ui/src/admin/containers/DatabaseManagerPage.js b/ui/src/admin/containers/DatabaseManagerPage.js
index cac0d0444..4fc9d10fe 100644
--- a/ui/src/admin/containers/DatabaseManagerPage.js
+++ b/ui/src/admin/containers/DatabaseManagerPage.js
@@ -35,9 +35,9 @@ class DatabaseManagerPage extends Component {
onStartDeleteDatabase={actions.startDeleteDatabase}
onAddRetentionPolicy={actions.addRetentionPolicy}
onEditRetentionPolicy={actions.editRetentionPolicy}
- onCancelRetentionPolicy={actions.removeRetentionPolicy}
onCreateRetentionPolicy={actions.createRetentionPolicyAsync}
onUpdateRetentionPolicy={actions.updateRetentionPolicyAsync}
+ onRemoveRetentionPolicy={actions.removeRetentionPolicy}
/>
)
}
@@ -108,6 +108,7 @@ DatabaseManagerPage.propTypes = {
updateDatabaseDeleteCode: func,
removeDatabaseDeleteCode: func,
editRetentionPolicy: func,
+ removeRetentionPolicy: func,
}),
notify: func,
}