Fix Lists edit form
[MAILPOET-1348]
This commit is contained in:
@ -1,17 +1,29 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
const FormFieldTextarea = () => (
|
const FormFieldTextarea = props => (
|
||||||
<textarea
|
<textarea
|
||||||
type="text"
|
type="text"
|
||||||
className="regular-text"
|
className="regular-text"
|
||||||
name={this.props.field.name}
|
name={props.field.name}
|
||||||
id={`field_${this.props.field.name}`}
|
id={`field_${props.field.name}`}
|
||||||
value={this.props.item[this.props.field.name]}
|
value={props.item[props.field.name]}
|
||||||
placeholder={this.props.field.placeholder}
|
placeholder={props.field.placeholder}
|
||||||
defaultValue={this.props.field.defaultValue}
|
defaultValue={props.field.defaultValue}
|
||||||
onChange={this.props.onValueChange}
|
onChange={props.onValueChange}
|
||||||
{...this.props.field.validation}
|
{...props.field.validation}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
FormFieldTextarea.propTypes = {
|
||||||
|
item: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
|
field: PropTypes.shape({
|
||||||
|
name: PropTypes.string,
|
||||||
|
placeholder: PropTypes.string,
|
||||||
|
defaultValue: PropTypes.string,
|
||||||
|
validation: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
||||||
|
}).isRequired,
|
||||||
|
onValueChange: PropTypes.func.isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
export default FormFieldTextarea;
|
export default FormFieldTextarea;
|
||||||
|
@ -2,6 +2,7 @@ import React from 'react';
|
|||||||
import { Link } from 'react-router';
|
import { Link } from 'react-router';
|
||||||
import MailPoet from 'mailpoet';
|
import MailPoet from 'mailpoet';
|
||||||
import Form from 'form/form.jsx';
|
import Form from 'form/form.jsx';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
const fields = [
|
const fields = [
|
||||||
{
|
{
|
||||||
@ -29,7 +30,7 @@ const messages = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const SegmentForm = params => (
|
const SegmentForm = ({ params }) => (
|
||||||
<div>
|
<div>
|
||||||
<h1 className="title">
|
<h1 className="title">
|
||||||
{MailPoet.I18n.t('segment')}
|
{MailPoet.I18n.t('segment')}
|
||||||
@ -45,4 +46,10 @@ const SegmentForm = params => (
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
SegmentForm.propTypes = {
|
||||||
|
params: PropTypes.shape({
|
||||||
|
id: PropTypes.string,
|
||||||
|
}).isRequired,
|
||||||
|
};
|
||||||
|
|
||||||
export default SegmentForm;
|
export default SegmentForm;
|
||||||
|
Reference in New Issue
Block a user