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: description in release step #3726

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

Conversation

adam-strzelec
Copy link
Contributor

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

Description

Add Permissions for Payer and Custom - arbitration role and Payment creator for Owner

Testing

  • Create advanced payment
  • Go thru entire flow
  • Go back to release step

Diffs

Changes 🏗

Screenshot 2024-12-19 at 11 31 56

Resolves 3334

@adam-strzelec adam-strzelec self-assigned this Nov 18, 2024
@adam-strzelec adam-strzelec requested a review from a team as a code owner November 18, 2024 12:22
@CLAassistant
Copy link

CLAassistant commented Nov 18, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@bassgeta bassgeta left a comment

Choose a reason for hiding this comment

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

Well it does in fact do the job, but if we always want to display this, I think we should remove FinalizeByPaymentCreator info so we get rid of some extra lines 😎

/>
)}
</>
<ActionWithPermissionsInfo
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmm? :D Alright so we always display that the payment was released via permissions, if that's what we always need to do (even if the user used their temporary payment creator permissions), we can safely remove FinalizeByPaymentCreatorInfo

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 thanks for picking this issue up 🙌

However, I believe this is not working as intended.

If I release the advanced payment using Permissions the right information is displayed
Screenshot 2024-11-21 at 17 32 10

However, releasing the advanced payment using Payment creator the same details as for the previously used decision method (Permissions) is shown, which is not correct
Screenshot 2024-11-21 at 17 33 11

@adam-strzelec
Copy link
Contributor Author

adam-strzelec commented Nov 28, 2024

@mmioana Where can i get decision method? From what I see, the decisionMethod in the ReleasePaymentModal is not even sent to the backend anywhere.

@jakubcolony
Copy link
Collaborator

The permissions vs payment creator selection never worked properly - the saga always uses payment creator if user is such:

image

While we can tell if permissions or reputation was used, we lack details to tell if permissions were specifically chosen over payment creator.

