-
Notifications
You must be signed in to change notification settings - Fork 90
feat(bulkselection): ListView - Created bulk selection component #742
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
Conversation
@serenamarie125 , Here is the bulk selection component that is functioning as discussed. I don't know what the process for UX review and approval is in this repo but could you help me figure out how to get this reviewed? |
For some reason the screenshot video is not truly showing the color right but partially selected and select all states use @color-pf-blue-400 when the states happen.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeff-phillips-18 @dtaylor113 although there isn't an "official design pattern" for bulk selection yet, it is in progress. @jennyhaines @mcarrano please take a peak here for a quick review from a UX/Visuals side
https://docs.google.com/document/d/1gtDUMASD2dc8G2A82i0lYBjaSxFBw34-65TuilDQjHQ/edit?usp=sharing
@chalettu is it possible to add still screenshots showing that states of the icon in the bulk selector? Jut want to make sure that it matches - here are the high fidelity mocks |
@chalettu thanks, this looks great! I do have two questions but I think they are more design related so may need @mcarrano to chime in. Curious if the checkbox is too small, because it seems too difficult to click the checkbox without clicking the dropdown. Also unsure if we need the dropdown for cases where there are no other options available other than select all/none, but fine either way. |
} | ||
}; | ||
ctrl.$doCheck = function () { | ||
var recordsSelectedCount = ctrl.totalRecords - ctrl.selectedRecordCount; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable is a little confusing and is too similar to ctrl.selectedRecordCount
. Perhaps a better name would be unselectedRecordsCount
.
active = element.find('.active'); | ||
expect(active.length).toBe(1); | ||
}); | ||
it ('should have bulk selection menu shown', function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appreciate the unit tests! :-)
I'm not sure how tricky it is to do, but I think it's important that the selector be moved further left so that all the checkboxes align. The visual line created by those will make its functionality a lot more clear. |
If I apply a fitter (Ex: Name='F'), then 'All' from the dropdown, it only selects rows shown by the filter. The dropdown icon is 'All/checkmark' in this state. Wondering if we want either: -thanks |
This looks good. In answer to your question @beanh66 , while having the dropdown, even when the only choices are Select All and None, is indeed redundant, we felt this was necessary to make it clear what's happening here. I did not feel like just a checkbox inside a button would be very intuitive on it's own. Unlike for tables, the checkbox is a bit removed from the column headers here. @dtaylor113 raises a good question about how this interacts with filtering. I was assuming that the selection only applied to what's currently loaded into the view, but maybe that's not the right answer. What do we do for tables? It's exactly the same use case. If I select all rows in a table and a filter is applied, does it select items that are filtered from the table? I wouldn't expect it to. |
@mcarrano the table's 'Select All' checkbox does only select the filtered rows. From patternfly.org Table View design: "Select All Rows: Selecting the checkbox in the header row selects all rows on the page. The total number of rows selected is shown near the table action buttons." 'select all rows on the page' <--- this even applies to Pagination. If I am only showing 5 records per page and click 'Select All' checkbox, it only selects the 5 rows on the current page. |
@dtaylor113 Thanks for the additional clarification. A couple of thoughts... 1- I don't think the Bulk Selector should apply in Table View as it does become redundant with the built in table selection. 2- I had forgotten about this whole business with whether select all applies to items outside the current page. I think we need to remain consistent with what we had decided earlier for Table View. But maybe this is a case where we can use the menu to allow an option to select everything (whether in view or not). @serenamarie125 what do you think? |
So I believe the bulk selector is correct irt. filtering and pagination, at least it is mirroring what the table's 'Select All' checkbox is doing. I'm still questioning whether both should be available in the table view. Ok, I see @mcarrano's feedback above about this question, 1 vote for not showing bulk selector in table view. |
agreed that we don't show it in our current table view implementation |
@chalettu ah, yes the checkbox in the selector should be aligned with the checkbox in the list view. Good find everyone! |
@chalettu, we do this already for the Sort button which we do not show in TableView because we use the table column headers to do sorting. Pattern should be very similar for the bulk selector: https://github.com/patternfly/angular-patternfly/blob/master/src/toolbars/examples/toolbar.js#L340 |
Wanted to call attention to a related conversation that is happening in the design repo here: patternfly/patternfly-design#684 regarding the intermediate state of the checkbox. I am recommending that we remove that state from the design as it would require us to create a custom checkbox in Core which we don't want to do. In this case, the bulk selector would show the checked state when all are selected and unchecked if no selection or partial selection. Clicking the checkbox would toggle between all and none selected as it does currently for the Table. There is currently a design PR in progress that will need to be updated. |
Hi @chalettu, this PR is very close to the recently added Bulk Selector component: https://www.patternfly.org/pattern-library/forms-and-controls/bulk-selector/# I only see a few visual differences:
The other issue is that this bulk selector component should be hidden when used with the TableView: Just curious, are you still working on this PR?
|
This is a component that goes along with a toolbar to allow for select all/ select none and partial select of lists of data.