Skip to content

Draft: selection overhaul

Michal Berky requested to merge mberky/STR-1145/cached_table_selection into main

Description

This draft contains initial work done on improving and unifying behaviour of selection checkboxes in tables across Perun.

As of now, there are currently 3 list components with improved selection - attr-def-list, applications-list and members-list. They represent the 3 expected types of components that appear in respect to whether they are server-paginated or not in all instances - non-server-paginated, server-paginated and a mix of both respectively.

Those 3 components, along with their parent components, would ideally be fit to serve as templates for majority of the work that needs to be done to apply these changes to all tables with checkboxes in Perun.

Please note that these components are using a modified version of table-checkbox.service.ts named table-checkbox-modified.service.ts. This is to allow gradual work and testing without functionally breaking all remaining tables. This modified version will then replace the original and all tables will go back to using that one.

The goal of the improvements is to achieve the following:

  • Selected items are cached when you change pages
  • Bulk operations are executed just for displayed data
  • Selection is restored from the cache on changing items per page and sorting
  • Master toggle (and its state) corresponds just to the state on the current page
  • The whole selection is cleared when any filter is applied
  • Server-side and client-side pagination behave exactly the same

Once the functional improvements are finished, new UI element needs to be added that will communicate with the user what they are working with at given moment. (That may be information about the number of selected items reflecting the number on current page only displayed in a neat way, or something completely different, should a better idea emerge)

NOTE: This is a continuation/rework of work started in !1520. Though there have been significant changes to tables since it has been opened.

How to test

Check if all points of the desired functionality are fulfilled, ideally for every table.

Author's checklist

  • I have followed the contribution guidelines
  • This MR has been tested or does not change functionality
  • I have added relevant merge request dependencies (if this MR has any)
  • I have added the correct labels
  • I have assigned reviewers (if any are relevant)
  • I have edited the documentation (if the changes require it) or I have noted the need for the change if I do not have access to the documentation
  • I have marked all introduced BREAKING CHANGES or necessary DEPLOYMENT NOTES in the commit message(s)

Reviewer's checklist

  • This MR has been tested or does not change functionality
  • This MR has correct commit message format

Closes STR-1145

Merge request reports