Skip to content

Commit

Permalink
Fixes #2663 - Reduce number of untriaged bugs on homepage and renamed…
Browse files Browse the repository at this point in the history
… usage of diagnose.js

Updated tests to be compatible with 5 `needstriage` issues in homepage

Signed-off-by: Anushi Maheshwari <[email protected]>
  • Loading branch information
Anushi1998 committed Oct 19, 2018
1 parent 1ab1dc0 commit 467c291
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions grunt-tasks/concat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
6 changes: 3 additions & 3 deletions grunt-tasks/uglify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/index-non-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
Expand Up @@ -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 %}

0 comments on commit 467c291

Please sign in to comment.