Display status column
[MAILPOET-3087]
This commit is contained in:
@@ -13,6 +13,10 @@ const columns = [
|
|||||||
label: MailPoet.I18n.t('formName'),
|
label: MailPoet.I18n.t('formName'),
|
||||||
sortable: true,
|
sortable: true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'status',
|
||||||
|
label: MailPoet.I18n.t('status'),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'segments',
|
name: 'segments',
|
||||||
label: MailPoet.I18n.t('segments'),
|
label: MailPoet.I18n.t('segments'),
|
||||||
@@ -182,6 +186,24 @@ class FormList extends React.Component {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
renderStatus(form) {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<p>
|
||||||
|
<select
|
||||||
|
data-id={form.id}
|
||||||
|
defaultValue={form.status}
|
||||||
|
onChange={this.updateStatus}
|
||||||
|
>
|
||||||
|
<option value="enabled">{MailPoet.I18n.t('active')}</option>
|
||||||
|
<option value="disabled">{MailPoet.I18n.t('inactive')}</option>
|
||||||
|
</select>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
renderItem = (form, actions) => {
|
renderItem = (form, actions) => {
|
||||||
const rowClasses = classNames(
|
const rowClasses = classNames(
|
||||||
'manage-column',
|
'manage-column',
|
||||||
@@ -213,6 +235,9 @@ class FormList extends React.Component {
|
|||||||
</strong>
|
</strong>
|
||||||
{ actions }
|
{ actions }
|
||||||
</td>
|
</td>
|
||||||
|
<td className="column" data-colname={MailPoet.I18n.t('status')}>
|
||||||
|
{ this.renderStatus(form) }
|
||||||
|
</td>
|
||||||
<td className="column" data-colname={MailPoet.I18n.t('segments')}>
|
<td className="column" data-colname={MailPoet.I18n.t('segments')}>
|
||||||
{ segments }
|
{ segments }
|
||||||
</td>
|
</td>
|
||||||
|
@@ -62,6 +62,9 @@
|
|||||||
'restore': __('Restore'),
|
'restore': __('Restore'),
|
||||||
'deletePermanently': __('Delete Permanently'),
|
'deletePermanently': __('Delete Permanently'),
|
||||||
|
|
||||||
|
'status': __('Status'),
|
||||||
|
'active': __('Active'),
|
||||||
|
'inactive': __('Not Active'),
|
||||||
'previousPage': __('Previous page'),
|
'previousPage': __('Previous page'),
|
||||||
'firstPage': __('First page'),
|
'firstPage': __('First page'),
|
||||||
'nextPage': __('Next page'),
|
'nextPage': __('Next page'),
|
||||||
|
Reference in New Issue
Block a user