Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d16e1a49
Commit
d16e1a49
authored
Nov 02, 2020
by
mfluharty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wire up the GraphQL query
i18n-ify strings
parent
444486ef
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
9 deletions
+91
-9
ee/app/assets/javascripts/analytics/repository_analytics/components/test_coverage_summary.vue
...repository_analytics/components/test_coverage_summary.vue
+67
-9
ee/app/assets/javascripts/analytics/repository_analytics/graphql/queries/get_group_test_coverage.query.graphql
...ics/graphql/queries/get_group_test_coverage.query.graphql
+12
-0
locale/gitlab.pot
locale/gitlab.pot
+12
-0
No files found.
ee/app/assets/javascripts/analytics/repository_analytics/components/test_coverage_summary.vue
View file @
d16e1a49
<
script
>
import
{
s__
}
from
'
~/locale
'
;
import
MetricCard
from
'
~/analytics/shared/components/metric_card.vue
'
;
import
getGroupTestCoverage
from
'
../graphql/queries/get_group_test_coverage.query.graphql
'
;
export
default
{
name
:
'
TestCoverageSummary
'
,
components
:
{
MetricCard
,
},
inject
:
{
groupFullPath
:
{
default
:
''
,
},
},
apollo
:
{
group
:
{
query
:
getGroupTestCoverage
,
variables
()
{
return
{
groupFullPath
:
this
.
groupFullPath
,
startDate
:
new
Date
(
Date
.
now
()
-
604800000
),
// one week ago
};
},
result
(
res
)
{
const
{
projectCount
,
averageCoverage
,
coverageCount
}
=
res
.
data
?.
group
?.
codeCoverageActivities
?.
nodes
?.[
0
]
||
{};
this
.
projectCount
=
projectCount
;
this
.
averageCoverage
=
averageCoverage
;
this
.
coverageCount
=
coverageCount
;
},
error
()
{
this
.
hasError
=
true
;
this
.
projectCount
=
null
;
this
.
averageCoverage
=
null
;
this
.
coverageCount
=
null
;
},
watchLoading
(
isLoading
)
{
this
.
isLoading
=
isLoading
;
},
},
},
data
()
{
return
{
projectCount
:
null
,
averageCoverage
:
null
,
coverageCount
:
null
,
hasError
:
false
,
isLoading
:
false
,
};
},
computed
:
{
metrics
()
{
return
[
{
key
:
'
projectCount
'
,
value
:
this
.
projectCount
,
label
:
s__
(
'
RepositoriesAnalytics|Projects with Tests
'
),
},
{
key
:
'
averageCoverage
'
,
value
:
this
.
averageCoverage
,
unit
:
'
%
'
,
label
:
s__
(
'
RepositoriesAnalytics|Average Coverage by Job
'
),
},
{
key
:
'
coverageCount
'
,
value
:
this
.
coverageCount
,
label
:
s__
(
'
RepositoriesAnalytics|Total Number of Coverages
'
),
},
];
},
},
};
</
script
>
<
template
>
<metric-card
:title=
"__('Overall Activity')"
:metrics=
"[
{ key: 1, value: 45, unit: '', label: 'Projects with Tests' },
{ key: 2, value: 72, unit: '%', label: 'Average Coverage by Job' },
{ key: 3, value: 103, unit: '', label: 'Total Number of Coverages' },
]"
:is-loading="false"
/>
<metric-card
:title=
"__('Overall Activity')"
:metrics=
"metrics"
:is-loading=
"isLoading"
/>
</
template
>
ee/app/assets/javascripts/analytics/repository_analytics/graphql/queries/get_group_test_coverage.query.graphql
0 → 100644
View file @
d16e1a49
query
getGroupTestCoverage
(
$groupFullPath
:
ID
!,
$startDate
:
Date
!,
$last
:
Int
=
1
)
{
group
(
fullPath
:
$groupFullPath
)
{
codeCoverageActivities
(
startDate
:
$startDate
,
last
:
$last
)
{
nodes
{
projectCount
averageCoverage
coverageCount
date
}
}
}
}
locale/gitlab.pot
View file @
d16e1a49
...
...
@@ -19082,6 +19082,9 @@ msgstr ""
msgid "Outdent"
msgstr ""
msgid "Overall Activity"
msgstr ""
msgid "Overridden"
msgstr ""
...
...
@@ -22730,6 +22733,9 @@ msgstr ""
msgid "Repositories Analytics"
msgstr ""
msgid "RepositoriesAnalytics|Average Coverage by Job"
msgstr ""
msgid "RepositoriesAnalytics|Coverage"
msgstr ""
...
...
@@ -22760,12 +22766,18 @@ msgstr ""
msgid "RepositoriesAnalytics|Please select projects to display."
msgstr ""
msgid "RepositoriesAnalytics|Projects with Tests"
msgstr ""
msgid "RepositoriesAnalytics|Test Code Coverage"
msgstr ""
msgid "RepositoriesAnalytics|There was an error fetching the projects."
msgstr ""
msgid "RepositoriesAnalytics|Total Number of Coverages"
msgstr ""
msgid "Repository"
msgstr ""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment