mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-19 10:58:10 +08:00
Revised terms and privacy consent dialog, analytics hooks (#1426)
* revised terms and privacy consent * reorg code * fix conditional * Overlay reflects un-dissmissable state * add inline scripts, and consent callback * add csp_directive config hook * revert config.yaml * fix logic error Co-authored-by: Colin Megill <colinmegill@gmail.com>
This commit is contained in:
@@ -4,58 +4,50 @@ import { Position, Toaster, Intent } from "@blueprintjs/core";
|
||||
|
||||
const ToastTopCenter = Toaster.create({
|
||||
className: "recipe-toaster",
|
||||
position: Position.TOP
|
||||
position: Position.TOP,
|
||||
});
|
||||
|
||||
const ToastBottomCenter = Toaster.create({
|
||||
className: "recipe-toaster",
|
||||
position: Position.BOTTOM
|
||||
position: Position.BOTTOM,
|
||||
});
|
||||
|
||||
/*
|
||||
A "user" error - eg, bad input
|
||||
*/
|
||||
export const postUserErrorToast = message =>
|
||||
export const postUserErrorToast = (message) =>
|
||||
ToastTopCenter.show({ message, intent: Intent.WARNING });
|
||||
|
||||
/*
|
||||
A toast the user must dismiss manually, because they need to act on its information,
|
||||
ie., 8 bulk add genes out of 40 were bad. Manually see which ones and fix.
|
||||
*/
|
||||
export const keepAroundErrorToast = message =>
|
||||
export const keepAroundErrorToast = (message) =>
|
||||
ToastTopCenter.show({ message, timeout: 0, intent: Intent.WARNING });
|
||||
|
||||
/*
|
||||
a hard network error
|
||||
*/
|
||||
export const postNetworkErrorToast = message =>
|
||||
export const postNetworkErrorToast = (message) =>
|
||||
ToastTopCenter.show({
|
||||
message,
|
||||
timeout: 30000,
|
||||
intent: Intent.DANGER
|
||||
intent: Intent.DANGER,
|
||||
});
|
||||
|
||||
/*
|
||||
Async message to user
|
||||
*/
|
||||
export const postAsyncSuccessToast = message =>
|
||||
export const postAsyncSuccessToast = (message) =>
|
||||
ToastTopCenter.show({
|
||||
message,
|
||||
timeout: 10000,
|
||||
intent: Intent.SUCCESS
|
||||
intent: Intent.SUCCESS,
|
||||
});
|
||||
|
||||
export const postAsyncFailureToast = message =>
|
||||
export const postAsyncFailureToast = (message) =>
|
||||
ToastTopCenter.show({
|
||||
message,
|
||||
timeout: 10000,
|
||||
intent: Intent.WARNING
|
||||
});
|
||||
|
||||
export const termsOfServiceToast = (message, _onDismiss) =>
|
||||
ToastBottomCenter.show({
|
||||
message,
|
||||
timeout: 0,
|
||||
intent: Intent.PRIMARY,
|
||||
onDismiss: _onDismiss
|
||||
intent: Intent.WARNING,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user