feat: add 'not_started' task status with updates to task creation, status handling, and translations
This commit is contained in:
@@ -127,7 +127,7 @@ export function createProjectTask(data) {
|
||||
if (result.lastInsertRowid) {
|
||||
const language = getUserLanguage();
|
||||
const priority = data.priority || "normal";
|
||||
const status = data.status || "pending";
|
||||
const status = data.status || "not_started";
|
||||
const translatedPriority = translatePriority(priority, language);
|
||||
const translatedStatus = translateStatus(status, language);
|
||||
const logMessage = `${serverT("Task created", language)} "${taskName}" ${serverT("with priority", language)}: ${translatedPriority}, ${serverT("status", language)}: ${translatedStatus}`;
|
||||
@@ -158,7 +158,7 @@ export function updateProjectTaskStatus(taskId, status, userId = null) {
|
||||
let stmt;
|
||||
let result;
|
||||
|
||||
if (oldStatus === "pending" && status === "in_progress") {
|
||||
if ((oldStatus === "not_started" || oldStatus === "pending") && status === "in_progress") {
|
||||
// Starting a task - set date_started
|
||||
stmt = db.prepare(`
|
||||
UPDATE project_tasks
|
||||
@@ -334,7 +334,7 @@ export function updateProjectTask(taskId, updates, userId = null) {
|
||||
values.push(updates.status);
|
||||
|
||||
// Handle status-specific timestamp updates
|
||||
if (currentTask.status === "pending" && updates.status === "in_progress") {
|
||||
if ((currentTask.status === "not_started" || currentTask.status === "pending") && updates.status === "in_progress") {
|
||||
fields.push("date_started = datetime('now', 'localtime')");
|
||||
} else if (updates.status === "completed") {
|
||||
fields.push("date_completed = datetime('now', 'localtime')");
|
||||
@@ -587,7 +587,7 @@ export function applyTaskSetToProject(setId, projectId, userId = null) {
|
||||
const result = createProjectTask({
|
||||
project_id: projectId,
|
||||
task_template_id: template.task_id,
|
||||
status: "pending",
|
||||
status: "not_started",
|
||||
priority: "normal",
|
||||
created_by: userId,
|
||||
assigned_to: null, // Will be assigned based on user role logic in createProjectTask
|
||||
|
||||
Reference in New Issue
Block a user