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

Table Row Selection #4638

Merged
merged 23 commits into from
Mar 1, 2022
Merged

Table Row Selection #4638

merged 23 commits into from
Mar 1, 2022

Conversation

PClmnt
Copy link
Collaborator

@PClmnt PClmnt commented Feb 22, 2022

Description

This PR adds the ability to select / multi-select a number of rows in a table and use them in bindings. This will allow cool stuff like the exporting of specific table in a data, or you could select a number of rows and pass them to automations using a button action etc. Stuff like that.

You can enable this feature by clicking this checkbox in the Table settings

image

A couple of changes have been made to the BBUI table component in order to enable this. There was an already the ability to select rows in the data tab, but you lost your selection every time you navigated to a new page, this PR fixes that and your selection is maintained over whatever amount of pages you have in the table.

Also new is the Checkbox used to select all rows on your current page (just added to the top left corner like here: https://spectrum.adobe.com/page/table/). This Checkbox will only select the rows on that page, not for the entire table. There's a little bit of hacky code in here as well, that basically ensures the Checkbox deselects when you navigate to a new page with no rows. The functuionality around this is never going to be perfect, essentially because the table has no idea what page it is as Pagination is a separate area altogether.

You can also see in the below screenshot that a row count has been added, just to keep track of what size your currrent selection is.
image

To allow for the handling of multiple tables, each selection is shown in the binding drawer like so

Screenshots

Screenshot 2022-02-22 at 15 16 30

Each of these are just an array of Row IDs.

Updates

A few quick updates made after review:

  • Readable bindings are now called "Selected rows"
  • Row selection bindings are added for table blocks too
  • The text saying "X record(s) selected" has been updated to "X rows selected" (with optional "s") and is only shown now when rows are actually selected, and is not absolutely positioned to avoid being hidden due to overflow
  • Data bindings are only generated for tables in the current asset

@codecov-commenter
Copy link

codecov-commenter commented Feb 22, 2022

Codecov Report

Merging #4638 (0338e8c) into develop (b28d69e) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #4638   +/-   ##
========================================
  Coverage    67.91%   67.91%           
========================================
  Files          144      144           
  Lines         4922     4922           
  Branches       761      761           
========================================
  Hits          3343     3343           
  Misses        1105     1105           
  Partials       474      474           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3249129...0338e8c. Read the comment docs.

Copy link
Member

@aptkingston aptkingston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff Peter! Trying to get these cypress tests to pass and then let's get this merged.

@PClmnt PClmnt merged commit 9931dec into develop Mar 1, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Mar 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants