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

(desktop/fix) Fix Owner token holder representation #13712

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

kounkou
Copy link
Contributor

@kounkou kounkou commented Feb 25, 2024

Description

Fix #12065 token owner presentation in Token section by displaying the owner token holder as contact

What does the PR do

Fetch the contactDetails for the token owner found in the tokenOwnerModel.

Affected areas

MintedTokenView page

Screenshot of functionality (including design for comparison)

Figma:
Screenshot from 2023-09-01 13-27-18

The following match the UI expectations

Screenshot from 2024-02-25 14-58-20
Screenshot from 2024-02-25 14-58-10

@kounkou kounkou self-assigned this Feb 25, 2024
@kounkou kounkou force-pushed the fix-owner-token-holder-represented-as-address branch from 687c146 to 5e148c5 Compare February 25, 2024 07:31
@status-im-auto
Copy link
Member

status-im-auto commented Feb 25, 2024

Jenkins Builds

Click to see older builds (37)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 5e148c5 #2 2024-02-25 07:38:11 ~6 min tests/nim 📄log
✔️ 5e148c5 #2 2024-02-25 07:38:42 ~6 min macos/aarch64 🍎dmg
✔️ 5e148c5 #2 2024-02-25 07:42:10 ~10 min macos/x86_64 🍎dmg
✔️ 5e148c5 #2 2024-02-25 07:42:40 ~10 min tests/ui 📄log
✔️ 5e148c5 #2 2024-02-25 07:48:39 ~16 min linux/x86_64 📦tgz
✔️ 5e148c5 #2 2024-02-25 07:56:58 ~24 min windows/x86_64 💿exe
✔️ bc6f319 #4 2024-02-25 22:50:08 ~4 min macos/aarch64 🍎dmg
✔️ bc6f319 #4 2024-02-25 22:51:51 ~6 min tests/nim 📄log
✔️ bc6f319 #4 2024-02-25 22:54:04 ~8 min macos/x86_64 🍎dmg
✔️ bc6f319 #4 2024-02-25 22:55:29 ~10 min tests/ui 📄log
✔️ bc6f319 #4 2024-02-25 23:00:12 ~14 min linux/x86_64 📦tgz
✔️ 39f6812 #5 2024-02-26 06:24:58 ~4 min macos/aarch64 🍎dmg
✔️ 39f6812 #5 2024-02-26 06:26:08 ~5 min tests/nim 📄log
✔️ 39f6812 #5 2024-02-26 06:28:42 ~8 min macos/x86_64 🍎dmg
✔️ 39f6812 #5 2024-02-26 06:30:41 ~10 min tests/ui 📄log
✔️ 39f6812 #5 2024-02-26 06:34:28 ~14 min linux/x86_64 📦tgz
✔️ 453b4b7 #8 2024-02-26 16:49:39 ~3 min macos/aarch64 🍎dmg
✔️ 453b4b7 #8 2024-02-26 16:51:57 ~6 min tests/nim 📄log
✔️ 453b4b7 #8 2024-02-26 16:53:46 ~8 min macos/x86_64 🍎dmg
✔️ 453b4b7 #8 2024-02-26 16:55:13 ~9 min tests/ui 📄log
✔️ b612c67 #9 2024-02-26 17:04:29 ~4 min macos/aarch64 🍎dmg
✔️ b612c67 #9 2024-02-26 17:06:49 ~6 min tests/nim 📄log
✔️ b612c67 #9 2024-02-26 17:08:18 ~7 min macos/x86_64 🍎dmg
✔️ b612c67 #9 2024-02-26 17:10:29 ~10 min tests/ui 📄log
✔️ b612c67 #9 2024-02-26 17:14:12 ~13 min linux/x86_64 📦tgz
✔️ 69f5c6e #11 2024-02-28 00:53:03 ~5 min tests/nim 📄log
✔️ 69f5c6e #11 2024-02-28 00:54:07 ~6 min macos/aarch64 🍎dmg
✔️ 8e04f60 #12 2024-02-28 01:02:31 ~5 min macos/aarch64 🍎dmg
✔️ 8e04f60 #12 2024-02-28 01:03:47 ~6 min tests/nim 📄log
✔️ 8e04f60 #12 2024-02-28 01:07:33 ~10 min tests/ui 📄log
✔️ 8e04f60 #12 2024-02-28 01:10:46 ~13 min macos/x86_64 🍎dmg
✔️ 8e04f60 #12 2024-02-28 01:11:33 ~14 min linux/x86_64 📦tgz
✔️ fc9b500 #13 2024-02-28 05:29:43 ~5 min macos/aarch64 🍎dmg
✔️ fc9b500 #13 2024-02-28 05:30:18 ~6 min tests/nim 📄log
✔️ fc9b500 #13 2024-02-28 05:31:11 ~6 min macos/x86_64 🍎dmg
✔️ fc9b500 #13 2024-02-28 05:34:15 ~10 min tests/ui 📄log
✔️ fc9b500 #13 2024-02-28 05:40:26 ~16 min linux/x86_64 📦tgz
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 01d7034 #14 2024-02-28 09:16:03 ~4 min macos/aarch64 🍎dmg
✔️ 01d7034 #14 2024-02-28 09:17:24 ~6 min tests/nim 📄log
✔️ 01d7034 #14 2024-02-28 09:19:49 ~8 min macos/x86_64 🍎dmg
✔️ 01d7034 #14 2024-02-28 09:21:36 ~10 min tests/ui 📄log
✔️ 01d7034 #14 2024-02-28 09:26:53 ~15 min linux/x86_64 📦tgz
✔️ 597af88 #15 2024-02-28 17:10:27 ~4 min macos/aarch64 🍎dmg
✔️ 597af88 #15 2024-02-28 17:12:00 ~6 min tests/nim 📄log
✔️ 597af88 #15 2024-02-28 17:15:47 ~9 min macos/x86_64 🍎dmg
✔️ 597af88 #15 2024-02-28 17:16:43 ~10 min tests/ui 📄log
✔️ 597af88 #15 2024-02-28 17:20:25 ~14 min linux/x86_64 📦tgz
✔️ 597af88 #25 2024-02-28 18:01:09 ~24 min windows/x86_64 💿exe

