ErwinKomen / RU-passim

0 stars 0 forks source link

List view results sorting - restore to default #764

Closed shariboodts closed 3 months ago

shariboodts commented 4 months ago

When sorting columns in the list view, they get a number (1, 2, 3) depending on the priority of sorting. When pressing 'Clear' to clear the search filters, the order of sorting of the list views remains in place. Only when exiting the database completely, it is reset to default.

Create an option to clear the sorting of the list views and restore to default.

ErwinKomen commented 4 months ago

Each individual column priority can be removed by pressing the gray up/down symbol left of the sort number:

image

Would it be an option to let the 'Clear' button also reset the list view column priority? Or else: add a button with Clear sort order or something like that?

shariboodts commented 4 months ago

I would let the 'clear' button also reset the list view column priority.

shariboodts commented 4 months ago

An additional question: when clicking the sorting button for the Gryson/Clavis code column, I do not see any logic in what happens. Ideally, the sorting would happen alphabetically based on the first Gryson or Clavis code in the field, and then numerically, so:

AU ci AU s 1 AU s 23 AU s 89 AU s 100 CAE s 20 GREG s 50

Is that possible? If the numerical is too complex this way, the alphabetical alone would also already be good.

ErwinKomen commented 3 months ago

I would let the 'clear' button also reset the list view column priority.

Okay, the Clear button now resets the list view column priority and, almost by necessity, it also re-loads the listview coming up with a clean slant.

ErwinKomen commented 3 months ago

An additional question: when clicking the sorting button for the Gryson/Clavis code column, I do not see any logic in what happens. Ideally, the sorting would happen alphabetically based on the first Gryson or Clavis code in the field, and then numerically, so:

AU ci AU s 1 AU s 23 AU s 89 AU s 100 CAE s 20 GREG s 50

Is that possible? If the numerical is too complex this way, the alphabetical alone would also already be good.

Implementation

  1. The order is Lower case, contents of siglist field
  2. But the contents of that field are not necessarily in the correct order...
    1. Relates to: SermonGold, SermonDescr
    2. Corrected it for the above
    3. One time adaptations: do that in those class's function do_signatures()
  3. What is shown in the listview should also represent the siglist well
    1. look at SermonDescr method get_eqsetsignatures_markdown() (for type combi)
  4. Options
    1. remove '[' and ']' from the set?
      1. That would need to be an effect of the plain option in do_signatures() for S and SG

Problem

The problem is in the use of non-alphanumerical characters, which are:

  1. square brackets (removed them from codesort)
  2. hyphens (no action for this)
  3. comma's inside Gryson/Clavis (removed in codesort)
  4. accented characters (de-accented for codesort)

This calls for a radical solution:

  1. Add a field codesort to the Signature model (and the SermonSignature?)
    1. Added to Signature
    2. Added to SermonSignature
    3. One-time adaptation of codesort
    4. Code to adapt code into codesort:
      1. When a new code is calculated: Signature, SermonSignature
      2. When a change is made to code: Signature, SermonSignature
  2. Adapt the get_signatures_markdown() and get_eqsetsignatures_markdown() to use the codesort
  3. Adaptations:
    1. Calculating codesort from the existing code
    2. Calculating siglist afresh (for S, SG)
ErwinKomen commented 3 months ago

Okay, works, implemented