forked from cardosofelipe/fast-next-template
fix(frontend): align issue types with backend enums
- Fix IssueStatus: remove 'done', keep 'closed' - Add IssuePriority 'critical' level - Add IssueType enum (epic, story, task, bug) - Update constants, hooks, and mocks to match - Fix StatusWorkflow component icons 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -26,7 +26,6 @@ const STATUS_ICONS = {
|
||||
in_progress: PlayCircle,
|
||||
in_review: Clock,
|
||||
blocked: AlertCircle,
|
||||
done: CheckCircle2,
|
||||
closed: XCircle,
|
||||
} as const;
|
||||
|
||||
|
||||
@@ -22,14 +22,17 @@ export const STATUS_CONFIG: Record<IssueStatus, StatusConfig> = {
|
||||
in_progress: { label: 'In Progress', color: 'text-yellow-500' },
|
||||
in_review: { label: 'In Review', color: 'text-purple-500' },
|
||||
blocked: { label: 'Blocked', color: 'text-red-500' },
|
||||
done: { label: 'Done', color: 'text-green-500' },
|
||||
closed: { label: 'Closed', color: 'text-muted-foreground' },
|
||||
closed: { label: 'Closed', color: 'text-green-500' },
|
||||
};
|
||||
|
||||
/**
|
||||
* Priority configuration with labels and colors
|
||||
*/
|
||||
export const PRIORITY_CONFIG: Record<IssuePriority, PriorityConfig> = {
|
||||
critical: {
|
||||
label: 'Critical',
|
||||
color: 'bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200',
|
||||
},
|
||||
high: { label: 'High', color: 'bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200' },
|
||||
medium: {
|
||||
label: 'Medium',
|
||||
@@ -46,10 +49,9 @@ export const STATUS_TRANSITIONS: StatusTransition[] = [
|
||||
{ from: 'open', to: 'in_progress', label: 'Start Work' },
|
||||
{ from: 'in_progress', to: 'in_review', label: 'Submit for Review' },
|
||||
{ from: 'in_progress', to: 'blocked', label: 'Mark Blocked' },
|
||||
{ from: 'in_review', to: 'done', label: 'Mark Done' },
|
||||
{ from: 'in_review', to: 'closed', label: 'Complete' },
|
||||
{ from: 'in_review', to: 'in_progress', label: 'Request Changes' },
|
||||
{ from: 'blocked', to: 'in_progress', label: 'Unblock' },
|
||||
{ from: 'done', to: 'closed', label: 'Close Issue' },
|
||||
{ from: 'closed', to: 'open', label: 'Reopen' },
|
||||
];
|
||||
|
||||
@@ -76,14 +78,13 @@ export const STATUS_ORDER: IssueStatus[] = [
|
||||
'in_progress',
|
||||
'in_review',
|
||||
'blocked',
|
||||
'done',
|
||||
'closed',
|
||||
];
|
||||
|
||||
/**
|
||||
* All possible priorities in order
|
||||
*/
|
||||
export const PRIORITY_ORDER: IssuePriority[] = ['high', 'medium', 'low'];
|
||||
export const PRIORITY_ORDER: IssuePriority[] = ['critical', 'high', 'medium', 'low'];
|
||||
|
||||
/**
|
||||
* Sync status configuration
|
||||
|
||||
@@ -94,7 +94,7 @@ function filterAndSortIssues(
|
||||
case 'number':
|
||||
return (a.number - b.number) * direction;
|
||||
case 'priority': {
|
||||
const priorityOrder = { high: 3, medium: 2, low: 1 };
|
||||
const priorityOrder = { critical: 4, high: 3, medium: 2, low: 1 };
|
||||
return (priorityOrder[a.priority] - priorityOrder[b.priority]) * direction;
|
||||
}
|
||||
case 'updated_at':
|
||||
|
||||
@@ -16,6 +16,7 @@ export const mockIssues: IssueSummary[] = [
|
||||
{
|
||||
id: 'ISS-001',
|
||||
number: 42,
|
||||
type: 'story',
|
||||
title: 'Implement user authentication flow',
|
||||
description:
|
||||
'Create complete authentication flow with login, register, and password reset.',
|
||||
@@ -31,6 +32,7 @@ export const mockIssues: IssueSummary[] = [
|
||||
{
|
||||
id: 'ISS-002',
|
||||
number: 43,
|
||||
type: 'task',
|
||||
title: 'Design product catalog component',
|
||||
description: 'Create reusable product card and catalog grid components.',
|
||||
status: 'in_review',
|
||||
@@ -45,6 +47,7 @@ export const mockIssues: IssueSummary[] = [
|
||||
{
|
||||
id: 'ISS-003',
|
||||
number: 44,
|
||||
type: 'bug',
|
||||
title: 'Fix cart total calculation bug',
|
||||
description: 'Cart total shows incorrect amount when discount is applied.',
|
||||
status: 'blocked',
|
||||
@@ -60,6 +63,7 @@ export const mockIssues: IssueSummary[] = [
|
||||
{
|
||||
id: 'ISS-004',
|
||||
number: 45,
|
||||
type: 'story',
|
||||
title: 'Add product search functionality',
|
||||
description: 'Implement full-text search with filters for the product catalog.',
|
||||
status: 'open',
|
||||
@@ -74,9 +78,10 @@ export const mockIssues: IssueSummary[] = [
|
||||
{
|
||||
id: 'ISS-005',
|
||||
number: 46,
|
||||
type: 'task',
|
||||
title: 'Optimize database queries for product listing',
|
||||
description: 'Performance optimization for product queries with pagination.',
|
||||
status: 'done',
|
||||
status: 'closed',
|
||||
priority: 'low',
|
||||
labels: ['performance', 'backend', 'database'],
|
||||
sprint: 'Sprint 2',
|
||||
@@ -88,9 +93,10 @@ export const mockIssues: IssueSummary[] = [
|
||||
{
|
||||
id: 'ISS-006',
|
||||
number: 47,
|
||||
type: 'task',
|
||||
title: 'Create checkout page wireframes',
|
||||
description: 'Design wireframes for the checkout flow including payment selection.',
|
||||
status: 'done',
|
||||
status: 'closed',
|
||||
priority: 'high',
|
||||
labels: ['design', 'checkout', 'ui'],
|
||||
sprint: 'Sprint 2',
|
||||
@@ -102,6 +108,7 @@ export const mockIssues: IssueSummary[] = [
|
||||
{
|
||||
id: 'ISS-007',
|
||||
number: 48,
|
||||
type: 'story',
|
||||
title: 'Implement responsive navigation',
|
||||
description: 'Create mobile-friendly navigation with hamburger menu.',
|
||||
status: 'open',
|
||||
@@ -116,6 +123,7 @@ export const mockIssues: IssueSummary[] = [
|
||||
{
|
||||
id: 'ISS-008',
|
||||
number: 49,
|
||||
type: 'task',
|
||||
title: 'Set up E2E test framework',
|
||||
description: 'Configure Playwright for end-to-end testing.',
|
||||
status: 'in_progress',
|
||||
@@ -135,6 +143,7 @@ export const mockIssues: IssueSummary[] = [
|
||||
export const mockIssueDetail: IssueDetail = {
|
||||
id: 'ISS-001',
|
||||
number: 42,
|
||||
type: 'story',
|
||||
title: 'Implement user authentication flow',
|
||||
description: `## Overview
|
||||
Create a complete authentication flow for the e-commerce platform.
|
||||
|
||||
@@ -8,14 +8,22 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Issue status values
|
||||
* Issue type values (for hierarchy: Epic -> Story -> Task)
|
||||
* Matches backend: IssueType enum in app/models/syndarix/enums.py
|
||||
*/
|
||||
export type IssueStatus = 'open' | 'in_progress' | 'in_review' | 'blocked' | 'done' | 'closed';
|
||||
export type IssueType = 'epic' | 'story' | 'task' | 'bug';
|
||||
|
||||
/**
|
||||
* Issue status values
|
||||
* Matches backend: IssueStatus enum in app/models/syndarix/enums.py
|
||||
*/
|
||||
export type IssueStatus = 'open' | 'in_progress' | 'in_review' | 'blocked' | 'closed';
|
||||
|
||||
/**
|
||||
* Issue priority values
|
||||
* Matches backend: IssuePriority enum in app/models/syndarix/enums.py
|
||||
*/
|
||||
export type IssuePriority = 'high' | 'medium' | 'low';
|
||||
export type IssuePriority = 'low' | 'medium' | 'high' | 'critical';
|
||||
|
||||
/**
|
||||
* Sync status with external trackers
|
||||
@@ -64,6 +72,7 @@ export interface IssueActivity {
|
||||
export interface IssueSummary {
|
||||
id: string;
|
||||
number: number;
|
||||
type: IssueType;
|
||||
title: string;
|
||||
description: string;
|
||||
status: IssueStatus;
|
||||
|
||||
Reference in New Issue
Block a user