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

Enhancement/contract update #676

Merged
merged 18 commits into from
Feb 23, 2022
Merged

Conversation

henriquecbuss
Copy link
Member

@henriquecbuss henriquecbuss commented Jan 21, 2022

What issue does this PR close

Closes #665

Changes Proposed ( a list of new changes introduced by this PR)

Update contract calls to be compatible after the migration from cambiatus/contracts#33

Here is a full list of changes and how they relate to the frontend:

  • assignroles - New
  • claimaction - Added community_id
  • clean - Not used
  • create - Not changed
  • createsale - Not changed
  • deleteact - Not changed/Not used
  • deleteobj - Not changed
  • deletesale - Not changed
  • migrate - Not changed/Not used
  • migrateafter - Not changed/Not used
  • migrateobj - New
  • migrateusers - New
  • netlink - Not changed/Not used
  • reward - Replaces verifyaction? - Not used
  • setindices - Not changed/Not used
  • transfersale - Not changed
  • update - Not changed
  • updatesale - Not changed
  • upsertaction - Added community_id
  • upsertobjctv - Replaces newobjective and updobjective , adding/replacing cmm_asset with community_symbol
  • upsertrole - New
  • verifyclaim - Added community_id
  • reactsale - Not used - was this deleted?

How to test ( a list of instructions on how to test this PR)

Check if the above list is correct, and test these contract calls on the frontend

If you try to perform an action and don't have enough permissions, you should see a modal telling you that.

@henriquecbuss
Copy link
Member Author

@lucca65 can you confirm if reward replaces verifyaction and reactsale was deleted? I'm not 100% sure on those

@lucca65
Copy link
Member

lucca65 commented Jan 21, 2022

Thats correct @NeoVier! No longer we have react sale and verify action changed its name! No need to implement the new reward as we will be discussing it here

@lucca65
Copy link
Member

lucca65 commented Jan 21, 2022

about migrateobj, migrateusers and some others, we don't need to implement them, as they are our cambiatus admin only actions, and will be removed once we are done with this migration

@henriquecbuss
Copy link
Member Author

Ok, then I believe the work for this PR is done!

Copy link
Member

@lucca65 lucca65 left a comment

Choose a reason for hiding this comment

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

just one missing param

src/elm/Action.elm Show resolved Hide resolved
@lucca65
Copy link
Member

lucca65 commented Jan 21, 2022

Bro, can you also work on instead of showing the regular Feedback when we got the permission error, to show this modal instead?

Captura de Tela 2022-01-21 às 15 55 35

https://www.figma.com/file/XKS6pzhjaFtdJVPAYR6hSK/Modal---Congelar-usuário

@henriquecbuss henriquecbuss mentioned this pull request Jan 25, 2022
6 tasks
@netlify
Copy link

netlify bot commented Feb 18, 2022

✔️ Deploy Preview for cambiatus-elm-book ready!

🔨 Explore the source changes: 89df2f4

🔍 Inspect the deploy log: https://app.netlify.com/sites/cambiatus-elm-book/deploys/62155b038b6e62000790eb69

😎 Browse the preview: https://deploy-preview-676--cambiatus-elm-book.netlify.app

@henriquecbuss
Copy link
Member Author

@lucca65 this PR is not supposed to include the permission configuration screens, right? Just showing the modal when the user doesn't have enough permissions to do stuff?

Here's a list of the necessary permissions for each action, please correct me if I'm wrong:

  • verifyclaim: Verify permission
  • claimaction: Claim permission
  • createsale: Sell permission
  • updatesale: Sell permission
  • transfersale: Order permission

From what I could find, these are all of the community actions we call on the frontend that require permissions. I also see that users need the invite permission to invite other users. Should we hide the button that generates the invite link if the user doesn't have that permission?

@lucca65
Copy link
Member

lucca65 commented Feb 22, 2022

@lucca65 this PR is not supposed to include the permission configuration screens, right? Just showing the modal when the user doesn't have enough permissions to do stuff?

Just the modal is enough for now!

Here's a list of the necessary permissions for each action, please correct me if I'm wrong:

That is right! Reward also requires a permission but we don't have this on the frontend yet

Should we hide the button that generates the invite link if the user doesn't have that permission?

No, we should also show the error modal, at least for now!

@henriquecbuss
Copy link
Member Author

@lucca65 is the backend synced with this new version? Seems like I can perform actions I don't have permissions to do (at least according to GraphQL). Looking at the GraphQL response, my user has no roles (and hence no permissions):

image

However, I can create and update sales, buy stuff from the shop and claim actions (I only get a permission error when trying to vote on claims)

Copy link
Member

@lucca65 lucca65 left a comment

Choose a reason for hiding this comment

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

Looks nice!! can't wait to finally have this working!! we need to make sure the test is good for this, though. @juramos-2020 please share with me three accounts you use for testing? one must be an admin and the others can be normal members. I'll create a few scenarios for testing

@juramos-2020
Copy link

Claro @lucca65

Segue conta admin:

Heltonlr4141 (admin)
beyond notice town crawl rally argue shove pride exhaust hat deliver twenty

Outros membros

ju3141441515
mesh blouse quarter then lunar disorder group punch maid frame mobile border

Miguel313314
squeeze true disagree joke lizard assault zone child goddess script bench boost

:

@lucca65
Copy link
Member

lucca65 commented Feb 23, 2022

@NeoVier event-source still don't sync up with new contract actions, this will be done in a part 2 of this task, that will include more stuff: transfer permission and clean up of RAM by removing old data (objectives)

@henriquecbuss henriquecbuss merged commit 3d4b408 into master Feb 23, 2022
@henriquecbuss henriquecbuss deleted the enhancement/contract-update branch February 23, 2022 15:49
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.

Atualizar as chamadas das actions em nossos contratos
3 participants