Skip to content

fix: Stake Pool table improvements - #413

Merged
colbr merged 12 commits into
developfrom
fix/stake-pool-table
Apr 1, 2022
Merged

fix: Stake Pool table improvements#413
colbr merged 12 commits into
developfrom
fix/stake-pool-table

Conversation

@colbr

@colbr colbr commented Mar 14, 2022

Copy link
Copy Markdown
Contributor

Associated Notion Card


1. Pull request checklist

  • Notion card has been moved to the Code Review column
  • Notion card has a link to this PR
  • A reviewer has been assigned to the Notion card

2. PR type

Feat

3. What is the old behaviour?

Previously, (1) stake pool table data would load very slow, and (2) the 'Your Total Stake' column would load indefinitely, and (3) loading errors were not handled.

4. What is the new behaviour?

All issues are fixed - stake pool table data loading should be faster, the 'Your Total Stake' column should load, and it will show "Failed to load" when loading fails. Also added some tests for row components.

5. Other information

Speed improvements all came from changes to zFI-SDK.

@colbr colbr added the bug Something isn't working label Mar 14, 2022
@colbr
colbr requested review from domw30 and eric-zero-dev March 14, 2022 02:06
@colbr colbr self-assigned this Mar 14, 2022
@colbr
colbr requested review from padala and stacy-hunt as code owners March 14, 2022 02:06
@netlify

netlify Bot commented Mar 14, 2022

Copy link
Copy Markdown

Deploy Preview for wilderworld-app ready!

Name Link
🔨 Latest commit 4fccfbe
🔍 Latest deploy log https://app.netlify.com/sites/wilderworld-app/deploys/62475db71cb2090008199950
😎 Deploy Preview https://deploy-preview-413--wilderworld-app.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 settings.

@eric-zero-dev eric-zero-dev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me 🥇. I just add my comments and it is up to you. Approving the PR now.

Comment thread src/containers/staking/StakePoolTable/StakePoolTableRow.tsx Outdated
Comment thread src/containers/staking/StakePoolTable/StakePoolTableRow.tsx Outdated
Comment thread src/containers/staking/StakePoolTable/StakePoolTableRow.tsx Outdated
@colbr

colbr commented Mar 17, 2022

Copy link
Copy Markdown
Contributor Author

Looks good to me 🥇. I just add my comments and it is up to you. Approving the PR now.

Good call in the comments, I made the adjustments you recommended.

@eric-zero-dev eric-zero-dev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks Great!! Approve again

@colbr

colbr commented Mar 18, 2022

Copy link
Copy Markdown
Contributor Author

@ericlowturing sorry - decided to add handling for failed load, and added some tests. If you could give this a quick once over again that would be much appreciated!

@colbr
colbr requested a review from eric-zero-dev March 18, 2022 01:18

@eric-zero-dev eric-zero-dev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 💯 👍 🥇

loading,
alt,
disabled = false,
disabled = false,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure why it was happened. Husky didn't work with this file? Hmm, not sure yet.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No clue to be honest!

Comment on lines +25 to +29
/**
* Note:
* This is directly copied from pool output in SDK
* as of Fri 18 Mar 2022
*/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice comment 💯

Comment on lines +78 to +82
<table>
<tbody>
<StakePoolTableRow data={mockPoolData} rowNumber={'1'} />
</tbody>
</table>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think we need <table>, <tbody> because it is the testing of StakePoolTableRow componnent. But its okay.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Was getting some compile errors for not putting a <tr> in a <table> and <tbody>, very painful

@@ -0,0 +1,177 @@
import '@testing-library/jest-dom/extend-expect';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Perfect test!

@colbr
colbr changed the base branch from develop to master April 1, 2022 20:10
@colbr
colbr changed the base branch from master to develop April 1, 2022 20:12
@colbr
colbr merged commit c02e243 into develop Apr 1, 2022
@colbr
colbr deleted the fix/stake-pool-table branch April 1, 2022 20:20
colbr added a commit that referenced this pull request Apr 1, 2022
* refactor(cancel-bid): reduce complexity

* test(cancel-bid): improve testing coverage

* feat(nft-view): add cancel bid button to NFT view

* fix(bid-table): better spacing of bid table button

* fix: handle 'wilder.' domain names properly

* fix(zAuction): remove caching so user bids can update

* Update Transfer Flow - add step wizard and modify logic/styles

* feat(useZnsDomain): switch to SDK for domain data retrieval

* complete tooltip step and styling touches

* Switch StakingRequestProvider to Redux

* fix(nft-view): change logic for hiding Your Bid

* feat(accept-bid): use zauction sdk method to accept bid

* review changes

* update constants on NFTDetails

* final fixes

* resolve memory leak console error - prevent state update on unmounted component

