mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-28 19:55:53 +03:00
Merge branch 'apps' of https://github.com/urbit/urbit into work
Conflicts: urb/zod/ape/work.hoon
This commit is contained in:
commit
3bf775813d
@ -121,41 +121,25 @@
|
||||
^- [mos=(list move) con=_+>.$]
|
||||
?- -.action
|
||||
%create :: XX should verify ownership
|
||||
=+ existing-task=(~(get by tasks) id.tax.action)
|
||||
=+ existing-task=(~(get by tasks) id.p.action)
|
||||
~? ?& ?=(^ existing-task)
|
||||
!=(tax.action task.u.existing-task)
|
||||
!=(p.action task.u.existing-task)
|
||||
==
|
||||
:* %new-task-with-old-id
|
||||
her=her
|
||||
from=from
|
||||
new-task=tax.action
|
||||
new-task=p.action
|
||||
existing-task=u.existing-task
|
||||
==
|
||||
?. |(=(her owner.tax.action) =(%released status.tax.action))
|
||||
~& :* %created-with-bad-owner
|
||||
her=her
|
||||
from=from
|
||||
new-task=tax.action
|
||||
existing-task=u.existing-task
|
||||
==
|
||||
[~ +>.$]
|
||||
=. tasks
|
||||
%^ ~(put by tasks) id.tax.action tax.action
|
||||
:_ |
|
||||
?~ existing-task from
|
||||
(~(uni in audience.u.existing-task) from)
|
||||
=. sort ?~(existing-task sort [id.action sort])
|
||||
=. sort ?~(existing-task sort [id.p.action sort])
|
||||
[~ +>.$]
|
||||
::
|
||||
%claim
|
||||
=+ tax=(~(got by tasks) id.action)
|
||||
?. &(=(our owner.tax) =(%announced status.tax))
|
||||
~& :* %bad-claim
|
||||
her=her
|
||||
from=from
|
||||
task=tax
|
||||
==
|
||||
[~ +>.$]
|
||||
abet:(release:(at (~(got by tasks) id.action)) her)
|
||||
::
|
||||
%update
|
||||
|
@ -761,7 +761,7 @@
|
||||
++ ap-move-quit :: give quit move
|
||||
|= [sto=bone vax=vase]
|
||||
^- (each cove tang)
|
||||
?^ q.vax [%| (ap-suck "move: improper quit")]
|
||||
?^ q.vax [%| (ap-suck "quit: improper give")]
|
||||
[%& `cove`[sto %give `cuft`[%quit ~]]]
|
||||
::
|
||||
++ ap-move-diff :: give diff move
|
||||
@ -769,20 +769,20 @@
|
||||
=. vax (spec vax)
|
||||
^- (each cove tang)
|
||||
?. &(?=(^ q.vax) ?=(@ -.q.vax) ((sane %tas) -.q.vax))
|
||||
[%| (ap-suck "move: improper diff")]
|
||||
[%| (ap-suck "diff: improper give")]
|
||||
[%& sto %give %diff `cage`[-.q.vax (slot 3 (spec vax))]]
|
||||
::
|
||||
++ ap-move-hiss :: pass %hiss
|
||||
|= [sto=bone vax=vase]
|
||||
^- (each cove tang)
|
||||
?. &(?=([p=* q=@ q=^] q.vax) ((sane %tas) q.q.vax))
|
||||
[%| (ap-suck "move: malformed hiss ask.[%hiss path mark cage]")]
|
||||
[%| (ap-suck "hiss: malformed hiss ask.[%hiss wire mark cage]")]
|
||||
=+ gaw=(slot 7 vax)
|
||||
?. &(?=([p=@ q=^] q.gaw) ((sane %tas) p.q.gaw))
|
||||
[%| (ap-suck "move: malformed cage")]
|
||||
[%| (ap-suck "hiss: malformed cage")]
|
||||
=+ pux=((soft path) p.q.vax)
|
||||
?. &(?=(^ pux) (levy u.pux (sane %ta)))
|
||||
[%| (ap-suck "move: malformed path")]
|
||||
[%| (ap-suck "hiss: malformed path")]
|
||||
:^ %& sto %pass
|
||||
:- [(scot %p q.q.pry) %cay u.pux]
|
||||
[%hiss q.q.vax [p.q.gaw (slot 3 (spec gaw))]]
|
||||
@ -793,20 +793,20 @@
|
||||
?. ?& ?=([p=* [q=@ r=@] s=*] q.vax)
|
||||
(gte 1 (met 7 q.q.vax))
|
||||
==
|
||||
[%| (ap-suck "move: malformed target")]
|
||||
[%| (ap-suck "mess: malformed target")]
|
||||
=+ pux=((soft path) p.q.vax)
|
||||
?. &(?=(^ pux) (levy u.pux (sane %ta)))
|
||||
[%| (ap-suck "move: malformed path")]
|
||||
[%| (ap-suck "mess: malformed path")]
|
||||
[%& [(scot %p q.q.vax) %out r.q.vax u.pux] q.q.vax r.q.vax]
|
||||
::
|
||||
++ ap-move-pass :: pass general move
|
||||
|= [sto=bone wut=* vax=vase]
|
||||
^- (each cove tang)
|
||||
?. &(?=(@ wut) ((sane %tas) wut))
|
||||
[%| (ap-suck "move: malformed card")]
|
||||
[%| (ap-suck "pass: malformed card")]
|
||||
=+ pux=((soft path) -.q.vax)
|
||||
?. &(?=(^ pux) (levy u.pux (sane %ta)))
|
||||
[%| (ap-suck "move: malformed path")]
|
||||
[%| (ap-suck "pass: malformed path")]
|
||||
=+ huj=(ap-vain wut)
|
||||
?~ huj [%| (ap-suck "move: unknown note {(trip wut)}")]
|
||||
:^ %& sto %pass
|
||||
@ -855,17 +855,17 @@
|
||||
(gte 1 (met 7 q.q.vax))
|
||||
((sane %tas) r.q.vax)
|
||||
==
|
||||
[%| (ap-suck "move: malformed send")]
|
||||
[%| (ap-suck "send: improper ask.[%send wire gill club]")]
|
||||
=+ pux=((soft path) p.q.vax)
|
||||
?. &(?=(^ pux) (levy u.pux (sane %ta)))
|
||||
[%| (ap-suck "move: malformed path")]
|
||||
[%| (ap-suck "send: malformed path")]
|
||||
?: ?=(%poke s.q.vax)
|
||||
=+ gav=(spec (slot 7 vax))
|
||||
?> =(%poke -.q.gav)
|
||||
?. ?& ?=([p=@ q=*] t.q.vax)
|
||||
((sane %tas) p.t.q.vax)
|
||||
==
|
||||
[%| (ap-suck "move: malformed poke")]
|
||||
[%| (ap-suck "send: malformed poke")]
|
||||
:^ %& sto %pass
|
||||
:- [(scot %p q.q.vax) %out r.q.vax u.pux]
|
||||
^- cote
|
||||
@ -873,7 +873,7 @@
|
||||
[%send q.q.vax r.q.vax %poke p.t.q.vax (slot 3 (spec (slot 3 gav)))]
|
||||
=+ cob=((soft club) [s t]:q.vax)
|
||||
?~ cob
|
||||
[%| (ap-suck "move: malformed club")]
|
||||
[%| (ap-suck "send: malformed club")]
|
||||
:^ %& sto %pass
|
||||
:- [(scot %p q.q.vax) %out r.q.vax u.pux]
|
||||
:: ~& [%ap-move-send `path`[(scot %p q.q.vax) %out r.q.vax u.pux]]
|
||||
|
@ -17,22 +17,50 @@
|
||||
|* a=fist
|
||||
%- cu :_ (ar a)
|
||||
~(gas in *(set ,_(need *a)))
|
||||
++ ot
|
||||
|* a=(pole ,[@tas fist])
|
||||
|= b=json
|
||||
%. ((^ot a) b)
|
||||
%+ slog 0
|
||||
?+ b ~
|
||||
[%o *]
|
||||
%+ murn `(list ,[@tas fist])`a
|
||||
|= [c=term d=fist] ^- (unit tank)
|
||||
=+ (~(get by p.b) c)
|
||||
?~ - (some >[c (turn (~(tap by p.b)) head)]<)
|
||||
=+ (d u)
|
||||
?~ - (some >[c u]<)
|
||||
~
|
||||
==
|
||||
++ of
|
||||
|* a=(pole ,[@tas fist])
|
||||
|= b=json
|
||||
%. ((of:jo a) b)
|
||||
%+ slog 0
|
||||
?+ b ~
|
||||
[%o *]
|
||||
%+ murn `(list ,[@tas fist])`a
|
||||
|= [c=term d=fist] ^- (unit tank)
|
||||
=+ (~(get by p.b) c)
|
||||
?~ - ~
|
||||
=+ (d u)
|
||||
?~ - (some >[c u]<)
|
||||
~
|
||||
==
|
||||
++ id (ci (slat %uv) so)
|
||||
++ ship (su fed:ag)
|
||||
++ coma (of new/task old/(ot id/id dif/uppd ~) sort/(ar id) ~)
|
||||
++ coma (of new/new old/(ot id/id dif/uppd ~) sort/(ar id) ~)
|
||||
++ new (ot task/task audience/audi ~)
|
||||
++ task
|
||||
%^ ot
|
||||
:- %task
|
||||
%- ot :~
|
||||
id/id date-created/di
|
||||
version/ni date-modified/di
|
||||
owner/ship status/(ci (soft status) so)
|
||||
tags/(as so) date-due/(mu di)
|
||||
done/(mu di) title/so
|
||||
description/so discussion/(ar (ot date/di ship/ship body/so ~))
|
||||
==
|
||||
audience/(as (ot ship/ship span/so ~))
|
||||
~
|
||||
%- ot :~
|
||||
id/id date-created/di
|
||||
version/ni date-modified/di
|
||||
owner/ship status/(ci (soft status) so)
|
||||
tags/(as so) date-due/(mu di)
|
||||
done/(mu di) title/so
|
||||
description/so discussion/(ar (ot date/di ship/ship body/so ~))
|
||||
==
|
||||
++ audi (as (ot ship/ship span/so ~))
|
||||
++ uppd
|
||||
%- of :~
|
||||
own/(of announce/ul claim/ul ~)
|
||||
@ -44,7 +72,7 @@
|
||||
description/so
|
||||
tags/(as so)
|
||||
done/bo
|
||||
audience/(as (ot ship/ship span/so ~))
|
||||
audience/audi
|
||||
==
|
||||
==
|
||||
--
|
||||
@ -63,7 +91,7 @@
|
||||
:: status:'gave',
|
||||
:: tags:['tag'],
|
||||
:: date-due:null,
|
||||
:: done:XX
|
||||
:: done:false,
|
||||
:: title:'Test task',
|
||||
:: description:'The converter owrks right?',
|
||||
:: discussion:[{date:1440011611215,ship:'sondel',body:'hi'}]
|
||||
|
@ -49,15 +49,15 @@
|
||||
|= a=wain ^+ taz
|
||||
=+ ~[id=%uv "_" date-created=%da " " version=%ud date-modified=%da]
|
||||
=^ b a (advance a ;~(plug (parse -) (punt (parse " " %da ~))))
|
||||
=+ [-.b `due-date=(unit ,@da)`+.b]
|
||||
=+ [-.b `date-due=(unit ,@da)`+.b]
|
||||
=^ tags a (undent a ~(gas in *(set cord)))
|
||||
=^ title a ?~(a !! a)
|
||||
=^ b a (advance a (parse owner=%p "." status=%tas ~))
|
||||
?> ?=(status.task status.b)
|
||||
=+ b
|
||||
=^ description a (undent a role)
|
||||
:* id date-created version date-modified
|
||||
owner status tags due-date title description
|
||||
:* id date-created version date-modified owner
|
||||
status tags date-due ~ title description :: XX done
|
||||
|- ^- (list comment)
|
||||
?: =(~ a) ~
|
||||
=^ b a (advance a (parse ship=%p " " date=%da ~))
|
||||
@ -72,7 +72,7 @@
|
||||
++ mime [/text/x-task (taco (role txt))]
|
||||
++ txt
|
||||
=+ taz
|
||||
=+ due=?~(due-date ~ ~[' ' da/u.due-date])
|
||||
=+ due=?~(date-due ~ ~[' ' da/u.date-due])
|
||||
:- (rend uv/id '_' da/date-created ' ' ud/version da/date-modified due)
|
||||
%+ welp (indent (sort (~(tap in tags)) aor))
|
||||
:- title
|
||||
@ -95,12 +95,13 @@
|
||||
description/[%s description]
|
||||
=< discussion/[%a (turn discussion .)]
|
||||
|=(comment (jobe date/(jode date) ship/(jape <ship>) body/[%s body] ~))
|
||||
due-date/?~(due-date ~ (jode u.due-date))
|
||||
date-due/?~(date-due ~ (jode u.date-due))
|
||||
done/?~(done ~ (jode u.done))
|
||||
==
|
||||
--
|
||||
++ grad %txt
|
||||
--
|
||||
:: {id}_{date-created} {version}{date-modified}{|(" {due-date}" ~)}
|
||||
:: {id}_{date-created} {version}{date-modified}{|(" {date-due}" ~)}
|
||||
:: {tag1}
|
||||
:: {tag2}
|
||||
:: ...
|
||||
|
@ -9,14 +9,15 @@ module.exports =
|
||||
version:0
|
||||
"date-created":Date.now()
|
||||
"date-modified":Date.now()
|
||||
"due-date":null
|
||||
"date-due":null
|
||||
done:null
|
||||
owner:window.urb.ship
|
||||
status:'gave'
|
||||
status:'announced'
|
||||
tags:[]
|
||||
title:''
|
||||
description:''
|
||||
discussion:[]
|
||||
Persistence.put "new":item
|
||||
Persistence.put "new": task:item, audience:[]
|
||||
Dispatcher.handleViewAction {type:'newItem', index, item}
|
||||
|
||||
setFilter: (key,val) ->
|
||||
@ -29,7 +30,7 @@ module.exports =
|
||||
Dispatcher.handleViewAction
|
||||
type:'setSort'
|
||||
key:key
|
||||
val:val
|
||||
val:val
|
||||
|
||||
swapItems: (to,from) ->
|
||||
Dispatcher.handleViewAction
|
||||
|
@ -15,16 +15,20 @@ module.exports = {
|
||||
version: 0,
|
||||
"date-created": Date.now(),
|
||||
"date-modified": Date.now(),
|
||||
"due-date": null,
|
||||
"date-due": null,
|
||||
done: null,
|
||||
owner: window.urb.ship,
|
||||
status: 'gave',
|
||||
status: 'announced',
|
||||
tags: [],
|
||||
title: '',
|
||||
description: '',
|
||||
discussion: []
|
||||
};
|
||||
Persistence.put({
|
||||
"new": item
|
||||
"new": {
|
||||
task: item,
|
||||
audience: []
|
||||
}
|
||||
});
|
||||
return Dispatcher.handleViewAction({
|
||||
type: 'newItem',
|
||||
@ -1024,7 +1028,7 @@ module.exports = Object.assign || function (target, source) {
|
||||
};
|
||||
|
||||
},{}],14:[function(require,module,exports){
|
||||
urb.appl = 'hood';
|
||||
urb.appl = 'work';
|
||||
|
||||
module.exports = {
|
||||
put: function(update, cb) {
|
||||
@ -1201,7 +1205,6 @@ WorkStore = assign({}, EventEmitter.prototype, {
|
||||
}, item);
|
||||
_item["date-created"] = new Date(item["date-created"]);
|
||||
_item["date-modified"] = new Date(item["date-modified"]);
|
||||
_item["date-due"] = item["due-date"];
|
||||
return _list.splice(index, 0, _item);
|
||||
},
|
||||
swapItem: function(arg) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
urb.appl = 'hood' # XX
|
||||
urb.appl = 'work'
|
||||
module.exports =
|
||||
put: (update,cb) -> urb.send(update,{mark:'work-command'},cb)
|
||||
get: (id,cb) ->
|
||||
|
@ -103,7 +103,6 @@ WorkStore = assign {},EventEmitter.prototype,{
|
||||
_item = _.extend {sort:index,audience:[]}, item
|
||||
_item["date-created"]=new Date item["date-created"]
|
||||
_item["date-modified"]=new Date item["date-modified"]
|
||||
_item["date-due"]=item["due-date"]
|
||||
_list.splice index,0,_item
|
||||
|
||||
swapItem: ({to,from}) ->
|
||||
|
@ -81,7 +81,7 @@
|
||||
++ work-stuff ::
|
||||
|% ::
|
||||
++ duty ::
|
||||
$% [%create tax=task] :: create new task
|
||||
$% [%create p=task] :: create new task
|
||||
[%claim id=@uvH] :: claim task
|
||||
$: %update :: operate on task
|
||||
id=@uvH :: which task
|
||||
|
Loading…
Reference in New Issue
Block a user