Skip to content

Commit

Permalink
Merge branch 'main' into settings-dao
Browse files Browse the repository at this point in the history
  • Loading branch information
Megha-Dev-19 committed Jan 25, 2024
2 parents 27d4b30 + bda3421 commit b5e204b
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 37 deletions.
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behaviour:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behaviour**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

## Feature Request

### Description
A clear and concise description of the feature you are proposing.

### Use Case

Describe the problem or need that this feature aims to address. Include any scenarios or examples that illustrate the use case.

### Proposed Solution

If you have a specific solution in mind, provide details on how you envision the feature working.

### Benefits

Explain the benefits of implementing this feature. How will it improve the project or user experience?

## Improvement Suggestion

###Description:
A clear and concise description of the improvement you are suggesting.

### Current Situation

Describe the current state or behavior that you believe could be improved. Include any pain points, limitations, or areas where the project can be enhanced.

### Proposed Improvement

If you have specific ideas or suggestions for improvement, outline them here. Be clear about how the suggested changes will benefit the project.

### Benefits

Explain the benefits of implementing this improvement. How will it positively impact the project or user experience?
16 changes: 9 additions & 7 deletions apps/astraplusplus/widget/Common/Modals/Voters.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,15 @@ return (
{Object.keys(votes).length === 0 && (
<span className="text-muted text-center">No votes yet</span>
)}
{votersCount > Object.keys(votes).length && (
<div>
Note: Indexer is currently running behind schedule, and the
expected results may take longer to appear. We appreciate your
patience and apologize for any inconvenience.
</div>
)}
{isCongressDaoID &&
isVotingBodyDao &&
votersCount > Object.keys(votes).length && (
<div>
Note: Indexer is currently running behind schedule, and the
expected results may take longer to appear. We appreciate
your patience and apologize for any inconvenience.
</div>
)}
{Object.keys(votes).map((voterId) => {
const vote =
isCongressDaoID || isVotingBodyDao
Expand Down
3 changes: 0 additions & 3 deletions apps/astraplusplus/widget/DAO/Projects.jsx

This file was deleted.

10 changes: 7 additions & 3 deletions apps/astraplusplus/widget/DAO/Proposals/Card/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,12 @@ const expensiveWork = () => {
: 0;

// Apply the threshold
const votesNeeded = Math.ceil(
(threshold[0] / threshold[1]) * eligibleVoters
);
if (eligibleVoters === 0) {
return;
}
const votesNeeded =
Math.floor((threshold[0] / threshold[1]) * eligibleVoters) +
1;

totalVotesNeeded += votesNeeded;
}
Expand Down Expand Up @@ -367,6 +370,7 @@ const expensiveWork = () => {
};

Object.keys(my_proposal.vote_counts).forEach((key) => {
if (key === "all") return;
totalVotes.yes += my_proposal.vote_counts[key][0];
totalVotes.no += my_proposal.vote_counts[key][1];
totalVotes.spam += my_proposal.vote_counts[key][2];
Expand Down
27 changes: 13 additions & 14 deletions apps/astraplusplus/widget/DAO/Proposals/Card/ui.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ function renderVoteButtons({
isAllowedToVote,
handleVote
}) {
const finished = statusName !== "In Progress";
const VoteButton = styled.button`
width: 100%;
border-radius: 15px;
Expand All @@ -518,8 +519,8 @@ function renderVoteButtons({
color: #000;
transition: all 0.4s ease-in-out;
}
${({ finsihed, percentage, disabled }) => {
if (finsihed) {
${({ finished, percentage, disabled }) => {
if (finished) {
if (percentage > 80) {
return `
&.no > div:last-child {
Expand Down Expand Up @@ -573,8 +574,8 @@ function renderVoteButtons({
min-width: ${({ percentage }) =>
percentage && percentage > 5 ? `${percentage}%` : "5px"};
${({ finsihed, wins }) =>
finsihed &&
${({ finished, wins }) =>
finished &&
wins &&
`
display: none;
Expand Down Expand Up @@ -632,8 +633,6 @@ function renderVoteButtons({
abstain: statusName === "Failed"
};

const finsihed = statusName !== "In Progress";

const voted = {
yes: checkVotesForCongressDao("Approve"),
no: checkVotesForCongressDao("Reject"),
Expand Down Expand Up @@ -676,11 +675,11 @@ function renderVoteButtons({
<VoteButton
className="yes"
percentage={percentages.yes}
finsihed={finsihed}
finished={finished}
wins={wins.yes}
myVote={voted.yes}
onClick={() => handleVote("VoteApprove")}
disabled={alreadyVoted || finsihed || !isAllowedToVote[0]}
disabled={alreadyVoted || finished || !isAllowedToVote[0]}
>
<div>
{wins.yes && (
Expand All @@ -698,11 +697,11 @@ function renderVoteButtons({
<VoteButton
className="no"
percentage={percentages.no}
finsihed={finsihed}
finished={finished}
wins={wins.no}
myVote={voted.no}
onClick={() => handleVote("VoteReject")}
disabled={alreadyVoted || finsihed || !isAllowedToVote[1]}
disabled={alreadyVoted || finished || !isAllowedToVote[1]}
>
<div className="d-flex gap-2 align-items-center">
{wins.no && (
Expand All @@ -722,12 +721,12 @@ function renderVoteButtons({
<VoteButton
className="abstain"
percentage={percentages.abstain}
finsihed={finsihed}
finished={finished}
wins={wins.abstain}
myVote={voted.abstain}
onClick={() => handleVote("VoteAbstain")}
disabled={
alreadyVoted || finsihed || !isAllowedToVote[2]
alreadyVoted || finished || !isAllowedToVote[2]
}
>
<div className="d-flex gap-2 align-items-center">
Expand All @@ -744,7 +743,7 @@ function renderVoteButtons({
<VoteButton
className="spam"
percentage={percentages.spam}
finsihed={finsihed}
finished={finished}
wins={wins.spam}
myVote={voted.spam}
onClick={() =>
Expand All @@ -753,7 +752,7 @@ function renderVoteButtons({
)
}
disabled={
alreadyVoted || finsihed || !isAllowedToVote[2]
alreadyVoted || finished || !isAllowedToVote[2]
}
>
<div className="d-flex gap-2 align-items-center">
Expand Down
10 changes: 0 additions & 10 deletions apps/astraplusplus/widget/DAO/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,6 @@ const tabs = {
dev: props.dev ?? false
})
},
projects: {
name: "Projects",
widget: "DAO.Projects",
href: constructURL({
tab: "projects",
daoId: state.daoId,
dev: props.dev ?? false
})
},
followers: {
name: "Followers",
widget: "DAO.Followers.index",
Expand Down Expand Up @@ -117,7 +108,6 @@ const tabs = {

if (isCongressDaoID || props.daoId === VotingBodyDaoId) {
delete tabs["funds"];
delete tabs["projects"];
delete tabs["bounties"];
delete tabs["settings"];
}
Expand Down

0 comments on commit b5e204b

Please sign in to comment.