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

[governance] "Finished Vote" tab filters #2854

Merged

Conversation

victorgcramos
Copy link
Member

This diff adds the possibility to filter finished voting proposals by its approved or rejected status.

I think we cannot filter proposals by timestamp, since timestamp filtering is not implemented on politeia, but we can add some filters into the Finished Vote tab, so we could filter props by Approved and Rejected status.

Closes #2786

@vctt94 vctt94 requested a review from jholdstock November 6, 2020 14:38
Copy link
Member

@jholdstock jholdstock left a comment

Choose a reason for hiding this comment

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

The filters buttons work nicely and solve my issue reported in #2786, but there is an expanse of blank space now (red on screenshot). I think this can be reduced by reducing the height of the buttons and the margin above/below them.

Screenshot from 2020-11-10 14-25-08

This diff adds the possibility to filter finished voting proposals by
its approved or rejected status.

Also, this fixes an infinite scroller bug caused by long height screens.
@jholdstock
Copy link
Member

jholdstock commented Nov 11, 2020

lgtm

@victorgcramos victorgcramos force-pushed the 2786-proposal-finished-voting-list branch from 5015d8e to 10080ac Compare November 11, 2020 13:38
Copy link
Member

@amass01 amass01 left a comment

Choose a reason for hiding this comment

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

LGTM, added couple of small suggestions.

@@ -7,6 +7,8 @@ import * as gov from "actions/GovernanceActions";
import { usePrevious } from "hooks";
import { setLastPoliteiaAccessTime } from "actions/WalletLoaderActions";

const MAX_PAGE_SIZE = 20; // TODO: Get proposallistpagesize from politeia's request: /v1/policy
Copy link
Member

Choose a reason for hiding this comment

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

Worth creating an issue

@@ -18,7 +20,7 @@ export function useProposalsTab() {
const [tab, setTab] = useReducer(() => getProposalsTab(location));

useEffect(() => {
dispatch(setLastPoliteiaAccessTime());
return () => dispatch(setLastPoliteiaAccessTime());
Copy link
Member

Choose a reason for hiding this comment

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

👍

@@ -157,7 +156,7 @@ const onLoadMoreProposals = async (

const proposalBatch = inventory.slice(proposalLength, proposalNumber);
try {
await getProposalsAndUpdateVoteStatus(proposalBatch);
return await getProposalsAndUpdateVoteStatus(proposalBatch);
Copy link
Member

Choose a reason for hiding this comment

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

can you please ditch the console.log in the catch block ?

Copy link
Member

@vctt94 vctt94 left a comment

Choose a reason for hiding this comment

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

LGTM

@alexlyp alexlyp merged commit 4201c43 into decred:master Nov 11, 2020
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.

"Finished Voting" proposals ordering
5 participants