Skip to content

Commit 3adcfef

Browse files
authored
Merge pull request #4616 from noraz31/highlight_outstanding
[feat] Highlight non-compliant rules in the Guideline statistics
2 parents fff3d9e + 89c3076 commit 3adcfef

3 files changed

Lines changed: 30 additions & 2 deletions

File tree

web/server/vue-cli/src/components/Statistics/Guideline/GuidelineStatistics.vue

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,16 @@
6969
</template>
7070
</v-select>
7171
</v-col>
72+
<v-col cols="6">
73+
<v-checkbox
74+
v-model="hideNotOutstanding"
75+
label="Hide compliant rules"
76+
density="comfortable"
77+
/>
78+
</v-col>
7279
</v-row>
7380
<guideline-statistics-table
74-
:items="statistics"
81+
:items="filteredStatistics"
7582
:loading="loading"
7683
@enabled-click="showingRuns"
7784
/>
@@ -209,6 +216,7 @@ export default {
209216
},
210217
statistics: [],
211218
type: null,
219+
hideNotOutstanding: false,
212220
};
213221
},
214222

@@ -223,6 +231,15 @@ export default {
223231
return this.selectedGuidelineIndexes.map(idx => new Guideline({
224232
guidelineName: this.guidelineOptions[idx].id
225233
}));
234+
},
235+
236+
filteredStatistics() {
237+
if (this.hideNotOutstanding) {
238+
return this.statistics.filter(stat =>
239+
stat.checkers.some(checker => checker.outstanding > 0)
240+
);
241+
}
242+
return this.statistics;
226243
}
227244
},
228245

web/server/vue-cli/src/components/Statistics/Guideline/GuidelineStatisticsTable.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
:items="items"
55
:loading="loading"
66
:mobile-breakpoint="1000"
7+
:item-class="getRowClass"
78
loading-text="Loading guideline statistics..."
89
no-data-text="No guideline statistics available"
910
item-key="guidelineRule"
@@ -89,12 +90,18 @@ export default {
8990
methods: {
9091
enabledClick(type, checker_name) {
9192
this.$emit("enabled-click", type, checker_name);
93+
},
94+
95+
getRowClass(item) {
96+
const hasOutstanding = item.checkers.some(
97+
checker => checker.outstanding > 0);
98+
return hasOutstanding ? "highlight-row" : "";
9299
}
93100
}
94101
};
95102
</script>
96103

97-
<style lang="scss" scoped>
104+
<style lang="scss">
98105
$class-name: ".checker-statistics > ::v-deep .v-data-table__wrapper";
99106
@import "@/components/Statistics/style.scss";
100107
</style>

web/server/vue-cli/src/components/Statistics/style.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,7 @@ $tr: 'tr:not(.v-data-table__expanded__content)';
8181
border-bottom: thin solid rgba(0, 0, 0, 0.12);
8282
}
8383
}
84+
85+
.highlight-row {
86+
background-color: $outstanding-bg-color !important;
87+
}

0 commit comments

Comments
 (0)