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

[ENG-166]: Fix displaying role's proposal creation permissions #2704

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

mudrila
Copy link
Contributor

@mudrila mudrila commented Feb 1, 2025

Changes

  • Fix displaying role's proposal creation permissions in view / edit "mode"
  • Fix displaying proposal threshold in DAO settings for ERC-721 DAO
  • Fix updating / deleting ERC-721 voting strategy when there's existing whitelisting strategy

Issues

  • ENG-166

Testing

Pre-setup

  1. Create NFT Voting DAO
  2. Create couple of roles
  3. Grant "Can create proposals" permissions for one role
  4. Execute proposal

Proper role's permissions display

  1. Navigate to Roles page, open role details -> make sure "Proposals" green badge is displayed
  2. Click "Edit Role" -> make sure switch is ON for that role
  3. Make sure other roles, which don't have permissions don't have "Proposals" green badge, in "Edit" mode switch should be OFF

Updating proposer threshold / deleting voting strategy

  1. Navigate to DAO Settings -> permissions tab
  2. Make sure proper proposal threshold is displayed in the card
  3. Try editing threshold - make sure new threshold is propagated after proposal execution
  4. Try deleting strategy (click trash icon after clicking on "Edit" pencil icon)
  5. Make sure strategy is disabled, but you still can create proposals through whitelisted roles

Screenshots

Screenshot 2025-02-01 at 01 38 42 Screenshot 2025-02-01 at 01 38 58 Screenshot 2025-02-01 at 01 39 09 Screenshot 2025-02-01 at 01 39 32

…proposer threshold and deleting ERC-721 voting strategy in DAO settings
@mudrila mudrila added the bug Something isn't working label Feb 1, 2025
@mudrila mudrila self-assigned this Feb 1, 2025
Copy link

linear bot commented Feb 1, 2025

const roleTermNominee = role.roleTerms?.[0].nominee;
const roleTermNominee = role.roleTerms?.[0]?.nominee;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there bad type safety here? I believe there was type safety conditionals put in place above this component, nominee must be defined.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yess - I was getting crash unless I've added this chaining

Copy link
Contributor

@Da-Colon Da-Colon left a comment

Choose a reason for hiding this comment

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

Approving, but man we have so many in place conditionals.

@mudrila mudrila merged commit 2bd3359 into develop Feb 4, 2025
4 checks passed
@mudrila mudrila deleted the fix/nft-whitelisting-and-role-permissions branch February 4, 2025 15:36
Copy link

sentry-io bot commented Feb 5, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ TypeError: Cannot read properties of undefined (reading 'nominee') //roles/edit View Issue

Did you find this useful? React with a 👍 or 👎

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
None yet
Development

Successfully merging this pull request may close these issues.

3 participants