* feat(accept-bid): handle pending and completed tx
When pending, show pending message in View Bids
When completed, hide View Bids and add notification

* Fix PR feedback

* add background-primary class to resolve firefox blur issue

* add type policies object to inMemoryCache - set merge to domains query to resolve warning

* remove blur class to prevent !important override

* add HoverDropDown common component and adjust styling - update BuyTokenRedirect and InfoPanel

* implement HoverDropDown to status buttons

* resolve build fail

* Fix compile error

* Fix eslint warnnings

* hover state of zero number button and position of dropdown content element

* minor tweaks to style

* rename and resolve merge conflict

* remove commented code

* attempt to resolve build fail

* switch order of dropdown components in index dropdowns file in attempt to resolve failing tests on circle ci build

* update index.js components - remove * export

* revert file changes

* correct import

* name change hack to push file name changes

* hacky name change to resolve build error step 1

* hacky name change to resolve build error step 2

* update zns-sdk

* update rinkeby zauction address

* push package-lock.json changes

* wip/feat(owned-domains-table): switch to GenericTable component

* ensure content dropdown remains open when over gap between elements

* Refactor Page Container component

* update packages

* Fix to show bid button by setting isBiddable as true as default

* Fix zna in MintNewNFT modal

* feat(nft-view): move transfer button to dropdown

* refactor(nft-view): purge some unused css

* Fix znas string value and link in Mint and Transfer modals

* refactor(metadata): migrate code to use sdk method to fetch metadata in useDomainMetadata

* add useAcceptBit and constants

* WIP implementing zauction approval and approve bid using SDK for accept bid

* refactor(make-a-bid): use SDK for getting bid
Also added some simplifications

* feat: add refetch method to useOwnedDomains

* refactor(owned-domains-table): simplify code

* Merge branch 'develop' into feat/dom/accept-bid-sdk

* refactor(owned-domains-table): remove unimportant comment and import

* feat(owned-domains-table): handle action dropdown and modals

* chore: delete legacy DomainTable component
Good riddance

* remove DomainTable from components index

* refactor: remove unused variables and imports

* buid: upgrade zns-sdk to v0.1.12

* feat(domain-data): add contract to queries and types

* feat(sdk-migration): use sdk method for transfer ownership functionality

* feat(sdk-integration): fix minor issue with zns metadata

* feat(sdk-integration): add provider for zauction sdk

* feat(sdk-integration): add missing field lockedby

* feat(Sdk-integration): use library signer instead of registrar provider signer

* accept bid flow & styling

* resolve failing build - update tests

* feat(sdk-integration): update bid provider to use zAuction SDK

* refactor: remove unused imports

* feat(sdk-integration): add error handling for subdomain table row

* refactor: use zAuction SDK directly instead of through zNS SDK

* minor typo fix and remove comment

* build: upgrade zns sdk to v0.1.13

* refactor: remove unused imports, variables and files related to zAuction

* feat(sdk-integration): reload zns data on network change

* build: upgrade zns sdk to v0.1.14

* build: upgrade zauction sdk to v0.0.40

* refactor: remove zns domain data provider & obsolete queries

* refactor: minor optimizations to use bid provider hook

* refactor: remove obsolete queries, imports and variables

* refactor(subdomain-table): better encapsulation

* feat(sdk-integration): update domain search to use sdk methods

* remove unused BidProvider file

* simplify constants - replace one item objects

* improve text style and tidy code

* tidy up handling of step titles on accept bid flow

* tidy up title handling on transfer ownership flow

* remove duplicate code - generic details component

* extract sort by date functionality

* extract utils to global util directory

* break sentence string on notification drawer due to long domains

* requested changes - update order of flow and minor design tweaks

* resolve failing test

* build: upgrade zfi sdk to v0.1.16

