dwyl / tudo

:white_check_mark: Want to see where you could help on an open dwyl issue?
https://tudo-app.herokuapp.com/
GNU General Public License v3.0
57 stars 9 forks source link

First opening the app shows issues only from August 2017 & before #260

Open iteles opened 6 years ago

iteles commented 6 years ago

As a user I would like to come to the application and see the latest updated issues as a default So that I get the most immediate needs shown to me first.

At the moment, the application shows only issues from August 2017 & before this date first: screen shot 2017-12-22 at 10 11 21

And it is only on clicking 'Updated' twice that I get the updated list: screen shot 2017-12-22 at 10 11 32

finnhodgkin commented 6 years ago

Eep I think I fixed this before I stopped working on Tudo but didn't push. I think if you swap round lines 15 and 17 of the page__controller it should fix the issue:

    initial_rummage = IssueSorting.default_sort_by(initial_rummage)

    {issues, rummage} =
      IssueSorting.collect_issues(search_params, initial_rummage)

vs the current:

    {issues, rummage} =
      IssueSorting.collect_issues(search_params, initial_rummage)

    rummage = IssueSorting.default_sort_by(rummage)
finnhodgkin commented 6 years ago

Oh @shouston3 made his own fix. Nevermind :smile:

samhstn commented 6 years ago

@finnhodgkin I think your solution is better, would you mind making a pr

finnhodgkin commented 6 years ago

Sure thing :+1:

iteles commented 6 years ago

@shouston3 Might be good to complement @finnhodgkin's excellently simple PR with your test additions for this though 😊

samhstn commented 6 years ago

My test was for my own helper function. @finnhodgkin used a helper function which he had already written and tested, just forgot to add it in.

Cleop commented 6 years ago

@shouston3 - this seems to be working on the heroku app but it's not working on my localhost, any suggestions why?

samhstn commented 6 years ago

Maybe you need to update your local database with the seed file. Something like mix run priv/repo/seeds.exs. If you clear your database before running the seeds file too, you may have to play around with the file to get it working.

Cleop commented 6 years ago

@shouston3 - I tried doing that before when I was following the instructions in the readme but I was getting this error: image

I looked into the error a little but couldn't work out what was going wrong. I tried dropping the db and starting again (following the readme commands) but I still get the same error.

samhstn commented 6 years ago

To fix this, you basically need to try and work through understanding what the seed file is trying to do and fixing it so it works. For this particular error, I would inspect the output of what is being passed into the function which causes this to crash (probably a function from the Enum or a Map libraries, you should put in some IO.inspects to track this down or type in each step using the IEx cli). Try to find the line which is causing this to break and work back from there. Sorry that I can't be more helpful.