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/request payment cards 16737 #16740

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Cuteivist
Copy link
Contributor

@Cuteivist Cuteivist commented Nov 9, 2024

Closes #16737

What does the PR do

  • Implemented request payment cards displayed in chat input and chat history
  • Added additional status messages to storybook
  • Added unit tests

Affected areas

Chat

Architecture compliance

Screenshot of functionality (including design for comparison)

  • I've checked the design and this PR matches it

image

image

@status-im-auto
Copy link
Member

status-im-auto commented Nov 9, 2024

Jenkins Builds

Click to see older builds (28)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ b5e83dc #1 2024-11-09 12:48:57 ~6 min macos/aarch64 🍎dmg
✔️ b5e83dc #1 2024-11-09 12:50:08 ~7 min tests/nim 📄log
b5e83dc #1 2024-11-09 12:52:24 ~9 min tests/ui 📄log
✔️ b5e83dc #1 2024-11-09 12:57:45 ~15 min macos/x86_64 🍎dmg
✔️ b5e83dc #1 2024-11-09 12:58:07 ~15 min linux-nix/x86_64 📦tgz
✔️ b5e83dc #1 2024-11-09 13:05:49 ~23 min linux/x86_64 📦tgz
✔️ b5e83dc #1 2024-11-09 13:10:23 ~27 min windows/x86_64 💿exe
✔️ 87b9b3e #4 2024-11-11 08:09:30 ~4 min macos/aarch64 🍎dmg
✔️ 87b9b3e #4 2024-11-11 08:12:18 ~7 min tests/nim 📄log
87b9b3e #4 2024-11-11 08:15:32 ~10 min tests/ui 📄log
✔️ 87b9b3e #4 2024-11-11 08:18:09 ~13 min macos/x86_64 🍎dmg
✔️ 87b9b3e #4 2024-11-11 08:18:56 ~14 min linux-nix/x86_64 📦tgz
✔️ 87b9b3e #4 2024-11-11 08:26:46 ~22 min linux/x86_64 📦tgz
✔️ 87b9b3e #4 2024-11-11 08:30:20 ~25 min windows/x86_64 💿exe
✔️ d1ccce5 #5 2024-11-24 07:40:59 ~5 min macos/aarch64 🍎dmg
✔️ d1ccce5 #5 2024-11-24 07:43:20 ~7 min tests/nim 📄log
d1ccce5 #5 2024-11-24 07:46:18 ~10 min tests/ui 📄log
✔️ d1ccce5 #5 2024-11-24 07:49:50 ~14 min linux-nix/x86_64 📦tgz
✔️ d1ccce5 #5 2024-11-24 07:50:09 ~14 min macos/x86_64 🍎dmg
✔️ d1ccce5 #5 2024-11-24 07:58:20 ~22 min linux/x86_64 📦tgz
✔️ d1ccce5 #5 2024-11-24 08:04:10 ~28 min windows/x86_64 💿exe
✔️ 04341f0 #6 2024-11-25 13:43:59 ~4 min macos/aarch64 🍎dmg
✔️ 04341f0 #6 2024-11-25 13:46:41 ~7 min tests/nim 📄log
✔️ 04341f0 #6 2024-11-25 13:52:57 ~13 min macos/x86_64 🍎dmg
✔️ 04341f0 #6 2024-11-25 13:52:58 ~13 min linux-nix/x86_64 📦tgz
✔️ 04341f0 #6 2024-11-25 13:53:03 ~13 min tests/ui 📄log
✔️ 04341f0 #6 2024-11-25 13:59:58 ~20 min linux/x86_64 📦tgz
✔️ 04341f0 #6 2024-11-25 14:05:30 ~26 min windows/x86_64 💿exe
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 1b6059d #7 2024-11-26 21:25:46 ~4 min macos/aarch64 🍎dmg
✔️ 1b6059d #7 2024-11-26 21:28:49 ~7 min tests/nim 📄log
1b6059d #7 2024-11-26 21:31:44 ~10 min tests/ui 📄log
✔️ 1b6059d #7 2024-11-26 21:34:26 ~13 min macos/x86_64 🍎dmg
✔️ 1b6059d #7 2024-11-26 21:34:59 ~13 min linux-nix/x86_64 📦tgz
✔️ 1b6059d #7 2024-11-26 21:42:16 ~21 min linux/x86_64 📦tgz
✔️ 1b6059d #7 2024-11-26 21:48:04 ~26 min windows/x86_64 💿exe
✔️ 9c3914a #8 2024-11-27 05:11:07 ~5 min macos/aarch64 🍎dmg
✔️ 9c3914a #8 2024-11-27 05:12:41 ~7 min tests/nim 📄log
✔️ 9c3914a #8 2024-11-27 05:17:28 ~12 min tests/ui 📄log
✔️ 9c3914a #8 2024-11-27 05:20:40 ~15 min macos/x86_64 🍎dmg
✔️ 9c3914a #8 2024-11-27 05:22:36 ~17 min linux-nix/x86_64 📦tgz
✔️ 9c3914a #8 2024-11-27 05:25:50 ~20 min linux/x86_64 📦tgz
✔️ 9c3914a #8 2024-11-27 05:29:29 ~24 min windows/x86_64 💿exe

