-
Notifications
You must be signed in to change notification settings - Fork 974
Payment history CSV receipt links #3477 (WIP) #4312
Conversation
for issue #3477 - Adds "Receipt Link" column to Payment History dialog - Clicking link opens CSV with 5 columns breaking down your contribution by Publisher: "Publisher","Votes","Fraction","BTC","USD" - depends on ledger-client changes NOT in master: see branch: https://github.com/willy-b/ledger-client/tree/support-browser-laptop-3477 specifically https://github.com/willy-b/ledger-client/commit/8c9e728de1f8f1b801dcba4baddc876f54c9167a
- link is now an <a> element - added an error check to OPEN_LEDGER_TRANSACTION_CSV handler in app/ledger.js for #3477
depends on a PR in ledger-client: brave/ledger-client#15 |
|
||
ipc.on(messages.OPEN_LEDGER_TRANSACTION_CSV, (event, viewingIds, csvFilename) => { | ||
if (client) { | ||
var txCsvText = client._getTransactionCSVText(viewingIds) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would replace all of the below with win.webContents.downloadURL(url)
, where url
is txCsvText
as a Blob object URL or perhaps a data URL. then the CSV file will be automatically written to the default downloads folder, and the user can click on the downloads bar to open it.
|
||
const win = electron.BrowserWindow.getFocusedWindow() | ||
if (win && win.webContents) { | ||
win.webContents.downloadURL(txCsvTextDataURI) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately there seems to be no way to specify the filename so it defaults to download.csv
. but i'm fine with merging this as-is and fixing the filename in a later issue. thanks!
@mrose17 this looks good to me to merge once ledger-client is updated. |
@willy-b i'm going to merge brave/ledger-client#15 and make a few changes, then push the new version. @diracdeltas - i will ping you when that is done so you can merge this PR. thanks! |
@diracdeltas - i have published ledger-client@0.8.78 - please update and commit as you see fit. thanks! |
fixing and rebasing this PR now |
+1 thanks! |
cherry-picked 7c44c28 |
thanks @diracdeltas & @mrose17! |
^^ tests on the way pending general review of this PR
git rebase -i
to squash commits (if needed).^^ will probably squash after adding tests
Test Plan:
Needs tests. Not sure if CSV export is desired in interim and so getting that feedback while writing tests to save time.