diff options
author | Tom Willemse | 2013-08-18 16:55:56 +0200 |
---|---|---|
committer | Tom Willemse | 2013-08-18 16:55:56 +0200 |
commit | aa06a99982a0df339b0335a106631d9d75975eda (patch) | |
tree | 100a9418b5048d4bee86bba350e42b11432f101e /data.lisp | |
parent | 6e5b291257e5ff34e00d7b7424c33fd67427934e (diff) | |
download | scrumli-aa06a99982a0df339b0335a106631d9d75975eda.tar.gz scrumli-aa06a99982a0df339b0335a106631d9d75975eda.zip |
Fix priorities for tasks
When setting and changing priorities no attention was paid to the
`story_id', which means that no two tasks could have the same priority,
even when belonging to other stories. This creates a weird situation
where the tasks of a certain story would become unmanageable because
there are gaps between the priorities. This could make it seem like
priority changing was impossible.
Diffstat (limited to 'data.lisp')
-rw-r--r-- | data.lisp | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -85,7 +85,9 @@ 'task :description description :priority (+ 1 (query (:select (:coalesce (:max 'priority) 0) - :from 'task) :single)) + :from 'task + :where (:= 'story-id story-id)) + :single)) :reporter reporter :story-id (parse-integer story-id) :assignee ""))) (save-dao obj))) @@ -102,8 +104,18 @@ :single)) (next-priority (funcall (ecase dir (:up #'-) (:down #'+)) current-priority 1)) - (max-priority (query (:select (:max 'priority) :from type) - :single))) + (max-priority + (case type + ('story (query (:select (:max 'priority) :from type) + :single)) + ('task + (query (:select + (:max 'priority) :from type + :where (:= 'story-id + (:select 'story-id + :from 'task + :where (:= 'id id)))) + :single))))) (execute (:update type :set 'priority current-priority :where (:= 'priority next-priority))) (execute (:update type :set |