mirror of
https://github.com/ascribe/onion.git
synced 2024-11-15 09:35:10 +01:00
aaa1a9a000
replaced spinners WIP renamed settings-property to property
63 lines
1.8 KiB
JavaScript
63 lines
1.8 KiB
JavaScript
'use strict';
|
|
|
|
import React from 'react';
|
|
|
|
import Form from '../ascribe_forms/form';
|
|
|
|
import ApiUrls from '../../constants/api_urls';
|
|
import AscribeSpinner from '../ascribe_spinner';
|
|
|
|
import { getLangText } from '../../utils/lang_utils';
|
|
|
|
|
|
let PieceDeleteForm = React.createClass({
|
|
propTypes: {
|
|
pieceId: React.PropTypes.number,
|
|
|
|
// Propagated by ModalWrapper in most cases
|
|
handleSuccess: React.PropTypes.func
|
|
},
|
|
|
|
getFormData() {
|
|
return {
|
|
piece_id: this.props.pieceId
|
|
};
|
|
},
|
|
|
|
render() {
|
|
return (
|
|
<Form
|
|
ref='form'
|
|
url={ApiUrls.piece}
|
|
getFormData={this.getFormData}
|
|
method="delete"
|
|
handleSuccess={this.props.handleSuccess}
|
|
buttons={
|
|
<div className="modal-footer">
|
|
<p className="pull-right">
|
|
<button
|
|
type="submit"
|
|
className="btn btn-danger btn-delete btn-sm ascribe-margin-1px"
|
|
onClick={this.submit}>
|
|
{getLangText('YES, DELETE')}
|
|
</button>
|
|
</p>
|
|
</div>
|
|
}
|
|
spinner={
|
|
<div className="modal-footer">
|
|
<p className="pull-right">
|
|
<AscribeSpinner color='dark-blue' size='md'/>
|
|
</p>
|
|
</div>
|
|
}>
|
|
<p>{getLangText('Are you sure you would like to permanently delete this piece')}?</p>
|
|
<p>{getLangText('This is an irrevocable action%s', '.')}</p>
|
|
</Form>
|
|
);
|
|
}
|
|
});
|
|
|
|
|
|
export default PieceDeleteForm;
|