-
+
- {{ v }}
+ {{ validator }}
,
-
+
+
+ {{ cappedValidators.length }} {{ $t('common.validator', cappedValidators.length) }}
+
Date: Thu, 24 Oct 2024 14:02:28 +0200
Subject: [PATCH 121/124] refactor: rename last 24h email count
- change `emails_count` to `email_count`
See: BEDS-870
---
backend/pkg/api/data_access/notifications.go | 2 +-
backend/pkg/api/types/notifications.go | 2 +-
frontend/components/notifications/NotificationsOverview.vue | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/backend/pkg/api/data_access/notifications.go b/backend/pkg/api/data_access/notifications.go
index 4774fed0c..3c99595de 100644
--- a/backend/pkg/api/data_access/notifications.go
+++ b/backend/pkg/api/data_access/notifications.go
@@ -204,7 +204,7 @@ func (d *DataAccessService) GetNotificationOverview(ctx context.Context, userId
}
return res.Uint64()
}
- response.Last24hEmailsCount, err = getMessageCount("n_mails")
+ response.Last24hEmailCount, err = getMessageCount("n_mails")
if err != nil {
return err
}
diff --git a/backend/pkg/api/types/notifications.go b/backend/pkg/api/types/notifications.go
index 777cad8b3..c28ed0370 100644
--- a/backend/pkg/api/types/notifications.go
+++ b/backend/pkg/api/types/notifications.go
@@ -15,7 +15,7 @@ type NotificationOverviewData struct {
VDBMostNotifiedGroups [3]string `json:"vdb_most_notified_groups"`
ADBMostNotifiedGroups [3]string `json:"adb_most_notified_groups"`
- Last24hEmailsCount uint64 `json:"last_24h_emails_count"` // daily limit should be available in user info
+ Last24hEmailCount uint64 `json:"last_24h_email_count"` // daily limit should be available in user info
Last24hPushCount uint64 `json:"last_24h_push_count"`
Last24hWebhookCount uint64 `json:"last_24h_webhook_count"`
diff --git a/frontend/components/notifications/NotificationsOverview.vue b/frontend/components/notifications/NotificationsOverview.vue
index 6de7c17b7..b30b8161f 100644
--- a/frontend/components/notifications/NotificationsOverview.vue
+++ b/frontend/components/notifications/NotificationsOverview.vue
@@ -17,7 +17,7 @@ const hasEmail = computed(() => overview.value?.is_email_notifications_enabled)
const hasPushNotifications = computed(() => overview.value?.is_push_notifications_enabled)
const vdbMostNotifiedGroups = computed(() => overview.value?.vdb_most_notified_groups || [])
const adbMostNotifiedGroups = computed(() => overview.value?.adb_most_notified_groups || [])
-const last24hEmailsCount = computed(() => overview.value?.last_24h_emails_count ?? 0)
+const last24hEmailsCount = computed(() => overview.value?.last_24h_email_count ?? 0)
const last24hPushCount = computed(() => overview.value?.last_24h_push_count ?? 0)
const last24hWebhookCount = computed(() => overview.value?.last_24h_webhook_count ?? 0)
const notificationsTotal = computed(() => {
From 0a5edafd267bb94d6795546998067465fe386062 Mon Sep 17 00:00:00 2001
From: Lucca Dukic <109136188+LuccaBitfly@users.noreply.github.com>
Date: Thu, 24 Oct 2024 14:03:03 +0200
Subject: [PATCH 122/124] feat: add next email count reset ts to notification
overview
See: BEDS-870
---
backend/pkg/api/data_access/notifications.go | 1 +
backend/pkg/api/types/notifications.go | 7 ++++---
frontend/types/api/notifications.ts | 3 ++-
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/backend/pkg/api/data_access/notifications.go b/backend/pkg/api/data_access/notifications.go
index 3c99595de..8f1e6961d 100644
--- a/backend/pkg/api/data_access/notifications.go
+++ b/backend/pkg/api/data_access/notifications.go
@@ -253,6 +253,7 @@ func (d *DataAccessService) GetNotificationOverview(ctx context.Context, userId
err = d.userReader.GetContext(ctx, &response, querySql, args...)
return err
})
+ response.NextEmailCountResetTimestamp = time.Now().Add(utils.Day).Truncate(utils.Day).Unix()
err = eg.Wait()
return &response, err
diff --git a/backend/pkg/api/types/notifications.go b/backend/pkg/api/types/notifications.go
index c28ed0370..a31d3ebe6 100644
--- a/backend/pkg/api/types/notifications.go
+++ b/backend/pkg/api/types/notifications.go
@@ -15,9 +15,10 @@ type NotificationOverviewData struct {
VDBMostNotifiedGroups [3]string `json:"vdb_most_notified_groups"`
ADBMostNotifiedGroups [3]string `json:"adb_most_notified_groups"`
- Last24hEmailCount uint64 `json:"last_24h_email_count"` // daily limit should be available in user info
- Last24hPushCount uint64 `json:"last_24h_push_count"`
- Last24hWebhookCount uint64 `json:"last_24h_webhook_count"`
+ NextEmailCountResetTimestamp int64 `json:"next_email_count_reset_timestamp"`
+ Last24hEmailCount uint64 `json:"last_24h_email_count"` // daily limit should be available in user info
+ Last24hPushCount uint64 `json:"last_24h_push_count"`
+ Last24hWebhookCount uint64 `json:"last_24h_webhook_count"`
// counts are shown in their respective tables
VDBSubscriptionsCount uint64 `db:"vdb_subscriptions_count" json:"vdb_subscriptions_count"`
diff --git a/frontend/types/api/notifications.ts b/frontend/types/api/notifications.ts
index 230ac73e0..2891cb1f7 100644
--- a/frontend/types/api/notifications.ts
+++ b/frontend/types/api/notifications.ts
@@ -17,7 +17,8 @@ export interface NotificationOverviewData {
*/
vdb_most_notified_groups: string[];
adb_most_notified_groups: string[];
- last_24h_emails_count: number /* uint64 */; // daily limit should be available in user info
+ next_email_count_reset_timestamp: number /* int64 */;
+ last_24h_email_count: number /* uint64 */; // daily limit should be available in user info
last_24h_push_count: number /* uint64 */;
last_24h_webhook_count: number /* uint64 */;
/**
From 6c646e64bb148dde61b5d3ad309a0c9adcd9daa7 Mon Sep 17 00:00:00 2001
From: benji-bitfly
Date: Fri, 25 Oct 2024 14:59:07 +0200
Subject: [PATCH 123/124] refactore(NotificationsOverview): add `reset hours`
for `email limit`
Show remaining hours until the account's email limit resets for the user
See: BEDS-870
---
frontend/components/notifications/NotificationsOverview.vue | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/frontend/components/notifications/NotificationsOverview.vue b/frontend/components/notifications/NotificationsOverview.vue
index b30b8161f..a9b30838c 100644
--- a/frontend/components/notifications/NotificationsOverview.vue
+++ b/frontend/components/notifications/NotificationsOverview.vue
@@ -27,8 +27,7 @@ const notificationsTotal = computed(() => {
const { user } = useUserStore()
const mailLimit = computed(() => user.value?.premium_perks.email_notifications_per_day ?? 0)
-// TODO: replace with actual hours value when we get the endpoint.
-const resetHours = ref(12)
+const resetHours = computed(() => overview.value?.next_email_count_reset_timestamp ?? 0)
const tooltipEmail = computed(() => {
return $t('notifications.overview.email_tooltip', {
hours: resetHours.value,
From c03c764223dfe0213f559d221379b530d2e5214b Mon Sep 17 00:00:00 2001
From: Stefan Pletka <124689083+Eisei24@users.noreply.github.com>
Date: Tue, 29 Oct 2024 09:24:49 +0100
Subject: [PATCH 124/124] Cleaned up event names
---
backend/pkg/api/data_access/notifications.go | 4 ++--
backend/pkg/commons/types/frontend.go | 13 +++++--------
2 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/backend/pkg/api/data_access/notifications.go b/backend/pkg/api/data_access/notifications.go
index 8f1e6961d..d84d0ceda 100644
--- a/backend/pkg/api/data_access/notifications.go
+++ b/backend/pkg/api/data_access/notifications.go
@@ -1896,7 +1896,7 @@ func (d *DataAccessService) GetNotificationSettingsDashboards(ctx context.Contex
settings.IsBlockProposalSubscribed = true
case types.ValidatorUpcomingProposalEventName:
settings.IsUpcomingBlockProposalSubscribed = true
- case types.SyncCommitteeSoon:
+ case types.SyncCommitteeSoonEventName:
settings.IsSyncSubscribed = true
case types.ValidatorReceivedWithdrawalEventName:
settings.IsWithdrawalProcessedSubscribed = true
@@ -2127,7 +2127,7 @@ func (d *DataAccessService) UpdateNotificationSettingsValidatorDashboard(ctx con
d.AddOrRemoveEvent(&eventsToInsert, &eventsToDelete, settings.IsGroupEfficiencyBelowSubscribed, userId, types.ValidatorGroupEfficiencyEventName, networkName, eventFilter, epoch, settings.GroupEfficiencyBelowThreshold)
d.AddOrRemoveEvent(&eventsToInsert, &eventsToDelete, settings.IsAttestationsMissedSubscribed, userId, types.ValidatorMissedAttestationEventName, networkName, eventFilter, epoch, 0)
d.AddOrRemoveEvent(&eventsToInsert, &eventsToDelete, settings.IsUpcomingBlockProposalSubscribed, userId, types.ValidatorUpcomingProposalEventName, networkName, eventFilter, epoch, 0)
- d.AddOrRemoveEvent(&eventsToInsert, &eventsToDelete, settings.IsSyncSubscribed, userId, types.SyncCommitteeSoon, networkName, eventFilter, epoch, 0)
+ d.AddOrRemoveEvent(&eventsToInsert, &eventsToDelete, settings.IsSyncSubscribed, userId, types.SyncCommitteeSoonEventName, networkName, eventFilter, epoch, 0)
d.AddOrRemoveEvent(&eventsToInsert, &eventsToDelete, settings.IsWithdrawalProcessedSubscribed, userId, types.ValidatorReceivedWithdrawalEventName, networkName, eventFilter, epoch, 0)
d.AddOrRemoveEvent(&eventsToInsert, &eventsToDelete, settings.IsSlashedSubscribed, userId, types.ValidatorGotSlashedEventName, networkName, eventFilter, epoch, 0)
d.AddOrRemoveEvent(&eventsToInsert, &eventsToDelete, settings.IsMaxCollateralSubscribed, userId, types.RocketpoolCollateralMaxReachedEventName, networkName, eventFilter, epoch, settings.MaxCollateralThreshold)
diff --git a/backend/pkg/commons/types/frontend.go b/backend/pkg/commons/types/frontend.go
index 60e0a7f48..acafbcae3 100644
--- a/backend/pkg/commons/types/frontend.go
+++ b/backend/pkg/commons/types/frontend.go
@@ -65,9 +65,6 @@ func (npui NotificationsPerUserId) AddNotification(n Notification) {
}
const (
- ValidatorMissedProposalEventName EventName = "validator_proposal_missed"
- ValidatorExecutedProposalEventName EventName = "validator_proposal_submitted"
-
ValidatorDidSlashEventName EventName = "validator_did_slash"
ValidatorReceivedDepositEventName EventName = "validator_received_deposit"
@@ -78,20 +75,20 @@ const (
NetworkValidatorExitQueueNotFullEventName EventName = "network_validator_exit_queue_not_full"
NetworkLivenessIncreasedEventName EventName = "network_liveness_increased"
TaxReportEventName EventName = "user_tax_report"
- SyncCommitteeSoonEventName EventName = "validator_synccommittee_soon"
//nolint:misspell
RocketpoolCommissionThresholdEventName EventName = "rocketpool_commision_threshold"
// Validator dashboard events
ValidatorIsOfflineEventName EventName = "validator_is_offline"
ValidatorIsOnlineEventName EventName = "validator_is_online"
- ValidatorGroupEfficiencyEventName EventName = "validator_group_efficiency"
ValidatorMissedAttestationEventName EventName = "validator_attestation_missed"
- ValidatorProposalEventName EventName = "validator_proposal"
+ ValidatorMissedProposalEventName EventName = "validator_proposal_missed"
+ ValidatorExecutedProposalEventName EventName = "validator_proposal_submitted"
ValidatorUpcomingProposalEventName EventName = "validator_proposal_upcoming"
- SyncCommitteeSoon EventName = "validator_synccommittee_soon"
+ SyncCommitteeSoonEventName EventName = "validator_synccommittee_soon"
ValidatorReceivedWithdrawalEventName EventName = "validator_withdrawal"
ValidatorGotSlashedEventName EventName = "validator_got_slashed"
+ ValidatorGroupEfficiencyEventName EventName = "validator_group_efficiency"
RocketpoolCollateralMinReachedEventName EventName = "rocketpool_colleteral_min" //nolint:misspell
RocketpoolCollateralMaxReachedEventName EventName = "rocketpool_colleteral_max" //nolint:misspell
@@ -113,8 +110,8 @@ const (
// Network events
RocketpoolNewClaimRoundStartedEventName EventName = "rocketpool_new_claimround"
- NetworkGasAboveThresholdEventName EventName = "network_gas_above_threshold"
NetworkGasBelowThresholdEventName EventName = "network_gas_below_threshold"
+ NetworkGasAboveThresholdEventName EventName = "network_gas_above_threshold"
NetworkParticipationRateThresholdEventName EventName = "network_participation_rate_threshold"
)