Skip to content

fixed sorting for upcoming cards#5493

Merged
juliusknorr merged 2 commits intonextcloud:mainfrom
elzody:sort-cards-upcoming
Jan 25, 2024
Merged

fixed sorting for upcoming cards#5493
juliusknorr merged 2 commits intonextcloud:mainfrom
elzody:sort-cards-upcoming

Conversation

@elzody
Copy link
Copy Markdown
Contributor

@elzody elzody commented Jan 18, 2024

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

upcoming-cards-sorted

Signed-off-by: Elizabeth Danzberger <elizabethdanzberger@gmail.com>
Copy link
Copy Markdown
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

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

Tested & works 👍

Comment thread src/components/overview/Overview.vue Outdated
sortCards(when) {
const cards = this.assignedCardsDashboard[when]

if (!cards) return null
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you for making me aware of this; it has been fixed in the second commit :)

Signed-off-by: Elizabeth Danzberger <elizabethdanzberger@gmail.com>
Comment on lines +150 to +158
} else {
return cards.toSorted((current, next) => {
const currentDueDate = new Date(current.duedate)
const nextDueDate = new Date(next.duedate)

return currentDueDate - nextDueDate
})
}
},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just a very small detail. Since the if-branch returns, we don't need an else branch which slightly improves readability:

Suggested change
} 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
})
},

@juliusknorr
Copy link
Copy Markdown
Member

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".

@elzody
Copy link
Copy Markdown
Contributor Author

elzody commented Jan 24, 2024

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.

@juliusknorr juliusknorr merged commit 7694c8b into nextcloud:main Jan 25, 2024
@juliusknorr
Copy link
Copy Markdown
Member

/backport to stable28

@backportbot
Copy link
Copy Markdown

backportbot Bot commented Jan 25, 2024

The backport to stable28 failed. Please do this backport manually.

# 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/stable28

Error: Failed to clone repository: Failed to clone and cache repo: Cloning into '.'...
error: RPC failed; curl 92 HTTP/2 stream 5 was not closed cleanly: CANCEL (err 8)
error: 4967 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@juliusknorr
Copy link
Copy Markdown
Member

I'll take care of this :)

@michaelrall
Copy link
Copy Markdown

michaelrall commented Apr 8, 2024

Hi guys,
thanks for working on this issue. I'm using nextcloud (hosted by hetzner) with Deck-App 1.12.2, but still get some sorting issues.
Things that come to my mind that might be an issue:

  • mixing boards -> seems like the cards get sorted board-by-board
  • changing due-dates over time -> I use the today-list to order my tasks, and very often update the due-date, e.g. move a task to tomorrow, or to a later time today. Maybe somewhere the creation-order or something simliar is getting preference over the due-date-sorting.

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.

cheers
Michael
2024-04-08_09h54_06

@github-actions
Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

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!

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.

Upcoming cards should be sorted by date

4 participants