Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(DashboardTableEfficiency): update UI for relative values in th… #1149

Draft
wants to merge 3 commits into
base: staging
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
9 changes: 5 additions & 4 deletions frontend/assets/css/prime_menubar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,16 @@
border-color: var(--primary-color);
}
> .p-menubar-item-content {
cursor: pointer;
padding: var(--padding-small) var(--padding);
border-radius: var(--border-radius);
height: 27px;
margin-top: 1px;
height: 1.6875rem;
margin-top: 0.0625rem;
justify-content: center;

&:not(:has(.text)) {
padding-left: 8px;
padding-right: 8px;
padding-left: 0.5rem;
padding-right: 0.5rem;
}
}

Expand Down
4 changes: 2 additions & 2 deletions frontend/components/bc/menu/BcMenuBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ defineProps<Props>()
<BcLink
v-else-if="item.route && !item.command"
:to="item.route"
class="pointer"

:class="{ 'p-active': item.active }"
>
<span
Expand All @@ -50,7 +50,7 @@ defineProps<Props>()
</BcLink>
<span
v-else
class="button-content pointer"
class="button-content"
:class="[item.class, { 'p-active': item.active }]"
:highlight="item.highlight || null"
>
Expand Down
42 changes: 24 additions & 18 deletions frontend/components/dashboard/table/DashboardTableEfficiency.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,36 @@ const data = computed(() => {
<slot name="tooltip">
<DashboardTableEfficiency
v-bind="props"
:absolute="!absolute"
:absolute
:is-tooltip="true"
/>
</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">0 / 0</span>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how would 50/70 be displayed?

  1. 50/50 or
  2. 50 / 50

<template v-else>
<BcFormatNumber
class="positive"
:value="props.success === 0 ? undefined : props.success"
/>
<span class="slash"> / </span>
<BcFormatNumber
:class="data.failedClass"
:value="props.failed === 0 ? undefined : props.failed"
/>
</template>
</span>
<span v-else>
<span v-if="props.success === 0 && props.failed === 0">-</span>
<BcFormatPercent
v-else
class="percent"
:base="typeof data.sum === 'number' ? data.sum : undefined"
:value="props.success === 0 ? undefined : props.success"
:fixed="undefined"
:color-break-point="80"
:full-on-empty-base="true"
/>
</span>
<BcFormatPercent
v-else
class="percent"
:base="data.sum"
:value="props.success"
:fixed="undefined"
:color-break-point="80"
:full-on-empty-base="true"
/>
</BcTooltip>
</template>
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ const openValidatorModal = () => {
</template>
</DashboardTableEfficiency>
<BcTooltip
v-if="data.tooltip?.title && data.tooltip?.text"
position="top"
:text="data.tooltip?.text"
:title="data.tooltip?.title"
Expand All @@ -248,7 +249,7 @@ const openValidatorModal = () => {
/>
</BcTooltip>
<FontAwesomeIcon
v-if="data?.context"
v-if="data?.context && data.efficiency.status_count.success > 0"
class="link popout"
:icon="faArrowUpRightFromSquare"
@click="openValidatorModal"
Expand All @@ -274,6 +275,7 @@ const openValidatorModal = () => {
:color-break-point="80"
/>
<BcTooltip
v-if="data.tooltip?.title"
position="top"
:text="data.tooltip?.text"
:title="data.tooltip?.title"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@ const groupName = computed(() => {
</script>

<template>
<div class="validator_column">
<div
v-if="validators.length"
class="validator_column"
>
<span
v-if="validators.length && validatorCount <= 3"
v-if="validatorCount <= 3"
class="validators"
>
<template
Expand All @@ -76,7 +79,6 @@ const groupName = computed(() => {
{{ validatorCount }} {{ $t('common.validator', validatorCount) }}
</span>
<FontAwesomeIcon
v-if="validators?.length"
class="link popout"
:icon="faArrowUpRightFromSquare"
@click="openValidatorModal"
Expand Down