Skip to content

Commit

Permalink
fix(notifications): adapt to type changes
Browse files Browse the repository at this point in the history
Peter decided to remove `group_offline`, `group_offline_reminder`
and `group_back_online`

Co-authored-by: Peter (bitfly) <[email protected]>
  • Loading branch information
marcel-bitfly and peterbitfly committed Oct 17, 2024
1 parent 3cd59d1 commit 3497388
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 119 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
faCube,
faFileSignature,
faGlobe,
faMoneyBill,
faPowerOff,
faRocket,
faUserSlash,
Expand Down Expand Up @@ -89,30 +88,6 @@ defineEmits<{ (e: 'filter-changed', value: string): void }>()
</BcLink>
</template>
</BcAccordion>
<BcAccordion
v-if="details?.group_offline?.length"
:items="details?.group_offline"
:info-copy="$t('notifications.dashboards.dialog.entity.group_offline')"
>
<template #heading>
{{ $t('notifications.dashboards.dialog.entity.group_offline') }} ({{ details?.group_offline?.length ?? 0 }})
</template>
<template #headingIcon>
<FontAwesomeIcon :icon="faPowerOff" class="notifications-dashboard-dialog-entity__icon__red" />
</template>
<template #item="{ item: groupOffline }">
<span>
{{ groupOffline.group_name }}
</span>

<BcLink
:to="`/dashboard/${groupOffline.dashboard_id}`"
class="link"
>
({{ groupOffline.dashboard_id }})
</BcLink>
</template>
</BcAccordion>
<BcAccordion
v-if="details?.proposal_missed?.length"
:items="details?.proposal_missed"
Expand All @@ -134,9 +109,9 @@ defineEmits<{ (e: 'filter-changed', value: string): void }>()
>
{{ proposal.index }}
</BcLink>
<template v-if="proposal.blocks.length">
<template v-if="proposal.slots.length">
[<BcLink
v-for="block in proposal.blocks"
v-for="block in proposal.slots"
:key="block"
:to="`/block/${block}`"
class="notifications-dashboard-dialog-entity__list-item link"
Expand Down Expand Up @@ -235,44 +210,20 @@ defineEmits<{ (e: 'filter-changed', value: string): void }>()
</template>
<template #item="{ item: attestation }">
<BcLink
:to="`/validator/${attestation.Index}`"
:to="`/validator/${attestation.index}`"
class="link"
>
{{ attestation.Index }}
{{ attestation.index }}
</BcLink>
(<BcLink
:to="`/epoch/${attestation.Epoch}`"
:to="`/epoch/${attestation.epoch}`"
class="link"
>
{{ $t('common.epoch') }}
{{ attestation.Epoch }}
{{ attestation.epoch }}
</BcLink>)
</template>
</BcAccordion>
<BcAccordion
v-if="details?.withdrawal?.length"
:items="details?.withdrawal"
:info-copy="$t('notifications.dashboards.dialog.entity.withdrawal')"
>
<template #headingIcon>
<FontAwesomeIcon
:icon="faMoneyBill"
class="notifications-dashboard-dialog-entity__icon__green"
/>
</template>
<template #heading>
{{ $t('notifications.dashboards.dialog.entity.withdrawal') }} ({{ details?.withdrawal?.length ?? 0 }})
</template>
<template #item="{ item: withdrawalItem }">
<BcLink
:to="`/validator/${withdrawalItem.index}`"
class="link"
>
{{ withdrawalItem.index }}
</BcLink>
<template v-if="withdrawalItem.blocks.length" />
</template>
</BcAccordion>
<BcAccordion
v-if="details?.validator_back_online?.length"
:items="details?.validator_back_online"
Expand All @@ -299,36 +250,6 @@ defineEmits<{ (e: 'filter-changed', value: string): void }>()
-->
</template>
</BcAccordion>
<BcAccordion
v-if="details?.group_back_online?.length"
:items="details?.group_back_online"
:info-copy="$t('notifications.dashboards.dialog.entity.group_back_online')"
>
<template #heading>
{{ $t('notifications.dashboards.dialog.entity.group_back_online') }} ({{ details?.group_back_online?.length ?? 0 }})
</template>
<template #headingIcon>
<FontAwesomeIcon :icon="faGlobe" class="notifications-dashboard-dialog-entity__icon__green" />
</template>
<template #item="{ item: group }">
<span>
{{ group.group_name }}
</span>
<span>
[{{ group.epoch_count }}&nbsp;{{ $t('common.epoch', group.epoch_count) }}]
</span>
(<BcLink
class="link"
:to="`/dashboard/${group.dashboard_id}`"
>
<!--
this will remove white space in html
-->Dashboard {{ group.dashboard_id }}
</BcLink>)<!--
this will remove white space in html
-->
</template>
</BcAccordion>
<BcAccordion
v-if="details?.validator_offline_reminder?.length"
:items="details?.validator_offline_reminder"
Expand All @@ -352,35 +273,6 @@ defineEmits<{ (e: 'filter-changed', value: string): void }>()
</BcLink>
</template>
</BcAccordion>
<BcAccordion
v-if="details?.group_offline_reminder?.length"
:items="details?.group_offline_reminder"
:info-copy="$t('notifications.dashboards.dialog.entity.group_offline_reminder')"
>
<template #headingIcon>
<FontAwesomeIcon
:icon="faAlarmSnooze"
class="notifications-dashboard-dialog-entity__icon__red"
/>
</template>
<template #heading>
{{ $t('notifications.dashboards.dialog.entity.group_offline_reminder') }} ({{ details?.group_offline_reminder?.length ?? 0 }})
</template>
<template #item="{ item: groupOfflineReminder }">
{{ groupOfflineReminder.group_name }}
(<BcLink
class="link"
:to="`/dashboard/${groupOfflineReminder.dashboard_id}`"
>
<!--
this will remove white space in html
-->Dashboard {{ groupOfflineReminder.dashboard_id }}
</BcLink>)
<!--
this will remove white space in html
-->
</template>
</BcAccordion>
<BcAccordion
v-if="details?.upcoming_proposals?.length"
:items="details?.upcoming_proposals"
Expand All @@ -402,9 +294,9 @@ defineEmits<{ (e: 'filter-changed', value: string): void }>()
>
{{ upcomingProposal.index }}
</BcLink>
<template v-if="upcomingProposal.blocks.length">
<template v-if="upcomingProposal.slots.length">
[<BcLink
v-for="block in upcomingProposal.blocks"
v-for="block in upcomingProposal.slots"
:key="block"
:to="`/block/${block}`"
class="notifications-dashboard-dialog-entity__list-item link"
Expand Down
3 changes: 0 additions & 3 deletions frontend/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -616,9 +616,6 @@
},
"entity": {
"attestation_missed":"Attestation missed",
"group_back_online": "Group back online",
"group_offline": "Group offline",
"group_offline_reminder": "Group offline reminder",
"max_collateral":"Maximum collateral reached",
"min_collateral":"Minimum collateral reached",
"proposal_done": "Proposal done",
Expand Down

0 comments on commit 3497388

Please sign in to comment.