Skip to content

Show simple activity log inside task modal 📜 #371

Description

@anoopcodehack

Show simple activity log inside task modal 📜

File: server/models/Task.js + TaskModal.jsx

No history of what happened to a task 💀
When was it moved? Who changed priority? fr!!

Fix: add activity array to Task model:
activity: [{
action: String, // "moved to review", "priority changed"
timestamp: { type: Date, default: Date.now }
}]

Push to activity on task update in routes/tasks.js:
task.activity.push({
action: status changed to ${req.body.status}
})

Show in TaskModal:
{task?.activity?.slice(-3).reverse().map((a, i) => (

{a.action} • {timeAgo(a.timestamp)}

))}

~15 lines across 3 files!

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions