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: confusing warning for changing voting policy #252

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,16 @@ return (
content: (
<div className="d-flex flex-column gap-2">
This action will result in significant changes to the system.
<div className="d-flex gap-3 warning px-3 py-2 rounded-3">
<i class="bi bi-exclamation-triangle warning-icon h5"></i>
<div>
Changing this setting will require {requiredVotes} vote(s)
to approve requests. You will no longer be able to approve
requests with {selectedGroup.requiredVotes} vote(s).
{requiredVotes != selectedGroup.requiredVotes && (
<div className="d-flex gap-3 warning px-3 py-2 rounded-3">
<i class="bi bi-exclamation-triangle warning-icon h5"></i>
<div>
Changing this setting will require {requiredVotes} vote(s)
to approve requests. You will no longer be able to approve
requests with {selectedGroup.requiredVotes} vote(s).
</div>
</div>
</div>
)}
</div>
),
confirmLabel: "Confirm",
Expand Down Expand Up @@ -419,11 +421,15 @@ return (
if (isPercentageSelected) {
if (number > 100)
setValueError("Maximum percentage allowed is 100.");
else if (number < 1)
setValueError("Minimum percentage allowed is 1.");
} else {
if (number > selectedGroup.members.length)
setValueError(
`Maximum members allowed is ${selectedGroup.members.length}.`
);
if (number < 1)
setValueError("Minimum members allowed is 1.");
}
},
value: selectedVoteValue,
Expand Down
Loading