diff --git a/javascripts/main.js b/javascripts/main.js index 4df25a19594..b35802dc0d3 100644 --- a/javascripts/main.js +++ b/javascripts/main.js @@ -31,7 +31,7 @@ }) .val(tags) .trigger("chosen:updated") - .change(function(e) { + .change(function() { location.href = updateQueryStringParameter( getFilterUrl(), "tags", @@ -48,7 +48,7 @@ }) .val(names) .trigger("chosen:updated") - .change(function(e) { + .change(function() { location.href = updateQueryStringParameter( getFilterUrl(), "names", @@ -64,7 +64,7 @@ }) .val(labels) .trigger("chosen:updated") - .change(function(e) { + .change(function() { location.href = updateQueryStringParameter( getFilterUrl(), "labels", @@ -110,9 +110,9 @@ var separator = uri.indexOf("?") !== -1 ? "&" : "?"; if (uri.match(re)) { return uri.replace(re, "$1" + key + "=" + value + "$2"); - } else { - return uri + separator + key + "=" + value; } + + return uri + separator + key + "=" + value; }; /** @@ -176,7 +176,7 @@ renderProjects(tags, names, labels); }); - this.get("#/", function(context) { + this.get("#/", function() { renderProjects(); }); }); @@ -246,7 +246,7 @@ } $.ajax(url) - .done(function(data, textStatus, jqXHR) { + .done(function(data) { var resultCount = data && typeof data.length === "number" ? data.length.toString() diff --git a/javascripts/projectsService.js b/javascripts/projectsService.js index e40976698a6..6c6affdbb88 100644 --- a/javascripts/projectsService.js +++ b/javascripts/projectsService.js @@ -32,7 +32,8 @@ * are returned. If none of the names was added to the filter. * Then it fallsback to show all the projects. * @param Array projects : An array having all the Projects in _data - * @param Array projectsNameSorted : This is another array showing all the projects in a sorted order + * @param Array projectsNameSorted : This is another array showing all the + * projects in a sorted order * @param Array names : This is an array with the given name filters. */ var applyNamesFilter = function(projects, projectNamesSorted, names) { @@ -67,7 +68,8 @@ * are returned. If none of the labels was added to the filter, * it fallsback to show all the projects. * @param Array projects : An array having all the Projects in _data - * @param Array projectLabelsSorted : This is another array showing all the labels in a sorted order + * @param Array projectLabelsSorted : This is another array showing all the + * labels in a sorted order * @param Array labels : This is an array with the given label filters. */ var applyLabelsFilter = function(projects, projectLabelsSorted, labels) { @@ -140,7 +142,7 @@ .sortBy(function(tag, key) { return key; }) - .sortBy(function(tag, key) { + .sortBy(function(tag) { return tag.frequency * -1; }) .value()); @@ -240,19 +242,19 @@ }; this.getTags = function() { - return _.sortBy(tagsMap, function(entry, key) { + return _.sortBy(tagsMap, function(entry) { return entry.name.toLowerCase(); }); }; this.getNames = function() { - return _.sortBy(namesMap, function(entry, key) { + return _.sortBy(namesMap, function(entry) { return entry.name.toLowerCase(); }); }; this.getLabels = function() { - return _.sortBy(labelsMap, function(entry, key) { + return _.sortBy(labelsMap, function(entry) { return entry.name.toLowerCase(); }); }; diff --git a/tests/src/sampleProjects.js b/tests/src/sampleProjects.js index 53bf924dd92..7f74c482f3f 100644 --- a/tests/src/sampleProjects.js +++ b/tests/src/sampleProjects.js @@ -1,3 +1,4 @@ +/* eslint-disable-next-line no-unused-vars */ var sampleProjects = [ { name: "Glimpse",