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

fix(files): Sort tree views correctly by natural order #47294

Merged
merged 4 commits into from
Sep 10, 2024

Conversation

Pytal
Copy link
Member

@Pytal Pytal commented Aug 16, 2024

Summary

  • Correctly sort nodes by natural order instead of order=0 i.e. creating a new folder always appended it to the bottom of the level instead of correct natural order
  • Render nodes by natural order as nodes returned from endpoint have an undefined order

Requires

Checklist

Signed-off-by: Christopher Ng <chrng8@gmail.com>
Signed-off-by: Christopher Ng <chrng8@gmail.com>
- Nodes are returned from the endpoint in an undefined order

Signed-off-by: Christopher Ng <chrng8@gmail.com>
@Pytal Pytal force-pushed the fix/natural-order-tree branch from c1b04dc to 060783c Compare September 9, 2024 23:13
@Pytal Pytal marked this pull request as ready for review September 9, 2024 23:13
@Pytal Pytal requested a review from skjnldsv as a code owner September 9, 2024 23:13
@Pytal Pytal requested review from susnux and artonge September 9, 2024 23:14
@Pytal Pytal enabled auto-merge September 9, 2024 23:14
@Pytal
Copy link
Member Author

Pytal commented Sep 9, 2024

/compile

@@ -35,8 +38,19 @@ export const folderTreeId = 'folders'

export const sourceRoot = `${davRemoteURL}/files/${getCurrentUser()?.uid}`

const collator = Intl.Collator(
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe instead simply use orderBy from nextcloud files?

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@Pytal Pytal merged commit d4313c2 into master Sep 10, 2024
116 checks passed
@Pytal Pytal deleted the fix/natural-order-tree branch September 10, 2024 08:00
@Pytal
Copy link
Member Author

Pytal commented Sep 10, 2024

/backport to stable30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants