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_progress: PlayCircle,
|
||||||
in_review: Clock,
|
in_review: Clock,
|
||||||
blocked: AlertCircle,
|
blocked: AlertCircle,
|
||||||
done: CheckCircle2,
|
|
||||||
closed: XCircle,
|
closed: XCircle,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
|||||||
@@ -22,14 +22,17 @@ export const STATUS_CONFIG: Record<IssueStatus, StatusConfig> = {
|
|||||||
in_progress: { label: 'In Progress', color: 'text-yellow-500' },
|
in_progress: { label: 'In Progress', color: 'text-yellow-500' },
|
||||||
in_review: { label: 'In Review', color: 'text-purple-500' },
|
in_review: { label: 'In Review', color: 'text-purple-500' },
|
||||||
blocked: { label: 'Blocked', color: 'text-red-500' },
|
blocked: { label: 'Blocked', color: 'text-red-500' },
|
||||||
done: { label: 'Done', color: 'text-green-500' },
|
closed: { label: 'Closed', color: 'text-green-500' },
|
||||||
closed: { label: 'Closed', color: 'text-muted-foreground' },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Priority configuration with labels and colors
|
* Priority configuration with labels and colors
|
||||||
*/
|
*/
|
||||||
export const PRIORITY_CONFIG: Record<IssuePriority, PriorityConfig> = {
|
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' },
|
high: { label: 'High', color: 'bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200' },
|
||||||
medium: {
|
medium: {
|
||||||
label: 'Medium',
|
label: 'Medium',
|
||||||
@@ -46,10 +49,9 @@ export const STATUS_TRANSITIONS: StatusTransition[] = [
|
|||||||
{ from: 'open', to: 'in_progress', label: 'Start Work' },
|
{ from: 'open', to: 'in_progress', label: 'Start Work' },
|
||||||
{ from: 'in_progress', to: 'in_review', label: 'Submit for Review' },
|
{ from: 'in_progress', to: 'in_review', label: 'Submit for Review' },
|
||||||
{ from: 'in_progress', to: 'blocked', label: 'Mark Blocked' },
|
{ 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: 'in_review', to: 'in_progress', label: 'Request Changes' },
|
||||||
{ from: 'blocked', to: 'in_progress', label: 'Unblock' },
|
{ from: 'blocked', to: 'in_progress', label: 'Unblock' },
|
||||||
{ from: 'done', to: 'closed', label: 'Close Issue' },
|
|
||||||
{ from: 'closed', to: 'open', label: 'Reopen' },
|
{ from: 'closed', to: 'open', label: 'Reopen' },
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -76,14 +78,13 @@ export const STATUS_ORDER: IssueStatus[] = [
|
|||||||
'in_progress',
|
'in_progress',
|
||||||
'in_review',
|
'in_review',
|
||||||
'blocked',
|
'blocked',
|
||||||
'done',
|
|
||||||
'closed',
|
'closed',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* All possible priorities in order
|
* 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
|
* Sync status configuration
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ function filterAndSortIssues(
|
|||||||
case 'number':
|
case 'number':
|
||||||
return (a.number - b.number) * direction;
|
return (a.number - b.number) * direction;
|
||||||
case 'priority': {
|
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;
|
return (priorityOrder[a.priority] - priorityOrder[b.priority]) * direction;
|
||||||
}
|
}
|
||||||
case 'updated_at':
|
case 'updated_at':
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export const mockIssues: IssueSummary[] = [
|
|||||||
{
|
{
|
||||||
id: 'ISS-001',
|
id: 'ISS-001',
|
||||||
number: 42,
|
number: 42,
|
||||||
|
type: 'story',
|
||||||
title: 'Implement user authentication flow',
|
title: 'Implement user authentication flow',
|
||||||
description:
|
description:
|
||||||
'Create complete authentication flow with login, register, and password reset.',
|
'Create complete authentication flow with login, register, and password reset.',
|
||||||
@@ -31,6 +32,7 @@ export const mockIssues: IssueSummary[] = [
|
|||||||
{
|
{
|
||||||
id: 'ISS-002',
|
id: 'ISS-002',
|
||||||
number: 43,
|
number: 43,
|
||||||
|
type: 'task',
|
||||||
title: 'Design product catalog component',
|
title: 'Design product catalog component',
|
||||||
description: 'Create reusable product card and catalog grid components.',
|
description: 'Create reusable product card and catalog grid components.',
|
||||||
status: 'in_review',
|
status: 'in_review',
|
||||||
@@ -45,6 +47,7 @@ export const mockIssues: IssueSummary[] = [
|
|||||||
{
|
{
|
||||||
id: 'ISS-003',
|
id: 'ISS-003',
|
||||||
number: 44,
|
number: 44,
|
||||||
|
type: 'bug',
|
||||||
title: 'Fix cart total calculation bug',
|
title: 'Fix cart total calculation bug',
|
||||||
description: 'Cart total shows incorrect amount when discount is applied.',
|
description: 'Cart total shows incorrect amount when discount is applied.',
|
||||||
status: 'blocked',
|
status: 'blocked',
|
||||||
@@ -60,6 +63,7 @@ export const mockIssues: IssueSummary[] = [
|
|||||||
{
|
{
|
||||||
id: 'ISS-004',
|
id: 'ISS-004',
|
||||||
number: 45,
|
number: 45,
|
||||||
|
type: 'story',
|
||||||
title: 'Add product search functionality',
|
title: 'Add product search functionality',
|
||||||
description: 'Implement full-text search with filters for the product catalog.',
|
description: 'Implement full-text search with filters for the product catalog.',
|
||||||
status: 'open',
|
status: 'open',
|
||||||
@@ -74,9 +78,10 @@ export const mockIssues: IssueSummary[] = [
|
|||||||
{
|
{
|
||||||
id: 'ISS-005',
|
id: 'ISS-005',
|
||||||
number: 46,
|
number: 46,
|
||||||
|
type: 'task',
|
||||||
title: 'Optimize database queries for product listing',
|
title: 'Optimize database queries for product listing',
|
||||||
description: 'Performance optimization for product queries with pagination.',
|
description: 'Performance optimization for product queries with pagination.',
|
||||||
status: 'done',
|
status: 'closed',
|
||||||
priority: 'low',
|
priority: 'low',
|
||||||
labels: ['performance', 'backend', 'database'],
|
labels: ['performance', 'backend', 'database'],
|
||||||
sprint: 'Sprint 2',
|
sprint: 'Sprint 2',
|
||||||
@@ -88,9 +93,10 @@ export const mockIssues: IssueSummary[] = [
|
|||||||
{
|
{
|
||||||
id: 'ISS-006',
|
id: 'ISS-006',
|
||||||
number: 47,
|
number: 47,
|
||||||
|
type: 'task',
|
||||||
title: 'Create checkout page wireframes',
|
title: 'Create checkout page wireframes',
|
||||||
description: 'Design wireframes for the checkout flow including payment selection.',
|
description: 'Design wireframes for the checkout flow including payment selection.',
|
||||||
status: 'done',
|
status: 'closed',
|
||||||
priority: 'high',
|
priority: 'high',
|
||||||
labels: ['design', 'checkout', 'ui'],
|
labels: ['design', 'checkout', 'ui'],
|
||||||
sprint: 'Sprint 2',
|
sprint: 'Sprint 2',
|
||||||
@@ -102,6 +108,7 @@ export const mockIssues: IssueSummary[] = [
|
|||||||
{
|
{
|
||||||
id: 'ISS-007',
|
id: 'ISS-007',
|
||||||
number: 48,
|
number: 48,
|
||||||
|
type: 'story',
|
||||||
title: 'Implement responsive navigation',
|
title: 'Implement responsive navigation',
|
||||||
description: 'Create mobile-friendly navigation with hamburger menu.',
|
description: 'Create mobile-friendly navigation with hamburger menu.',
|
||||||
status: 'open',
|
status: 'open',
|
||||||
@@ -116,6 +123,7 @@ export const mockIssues: IssueSummary[] = [
|
|||||||
{
|
{
|
||||||
id: 'ISS-008',
|
id: 'ISS-008',
|
||||||
number: 49,
|
number: 49,
|
||||||
|
type: 'task',
|
||||||
title: 'Set up E2E test framework',
|
title: 'Set up E2E test framework',
|
||||||
description: 'Configure Playwright for end-to-end testing.',
|
description: 'Configure Playwright for end-to-end testing.',
|
||||||
status: 'in_progress',
|
status: 'in_progress',
|
||||||
@@ -135,6 +143,7 @@ export const mockIssues: IssueSummary[] = [
|
|||||||
export const mockIssueDetail: IssueDetail = {
|
export const mockIssueDetail: IssueDetail = {
|
||||||
id: 'ISS-001',
|
id: 'ISS-001',
|
||||||
number: 42,
|
number: 42,
|
||||||
|
type: 'story',
|
||||||
title: 'Implement user authentication flow',
|
title: 'Implement user authentication flow',
|
||||||
description: `## Overview
|
description: `## Overview
|
||||||
Create a complete authentication flow for the e-commerce platform.
|
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
|
* 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
|
* Sync status with external trackers
|
||||||
@@ -64,6 +72,7 @@ export interface IssueActivity {
|
|||||||
export interface IssueSummary {
|
export interface IssueSummary {
|
||||||
id: string;
|
id: string;
|
||||||
number: number;
|
number: number;
|
||||||
|
type: IssueType;
|
||||||
title: string;
|
title: string;
|
||||||
description: string;
|
description: string;
|
||||||
status: IssueStatus;
|
status: IssueStatus;
|
||||||
|
|||||||
Reference in New Issue
Block a user