Add status on proposals

This commit is contained in:
MartinBraquet
2025-10-26 10:51:52 +01:00
parent 0fa562e6fd
commit 4c4f2e720d
7 changed files with 56 additions and 16 deletions

View File

@@ -945,6 +945,7 @@ export type Database = {
description: Json | null
id: number
is_anonymous: boolean | null
status: string | null
title: string
}
Insert: {
@@ -953,6 +954,7 @@ export type Database = {
description?: Json | null
id?: never
is_anonymous?: boolean | null
status?: string | null
title: string
}
Update: {
@@ -961,6 +963,7 @@ export type Database = {
description?: Json | null
id?: never
is_anonymous?: boolean | null
status?: string | null
title?: string
}
Relationships: [
@@ -1009,6 +1012,7 @@ export type Database = {
id: number
is_anonymous: boolean
priority: number
status: string
title: string
votes_abstain: number
votes_against: number

View File

@@ -1,7 +1,26 @@
export const ORDER_BY = ['recent', 'mostVoted', 'priority'] as const
export type OrderBy = typeof ORDER_BY[number]
export const Constants: Record<OrderBy, string> = {
export const ORDER_BY_CHOICES: Record<OrderBy, string> = {
recent: 'Most recent',
mostVoted: 'Most voted',
priority: 'Highest Priority',
}
}
export const STATUS_CHOICES: Record<string, string> = {
draft: "Draft",
under_review: "Under Review",
voting_open: "Voting Open",
voting_closed: "Voting Closed",
accepted: "Accepted",
pending: "Pending Implementation",
implemented: "Implemented ✔️",
rejected: "Rejected ❌",
cancelled: "Cancelled 🚫",
superseded: "Superseded",
expired: "Expired ⌛",
archived: "Archived",
}
export const REVERSED_STATUS_CHOICES: Record<string, string> = Object.fromEntries(
Object.entries(STATUS_CHOICES).map(([key, value]) => [value, key])
)