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

Implement custom sort title and sorting titles #259

Merged

Conversation

Leeingnyo
Copy link
Member

@Leeingnyo Leeingnyo commented Dec 25, 2021

Resolves #182

New

DB

  • add column sort_title on ids and titles tables (migration file no.12)

API

  • implement /api/admin/sort_title/:title_id
    • name is an optional query parameter and if empty, make sort_title null

Server

  • add the name(title) option to sort titles
  • use sort_title instead title for sorting titles and entries in auto and title options
  • sort titles too
  • cache sorted titles
    • make helper methods to remove sorted caches

UI

  • add a Sort Title field below the Display Name field in edit modal
  • set a placeholder with file title (same with title mentioned in [Feature Request] Custom sort order #182 (comment)) at the Display Name field and the Sort Title field
  • restore a display name with the file title when a user submits an empty input

Fixes

UI

  • remove callbacks after modal hidden

@Leeingnyo
Copy link
Member Author

It's really complicated to delete columns in sqlite3! haha I didn't know that. Thank you for fixing!

@hkalexling
Copy link
Member

Haha no problem. I will test and review the rest of the PR soon.

Happy new year! 🎆

@hkalexling
Copy link
Member

Sorry for the long delay. I included the sort_title fields into the API response, and everything else looks good.

Thanks for the PR!

@hkalexling hkalexling merged commit 2007f13 into getmango:dev Jan 15, 2022
@Leeingnyo Leeingnyo deleted the feature/custom-sort-title-and-sorting-titles branch January 15, 2022 13:02
@hkalexling hkalexling linked an issue Jan 23, 2022 that may be closed by this pull request
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.

[Feature Request] Custom sort order
2 participants