- Disables input fields if subscriber is a WP user. #421 (5)
- Removes 'unconfirmed' status if subscriber is a WP user. #421 (9) - Displays notice if subscriber is a WP user. #421 (6)
This commit is contained in:
@@ -10,7 +10,11 @@ function(
|
||||
return false;
|
||||
}
|
||||
|
||||
const options = Object.keys(this.props.field.values).map(
|
||||
var values = (this.props.field.filterValues !== undefined)
|
||||
? this.props.field.filterValues(this.props.item)
|
||||
: this.props.field.values;
|
||||
|
||||
const options = Object.keys(values).map(
|
||||
(value, index) => {
|
||||
return (
|
||||
<option
|
||||
|
@@ -14,6 +14,11 @@ function(
|
||||
return (
|
||||
<input
|
||||
type="text"
|
||||
disabled={
|
||||
(this.props.field.disabled !== undefined)
|
||||
? this.props.field.disabled(this.props.item)
|
||||
: ''
|
||||
}
|
||||
className={ (this.props.field.size) ? '' : 'regular-text' }
|
||||
size={
|
||||
(this.props.field.size !== 'auto' && this.props.field.size > 0)
|
||||
|
@@ -167,6 +167,14 @@ define(
|
||||
{ 'mailpoet_form_loading': this.state.loading || this.props.loading }
|
||||
);
|
||||
|
||||
if (this.props.beforeFormContent !== undefined) {
|
||||
var beforeFormContent = this.props.beforeFormContent(this.getValues())
|
||||
}
|
||||
|
||||
if (this.props.afterFormContent !== undefined) {
|
||||
var afterFormContent = this.props.afterFormContent(this.getValues())
|
||||
}
|
||||
|
||||
var fields = this.props.fields.map(function(field, i) {
|
||||
return (
|
||||
<FormField
|
||||
@@ -191,26 +199,30 @@ define(
|
||||
}
|
||||
|
||||
return (
|
||||
<form
|
||||
id={ this.props.id }
|
||||
ref="form"
|
||||
className={ formClasses }
|
||||
onSubmit={
|
||||
(this.props.onSubmit !== undefined)
|
||||
? this.props.onSubmit
|
||||
: this.handleSubmit
|
||||
}
|
||||
>
|
||||
{ errors }
|
||||
<div>
|
||||
{ beforeFormContent }
|
||||
<form
|
||||
id={ this.props.id }
|
||||
ref="form"
|
||||
className={ formClasses }
|
||||
onSubmit={
|
||||
(this.props.onSubmit !== undefined)
|
||||
? this.props.onSubmit
|
||||
: this.handleSubmit
|
||||
}
|
||||
>
|
||||
{ errors }
|
||||
|
||||
<table className="form-table">
|
||||
<tbody>
|
||||
{fields}
|
||||
</tbody>
|
||||
</table>
|
||||
<table className="form-table">
|
||||
<tbody>
|
||||
{fields}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{ actions }
|
||||
</form>
|
||||
{ actions }
|
||||
</form>
|
||||
{ afterFormContent }
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user