Commits

Ronny Pfannschmidt  committed 6f9951e

add missing view for task states

  • Participants
  • Parent commits fd02dd7

Comments (0)

Files changed (2)

File composeapp/couchdb-compose.yml

 - views/streams.yml
 - views/statret.yml
 - views/steps_of.yml
+- views/tasks_of.yml
 - views/lines.yml
 - lists.yml
 

File composeapp/views/tasks_of.yml

+map.coffee: |
+ (doc) ->
+   if doc.type == 'juggler:task'
+     emit doc.task, [doc.status]
+   return
+
+
+reduce.coffee: |
+  (key, values) ->
+    # copied from
+    # due to map returning lists we ignore rereduce
+    # and always do the same
+    values = Array.concat.apply(null, values)
+    uniq = {}
+    values.forEach (item) -> uniq[item] = true
+    Object.keys(uniq)
+