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

Fix CSV export #297

Merged
merged 3 commits into from
Apr 12, 2024
Merged

Fix CSV export #297

merged 3 commits into from
Apr 12, 2024

Conversation

kmcginnes
Copy link
Collaborator

Description

This type error was happening because when we call the accessor to get the cell data for the row we could be passing either the row data or a wrapper object that contains the row data in one of its properties.

Since no logic required any of the data in the row wrapper, it made sense to move the check of what type of data we have up a level. So I added a new map before the big map logic to make sure we always have the row data and not the wrapper.

Types

I updated the generic constraints across the board to match what React Table expects. This helped me find the issue with the row and row wrapper.

While these changes aren't necessary for the fix, I think they improve the code quality and will help find future issues.

Automated testing

This logic is super complicated and interwoven. I'd love to have it under some tests. But in the interest of time I haven't added any in this PR.

If we consider it important enough, we can add a new GitHub issue to add some tests as a follow up change.

Validation

  1. Open the browser's developer console
  2. Add a node to the graph
  3. Open the table view at the bottom
  4. Choose export with all columns selected
  5. Make sure the "Keep filtering and sorting" checkbox is checked
  6. Click "Export"
  7. See failure in the console

CleanShot 2024-04-11 at 16 36 41@2x

Related Issues

Check List

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I have run pnpm run checks to ensure code compiles and meets standards.
  • I have run pnpm run test to check if all tests are passing.
  • I've covered new added functionality with unit tests if necessary.

Copy link
Contributor

@vkagamlyk vkagamlyk left a comment

Choose a reason for hiding this comment

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

I tested locally, error is not reproduced

@vkagamlyk vkagamlyk merged commit 800ac88 into aws:main Apr 12, 2024
1 check passed
@kmcginnes kmcginnes deleted the fix-csv-export branch April 12, 2024 15:20
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.

2 participants