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:
Bruce Martin
2020-04-28 14:21:53 -07:00
committed by GitHub
parent 666e6d9849
commit 05fcdaf93c
7 changed files with 184 additions and 48 deletions

View File

@@ -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,
});