diff options
Diffstat (limited to 'Omni/Task/Core.hs')
| -rw-r--r-- | Omni/Task/Core.hs | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/Omni/Task/Core.hs b/Omni/Task/Core.hs index 6d69834..18f80e2 100644 --- a/Omni/Task/Core.hs +++ b/Omni/Task/Core.hs @@ -35,7 +35,7 @@ data Task = Task taskStatus :: Status, taskPriority :: Priority, -- Priority level (0-4) taskDependencies :: [Dependency], -- List of dependencies with types - taskDescription :: Maybe Text, -- Optional detailed description + taskDescription :: Text, -- Required description taskCreatedAt :: UTCTime, taskUpdatedAt :: UTCTime } @@ -251,7 +251,7 @@ instance SQL.FromRow Task where <*> SQL.field <*> SQL.field <*> SQL.field - <*> SQL.field + <*> (fromMaybe "" </ SQL.field) -- Handle NULL description from legacy data <*> SQL.field <*> SQL.field @@ -598,7 +598,7 @@ saveTask task = task -- Create a new task -createTask :: Text -> TaskType -> Maybe Text -> Maybe Text -> Priority -> [Dependency] -> Maybe Text -> IO Task +createTask :: Text -> TaskType -> Maybe Text -> Maybe Text -> Priority -> [Dependency] -> Text -> IO Task createTask title taskType parent namespace priority deps description = withTaskLock <| do let parent' = fmap normalizeId parent @@ -957,13 +957,11 @@ showTaskDetailed t = do putText "Dependencies:" traverse_ printDependency (taskDependencies t) - case taskDescription t of - Nothing -> pure () - Just desc -> do - putText "" - putText "Description:" - let indented = T.unlines <| map (" " <>) (T.lines desc) - putText indented + unless (T.null (taskDescription t)) <| do + putText "" + putText "Description:" + let indented = T.unlines <| map (" " <>) (T.lines (taskDescription t)) + putText indented putText "" where |
