mirror of
https://github.com/callumalpass/tasknotes.git
synced 2026-07-22 12:50:26 +00:00
Move task creation defaults application logic from individual callers into TaskService.createTask() to eliminate code duplication. Changes: - Add applyDefaults option to TaskService.createTask() (default: true) - Create private applyTaskCreationDefaults() method in TaskService that handles all defaults: due, scheduled, contexts, projects, tags, time estimate, recurrence, reminders, and user field defaults - Update TaskCreationModal to pass applyDefaults: false since defaults are already applied to form fields during initialization - Update ICSNoteService to pass applyDefaults: false since calendar events have their own data and shouldn't receive defaults - Remove duplicate applyTaskCreationDefaults() from TasksController and SystemController - Simplify InstantTaskConvertService and TaskSelectorWithCreateModal to only handle NLP-parsed user fields, letting TaskService apply defaults for unparsed fields - Update test mocks for TaskService to include calculateDefaultDate This refactor reduces code duplication and ensures consistent default application across all task creation paths. |
||
|---|---|---|
| .. | ||
| __mocks__ | ||
| components | ||
| helpers | ||
| integration | ||
| manual | ||
| services | ||
| types | ||
| unit | ||
| utils | ||
| coverage-report.md | ||
| test-setup.ts | ||