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

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

Open
vmonakhov opened this issue Aug 11, 2024 · 2 comments
Open

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

vmonakhov opened this issue Aug 11, 2024 · 2 comments
Assignees
Labels
backend bug is related to backend frontend bug is related to frontend optimization something that improves performance or storage space

Comments

@vmonakhov
Copy link

vmonakhov commented Aug 11, 2024

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 vmonakhov self-assigned this Aug 11, 2024
@vmonakhov vmonakhov added optimization something that improves performance or storage space backend bug is related to backend frontend bug is related to frontend labels Aug 11, 2024
vmonakhov added a commit that referenced this issue Aug 11, 2024
* init

* next steps

* PerspectivePage methods moved to DictionaryPerspective

* next steps

* refactoring

* regexp

* some workaround

* some workaround

* fixes and cleanup

* more correct filtering

* next steps

* refactoring

* created entries calculating
vmonakhov added a commit to ispras/lingvodoc that referenced this issue Aug 11, 2024
)

* init

* next steps

* minor

* PerspectivePage methods moved to DictionaryPerspective

* fixes

* next steps

* sql to alchemy

* sql to alchemy

* sql to alchemy

* refactoring

* filtering

* filtering

* sorting

* refactoring

* checking edit mode

* refactoring

* fix

* regexp

* refactoring

* fixed and cleaned-up

* complex sorting

* correct sorting within lex entry

* sort by lowercase

* fixed filtering

* minor

* cleanup

* fixes and cleanup

* more correct filtering

* next steps

* outerjoin and labels

* with sorting_cte

* created entries calculating

* new entries showing

* fixes

* fixes
vmonakhov added a commit that referenced this issue Aug 21, 2024
* checkboxes

* fixes

* fixes

* styled
@vmonakhov
Copy link
Author

vmonakhov commented Aug 22, 2024

All the listed above points are solved.

  • Filtering and sorting are processed using sql requests.
  • Filtering can be case sensitive or insensitive and/or using regexp.
  • Sorting goes after filtering and uses its result.
  • Sorting can be ascending or descending. In ascending case we choose lexicographically minimal entity within every lexical entry and sort our entries by them. We sort entities themselves within every lexical entry as well.
  • Empty and/or newly created entries we show as required.

@vmonakhov
Copy link
Author

vmonakhov commented Aug 22, 2024

Added sorting for 'Paradigm and contexts' field by entities amount (this field has empty contents).
ispras/lingvodoc@84b7a74

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend bug is related to backend frontend bug is related to frontend optimization something that improves performance or storage space
Projects
None yet
Development

No branches or pull requests

1 participant