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

[BUG] - CSV Export uses an outdated pacakge - export-to-csv-fix-source-map #5317

Closed
vikavorkin opened this issue Nov 26, 2023 · 4 comments · Fixed by #5332
Closed

[BUG] - CSV Export uses an outdated pacakge - export-to-csv-fix-source-map #5317

vikavorkin opened this issue Nov 26, 2023 · 4 comments · Fixed by #5332
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@vikavorkin
Copy link
Contributor

Describe the bug

Current version of the export-to-csv package is export-to-csv-fix-source-map@0.2.1

This version has a bug where not all headers are exported and it depends on the first data item.

This issue affect @refinedev/core since useExport was added @ 8a115b5f

Steps To Reproduce

  1. Load a table with the following data
[
 {"field1":"foo"}, 
 {"field1":"bar", "field2": "baz"}
]
  1. Export a CSV using
    const { triggerExport, isLoading } = useExport<IVendor>({
        mapData: item => flatten(item),
        exportOptions: {
            showLabels: true,
            // There is an issue if the first item in the list is missing a keys, no column will be generated for them.
            // Manually defining the keys
            useKeysAsHeaders: false,
            headers: ["field1", "field2"]
        }
    });
  1. CSV will not contain "field2"

Expected behavior

Specifying the headers for the CSV should export all the headers without depending on the actual data for the keys.

Screenshot

No response

Desktop

No response

Mobile

No response

Additional Context

No response

@aliemir
Copy link
Member

aliemir commented Nov 27, 2023

Hey @vikavorkin, sorry for the issue! export-to-csv-fix-source-map was a fix for webpack back then, now it's most likely not needed. We can switch to export-to-csv and fix this issue. We'll be happy to accept your contribution if you want to open up a PR for this 🙏

@vikavorkin
Copy link
Contributor Author

Hi @aliemir, I will gladly open a PR, will take me some time to get to it.
The current parameters look to match the latest version so I expect no breaking changes.

Will update, thanks for the quick answer! 👍

@omeraplak omeraplak added the good first issue Good for newcomers label Nov 27, 2023
@omeraplak
Copy link
Member

omeraplak commented Nov 27, 2023

Hi @aliemir, I will gladly open a PR, will take me some time to get to it. The current parameters look to match the latest version so I expect no breaking changes.

Will update, thanks for the quick answer! 👍

Thank you, I have assigned the issue to you. You can take a look at our Contributing document at https://refine.dev/docs/contributing/

Copy link

stale bot commented Jan 26, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jan 26, 2024
@omeraplak omeraplak removed the wontfix This will not be worked on label Jan 26, 2024
@omeraplak omeraplak added this to the February Release milestone Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants