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
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
Show 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 @@
...
@@ -13,13 +13,14 @@
this
.
state
=
state1
;
this
.
state
=
state1
;
this
.
hideSidebar
=
bind
(
this
.
hideSidebar
,
this
);
this
.
hideSidebar
=
bind
(
this
.
hideSidebar
,
this
);
this
.
toggleSidebar
=
bind
(
this
.
toggleSidebar
,
this
);
this
.
toggleSidebar
=
bind
(
this
.
toggleSidebar
,
this
);
this
.
updateDropdown
=
bind
(
this
.
updateDropdown
,
this
);
clearInterval
(
Build
.
interval
);
clearInterval
(
Build
.
interval
);
this
.
bp
=
Breakpoints
.
get
();
this
.
bp
=
Breakpoints
.
get
();
this
.
hideSidebar
();
this
.
displayTestStatuses
();
$
(
'
.js-build-sidebar
'
).
niceScroll
();
$
(
'
.js-build-sidebar
'
).
niceScroll
();
this
.
hideSidebar
();
$
(
document
).
off
(
'
click
'
,
'
.js-sidebar-build-toggle
'
).
on
(
'
click
'
,
'
.js-sidebar-build-toggle
'
,
this
.
toggleSidebar
);
$
(
document
).
off
(
'
click
'
,
'
.js-sidebar-build-toggle
'
).
on
(
'
click
'
,
'
.js-sidebar-build-toggle
'
,
this
.
toggleSidebar
);
$
(
window
).
off
(
'
resize.build
'
).
on
(
'
resize.build
'
,
this
.
hideSidebar
);
$
(
window
).
off
(
'
resize.build
'
).
on
(
'
resize.build
'
,
this
.
hideSidebar
);
$
(
document
).
on
(
'
click
'
,
'
.stage-item
'
,
this
.
updateDropdown
);
this
.
updateArtifactRemoveDate
();
this
.
updateArtifactRemoveDate
();
if
(
$
(
'
#build-trace
'
).
length
)
{
if
(
$
(
'
#build-trace
'
).
length
)
{
this
.
getInitialBuildTrace
();
this
.
getInitialBuildTrace
();
...
@@ -133,12 +134,16 @@
...
@@ -133,12 +134,16 @@
}
}
};
};
Build
.
prototype
.
displayTestStatuses
=
function
()
{
Build
.
prototype
.
populateJobDropdown
=
function
(
stage
)
{
$jobs
=
$
(
'
.build-job
'
);
$
(
'
.build-job
'
).
hide
();
jobjects
=
$jobs
.
map
(
function
()
{
$
(
'
.build-job[data-stage="
'
+
stage
+
'
"]
'
).
show
();
return
$
(
this
).
data
();
};
});
console
.
log
(
jobjects
);
Build
.
prototype
.
updateDropdown
=
function
(
e
)
{
e
.
preventDefault
();
var
stage
=
e
.
target
.
text
;
$
(
'
.stage-selection
'
).
text
(
stage
);
this
.
populateJobDropdown
(
stage
);
};
};
return
Build
;
return
Build
;
...
...
app/views/projects/builds/show.html.haml
View file @
f97939a7
...
@@ -6,25 +6,25 @@
...
@@ -6,25 +6,25 @@
=
render
"header"
=
render
"header"
-
builds
=
@build
.
pipeline
.
builds
.
latest
.
to_a
-
builds
=
@build
.
pipeline
.
builds
.
latest
.
to_a
-
statuses
=
[
"failed"
,
"pending"
,
"running"
,
"canceled"
,
"skipped"
,
"success"
]
-
if
builds
.
size
>
1
-
if
builds
.
size
>
1
.dropdown.stage
.dropdown.stage
%button
.dropdown-menu-toggle
{
type:
'button'
,
'data-toggle'
=>
'dropdown'
}
%button
.dropdown-menu-toggle
{
type:
'button'
,
'data-toggle'
=>
'dropdown'
}
%span
.
more-tests
More
%span
.
stage-selection
More
=
icon
(
'caret-down'
)
=
icon
(
'caret-down'
)
%ul
.dropdown-menu.overflow-jobs
%ul
.dropdown-menu.overflow-jobs
-
builds
.
each
do
|
build
|
-
builds
.
map
(
&
:stage
).
uniq
.
each
do
|
stage
|
%li
%li
%a
=
build
.
stage
%a
.stage-item
=
stage
-
statuses
=
[
"failed"
,
"pending"
,
"running"
,
"canceled"
,
"skipped"
,
"success"
]
.dropdown.jobs-dropdown
.dropdown.jobs-dropdown
%button
.dropdown-menu-toggle
{
type:
'button'
,
'data-toggle'
=>
'dropdown'
}
%button
.dropdown-menu-toggle
{
type:
'button'
,
'data-toggle'
=>
'dropdown'
}
%span
.
more-tests
More
%span
.
build-selection
More
=
icon
(
'caret-down'
)
=
icon
(
'caret-down'
)
%ul
.dropdown-menu.overflow-jobs
%ul
.dropdown-menu.overflow-jobs
-
statuses
.
each
do
|
build_status
|
-
statuses
.
each
do
|
build_status
|
-
builds
.
select
{
|
build
|
build
.
status
==
build_status
}.
each
do
|
build
|
-
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
=
link_to
namespace_project_build_path
(
@project
.
namespace
,
@project
,
build
)
do
=
ci_icon_for_status
(
build
.
status
)
=
ci_icon_for_status
(
build
.
status
)
%span
%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