Skip to content

Commit 782cdac

Browse files
committed
feat: display add validator message on tables of empty dashboards
- prevent fetching data on empty-dashboard tables See: BEDS: 1509
1 parent 23fb310 commit 782cdac

File tree

5 files changed

+36
-0
lines changed

5 files changed

+36
-0
lines changed

frontend/components/dashboard/table/DashboardTableClConsolidations.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ const { width } = useWindowSize()
2020
const isMobile = computed(() => {
2121
return width.value < 768
2222
})
23+
24+
const validatorDashboardOverviewStore = useValidatorDashboardOverviewStore()
25+
const {
26+
hasValidators,
27+
} = storeToRefs(validatorDashboardOverviewStore)
28+
2329
const {
2430
getTimestampFromSlot,
2531
} = useNetworkStore()
@@ -266,6 +272,9 @@ const setSearch = (value?: string) => {
266272
</div>
267273
</div>
268274
</template>
275+
<template #empty>
276+
<DashboardTableAddValidator v-if="!hasValidators" />
277+
</template>
269278
</BcTable>
270279
</ClientOnly>
271280
</template>

frontend/components/dashboard/table/DashboardTableClWithdrawals.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ const isMobile = computed(() => {
2929
return width.value < 768
3030
})
3131
32+
const validatorDashboardOverviewStore = useValidatorDashboardOverviewStore()
33+
const {
34+
hasValidators,
35+
} = storeToRefs(validatorDashboardOverviewStore)
36+
3237
const clWithdrawalsWithIdentifiers = computed(() =>
3338
addIdentifier(clWithdrawals, 'slot', 'slot_index'),
3439
)
@@ -388,6 +393,9 @@ const getGroupName = (groupId: number) => {
388393
</div>
389394
</div>
390395
</template>
396+
<template #empty>
397+
<DashboardTableAddValidator v-if="!hasValidators" />
398+
</template>
391399
</BcTable>
392400
</ClientOnly>
393401
</template>

frontend/components/dashboard/table/DashboardTableElConsolidations.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ const isMobile = computed(() => {
2020
return width.value < 768
2121
})
2222
23+
const validatorDashboardOverviewStore = useValidatorDashboardOverviewStore()
24+
const {
25+
hasValidators,
26+
} = storeToRefs(validatorDashboardOverviewStore)
27+
2328
const query = defineModel<TableQueryParams>('query')
2429
2530
const onSort = (sort: DataTableSortEvent) => {
@@ -330,6 +335,9 @@ const setSearch = (value?: string) => {
330335
</div>
331336
</div>
332337
</template>
338+
<template #empty>
339+
<DashboardTableAddValidator v-if="!hasValidators" />
340+
</template>
333341
</BcTable>
334342
</ClientOnly>
335343
</template>

frontend/components/dashboard/table/DashboardTableElWithdrawals.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ const {
2323
} = useDashboardKey()
2424
const { t: $t } = useTranslation()
2525
26+
const validatorDashboardOverviewStore = useValidatorDashboardOverviewStore()
27+
const {
28+
hasValidators,
29+
} = storeToRefs(validatorDashboardOverviewStore)
30+
2631
const { width } = useWindowSize()
2732
const isMobile = computed(() => {
2833
return width.value < 768
@@ -354,6 +359,9 @@ const getGroupName = (groupId: number) => {
354359
</div>
355360
</div>
356361
</template>
362+
<template #empty>
363+
<DashboardTableAddValidator v-if="!hasValidators" />
364+
</template>
357365
</BcTable>
358366
</ClientOnly>
359367
</template>

frontend/pages/dashboard/[[id]]/index.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ useBcSeo(seoTitle, true)
8484
8585
const validatorDashboardOverviewStore = useValidatorDashboardOverviewStore()
8686
const {
87+
hasValidators,
8788
overview,
8889
} = storeToRefs(validatorDashboardOverviewStore)
8990
const {
@@ -363,6 +364,8 @@ const route = useRoute()
363364
const activeTab = computed(() => route.hash)
364365
365366
const refreshActiveTab = () => {
367+
if (!hasValidators.value) return
368+
366369
switch (activeTab.value) {
367370
case '#consolidations':
368371
refreshElConsolidationsData()

0 commit comments

Comments
 (0)