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

Enhanced sorting for numeric and alphanumeric titles #3554

Merged
merged 2 commits into from
Mar 27, 2023

Conversation

symmetrically
Copy link
Contributor

@symmetrically symmetrically commented Mar 16, 2023

Closes #2809

@symmetrically symmetrically marked this pull request as draft March 16, 2023 17:12
@symmetrically symmetrically requested a review from benwbrum March 16, 2023 17:12
@symmetrically
Copy link
Contributor Author

@benwbrum I opted for the approach in which at the time of read_work(Display Controller) it will sort the pages based on the title of the page. The pattern would be numeric, then alphabets and then alphanumeric. I only did these changes for the else condition when params[:needs_review] is nill for the Read Tab.
Let me know what you think about this approach

Screencast.from.03-16-2023.09_18_38.PM.webm

@benwbrum
Copy link
Owner

I don't think that ording on display is going to work, since part of the application allows project owners to manually change the order of pages within a work. (Click on a work you own; click the Pages tab)

Screenshot from 2023-03-22 13-58-56

This is a feature which is not used often, but it is important for the few projects that use it.

So I think that we should continue to order based on the acts_as_list position when we display pages in Read Work or Contents tabs, but use numerical order (as appropriate) in the Ingestor's code which converts uploaded files to works.

Copy link
Owner

@benwbrum benwbrum left a comment

Choose a reason for hiding this comment

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

See comment on PR.

@symmetrically
Copy link
Contributor Author

@benwbrum With the new changes, it will sort the pages numerically before creating them in the DB. I have tested it locally too, its working as expected now.

@symmetrically symmetrically requested a review from benwbrum March 24, 2023 12:09
@symmetrically symmetrically force-pushed the 2809-order-pages-numerically branch from f9182d0 to b67873c Compare March 24, 2023 12:14
@symmetrically symmetrically marked this pull request as ready for review March 24, 2023 12:29
@benwbrum benwbrum self-assigned this Mar 27, 2023
Copy link
Owner

@benwbrum benwbrum left a comment

Choose a reason for hiding this comment

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

This is better logic than what I came up with.

@benwbrum benwbrum merged commit 3f072f1 into development Mar 27, 2023
@benwbrum benwbrum deleted the 2809-order-pages-numerically branch March 27, 2023 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upload should order pages numerically instead of alphabetically
2 participants