Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #13076 from ryanml/non-sortable-tables-prop
Browse files Browse the repository at this point in the history
Disables Action column header in ledger payments table
  • Loading branch information
NejcZdovc committed Feb 9, 2018
1 parent b545d61 commit 0129cea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/renderer/components/common/sortableTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,8 @@ class SortableTable extends React.Component {
[css(styles.table__th)]: true
}
const isString = typeof heading === 'string'
const sortMethod = this.sortingDisabled ? 'none' : (dataType === 'number' ? 'number' : undefined)
const nonSortableColumns = this.props.nonSortableColumns ? this.props.nonSortableColumns : []
const sortMethod = (this.sortingDisabled || nonSortableColumns.includes(heading)) ? 'none' : (dataType === 'number' ? 'number' : undefined)
if (isString) headerClasses['heading-' + heading] = true
return <th className={cx(headerClasses)}
data-sort-method={sortMethod}
Expand Down
1 change: 1 addition & 0 deletions app/renderer/components/preferences/payment/ledgerTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ class LedgerTable extends ImmutableComponent {
fillAvailable
smallRow
headings={['', 'publisher', 'include', 'views', 'timeSpent', 'percentage', 'actions']}
nonSortableColumns={['actions']}
defaultHeading='percentage'
defaultHeadingSortOrder='desc'
headerClassNames={css(styles.tableTh)}
Expand Down

0 comments on commit 0129cea

Please sign in to comment.