Skip to content

Commit a2e757a

Browse files
committed
Added additional info to tooltip hover
Signed-off-by: Sekwah <[email protected]>
1 parent b310d62 commit a2e757a

File tree

3 files changed

+24
-18
lines changed

3 files changed

+24
-18
lines changed

src/i18n/locales/en.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,10 @@
445445
"policy_violation": {
446446
"fails": "Violation Failures",
447447
"warns": "Violation Warnings",
448-
"infos": "Informational Violations"
448+
"infos": "Informational Violations",
449+
"license": "License Violations",
450+
"operational": "Operational Violations",
451+
"security": "Security Violations"
449452
},
450453
"severity": {
451454
"critical": "Critical",

src/views/components/PolicyViolationProgressBar.vue

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,32 @@
11
<template>
2-
<span v-if="total === 0" class="progress">
2+
<span v-if="metrics.policyViolationsTotal === 0" class="progress">
33
<b-progress class="table-progress" :max="'0'" show-value>
44
<b-progress-bar class="table-progress" value="0"></b-progress-bar>
55
</b-progress>
66
</span>
77
<span v-else class="progress">
88
<span :id="'progressbar' + hoverId" class="table-progress">
9-
<b-progress class="table-progress" :max="total" show-value>
10-
<b-progress-bar :value="info" class="severity-info-bg"></b-progress-bar>
11-
<b-progress-bar :value="warn" class="severity-warn-bg"></b-progress-bar>
12-
<b-progress-bar :value="fail" class="severity-fail-bg"></b-progress-bar>
9+
<b-progress class="table-progress" :max="metrics.policyViolationsTotal" show-value>
10+
<b-progress-bar :value="metrics.policyViolationsInfo" class="severity-info-bg"></b-progress-bar>
11+
<b-progress-bar :value="metrics.policyViolationsWarn" class="severity-warn-bg"></b-progress-bar>
12+
<b-progress-bar :value="metrics.policyViolationsFail" class="severity-fail-bg"></b-progress-bar>
1313
</b-progress>
1414
</span>
1515
<b-tooltip :target="'progressbar' + hoverId" placement="left" noninteractive>
1616
<div style="text-align: left;">
17-
{{$t('policy_violation.infos')}}: {{ info }}<br>
18-
{{$t('policy_violation.warns')}}: {{ warn }}<br>
19-
{{$t('policy_violation.fails')}}: {{ fail }}<br>
20-
{{$t('message.total')}}: {{ total }}<br>
17+
<h5>{{$t('message.type')}}</h5>
18+
<p>
19+
{{$t('policy_violation.license')}}: {{ metrics.policyViolationsLicenseTotal }}<br>
20+
{{$t('policy_violation.operational')}}: {{ metrics.policyViolationsOperationalTotal }}<br>
21+
{{$t('policy_violation.security')}}: {{ metrics.policyViolationsSecurityTotal }}<br>
22+
</p>
23+
<h5>{{ $t('message.violation_state') }}</h5>
24+
<p>
25+
{{$t('policy_violation.infos')}}: {{ metrics.policyViolationsInfo }}<br>
26+
{{$t('policy_violation.warns')}}: {{ metrics.policyViolationsWarn }}<br>
27+
{{$t('policy_violation.fails')}}: {{ metrics.policyViolationsFail }}<br>
28+
</p>
29+
{{$t('message.total')}}: {{ metrics.policyViolationsTotal }}
2130
</div>
2231
</b-tooltip>
2332
</span>
@@ -26,10 +35,7 @@
2635
<script>
2736
export default {
2837
props: {
29-
total: Number,
30-
info: Number,
31-
warn: Number,
32-
fail: Number,
38+
metrics: Object,
3339
$t: Function,
3440
},
3541
data() {

src/views/portfolio/projects/ProjectList.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,7 @@
128128
let ComponentClass = Vue.extend(PolicyViolationProgressBar);
129129
let progressBar = new ComponentClass({
130130
propsData: {
131-
total: metrics.policyViolationsTotal,
132-
warn: metrics.policyViolationsWarn,
133-
fail: metrics.policyViolationsFail,
134-
info: metrics.policyViolationsInfo,
131+
metrics,
135132
$t: this.$t.bind(this),
136133
}
137134
});

0 commit comments

Comments
 (0)