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

New feature : Csv Export #2273

Closed
wants to merge 13 commits into from
Closed

New feature : Csv Export #2273

wants to merge 13 commits into from

Conversation

Ajeett01
Copy link
Contributor

@Ajeett01 Ajeett01 commented Jul 1, 2024

Description

Relates to issue: ZEUS-#1467

package.json Outdated
@@ -31,6 +31,7 @@
"fetch-libraries": "bash fetch-libraries.sh"
},
"dependencies": {
"@json2csv/plainjs": "^7.0.6",
Copy link
Contributor

@shubhamkmr04 shubhamkmr04 Jul 8, 2024

Choose a reason for hiding this comment

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

Lock the version here (remove ^ and run yarn again)

package.json Outdated
@@ -156,6 +157,7 @@
"@babel/plugin-proposal-nullish-coalescing-operator": "7.18.6",
"@babel/plugin-proposal-optional-chaining": "7.21.0",
"@babel/plugin-transform-arrow-functions": "7.22.5",
"@babel/plugin-transform-export-namespace-from": "^7.24.7",
Copy link
Contributor

Choose a reason for hiding this comment

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

here too

@shubhamkmr04
Copy link
Contributor

We might have to change the file name from JsonToCsv.tsx to something else.
@kaloudis your thoughts?

onChangeText={setCustomFileName}
/>
<View>
<Button title="Download CSV" onPress={downloadCsv} />
Copy link
Contributor

@kaloudis kaloudis Jul 8, 2024

Choose a reason for hiding this comment

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

this needs to be localized

Copy link
Contributor

Choose a reason for hiding this comment

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

@Ajeett01 look through locale files and add your used strings here

@kaloudis
Copy link
Contributor

kaloudis commented Jul 8, 2024

We might have to change the file name from JsonToCsv.tsx to something else. @kaloudis your thoughts?

ActivityToCsv, perhaps?

@shubhamkmr04
Copy link
Contributor

We might have to change the file name from JsonToCsv.tsx to something else. @kaloudis your thoughts?

ActivityToCsv, perhaps?

Yup we can, or maybe ImportActivity, lets iterate on that

type="feather"
color={themeColor('text')}
underlayColor="transparent"
size={30}
Copy link
Contributor

Choose a reason for hiding this comment

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

adjust the download icon size here as compared to filter and cross icons

Copy link
Contributor

@shubhamkmr04 shubhamkmr04 left a comment

Choose a reason for hiding this comment

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

Screenshot 2024-07-08 at 2 41 38 PM
  • Update the theme of 'Download csv' and 'close` button (try what would look better and how we have used that in other places)
  • they should cover the full width like the input box

'react-native-reanimated/plugin',
['@babel/plugin-transform-export-namespace-from']
]
Copy link
Contributor

Choose a reason for hiding this comment

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

why have we added that?

Copy link
Contributor

Choose a reason for hiding this comment

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

I am curious about this too

if (!csv) return;

try {
if (Platform.OS === 'android') {
Copy link
Contributor

Choose a reason for hiding this comment

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

we are not yet handling the downloading for iOS right ?

'cltv_expiry',
'creation_date',
'expiry'
];
Copy link
Contributor

Choose a reason for hiding this comment

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

@kaloudis would these keys be good to download in our csv data?

Copy link
Contributor

Choose a reason for hiding this comment

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

these look ok, definitely need to flesh them out though

@kaloudis kaloudis added this to the v0.9.1 milestone Jul 18, 2024
message: 'This app needs access to your storage to save CSV files',
buttonNeutral: 'Ask Me Later',
buttonNegative: 'Cancel',
buttonPositive: 'OK'
Copy link
Contributor

Choose a reason for hiding this comment

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

We should localize these strings

@shubhamkmr04
Copy link
Contributor

@Ajeett01 We need to fix failing check on the latest commit

@Ajeett01 Ajeett01 force-pushed the csv-export branch 2 times, most recently from a03c80a to 1ea2ac2 Compare September 3, 2024 09:53
@Ajeett01 Ajeett01 marked this pull request as ready for review September 4, 2024 12:32
)
.join('\n');

return `Transaction Section\n${header}\n${rows}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be localized

'',
'',
'Expiry'
].join(',');
Copy link
Contributor

Choose a reason for hiding this comment

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

these should be localized

].join(',');

const invoiceSection = [
'Invoice Section',
Copy link
Contributor

Choose a reason for hiding this comment

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

this needs localization

].join('\n');

const paymentSection = [
'Payment Section',
Copy link
Contributor

Choose a reason for hiding this comment

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

this needs localization

const { filteredActivity } = ActivityStore;

if (!startDate || !endDate) {
Alert.alert('Error', 'Please select Start and End date.');
Copy link
Contributor

Choose a reason for hiding this comment

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

this needs localization

'react-native-reanimated/plugin',
['@babel/plugin-transform-export-namespace-from']
]
Copy link
Contributor

Choose a reason for hiding this comment

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

I am curious about this too

@kaloudis
Copy link
Contributor

closing in favor of #2436

@kaloudis kaloudis closed this Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants