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

[explorer] Groups Owned Objects by Type #1741

Merged
merged 17 commits into from
May 4, 2022
Merged

Conversation

apburnie
Copy link
Contributor

@apburnie apburnie commented May 3, 2022

When viewing addresses and objects, the owned objects are first grouped by type. Upon clicking this leads to an individual object view.

image

image

const [results, setResults] = useState(DATATYPE_DEFAULT);
const [isLoaded, setIsLoaded] = useState(false);

// TODO - The below will fail for a large number of owned objects
Copy link
Contributor

@666lcz 666lcz May 3, 2022

Choose a reason for hiding this comment

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

This works pretty well in practice. This address(813ec1ab1e1797c79d1e1fcbebebc27a1fd21f07) owns 110+ coins and the page loads well. But I will try to fix this in the next day or two

Copy link
Contributor

Choose a reason for hiding this comment

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

if it can handle 110 objects, that's good enough for now i think.

@apburnie apburnie requested a review from stella3d May 3, 2022 19:02
@666lcz
Copy link
Contributor

666lcz commented May 3, 2022

CleanShot.2022-05-03.at.11.51.44.mp4

Thanks for working on this! Here're a few high-level feedback(and synced with @bwann52 ):

  • we should have two sections for owned objects:
  • one section should be called Coins(placeholder, we might change it to Fungible Tokensor something else in the future, that contains all objects with type Coin<T>. We should aggregate by the T by default
  • The other section should be called Owned object(placeholder value) that contains all objects with other types. We SHOULD NOT aggregate them by default.

@bwann52 Could you add more feedback on content and other things if any?

@bwann52
Copy link
Contributor

bwann52 commented May 3, 2022

no additional comments at this time. Thanks @666lcz @Andrew47

Copy link
Contributor

@stella3d stella3d left a comment

Choose a reason for hiding this comment

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

giving the mock data unique IDs is the only critical change - otherwise we could merge this now

explorer/client/package.json Outdated Show resolved Hide resolved
@@ -391,6 +398,9 @@ describe('End-to-end Tests', () => {
it('to go to the last page', async () => {
const address = 'ownsAllAddress';
await page.goto(`${BASE_URL}/addresses/${address}`);
const btn1 = await page.$('#groupCollection > div:nth-child(1)');
Copy link
Contributor

Choose a reason for hiding this comment

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

we re-use '#groupCollection > div:nth-child(1)' selector several times, could we make it a const variable with a name describing what the selector is for ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A refactoring of the test suite code is a good idea and certainly something to consider post-Devnet.

Copy link
Contributor

@stella3d stella3d May 4, 2022

Choose a reason for hiding this comment

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

my concern is more for our own future understanding of this code: it's good to give descriptive names to magic constant values in the codebase, and to do it while the meaning is still fresh

const [results, setResults] = useState(DATATYPE_DEFAULT);
const [isLoaded, setIsLoaded] = useState(false);

// TODO - The below will fail for a large number of owned objects
Copy link
Contributor

Choose a reason for hiding this comment

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

if it can handle 110 objects, that's good enough for now i think.

explorer/client/src/utils/static/mock_data.json Outdated Show resolved Hide resolved
@apburnie
Copy link
Contributor Author

apburnie commented May 4, 2022

I've gone through the feedback and updated the PR.

image

@apburnie apburnie merged commit fc812d6 into main May 4, 2022
@apburnie apburnie deleted the andrew/aggOwnedObjects branch May 4, 2022 17:03
longbowlu pushed a commit that referenced this pull request May 12, 2022
* aggregates objects into groups for static view

* WIP - basic group view set up for API

* Group View set up for API with pagination

* Coin sums balance not count

* stylizes group view

* resolve white background issue with page navigation

* removes balance where not relevant

* removes standard library from Group View

* adds guidance on required changes to backend

* Type titles rather than types everywhere

* WIP - splits coins from NFTs

* improves Object Owning Objects view

* fix tests

* changes package.json order back to original

* improvements to individual object display

* rearrange pagination order following Bauer feedback

* standardizes Coin/NFTs view following Bauer feedback
punwai pushed a commit that referenced this pull request Jul 27, 2022
* aggregates objects into groups for static view

* WIP - basic group view set up for API

* Group View set up for API with pagination

* Coin sums balance not count

* stylizes group view

* resolve white background issue with page navigation

* removes balance where not relevant

* removes standard library from Group View

* adds guidance on required changes to backend

* Type titles rather than types everywhere

* WIP - splits coins from NFTs

* improves Object Owning Objects view

* fix tests

* changes package.json order back to original

* improvements to individual object display

* rearrange pagination order following Bauer feedback

* standardizes Coin/NFTs view following Bauer feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants