Skip to content

Commit

Permalink
refactor: split frontend block proposal success & miss notification e…
Browse files Browse the repository at this point in the history
…vents

See: BEDS-1079
  • Loading branch information
LuccaBitfly committed Jan 2, 2025
1 parent f29cc18 commit 118d202
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,11 @@ const wrappedDashboards: ComputedRef<
if (settingsValidatorDashboard.is_attestations_missed_subscribed) {
result.push($t('notifications.subscriptions.validators.attestation_missed.label'))
}
if (settingsValidatorDashboard.is_block_proposal_subscribed) {
result.push($t('notifications.subscriptions.validators.block_proposal.label'))
if (settingsValidatorDashboard.is_block_proposal_missed_subscribed) {
result.push($t('notifications.subscriptions.validators.block_proposal_missed.label'))
}
if (settingsValidatorDashboard.is_block_proposal_success_subscribed) {
result.push($t('notifications.subscriptions.validators.block_proposal_success.label'))
}
if (settingsValidatorDashboard.is_upcoming_block_proposal_subscribed) {
result.push($t('notifications.subscriptions.validators.upcoming_block_proposal.label'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ function closeDialog(): void {
const checkboxes = ref({
is_attestations_missed_subscribed: props.value?.is_attestations_missed_subscribed ?? false,
is_block_proposal_subscribed: props.value?.is_block_proposal_subscribed ?? false,
is_block_proposal_missed_subscribed: props.value?.is_block_proposal_missed_subscribed ?? false,
is_block_proposal_success_subscribed: props.value?.is_block_proposal_success_subscribed ?? false,
is_group_efficiency_below_subscribed: props.value?.is_group_efficiency_below_subscribed ?? false,
is_max_collateral_subscribed: props.value?.is_max_collateral_subscribed ?? false,
is_min_collateral_subscribed: props.value?.is_min_collateral_subscribed ?? false,
Expand Down Expand Up @@ -108,8 +109,12 @@ watch(hasAllEvents, () => {
:info="$t('notifications.subscriptions.validators.attestation_missed.info', { count: Number(formatSecondsTo(secondsPerEpoch, { minimumFractionDigits: 1 }).minutes) })"
/>
<BcSettingsRow
v-model:checkbox="checkboxes.is_block_proposal_subscribed"
:label="$t('notifications.subscriptions.validators.block_proposal.label')"
v-model:checkbox="checkboxes.is_block_proposal_success_subscribed"
:label="$t('notifications.subscriptions.validators.block_proposal_success.label')"
/>
<BcSettingsRow
v-model:checkbox="checkboxes.is_block_proposal_missed_subscribed"
:label="$t('notifications.subscriptions.validators.block_proposal_missed.label')"
/>
<BcSettingsRow
v-model:checkbox="checkboxes.is_upcoming_block_proposal_subscribed"
Expand Down
3 changes: 2 additions & 1 deletion frontend/components/playground/PlaygroundDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ const openQuestion = (yesLabel?: string, noLabel?: string) => {
const validatorSub: NotificationSettingsValidatorDashboard = {
group_efficiency_below_threshold: 0,
is_attestations_missed_subscribed: true,
is_block_proposal_subscribed: true,
is_block_proposal_missed_subscribed: true,
is_block_proposal_success_subscribed: true,
is_group_efficiency_below_subscribed: true,
is_max_collateral_subscribed: false,
is_min_collateral_subscribed: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ export function useNotificationsManagementDashboards() {
const accountDashboarSettings = settings as NotificationSettingsValidatorDashboard
accountDashboarSettings.group_efficiency_below_threshold = 0
accountDashboarSettings.is_attestations_missed_subscribed = false
accountDashboarSettings.is_block_proposal_subscribed = false
accountDashboarSettings.is_block_proposal_missed_subscribed = false
accountDashboarSettings.is_block_proposal_success_subscribed = false
accountDashboarSettings.is_group_efficiency_below_subscribed = false
accountDashboarSettings.is_max_collateral_subscribed = false
accountDashboarSettings.is_min_collateral_subscribed = false
Expand Down
7 changes: 5 additions & 2 deletions frontend/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -849,8 +849,11 @@
"info": "We will trigger a notification every epoch ({count} minute) during downtime. | We will trigger a notification every epoch ({count} minutes) during downtime.",
"label": "Attestations missed"
},
"block_proposal": {
"label": "Block proposal (missed & success)"
"block_proposal_missed": {
"label": "Block proposal missed"
},
"block_proposal_success": {
"label": "Block proposal success"
},
"explanation": "All notifications are sent after network finality (~20min).",
"group_efficiency": {
Expand Down
3 changes: 2 additions & 1 deletion frontend/types/api/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ export interface NotificationSettingsValidatorDashboard {
is_group_efficiency_below_subscribed: boolean;
group_efficiency_below_threshold: number /* float64 */;
is_attestations_missed_subscribed: boolean;
is_block_proposal_subscribed: boolean;
is_block_proposal_success_subscribed: boolean;
is_block_proposal_missed_subscribed: boolean;
is_upcoming_block_proposal_subscribed: boolean;
is_sync_subscribed: boolean;
is_withdrawal_processed_subscribed: boolean;
Expand Down

0 comments on commit 118d202

Please sign in to comment.