Adding the email_admins for new application config. (#742)

This commit is contained in:
Dessalines 2022-09-27 15:45:42 -04:00 committed by GitHub
parent 80be834867
commit 333642e065
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,6 +53,7 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
legal_information: None, legal_information: None,
description: None, description: None,
community_creation_admin_only: None, community_creation_admin_only: None,
application_email_admins: None,
auth: undefined, auth: undefined,
hide_modlog_mod_names: Some(true), hide_modlog_mod_names: Some(true),
}), }),
@ -101,6 +102,7 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
default_theme: Some(site.default_theme), default_theme: Some(site.default_theme),
default_post_listing_type: Some(site.default_post_listing_type), default_post_listing_type: Some(site.default_post_listing_type),
legal_information: site.legal_information, legal_information: site.legal_information,
application_email_admins: Some(site.application_email_admins),
hide_modlog_mod_names: site.hide_modlog_mod_names, hide_modlog_mod_names: site.hide_modlog_mod_names,
auth: undefined, auth: undefined,
}), }),
@ -388,6 +390,30 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
</div> </div>
</div> </div>
</div> </div>
<div className="form-group row">
<div className="col-12">
<div className="form-check">
<input
className="form-check-input"
id="create-site-application-email-admins"
type="checkbox"
checked={toUndefined(
this.state.siteForm.application_email_admins
)}
onChange={linkEvent(
this,
this.handleSiteApplicationEmailAdmins
)}
/>
<label
className="form-check-label"
htmlFor="create-site-email-admins"
>
{i18n.t("application_email_admins")}
</label>
</div>
</div>
</div>
<div className="form-group row"> <div className="form-group row">
<div className="col-12"> <div className="col-12">
<label <label
@ -527,6 +553,7 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
private_instance: sForm.private_instance, private_instance: sForm.private_instance,
default_theme: sForm.default_theme, default_theme: sForm.default_theme,
default_post_listing_type: sForm.default_post_listing_type, default_post_listing_type: sForm.default_post_listing_type,
application_email_admins: sForm.application_email_admins,
auth: auth().unwrap(), auth: auth().unwrap(),
hide_modlog_mod_names: sForm.hide_modlog_mod_names, hide_modlog_mod_names: sForm.hide_modlog_mod_names,
}); });
@ -587,6 +614,11 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
i.setState(i.state); i.setState(i.state);
} }
handleSiteApplicationEmailAdmins(i: SiteForm, event: any) {
i.state.siteForm.application_email_admins = Some(event.target.checked);
i.setState(i.state);
}
handleSitePrivateInstance(i: SiteForm, event: any) { handleSitePrivateInstance(i: SiteForm, event: any) {
i.state.siteForm.private_instance = Some(event.target.checked); i.state.siteForm.private_instance = Some(event.target.checked);
i.setState(i.state); i.setState(i.state);