Skip to content

Commit

Permalink
feat(DashboardTableEfficiency): update UI for relative values in th…
Browse files Browse the repository at this point in the history
…e `validator summary`

Display `-` when relative values are equal to 0.

See: BEDS-844
  • Loading branch information
benji-bitfly committed Nov 25, 2024
1 parent 1db1b7c commit 52b6fcc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions frontend/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"BcToggle",
"DashboardChartSummaryChartFilter",
"DashboardGroupManagementModal",
"DashboardTableEfficiency",
"DashboardTableSummaryDetails",
"DashboardTableValidators",
"DashboardValidatorManagmentModal",
Expand Down
23 changes: 13 additions & 10 deletions frontend/components/dashboard/table/DashboardTableEfficiency.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,23 @@ const data = computed(() => {
</slot>
</template>
<span v-if="absolute">
<BcFormatNumber
class="positive"
:value="props.success"
/>
<span class="slash"> / </span>
<BcFormatNumber
:class="data.failedClass"
:value="props.failed"
/>
<span v-if="props.success === 0 && props.failed === 0">-</span>
<template v-else>
<BcFormatNumber
class="positive"
:value="props.success"
/>
<span class="slash"> / </span>
<BcFormatNumber
:class="data.failedClass"
:value="props.failed"
/>
</template>
</span>
<BcFormatPercent
v-else
class="percent"
:base="data.sum"
:base="typeof data.sum === 'number' ? data.sum : undefined"
:value="props.success"
:fixed="undefined"
:color-break-point="80"
Expand Down

0 comments on commit 52b6fcc

Please sign in to comment.