Skip to content

Commit

Permalink
fix UI tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
cenfun committed Dec 21, 2023
1 parent 2945912 commit d3554c9
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions packages/v8/src/components/report.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ const updateTopExecutions = (executionCounts) => {
return;
}
data.executionCounts = executionCounts;
const list = [];
Object.keys(executionCounts).forEach((line) => {
const arr = executionCounts[line];
Expand All @@ -62,7 +60,7 @@ const updateTopExecutions = (executionCounts) => {
});
});
if (!list.length) {
if (list.length < 2) {
data.topExecutions = null;
return;
}
Expand Down Expand Up @@ -284,29 +282,41 @@ onMounted(() => {
<div
v-if="(typeof item.pct === 'number')"
:class="'mcr-report-percent mcr-'+item.status"
:tooltip="item.name + ' Coverage'"
>
{{ Util.PF(item.pct, 100) }}
</div>
<VuiFlex
gap="5px"
class="mcr-report-values"
>
<div :class="item.covered?'mcr-covered':''">
<div
:class="item.covered?'mcr-covered':''"
:tooltip="'Covered ' + item.name"
>
{{ Util.NF(item.covered) }}
</div>
<div :class="item.uncovered?'mcr-uncovered':''">
<div
:class="item.uncovered?'mcr-uncovered':''"
:tooltip="'Uncovered ' + item.name"
>
{{ Util.NF(item.uncovered) }}
</div>
<div>{{ Util.NF(item.total) }}</div>
<div :tooltip="'Total ' + item.name">
{{ Util.NF(item.total) }}
</div>
</VuiFlex>
<VuiFlex
v-if="item.id==='lines'"
gap="5px"
class="mcr-report-bc"
>
<div>Blank</div>
<div>{{ item.blank }}</div>
<div>Comment</div>
<div>{{ item.comment }}</div>
<div tooltip="Blank Lines">
Blank {{ item.blank }}
</div>
<div tooltip="Comment Lines">
Comment {{ item.comment }}
</div>
</VuiFlex>
</VuiFlex>
<VuiSwitch
Expand Down Expand Up @@ -364,6 +374,7 @@ onMounted(() => {
width: 100%;
border-bottom: 1px solid #dae9fa;
background-color: #eef6ff;
cursor: default;
a {
word-break: break-all;
Expand All @@ -386,6 +397,11 @@ onMounted(() => {
}
}
.mcr-report-bc {
color: gray;
font-size: 12px;
}
.mcr-report-code {
position: relative;
}
Expand Down

0 comments on commit d3554c9

Please sign in to comment.