Various fixes
This commit is contained in:
parent
4a6aed4cf7
commit
97bb700334
5 changed files with 8 additions and 6 deletions
|
@ -277,7 +277,7 @@ export default class CUD extends Component {
|
||||||
<Dropdown id="form" label={t('forms')} options={formsOptions} help={t('webAndEmailFormsAndTemplatesUsedIn')}/>
|
<Dropdown id="form" label={t('forms')} options={formsOptions} help={t('webAndEmailFormsAndTemplatesUsedIn')}/>
|
||||||
|
|
||||||
{this.getFormValue('form') === 'custom' &&
|
{this.getFormValue('form') === 'custom' &&
|
||||||
<TableSelect id="default_form" label={t('customForms')} withHeader dropdown dataUrl='rest/forms-table' columns={customFormsColumns} selectionLabelIndex={1} help={<Trans i18nKey="theCustomFormUsedForThisListYouCanCreate">The custom form used for this list. You can create a form <a href={`/lists/forms/create/${this.props.entity.id}`}>here</a>.</Trans>}/>
|
<TableSelect id="default_form" label={t('customForms')} withHeader dropdown dataUrl='rest/forms-table' columns={customFormsColumns} selectionLabelIndex={1} help={<Trans i18nKey="theCustomFormUsedForThisListYouCanCreate">The custom form used for this list. You can create a form <a href={`/lists/forms/create`}>here</a>.</Trans>}/>
|
||||||
}
|
}
|
||||||
|
|
||||||
<CheckBox id="public_subscribe" label={t('subscription')} text={t('allowPublicUsersToSubscribeThemselves')}/>
|
<CheckBox id="public_subscribe" label={t('subscription')} text={t('allowPublicUsersToSubscribeThemselves')}/>
|
||||||
|
|
|
@ -311,13 +311,15 @@ export default class CUD extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
getFormValuesMutator(data) {
|
getFormValuesMutator(data) {
|
||||||
data.selectedTemplate = 'layout';
|
|
||||||
this.supplyDefaults(data);
|
this.supplyDefaults(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
if (this.props.entity) {
|
if (this.props.entity) {
|
||||||
this.getFormValuesFromEntity(this.props.entity, ::this.getFormValuesMutator);
|
this.getFormValuesFromEntity(this.props.entity, data => {
|
||||||
|
this.getFormValuesMutator(data);
|
||||||
|
data.selectedTemplate = 'layout';
|
||||||
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
const data = {
|
const data = {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit f0167635c8c238e828b311fa9d0b058b5a00020d
|
Subproject commit 4d53d4b030273f25062fcc3c2328987d5a39cffc
|
|
@ -129,7 +129,7 @@ async function _sendMail(list, email, template, locale, subjectKey, relativeUrls
|
||||||
};
|
};
|
||||||
|
|
||||||
if (list.default_form) {
|
if (list.default_form) {
|
||||||
const form = await forms.getById(contextHelpers.getAdminContext(), list.default_form);
|
const form = await forms.getById(contextHelpers.getAdminContext(), list.default_form, false);
|
||||||
|
|
||||||
text.template = form['mail_' + template + '_text'] || text.template;
|
text.template = form['mail_' + template + '_text'] || text.template;
|
||||||
html.template = form['mail_' + template + '_html'] || html.template;
|
html.template = form['mail_' + template + '_html'] || html.template;
|
||||||
|
|
|
@ -675,7 +675,7 @@ async function webNotice(type, req, res) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
await injectCustomFormData(req.query.fid || list.default_form, 'web_' + type + '_notice', data);
|
await injectCustomFormData(req.query.fid || list.default_form, 'web_' + type.replace('-', '_') + '_notice', data);
|
||||||
|
|
||||||
const htmlRenderer = await tools.getTemplate(data.template, req.locale);
|
const htmlRenderer = await tools.getTemplate(data.template, req.locale);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue