-
Notifications
You must be signed in to change notification settings - Fork 269
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
Sorting projects in dropdown based on recent activity not alphabetically #350
Comments
Yes, I agree :) |
which of the two would seem more logical to you @jurre ? (based on recent activity of the user, or based on recent activity of the tenant as a whole ) |
Either is an improvement, I think the users activity would probably be more relevant for this though |
HI guys, I think that a possible solution is update the project (update the updated_at field only) after create a new entry. In this way, we only list the projects order by updated_at field. In other case, we need sort them by the last entry and we need to make a lot of queries and check all creation dates. If you want (/cc @jurre @alexanderjeurissen ), I can change after save callback in entries to update the project field (updated_at). If you have any other possible solution I can do it too. |
You could just do belongs_to :project, touch: true Right? |
@jurre the belongs_to :project, touch: true Only sorting the project list that is rendered is necessary, however that would result in sorting the projects based on activity of the whole tenant. creating the desired behaviour for just the current user is a bit more complex. |
I just checked and the |
Yes, it's a possibility. You need consider what is a "update for the project" in order with the project philosophy. Of course if you update the name of the project you update the project but this action meaning that it's an active project in that moment? I mean that we need take a decision if we add a new field to manage the last real update of the project (new entry or other event) or an update the updated_at field is enough. In the first case, we need to create callback to update the new field in project model when a relevant success appear, for example, after create in Entry model will update this new field in his project. In the second case, only with the modification of @alexanderjeurissen is enough. |
Often I find myself working on a limited set of projects at any given time, I think it would speed up the time tracking process if the projects I recently created entries for are on top in the dropdown.
An alternative would be to sort the projects in the dropdown based on recent activity of the tenant as a whole. That way less active projects would be on the bottom of the dropdown list.
The text was updated successfully, but these errors were encountered: