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 authored Feb 9, 2018
2 parents 1058a36 + 43eefe8 commit 7c7464c
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, this.props.smallRow && styles.table__th_smallRow)]: 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)}
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 @@ -297,6 +297,7 @@ class LedgerTable extends ImmutableComponent {
fillAvailable
smallRow
headings={['', 'publisher', 'include', 'views', 'timeSpent', 'percentage', 'actions']}
nonSortableColumns={['actions']}
defaultHeading='percentage'
defaultHeadingSortOrder='desc'
headerStyles={styles.header}
Expand Down

0 comments on commit 7c7464c

Please sign in to comment.