Skip to content

[Dashboard] Abstract code for CSV upload form #5324

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

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

kien-ngo
Copy link
Contributor

@kien-ngo kien-ngo commented Nov 6, 2024

DASH-372


PR-Codex overview

This PR focuses on refactoring the AirdropUpload and SnapshotUpload components to utilize a new useCsvUpload hook for handling CSV uploads and data processing. It also introduces a new CsvDataTable component for displaying data in a tabular format.

Detailed summary

  • Added useCsvUpload hook for handling CSV uploads.
  • Introduced CsvDataTable for rendering tabular data.
  • Refactored AirdropUpload to use useCsvUpload and CsvDataTable.
  • Simplified CSV parsing and validation logic.
  • Removed redundant code related to address validation.
  • Updated SnapshotUpload similarly to AirdropUpload.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@vercel vercel bot temporarily deployed to Preview – docs-v2 November 6, 2024 15:39 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui November 6, 2024 15:39 Inactive
Copy link

vercel bot commented Nov 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 7, 2024 3:56pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 7, 2024 3:56pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Skipped (Inspect) Nov 7, 2024 3:56pm
wallet-ui ⬜️ Skipped (Inspect) Nov 7, 2024 3:56pm

Copy link

changeset-bot bot commented Nov 6, 2024

⚠️ No Changeset found

Latest commit: 5216bef

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel vercel bot temporarily deployed to Preview – thirdweb_playground November 6, 2024 15:39 Inactive
Copy link
Contributor

graphite-app bot commented Nov 6, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

Copy link
Contributor Author

kien-ngo commented Nov 6, 2024

@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Nov 6, 2024
@kien-ngo kien-ngo changed the title update [Dashboard] Abstract code for CSV upload form Nov 6, 2024
@kien-ngo kien-ngo marked this pull request as ready for review November 6, 2024 15:39
Copy link
Contributor

github-actions bot commented Nov 6, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 43 KB (0%) 861 ms (0%) 217 ms (+80.38% 🔺) 1.1 s
thirdweb (cjs) 103.05 KB (0%) 2.1 s (0%) 316 ms (-11.39% 🔽) 2.4 s
thirdweb (minimal + tree-shaking) 4.85 KB (0%) 97 ms (0%) 13 ms (+82.47% 🔺) 110 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 12 ms (+387.29% 🔺) 22 ms
thirdweb/react (minimal + tree-shaking) 17.56 KB (0%) 352 ms (0%) 51 ms (+116.06% 🔺) 402 ms

previousPage,
setPageSize,
state: { pageIndex, pageSize },
} = useTable(
Copy link
Member

Choose a reason for hiding this comment

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

if we're updating this component lets please update this to tanstack table while we're at it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. I'll stack up the PRs

@kien-ngo kien-ngo force-pushed the kien/snapshot-upload branch from 9df1a71 to 888a5cf Compare November 6, 2024 23:57
@kien-ngo kien-ngo requested a review from gregfromstl as a code owner November 6, 2024 23:57
@vercel vercel bot temporarily deployed to Preview – docs-v2 November 6, 2024 23:57 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui November 6, 2024 23:57 Inactive
@github-actions github-actions bot added the Playground Changes involving the Playground codebase. label Nov 6, 2024
Copy link

codecov bot commented Nov 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 45.76%. Comparing base (f81c1af) to head (5216bef).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5324   +/-   ##
=======================================
  Coverage   45.76%   45.76%           
=======================================
  Files        1069     1069           
  Lines       55606    55606           
  Branches     4073     4073           
=======================================
  Hits        25448    25448           
  Misses      29469    29469           
  Partials      689      689           
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from f81c1af
packages 40.91% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

Copy link
Contributor

graphite-app bot commented Nov 7, 2024

Merge activity

  • Nov 7, 12:42 AM EST: A user added this pull request to the Graphite merge queue.
  • Nov 7, 12:52 AM EST: The Graphite merge queue couldn't merge this PR because it was not satisfying all requirements (Failed CI: 'Vercel – thirdweb-www').
  • Nov 7, 11:05 AM EST: A user added this pull request to the Graphite merge queue.
  • Nov 7, 11:05 AM EST: A user merged this pull request with the Graphite merge queue.

kien-ngo added a commit that referenced this pull request Nov 7, 2024
DASH-372

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on enhancing the CSV upload functionality by refactoring components to use a new `useCsvUpload` hook, which centralizes CSV processing logic. It introduces a `CsvDataTable` component for displaying data and improves address validation in the airdrop and snapshot upload processes.

### Detailed summary
- Introduced `CsvDataTable` component for displaying CSV data.
- Refactored `AirdropUpload` and `SnapshotUpload` to use `useCsvUpload` hook.
- Centralized CSV parsing logic in `csvParser` functions.
- Improved address validation and error handling in CSV uploads.
- Removed redundant address checking functions from `AirdropUpload` and `SnapshotUpload`.
- Enhanced pagination and UI updates in CSV data tables.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
@kien-ngo kien-ngo force-pushed the kien/snapshot-upload branch from 884d513 to 039d39a Compare November 7, 2024 05:43
@vercel vercel bot temporarily deployed to Preview – docs-v2 November 7, 2024 05:44 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui November 7, 2024 05:44 Inactive
DASH-372

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on enhancing the CSV upload functionality by refactoring components to use a new `useCsvUpload` hook, which centralizes CSV processing logic. It introduces a `CsvDataTable` component for displaying data and improves address validation in the airdrop and snapshot upload processes.

### Detailed summary
- Introduced `CsvDataTable` component for displaying CSV data.
- Refactored `AirdropUpload` and `SnapshotUpload` to use `useCsvUpload` hook.
- Centralized CSV parsing logic in `csvParser` functions.
- Improved address validation and error handling in CSV uploads.
- Removed redundant address checking functions from `AirdropUpload` and `SnapshotUpload`.
- Enhanced pagination and UI updates in CSV data tables.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dashboard Involves changes to the Dashboard. Playground Changes involving the Playground codebase.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants