mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-03 02:35:52 +03:00
link: can create managed groups for new collections
Just defers to contact-view for managed group creation.
This commit is contained in:
parent
0539f3ca1f
commit
111333ec93
@ -12,7 +12,7 @@
|
||||
::
|
||||
/- *link-view,
|
||||
metadata-store, *invite-store, group-store,
|
||||
group-hook, permission-hook, metadata-hook
|
||||
group-hook, permission-hook, metadata-hook, contact-view
|
||||
/+ *link, *server, default-agent, verb, dbug
|
||||
::
|
||||
|%
|
||||
@ -274,7 +274,9 @@
|
||||
=/ group-path=path
|
||||
?- -.members.act
|
||||
%group path.members.act
|
||||
%ships [~.~ (scot %p our.bowl) path.act]
|
||||
%ships %+ weld
|
||||
?:(real-group.act ~ [~.~]~)
|
||||
[(scot %p our.bowl) path.act]
|
||||
==
|
||||
|^
|
||||
=; group-setup=(list card)
|
||||
@ -294,6 +296,16 @@
|
||||
==
|
||||
==
|
||||
?: ?=(%group -.members.act) ~
|
||||
:: if the group is "real", make contact-view do the heavy lifting
|
||||
::
|
||||
?: real-group.act
|
||||
:_ ~
|
||||
%^ do-poke %contact-view
|
||||
%contact-view-action
|
||||
!> ^- contact-view-action:contact-view
|
||||
[%create group-path [ships.members title description]:act]
|
||||
:: for "unmanaged" groups, do it ourselves
|
||||
::
|
||||
:* :: create the new group
|
||||
::
|
||||
%^ do-poke %group-store
|
||||
|
@ -5,14 +5,21 @@
|
||||
|%
|
||||
++ noun view-action
|
||||
++ json
|
||||
|^ %- of
|
||||
:~ %create^(ot 'path'^pa 'title'^so 'description'^so 'members'^mems ~)
|
||||
==
|
||||
|^ (of %create^create ~)
|
||||
::
|
||||
++ create
|
||||
%- ot
|
||||
:~ 'path'^pa
|
||||
'title'^so
|
||||
'description'^so
|
||||
'members'^mems
|
||||
'realGroup'^bo
|
||||
==
|
||||
::
|
||||
++ mems
|
||||
%- of
|
||||
:~ %group^pa
|
||||
%ships^(cu sy (ar (su ;~(pfix sig fed:ag))))
|
||||
:~ 'group'^pa
|
||||
'ships'^(cu sy (ar (su ;~(pfix sig fed:ag))))
|
||||
==
|
||||
--
|
||||
--
|
||||
|
@ -7,6 +7,7 @@
|
||||
title=@t
|
||||
description=@t
|
||||
members=$%([%group =path] [%ships ships=(set ship)])
|
||||
real-group=?
|
||||
==
|
||||
==
|
||||
--
|
||||
|
@ -144,10 +144,11 @@ class UrbitApi {
|
||||
);
|
||||
}
|
||||
|
||||
createCollection(path, title, description, members) {
|
||||
// members is either {group:'/group-path'} or {'ships':[~zod]}
|
||||
createCollection(path, title, description, members, realGroup) {
|
||||
// members is either {group:'/group-path'} or {'ships':[~zod]},
|
||||
// with realGroup signifying if ships should become a managed group or not.
|
||||
return this.action("link-view", "link-view-action", {
|
||||
create: {path, title, description, members}
|
||||
create: {path, title, description, members, realGroup}
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -125,12 +125,12 @@ export class NewScreen extends Component {
|
||||
ships: []
|
||||
}, () => {
|
||||
api.setSpinner(true);
|
||||
//TODO account for state.createGroup
|
||||
let submit = api.createCollection(
|
||||
appPath,
|
||||
state.title,
|
||||
state.description,
|
||||
target
|
||||
target,
|
||||
state.createGroup
|
||||
);
|
||||
submit.then(() => {
|
||||
api.setSpinner(false);
|
||||
|
Loading…
Reference in New Issue
Block a user