This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement delete all option for admin
- Loading branch information
Alex Eng
committed
May 31, 2016
1 parent
0f669b1
commit 6142303
Showing
6 changed files
with
212 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
frontend/src/main/web/src/containers/Glossary/DeleteAllEntryModal.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import React, { Component, PropTypes } from 'react' | ||
import ReactDOM from 'react-dom' | ||
import { | ||
ButtonLink, | ||
ButtonRound, | ||
LoaderText, | ||
Icon, | ||
Tooltip, | ||
Overlay | ||
} from '../../components' | ||
|
||
/** | ||
* Confirmation modal dialog for delete all glossary entries | ||
*/ | ||
class DeleteAllEntryModal extends Component { | ||
render () { | ||
const { | ||
show, | ||
isDeleting, | ||
handleDeleteAllEntryDisplay, | ||
handleDeleteAllEntry | ||
} = this.props | ||
|
||
return ( | ||
<div className='Mstart(rq) D(ib)'> | ||
<Overlay | ||
placement='bottom' | ||
target={() => ReactDOM.findDOMNode(this)} | ||
rootClose | ||
show={show} | ||
onHide={() => handleDeleteAllEntryDisplay(false)}> | ||
<Tooltip id='delete-entries' title='Delete all glossary entry'> | ||
<p> | ||
Are you sure you want to delete | ||
<strong>all entries</strong> ? | ||
</p> | ||
<div className='Mt(rq)'> | ||
<ButtonLink | ||
atomic={{m: 'Mend(rh)'}} | ||
onClick={() => handleDeleteAllEntryDisplay(false)}> | ||
Cancel | ||
</ButtonLink> | ||
<ButtonRound type='danger' size='n1' | ||
disabled={isDeleting} | ||
onClick={() => handleDeleteAllEntry()}> | ||
<LoaderText loading={isDeleting} size='n1' | ||
loadingText='Deleting'> | ||
Delete all | ||
</LoaderText> | ||
</ButtonRound> | ||
</div> | ||
</Tooltip> | ||
</Overlay> | ||
<ButtonLink type='danger' | ||
onClick={() => handleDeleteAllEntryDisplay(true)} | ||
disabled={isDeleting}> | ||
<Icon name='trash' atomic={{m: 'Mend(re)'}} /> | ||
<span className='Hidden--lesm'>Delete all</span> | ||
</ButtonLink> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
DeleteAllEntryModal.propTypes = { | ||
show: React.PropTypes.bool, | ||
isDeleting: React.PropTypes.bool, | ||
handleDeleteAllEntryDisplay: PropTypes.func.isRequired, | ||
handleDeleteAllEntry: React.PropTypes.func.isRequired | ||
} | ||
|
||
export default DeleteAllEntryModal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.