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

feat(tangle-dapp): Integrate Blueprints APIs #2575

Merged
merged 25 commits into from
Oct 2, 2024

Conversation

AtelyPham
Copy link
Member

@AtelyPham AtelyPham commented Sep 30, 2024

Summary of changes

Provide a detailed description of proposed changes.

  • Integrate blueprint APIs.
  • Resolve race condition in usePromise hook.
  • Correct item count on the last page of Pagination component.

Proposed area of change

Put an x in the boxes that apply.

  • apps/bridge-dapp
  • apps/hubble-stats
  • apps/stats-dapp
  • apps/tangle-dapp
  • apps/testnet-leaderboard
  • apps/faucet
  • apps/zk-explorer
  • libs/webb-ui-components

Reference issue to close (if applicable)

Specify any issues that can be closed from these changes (e.g. Closes #233).

Screen Recording

If possible provide a screen recording of proposed change.

CleanShot.2024-10-01.at.03.45.48.mp4

Display properly last page number of items on the Pagination component
fix #2571
Fixed race condition in `usePromise` hook causes state updates on unmounted components
fix #2574
Copy link

netlify bot commented Sep 30, 2024

Deploy Preview for tangle-dapp ready!

Name Link
🔨 Latest commit 334f1af
🔍 Latest deploy log https://app.netlify.com/sites/tangle-dapp/deploys/66fd19fb9ad8ca0008ecb803
😎 Deploy Preview https://deploy-preview-2575--tangle-dapp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@AtelyPham AtelyPham self-assigned this Oct 1, 2024
@AtelyPham
Copy link
Member Author

Depends on tangle-network/tangle#771.

@AtelyPham AtelyPham removed wip 🚧 Work in-progress do not merge 🛑 labels Oct 1, 2024
@AtelyPham AtelyPham added the needs review 👓 Pull request needs a review label Oct 1, 2024
@AtelyPham AtelyPham marked this pull request as ready for review October 1, 2024 18:59
apyPercentage,
// TODO: Find out a proper way to get the pool name, now it's the first token name
// TODO: Find out a proper way to get the vault name, now it's the first token name
Copy link
Contributor

Choose a reason for hiding this comment

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

@1xstj how to get the metadata name of the vault?

apiRx.query.services?.blueprints === undefined ||
apiRx.query.services?.operators === undefined
)
// TODO: Should return the error here instead of throw it
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this TODO be handled as part of this PR? Seems important to also ensure that we don't hit 404 and instead just don't show certain content.

Copy link
Member

Choose a reason for hiding this comment

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

@drewstone I'm planning to modify the useApiRx hook to be able to manage errors by returning them from functions like these briefly, when I do that I'll handle this TODO

Copy link
Member

Choose a reason for hiding this comment

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

@AtelyPham In this specific case, since it's checking whether the pallets are available, if the feature isn't supported we should probably have an error state or at least default to 'empty,' since this is a possible edge case that the user would run into. For example, simply switching to mainnet (where the pallet(s) might not be live yet) would trigger this error to be thrown

Copy link
Member Author

Choose a reason for hiding this comment

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

When this error occurs, the UI handles it by displaying a message to inform users that the feature is not supported.

apps/tangle-dapp/app/blueprints/[id]/OperatorsTable.tsx Outdated Show resolved Hide resolved
apps/tangle-dapp/app/restake/TableTabs.tsx Outdated Show resolved Hide resolved
apps/tangle-dapp/constants/links.ts Outdated Show resolved Hide resolved
apps/tangle-dapp/hooks/usePromise.ts Outdated Show resolved Hide resolved
apps/tangle-dapp/next.config.js Outdated Show resolved Hide resolved
apps/tangle-dapp/types/error.ts Outdated Show resolved Hide resolved
apps/tangle-dapp/utils/polkadot/identity.ts Show resolved Hide resolved
@drewstone drewstone merged commit fd66948 into develop Oct 2, 2024
11 checks passed
@drewstone drewstone deleted the trung-tin/blueprints-api-integration branch October 2, 2024 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review 👓 Pull request needs a review
Projects
Status: Completed ✅
3 participants