@arrenv How should we proceed with this one?

  • We could add a separate payment creator finalization action (but this might be overkill just for history tracking).
  • Simply prevent payment creators from selecting permissions (assuming there's no real need for them to use permissions). This lets us keep using the existing expenditure owner address check.

@arrenv
Copy link
Member

arrenv commented Dec 6, 2024

@adam-strzelec @jakubcolony

Thank you for the input on this. I think it is useful to be able to communicate the difference of how the payment was released. So, out of the two options provided, I would opt for the second one.

Simply prevent payment creators from selecting permissions (assuming there's no real need for them to use permissions). This lets us keep using the existing expenditure owner address check.

To add to that, I feel it would also be good to have the select field to auto select the option if there is only one. I do think a new issue should be created for this update.

@adam-strzelec adam-strzelec requested a review from mmioana December 9, 2024 09:11
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.

It looks like there was a copy change that was not specified in the issue. I think this should still read "Payment creator released this payment."

image

The info is also incorrectly showing payment creator decision method when the payment was finalized by a different user via permissions.
image

</>
<ActionWithPermissionsInfo
action={finalizingActions?.items[0]}
statusText="action.executed.creator.description"
Copy link
Collaborator

Choose a reason for hiding this comment

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

This needs to show payment creator/permissions depending on the decision method used

@adam-strzelec adam-strzelec force-pushed the fix/16120160-release-step-description branch from d808b86 to 4592627 Compare December 19, 2024 10:29
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 for your continuous effort on this one @adam-strzelec 🙌

Now the copy is the correct one for the Release step as the Payment creator
Screenshot 2024-12-20 at 11 38 36

Created another Advanced payment
Screenshot 2024-12-20 at 11 40 51

And tried to finalise it as amy, but it seems I can no longer do that. Is this as intended?
Screenshot 2024-12-20 at 11 41 06

@adam-strzelec
Copy link
Contributor Author

@mmioana I have no idea. @arrenv If I am a person who did not create the action, should I receive such information?

@arrenv
Copy link
Member

arrenv commented Jan 2, 2025

@mmioana I have no idea. @arrenv If I am a person who did not create the action, should I receive such information?

Yes, this is intended, there has to be an available decision method for a non-creator of the Payment to be able to release it.

So, amy would need either the right permissions ("Payer" bundled or Arbitration), or, the Lazy consensus extension would need to be installed and there would need to be reputation in the domain.

@adam-strzelec adam-strzelec requested a review from mmioana January 2, 2025 09:31
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 @arrenv thanks for the clarification 🙌

The description correctly updates when releasing as a payment creator
Screenshot 2025-01-13 at 09 18 33
Screenshot 2025-01-13 at 09 18 43

Created another Advanced payment
Screenshot 2025-01-13 at 09 19 28

Then after installing the Reputation extension
Screenshot 2025-01-13 at 09 21 53

And tried to release it as amy, the Reputation decision method was available in the dropdown
Screenshot 2025-01-13 at 09 21 49

However @arrenv @adam-strzelec, if I assign amy the Payer bundled permissions, the permissions is not available to Release the advanced payment ❌
Screenshot 2025-01-13 at 09 16 20
Screenshot 2025-01-13 at 09 20 56

@arrenv
Copy link
Member

arrenv commented Jan 14, 2025

@adam-strzelec It is correct that with "Payer" bundled permissions or "Custom - Arbitration" permissions. You should be able to "Release" the payment.

@adam-strzelec adam-strzelec requested a review from mmioana January 14, 2025 16:48
@adam-strzelec
Copy link
Contributor Author

@mmioana done 🙂

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 another round of changes @adam-strzelec

As leela (who created the payment), I can correctly see Payment creator as the only available decision method:
image

As a user without arbitration permission, I get an error as expected:
image

However, after being assigned Payer role, the newly available method reads "Payment creator" instead of "Permissions":
image

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.

Thanks for your continuous efforts on this issue @adam-strzelec 🙌

Released a payment as Payment creator
Screenshot 2025-01-16 at 08 34 15

Gave amy payer permissions
Screenshot 2025-01-16 at 08 35 00

Released payment using Payer permissions ✅
Screenshot 2025-01-16 at 08 36 47
However the widget from the Release step showed the payment was released as Payment creator, which is not correct ❌
Screenshot 2025-01-16 at 08 37 09

Gave fry Custom-Arbitration permissions
Screenshot 2025-01-16 at 08 38 55
Released payment using Custom-Arbitration permissions ✅
Screenshot 2025-01-16 at 08 40 39
However, also here the same problem with the widget showing the payment was released as Payment creator, which is not correct ❌
Screenshot 2025-01-16 at 08 40 49

Comment on lines 22 to 23
userRole?.role === 'payer' ||
(userRole?.role === 'custom' &&
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we please use here UserRole.Payer and UserRole.Custom instead of hard-coded values?

Comment on lines 147 to 151
{selectedFinalizeAction && !selectedFinalizeMotion && (
<ActionWithPermissionsInfo action={selectedFinalizeAction} />
<FinalizeByPaymentCreatorInfo
userAdddress={selectedFinalizeAction.initiatorAddress}
/>
)}
Copy link
Contributor

Choose a reason for hiding this comment

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

Here we should perform a similar check for userIsCreator to decide which description to actually show

@adam-strzelec
Copy link
Contributor Author

@mmioana Do we have any designs for how it should look like when the user uses permissions? The main issue only says very generally that The history of decisions should accurately show what happened and how the decision was made. Should it be Member used permissions to create this action.?

@jakubcolony
Copy link
Collaborator

@adam-strzelec I believe that's the copy that should be used in case of permissions, it would be consistent with the cancel step:
image

@adam-strzelec adam-strzelec requested a review from mmioana January 28, 2025 12:30
@adam-strzelec
Copy link
Contributor Author

@bassgeta @jakubcolony @mmioana done 🙂

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.

Thanks a lot for all the changes @adam-strzelec it all works as expected now 🥇

Released the payment as Payment creator
Screenshot 2025-01-28 at 20 04 14
Screenshot 2025-01-28 at 20 04 30

Gave amy Payer permissions and released the payment using Permissions
Screenshot 2025-01-28 at 20 06 13
Screenshot 2025-01-28 at 20 07 34

Now gave fry Custom-Arbitration permissions
Screenshot 2025-01-28 at 20 07 41
And released the payment using Permissions
Screenshot 2025-01-28 at 20 08 36
Screenshot 2025-01-28 at 20 08 46

Removed fry's permissions and installed the Reputation extension
Screenshot 2025-01-28 at 20 11 51
Created another payment as fry and used the Reputation decision method for releasing the payment
Screenshot 2025-01-28 at 20 11 57
Screenshot 2025-01-28 at 20 14 01

@adam-strzelec Regarding the wording I think @arrenv is best to provide an input to when releasing a payment using Permissions we should use Member used permissions to create this action.. Personally, I believe Member used permissions to release this payment. would be a better fit. Either way, I'm happy to approve your PR 💯

Really nice work and thanks again for all the changes! 🎉

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

@bassgeta bassgeta 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 all the hard work on this, looking real good right now 💪
As payment creator ✔️
image
As member with permissions ✔️
image
With reputation ✔️
image

@arrenv
Copy link
Member

arrenv commented Jan 29, 2025

@adam-strzelec Regarding wording as @mmioana has raised, this is definitely the desired behavior, we want these descriptions to be as accurate as possible so, if it can be Member used permissions to release this payment. in this case, that would be preferred.

@adam-strzelec adam-strzelec dismissed stale reviews from bassgeta and mmioana via d6d1b7d January 30, 2025 09:54
@adam-strzelec
Copy link
Contributor Author

adam-strzelec commented Jan 30, 2025

@arrenv @mmioana @bassgeta I already changed the copy 🙂

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.

Thanks a lot @adam-strzelec for your latest copy change as well as for all your efforts on this issue 🙌

Screenshot 2025-01-30 at 15 17 49

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.

Nice work on this PR, looks good to be merged. Thank you @adam-strzelec 👍

Releasing as payment creator:
image
image

Releasing as another user with permissions:
image
image

Trying to release as a user without permissions:
image

Releasing using reputation:
image

@AdrianDudko
Copy link

@bassgeta Can you please take a look at this PR? We have 2 approvals already :)

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.

Incorrect description on release step
7 participants