зеркало из https://github.com/mozilla/treeherder.git
Bug 1220479 - Fix indentation issues found by newer eslint
The newer version of eslint is more particular, so before updating we need to clean up the indentation in a few places.
This commit is contained in:
Родитель
66450c5400
Коммит
71eea52cae
|
@ -59,13 +59,14 @@ perf.controller('CompareChooserCtrl', [
|
|||
};
|
||||
|
||||
$scope.runCompare = function() {
|
||||
ThResultSetModel.getResultSetsFromRevision(
|
||||
$scope.originalProject.name, $scope.originalRevision).then(
|
||||
function(resultSets) {
|
||||
$scope.originalRevisionError = undefined;
|
||||
}, function(error) {
|
||||
$scope.originalRevisionError = error;
|
||||
});
|
||||
ThResultSetModel.getResultSetsFromRevision($scope.originalProject.name, $scope.originalRevision).then(
|
||||
function(resultSets) {
|
||||
$scope.originalRevisionError = undefined;
|
||||
},
|
||||
function(error) {
|
||||
$scope.originalRevisionError = error;
|
||||
}
|
||||
);
|
||||
|
||||
ThResultSetModel.getResultSetsFromRevision($scope.newProject.name, $scope.newRevision).then(
|
||||
function (resultSets) {
|
||||
|
@ -78,7 +79,8 @@ perf.controller('CompareChooserCtrl', [
|
|||
newRevision: $scope.newRevision
|
||||
});
|
||||
}
|
||||
}, function (error) {
|
||||
},
|
||||
function (error) {
|
||||
$scope.newRevisionError = error;
|
||||
}
|
||||
);
|
||||
|
@ -228,7 +230,8 @@ perf.controller('CompareResultsCtrl', [
|
|||
} else {
|
||||
$scope.newResultSet = resultSet;
|
||||
}
|
||||
}, function(error) {
|
||||
},
|
||||
function(error) {
|
||||
$scope.errors.push(error);
|
||||
});
|
||||
}
|
||||
|
@ -319,7 +322,8 @@ perf.controller('CompareSubtestResultsCtrl', [
|
|||
} else {
|
||||
$scope.newResultSet = resultSet;
|
||||
}
|
||||
}, function(error) {
|
||||
},
|
||||
function(error) {
|
||||
$scope.errors.push(error);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -78,8 +78,7 @@ perf.controller('GraphsCtrl', [
|
|||
return fs.thSeries.projectName == dataPoint.projectName &&
|
||||
fs.thSeries.signature == dataPoint.signature;
|
||||
}),
|
||||
pointIndex: index ? index : phSeries.flotSeries.resultSetData.indexOf(
|
||||
dataPoint.resultSetId)
|
||||
pointIndex: index ? index : phSeries.flotSeries.resultSetData.indexOf(dataPoint.resultSetId)
|
||||
};
|
||||
var prevResultSetId = _.findLast(phSeries.flotSeries.resultSetData,
|
||||
function(resultSetId) {
|
||||
|
@ -253,26 +252,28 @@ perf.controller('GraphsCtrl', [
|
|||
series.flotSeries.lines.show = series.visible;
|
||||
});
|
||||
|
||||
$scope.overviewPlot = $.plot($("#overview-plot"),
|
||||
$scope.seriesList.map(
|
||||
function(series) {
|
||||
return series.flotSeries; }),
|
||||
{
|
||||
xaxis: { mode: 'time' },
|
||||
selection: { mode: 'xy', color: '#97c6e5' },
|
||||
series: { shadowSize: 0 },
|
||||
lines: { show: true },
|
||||
points: { show: false },
|
||||
legend: { show: false },
|
||||
grid: {
|
||||
color: '#cdd6df',
|
||||
borderWidth: 2,
|
||||
backgroundColor: '#fff',
|
||||
hoverable: true,
|
||||
clickable: true,
|
||||
autoHighlight: false
|
||||
}
|
||||
});
|
||||
$scope.overviewPlot = $.plot(
|
||||
$("#overview-plot"),
|
||||
$scope.seriesList.map(function(series) {
|
||||
return series.flotSeries;
|
||||
}),
|
||||
{
|
||||
xaxis: { mode: 'time' },
|
||||
selection: { mode: 'xy', color: '#97c6e5' },
|
||||
series: { shadowSize: 0 },
|
||||
lines: { show: true },
|
||||
points: { show: false },
|
||||
legend: { show: false },
|
||||
grid: {
|
||||
color: '#cdd6df',
|
||||
borderWidth: 2,
|
||||
backgroundColor: '#fff',
|
||||
hoverable: true,
|
||||
clickable: true,
|
||||
autoHighlight: false
|
||||
}
|
||||
}
|
||||
);
|
||||
// Reset $scope.seriesList with lines.show = false
|
||||
$scope.seriesList.forEach(function(series) {
|
||||
series.flotSeries.points.show = series.visible;
|
||||
|
@ -352,25 +353,28 @@ perf.controller('GraphsCtrl', [
|
|||
});
|
||||
$q.all(highlightPromises).then(function() {
|
||||
// plot the actual graph
|
||||
$scope.plot = $.plot($("#graph"),
|
||||
$scope.seriesList.map(
|
||||
function(series) { return series.flotSeries; }),
|
||||
{
|
||||
xaxis: { mode: 'time' },
|
||||
series: { shadowSize: 0 },
|
||||
selection: { mode: 'xy', color: '#97c6e5'},
|
||||
lines: { show: false },
|
||||
points: { show: true },
|
||||
legend: { show: false },
|
||||
grid: {
|
||||
color: '#cdd6df',
|
||||
borderWidth: 2,
|
||||
backgroundColor: '#fff',
|
||||
hoverable: true,
|
||||
clickable: true,
|
||||
autoHighlight: false
|
||||
}
|
||||
});
|
||||
$scope.plot = $.plot(
|
||||
$("#graph"),
|
||||
$scope.seriesList.map(function(series) {
|
||||
return series.flotSeries;
|
||||
}),
|
||||
{
|
||||
xaxis: { mode: 'time' },
|
||||
series: { shadowSize: 0 },
|
||||
selection: { mode: 'xy', color: '#97c6e5'},
|
||||
lines: { show: false },
|
||||
points: { show: true },
|
||||
legend: { show: false },
|
||||
grid: {
|
||||
color: '#cdd6df',
|
||||
borderWidth: 2,
|
||||
backgroundColor: '#fff',
|
||||
hoverable: true,
|
||||
clickable: true,
|
||||
autoHighlight: false
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
updateSelectedItem(null);
|
||||
highlightDataPoints();
|
||||
|
@ -686,10 +690,10 @@ perf.controller('GraphsCtrl', [
|
|||
var tooltipString = decodeURIComponent($stateParams.selected).replace(/[\[\]"]/g, '');
|
||||
var tooltipArray = tooltipString.split(",");
|
||||
var tooltip = {
|
||||
projectName: tooltipArray[0],
|
||||
signature: tooltipArray[1],
|
||||
resultSetId: parseInt(tooltipArray[2]),
|
||||
jobId: (tooltipArray[3] !== undefined) ? parseInt(tooltipArray[3]) : null
|
||||
projectName: tooltipArray[0],
|
||||
signature: tooltipArray[1],
|
||||
resultSetId: parseInt(tooltipArray[2]),
|
||||
jobId: (tooltipArray[3] !== undefined) ? parseInt(tooltipArray[3]) : null
|
||||
};
|
||||
$scope.selectedDataPoint = (tooltipString) ? tooltip : null;
|
||||
}
|
||||
|
@ -855,10 +859,10 @@ perf.controller('TestChooserCtrl', function($scope, $modalInstance, $http,
|
|||
});
|
||||
}
|
||||
).then(function() {
|
||||
// resolve the testsToAdd's length after every thing was done
|
||||
// so we don't need timeout here
|
||||
loadingExtraDataPromise.resolve($scope.testsToAdd.length);
|
||||
});
|
||||
// resolve the testsToAdd's length after every thing was done
|
||||
// so we don't need timeout here
|
||||
loadingExtraDataPromise.resolve($scope.testsToAdd.length);
|
||||
});
|
||||
};
|
||||
|
||||
var addRelatedBranches = function(relatedSeries) {
|
||||
|
|
|
@ -364,33 +364,33 @@ treeherder.directive('thCloneJobs', [
|
|||
job.revision = resultset.revision;
|
||||
//NOTE: scope is set to "this" by _.bind
|
||||
switch (ev.which) {
|
||||
case 1:
|
||||
//Left mouse button pressed
|
||||
if (ev.ctrlKey || ev.metaKey) {
|
||||
_.bind(togglePinJobCb, this, ev, el, job)();
|
||||
} else {
|
||||
_.bind(clickJobCb, this, ev, el, job)();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 2:
|
||||
ev.preventDefault();
|
||||
//Middle mouse button pressed
|
||||
ThJobModel.get(this.repoName, job.id).then(function(data){
|
||||
// Open the logviewer in a new window
|
||||
if (data.logs.length > 0) {
|
||||
window.open(location.origin + "/" + thUrl.getLogViewerUrl(job.id));
|
||||
case 1:
|
||||
//Left mouse button pressed
|
||||
if (ev.ctrlKey || ev.metaKey) {
|
||||
_.bind(togglePinJobCb, this, ev, el, job)();
|
||||
} else {
|
||||
_.bind(clickJobCb, this, ev, el, job)();
|
||||
}
|
||||
});
|
||||
|
||||
break;
|
||||
case 3:
|
||||
//Right mouse button pressed
|
||||
break;
|
||||
default:
|
||||
//strange mouse detected
|
||||
_.bind(clickJobCb, this, ev, el, job)();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
ev.preventDefault();
|
||||
//Middle mouse button pressed
|
||||
ThJobModel.get(this.repoName, job.id).then(function(data){
|
||||
// Open the logviewer in a new window
|
||||
if (data.logs.length > 0) {
|
||||
window.open(location.origin + "/" + thUrl.getLogViewerUrl(job.id));
|
||||
}
|
||||
});
|
||||
|
||||
break;
|
||||
case 3:
|
||||
//Right mouse button pressed
|
||||
break;
|
||||
default:
|
||||
//strange mouse detected
|
||||
_.bind(clickJobCb, this, ev, el, job)();
|
||||
}
|
||||
|
||||
ThResultSetStore.setSelectedJob($rootScope.repoName, el, job);
|
||||
|
@ -936,5 +936,5 @@ treeherder.directive('thCloneJobs', [
|
|||
link:linker,
|
||||
replace:true
|
||||
};
|
||||
|
||||
}]);
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -3,45 +3,46 @@
|
|||
treeherder.factory('ThBugJobMapModel', [
|
||||
'$http', 'thUrl',
|
||||
function($http, thUrl) {
|
||||
// ThBugJobMap is a class which we can use for retrieving and
|
||||
// updating data on the server
|
||||
var ThBugJobMapModel = function(data) {
|
||||
angular.extend(this, data);
|
||||
};
|
||||
// ThBugJobMap is a class which we can use for retrieving and
|
||||
// updating data on the server
|
||||
var ThBugJobMapModel = function(data) {
|
||||
angular.extend(this, data);
|
||||
};
|
||||
|
||||
ThBugJobMapModel.get_uri = function(){return thUrl.getProjectUrl("/bug-job-map/");};
|
||||
ThBugJobMapModel.get_uri = function(){return thUrl.getProjectUrl("/bug-job-map/");};
|
||||
|
||||
// a static method to retrieve a list of ThBugJobMap
|
||||
// the options parameter is used to filter/limit the list of objects
|
||||
ThBugJobMapModel.get_list = function(options) {
|
||||
var query_string = $.param(options);
|
||||
return $http.get(ThBugJobMapModel.get_uri()+"?"+query_string).then(function(response) {
|
||||
var item_list = [];
|
||||
_.each(response.data, function(elem){
|
||||
item_list.push(new ThBugJobMapModel(elem));
|
||||
// a static method to retrieve a list of ThBugJobMap
|
||||
// the options parameter is used to filter/limit the list of objects
|
||||
ThBugJobMapModel.get_list = function(options) {
|
||||
var query_string = $.param(options);
|
||||
return $http.get(ThBugJobMapModel.get_uri()+"?"+query_string).then(function(response) {
|
||||
var item_list = [];
|
||||
_.each(response.data, function(elem){
|
||||
item_list.push(new ThBugJobMapModel(elem));
|
||||
});
|
||||
return item_list;
|
||||
});
|
||||
return item_list;
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
// a static method to retrieve a single instance of ThBugJobMap
|
||||
ThBugJobMapModel.get = function(pk) {
|
||||
return $http.get(ThBugJobMapModel.get_uri()+pk).then(function(response) {
|
||||
return new ThBugJobMapModel(response.data);
|
||||
});
|
||||
};
|
||||
// a static method to retrieve a single instance of ThBugJobMap
|
||||
ThBugJobMapModel.get = function(pk) {
|
||||
return $http.get(ThBugJobMapModel.get_uri()+pk).then(function(response) {
|
||||
return new ThBugJobMapModel(response.data);
|
||||
});
|
||||
};
|
||||
|
||||
// an instance method to create a new ThBugJobMap
|
||||
ThBugJobMapModel.prototype.create = function() {
|
||||
var bug_job_map = this;
|
||||
return $http.post(ThBugJobMapModel.get_uri(), bug_job_map);
|
||||
};
|
||||
// an instance method to create a new ThBugJobMap
|
||||
ThBugJobMapModel.prototype.create = function() {
|
||||
var bug_job_map = this;
|
||||
return $http.post(ThBugJobMapModel.get_uri(), bug_job_map);
|
||||
};
|
||||
|
||||
// an instance method to delete a ThBugJobMap object
|
||||
ThBugJobMapModel.prototype.delete = function(){
|
||||
var pk = this.job_id+"-"+this.bug_id;
|
||||
return $http.delete(ThBugJobMapModel.get_uri()+pk+"/");
|
||||
};
|
||||
// an instance method to delete a ThBugJobMap object
|
||||
ThBugJobMapModel.prototype.delete = function(){
|
||||
var pk = this.job_id+"-"+this.bug_id;
|
||||
return $http.delete(ThBugJobMapModel.get_uri()+pk+"/");
|
||||
};
|
||||
|
||||
return ThBugJobMapModel;
|
||||
}]);
|
||||
return ThBugJobMapModel;
|
||||
}
|
||||
]);
|
||||
|
|
|
@ -267,7 +267,8 @@ treeherder.factory('ThRepositoryModel', [
|
|||
function(data) {
|
||||
newStatuses[repo] = data.data.result;
|
||||
updateStatusesIfDone();
|
||||
}, function(data) {
|
||||
},
|
||||
function(data) {
|
||||
if (data.data != null) {
|
||||
newStatuses[repo] = getUnsupportedTreeStatus(repo);
|
||||
} else {
|
||||
|
|
|
@ -24,7 +24,8 @@ treeherder.factory('ThUserModel', [
|
|||
}else{
|
||||
return {};
|
||||
}
|
||||
}, function(reason){
|
||||
},
|
||||
function(reason){
|
||||
thNotify.send(reason.data,"danger");
|
||||
return $q.reject(reason);
|
||||
});
|
||||
|
|
|
@ -48,13 +48,13 @@ treeherder.provider('thResultStatusObject', function() {
|
|||
'running':0,
|
||||
'pending':0,
|
||||
'completed':0
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
this.$get = function() {
|
||||
return {
|
||||
getResultStatusObject:getResultStatusObject
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
|
@ -262,7 +262,7 @@ treeherder.provider('thAggregateIds', function() {
|
|||
getJobMapKey: getJobMapKey,
|
||||
getGroupMapKey: getGroupMapKey,
|
||||
escape: escape
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
@ -221,29 +221,29 @@ treeherder.factory('thJobFilters', [
|
|||
|
||||
switch (FIELD_CHOICES[field].matchType) {
|
||||
|
||||
case MATCH_TYPE.substr:
|
||||
if (!_containsSubstr(values, jobFieldValue.toLowerCase())) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case MATCH_TYPE.substr:
|
||||
if (!_containsSubstr(values, jobFieldValue.toLowerCase())) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case MATCH_TYPE.searchStr:
|
||||
if (!_containsAllSubstr(values, jobFieldValue.toLowerCase())) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case MATCH_TYPE.searchStr:
|
||||
if (!_containsAllSubstr(values, jobFieldValue.toLowerCase())) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case MATCH_TYPE.exactstr:
|
||||
if (!_.contains(values, jobFieldValue.toLowerCase())) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case MATCH_TYPE.exactstr:
|
||||
if (!_.contains(values, jobFieldValue.toLowerCase())) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case MATCH_TYPE.choice:
|
||||
if (!_.contains(values, String(jobFieldValue).toLowerCase())) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case MATCH_TYPE.choice:
|
||||
if (!_.contains(values, String(jobFieldValue).toLowerCase())) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,41 +3,42 @@
|
|||
treeherder.factory('ThLog', [
|
||||
'$log', 'ThLogConfig',
|
||||
function($log, ThLogConfig) {
|
||||
// a logger that states the object doing the logging
|
||||
// a logger that states the object doing the logging
|
||||
|
||||
var ThLog = function(name) {
|
||||
this.name = name;
|
||||
};
|
||||
var ThLog = function(name) {
|
||||
this.name = name;
|
||||
};
|
||||
|
||||
/**
|
||||
* If ``whitelist`` has values, then only show messages from those.
|
||||
* If ``whitelist`` is empty, then skip any messages from ``blacklist`` items.
|
||||
*/
|
||||
var whitelist = ThLogConfig.whitelist;
|
||||
var blacklist = ThLogConfig.blacklist;
|
||||
/**
|
||||
* If ``whitelist`` has values, then only show messages from those.
|
||||
* If ``whitelist`` is empty, then skip any messages from ``blacklist`` items.
|
||||
*/
|
||||
var whitelist = ThLogConfig.whitelist;
|
||||
var blacklist = ThLogConfig.blacklist;
|
||||
|
||||
ThLog.prototype.getClassName = function() {
|
||||
return this.name;
|
||||
};
|
||||
ThLog.prototype.getClassName = function() {
|
||||
return this.name;
|
||||
};
|
||||
|
||||
ThLog.prototype.debug = function() {logIt(this, $log.debug, arguments);};
|
||||
ThLog.prototype.log = function() {logIt(this, $log.log, arguments);};
|
||||
ThLog.prototype.warn = function() {logIt(this, $log.warn, arguments);};
|
||||
ThLog.prototype.info = function() {logIt(this, $log.info, arguments);};
|
||||
ThLog.prototype.error = function() {logIt(this, $log.error, arguments);};
|
||||
ThLog.prototype.debug = function() {logIt(this, $log.debug, arguments);};
|
||||
ThLog.prototype.log = function() {logIt(this, $log.log, arguments);};
|
||||
ThLog.prototype.warn = function() {logIt(this, $log.warn, arguments);};
|
||||
ThLog.prototype.info = function() {logIt(this, $log.info, arguments);};
|
||||
ThLog.prototype.error = function() {logIt(this, $log.error, arguments);};
|
||||
|
||||
var logIt = function(self, func, args) {
|
||||
if ((whitelist.length && _.contains(whitelist, self.getClassName())) ||
|
||||
(blacklist.length && !_.contains(blacklist, self.getClassName())) ||
|
||||
(!whitelist.length && !blacklist.length)) {
|
||||
var newArgs = Array.prototype.slice.call(args);
|
||||
newArgs.unshift(self.getClassName());
|
||||
func.apply(null, newArgs);
|
||||
}
|
||||
};
|
||||
var logIt = function(self, func, args) {
|
||||
if ((whitelist.length && _.contains(whitelist, self.getClassName())) ||
|
||||
(blacklist.length && !_.contains(blacklist, self.getClassName())) ||
|
||||
(!whitelist.length && !blacklist.length)) {
|
||||
var newArgs = Array.prototype.slice.call(args);
|
||||
newArgs.unshift(self.getClassName());
|
||||
func.apply(null, newArgs);
|
||||
}
|
||||
};
|
||||
|
||||
return ThLog;
|
||||
}]);
|
||||
return ThLog;
|
||||
}
|
||||
]);
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -144,10 +144,13 @@ treeherder.factory('BrowserId', [
|
|||
*/
|
||||
verifyAssertion: function(assertion){
|
||||
return $http.post(
|
||||
thServiceDomain+'/browserid/login/', {assertion: assertion},{
|
||||
thServiceDomain+'/browserid/login/',
|
||||
{assertion: assertion},
|
||||
{
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'},
|
||||
transformRequest: browserid.transform_data
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
transform_data: function(data){
|
||||
|
|
Загрузка…
Ссылка в новой задаче