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
f97939a7
Commit
f97939a7
authored
Aug 03, 2016
by
Annabel Dunstone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Selecting stage updates builds dropdown
parent
5bfca3b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
14 deletions
+19
-14
app/assets/javascripts/build.js
app/assets/javascripts/build.js
+13
-8
app/views/projects/builds/show.html.haml
app/views/projects/builds/show.html.haml
+6
-6
No files found.
app/assets/javascripts/build.js
View file @
f97939a7
...
...
@@ -13,13 +13,14 @@
this
.
state
=
state1
;
this
.
hideSidebar
=
bind
(
this
.
hideSidebar
,
this
);
this
.
toggleSidebar
=
bind
(
this
.
toggleSidebar
,
this
);
this
.
updateDropdown
=
bind
(
this
.
updateDropdown
,
this
);
clearInterval
(
Build
.
interval
);
this
.
bp
=
Breakpoints
.
get
();
this
.
hideSidebar
();
this
.
displayTestStatuses
();
$
(
'
.js-build-sidebar
'
).
niceScroll
();
this
.
hideSidebar
();
$
(
document
).
off
(
'
click
'
,
'
.js-sidebar-build-toggle
'
).
on
(
'
click
'
,
'
.js-sidebar-build-toggle
'
,
this
.
toggleSidebar
);
$
(
window
).
off
(
'
resize.build
'
).
on
(
'
resize.build
'
,
this
.
hideSidebar
);
$
(
document
).
on
(
'
click
'
,
'
.stage-item
'
,
this
.
updateDropdown
);
this
.
updateArtifactRemoveDate
();
if
(
$
(
'
#build-trace
'
).
length
)
{
this
.
getInitialBuildTrace
();
...
...
@@ -133,12 +134,16 @@
}
};
Build
.
prototype
.
displayTestStatuses
=
function
()
{
$jobs
=
$
(
'
.build-job
'
);
jobjects
=
$jobs
.
map
(
function
()
{
return
$
(
this
).
data
();
});
console
.
log
(
jobjects
);
Build
.
prototype
.
populateJobDropdown
=
function
(
stage
)
{
$
(
'
.build-job
'
).
hide
();
$
(
'
.build-job[data-stage="
'
+
stage
+
'
"]
'
).
show
();
};
Build
.
prototype
.
updateDropdown
=
function
(
e
)
{
e
.
preventDefault
();
var
stage
=
e
.
target
.
text
;
$
(
'
.stage-selection
'
).
text
(
stage
);
this
.
populateJobDropdown
(
stage
);
};
return
Build
;
...
...
app/views/projects/builds/show.html.haml
View file @
f97939a7
...
...
@@ -6,25 +6,25 @@
=
render
"header"
-
builds
=
@build
.
pipeline
.
builds
.
latest
.
to_a
-
statuses
=
[
"failed"
,
"pending"
,
"running"
,
"canceled"
,
"skipped"
,
"success"
]
-
if
builds
.
size
>
1
.dropdown.stage
%button
.dropdown-menu-toggle
{
type:
'button'
,
'data-toggle'
=>
'dropdown'
}
%span
.
more-tests
More
%span
.
stage-selection
More
=
icon
(
'caret-down'
)
%ul
.dropdown-menu.overflow-jobs
-
builds
.
each
do
|
build
|
-
builds
.
map
(
&
:stage
).
uniq
.
each
do
|
stage
|
%li
%a
=
build
.
stage
%a
.stage-item
=
stage
-
statuses
=
[
"failed"
,
"pending"
,
"running"
,
"canceled"
,
"skipped"
,
"success"
]
.dropdown.jobs-dropdown
%button
.dropdown-menu-toggle
{
type:
'button'
,
'data-toggle'
=>
'dropdown'
}
%span
.
more-tests
More
%span
.
build-selection
More
=
icon
(
'caret-down'
)
%ul
.dropdown-menu.overflow-jobs
-
statuses
.
each
do
|
build_status
|
-
builds
.
select
{
|
build
|
build
.
status
==
build_status
}.
each
do
|
build
|
%li
.build-job
{
class:
(
'active'
if
build
==
@build
),
data:
{
id:
build
.
id
,
name:
build
.
name
,
sta
tus:
build
.
status
}}
%li
.build-job
{
class:
(
'active'
if
build
==
@build
),
data:
{
id:
build
.
id
,
name:
build
.
name
,
sta
ge:
build
.
stage
}}
=
link_to
namespace_project_build_path
(
@project
.
namespace
,
@project
,
build
)
do
=
ci_icon_for_status
(
build
.
status
)
%span
...
...
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