diff --git a/frontend/src/components/common/fixed-width-table.js b/frontend/src/components/common/fixed-width-table.js index 12fd4b11a2..953831fbcf 100644 --- a/frontend/src/components/common/fixed-width-table.js +++ b/frontend/src/components/common/fixed-width-table.js @@ -26,9 +26,19 @@ const FixedWidthTable = ({ className, headers, theadOptions = {}, children }) => {headers.map((header, index) => { - const { width, isFixed, children: thChildren, className } = header; - const validWidth = isFixed ? width : (containerWidth - fixedWidth) * width; - return ({thChildren}); + const { width, isFixed, className, onClick = () => {}, title = '', ariaLabel = '' } = header; + return ( + + {header.children} + + ); })} diff --git a/frontend/src/components/dirent-list-view/dirent-list-item.js b/frontend/src/components/dirent-list-view/dirent-list-item.js index a44a81abe2..badf3c0ee2 100644 --- a/frontend/src/components/dirent-list-view/dirent-list-item.js +++ b/frontend/src/components/dirent-list-view/dirent-list-item.js @@ -829,15 +829,19 @@ class DirentListItem extends React.Component { onMouseDown={this.onItemMouseDown} onContextMenu={this.onItemContextMenu} > - + {}} checked={isSelected} - aria-label={isSelected ? gettext('Unselect this item') : gettext('Select this item')} /> diff --git a/frontend/src/components/dirent-list-view/dirent-list-view.js b/frontend/src/components/dirent-list-view/dirent-list-view.js index e96365e503..18a410f43c 100644 --- a/frontend/src/components/dirent-list-view/dirent-list-view.js +++ b/frontend/src/components/dirent-list-view/dirent-list-view.js @@ -697,36 +697,52 @@ class DirentListView extends React.Component { ]; } - // sort - const sortByName = sortBy == 'name'; - const sortByTime = sortBy == 'time'; - const sortBySize = sortBy == 'size'; - const sortIcon = sortOrder == 'asc' ? : ; + const sortIcon = ; return [ - { isFixed: true, width: 31, className: 'pl10 pr-2', children: ( - - ) }, { + { isFixed: true, + width: 31, + className: 'pl10 pr-2 cursor-pointer', + title: this.props.isAllItemSelected ? gettext('Unselect all items') : gettext('Select all items'), + ariaLabel: this.props.isAllItemSelected ? gettext('Unselect all items') : gettext('Select all items'), + children: ( + + ), + onClick: (e) => { + e.stopPropagation(); + this.props.onAllItemSelected(); + } + }, + { isFixed: true, width: 32, className: 'pl-2 pr-2', // star - }, { + }, + { isFixed: true, width: 40, className: 'pl-2 pr-2', // icon - }, { - isFixed: false, width: 0.5, children: ({gettext('Name')} {sortByName && sortIcon}), - }, { + }, + { + isFixed: false, + width: 0.5, + children: ({gettext('Name')} {sortBy == 'name' && sortIcon}), + }, + { isFixed: false, width: 0.06, // tag - }, { + }, + { isFixed: false, width: 0.18, // operation - }, { - isFixed: false, width: 0.11, children: ({gettext('Size')} {sortBySize && sortIcon}) - }, { - isFixed: false, width: 0.15, children: ({gettext('Last Update')} {sortByTime && sortIcon}) + }, + { + isFixed: false, + width: 0.11, + children: ({gettext('Size')} {sortBy == 'size' && sortIcon}) + }, + { + isFixed: false, + width: 0.15, + children: ({gettext('Last Update')} {sortBy == 'time' && sortIcon}) } ]; }; @@ -736,7 +752,6 @@ class DirentListView extends React.Component { const isDesktop = Utils.isDesktop(); const repoEncrypted = this.props.currentRepoInfo.encrypted; - const headers = this.getHeaders(isDesktop); return (
0 && ( {direntList.map((dirent, index) => {