hook up proposal stage filters
This commit is contained in:
parent
84dd969136
commit
4ce3ea4dbe
|
@ -4,6 +4,7 @@ import {
|
|||
CONTRIBUTION_STATUSES,
|
||||
PROPOSAL_ARBITER_STATUSES,
|
||||
MILESTONE_STAGES,
|
||||
PROPOSAL_STAGES,
|
||||
} from './statuses';
|
||||
|
||||
export interface Filter {
|
||||
|
@ -35,6 +36,14 @@ const PROPOSAL_FILTERS = PROPOSAL_STATUSES.map(s => ({
|
|||
group: 'Status',
|
||||
}))
|
||||
// proposal has extra filters
|
||||
.concat(
|
||||
PROPOSAL_STAGES.map(s => ({
|
||||
id: `STAGE_${s.id}`,
|
||||
display: `Stage: ${s.tagDisplay}`,
|
||||
color: s.tagColor,
|
||||
group: 'Stage',
|
||||
})),
|
||||
)
|
||||
.concat(
|
||||
PROPOSAL_ARBITER_STATUSES.map(s => ({
|
||||
id: `ARBITER_${s.id}`,
|
||||
|
|
|
@ -4,6 +4,7 @@ import {
|
|||
CONTRIBUTION_STATUS,
|
||||
PROPOSAL_ARBITER_STATUS,
|
||||
MILESTONE_STAGE,
|
||||
PROPOSAL_STAGE,
|
||||
} from 'src/types';
|
||||
|
||||
export interface StatusSoT<E> {
|
||||
|
@ -92,6 +93,33 @@ export const PROPOSAL_STATUSES: Array<StatusSoT<PROPOSAL_STATUS>> = [
|
|||
},
|
||||
];
|
||||
|
||||
export const PROPOSAL_STAGES: Array<StatusSoT<PROPOSAL_STAGE>> = [
|
||||
{
|
||||
id: PROPOSAL_STAGE.PREVIEW,
|
||||
tagDisplay: 'Preview',
|
||||
tagColor: '#afd500',
|
||||
hint: 'Proposal is not yet published.',
|
||||
},
|
||||
{
|
||||
id: PROPOSAL_STAGE.FUNDING_REQUIRED,
|
||||
tagDisplay: 'Funding',
|
||||
tagColor: '#bebebe',
|
||||
hint: 'Proposal has been published but still needs funding.',
|
||||
},
|
||||
{
|
||||
id: PROPOSAL_STAGE.WIP,
|
||||
tagDisplay: 'WIP',
|
||||
tagColor: '#8d8d8d',
|
||||
hint: 'Proposal is fully funded and the work is being done.',
|
||||
},
|
||||
{
|
||||
id: PROPOSAL_STAGE.COMPLETED,
|
||||
tagDisplay: 'Completed',
|
||||
tagColor: '#108ee9',
|
||||
hint: 'Proposal was accepted, published, funded and all funds paid out.',
|
||||
},
|
||||
];
|
||||
|
||||
export const PROPOSAL_ARBITER_STATUSES: Array<StatusSoT<PROPOSAL_ARBITER_STATUS>> = [
|
||||
{
|
||||
id: PROPOSAL_ARBITER_STATUS.MISSING,
|
||||
|
|
|
@ -84,10 +84,8 @@ class ProposalPagination(Pagination):
|
|||
|
||||
if status_filters:
|
||||
query = query.filter(Proposal.status.in_(status_filters))
|
||||
# TODO: figure out what is going to happen with stages
|
||||
if stage_filters:
|
||||
self._raise('stage filters not yet supported')
|
||||
# query = query.filter(Proposal.stage.in_(stage_filters))
|
||||
query = query.filter(Proposal.stage.in_(stage_filters))
|
||||
if cat_filters:
|
||||
query = query.filter(Proposal.category.in_(cat_filters))
|
||||
if arbiter_filters:
|
||||
|
|
Loading…
Reference in New Issue