Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Activity: CSV Export #2488

Merged
merged 18 commits into from
Nov 1, 2024
Merged

[feature] Activity: CSV Export #2488

merged 18 commits into from
Nov 1, 2024

Conversation

kaloudis
Copy link
Contributor

Description

Relates to issue: ZEUS-1467

@kaloudis kaloudis added the Activity Activity view label Oct 23, 2024
@kaloudis kaloudis added this to the v0.9.2 milestone Oct 23, 2024
@kaloudis kaloudis changed the title Activity: CSV Export [feature] Activity: CSV Export Oct 23, 2024
@kaloudis kaloudis marked this pull request as ready for review October 27, 2024 15:29
@myxmaster
Copy link
Contributor

Nice work! A few thoughts:

  1. Exported csv filename should start with something like Zeus_activity-export_... instead of data_....
  2. Would "On-chain" and "Lightning" be more comprehensible than "Transaction" and "Payment"?
  3. Either way, stick with singular (or plural) consequently (right now everything is singular, but 1st line in payment csv-file is "Payments").
  4. Creation Date / Timestamp field contains , chars itself but also space chars after each , -> one of those should be removed before written to csv, otherwise post processing of csv data will create extra work.

@myxmaster
Copy link
Contributor

Oh and what about exporting notes as well?

@myxmaster
Copy link
Contributor

There are 2 commas before the timestamp (in both, ln and onchain csv):

Payments
Destination,Payment Hash,Value,Note,Creation Date
02a3eda67c8b28d94c01605b0b73f8b8d6f6905135bd9bf5e9c77b26be68658837,ca94af0cd8c58d509a75a0928d668d749c6a3813ea52a4701fbcd5b737fa6535,200000,,Thu Oct 24 2024 10:39:23 GMT+0000

Else, edge case for notes: they can contain a comma char itself. so we should export notes in qoutes: ""
Typically csv interpreters understand that and import it into 1 field then.

nit: the csv files still start with "Payments" vs. "Transaction"

@myxmaster
Copy link
Contributor

Expiry in invoices.csv also has a comma, but I think we should export "Original Expiry" (e.g. 1 hour) anyways, not "Time until Expiry" (e.g. 59 minutes, 24 seconds).

Amount Paid (sat),Note,Creation Date,Expiry
21000,"Note, with comma",Thu Oct 31 2024 00:26:48 GMT+0000,59 minutes, 35 seconds

The 2 commas are still there (in case no note is exported).

@kaloudis kaloudis force-pushed the activity-csv branch 2 times, most recently from 1cb0837 to 723295f Compare October 31, 2024 00:45
@myxmaster
Copy link
Contributor

My bad, the 2 commas totally make sense of course, because the data always has to match the headlines and in case there is no note the 2 commas will lead to an empty "note" field when importing the csv to e.g. Excel.

But you now put everything in quotes, not sure why, I think that is unneeded.

@kaloudis
Copy link
Contributor Author

My bad, the 2 commas totally make sense of course, because the data always has to match the headlines and in case there is no note the 2 commas will lead to an empty "note" field when importing the csv to e.g. Excel.

But you now put everything in quotes, not sure why, I think that is unneeded.

Excel, Numbers etc should be able to grok out the values with quotes in place.

closeModal();
} catch (err) {
console.error(
localeString('views.ActivityToCsv.csvDownloadFailed'),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

don't need to localize this if it's only used for console errors

This comment was marked as off-topic.

@kaloudis kaloudis merged commit e18da24 into master Nov 1, 2024
4 checks passed
@kaloudis kaloudis deleted the activity-csv branch November 1, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Activity Activity view
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants