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
3ef1e766
Commit
3ef1e766
authored
Dec 20, 2016
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broken test
Changes after review
parent
4b9bd188
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
16 deletions
+22
-16
app/assets/javascripts/mini_pipeline_graph_dropdown.js.es6
app/assets/javascripts/mini_pipeline_graph_dropdown.js.es6
+13
-8
app/views/projects/ci/pipelines/_pipeline.html.haml
app/views/projects/ci/pipelines/_pipeline.html.haml
+4
-6
spec/features/projects/pipelines/pipelines_spec.rb
spec/features/projects/pipelines/pipelines_spec.rb
+4
-1
spec/models/ci/stage_spec.rb
spec/models/ci/stage_spec.rb
+1
-1
No files found.
app/assets/javascripts/mini_pipeline_graph_dropdown.js.es6
View file @
3ef1e766
/* eslint-disable no-new */
/* global Flash */
/**
...
...
@@ -30,8 +31,8 @@
bindEvents() {
const dropdownButtonSelector = 'button.js-builds-dropdown-button';
$(this.container).off('click', dropdownButtonSelector, this.getBuildsList)
;
$(this.container)
.on('click', dropdownButtonSelector, this.getBuildsList);
$(this.container).off('click', dropdownButtonSelector, this.getBuildsList)
.on('click', dropdownButtonSelector, this.getBuildsList);
}
/**
...
...
@@ -55,21 +56,25 @@
* @return {Promise}
*/
getBuildsList(e) {
const endpoint = e.currentTarget.dataset.stageEndpoint;
const button = e.currentTarget;
const endpoint = button.dataset.stageEndpoint;
return $.ajax({
dataType: 'json',
type: 'GET',
url: endpoint,
beforeSend: () => {
this.renderBuildsList(
e.currentTarget
, '');
this.toggleLoading(
e.currentTarget
);
this.renderBuildsList(
button
, '');
this.toggleLoading(
button
);
},
success: (data) => {
this.toggleLoading(e.currentTarget);
this.renderBuildsList(e.currentTarget, data.html);
this.toggleLoading(button);
this.renderBuildsList(button, data.html);
},
error: () => {
this.toggleLoading(button);
new Flash('An error occurred while fetching the builds.', 'alert');
},
error: () => new Flash('An error occurred while fetching the builds.', 'alert'),
});
}
...
...
app/views/projects/ci/pipelines/_pipeline.html.haml
View file @
3ef1e766
...
...
@@ -44,17 +44,15 @@
-
pipeline
.
stages
.
each
do
|
stage
|
-
if
stage
.
status
-
detailed_status
=
stage
.
detailed_status
(
current_user
)
-
klass
=
"has-tooltip ci-status-icon ci-status-icon-
#{
detailed_status
.
group
}
"
-
icon_status
=
"
#{
detailed_status
.
icon
}
_borderless"
-
icon_status_klass
=
"ci-status-icon ci-status-icon-
#{
detailed_status
.
group
}
"
-
tooltip
=
"
#{
stage
.
name
}
:
#{
detailed_status
.
label
||
'not found'
}
"
-
status_klass
=
"ci-status-icon ci-status-icon-
#{
detailed_status
.
group
}
"
.stage-container.mini-pipeline-graph
.dropdown.inline.build-content
%button
.has-tooltip.builds-dropdown.js-builds-dropdown-button
{
type:
'button'
,
data:
{
toggle:
'dropdown'
,
title:
tooltip
,
placement:
'top'
,
"stage-endpoint"
=>
stage_namespace_project_pipeline_path
(
pipeline
.
project
.
namespace
,
pipeline
.
project
,
pipeline
,
stage:
stage
.
name
)}}
%span
{
class:
klass
}
%button
.has-tooltip.builds-dropdown.js-builds-dropdown-button
{
type:
'button'
,
data:
{
toggle:
'dropdown'
,
title:
"#{stage.name}: #{detailed_status.label}"
,
placement:
'top'
,
"stage-endpoint"
=>
stage_namespace_project_pipeline_path
(
pipeline
.
project
.
namespace
,
pipeline
.
project
,
pipeline
,
stage:
stage
.
name
)}}
%span
.has-tooltip
{
class:
status_
klass
}
%span
.mini-pipeline-graph-icon-container
%span
{
class:
icon_
status_klass
}=
custom_icon
(
icon_status
)
%span
{
class:
status_klass
}=
custom_icon
(
icon_status
)
=
icon
(
'caret-down'
,
class:
'dropdown-caret'
)
.js-builds-dropdown-container
...
...
spec/features/projects/pipelines/pipelines_spec.rb
View file @
3ef1e766
...
...
@@ -74,7 +74,10 @@ describe "Pipelines", feature: true, js:true do
before
{
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
}
it
{
expect
(
page
).
to
have_link
(
'Manual build'
)
}
it
do
find
(
'.js-pipeline-dropdown-manual-actions'
).
click
expect
(
page
).
to
have_link
(
'Manual build'
)
end
context
'when playing'
do
...
...
spec/models/ci/stage_spec.rb
View file @
3ef1e766
...
...
@@ -36,7 +36,7 @@ describe Ci::Stage, models: true do
subject
{
stage
.
statuses_count
}
it
"statuses only from current stage"
do
it
"
counts
statuses only from current stage"
do
is_expected
.
to
eq
(
1
)
end
end
...
...
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