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

prevent project owners from making donations to their own project on donate page #4612

Closed
7 tasks done
divine-comedian opened this issue Aug 22, 2024 · 13 comments
Closed
7 tasks done
Assignees
Labels
bug Something isn't working

Comments

@divine-comedian
Copy link
Contributor

divine-comedian commented Aug 22, 2024

@LatifatAbdullahi found a flaw in our UX

Currently project owners are not allowed to make donations to their own project. If they try to the back-end will throw an error and the UI will show a non-descriptive error to the user.

Image

Through the navigation of the website normally the user cannot get to the donate page for a project they own. HOWEVER if they use the direct url donate/{projectSlug} it is possible for them to attempt making a donation to their project.

When a user connects to the donate page with a wallet address that matches the project owner address we should show a modal that cannot be closed as long as the same wallet address remains connected to the app.

Similar to what was done with the #4449 modal we should check this at the same point and show the modal with the following copy

Project Owner Address Detected

You cannot donate to a project you are the owner of. There are thousands of projects on Giveth looking for your support! Please choose another project to donate to.

BUTTON -> View All Projects

Requirements

  • When a user connects to the donate page with an address that matches the project owner address we show a warning modal
  • the warning modal cannot be closed as long as the same wallet address is connected
  • switching the connected wallet address closes the modal
  • if connecting to the donate page with an address that DOES NOT match the project owner address the modal is NOT shown
  • the modal button successfully redirects the users to the all projects page
  • the text shown on the modal matches the above
  • the text is also translated when the app language is set to spanish or catalan
@maryjaf
Copy link
Collaborator

maryjaf commented Sep 8, 2024

Since we have a deploy today or tomorrow and the implementation of this new logic isn't completed, I think we should be sure that this changed will not be deployed on prod in this release.
@HrithikSampson @MoeNick

@MoeNick
Copy link
Member

MoeNick commented Sep 8, 2024

Please simply ignore these checks if the user clicks on donating with Stellar. As far as we don;t have sign-in with Stellar, there's no way we detect the ownership of the donor to the sender address. @HrithikSampson
@divine-comedian FYI

@HrithikSampson
Copy link
Collaborator

Hi @maryjaf , this issue is ready to be tested

@maryjaf
Copy link
Collaborator

maryjaf commented Sep 8, 2024

  • the warning modal cannot be closed as long as the same wallet address is connected
  • switching the connected wallet address closes the modal

When this modal is shown, there is no way to switch user in donate page
@HrithikSampson @divine-comedian

Screen.Recording.2024-09-08.at.1.43.47.PM.mov

@HrithikSampson
Copy link
Collaborator

Hi @maryjaf ,

The description also said that the modal cannot be closed,

That is why it is not allowing it to switch address in the same page

@maryjaf
Copy link
Collaborator

maryjaf commented Sep 8, 2024

  • switching the connected wallet address closes the modal

Yeah, you're right
But I don't understand this AC
and there is no way for switching user that the modal be closed
Let's wait for @divine-comedian to give his opinion about this item

@MoeNick
Copy link
Member

MoeNick commented Sep 9, 2024

The AC is saying, if user changes the address in his wallet (like MM) DApp should detect and close it. @HrithikSampson

@maryjaf
Copy link
Collaborator

maryjaf commented Sep 9, 2024

The AC is saying, if user changes the address in his wallet (like MM) DApp should detect and close it. @HrithikSampson

Thanks @HrithikSampson @MoeNick It works as expected

@maryjaf
Copy link
Collaborator

maryjaf commented Sep 10, 2024

In a scenario that the project doesn't support the network, two modal is shown concurrently, is this accepted ?
or some fixes should be made?

@HrithikSampson @divine-comedian
If this is accepted behavior we can close this issue

image

@divine-comedian
Copy link
Contributor Author

divine-comedian commented Sep 10, 2024

@HrithikSampson - can we modify this so the modals don't overlap - we should only show 1 modal at a time the priority for modals:

  1. project owner address modal
  2. the switch network modal

to clarify the flow should be like

  • app detects connected address is project owner, shows modal. user clicks button to redirect to all projects page
  • user should not see or get blocked by switch network modal during the redirect process

@HrithikSampson
Copy link
Collaborator

@divine-comedian - I will try to fix this now.

@HrithikSampson
Copy link
Collaborator

@maryjaf , this issue is ready to be tested

@maryjaf
Copy link
Collaborator

maryjaf commented Sep 29, 2024

Thanks @HrithikSampson This problem has been fixed

@divine-comedian divine-comedian closed this as completed by moving to Merged to Production in All-Devs Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

4 participants