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

Disables Action column header in ledger payments table #13076

Merged
merged 1 commit into from
Feb 9, 2018
Merged

Disables Action column header in ledger payments table #13076

merged 1 commit into from
Feb 9, 2018

Conversation

ryanml
Copy link
Contributor

@ryanml ryanml commented Feb 9, 2018

Resolves #13074

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed. (Ask a Brave employee to help if you cannot access this document.)

Test Plan:

Ensure that the Actions column on the ledger table in about:preferences#payments is neither clickable nor sortable.

Ensure that other implementations of the SortableTable such as on about:history work as expected without error.

Reviewer Checklist:

  • Request a security/privacy review as needed if one was not already requested.

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header

As opposed to hard coding in something to exclude the Actions column from being clickable/sortable, I thought it would be helpful to have a nonSortableColumns property on the component for future column exclusions as more tables may be added. It is implemented in such away that not having the property does not break anything or produce any unexpected behavior.

@ryanml
Copy link
Contributor Author

ryanml commented Feb 9, 2018

@NejcZdovc let me know how this looks, and if hard coding would be preferable in this case

Simplest solution there would be doing data-sort-method={heading === 'actions' ? 'none' : sortMethod} in the render() method of the sortable table. I think my requested change is more helpful for the future though.

:) Thanks

@codecov-io
Copy link

codecov-io commented Feb 9, 2018

Codecov Report

Merging #13076 into master will increase coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master   #13076      +/-   ##
==========================================
+ Coverage   56.21%   56.22%   +<.01%     
==========================================
  Files         280      280              
  Lines       27521    27522       +1     
  Branches     4486     4487       +1     
==========================================
+ Hits        15471    15473       +2     
+ Misses      12050    12049       -1
Flag Coverage Δ
#unittest 56.22% <100%> (ø) ⬆️
Impacted Files Coverage Δ
...erer/components/preferences/payment/ledgerTable.js 87.75% <ø> (ø) ⬆️
app/renderer/components/common/sortableTable.js 62.11% <100%> (+0.42%) ⬆️

@NejcZdovc NejcZdovc self-requested a review February 9, 2018 07:20
@NejcZdovc NejcZdovc changed the title Fixing Issue #13074, allows for non sortable columns, excluding the A… Disables Action column header in ledger payments table Feb 9, 2018
@NejcZdovc NejcZdovc added this to the 0.21.x (Beta Channel) milestone Feb 9, 2018
Copy link
Contributor

@NejcZdovc NejcZdovc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++ Your approach is for sure more elegant, because we can reuse this in other tables. Great job 👍

@NejcZdovc NejcZdovc merged commit 7c7464c into brave:master Feb 9, 2018
NejcZdovc added a commit that referenced this pull request Feb 9, 2018
Disables Action column header in ledger payments table
@NejcZdovc
Copy link
Contributor

NejcZdovc commented Feb 9, 2018

master 7c7464c
0.22 557f51c
0.21 0129cea

NejcZdovc added a commit that referenced this pull request Feb 9, 2018
Disables Action column header in ledger payments table
@ryanml
Copy link
Contributor Author

ryanml commented Feb 9, 2018

Awesome! Thanks @NejcZdovc :)

@NejcZdovc NejcZdovc modified the milestones: 0.21.x (Beta Channel), 0.21.x (Twitch) Feb 24, 2018
@NejcZdovc
Copy link
Contributor

NejcZdovc commented Feb 24, 2018

0.21 twitch a04e202

NejcZdovc added a commit that referenced this pull request Feb 24, 2018
Disables Action column header in ledger payments table
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants