diff --git a/frontend/components/bc/BcAccordion.vue b/frontend/components/bc/BcAccordion.vue new file mode 100644 index 000000000..b375bf80c --- /dev/null +++ b/frontend/components/bc/BcAccordion.vue @@ -0,0 +1,144 @@ + + + + + diff --git a/frontend/components/bc/BcCard.vue b/frontend/components/bc/BcCard.vue new file mode 100644 index 000000000..f2eed9a5a --- /dev/null +++ b/frontend/components/bc/BcCard.vue @@ -0,0 +1,17 @@ + + + + + diff --git a/frontend/components/bc/BcContentFilter.vue b/frontend/components/bc/BcContentFilter.vue index 53e3a67cb..bf3619eea 100644 --- a/frontend/components/bc/BcContentFilter.vue +++ b/frontend/components/bc/BcContentFilter.vue @@ -1,15 +1,14 @@ diff --git a/frontend/components/bc/BcText.vue b/frontend/components/bc/BcText.vue index 57d343cf6..588198ecf 100644 --- a/frontend/components/bc/BcText.vue +++ b/frontend/components/bc/BcText.vue @@ -1,8 +1,9 @@ diff --git a/frontend/components/notifications/NotificationsDashboardsTable.vue b/frontend/components/notifications/NotificationsDashboardsTable.vue index f221486a7..51510411d 100644 --- a/frontend/components/notifications/NotificationsDashboardsTable.vue +++ b/frontend/components/notifications/NotificationsDashboardsTable.vue @@ -8,6 +8,7 @@ import type { DashboardType } from '~/types/dashboard' import { useUserDashboardStore } from '~/stores/dashboard/useUserDashboardStore' import type { ChainIDs } from '~/types/network' import type { NotificationDashboardsTableRow } from '~/types/api/notifications' +import { NotificationsDashboardDialogEntity } from '#components' defineEmits<{ (e: 'openDialog'): void }>() @@ -40,11 +41,6 @@ const colsVisible = computed(() => { } }) -const openDialog = () => { - // TODO: implement dialog - alert('not implemented yet 😪') -} - const getDashboardType = (isAccount: boolean): DashboardType => isAccount ? 'account' : 'validator' const { overview } = useNotificationsDashboardOverviewStore() const mapEventtypeToText = (eventType: NotificationDashboardsTableRow['event_types'][number]) => { @@ -95,6 +91,20 @@ const mapEventtypeToText = (eventType: NotificationDashboardsTableRow['event_typ const textDashboardNotifications = (event_types: NotificationDashboardsTableRow['event_types']) => { return event_types.map(mapEventtypeToText).join(', ') } + +const dialog = useDialog() + +const showDialog = (row: { identifier: string } & NotificationDashboardsTableRow) => { + dialog.open(NotificationsDashboardDialogEntity, { + data: { + dashboard_id: row.dashboard_id, + epoch: row.epoch, + group_id: row.group_id, + group_name: row.group_name, + identifier: row.identifier, + }, + }) +} @@ -373,17 +384,6 @@ $breakpoint-lg: 1024px; @include utils.truncate-text; } -:deep(.bc-table-header) { - .h1 { - display: none; - } - - @media (min-width: $breakpoint-lg) { - .h1 { - display: block; - } - } -} :deep(.right-info) { flex-direction: column; justify-content: center; diff --git a/frontend/locales/en.json b/frontend/locales/en.json index be4f6211d..586d44e26 100644 --- a/frontend/locales/en.json +++ b/frontend/locales/en.json @@ -16,6 +16,7 @@ }, "clipboard": { "copied": "Copied!", + "copied_to_clipboard": "Copied to clipboard!", "copy": "Copy to clipboard" }, "common": { @@ -613,6 +614,25 @@ "heading":"Delete all notifications", "paragraph": "Do you really want to delete all notifications for this dashboard?" }, + "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", + "proposal_missed": "Proposal missed", + "slashed": "Slashed", + "sync_committee": "Sync committee", + "title": "Notifications", + "upcoming_proposal": "Upcoming proposal", + "validator_back_online": "Validator back online", + "validator_offline": "Validator offline", + "validator_offline_reminder": "Validator offline reminder", + "withdrawal": "Withdrawal" + + }, "heading_webhook": "Edit Webhook", "info_send_via_discord": { "_link": "Discord webhook", diff --git a/frontend/stores/notifications/useNotificationsDashboardDetailsStore.ts b/frontend/stores/notifications/useNotificationsDashboardDetailsStore.ts new file mode 100644 index 000000000..06754b995 --- /dev/null +++ b/frontend/stores/notifications/useNotificationsDashboardDetailsStore.ts @@ -0,0 +1,52 @@ +import type { + InternalGetUserNotificationsValidatorDashboardResponse, + NotificationDashboardsTableRow, NotificationValidatorDashboardDetail, +} from '~/types/api/notifications' +import { API_PATH } from '~/types/customFetch' + +export const useNotificationsDashboardDetailsStore = defineStore('notifications-dashboard-details', () => { + const { fetch } = useCustomFetch() + const detailsList = ref(new Map()) + + const getDetails = async ({ + dashboard_id, + epoch, + group_id, + search, + }: + { + search?: string, + } + & Pick, + ) => { + return fetch( + API_PATH.NOTIFICATIONS_DASHBOARDS_DETAILS_VALIDATOR, + { + query: { + search, + }, + }, + { + dashboard_id, + epoch, + group_id, + }, + ) + } + + const addDetails = ({ + details, + identifier, + }: { + details: NotificationValidatorDashboardDetail, + identifier: string, + }) => { + detailsList.value.set(identifier, details) + } + + return { + addDetails, + detailsList, + getDetails, + } +}) diff --git a/frontend/stores/notifications/useNotificationsDashboardStore.ts b/frontend/stores/notifications/useNotificationsDashboardStore.ts index 41f392627..97963628b 100644 --- a/frontend/stores/notifications/useNotificationsDashboardStore.ts +++ b/frontend/stores/notifications/useNotificationsDashboardStore.ts @@ -30,7 +30,7 @@ export function useNotificationsDashboardStore(networkId: globalThis.Ref = { [API_PATH.NOTIFICATIONS_DASHBOARDS]: { path: '/users/me/notifications/dashboards', }, + [API_PATH.NOTIFICATIONS_DASHBOARDS_DETAILS_ACCOUNT]: { + getPath: pathValues => + `/users/me/notifications/account-dashboards/${pathValues?.dashboard_id}` + + `/groups/${pathValues?.group_id}/epochs/${pathValues?.epoch}`, + path: '/users/me/notifications/account-dashboards/{dashboard_id}/groups/{group_id}/epochs/{epoch}', + }, + [API_PATH.NOTIFICATIONS_DASHBOARDS_DETAILS_VALIDATOR]: { + getPath: pathValues => + `/users/me/notifications/validator-dashboards/${pathValues?.dashboard_id}` + + `/groups/${pathValues?.group_id}/epochs/${pathValues?.epoch}`, + path: '/users/me/notifications/validator-dashboards/{dashboard_id}/groups/{group_id}/epochs/{epoch}', + }, [API_PATH.NOTIFICATIONS_MACHINE]: { path: '/users/me/notifications/machines', },