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

refactor: datasets, pagination, empty states #855

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

alexfreska
Copy link
Member

@alexfreska alexfreska commented Dec 13, 2024

Overview

  • This PR cleans up "dataset" related code and makes it consistent across all apps in terms of prop names, pagination (marker and offset), and empty state handling.
  • These changes fix some related bugs along the way such as with paginating the files and uploads and adding missing empty states for all data tables.
  • The PR largely consists of applying identical changes across all dataset instances.
  • The term "dataset" is used to refer to collections of data, some datasets are filtered and paginated on the server others on the client.

Changes

  • Refactored useDatasetState to include a noneOnPage state, a renamed loaded state, and a more explicit API.
  • Added EmptyState component for handling all dataset empty states with custom or default components.
  • Data tables now show an empty state when viewing a page greater than the first page with no data.
  • Added maybeFromNullishArrayResponse for casting null empty array responses to [].
  • PaginationMarker now takes an explicit nextMarker and also an optional marker. If the current marker is not passed at all, previous page navigation is always enabled.
  • Fixed a bug where pagination did now work on the file explorer.
  • Fixed a bug where pagination did now work on the file uploads list.
  • Host and contract responses are now Nullable rather than Maybe, since empty responses return null.
  • Fixed a bug where the transaction list would show pending transactions when viewing pages other than the first page.

Copy link

vercel bot commented Dec 13, 2024

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

Name Status Preview Comments Updated (UTC)
hostd ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 20, 2024 6:44pm
renterd ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 20, 2024 6:44pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
explorer ⬜️ Ignored (Inspect) Visit Preview Dec 20, 2024 6:44pm
explorer-zen ⬜️ Ignored (Inspect) Visit Preview Dec 20, 2024 6:44pm
website ⬜️ Ignored (Inspect) Visit Preview Dec 20, 2024 6:44pm

Copy link

changeset-bot bot commented Dec 13, 2024

🦋 Changeset detected

Latest commit: a493daf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@siafoundation/renterd-types Patch
hostd Minor
renterd Minor
walletd Minor
@siafoundation/react-core Minor
@siafoundation/design-system Minor
@siafoundation/renterd-js Patch
@siafoundation/renterd-react Patch
@siafoundation/e2e Patch
@siafoundation/clusterd Patch

Not sure what this means? Click here to learn what changesets are.

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

Copy link
Member Author

alexfreska commented Dec 13, 2024

@alexfreska alexfreska force-pushed the refactor_dataset_and_datastate branch from c4dee5a to a5daa68 Compare December 16, 2024 14:54
@alexfreska alexfreska force-pushed the refactor_dataset_and_datastate branch from f268fe3 to 72997dd Compare December 16, 2024 18:23
@alexfreska alexfreska force-pushed the refactor_dataset_and_datastate branch from 72997dd to 5be2058 Compare December 16, 2024 18:35
@alexfreska alexfreska force-pushed the refactor_dataset_and_datastate branch from 5be2058 to e15f47a Compare December 17, 2024 15:25
@alexfreska alexfreska force-pushed the refactor_dataset_and_datastate branch from e15f47a to 0cfd7b4 Compare December 17, 2024 15:36
@alexfreska alexfreska force-pushed the refactor_dataset_and_datastate branch from 0cfd7b4 to a3e8cf3 Compare December 19, 2024 20:05
@alexfreska alexfreska changed the base branch from main to fix_renterd_files_copy_metadata December 19, 2024 20:05
@alexfreska alexfreska force-pushed the refactor_dataset_and_datastate branch from a3e8cf3 to e55ecbc Compare December 19, 2024 20:10
@alexfreska alexfreska force-pushed the fix_renterd_files_copy_metadata branch from 53c4c5f to d4173ff Compare December 19, 2024 20:27
@alexfreska alexfreska force-pushed the refactor_dataset_and_datastate branch from e4130b4 to 53755b1 Compare December 19, 2024 20:52
@alexfreska alexfreska changed the base branch from graphite-base/855 to main December 19, 2024 20:53
@alexfreska alexfreska force-pushed the refactor_dataset_and_datastate branch from 53755b1 to 18f6d61 Compare December 19, 2024 20:53
@alexfreska alexfreska force-pushed the refactor_dataset_and_datastate branch from 18f6d61 to ab7ee70 Compare December 20, 2024 14:16
@alexfreska alexfreska requested a review from peterjan December 20, 2024 16:21
@alexfreska alexfreska force-pushed the refactor_dataset_and_datastate branch from ab7ee70 to b06387c Compare December 20, 2024 16:31
@alexfreska alexfreska changed the base branch from main to refactor_renterd_contracts_no_longer_provide_hostip December 20, 2024 16:31
@alexfreska alexfreska force-pushed the refactor_renterd_contracts_no_longer_provide_hostip branch from 89ef077 to f540538 Compare December 20, 2024 17:24
@alexfreska alexfreska force-pushed the refactor_dataset_and_datastate branch from b06387c to c6f5a05 Compare December 20, 2024 17:24
Copy link
Member

@peterjan peterjan left a comment

Choose a reason for hiding this comment

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

🚀

Copy link
Member Author

alexfreska commented Dec 20, 2024

Merge activity

  • Dec 20, 12:54 PM EST: A user started a stack merge that includes this pull request via Graphite.
  • Dec 20, 12:56 PM EST: Graphite rebased this pull request as part of a merge.
  • Dec 20, 12:57 PM EST: A user merged this pull request with Graphite.

@alexfreska alexfreska changed the base branch from refactor_renterd_contracts_no_longer_provide_hostip to graphite-base/855 December 20, 2024 17:54
@alexfreska alexfreska changed the base branch from graphite-base/855 to main December 20, 2024 17:54
@alexfreska alexfreska force-pushed the refactor_dataset_and_datastate branch from c6f5a05 to a493daf Compare December 20, 2024 17:55
@alexfreska alexfreska merged commit b7e5ea1 into main Dec 20, 2024
10 of 33 checks passed
@alexfreska alexfreska deleted the refactor_dataset_and_datastate branch December 20, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants