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

fix: add overview info and change copy for advanced payment review #3724

Merged
merged 7 commits into from
Feb 7, 2025

Conversation

adam-strzelec
Copy link
Contributor

@adam-strzelec adam-strzelec commented Nov 15, 2024

Description

Change copy and add overview info for advancep payment

Testing

  • Create advanced payment
  • Go to Review tab

Diffs

Permissions:
Screenshot 2024-12-31 at 13 09 02

Staking:
Screenshot 2024-12-31 at 13 09 28

Creator:
Screenshot 2024-11-15 at 17 36 17

Main issue - #3680

@adam-strzelec adam-strzelec self-assigned this Nov 15, 2024
@adam-strzelec adam-strzelec requested a review from a team as a code owner November 15, 2024 16:43
@CLAassistant
Copy link

CLAassistant commented Nov 15, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@iamsamgibbs iamsamgibbs left a comment

Choose a reason for hiding this comment

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

Thanks for your work on this. I can see the updated copy for the creator is correct.

Screenshot 2024-11-18 at 12 14 44

However, I created the action using permissions rather than staking, so I don't think a stake amount should be shown here:

Screenshot 2024-11-18 at 12 14 37

The original issue says "The card should show a different message about how they created the payment, i.e. Permissions, or Stake amount." Although the figma design doesn't seem to include the permissions version.

The PaymentBuilderWidget is really getting bloated now, do you think you could move all the review step logic into a new component to keep things a bit tidier?

@adam-strzelec
Copy link
Contributor Author

@iamsamgibbs I can't create an action for Stake. I also don't know how designs should look for Permissions

@iamsamgibbs
Copy link
Contributor

@iamsamgibbs I can't create an action for Stake.

You might need to rebase, this PR fixes stakes and got merged yesterday: #3629

I also don't know how designs should look for Permissions

@arrenv @melyndav Might need a quick figma mock up / description for how this should look (assuming we've understood correctly what is required here)

@adam-strzelec adam-strzelec force-pushed the fix/16167998-advancep-payment-review branch from 6c758b5 to 7537056 Compare November 21, 2024 09:03
@AdrianDudko AdrianDudko linked an issue Nov 22, 2024 that may be closed by this pull request
@jakubcolony
Copy link
Collaborator

@adam-strzelec The only difference between Permissions and Staking decision methods is that the stake amount should only be shown for the latter. If a payment was created with permissions, non-creators should only see the Payment creator field on this card:

image

@adam-strzelec adam-strzelec force-pushed the fix/16167998-advancep-payment-review branch from 7537056 to b17624f Compare December 3, 2024 10:19
Copy link
Contributor

@iamsamgibbs iamsamgibbs left a comment

Choose a reason for hiding this comment

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

Nice job, this is looking a lot better now! Whilst in review and viewing as another user:

As the creator:
Screenshot 2024-12-06 at 09 17 13

Permissions:
Screenshot 2024-12-06 at 09 10 02

Staked:
Screenshot 2024-12-06 at 09 12 53

However, the wording in the completed view of these steps does not match the figma design, it should read "Payment creator completed the review step."

Screenshot 2024-12-06 at 09 14 52

Currently looks like this:

Screenshot 2024-12-06 at 09 07 25 Screenshot 2024-12-06 at 09 08 29

I think with that small change we're good to go!

@arrenv
Copy link
Member

arrenv commented Dec 9, 2024

@arrenv @melyndav Might need a quick figma mock up / description for how this should look (assuming we've understood correctly what is required here)

@adam-strzelec there will just not be any stake amount row. Figma design.

image

@adam-strzelec
Copy link
Contributor Author

adam-strzelec commented Dec 12, 2024

@arrenv @melyndav Might need a quick figma mock up / description for how this should look (assuming we've understood correctly what is required here)

@adam-strzelec there will just not be any stake amount row. Figma design.

image

@arrenv @iamsamgibbs That's how it works now

Copy link
Collaborator

@jakubcolony jakubcolony left a comment

Choose a reason for hiding this comment

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

Thanks for your PR @adam-strzelec. The copy looks good, however I noted the bottom padding of the card is too big compared to Figma:

image

I also left a comment where a different field should be used to access payment creator address.

As creator:

image image

As a different user:

image image

@@ -82,7 +85,7 @@ const PaymentBuilderWidget: FC<PaymentBuilderWidgetProps> = ({ action }) => {
setSelectedReleaseAction,
} = usePaymentBuilderContext();

const { expenditureId } = action;
const { expenditureId, initiatorUser } = action;
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's possible initiatorUser will be null, for example as a result of direct chain interaction outside the UI.

Wherever expenditure creator's address is referenced it should use action.initiatorAddress.

@adam-strzelec adam-strzelec force-pushed the fix/16167998-advancep-payment-review branch from cc22cbd to fa4d0e0 Compare December 19, 2024 11:18
Copy link
Contributor

@mmioana mmioana left a comment

Choose a reason for hiding this comment

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

Nice work on this one @adam-strzelec 🙌

View after the Advanced payment was created as the Payment creator
Screenshot 2024-12-30 at 07 21 39
Screenshot 2024-12-30 at 07 22 16

View after the Advanced payment was created as another user
Screenshot 2024-12-30 at 07 22 44
Screenshot 2024-12-30 at 07 23 01

View after the payment creator finalised the the Review step.
Screenshot 2024-12-30 at 07 27 19
Screenshot 2024-12-30 at 07 27 31

However as @iamsamgibbs pointed out, the widget header copy after the Review step has been completed doesn't match Figma, so would appreciate it if we could update this as well @adam-strzelec 🥇

Screenshot 2024-12-30 at 07 35 38

Copy link
Collaborator

@jakubcolony jakubcolony left a comment

Choose a reason for hiding this comment

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

The copy and padding looks good now, thank you @adam-strzelec. However, I noticed an unsafe array access, which should hopefully be easy to fix.

image image image image

@@ -92,6 +95,11 @@ const PaymentBuilderWidget: FC<PaymentBuilderWidgetProps> = ({ action }) => {
stopPolling,
} = useGetExpenditureData(expenditureId, { pollUntilUnmount: true });

const tokenData = getSelectedToken(
colony,
expenditure?.slots?.[0].payouts?.[0].tokenAddress ?? '',
Copy link
Collaborator

Choose a reason for hiding this comment

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

I hadn't caught it earlier, the array indexes need to be followed by ? too, otherwise this will crash on empty slots/payouts array.

Suggested change
expenditure?.slots?.[0].payouts?.[0].tokenAddress ?? '',
expenditure?.slots?.[0]?.payouts?.[0]?.tokenAddress ?? '',

Copy link
Contributor

@davecreaser davecreaser left a comment

Choose a reason for hiding this comment

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

Looking good from my side @adam-strzelec, once the empty array fix Jakub raised is dealt with!

Permissions:
Screenshot 2025-01-17 at 13 44 14
Screenshot 2025-01-17 at 13 45 14

Staking:
Screenshot 2025-01-17 at 13 46 06
Screenshot 2025-01-17 at 13 46 23

Ready to approve as soon as that potential crash is fixed 🚀

Copy link
Contributor

@mmioana mmioana left a comment

Choose a reason for hiding this comment

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

Hey @adam-strzelec, I noticed the header issue is still present and not matching Figma when the Review step is completed. Is this something we don't want to tackle for now?
Screenshot 2025-01-20 at 11 49 12
Screenshot 2025-01-20 at 11 53 16

Also @adam-strzelec can you please address @jakubcolony comment regarding the empty arrays?

@adam-strzelec
Copy link
Contributor Author

@mmioana Did you mean to change the Status Badge to one that corresponds to the currently selected step?

@mmioana
Copy link
Contributor

mmioana commented Jan 27, 2025

Hey @adam-strzelec! Thanks for your patience 🙏 I meant the card header after the Review step has been completed currently says Member used permissions/staking to create this action.
While in Figma
Screenshot 2025-01-27 at 15 21 39

@adam-strzelec adam-strzelec marked this pull request as draft January 28, 2025 08:53
@adam-strzelec adam-strzelec force-pushed the fix/16167998-advancep-payment-review branch from 63dd476 to 57ad081 Compare January 28, 2025 13:06
@adam-strzelec
Copy link
Contributor Author

@mmioana I see that it was already fixed in this commit 6b7e3cd
On my device it shows header properly 🙂
Screenshot 2025-01-28 at 14 03 21

@adam-strzelec adam-strzelec marked this pull request as ready for review January 28, 2025 13:09
mmioana
mmioana previously approved these changes Jan 28, 2025
Copy link
Contributor

@mmioana mmioana left a comment

Choose a reason for hiding this comment

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

@adam-strzelec must be I haven't pulled the latest changes, but can confirm that now it properly shows up also for me! Thank you for all the effort on this issue 🥇

Screen.Recording.2025-01-28.at.19.58.25.mov
Screen.Recording.2025-01-28.at.19.59.03.mov

iamsamgibbs
iamsamgibbs previously approved these changes Jan 29, 2025
Copy link
Contributor

@iamsamgibbs iamsamgibbs left a comment

Choose a reason for hiding this comment

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

Nice job handling all of these cases! This is good to go now.

Permissions as the creator:

Screenshot 2025-01-29 at 17 07 38

Permissions as another user:

Screenshot 2025-01-29 at 17 07 55

Permissions after going to the next step:
Screenshot 2025-01-29 at 17 08 17

Screenshot 2025-01-29 at 17 08 25

Staking as the creator:
Screenshot 2025-01-29 at 17 08 51

Staking as another user:
Screenshot 2025-01-29 at 17 09 02

Staking after moving to the next step:
Screenshot 2025-01-29 at 17 09 17

Screenshot 2025-01-29 at 17 09 23

Copy link
Collaborator

@jakubcolony jakubcolony left a comment

Choose a reason for hiding this comment

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

All good apart from a single question mark - please ping me once you add it and I'll approve straightaway.

@@ -92,6 +95,11 @@ const PaymentBuilderWidget: FC<PaymentBuilderWidgetProps> = ({ action }) => {
stopPolling,
} = useGetExpenditureData(expenditureId, { pollUntilUnmount: true });

const tokenData = getSelectedToken(
colony,
expenditure?.slots?.[0].payouts?.[0]?.tokenAddress ?? '',
Copy link
Collaborator

Choose a reason for hiding this comment

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

You're missing a ? just before .payouts, which means the app can still crash if expenditure slots are not set yet:
image

Copy link
Contributor

@iamsamgibbs iamsamgibbs left a comment

Choose a reason for hiding this comment

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

Thanks for the tiny fix, all good here.

Copy link
Contributor

@mmioana mmioana left a comment

Choose a reason for hiding this comment

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

Thank you a lot for your continuous effort on this issue @adam-strzelec 🙌

Looks good from my side 💯

Using permissions

Screen.Recording.2025-02-07.at.14.10.05.mov

Using staking

Screen.Recording.2025-02-07.at.14.11.06.mov

Copy link
Collaborator

@jakubcolony jakubcolony left a comment

Choose a reason for hiding this comment

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

Thanks for the fix, all good here 👍

@adam-strzelec adam-strzelec merged commit 8d919d1 into master Feb 7, 2025
2 checks passed
@adam-strzelec adam-strzelec deleted the fix/16167998-advancep-payment-review branch February 7, 2025 16:22
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.

Advanced payment review without permissions
7 participants