[PR #2356] [MERGED] feat: add task duplication #8209

Closed
opened 2026-04-20 18:05:23 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/2356
Author: @tink-bot
Created: 3/4/2026
Status: Merged
Merged: 3/4/2026
Merged by: @kolaente

Base: mainHead: feat-task-duplicate


📝 Commits (10+)

  • cfdde05 feat: add task duplicate backend model and tests
  • f6c79cb feat: register task duplicate API route
  • 573d7ba test: add web integration tests for task duplication
  • 7508c1e feat: add task duplicate frontend model and service
  • 32d6828 feat: add duplicateTask action to task store
  • fe09e08 feat: add duplicate button to task detail view
  • ecea2c1 fix: remove debug log statements from task duplicate
  • d1ade91 refactor: batch label inserts during task duplication
  • 04ac74b refactor: use TaskRelation.Create for copy relation
  • a704ca7 fix: close source file handle when duplicating attachments

📊 Changes

10 files changed (+373 additions, -2 deletions)

View changed files

📝 frontend/src/i18n/lang/en.json (+2 -0)
frontend/src/modelTypes/ITaskDuplicate.ts (+7 -0)
frontend/src/models/taskDuplicateModel.ts (+17 -0)
frontend/src/services/taskDuplicateService.ts (+15 -0)
📝 frontend/src/stores/tasks.ts (+14 -0)
📝 frontend/src/views/tasks/TaskDetailView.vue (+20 -2)
pkg/models/task_duplicate.go (+166 -0)
pkg/models/task_duplicate_test.go (+89 -0)
📝 pkg/routes/routes.go (+7 -0)
📝 pkg/webtests/task_test.go (+36 -0)

📄 Description

Summary

  • Add a PUT /api/v1/tasks/:id/duplicate endpoint that duplicates a task with all its properties (title, description, dates, priority, color, percent done, repeat settings, assignees, reminders, labels, and attachments) into the same project
  • Create "copied from" / "copied to" relations between the original and duplicated task
  • Add a "Duplicate" button to the task detail sidebar in the frontend, which duplicates the task and navigates to the new copy

What gets duplicated

Title, description, dates, priority, color, percent done, repeat settings, assignees, reminders, labels, attachments (files are copied, not referenced). Done status is reset to false. Comments, existing relations, favorites, and subscriptions are not copied.

Test plan

  • Backend model unit test (TestTaskDuplicate in pkg/models/task_duplicate_test.go) -- verifies basic duplication, label/assignee copying, relation creation, and permission checking
  • Backend web integration test (TestTaskDuplicate in pkg/webtests/task_test.go) -- verifies HTTP endpoint for duplication, nonexistent task error, and permission denial
  • All existing feature tests pass (mage test:feature)
  • All existing web tests pass (mage test:web)
  • All frontend unit tests pass (930/930)
  • Frontend linting passes with no errors
  • Go linting passes with 0 issues

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-vikunja/vikunja/pull/2356 **Author:** [@tink-bot](https://github.com/tink-bot) **Created:** 3/4/2026 **Status:** ✅ Merged **Merged:** 3/4/2026 **Merged by:** [@kolaente](https://github.com/kolaente) **Base:** `main` ← **Head:** `feat-task-duplicate` --- ### 📝 Commits (10+) - [`cfdde05`](https://github.com/go-vikunja/vikunja/commit/cfdde05588e3598743f04704b25d39168922e378) feat: add task duplicate backend model and tests - [`f6c79cb`](https://github.com/go-vikunja/vikunja/commit/f6c79cbf268bae0cdfe3e9f702c04a56a18e36e9) feat: register task duplicate API route - [`573d7ba`](https://github.com/go-vikunja/vikunja/commit/573d7ba845b75e0303a39cd97c1451f091802a54) test: add web integration tests for task duplication - [`7508c1e`](https://github.com/go-vikunja/vikunja/commit/7508c1e1b0a33b15ba449420ed2d4e930887c40c) feat: add task duplicate frontend model and service - [`32d6828`](https://github.com/go-vikunja/vikunja/commit/32d682865fff82702ca1bae2ae230b10b8fec23b) feat: add duplicateTask action to task store - [`fe09e08`](https://github.com/go-vikunja/vikunja/commit/fe09e08e5090c940cf217b0353bb032e4776bc81) feat: add duplicate button to task detail view - [`ecea2c1`](https://github.com/go-vikunja/vikunja/commit/ecea2c16341352e88dd66ecadfbbc4291a84492b) fix: remove debug log statements from task duplicate - [`d1ade91`](https://github.com/go-vikunja/vikunja/commit/d1ade9108663584010cabcd06b035222a0c7d3c8) refactor: batch label inserts during task duplication - [`04ac74b`](https://github.com/go-vikunja/vikunja/commit/04ac74b95d5971ac918634149560cc2ad9a0d038) refactor: use TaskRelation.Create for copy relation - [`a704ca7`](https://github.com/go-vikunja/vikunja/commit/a704ca7d924597bd20fd985cbf565a259419eab6) fix: close source file handle when duplicating attachments ### 📊 Changes **10 files changed** (+373 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/i18n/lang/en.json` (+2 -0) ➕ `frontend/src/modelTypes/ITaskDuplicate.ts` (+7 -0) ➕ `frontend/src/models/taskDuplicateModel.ts` (+17 -0) ➕ `frontend/src/services/taskDuplicateService.ts` (+15 -0) 📝 `frontend/src/stores/tasks.ts` (+14 -0) 📝 `frontend/src/views/tasks/TaskDetailView.vue` (+20 -2) ➕ `pkg/models/task_duplicate.go` (+166 -0) ➕ `pkg/models/task_duplicate_test.go` (+89 -0) 📝 `pkg/routes/routes.go` (+7 -0) 📝 `pkg/webtests/task_test.go` (+36 -0) </details> ### 📄 Description ## Summary - Add a `PUT /api/v1/tasks/:id/duplicate` endpoint that duplicates a task with all its properties (title, description, dates, priority, color, percent done, repeat settings, assignees, reminders, labels, and attachments) into the same project - Create "copied from" / "copied to" relations between the original and duplicated task - Add a "Duplicate" button to the task detail sidebar in the frontend, which duplicates the task and navigates to the new copy ## What gets duplicated Title, description, dates, priority, color, percent done, repeat settings, assignees, reminders, labels, attachments (files are copied, not referenced). Done status is reset to false. Comments, existing relations, favorites, and subscriptions are not copied. ## Test plan - [x] Backend model unit test (`TestTaskDuplicate` in `pkg/models/task_duplicate_test.go`) -- verifies basic duplication, label/assignee copying, relation creation, and permission checking - [x] Backend web integration test (`TestTaskDuplicate` in `pkg/webtests/task_test.go`) -- verifies HTTP endpoint for duplication, nonexistent task error, and permission denial - [x] All existing feature tests pass (`mage test:feature`) - [x] All existing web tests pass (`mage test:web`) - [x] All frontend unit tests pass (930/930) - [x] Frontend linting passes with no errors - [x] Go linting passes with 0 issues --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 18:05:23 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#8209