Skip to content

Commit

Permalink
Adding reports send email to admins option (#932)
Browse files Browse the repository at this point in the history
  • Loading branch information
dessalines authored Feb 17, 2023
1 parent 4eb9023 commit b0755bc
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lemmy-translations
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"inferno-server": "^8.0.5",
"isomorphic-cookie": "^1.2.4",
"jwt-decode": "^3.1.2",
"lemmy-js-client": "0.17.0-rc.62",
"lemmy-js-client": "0.17.2-rc.1",
"markdown-it": "^13.0.1",
"markdown-it-container": "^3.0.0",
"markdown-it-footnote": "^3.0.3",
Expand Down
25 changes: 25 additions & 0 deletions src/shared/components/home/site-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
default_post_listing_type: ls.default_post_listing_type,
legal_information: ls.legal_information,
application_email_admins: ls.application_email_admins,
reports_email_admins: ls.reports_email_admins,
hide_modlog_mod_names: ls.hide_modlog_mod_names,
discussion_languages: this.props.siteRes.discussion_languages,
slur_filter_regex: ls.slur_filter_regex,
Expand Down Expand Up @@ -390,6 +391,25 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
</div>
</div>
</div>
<div className="form-group row">
<div className="col-12">
<div className="form-check">
<input
className="form-check-input"
id="create-site-reports-email-admins"
type="checkbox"
checked={this.state.siteForm.reports_email_admins}
onChange={linkEvent(this, this.handleSiteReportsEmailAdmins)}
/>
<label
className="form-check-label"
htmlFor="create-site-reports-email-admins"
>
{i18n.t("reports_email_admins")}
</label>
</div>
</div>
</div>
<div className="form-group row">
<div className="col-12">
<label
Expand Down Expand Up @@ -1117,6 +1137,11 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
i.setState(i.state);
}

handleSiteReportsEmailAdmins(i: SiteForm, event: any) {
i.state.siteForm.reports_email_admins = event.target.checked;
i.setState(i.state);
}

handleSitePrivateInstance(i: SiteForm, event: any) {
i.state.siteForm.private_instance = event.target.checked;
i.setState(i.state);
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5324,10 +5324,10 @@ leac@^0.6.0:
resolved "https://registry.yarnpkg.com/leac/-/leac-0.6.0.tgz#dcf136e382e666bd2475f44a1096061b70dc0912"
integrity sha512-y+SqErxb8h7nE/fiEX07jsbuhrpO9lL8eca7/Y1nuWV2moNlXhyd59iDGcRf6moVyDMbmTNzL40SUyrFU/yDpg==

[email protected].0-rc.62:
version "0.17.0-rc.62"
resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.0-rc.62.tgz#631a87c7358595ade5cb34d7e4b0ca787b50a434"
integrity sha512-wOG5oqhmXUrjlo5pEkLMd1xXG261Wd3Z13zeeRr1VzpEbkXXBJcgMInzLP5ahgcvzKSo3uSIyqI93iH5UWPvUw==
[email protected].2-rc.1:
version "0.17.2-rc.1"
resolved "https://registry.yarnpkg.com/lemmy-js-client/-/lemmy-js-client-0.17.2-rc.1.tgz#fe8d1508311bbf245acc98c2c3e47e2165a95b14"
integrity sha512-YrOXuCofgkqp28krmPTQZAfUWL5zEDA0sRJ0abKcgf/I8YYkYkUkPS9TOORN5Lv3bc8RAAz4+2/zLHqYL/Tnow==
dependencies:
node-fetch "2.6.6"

Expand Down

0 comments on commit b0755bc

Please sign in to comment.