feat(notif): Notification improvements (#914)

This commit is contained in:
TheCatLady
2021-02-12 08:27:11 -05:00
committed by GitHub
parent 7d3da1a1d2
commit 2768155bba
14 changed files with 252 additions and 205 deletions

View File

@@ -28,6 +28,8 @@ const messages = defineMessages({
Additionally, you need the chat ID for the chat you want the bot to send notifications to.\
You can do this by adding <GetIdBotLink>@get_id_bot</GetIdBotLink> to the chat or group chat.',
notificationtypes: 'Notification Types',
sendSilently: 'Send Silently',
sendSilentlyTip: 'Send notifications with no sound',
});
const NotificationsTelegram: React.FC = () => {
@@ -57,6 +59,7 @@ const NotificationsTelegram: React.FC = () => {
types: data?.types,
botAPI: data?.options.botAPI,
chatId: data?.options.chatId,
sendSilently: data?.options.sendSilently,
}}
validationSchema={NotificationsTelegramSchema}
onSubmit={async (values) => {
@@ -67,6 +70,7 @@ const NotificationsTelegram: React.FC = () => {
options: {
botAPI: values.botAPI,
chatId: values.chatId,
sendSilently: values.sendSilently,
},
});
addToast(intl.formatMessage(messages.telegramsettingssaved), {
@@ -91,6 +95,7 @@ const NotificationsTelegram: React.FC = () => {
options: {
botAPI: values.botAPI,
chatId: values.chatId,
sendSilently: values.sendSilently,
},
});
@@ -178,6 +183,21 @@ const NotificationsTelegram: React.FC = () => {
)}
</div>
</div>
<div className="form-row">
<label htmlFor="sendSilently" className="checkbox-label">
<span>{intl.formatMessage(messages.sendSilently)}</span>
<span className="label-tip">
{intl.formatMessage(messages.sendSilentlyTip)}
</span>
</label>
<div className="form-input">
<Field
type="checkbox"
id="sendSilently"
name="sendSilently"
/>
</div>
</div>
<div
role="group"
aria-labelledby="group-label"