|
|
|
@ -26,6 +26,7 @@ const messages = defineMessages({
|
|
|
|
|
toastDiscordTestFailed: 'Discord test notification failed to send.',
|
|
|
|
|
validationUrl: 'You must provide a valid URL',
|
|
|
|
|
validationTypes: 'You must select at least one notification type',
|
|
|
|
|
enableMentions: 'Enable Mentions',
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const NotificationsDiscord: React.FC = () => {
|
|
|
|
@ -64,6 +65,7 @@ const NotificationsDiscord: React.FC = () => {
|
|
|
|
|
botUsername: data?.options.botUsername,
|
|
|
|
|
botAvatarUrl: data?.options.botAvatarUrl,
|
|
|
|
|
webhookUrl: data.options.webhookUrl,
|
|
|
|
|
enableMentions: data?.options.enableMentions,
|
|
|
|
|
}}
|
|
|
|
|
validationSchema={NotificationsDiscordSchema}
|
|
|
|
|
onSubmit={async (values) => {
|
|
|
|
@ -75,6 +77,7 @@ const NotificationsDiscord: React.FC = () => {
|
|
|
|
|
botUsername: values.botUsername,
|
|
|
|
|
botAvatarUrl: values.botAvatarUrl,
|
|
|
|
|
webhookUrl: values.webhookUrl,
|
|
|
|
|
enableMentions: values.enableMentions,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -122,6 +125,7 @@ const NotificationsDiscord: React.FC = () => {
|
|
|
|
|
botUsername: values.botUsername,
|
|
|
|
|
botAvatarUrl: values.botAvatarUrl,
|
|
|
|
|
webhookUrl: values.webhookUrl,
|
|
|
|
|
enableMentions: values.enableMentions,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -227,6 +231,18 @@ const NotificationsDiscord: React.FC = () => {
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="form-row">
|
|
|
|
|
<label htmlFor="enableMentions" className="checkbox-label">
|
|
|
|
|
{intl.formatMessage(messages.enableMentions)}
|
|
|
|
|
</label>
|
|
|
|
|
<div className="form-input">
|
|
|
|
|
<Field
|
|
|
|
|
type="checkbox"
|
|
|
|
|
id="enableMentions"
|
|
|
|
|
name="enableMentions"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<NotificationTypeSelector
|
|
|
|
|
currentTypes={values.enabled ? values.types : 0}
|
|
|
|
|
onUpdate={(newTypes) => {
|
|
|
|
|