Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Commit

Permalink
bug 1067854 - hide empty failure text when loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Cameron Dawson committed Sep 22, 2014
1 parent 63b64b1 commit 52b486d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 28 deletions.
42 changes: 16 additions & 26 deletions webapp/app/plugins/failure_summary/controller.js
Expand Up @@ -11,7 +11,7 @@ treeherder.controller('BugsPluginCtrl', [

var timeout_promise = null;
var bug_limit = 20;

$scope.tabs = thTabs.tabs;

// update function triggered by the plugins controller
thTabs.tabs.failureSummary.update = function(){
Expand Down Expand Up @@ -44,31 +44,21 @@ treeherder.controller('BugsPluginCtrl', [
suggestion.bugs = {"open_recent":[], "all_others":[]};
}

if(suggestion.bugs.open_recent.length > bug_limit){
suggestion.bugs.too_many_open_recent = true;
}else{
suggestion.bugs.too_many_open_recent = false;
}

if(suggestion.bugs.all_others.length > bug_limit){
suggestion.bugs.too_many_all_others = true;
}else{
suggestion.bugs.too_many_all_others = false;
}
suggestion.bugs.too_many_open_recent = (
suggestion.bugs.open_recent.length > bug_limit
);
suggestion.bugs.too_many_all_others = (
suggestion.bugs.all_others.length > bug_limit
);
suggestion.open_recent_hidden = (
suggestion.bugs.too_many_open_recent ||
suggestion.bugs.open_recent.length === 0
);

if(suggestion.bugs.too_many_open_recent
|| suggestion.bugs.open_recent.length == 0){
suggestion.open_recent_hidden = true;
}else{
suggestion.open_recent_hidden = false;
}

if(suggestion.bugs.too_many_all_others
|| suggestion.bugs.all_others.length == 0){
suggestion.all_others_hidden = true;
}else{
suggestion.all_others_hidden = false;
}
suggestion.all_others_hidden = (
suggestion.bugs.too_many_all_others ||
suggestion.bugs.all_others.length === 0
);

suggestions.push(suggestion);
});
Expand All @@ -79,6 +69,6 @@ treeherder.controller('BugsPluginCtrl', [
thTabs.tabs.failureSummary.is_loading = false;
});
}
}
};
}
]);
4 changes: 2 additions & 2 deletions webapp/app/plugins/failure_summary/main.html
Expand Up @@ -54,13 +54,13 @@
>Exceeded max bug suggestions</mark>

</li>
<li ng-if="!tabs.failure_summary.is_loading && suggestions.length == 0">
<li ng-if="!tabs.failureSummary.is_loading && suggestions.length == 0">
<div class="failure-summary-line-empty">
<span>Failure summary is empty</span>
</div>
</li>
</ul>
<div ng-if="tabs.failure_summary.is_loading" class="overlay">
<div ng-if="tabs.failureSummary.is_loading" class="overlay">
<div>
<span class="fa fa-refresh fa-spin"></span>
</div>
Expand Down

0 comments on commit 52b486d

Please sign in to comment.