eeditiones / tei-publisher-app

The main TEI Publisher app
https://teipublisher.com
GNU General Public License v3.0
68 stars 33 forks source link

App Generator's list of templates should be alphabetized #137

Open joewiz opened 1 year ago

joewiz commented 1 year ago

The order of templates in the App Generator interface (http://localhost:8080/exist/apps/tei-publisher/manage.html) is seemingly random. On my machine:

Screenshot 2022-12-02 at 18 52 32

This list would be far easier to browse if it were presented in alphabetical order.

joewiz commented 1 year ago

Hoping to supply a fix for this issue, I tried applying ordering by inserting an order by $description clause in the iapi:list-templates() function that produces this data (a JSON array of objects) for the API call to the http://localhost:8080/exist/apps/tei-publisher/api/templates endpoint - i.e. in the info.xql library module, but while the objects in the JSON array did correctly sort into alphabetical order, the order as shown in the app - i.e., in manage.html page's pb-edit-app component - did not change. I tried to rule caching by shift-reloading and selecting the "Disable cache" checkbox in Chrome's Developer Tools pane.

If anyone has a tip about what would be needed to convince pb-edit-app to display the objects in the order of the array supplied by the API, I'd be grateful!