Author manager updates#260
Merged
Merged
Conversation
This feature is unused, and it makes Author Manager's table too wide.
This commit adds some navigation options, rather than loading all author records at once (at least by default). It does NOT add real pagination, which is evidently something that our dataTables library supports[1]. From the user side: 1. The client-side control (and JS code) for toggling between unconfirmed authors and *all* authors has been replaced with a pair of navigation buttons. 'unconfirmed' is the default, and is _faster_. 2. dataTables will now hide its client-side pagination and search controls, if there are 10 or fewer authors in the navigation selection. 3. Authors can be navigated individually by name, using the new, auto-completing search box (based on the one in Section Compiler). [1]: https://datatables.net/manual/server-side ...though, at version 1.9.2, we're officially in legacy-land.
Based on @peterjdann's handy addition to project pages. 👍
Navigate Author Manager by project ID, showing all authors and translators assigned to the project (or to its individual sections, if it's a collection/compilation project). For now, this is only linked from the Projects search view.
Added some try/catch logic, so the application doesn't hang when the server response is malformed or lost (see: HTML warnings that precede the expected JSON objects, or timeouts in certain AJAX requests). Also, we can use the pretty message pattern that the other pages use, instead of a jarring fallback to `alert()`.
notartom
approved these changes
May 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR does add more code than it removes... but hopefully it's clean and easy to follow. Each commit is separable, if just one part needs to go. There having been no objections on the admin side, I'm getting this up while it's still (re-)fresh in mind.
Resolves #91: after further discussion, we don't need that column visible for the foreseeable future. 😁
Resolves #24... hopefully. New endpoints for authors by ID, by project, or by confirmation status (the default use-case), and some hopefully-intuitive ways of navigating them. 🤞
Also, a nicer way of handling malformed responses to AJAX requests. Seeing an unhelpful message is better than having the application freeze, as seen in #31. Thankfully, that's rare on live these days. When testing with warnings enabled, not so rare. 😉