|
88 | 88 | </template> |
89 | 89 | </el-table-column> |
90 | 90 | <el-table-column prop="title" label="Title" min-width="200" sortable /> |
91 | | - <el-table-column prop="status" label="Status" width="120" sortable> |
| 91 | + <el-table-column |
| 92 | + prop="status" |
| 93 | + label="Status" |
| 94 | + width="120" |
| 95 | + sortable |
| 96 | + :sort-method="(a, b) => getStatusOrder(a.status) - getStatusOrder(b.status)" |
| 97 | + > |
92 | 98 | <template #default="{ row }"> |
93 | 99 | <el-tag size="small">{{ formatStatus(row.status) }}</el-tag> |
94 | 100 | </template> |
95 | 101 | </el-table-column> |
96 | | - <el-table-column prop="priority" label="Priority" width="100" sortable> |
| 102 | + <el-table-column |
| 103 | + prop="priority" |
| 104 | + label="Priority" |
| 105 | + width="100" |
| 106 | + sortable |
| 107 | + :sort-method="(a, b) => getPriorityOrder(a.priority) - getPriorityOrder(b.priority)" |
| 108 | + > |
97 | 109 | <template #default="{ row }"> |
98 | 110 | <span :class="['priority-badge', `priority-${row.priority}`]"> |
99 | 111 | {{ row.priority }} |
@@ -213,6 +225,22 @@ const { activeProjectId, hasActiveProject } = useProject(); |
213 | 225 | // Only users (not contacts) can be assigned to issues |
214 | 226 | const assignableMembers = computed(() => teamMembers.value.filter(m => m.isUser !== false)); |
215 | 227 |
|
| 228 | + // Status workflow order for sorting |
| 229 | + const STATUS_ORDER = ['backlog', 'todo', 'in_progress', 'review', 'done']; |
| 230 | + |
| 231 | + const getStatusOrder = (status) => { |
| 232 | + const index = STATUS_ORDER.indexOf(status); |
| 233 | + return index === -1 ? 999 : index; // Unknown statuses go to the end |
| 234 | + }; |
| 235 | +
|
| 236 | + // Priority order for sorting (highest to lowest urgency) |
| 237 | + const PRIORITY_ORDER = ['urgent', 'high', 'medium', 'low']; |
| 238 | + |
| 239 | + const getPriorityOrder = (priority) => { |
| 240 | + const index = PRIORITY_ORDER.indexOf(priority); |
| 241 | + return index === -1 ? 999 : index; // Unknown priorities go to the end |
| 242 | + }; |
| 243 | +
|
216 | 244 | // Initial simple filtering (can be expanded) |
217 | 245 | const filteredIssues = computed(() => issues.value); |
218 | 246 |
|
|
0 commit comments