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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
b817ce2d
Commit
b817ce2d
authored
Mar 07, 2017
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sort builds in stage dropdown
Order: failed pending running manual canceled success skipped created
parent
db2617fd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
4 deletions
+29
-4
app/models/concerns/has_status.rb
app/models/concerns/has_status.rb
+1
-1
app/views/projects/pipelines/_stage.html.haml
app/views/projects/pipelines/_stage.html.haml
+5
-3
changelogs/unreleased/sort-builds-in-stage-dropdown.yml
changelogs/unreleased/sort-builds-in-stage-dropdown.yml
+4
-0
spec/views/projects/pipelines/_stage.html.haml_spec.rb
spec/views/projects/pipelines/_stage.html.haml_spec.rb
+19
-0
No files found.
app/models/concerns/has_status.rb
View file @
b817ce2d
...
@@ -7,7 +7,7 @@ module HasStatus
...
@@ -7,7 +7,7 @@ module HasStatus
STARTED_STATUSES
=
%w[running success failed skipped manual]
.
freeze
STARTED_STATUSES
=
%w[running success failed skipped manual]
.
freeze
ACTIVE_STATUSES
=
%w[pending running]
.
freeze
ACTIVE_STATUSES
=
%w[pending running]
.
freeze
COMPLETED_STATUSES
=
%w[success failed canceled skipped]
.
freeze
COMPLETED_STATUSES
=
%w[success failed canceled skipped]
.
freeze
ORDERED_STATUSES
=
%w[
manual failed pending running canceled success skipp
ed]
.
freeze
ORDERED_STATUSES
=
%w[
failed pending running manual canceled success skipped creat
ed]
.
freeze
class_methods
do
class_methods
do
def
status_sql
def
status_sql
...
...
app/views/projects/pipelines/_stage.html.haml
View file @
b817ce2d
-
@stage
.
statuses
.
latest
.
each
do
|
status
|
-
grouped_statuses
=
@stage
.
statuses
.
latest_ordered
.
group_by
(
&
:status
)
%li
-
HasStatus
::
ORDERED_STATUSES
.
each
do
|
ordered_status
|
=
render
'ci/status/dropdown_graph_badge'
,
subject:
status
-
grouped_statuses
.
fetch
(
ordered_status
,
[]).
each
do
|
status
|
%li
=
render
'ci/status/dropdown_graph_badge'
,
subject:
status
changelogs/unreleased/sort-builds-in-stage-dropdown.yml
0 → 100644
View file @
b817ce2d
---
title
:
Sort builds in stage dropdown
merge_request
:
author
:
spec/views/projects/pipelines/_stage.html.haml_spec.rb
View file @
b817ce2d
...
@@ -50,4 +50,23 @@ describe 'projects/pipelines/_stage', :view do
...
@@ -50,4 +50,23 @@ describe 'projects/pipelines/_stage', :view do
expect
(
rendered
).
to
have_text
'test:build'
,
count:
1
expect
(
rendered
).
to
have_text
'test:build'
,
count:
1
end
end
end
end
context
'when there are multiple builds'
do
before
do
HasStatus
::
AVAILABLE_STATUSES
.
each
do
|
status
|
create_build
(
status
)
end
end
it
'shows them in order'
do
render
expect
(
rendered
).
to
have_text
(
HasStatus
::
ORDERED_STATUSES
.
join
(
" "
))
end
def
create_build
(
status
)
create
(
:ci_build
,
name:
status
,
status:
status
,
pipeline:
pipeline
,
stage:
stage
.
name
)
end
end
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