@kounkou kounkou force-pushed the fix-owner-token-holder-represented-as-address branch 3 times, most recently from bc6f319 to 39f6812 Compare February 26, 2024 06:19
@kounkou kounkou marked this pull request as ready for review February 26, 2024 06:53
Copy link
Member

@caybro caybro left a comment

Choose a reason for hiding this comment

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

LGTM beside the alleged typo fixes ;)

Copy link
Contributor

@MishkaRogachev MishkaRogachev left a comment

Choose a reason for hiding this comment

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

Seems good for me, just rename hodler back :)

ui/app/AppLayouts/Communities/views/CommunityTokenView.qml Outdated Show resolved Hide resolved
@kounkou kounkou force-pushed the fix-owner-token-holder-represented-as-address branch 4 times, most recently from 453b4b7 to b612c67 Compare February 26, 2024 17:00
Copy link
Member

@caybro caybro left a comment

Choose a reason for hiding this comment

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

More questions :)

sensor.enabled: false

Component.onCompleted: {
d.updateContactDetails(model.contactId)
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, how does this work? You're fetching and overwriting the d.contactDetails for each delegate in the listview? 🤔 That sounds odd...

Copy link
Member

Choose a reason for hiding this comment

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

I mean, doesn't the root.tokenOwnersModel already include it in some way? And if not, if should probably added to it, not fetched from the UI

Copy link
Contributor Author

@kounkou kounkou Feb 26, 2024

Choose a reason for hiding this comment

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

Thank you for taking the time to review, from the tokenOwnersModel, what could be extracted is the name and the contactId (cf. below. The other way to go about this would be to enrich the tokenOwnersModel with all the necessary details to be displayed and then fetch the information directly from the tokenOwners, not sure if this second approach seems overkill to me, wdyt?

Hmm, how does this work? You're fetching and overwriting the d.contactDetails for each delegate in the listview?
As of now, There is only 1 Owner token for a community so, the delegate is called once.

  TokenOwnersItem* = object
    contactId*: string
    name*: string
    imageSource*: string
    numberOfMessages*: int
    ownerDetails*: CollectibleOwner
    amount*: Uint256
    remotelyDestructState*: ContractTransactionStatus

Copy link
Member

Choose a reason for hiding this comment

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

The solution would be to use the LeftJoinModel on the contactId

Copy link
Contributor Author

@kounkou kounkou Feb 27, 2024

Choose a reason for hiding this comment

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

The solution would be to use the LeftJoinModel on the contactId

Sure, I think that's the easy part though.

To accomplish what is asked by @caybro
I should pull the usersModel and Join it with he tokenOwnersModel on the contactId because it's better to use the Qt binding rather than fetching the contact details even if it's called only once here as of now (I suspect it might be called more than once later on reason why I used a list...). This is ideal solution for sure, it might take me a bit more time (probably 1 more day) than I had expected judging on the usage of the contact details. I'll be working on it now CC @jrainville

Copy link
Contributor Author

@kounkou kounkou Feb 28, 2024

Choose a reason for hiding this comment

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

So I have sent a new revision making use of a LeftJoinModel for extracting the ownerToken after crossing it with the members available to the CommunitySettingsView component. Please @caybro let me know what you think.


Not directly related to this ticket, trying to understand why I don't have update of the properties... After a quick look, it seems like the Members panel as well don't have updates on the members properties. This is most likely a bug. I can have a look in a different ticket. On this screenshot the Phoenix-2 is offline in the Members list but online in the bottom left corner

Screenshot from 2024-02-27 20-59-16

@kounkou kounkou force-pushed the fix-owner-token-holder-represented-as-address branch 3 times, most recently from 69f5c6e to 8e04f60 Compare February 28, 2024 00:56
@kounkou kounkou requested a review from caybro February 28, 2024 00:57
@kounkou kounkou force-pushed the fix-owner-token-holder-represented-as-address branch from 8e04f60 to fc9b500 Compare February 28, 2024 05:23
Copy link
Member

@caybro caybro left a comment

Choose a reason for hiding this comment

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

I like where this is going! :)

@kounkou kounkou force-pushed the fix-owner-token-holder-represented-as-address branch from fc9b500 to 01d7034 Compare February 28, 2024 09:10
@kounkou kounkou requested a review from caybro February 28, 2024 09:15
Copy link
Member

@caybro caybro left a comment

Choose a reason for hiding this comment

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

Nice 👍

@anastasiyaig
Copy link
Contributor

@kounkou please rebase to let the tests pass

Copy link
Contributor

@MishkaRogachev MishkaRogachev left a comment

Choose a reason for hiding this comment

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

Great work!

fix #12065 token owner presentation in Token section by displaying the owner
token holder as contact
@kounkou kounkou force-pushed the fix-owner-token-holder-represented-as-address branch from 01d7034 to 597af88 Compare February 28, 2024 17:05
@kounkou kounkou merged commit 0a42bd0 into master Feb 28, 2024
8 checks passed
@kounkou kounkou deleted the fix-owner-token-holder-represented-as-address branch February 28, 2024 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Communities: Owner token holder presented as address instead of contact (self)
5 participants