Cancel edit rp on click outside

pull/10616/head
Andrew Watkins 2017-03-20 14:42:05 -07:00
parent 0fa7767cfd
commit aa33b622a5
2 changed files with 6 additions and 2 deletions

View File

@ -1,8 +1,9 @@
import React, {PropTypes} from 'react'
import {formatRPDuration} from 'utils/formatting'
import ConfirmButtons from 'src/admin/components/ConfirmButtons'
import onClickOutside from 'react-onclickoutside'
export const DatabaseRow = ({
const DatabaseRow = ({
retentionPolicy,
retentionPolicy: {name, duration, replication, isEditing, isDefault, isNew},
database,
@ -103,3 +104,5 @@ DatabaseRow.propTypes = {
onCancel: func,
onConfirm: func,
}
export default onClickOutside(DatabaseRow)

View File

@ -1,5 +1,5 @@
import React, {PropTypes} from 'react'
import {DatabaseRow} from 'src/admin/components/DatabaseRow'
import DatabaseRow from 'src/admin/components/DatabaseRow'
import ConfirmButtons from 'src/admin/components/ConfirmButtons'
const {
@ -57,6 +57,7 @@ const DatabaseTable = ({
onCancel={onCancelRetentionPolicy}
onConfirm={onCreateRetentionPolicy}
onStopEdit={onStopEditRetentionPolicy}
handleClickOutside={() => onStopEditRetentionPolicy({database, retentionPolicy: rp})}
/>
)
})