From 8113b70814050367cc07450f6dacb08709f89411 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Thu, 20 Aug 2015 13:50:06 -0700 Subject: [PATCH] flop audience and task in %new --- ape/work.hoon | 12 ++++++------ mar/work/command.hoon | 7 ++++--- pub/work/src/js/actions/WorkActions.coffee | 4 ++-- pub/work/src/js/main.js | 14 +++++--------- pub/work/src/js/stores/WorkStore.coffee | 2 +- sur/talk.hoon | 2 +- sur/work.hoon | 2 +- 7 files changed, 20 insertions(+), 23 deletions(-) diff --git a/ape/work.hoon b/ape/work.hoon index 45b1d7e3f..8a842bf87 100644 --- a/ape/work.hoon +++ b/ape/work.hoon @@ -121,21 +121,21 @@ ^- [mos=(list move) con=_+>.$] ?- -.action %create :: XX should verify ownership - =+ existing-task=(~(get by tasks) id.p.action) + =+ existing-task=(~(get by tasks) id.tax.action) ~? ?& ?=(^ existing-task) - !=(p.action task.u.existing-task) + !=(tax.action task.u.existing-task) == :* %new-task-with-old-id her=her from=from - new-task=p.action + new-task=tax.action existing-task=u.existing-task == =. tasks - %^ ~(put by tasks) id.p.action p.action + %^ ~(put by tasks) id.tax.action tax.action ?~ existing-task from (~(uni in audience.u.existing-task) from) - =. sort ?~(existing-task sort [id.p.action sort]) + =. sort ?~(existing-task sort [id.tax.action sort]) [~ +>.$] :: %claim @@ -222,7 +222,7 @@ initialize =^ mof +>.$ ?- -.cod - %new abet:create:(at +.cod) + %new abet:create:(at [+ -]:+.cod) %old abet:(process-update:(at (~(got by tasks) id.cod)) dif.cod) %sort ~|(%not-implemented !!) == diff --git a/mar/work/command.hoon b/mar/work/command.hoon index c6b0b4cd0..4f1718b2b 100644 --- a/mar/work/command.hoon +++ b/mar/work/command.hoon @@ -49,10 +49,10 @@ == ++ id (ci (slat %uv) so) ++ ship (su fed:ag) - ++ coma (of new/new old/(ot id/id dif/uppd ~) sort/(ar id) ~) - ++ new (ot task/task audience/audi ~) + ++ coma (of new/task old/(ot id/id dif/uppd ~) sort/(ar id) ~) ++ task %- ot :~ + audience/audi id/id date-created/di version/ni date-modified/di owner/ship status/(ci (soft status) so) @@ -60,7 +60,8 @@ done/(mu di) title/so description/so discussion/(ar (ot date/di ship/ship body/so ~)) == - ++ audi (as (ot ship/ship span/so ~)) + ++ audi (as stan) + ++ stan (su ;~((glue fas) ;~(pfix sig fed:ag) urs:ab)) ++ uppd %- of :~ own/(of announce/ul claim/ul ~) diff --git a/pub/work/src/js/actions/WorkActions.coffee b/pub/work/src/js/actions/WorkActions.coffee index 03f85edde..d605b5527 100644 --- a/pub/work/src/js/actions/WorkActions.coffee +++ b/pub/work/src/js/actions/WorkActions.coffee @@ -17,8 +17,8 @@ module.exports = title:'' description:'' discussion:[] - station = window.util.talk.mainStationPath window.urb.ship - Persistence.put "new": task:item, audience:[station] + audience:[window.util.talk.mainStationPath window.urb.ship] + Persistence.put "new":item Dispatcher.handleViewAction {type:'newItem', index, item} setFilter: (key,val) -> diff --git a/pub/work/src/js/main.js b/pub/work/src/js/main.js index d8ee06bb7..780132851 100644 --- a/pub/work/src/js/main.js +++ b/pub/work/src/js/main.js @@ -9,7 +9,7 @@ Persistence.get('test', console.log.bind(console)); module.exports = { newItem: function(index, list) { - var item, station; + var item; item = { id: window.util.uuid32(), version: 0, @@ -22,14 +22,11 @@ module.exports = { tags: [], title: '', description: '', - discussion: [] + discussion: [], + audience: [window.util.talk.mainStationPath(window.urb.ship)] }; - station = window.util.talk.mainStationPath(window.urb.ship); Persistence.put({ - "new": { - task: item, - audience: [station] - } + "new": item }); return Dispatcher.handleViewAction({ type: 'newItem', @@ -1201,8 +1198,7 @@ WorkStore = assign({}, EventEmitter.prototype, { var _item, index, item; index = arg.index, item = arg.item; _item = _.extend({ - sort: index, - audience: [] + sort: index }, item); _item["date-created"] = new Date(item["date-created"]); _item["date-modified"] = new Date(item["date-modified"]); diff --git a/pub/work/src/js/stores/WorkStore.coffee b/pub/work/src/js/stores/WorkStore.coffee index 8adf65942..0b11428e8 100644 --- a/pub/work/src/js/stores/WorkStore.coffee +++ b/pub/work/src/js/stores/WorkStore.coffee @@ -100,7 +100,7 @@ WorkStore = assign {},EventEmitter.prototype,{ _sorts[key] = val newItem: ({index,item}) -> - _item = _.extend {sort:index,audience:[]}, item + _item = _.extend {sort:index}, item _item["date-created"]=new Date item["date-created"] _item["date-modified"]=new Date item["date-modified"] _list.splice index,0,_item diff --git a/sur/talk.hoon b/sur/talk.hoon index 32d825b24..cd63463b1 100644 --- a/sur/talk.hoon +++ b/sur/talk.hoon @@ -81,7 +81,7 @@ ++ work-stuff :: |% :: ++ duty :: - $% [%create p=task] :: create new task + $% [%create tax=task] :: create new task [%claim id=@uvH] :: claim task $: %update :: operate on task id=@uvH :: which task diff --git a/sur/work.hoon b/sur/work.hoon index 498f3cc77..8a0f6fde7 100644 --- a/sur/work.hoon +++ b/sur/work.hoon @@ -29,7 +29,7 @@ == ++ status ?(%announced %released %accepted) ++ command - $% [%new task audience=(set station:talk)] + $% [%new audience=(set station:talk) task] [%old id=@uvH dif=update] [%sort p=(list ,@uvH)] ==