* feat: Allow retrieval of buy now price when no wallet connected (#428)

* chore: upgrade zNS-SDK and zAuction-SDK versions

* feat(zns-sdk-provider): add handling for default provider
Some minor refactoring to make the hook more readable, namely by replacing chain ID numbers with NETWORK_TYPES
Removed unused functions to make file thinner

* fix: allow fetch buy now price without wallet connected

* feat(sdk-integration): refactor the zAuction instance creation

* refactor: delete the queries and obsolete files

* Add StepBar to Accept Bid Flow Wizard

* add missing set step

* minor copy change to price format

* minor naming changes to utils and remove console.log

* remove unused var

* custom max character length for truncateDomain util

* rename truncateAddress to truncateWalletAddress

* allow for truncated domain in Wizard NFTDetails with max length set

* edit accept bid wizard nft details to use truncated domain

* truncate make a bid domain name and update domain color

* Make a bid step 3 truncate domain

* refactor: simplify NFTView container (#424)

* refactor NFTView component

* Update by PR feedback

Co-authored-by: Brett <12437916+colbr@users.noreply.github.com>

* fix: missed change in develop merge

* refactor: remove unneeded dependency

* bump sdk and resolve errors

* Make dApp read ‘stakingrequests’ and ‘stakingRequests’

* error messages to prevent owner transferring to their own account

* rename instances of auctionId to bidNonce

* feat(sdk-integration): update change in properties of bid object

* truncate header if 90 characters

* build: fix failing test cases due to change in data type

* tidy up responsiveness for header/nav bar

* chore: fix lint issues

* build: upgrade zns, zauction and zsale sdk to latest version

* refactor: remove log statment

* replace auctionId with bidNonce

* add version property and disable cancel for version 1 bids

* use version property to disable accept bid for v1 zAuction bids

* revert previous changes

* update cancel bid for version 1 bids

* update tests for v1 and v2 bids

* remove console.log

* bump sdk packages

* chore: npm i

* feedback changes - copy and domain

* resolve conflicts

* remove request table from components index file

* filter own bids out of bid list

* revert deletion of RequestTable

* add missing wilder jpeg

* new lines at end of file - lint

* refactor: rename mint wheels to more generic mint drop nft

* refactor: enable mint drop nft banner

* refactor: add zsale sdk provider

* feat(zsale-integration): update existing helpers to use sdk methods

* feat(zsale-integration): update useMint hook to use sdk methods for nft purchase

* refactor(zsale-integration): remove hard coded values and update to use helpers

* refactor: update sdk providers to hooks

* refactor: fix warnings due to missing keys

* feat(zsale-sdk): update banner sale times for testing

* feat(zsale-sdk): update contract address and merkleTreeFileUri

* fix: add missing NFT name to NFTView

* bug: add missing toast notification drawer

* refactor: remove logs

* remove console log

* add toast notifications to buy now and set buy now flows

* build: upgrade zauction sdk to 0.0.48

* feat(zauction-v2): include bid in zauction methods for backwards compatibility

* remove duplicate error line

* remove duplicate line for failed zAuction

* build: update zauction sdk to v0.0.51

* build: upgrade zauction and zns sdk to latest version

* refactor: add any as type for catch error param

* refactor: update dapp to use zauction through zns sdk

* refactor: remove unused hook useZAuctionSDK

* build: upgrade zNS SDK to v0.1.23

* update zAuction sdk

* Fix biddable feature from domain metadata

* feat(sdk-integration): remove registrar and use sdk method to get lock status

* feat(sdk-integration): update etherscan url

* Remove console log and update the sentence to disabled domain make a bid modal

* Use domain metadata parsing at one place

* fix(subdomain-table): show bid button by default (#448)

* Remove console log on bid steps

* fix(nft-view): use proper metadata title (#451)

* feat(domain-search): fix issue with domain search

* build: fix issue with hot reloading - react/create-react-app#11773

* Fix header searching sticky issue

* develop <- master (#457)

* fix: remove 3 from NFTView

* build: increment version number

* fix(history-item): remove cursed 3

* chore: npm i

* chore: bump version number

* build: upgrade zNS SDK to v0.1.27 and zAuction SDK to v0.0.58

* feat: hide banner for now

* chore: SDK version bump, zAuction V2 mainnet address

* refactor: use context API for SDK use (#454)

* Fix to parse domain metadata from current domain instead of parent domain

* fix: Stake Pool table improvements (#413)

* chore: upgrade zFI-SDK to 0.1.16
This upgrade brings faster pool data loading

* fix(stake-pool): fix infinitely loading user balances

* refactor(stake-pool-table): made code slightly more readable

* chore: remove linter warnings

* feat(stake-pool-table): handle failed load
Also some slight refactoring

* test(stake-pool-table): add tests for table row

* fix(stake-pools): fix bug where stake pools wouldn't load

* fix(deposits): fix total stake not loading if 0

* fix(deposits): consistent stat widget height

* chore: bump version number

Co-authored-by: ericlowturing <91501349+ericlowturing@users.noreply.github.com>
Co-authored-by: dominic <domw30@gmail.com>
Co-authored-by: ericlow <eric.l@turing.com>
Co-authored-by: Subrahmanyam Padala <subrahmanyam03@gmail.com>
Co-authored-by: James Earle <j_earle@hotmail.com>
Co-authored-by: Subrahmanyam Padala <subbu@lambda.local>
Co-authored-by: joonchoi0918 <101390821+joonchoi0918@users.noreply.github.com>
Co-authored-by: ericlow <eric.low.dev@gmail.com>
Co-authored-by: eric-zero-dev <91501349+eric-zero-dev@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants