-
Notifications
You must be signed in to change notification settings - Fork 378
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
feat(govdao): better rendering #3096
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
@leohhhn can you add the prop title in the list too? Maybe just the N first chars. |
I was about to; but then i realized there isn't a title field in the prop structure/interface. Is there a reason for this? If not, I can add it (I did the same thing in my previous PR) |
Yeah, I think it makes sense for a prop to have a required title and an optional or required description. |
@@ -58,5 +61,5 @@ type Proposal interface { | |||
IsExpired() bool | |||
|
|||
// Render renders the proposal in a readable format | |||
Render() string | |||
Render(idx int, authorUsername string) string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The caller shouldn't need to specify these things, the Proposal
should know about them internally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be a phishing vector
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two issues:
- The
Proposal
interface doesn't have a built-inID
- should we add this? Otherwise, prop page rendering can be done inside of ther/gov/v2
realm, but it will be split up betweenr/gov/v2
&simpledao
, making it a bit ugly. - This is a
p/
- to resolve usernames, we need to accessr/demo/users
; importing ar/
inside of ap/
will be forbidden soon. We can set the username upon prop creation, but it will not be updated later if a user is not registered initially and then registers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out.WriteString(ufmt.Sprintf("#### Status: %s\n\n", strings.ToUpper(p.Status().String()))) | ||
|
||
out.WriteString(ufmt.Sprintf( | ||
"#### Voting stats:\n- YES %d (%d%%)\n- NO %d (%d%%)\n- ABSTAIN %d (%d%%)\n- MISSING VOTE %d (%d%%)\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MISSING VOTES
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used to be like that, I assumed there was a reason; changed it: 1a9c7ed
Can be useful for #3096. --------- Signed-off-by: moul <[email protected]>
Made some more changes. Check out the comments & the prop page that was updated a bit. |
Merge RequirementsThe following requirements must be fulfilled before a pull request can be merged. These requirements are defined in this configuration file. Automated Checks🟢 Maintainers must be able to edit this pull request Details
Manual Checks
Details
|
Description
Introduces better
gnoweb
rendering for the GovDAO suite, and better help page actions for voting on proposals.Home page before:
Home page after (also resolves usernames from
r/demo/users
):Prop page before:
Prop page after:
The actions bar notifies the user when the proposal is no longer active as well.
Continuation of #2579
Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the description