@Cuteivist Cuteivist force-pushed the feat/request-payment-cards-16737 branch 2 times, most recently from 7b82665 to 87b9b3e Compare November 11, 2024 08:04
Copy link
Contributor

@alexjba alexjba left a comment

Choose a reason for hiding this comment

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

Storybook is broken due to missing required property
chat/ChatInputLinksPreviewArea.qml:40:5: Required property requestPaymentModel was not initialized

Copy link
Member

@micieslak micieslak left a comment

Choose a reason for hiding this comment

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

LGTM in general, some minor comments here + some aspects of #16744 seems to be applicable here as well

ui/imports/shared/views/chat/LinksMessageView.qml Outdated Show resolved Hide resolved
storybook/stubs/shared/stores/RequestPaymentStore.qml Outdated Show resolved Hide resolved
@@ -41,6 +47,8 @@ Control {
signal linkReload(string link)
signal linkClicked(string link)

signal paymentRequestRemoved(int index)
Copy link
Member

Choose a reason for hiding this comment

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

The name suggests that the action has been performed and the signal is called to inform about that executed action. If the signal is called with intention that the user will do the job it should follow the convention with Requested on the end, e.g.:

signal removePaymentRequestRequested(int index)

I know, we have strange naming coincidence here but imo it's ok. Or alternatively removePaymentRequested 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure about Requested part, but to make sure it's clear what is removed I renamed it to: removePaymentRequestPreviewRequested. Made it pretty long though :(

@Cuteivist Cuteivist force-pushed the feat/request-payment-cards-16737 branch from 87b9b3e to d1ccce5 Compare November 24, 2024 07:35
@Cuteivist Cuteivist force-pushed the feat/request-payment-cards-16737 branch from 1b6059d to 9c3914a Compare November 27, 2024 05:04
@Cuteivist
Copy link
Contributor Author

Logic is refactored according to remarks.

Please review again @alexjba @caybro @micieslak

Thanks

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 in general, just format the amount pls when displaying it


signal imageRemoved(int index)
signal imageClicked(var chatImage)
signal linkReload(string link)
signal linkClicked(string link)

signal removePaymentRequestPreviewRequested(int index)
Copy link
Member

Choose a reason for hiding this comment

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

Ugh, what a mouthful 😆

color: Theme.palette.baseColor1
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
text: root.amount
Copy link
Member

Choose a reason for hiding this comment

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

Must format this value!

QtObject {
id: d
property real bannerImageMargins: 1 / Screen.devicePixelRatio // image size isn't pixel perfect..
property bool highlight: root.highlight || root.hovered
Copy link
Member

Choose a reason for hiding this comment

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

readonly those two?

StatusBaseText {
Layout.fillWidth: true
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
text: qsTr("Send %1 %2 to %3").arg(root.amount).arg(root.symbol).arg(Utils.compactAddress(root.address.toLowerCase(), 4))
Copy link
Member

Choose a reason for hiding this comment

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

Format the amount

const receiver = StatusQUtils.ModelUtils.get(paymentRequestModel, index, "receiver")
const amount = StatusQUtils.ModelUtils.get(paymentRequestModel, index, "amount")
const symbol = StatusQUtils.ModelUtils.get(paymentRequestModel, index, "symbol")
const chainId = StatusQUtils.ModelUtils.get(paymentRequestModel, index, "chainId")
Copy link
Member

Choose a reason for hiding this comment

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

You could get the whole row at once, and then get the props

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.

Request Payment - chat cards
5 participants