зеркало из https://github.com/mozilla/treeherder.git
Bug 1098512 - Code cleanup and refactoring.
Removed dead and redundant code. Fixed names of functions to be more clear. Rearranged function placement to be more logical.
This commit is contained in:
Родитель
84529b7658
Коммит
25d6f4cd7b
|
@ -79,7 +79,6 @@ treeherder.controller('FilterPanelCtrl', [
|
|||
*/
|
||||
$scope.toggleClassifiedFilter = function() {
|
||||
var func = $scope.classifiedFilter? thJobFilters.addFilter: thJobFilters.removeFilter;
|
||||
console.log("toggling classified", func, $scope.classifiedFilter);
|
||||
func(thJobFilters.classifiedState, 'classified');
|
||||
};
|
||||
$scope.toggleUnClassifiedFilter = function() {
|
||||
|
@ -117,7 +116,7 @@ treeherder.controller('FilterPanelCtrl', [
|
|||
$scope.fieldFilters = thJobFilters.getFieldFiltersArray();
|
||||
};
|
||||
|
||||
$scope.addFieldFilter = function(quiet) {
|
||||
$scope.addFieldFilter = function() {
|
||||
$log.debug("adding filter", $scope.newFieldFilter.field);
|
||||
|
||||
if (!$scope.newFieldFilter) {
|
||||
|
@ -186,8 +185,9 @@ treeherder.controller('FilterPanelCtrl', [
|
|||
// these are a special case of filtering because we're not checking
|
||||
// for a value, just whether the job has any value set or not.
|
||||
// just a boolean check either way
|
||||
$scope.classifiedFilter = _.contains(thJobFilters.getIsClassifiedArray(), 'classified');
|
||||
$scope.unClassifiedFilter = _.contains(thJobFilters.getIsClassifiedArray(), 'unclassified');
|
||||
var classifiedState = thJobFilters.getClassifiedStateArray();
|
||||
$scope.classifiedFilter = _.contains(classifiedState, 'classified');
|
||||
$scope.unClassifiedFilter = _.contains(classifiedState, 'unclassified');
|
||||
|
||||
// update "all checked" boxes for groups
|
||||
_.each($scope.filterGroups, function(group) {
|
||||
|
|
|
@ -250,7 +250,7 @@ treeherder.controller('ResultSetCtrl', [
|
|||
$scope.repoName + "&author=" +
|
||||
encodeURIComponent($scope.resultset.author);
|
||||
|
||||
$scope.resultStatusFilters = thJobFilters.copyResultStatusFilters();
|
||||
$scope.resultStatusFilters = thJobFilters.getResultStatusArray();
|
||||
|
||||
$rootScope.$on(thEvents.jobContextMenu, function(event, job){
|
||||
$log.debug("caught", thEvents.jobContextMenu);
|
||||
|
|
|
@ -934,13 +934,13 @@ treeherder.directive('thCloneJobs', [
|
|||
|
||||
$rootScope.$on(
|
||||
thEvents.globalFilterChanged, function(ev, filterData){
|
||||
scope.resultStatusFilters = thJobFilters.copyResultStatusFilters();
|
||||
scope.resultStatusFilters = thJobFilters.getResultStatusArray();
|
||||
_.bind(filterJobs, scope, element, scope.resultStatusFilters)();
|
||||
});
|
||||
|
||||
$rootScope.$on(
|
||||
thEvents.searchPage, function(ev, searchData){
|
||||
scope.resultStatusFilters = thJobFilters.copyResultStatusFilters();
|
||||
scope.resultStatusFilters = thJobFilters.getResultStatusArray();
|
||||
_.bind(filterJobs, scope, element, scope.resultStatusFilters)();
|
||||
});
|
||||
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -8,7 +8,7 @@
|
|||
ng-click="pinAllShownJobs()"><i class="glyphicon glyphicon-pushpin"></i> pin all showing</span>
|
||||
<span class="btn btn-default btn-xs"
|
||||
title="show only coalesced jobs"
|
||||
ng-click="thJobFilters.showCoalesced()">coalesced only</span>
|
||||
ng-click="thJobFilters.setOnlyCoalesced()">coalesced only</span>
|
||||
<span class="btn btn-default btn-xs"
|
||||
title="reset to default status filters"
|
||||
ng-click="thJobFilters.resetNonFieldFilters()">reset</span>
|
||||
|
|
Загрузка…
Ссылка в новой задаче