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

Add possibility to show random tasks #2860

Merged
merged 7 commits into from
Jul 12, 2018
Merged

Conversation

rschwanhold
Copy link
Contributor

Mailable description of changes:

  • The admin has now the possibility to show the task in a random order. This feature is used when you click on 'Show random subset'. The behavior of 'Search' is still the same.

Steps to test:

  • go to Administration >> Tasks
    • e.g. select Project
    • click 'Search': the result should stay the same every time you click on it
    • click 'Show random subset': the order of the result should change every time you click it (if you have at lest 2 Tasks that fits the criteria)

Issues:


  • Ready for review

@rschwanhold rschwanhold changed the title random task assignment Add possibility to show random tasks Jul 6, 2018
@jstriebel
Copy link
Contributor

@rschwanhold : Please add the change notes to the changelog

@fm3 fm3 added this to the Sprint 24a milestone Jul 10, 2018
Copy link
Member

@fm3 fm3 left a comment

Choose a reason for hiding this comment

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

Works for me (but I’m a bit scared of the performance on a 3M-entry-table – but I assume this is not used with a super high frequency anyway). Backend code looks okay to me.
@philippotto could you have a look at the js changes? Also, do you think it is confusing that the loading symbol still appears in the original Search button rather than the new Show random subset button? Here, too, I think it’s acceptable but I’d like to hear your opinion.

@philippotto
Copy link
Member

Works for me (but I’m a bit scared of the performance on a 3M-entry-table – but I assume this is not used with a super high frequency anyway). Backend code looks okay to me.

We can test this directly after deployment. As long as the server doesn't freeze, everything should be fine. The functionality is probably not used very often.

@philippotto could you have a look at the js changes? Also, do you think it is confusing that the loading symbol still appears in the original Search button rather than the new Show random subset button? Here, too, I think it’s acceptable but I’d like to hear your opinion.

Yes, I tweaked the code a bit and combined the two search buttons (which also solves the "wrong" place for the loading indicator). Should be good to go now.

@rschwanhold
Copy link
Contributor Author

@fm3 the performance optimized way would be to use the "tablesample" method from postgres. This works really well for big tables, but this does only work with tables or materialized views.

@fm3
Copy link
Member

fm3 commented Jul 11, 2018

@rschwanhold ok, then let’s do it with order by random for now. If it’s super slow we can still optimize later :)

@rschwanhold rschwanhold merged commit e81ce59 into master Jul 12, 2018
@philippotto philippotto deleted the random-task-assignment branch August 13, 2018 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add possibility to randomize Task search result sample
4 participants