fixed sorting for upcoming cards#5493
fixed sorting for upcoming cards#5493juliusknorr merged 2 commits intonextcloud:mainfrom elzody:sort-cards-upcoming
Conversation
Signed-off-by: Elizabeth Danzberger <elizabethdanzberger@gmail.com>
| sortCards(when) { | ||
| const cards = this.assignedCardsDashboard[when] | ||
|
|
||
| if (!cards) return null |
There was a problem hiding this comment.
There was a problem hiding this comment.
Thank you for making me aware of this; it has been fixed in the second commit :)
Signed-off-by: Elizabeth Danzberger <elizabethdanzberger@gmail.com>
| } else { | ||
| return cards.toSorted((current, next) => { | ||
| const currentDueDate = new Date(current.duedate) | ||
| const nextDueDate = new Date(next.duedate) | ||
|
|
||
| return currentDueDate - nextDueDate | ||
| }) | ||
| } | ||
| }, |
There was a problem hiding this comment.
Just a very small detail. Since the if-branch returns, we don't need an else branch which slightly improves readability:
| } else { | |
| return cards.toSorted((current, next) => { | |
| const currentDueDate = new Date(current.duedate) | |
| const nextDueDate = new Date(next.duedate) | |
| return currentDueDate - nextDueDate | |
| }) | |
| } | |
| }, | |
| return cards.toSorted((current, next) => { | |
| const currentDueDate = new Date(current.duedate) | |
| const nextDueDate = new Date(next.duedate) | |
| return currentDueDate - nextDueDate | |
| }) | |
| }, |
|
The DCO check fails as there seems to be an email mismatch, but if you say that this is ok this would not be a blocker. Commit sha: a6fc696, Author: Elizabeth Danzberger, Committer: Elizabeth Danzberger; Expected "Elizabeth Danzberger spookystuff@protonmail.com", but got "Elizabeth Danzberger elizabethdanzberger@gmail.com". |
Yeah, this email is fine. |
|
/backport to stable28 |
|
The backport to # Switch to the target branch and update it
git checkout stable28
git pull origin stable28
# Create the new backport branch
git checkout -b backport/5493/stable28
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick a6fc69637326254f8e4addefd5dba4b21cb9aadf 220f91fdc5c8d438af7994b8896650c6297cd926
# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/5493/stable28Error: Failed to clone repository: Failed to clone and cache repo: Cloning into '.'... Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports. |
|
I'll take care of this :) |
|
Hi guys,
I would happlily support your investigations to get the sorting right. I'm a developer myself, so we can get technical ;-). Maybe you take a look at the android app for deck, it handles sorting (in my opinion) correctly. |
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! |

Summary
Cards were previously not organized in order of due date (ascending) on the Upcoming Cards screen. These changes fix this.
Cards which have a due date that has already passed are organized in due date (descending), as it likely makes the most sense to see cards which are way past due first. This can be changed if desired.
Screenshot