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
d15cce39
Commit
d15cce39
authored
Feb 05, 2020
by
Maxime Orefice
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Load pipeline test tab badge counter asynchronously
parent
1f5b41c4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletion
+21
-1
app/assets/javascripts/pipelines/pipeline_details_bundle.js
app/assets/javascripts/pipelines/pipeline_details_bundle.js
+8
-0
app/views/projects/pipelines/_with_tabs.html.haml
app/views/projects/pipelines/_with_tabs.html.haml
+1
-1
spec/features/projects/pipelines/pipeline_spec.rb
spec/features/projects/pipelines/pipeline_spec.rb
+12
-0
No files found.
app/assets/javascripts/pipelines/pipeline_details_bundle.js
View file @
d15cce39
...
...
@@ -10,6 +10,7 @@ import pipelineHeader from './components/header_component.vue';
import
eventHub
from
'
./event_hub
'
;
import
TestReports
from
'
./components/test_reports/test_reports.vue
'
;
import
testReportsStore
from
'
./stores/test_reports
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
Vue
.
use
(
Translate
);
...
...
@@ -111,5 +112,12 @@ export default () => {
return
createElement
(
'
test-reports
'
);
},
});
axios
.
get
(
dataset
.
testReportEndpoint
)
.
then
(({
data
})
=>
{
document
.
querySelector
(
'
.js-test-report-badge-counter
'
).
innerHTML
=
data
.
total_count
;
})
.
catch
(()
=>
{});
}
};
app/views/projects/pipelines/_with_tabs.html.haml
View file @
d15cce39
...
...
@@ -18,7 +18,7 @@
%li
.js-tests-tab-link
=
link_to
test_report_project_pipeline_path
(
@project
,
@pipeline
),
data:
{
target:
'#js-tab-tests'
,
action:
'test_report'
,
toggle:
'tab'
},
class:
'test-tab'
do
=
s_
(
'TestReports|Tests'
)
%span
.badge.badge-pill
=
pipeline
.
test_reports
.
total_count
%span
.badge.badge-pill
.js-test-report-badge-counter
=
render_if_exists
"projects/pipelines/tabs_holder"
,
pipeline:
@pipeline
,
project:
@project
.tab-content
...
...
spec/features/projects/pipelines/pipeline_spec.rb
View file @
d15cce39
...
...
@@ -356,6 +356,18 @@ describe 'Pipeline', :js do
end
end
context
'test tabs'
do
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
:with_test_reports
,
project:
project
)
}
it
'shows badge counter in Tests tab'
do
visit_pipeline
wait_for_requests
expect
(
pipeline
.
test_reports
.
total_count
).
to
eq
(
4
)
expect
(
page
.
find
(
'.js-test-report-badge-counter'
).
text
).
to
eq
(
pipeline
.
test_reports
.
total_count
.
to_s
)
end
end
context
'retrying jobs'
do
before
do
visit_pipeline
...
...
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