feat(notif): add "Media Automatically Approved" notification type (#1137)

This commit is contained in:
TheCatLady
2021-03-11 21:42:06 -05:00
committed by GitHub
parent 1be97fe7fb
commit f7d2723fab
19 changed files with 284 additions and 102 deletions

View File

@@ -28,7 +28,6 @@ const messages = defineMessages({
notificationsettingssaved: 'Notification settings saved successfully!',
notificationsettingsfailed: 'Notification settings failed to save.',
enablenotifications: 'Enable Notifications',
autoapprovedrequests: 'Enable Notifications for Automatic Approvals',
email: 'Email',
webhook: 'Webhook',
});
@@ -187,14 +186,12 @@ const SettingsNotifications: React.FC = ({ children }) => {
<Formik
initialValues={{
enabled: data.enabled,
autoapprovalEnabled: data.autoapprovalEnabled,
}}
enableReinitialize
onSubmit={async (values) => {
try {
await axios.post('/api/v1/settings/notifications', {
enabled: values.enabled,
autoapprovalEnabled: values.autoapprovalEnabled,
});
addToast(intl.formatMessage(messages.notificationsettingssaved), {
appearance: 'success',
@@ -233,26 +230,6 @@ const SettingsNotifications: React.FC = ({ children }) => {
/>
</div>
</div>
<div className="form-row">
<label htmlFor="name" className="checkbox-label">
<span>
{intl.formatMessage(messages.autoapprovedrequests)}
</span>
</label>
<div className="form-input">
<Field
type="checkbox"
id="autoapprovalEnabled"
name="autoapprovalEnabled"
onChange={() => {
setFieldValue(
'autoapprovalEnabled',
!values.autoapprovalEnabled
);
}}
/>
</div>
</div>
<div className="actions">
<div className="flex justify-end">
<span className="inline-flex ml-3 rounded-md shadow-sm">