Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TableList improvements (Graylog2#4579)
* Show count of selected items in header This provides some feedback when users select items in the list. * Show header actions also if 1 element is selected This is not different than the case when user selects two or more elements and it makes easier to figure out what the UI does. * Wrap TableList bulk actions inside component Until now we positioned the individual actions inside the component but not the bulk actions. Moving it inside the component makes it more consistent. * Update selection when filter changes When some items are selected, changes in the filter should also affect the selection, deselecting items that are filtered out from the list. selection * Improve select all selection - Set the select all checkbox as indeterminate when some but not all items are checked - Remove the select all checked status from the component state * Extract function recalculating selected items Make clearer how we recalculate selected items on filter change by extracting the code into a function. * Correct data passed to TypeAheadDataFilter We require the items prop to be an instance of `Immutable.List`, but the code doesn't treat it like that. This commit ensures we convert the list back to a JS array before using it in the filter. * Refactor code in componentDidUpdate Move code setting the "select all" checkbox status to indeterminate into its own function. * Disable "select all" checkbox if there's no data * Do not hide filter and header when no data Having no items to display should not hide UI elements from the view. * Update filters and selections when items change * Enable users to filter data from TableList header When no elements are selected, display filter elements that may filter the data outside of the component. * Add prop to hide TableList filter * Add ControlledTableList This is meant to provide a more customizable UI, only providing the basis to build a TableList. * Move styling to a better place * Wrap string headers Ensure giving a string header is displayed properly. Consumers providing their own nodes must do this on their own. * Render TableList using ControlledTableList * Remove unused ControlledTableList.css * Remove headerFiltersFactory We need this functionality but the `TableList` component is becoming more complicated. In the end, consumers needing a fully customizable `TableList` should use `ControlledTableList` and customize the components as needed on a case by case basis. * Rename headerActionsFactory with bulkActionsFactory That makes clearer what the prop is for, in the end where elements are rendered is an implementation detail. * Add prop to disable bulk actions This also removes checkboxes from items, since there is no need for selecting them when actions can only affect an element. * Use consistent naming for enable/disable flags Rename `isFilterEnabled` to `enableFilter`. * Use all space available for filter In certain screen sizes the filter buttons cannot fit on its column. As we currently don't use the space after the filter, here we take all available space to ensure the filter buttons will be aligned with the input. * Add more specificity to group header style * Adapt PermissionSelector to changes in TableList * Correct description after problem with conflict After merge-conflicts, the description was duplicated. * Disable bulk actions in TokenList * Update test snapshots * Ensure we pass Immutable JS lists down * Fix ImmutableJS proptypes checking
- Loading branch information