2015-06-05 11:06:36 +02:00
|
|
|
'use strict';
|
2015-05-29 16:53:30 +02:00
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
|
2015-07-14 17:42:15 +02:00
|
|
|
import Button from 'react-bootstrap/lib/Button';
|
2015-05-29 16:53:30 +02:00
|
|
|
|
2015-07-14 17:42:15 +02:00
|
|
|
import Form from './form';
|
|
|
|
import Property from './property';
|
|
|
|
import InputTextAreaToggable from './input_textarea_toggable';
|
2015-05-29 16:53:30 +02:00
|
|
|
|
2015-06-05 11:06:36 +02:00
|
|
|
|
2015-07-14 17:42:15 +02:00
|
|
|
import AppConstants from '../../constants/application_constants';
|
|
|
|
import { getLangText } from '../../utils/lang_utils.js';
|
2015-06-05 11:06:36 +02:00
|
|
|
|
2015-05-29 16:53:30 +02:00
|
|
|
|
2015-07-14 17:42:15 +02:00
|
|
|
let UnConsignRequestForm = React.createClass({
|
|
|
|
propTypes: {
|
|
|
|
url: React.PropTypes.string,
|
|
|
|
id: React.PropTypes.object,
|
|
|
|
message: React.PropTypes.string,
|
|
|
|
handleSuccess: React.PropTypes.func
|
|
|
|
},
|
|
|
|
|
|
|
|
getFormData(){
|
|
|
|
return this.props.id;
|
|
|
|
},
|
2015-05-29 16:53:30 +02:00
|
|
|
|
2015-07-14 17:42:15 +02:00
|
|
|
render() {
|
2015-05-29 16:53:30 +02:00
|
|
|
|
|
|
|
return (
|
2015-07-14 17:42:15 +02:00
|
|
|
<Form
|
|
|
|
ref='form'
|
|
|
|
url={this.props.url}
|
|
|
|
getFormData={this.getFormData}
|
|
|
|
handleSuccess={this.props.handleSuccess}
|
|
|
|
buttons={
|
|
|
|
<div className="modal-footer">
|
|
|
|
<p className="pull-right">
|
|
|
|
<Button
|
|
|
|
className="btn btn-default btn-sm ascribe-margin-1px"
|
2015-08-05 18:00:44 +02:00
|
|
|
type="submit">
|
|
|
|
{getLangText('REQUEST UNCONSIGN')}
|
|
|
|
</Button>
|
2015-07-14 17:42:15 +02:00
|
|
|
</p>
|
|
|
|
</div>}
|
|
|
|
spinner={
|
|
|
|
<div className="modal-footer">
|
|
|
|
<img src={AppConstants.baseUrl + 'static/img/ascribe_animated_small.gif'} />
|
|
|
|
</div>}>
|
|
|
|
<Property
|
|
|
|
name='unconsign_request_message'
|
|
|
|
label={getLangText('Personal Message')}
|
2015-09-21 12:05:42 +02:00
|
|
|
editable={true}
|
|
|
|
overrideForm={true}>
|
2015-07-14 17:42:15 +02:00
|
|
|
<InputTextAreaToggable
|
|
|
|
rows={1}
|
|
|
|
defaultValue={this.props.message}
|
|
|
|
placeholder={getLangText('Enter a message...')}
|
|
|
|
required="required"/>
|
|
|
|
</Property>
|
|
|
|
<hr />
|
|
|
|
</Form>
|
2015-05-29 16:53:30 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default UnConsignRequestForm;
|