gamebrary/gamebrary

Sort list by game release date

Closed this issue ยท 7 comments

๐ŸŒŸ Feature

Hi, @romancm I'm willing to take this on but this is my first contribution to gamebrary so can I get some more info & context on this one?

Hi @haseebelahi. Great, I just added release_dates to the endpoint.

So you should now see a release_dates object in the game board data.

Screen Shot 2019-05-23 at 9 48 41 AM

I would first look at ListSettings.vue, find the part in the template that's rendering the sort types, then you'll see that there's an array that has all the sort types, you would have to add the new sort type along with a sort icon.

The setListSort method saves the sort value you specified and calls the sort method.

The sort method callls the corresponding mutation that actually sorts the games. You will have to create a new mutation that sorts the game data by release date.

That's more or less the high level idea of what you have to do. Let me know if you have any questions.

Thank you very much for showing me the direction, I'm almost done with the changes.
The sorting control looks like this right now

image

do you think we should reduce the font-size for each button to accommodate 4 buttons now instead of 3?
and also any opinions on which icon to use for the sort by release date button?

I would say maybe the calendar icon, maybe the icon should be in its own line? Like the view buttons. Honestly it doesn't matter that much, you can remove the icons if you want, I'll leave it up to you.

I would also make sure you're using the release date object that matches the platform is. Sometimes games are released at different dates depending on the platform

yes, I'm considering that and also assuming that for a given game the release dates array will definitely have the release date object for the current platform..
e.g if FIFA '19 is added to PlayStation 4 list its release dates array will definitely have a release date for PS 4.

Created a PR for this
#122