Commit bf87128d authored by mfluharty's avatar mfluharty

Add project count and coverage count to tooltip

In group repositories analytics,
add "Projects with coverage" and "Jobs with coverage" counts
to average test coverage history graph hover tooltip

Changelog: changed
EE: true
parent 5a045d0a
...@@ -55,7 +55,12 @@ export default { ...@@ -55,7 +55,12 @@ export default {
this.groupCoverageChartData = [ this.groupCoverageChartData = [
{ {
name: this.$options.i18n.graphName, name: this.$options.i18n.graphName,
data: groupCoverage.map((coverage) => [coverage.date, coverage.averageCoverage]), data: groupCoverage.map((coverage) => [
coverage.date,
coverage.averageCoverage,
coverage.projectCount,
coverage.coverageCount,
]),
}, },
]; ];
}, },
...@@ -137,8 +142,12 @@ export default { ...@@ -137,8 +142,12 @@ export default {
}, },
methods: { methods: {
formatTooltipText(params) { formatTooltipText(params) {
const [, averageCoverage, projectCount, coverageCount] = params.seriesData?.[0]?.data;
this.tooltipTitle = formatDate(params.value, 'mmm dd'); this.tooltipTitle = formatDate(params.value, 'mmm dd');
this.coveragePercentage = formatPercent(params.seriesData?.[0]?.data?.[1], 2); this.tooltipAverageCoverage = formatPercent(averageCoverage, 2);
this.tooltipProjectCount = projectCount;
this.tooltipCoverageCount = coverageCount;
}, },
}, },
i18n: { i18n: {
...@@ -147,7 +156,11 @@ export default { ...@@ -147,7 +156,11 @@ export default {
yAxisName: __('Coverage'), yAxisName: __('Coverage'),
xAxisName: __('Date'), xAxisName: __('Date'),
graphName: s__('RepositoriesAnalytics|Average coverage'), graphName: s__('RepositoriesAnalytics|Average coverage'),
graphTooltipMessage: __('Code Coverage: %{coveragePercentage}'), graphTooltip: {
averageCoverage: s__('RepositoriesAnalytics|Code Coverage: %{averageCoverage}'),
projectCount: s__('RepositoriesAnalytics|Projects with Coverage: %{projectCount}'),
coverageCount: s__('RepositoriesAnalytics|Jobs with Coverage: %{coverageCount}'),
},
metrics: { metrics: {
projectCountLabel: s__('RepositoriesAnalytics|Projects with Coverage'), projectCountLabel: s__('RepositoriesAnalytics|Projects with Coverage'),
averageCoverageLabel: s__('RepositoriesAnalytics|Average Coverage by Job'), averageCoverageLabel: s__('RepositoriesAnalytics|Average Coverage by Job'),
...@@ -207,10 +220,16 @@ export default { ...@@ -207,10 +220,16 @@ export default {
{{ tooltipTitle }} {{ tooltipTitle }}
</template> </template>
<template #tooltip-content> <template #tooltip-content>
<gl-sprintf :message="$options.i18n.graphTooltipMessage"> <gl-sprintf :message="$options.i18n.graphTooltip.averageCoverage">
<template #coveragePercentage> <template #averageCoverage> {{ tooltipAverageCoverage }}</template>
{{ coveragePercentage }} </gl-sprintf>
</template> <br />
<gl-sprintf :message="$options.i18n.graphTooltip.projectCount">
<template #projectCount> {{ tooltipProjectCount }} </template>
</gl-sprintf>
<br />
<gl-sprintf :message="$options.i18n.graphTooltip.coverageCount">
<template #coverageCount> {{ tooltipCoverageCount }} </template>
</gl-sprintf> </gl-sprintf>
</template> </template>
</gl-area-chart> </gl-area-chart>
......
...@@ -8198,9 +8198,6 @@ msgstr "" ...@@ -8198,9 +8198,6 @@ msgstr ""
msgid "Code" msgid "Code"
msgstr "" msgstr ""
msgid "Code Coverage: %{coveragePercentage}"
msgstr ""
msgid "Code Coverage: %{coveragePercentage}%{percentSymbol}" msgid "Code Coverage: %{coveragePercentage}%{percentSymbol}"
msgstr "" msgstr ""
...@@ -28912,6 +28909,9 @@ msgstr "" ...@@ -28912,6 +28909,9 @@ msgstr ""
msgid "RepositoriesAnalytics|Average test coverage last 30 days" msgid "RepositoriesAnalytics|Average test coverage last 30 days"
msgstr "" msgstr ""
msgid "RepositoriesAnalytics|Code Coverage: %{averageCoverage}"
msgstr ""
msgid "RepositoriesAnalytics|Coverage" msgid "RepositoriesAnalytics|Coverage"
msgstr "" msgstr ""
...@@ -28933,6 +28933,9 @@ msgstr "" ...@@ -28933,6 +28933,9 @@ msgstr ""
msgid "RepositoriesAnalytics|Jobs with Coverage" msgid "RepositoriesAnalytics|Jobs with Coverage"
msgstr "" msgstr ""
msgid "RepositoriesAnalytics|Jobs with Coverage: %{coverageCount}"
msgstr ""
msgid "RepositoriesAnalytics|Last Update" msgid "RepositoriesAnalytics|Last Update"
msgstr "" msgstr ""
...@@ -28951,6 +28954,9 @@ msgstr "" ...@@ -28951,6 +28954,9 @@ msgstr ""
msgid "RepositoriesAnalytics|Projects with Coverage" msgid "RepositoriesAnalytics|Projects with Coverage"
msgstr "" msgstr ""
msgid "RepositoriesAnalytics|Projects with Coverage: %{projectCount}"
msgstr ""
msgid "RepositoriesAnalytics|Test Code Coverage" msgid "RepositoriesAnalytics|Test Code Coverage"
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment