fixes
This commit is contained in:
@@ -3,7 +3,6 @@ import { format, isToday } from 'date-fns'
|
||||
import useProjectStore from '../../store/useProjectStore'
|
||||
import useFocusStore from '../../store/useFocusStore'
|
||||
import useUIStore from '../../store/useUIStore'
|
||||
import { updateDeliverable as apiUpdate } from '../../api/deliverables'
|
||||
import DeliverableModal from '../Deliverables/DeliverableModal'
|
||||
|
||||
const STATUS_KEYS = ['overdue', 'in_progress', 'upcoming', 'completed']
|
||||
@@ -46,8 +45,7 @@ export default function HeatmapDayPanel({ date, onClose }) {
|
||||
const next = STATUS_CYCLE[deliverable.status] || 'upcoming'
|
||||
setCycling(deliverable.id)
|
||||
try {
|
||||
const updated = await apiUpdate(deliverable.id, { status: next })
|
||||
storeUpdate(updated)
|
||||
await storeUpdate(deliverable.id, { status: next })
|
||||
} finally {
|
||||
setCycling(null)
|
||||
}
|
||||
|
||||
@@ -4,6 +4,9 @@ import dayGridPlugin from '@fullcalendar/daygrid'
|
||||
import timeGridPlugin from '@fullcalendar/timegrid'
|
||||
import interactionPlugin from '@fullcalendar/interaction'
|
||||
import useProjectStore from '../../store/useProjectStore'
|
||||
import useFocusStore from '../../store/useFocusStore'
|
||||
import useUIStore from '../../store/useUIStore'
|
||||
import useToastStore from '../../store/useToastStore'
|
||||
import DeliverableModal from '../Deliverables/DeliverableModal'
|
||||
import ContextMenu from '../UI/ContextMenu'
|
||||
import EventTooltip from './EventTooltip'
|
||||
|
||||
@@ -4,8 +4,6 @@ import ProjectModal from './ProjectModal'
|
||||
import Button from '../UI/Button'
|
||||
import AgendaPanel from '../Calendar/AgendaPanel'
|
||||
import useProjectStore from '../../store/useProjectStore'
|
||||
import useUIStore from '../../store/useUIStore'
|
||||
import { deleteProject, fetchProjects } from '../../api/projects'
|
||||
|
||||
const VIEW_OPTIONS = [
|
||||
{ key: 'active', label: 'Active' },
|
||||
@@ -14,7 +12,7 @@ const VIEW_OPTIONS = [
|
||||
]
|
||||
|
||||
export default function ProjectList({ onRegisterNewProject }) {
|
||||
const { projects, removeProject, setProjects } = useProjectStore()
|
||||
const { projects, deleteProject, loadProjects } = useProjectStore()
|
||||
const { sidebarTab, setSidebarTab } = useUIStore()
|
||||
const [showModal, setShowModal] = useState(false)
|
||||
const [editing, setEditing] = useState(null)
|
||||
@@ -26,15 +24,13 @@ export default function ProjectList({ onRegisterNewProject }) {
|
||||
}, [onRegisterNewProject])
|
||||
|
||||
const refreshProjects = async () => {
|
||||
const data = await fetchProjects()
|
||||
setProjects(data)
|
||||
await loadProjects()
|
||||
}
|
||||
|
||||
const handleEdit = (p) => { setEditing(p); setShowModal(true) }
|
||||
const handleDelete = async (p) => {
|
||||
if (window.confirm(`Delete "${p.name}" and all its deliverables?`)) {
|
||||
await deleteProject(p.id)
|
||||
removeProject(p.id)
|
||||
}
|
||||
}
|
||||
const handleClose = () => { setShowModal(false); setEditing(null) }
|
||||
|
||||
Reference in New Issue
Block a user