Skip to content

Commit

Permalink
(BIDS-2829) dashboard validator rewards table (#165)
Browse files Browse the repository at this point in the history
* dashboard rewards table

---------

Co-authored-by: D13ce <[email protected]>
  • Loading branch information
MauserBitfly and D13ce authored Apr 15, 2024
1 parent 7230a7a commit 28fc22a
Show file tree
Hide file tree
Showing 21 changed files with 996 additions and 95 deletions.
53 changes: 41 additions & 12 deletions frontend/assets/css/utils.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,43 @@
text-overflow: ellipsis;
}

.truncate-text{
.truncate-text {
@include truncate-text;
}

.pointer {
.text-align-left {
text-align: left;
}

.pointer {
cursor: pointer;
}

.dots-before {
&:before{
content: '\2026'
&:before {
content: "\2026";
}
}

.dots-after {
&:after{
content: '\2026'
&:after {
content: "\2026";
}
}

.no-wrap{
.no-wrap {
white-space: nowrap;
}

.positive {
.text-disabled{
color: var(--text-color-disabled);
}

.positive {
color: var(--positive-color);
}

.negative{
.negative {
color: var(--negative-color);
}

Expand All @@ -44,8 +52,29 @@
color: var(--purple);
}

.comma{
&:before{
content: ',';
.comma {
&:before {
content: ",";
}
}

.slash-after {
&:after {
content: " / ";
}
}

.round-brackets {
&:before {
content: "(";
}
&:after {
content: ")";
}
}

@mixin set-all-width($width) {
width: $width;
max-width: $width;
min-width: $width;
}
9 changes: 8 additions & 1 deletion frontend/components/bc/BcTooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ interface Props {
hide?: boolean,
tooltipClass?: string,
fitContent?: boolean,
renderTextAsHtml?: boolean,
scrollContainer?: string // query selector for scrollable parent container
}
Expand Down Expand Up @@ -167,7 +168,13 @@ onUnmounted(() => {
<b v-if="props.title">
{{ props.title }}
</b>
{{ text }}
<template v-if="renderTextAsHtml && text">
<!-- eslint-disable-next-line vue/no-v-html -->
<span v-html="text" />
</template>
<template v-else>
{{ text }}
</template>
</span>
</slot>
</div>
Expand Down
6 changes: 4 additions & 2 deletions frontend/components/bc/table/BcTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ interface Props {
pageSize?: number,
data?: ApiPagingResponse<any>,
expandable?: boolean,
isRowExpandable?: (item: any) => boolean,
selectionMode?: 'multiple' | 'single'
tableClass?: string
addSpacer?: boolean
Expand All @@ -19,7 +20,7 @@ const emit = defineEmits<{(e: 'setCursor', value: Cursor): void, (e: 'setPageSiz
const expandedRows = ref<Record<any, boolean>>({})
const allExpanded = computed(() => {
if (!props.expandable || !props.dataKey) {
if (!props.expandable || !props.dataKey || !props.data?.data?.length) {
return false
}
return !!props.data?.data?.every((item) => {
Expand All @@ -35,7 +36,7 @@ const toggleAll = (forceClose = false) => {
props.data?.data?.forEach((item) => {
if (wasExpanded || forceClose) {
delete expandedRows.value[item[props.dataKey!]]
} else {
} else if (!props.isRowExpandable || props.isRowExpandable(item)) {
expandedRows.value[item[props.dataKey!]] = true
}
})
Expand Down Expand Up @@ -91,6 +92,7 @@ watch(() => props.expandable, (expandable) => {

<template #body="slotProps">
<IconChevron
v-if="!isRowExpandable || isRowExpandable(slotProps.data)"
class="toggle"
:direction="dataKey && expandedRows[slotProps.data[dataKey]] ? 'bottom' : 'right'"
@click.stop.prevent="toggleItem(slotProps.data)"
Expand Down
Loading

0 comments on commit 28fc22a

Please sign in to comment.