Commit 283c1dc3 authored by Annabel Dunstone's avatar Annabel Dunstone

Add overflow tests to dropdown

parent 8e4ec561
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
$(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);
this.updateArtifactRemoveDate(); this.updateArtifactRemoveDate();
this.displayTestStatuses();
if ($('#build-trace').length) { if ($('#build-trace').length) {
this.getInitialBuildTrace(); this.getInitialBuildTrace();
this.initScrollButtonAffix(); this.initScrollButtonAffix();
...@@ -132,6 +133,16 @@ ...@@ -132,6 +133,16 @@
} }
}; };
Build.prototype.displayTestStatuses = function() {
$jobTopPosition = $('.build-job').first().offset().top;
$('.build-job').each(function() {
if ($(this).offset().top > $jobTopPosition) {
$('.overflow-jobs > li').append($(this));
}
})
};
return Build; return Build;
})(); })();
......
...@@ -12,23 +12,19 @@ ...@@ -12,23 +12,19 @@
- 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{class: ('active' if build == @build) } %li{class: ('active' if build == @build) }
= link_to namespace_project_build_path(@project.namespace, @project, build) do = link_to namespace_project_build_path(@project.namespace, @project, build), class: 'build-job' do
= ci_icon_for_status(build.status) = ci_icon_for_status(build.status)
%span %span
- if build.name - if build.name
= build.name = build.name
- else - else
= build.id = build.id
.dropdown
- builds.select{|build| build.status == "success"}.each do |build| %button.dropdown-menu-toggle{type: 'button', 'data-toggle' => 'dropdown'}
%li{class: ('active' if build == @build) } %span Test Name
= link_to namespace_project_build_path(@project.namespace, @project, build) do = icon('chevron-down')
= ci_icon_for_status(build.status) %ul.dropdown-menu.overflow-jobs
%span %li
- if build.name
= build.name
- else
= build.id
- if @build.retried? - if @build.retried?
%li.active %li.active
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment