mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
03ead0d1ca
Summary: Front-end code can now test if emails are enabled and hide some parts of UI based on it. Test Plan: Only secondery text was hidden on add users dialog. Tested manually. Reviewers: georgegevoian Reviewed By: georgegevoian Subscribers: georgegevoian Differential Revision: https://phab.getgrist.com/D4221
22 lines
778 B
TypeScript
22 lines
778 B
TypeScript
import {SendGridConfig, SendGridMail} from 'app/gen-server/lib/NotifierTypes';
|
|
|
|
export interface INotifier {
|
|
// for test purposes, check if any notifications are in progress
|
|
readonly testPending: boolean;
|
|
|
|
deleteUser(userId: number): Promise<void>;
|
|
|
|
// Intercept outgoing messages for test purposes.
|
|
// Return undefined if no notification system is available.
|
|
testSetSendMessageCallback(op: (body: SendGridMail, description: string) => Promise<void>): SendGridConfig|undefined;
|
|
}
|
|
|
|
/**
|
|
* A notifier that does nothing. Used when no email notifications are configured.
|
|
*/
|
|
export const EmptyNotifier: INotifier = {
|
|
get testPending() { return false; },
|
|
async deleteUser() { /* do nothing */ },
|
|
testSetSendMessageCallback() { return undefined; },
|
|
} as const;
|