Commit 34ba9e41 authored by Bryce Johnson's avatar Bryce Johnson

Merge branch 'master' into issues-filters-reset-btn

parents ab4763b1 4f8b9d09
...@@ -54,12 +54,14 @@ ...@@ -54,12 +54,14 @@
} }
Build.prototype.getInitialBuildTrace = function() { Build.prototype.getInitialBuildTrace = function() {
var removeRefreshStatuses = ['success', 'failed', 'canceled', 'skipped']
return $.ajax({ return $.ajax({
url: this.build_url, url: this.build_url,
dataType: 'json', dataType: 'json',
success: function(build_data) { success: function(build_data) {
$('.js-build-output').html(build_data.trace_html); $('.js-build-output').html(build_data.trace_html);
if (build_data.status === 'success' || build_data.status === 'failed') { if (removeRefreshStatuses.indexOf(build_data.status) >= 0) {
return $('.js-build-refresh').remove(); return $('.js-build-refresh').remove();
} }
} }
......
...@@ -28,11 +28,6 @@ module Gitlab ...@@ -28,11 +28,6 @@ module Gitlab
end end
end end
def total_count
@total_count ||= issues_count + merge_requests_count + blobs_count +
notes_count + wiki_blobs_count + commits_count
end
def blobs_count def blobs_count
@blobs_count ||= blobs.count @blobs_count ||= blobs.count
end end
......
...@@ -27,11 +27,6 @@ module Gitlab ...@@ -27,11 +27,6 @@ module Gitlab
end end
end end
def total_count
@total_count ||= projects_count + issues_count + merge_requests_count +
milestones_count
end
def projects_count def projects_count
@projects_count ||= projects.count @projects_count ||= projects.count
end end
...@@ -48,10 +43,6 @@ module Gitlab ...@@ -48,10 +43,6 @@ module Gitlab
@milestones_count ||= milestones.count @milestones_count ||= milestones.count
end end
def empty?
total_count.zero?
end
private private
def projects def projects
......
...@@ -20,10 +20,6 @@ module Gitlab ...@@ -20,10 +20,6 @@ module Gitlab
end end
end end
def total_count
@total_count ||= snippet_titles_count + snippet_blobs_count
end
def snippet_titles_count def snippet_titles_count
@snippet_titles_count ||= snippet_titles.count @snippet_titles_count ||= snippet_titles.count
end end
......
...@@ -12,12 +12,6 @@ describe Gitlab::SearchResults do ...@@ -12,12 +12,6 @@ describe Gitlab::SearchResults do
let!(:milestone) { create(:milestone, project: project, title: 'foo') } let!(:milestone) { create(:milestone, project: project, title: 'foo') }
let(:results) { described_class.new(user, Project.all, 'foo') } let(:results) { described_class.new(user, Project.all, 'foo') }
describe '#total_count' do
it 'returns the total amount of search hits' do
expect(results.total_count).to eq(4)
end
end
describe '#projects_count' do describe '#projects_count' do
it 'returns the total amount of projects' do it 'returns the total amount of projects' do
expect(results.projects_count).to eq(1) expect(results.projects_count).to eq(1)
...@@ -42,18 +36,6 @@ describe Gitlab::SearchResults do ...@@ -42,18 +36,6 @@ describe Gitlab::SearchResults do
end end
end end
describe '#empty?' do
it 'returns true when there are no search results' do
allow(results).to receive(:total_count).and_return(0)
expect(results.empty?).to eq(true)
end
it 'returns false when there are search results' do
expect(results.empty?).to eq(false)
end
end
describe 'confidential issues' do describe 'confidential issues' do
let(:project_1) { create(:empty_project) } let(:project_1) { create(:empty_project) }
let(:project_2) { create(:empty_project) } let(:project_2) { create(:empty_project) }
......
...@@ -5,12 +5,6 @@ describe Gitlab::SnippetSearchResults do ...@@ -5,12 +5,6 @@ describe Gitlab::SnippetSearchResults do
let(:results) { described_class.new(Snippet.all, 'foo') } let(:results) { described_class.new(Snippet.all, 'foo') }
describe '#total_count' do
it 'returns the total amount of search hits' do
expect(results.total_count).to eq(2)
end
end
describe '#snippet_titles_count' do describe '#snippet_titles_count' do
it 'returns the amount of matched snippet titles' do it 'returns the amount of matched snippet titles' do
expect(results.snippet_titles_count).to eq(1) expect(results.snippet_titles_count).to eq(1)
......
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