!74 fix: 任务侧边栏点击详情后"任务不存在"问题
Merge pull request !74 from 郭永昊/fix/tag-labels-and-click
This commit is contained in:
@@ -198,7 +198,7 @@ func (s *ProjectService) GetTasks(ctx context.Context, userID uint, projectID ui
|
||||
response := make([]model.TaskResponse, len(tasks))
|
||||
for i, t := range tasks {
|
||||
response[i] = model.TaskResponse{
|
||||
ID: fmt.Sprintf("%d", t.ID),
|
||||
ID: t.ExternalID,
|
||||
ProjectID: fmt.Sprintf("%d", t.ProjectID),
|
||||
Prompt: t.Prompt,
|
||||
AssetType: t.AssetType,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useEffect, useState, useCallback } from 'react'
|
||||
import { useParams } from 'react-router-dom'
|
||||
import { Link, useParams } from 'react-router-dom'
|
||||
import { getTasks } from '../api/project'
|
||||
import type { Task } from '../api/types'
|
||||
import StatusBadge from './StatusBadge'
|
||||
@@ -67,9 +67,9 @@ export default function TaskListPanel() {
|
||||
</p>
|
||||
) : (
|
||||
tasks.map(task => (
|
||||
<a
|
||||
<Link
|
||||
key={task.id}
|
||||
href={task.status === 'completed' ? `/projects/${projectId}/tasks/${task.id}` : undefined}
|
||||
to={task.status === 'completed' ? `/projects/${projectId}/tasks/${task.id}` : '#'}
|
||||
style={{
|
||||
display: 'block',
|
||||
padding: '12px 16px',
|
||||
@@ -77,8 +77,12 @@ export default function TaskListPanel() {
|
||||
textDecoration: 'none',
|
||||
color: 'inherit',
|
||||
cursor: task.status === 'completed' ? 'pointer' : 'default',
|
||||
pointerEvents: task.status === 'completed' ? 'auto' : 'none',
|
||||
transition: 'background 0.15s',
|
||||
}}
|
||||
onClick={e => {
|
||||
if (task.status !== 'completed') e.preventDefault()
|
||||
}}
|
||||
onMouseEnter={e => {
|
||||
if (task.status === 'completed')
|
||||
(e.currentTarget as HTMLElement).style.background = 'var(--accent-dim)'
|
||||
@@ -115,7 +119,7 @@ export default function TaskListPanel() {
|
||||
)}
|
||||
</div>
|
||||
<PipelineStages currentStage={task.stage ?? null} status={task.status} />
|
||||
</a>
|
||||
</Link>
|
||||
))
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -22,7 +22,7 @@ interface AuthState {
|
||||
|
||||
export const useAuthStore = create<AuthState>((set) => ({
|
||||
user: null,
|
||||
isAuthenticated: false,
|
||||
isAuthenticated: getToken() !== null,
|
||||
loading: false,
|
||||
error: null,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user