ispras / lingvodoc-react

Apache License 2.0
7 stars 11 forks source link

Perspective view filtering, sorting and pagination on backend side #1133

Open vmonakhov opened 1 month ago

vmonakhov commented 1 month ago

Now PerspectiveView component gets all lexical entries for current perspective from database and processing the data on frontend side. It is not the optimal way in case of huge perspective (tens and hundreds of thousands entries). We need to process (filtering, sorting, pagination) the data on backend side and pass it page by page to frontend. In detail:

  1. Filtering should have CaseSensitive and Regexp options. Probably, just created entries should not be filtered, should be visible any way.
  2. Custom sorting goes by some field and can be ascending or descending. Default sorting is by 'Meaning' field and/or by client/object id from older to newer entries. Be careful, current perspective may not have 'Meaning' field. Just created entries should not be sorted by any field.
  3. Before pagination you should separate (if any) old empty entries, just created empty entries, just created filled entries and count all the obtained entries. Just after this you can split data by pages.
  4. Old empty entries should be visible in the beginning of the whole table in edit mode only. Newly created empty and filled entries should be visible in the beginning of any page over its limit without any custom filtering or sorting.
vmonakhov commented 4 weeks ago

All the listed above points are solved.

vmonakhov commented 4 weeks ago

Added sorting for 'Paradigm and contexts' field by entities amount (this field has empty contents). https://github.com/ispras/lingvodoc/commit/84b7a74aeb8bf6bff82bbd46c2f74a0088877864