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: sort proposals #5675
feat: sort proposals #5675
Conversation
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.
Just minor code convention changes then it is good to go 😄
import { isVisibleProposal } from '@contexts/governance/utils/isVisibleProposal' | ||
import { sortProposals } from '@contexts/governance/utils/sortProposals' |
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.
Both modules can be added to the utils index and then imported in the same line
import { isVisibleProposal } from '@contexts/governance/utils/isVisibleProposal' | |
import { sortProposals } from '@contexts/governance/utils/sortProposals' | |
import { isVisibleProposal, sortProposals } from '@contexts/governance/utils' |
export * from './proposal-type.enum' | ||
export * from './proposal-status.enum' |
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.
just sorting this by alphabetic order
export * from './proposal-type.enum' | |
export * from './proposal-status.enum' | |
export * from './proposal-status.enum' | |
export * from './proposal-type.enum' |
isAscending = filter.order.ascDesc === OrderOption.Asc | ||
} | ||
|
||
return proposals?.sort((proposal1, propsal2) => orderFunction(proposal1, propsal2, isAscending)) ?? [] |
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.
typo
return proposals?.sort((proposal1, propsal2) => orderFunction(proposal1, propsal2, isAscending)) ?? [] | |
return proposals?.sort((proposal1, proposal2) => orderFunction(proposal1, proposal2, isAscending)) ?? [] |
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.
I pushed the fixes
Summary
This PR includes different sorting options for proposals
Changelog
Relevant Issues
Closes #5255
Testing
Platforms
Instructions
...
Checklist