Fixed: Select all on Activity: Queue

This commit is contained in:
Mark McDowall 2019-02-19 17:54:57 -08:00
parent 9b212d11f0
commit 728c0e8272
2 changed files with 9 additions and 3 deletions

View File

@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import React, { Component } from 'react';
import hasDifferentItems from 'Utilities/Object/hasDifferentItems';
import getSelectedIds from 'Utilities/Table/getSelectedIds';
import removeOldSelectedState from 'Utilities/Table/removeOldSelectedState';
import selectAll from 'Utilities/Table/selectAll';
import toggleSelected from 'Utilities/Table/toggleSelected';
import { align, icons } from 'Helpers/Props';
@ -61,7 +62,10 @@ class Queue extends Component {
componentDidUpdate(prevProps) {
if (hasDifferentItems(prevProps.items, this.props.items)) {
this.setState({ selectedState: {} });
this.setState((state) => {
return removeOldSelectedState(state, prevProps.items);
});
return;
}

View File

@ -30,6 +30,7 @@ class TableHeaderCell extends Component {
const {
className,
name,
columnLabel,
isSortable,
isVisible,
isModifiable,
@ -49,10 +50,11 @@ class TableHeaderCell extends Component {
return (
isSortable ?
<Link
{...otherProps}
component="th"
className={className}
title={columnLabel}
onPress={this.onPress}
{...otherProps}
>
{children}
@ -75,7 +77,7 @@ class TableHeaderCell extends Component {
TableHeaderCell.propTypes = {
className: PropTypes.string,
name: PropTypes.string.isRequired,
label: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
columnLabel: PropTypes.string,
isSortable: PropTypes.bool,
isVisible: PropTypes.bool,
isModifiable: PropTypes.bool,