Skip to content

Fixes #2732 - Makes the right number of needstriage requests on webcompat webpage#2737

Merged
karlcow merged 2 commits intowebcompat:masterfrom
marimeireles:issues/2732/1
Dec 17, 2018
Merged

Fixes #2732 - Makes the right number of needstriage requests on webcompat webpage#2737
karlcow merged 2 commits intowebcompat:masterfrom
marimeireles:issues/2732/1

Conversation

@marimeireles
Copy link
Copy Markdown
Member

Github will fetch 30 issues by default as shown here. Adding + '?per_page=5' to the API request fixes it.

@marimeireles marimeireles requested a review from karlcow December 13, 2018 13:48
@marimeireles marimeireles changed the title Makes the right number of needstriage requests on webcompat webpage Fixes #2732 - Makes the right number of needstriage requests on webcompat webpage Dec 13, 2018
Copy link
Copy Markdown
Member

@karlcow karlcow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will work indeed, but I have the feeling that this is not the right place to do it. By modifying the enpoint response, we are limiting the generic usage of the endpoint (if we want to reuse it somewhere else). The homepage list is controlled by the script untriaged.js, which is the one calling the API endpoint.

So probably this modification should be done here instead of the API endpoint.

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

@marimeireles @miketaylr What do you think?

@marimeireles
Copy link
Copy Markdown
Member Author

I think you're right. Makes sense.

@marimeireles
Copy link
Copy Markdown
Member Author

marimeireles commented Dec 15, 2018

When I changed the untriaged.js file it generated a new hash to make the requisition on test mode.
So I had to create a new file on tests/fixtures/api/category to send the issues when requested.

Copy link
Copy Markdown
Member

@karlcow karlcow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @marimeireles !!! Good low hanging fruit. 🍏

@miketaylr
Copy link
Copy Markdown
Member

@marimeireles @miketaylr What do you think?

Sorry for the late response, but yes, I agree!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants