diff --git a/frontend/components/BcFeatureFlag.vue b/frontend/components/BcFeatureFlag.vue new file mode 100644 index 000000000..53c6c6673 --- /dev/null +++ b/frontend/components/BcFeatureFlag.vue @@ -0,0 +1,35 @@ + + + + + diff --git a/frontend/components/bc/BcButtonText.vue b/frontend/components/bc/BcButtonText.vue new file mode 100644 index 000000000..60eb5acc1 --- /dev/null +++ b/frontend/components/bc/BcButtonText.vue @@ -0,0 +1,19 @@ + + + + + diff --git a/frontend/components/notifications/NotificationsOverview.vue b/frontend/components/notifications/NotificationsOverview.vue new file mode 100644 index 000000000..7eb583cd4 --- /dev/null +++ b/frontend/components/notifications/NotificationsOverview.vue @@ -0,0 +1,247 @@ + + + + + diff --git a/frontend/locales/en.json b/frontend/locales/en.json index 302cfa091..9a989b149 100644 --- a/frontend/locales/en.json +++ b/frontend/locales/en.json @@ -20,6 +20,7 @@ }, "common": { "account": "Account | Accounts", + "active": "Active", "address": "Address | Addresses", "age": "Age", "and_more": "and {count} more", @@ -34,6 +35,7 @@ "deselected": "Not selected", "earned": "Earned", "edit": "Edit", + "email": "Email", "ens_address": "ENS address | ENS addresses", "epoch": "Epoch | Epochs", "erc20token": "ERC-20 Token | ERC-20 Tokens", @@ -45,6 +47,7 @@ "graffiti": "Graffiti | Graffitis", "id": "ID", "in_day": "In one day | In {count} days", + "inactive": "Inactive", "index": "Index", "last_x": "Last {duration}", "live": "Live", @@ -68,8 +71,12 @@ "true": "True", "tx_batch": "Tx Batch | Tx Batches", "unavailable": "Unavailable", + "units": { + "per_day": "per day" + }, "upcoming": "Upcoming", - "validator": "Validator | Validators" + "validator": "Validator | Validators", + "webhook": "Webhook" }, "cookies": { "accept_all": "Accept All", @@ -692,6 +699,27 @@ "subscriptions": "Network ({count} Subscription) | Validators ({count} Subscriptions)" } }, + "overview": { + "email_activate": "Click here to activate Email notifications", + "email_tooltip": "Your current limit is { limit } emails per day. Your email limit resets in { hours } hours. Upgrade to premium for more.", + "headers": { + "account_groups": "Most notified account groups", + "email_notifications": "Email Notifications", + "most_notifications_24h": "Most Notifications in 24h", + "most_notifications_30d": "Most Notifications in 30d", + "push_notifications": "Push Notifications", + "validator_groups": "Most notified validator groups" + }, + "notifications_activate_premium": { + "_link": "here", + "template": "Click {_link} to activate" + }, + "notifications_download_app": { + "_link": "mobile app", + "template": "Download the {_link} to activate" + }, + "push": "Push" + }, "subscriptions": { "accounts": { "all": { diff --git a/frontend/pages/notifications.vue b/frontend/pages/notifications.vue index 5d591e793..d1701d51d 100644 --- a/frontend/pages/notifications.vue +++ b/frontend/pages/notifications.vue @@ -84,7 +84,9 @@ const openManageNotifications = () => { { + const data = ref() + return { data } +}) + +export function useNotificationsDashboardOverviewStore() { + const { fetch } = useCustomFetch() + const { data: overview } = storeToRefs(notificationsOverviewStore()) + + async function refreshOverview() { + try { + const res = await fetch( + API_PATH.NOTIFICATIONS_OVERVIEW, + ) + overview.value = res.data + + return overview.value + } + catch (e) { + overview.value = undefined + throw e + } + } + + return { + overview, + refreshOverview, + } +} diff --git a/frontend/types/customFetch.ts b/frontend/types/customFetch.ts index 18b2d3ea1..b7cf641b4 100644 --- a/frontend/types/customFetch.ts +++ b/frontend/types/customFetch.ts @@ -45,6 +45,7 @@ export enum API_PATH { NOTIFICATIONS_MACHINE = '/notifications/machines', NOTIFICATIONS_MANAGEMENT_GENERAL = '/notifications/managementGeneral', NOTIFICATIONS_NETWORK = '/notifications/networks', + NOTIFICATIONS_OVERVIEW = '/notifications', NOTIFICATIONS_TEST_EMAIL = '/notifications/test_email', NOTIFICATIONS_TEST_PUSH = '/notifications/test_push', NOTIFICATIONS_TEST_WEBHOOK = '/users/me/notifications/test-webhook', @@ -298,6 +299,11 @@ export const mapping: Record = { [API_PATH.NOTIFICATIONS_NETWORK]: { path: '/users/me/notifications/networks', }, + [API_PATH.NOTIFICATIONS_OVERVIEW]: { + method: 'GET', + mock: false, + path: '/users/me/notifications', + }, [API_PATH.NOTIFICATIONS_TEST_EMAIL]: { method: 'POST', mock: true,