Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #2663 - Reduce number of untriaged bugs on homepage #2664

Merged
merged 1 commit into from
Oct 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions grunt-tasks/concat.js
Original file line number Diff line number Diff line change
@@ -28,13 +28,13 @@ module.exports = function(grunt) {
],
dest: "<%= jsDistPath %>/<%= pkg.name %>.js"
},
diagnose: {
untriaged: {
src: [
"<%= jsPath %>/lib/models/label-list.js",
"<%= jsPath %>/lib/models/issue.js",
"<%= jsPath %>/lib/diagnose.js"
"<%= jsPath %>/lib/untriaged.js"
],
dest: "<%= jsDistPath %>/diagnose.js"
dest: "<%= jsDistPath %>/untriaged.js"
},
issues: {
src: [
6 changes: 3 additions & 3 deletions grunt-tasks/uglify.js
Original file line number Diff line number Diff line change
@@ -28,9 +28,9 @@ module.exports = function(grunt) {
src: "<%= concat.userActivity.dest %>",
dest: "<%= jsDistPath %>/user-activity.min.js"
},
diagnose: {
src: "<%= concat.diagnose.dest %>",
dest: "<%= jsDistPath %>/diagnose.min.js"
untriaged: {
src: "<%= concat.untriaged.dest %>",
dest: "<%= jsDistPath %>/untriaged.min.js"
},
contributors: {
src: "<%= jsPath %>/lib/contributors.js",
2 changes: 1 addition & 1 deletion tests/functional/index-non-auth.js
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ registerSuite("Index", {
return FunctionalHelpers.openPage(this, url("/"), ".js-hero-title")
.findAllByCssSelector("#js-lastIssue .js-IssueList.label-needstriage")
.then(function(elms) {
assert.equal(elms.length, 10, "10 issues should be displayed");
assert.equal(elms.length, 5, "5 issues should be displayed");
})
.end()
.findByCssSelector(".js-IssueList.label-needstriage .js-issue-number")
Original file line number Diff line number Diff line change
@@ -2,20 +2,20 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

var diagnose = diagnose || {}; // eslint-disable-line no-use-before-define
var untriaged = untriaged || {}; // eslint-disable-line no-use-before-define
var issues = issues || {}; // eslint-disable-line no-use-before-define

diagnose.NeedsTriageCollection = Backbone.Collection.extend({
untriaged.NeedsTriageCollection = Backbone.Collection.extend({
model: issues.Issue,
url: "/api/issues/category/needstriage"
});

diagnose.NeedsTriageView = Backbone.View.extend({
untriaged.NeedsTriageView = Backbone.View.extend({
el: $("#js-lastIssue"),
initialize: function() {
var self = this;
var headersBag = { headers: { Accept: "application/json" } };
this.issues = new diagnose.NeedsTriageCollection();
this.issues = new untriaged.NeedsTriageCollection();
this.issues
.fetch(headersBag)
.done(function() {
@@ -27,14 +27,14 @@ diagnose.NeedsTriageView = Backbone.View.extend({
render: function() {
this.$el.html(
this.template({
// Just display the first 10.
issues: this.issues.toJSON().slice(0, 10)
// Just display the first 5.
issues: this.issues.toJSON().slice(0, 5)
})
);
return this;
}
});

$(function() {
new diagnose.NeedsTriageView();
new untriaged.NeedsTriageView();
});
4 changes: 2 additions & 2 deletions webcompat/templates/index.html
Original file line number Diff line number Diff line change
@@ -13,10 +13,10 @@
{% endblock %}
{%- block extrascripts -%}
{%- if config.PRODUCTION or config.STAGING -%}
<script src="{{ url_for('static', filename='js/dist/diagnose.min.js')|bust_cache }}"></script>
<script src="{{ url_for('static', filename='js/dist/untriaged.min.js')|bust_cache }}"></script>
{%- else -%}
<script src="{{ url_for('static', filename='js/lib/models/label-list.js') }}"></script>
<script src="{{ url_for('static', filename='js/lib/models/issue.js') }}"></script>
<script src="{{ url_for('static', filename='js/lib/diagnose.js') }}"></script>
<script src="{{ url_for('static', filename='js/lib/untriaged.js') }}"></script>
{%- endif -%}
{%- endblock %}