From c9cb97d476864515fe66c4806852262d7249e65c Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Fri, 16 Oct 2020 10:42:06 -0500 Subject: [PATCH 1/9] spider: update http handler to be compatible with dojo --- pkg/arvo/app/spider.hoon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/arvo/app/spider.hoon b/pkg/arvo/app/spider.hoon index d80d8e69da..1d4230c68e 100644 --- a/pkg/arvo/app/spider.hoon +++ b/pkg/arvo/app/spider.hoon @@ -290,7 +290,7 @@ =/ body=json (need (de-json:html q.u.body.request.inbound-request)) =/ input=vase - (tube !>(body)) + (slop (tube !>(body)) !>(~)) =/ =start-args [~ `tid thread input] =^ cards state From ace6a41e9eb7de6bb543a00d7cc40791b9041af9 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Fri, 16 Oct 2020 10:42:31 -0500 Subject: [PATCH 2/9] graph-threads: update to work with dojo and http --- pkg/arvo/ted/graph/create.hoon | 2 +- pkg/arvo/ted/graph/delete.hoon | 2 +- pkg/arvo/ted/graph/groupify.hoon | 2 +- pkg/arvo/ted/graph/join.hoon | 2 +- pkg/arvo/ted/graph/leave.hoon | 2 +- pkg/arvo/ted/graph/restore.hoon | 4 +++- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pkg/arvo/ted/graph/create.hoon b/pkg/arvo/ted/graph/create.hoon index 6b7462e0f4..e0938fbc6c 100644 --- a/pkg/arvo/ted/graph/create.hoon +++ b/pkg/arvo/ted/graph/create.hoon @@ -24,7 +24,7 @@ |= arg=vase =/ m (strand ,vase) ^- form:m -=+ !<(=action:graph-view arg) +=+ !<([=action:graph-view ~] arg) ?> ?=(%create -.action) ;< =bowl:spider bind:m get-bowl:strandio :: Add graph to graph-store diff --git a/pkg/arvo/ted/graph/delete.hoon b/pkg/arvo/ted/graph/delete.hoon index 96e8524a7a..7e95d492bc 100644 --- a/pkg/arvo/ted/graph/delete.hoon +++ b/pkg/arvo/ted/graph/delete.hoon @@ -48,7 +48,7 @@ |= arg=vase =/ m (strand ,vase) ^- form:m -=+ !<(=action:graph-view arg) +=+ !<([=action:graph-view ~] arg) ?> ?=(%delete -.action) ;< =bowl:spider bind:m get-bowl:strandio ?. =(our.bowl entity.rid.action) diff --git a/pkg/arvo/ted/graph/groupify.hoon b/pkg/arvo/ted/graph/groupify.hoon index fb689bee3c..5a3f618fd5 100644 --- a/pkg/arvo/ted/graph/groupify.hoon +++ b/pkg/arvo/ted/graph/groupify.hoon @@ -43,7 +43,7 @@ |= arg=vase =/ m (strand ,vase) ^- form:m -=+ !<(=action:graph-view arg) +=+ !<([=action:graph-view ~] arg) ?> ?=(%groupify -.action) ;< =group bind:m (scry-group rid.action) ?. hidden.group diff --git a/pkg/arvo/ted/graph/join.hoon b/pkg/arvo/ted/graph/join.hoon index 6cb81d35b8..b4ebffff88 100644 --- a/pkg/arvo/ted/graph/join.hoon +++ b/pkg/arvo/ted/graph/join.hoon @@ -28,7 +28,7 @@ |= arg=vase =/ m (strand ,vase) ^- form:m -=+ !<(=action:graph-view arg) +=+ !<([=action:graph-view ~] arg) ?> ?=(%join -.action) ;< =bowl:spider bind:m get-bowl:strandio ?: =(our.bowl entity.rid.action) diff --git a/pkg/arvo/ted/graph/leave.hoon b/pkg/arvo/ted/graph/leave.hoon index 46486fee02..e85359d849 100644 --- a/pkg/arvo/ted/graph/leave.hoon +++ b/pkg/arvo/ted/graph/leave.hoon @@ -49,7 +49,7 @@ |= arg=vase =/ m (strand ,vase) ^- form:m -=+ !<(=action:graph-view arg) +=+ !<([=action:graph-view ~] arg) ?> ?=(%leave -.action) ;< =bowl:spider bind:m get-bowl:strandio ?: =(our.bowl entity.rid.action) diff --git a/pkg/arvo/ted/graph/restore.hoon b/pkg/arvo/ted/graph/restore.hoon index 33cf02dc0b..96e570081c 100644 --- a/pkg/arvo/ted/graph/restore.hoon +++ b/pkg/arvo/ted/graph/restore.hoon @@ -11,7 +11,9 @@ |= arg=vase =/ m (strand ,vase) ^- form:m -=+ !<([rid=resource title=@t description=@t group=resource module=@t ~] arg) ++= !< + [[rid=resource title=@t description=@t group=resource module=@t ~] ~] + arg ;< =bowl:spider bind:m get-bowl:strandio :: unarchive graph and share it ;< ~ bind:m From ed337eb4356e09f201432d26b816fca46c208512 Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Fri, 16 Oct 2020 12:00:05 -0400 Subject: [PATCH 3/9] launch: home tile uses boxShadow Fixes urbit/landscape#114. --- pkg/interface/src/views/apps/launch/app.js | 4 +--- pkg/interface/src/views/apps/launch/components/tiles/tile.js | 2 +- .../src/views/apps/launch/components/tiles/weather.js | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/interface/src/views/apps/launch/app.js b/pkg/interface/src/views/apps/launch/app.js index e660f850da..f2e09aeebd 100644 --- a/pkg/interface/src/views/apps/launch/app.js +++ b/pkg/interface/src/views/apps/launch/app.js @@ -47,11 +47,9 @@ export default class LaunchApp extends React.Component { p={2} > diff --git a/pkg/interface/src/views/apps/launch/components/tiles/tile.js b/pkg/interface/src/views/apps/launch/components/tiles/tile.js index a3dffa6853..3d6d8d966e 100644 --- a/pkg/interface/src/views/apps/launch/components/tiles/tile.js +++ b/pkg/interface/src/views/apps/launch/components/tiles/tile.js @@ -30,7 +30,7 @@ export default class Tile extends React.Component { borderRadius={2} overflow="hidden" bg={bg || "white"} - color='washedGray' + color={props?.color || 'washedGray'} boxShadow={boxShadow || '0 0 0px 1px inset'} > + {child} ); From 40983be79ca7b15e0b1210bdc5ee364b8503e8da Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Fri, 16 Oct 2020 12:05:38 -0400 Subject: [PATCH 4/9] landscape: sidebar uses borderRadius --- pkg/interface/src/views/landscape/components/Sidebar/Sidebar.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/interface/src/views/landscape/components/Sidebar/Sidebar.tsx b/pkg/interface/src/views/landscape/components/Sidebar/Sidebar.tsx index c32bbee0e8..12229753b6 100644 --- a/pkg/interface/src/views/landscape/components/Sidebar/Sidebar.tsx +++ b/pkg/interface/src/views/landscape/components/Sidebar/Sidebar.tsx @@ -95,6 +95,7 @@ export function Sidebar(props: SidebarProps) { width="100%" gridRow="1/2" gridColumn="1/2" + borderTopLeftRadius='2' borderRight={1} borderRightColor="washedGray" overflowY="scroll" From 926c9975c26b85bfdd5e75430c104bc48308e27a Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Fri, 16 Oct 2020 12:10:07 -0500 Subject: [PATCH 5/9] graph-leave: fixed leave thread to function properly --- pkg/arvo/ted/graph/leave.hoon | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/pkg/arvo/ted/graph/leave.hoon b/pkg/arvo/ted/graph/leave.hoon index e85359d849..9d0bc6797e 100644 --- a/pkg/arvo/ted/graph/leave.hoon +++ b/pkg/arvo/ted/graph/leave.hoon @@ -28,20 +28,20 @@ ;< ugroup=(unit group) bind:m %+ scry:strandio ,(unit group) ;: weld - /gx/group-store/resource/graph + /gx/group-store/groups (en-path:resource rid) /noun == (pure:m (need ugroup)) :: ++ delete-graph - |= rid=resource + |= [now=time rid=resource] =/ m (strand ,~) ^- form:m ;< ~ bind:m (poke-our %graph-pull-hook %pull-hook-action !>([%remove rid])) ;< ~ bind:m - (poke-our %graph-store %graph-update !>([%remove-graph rid])) + (poke-our %graph-store %graph-update !>([%0 now [%remove-graph rid]])) (pure:m ~) -- :: @@ -57,11 +57,20 @@ ;< group-rid=resource bind:m (scry-metadata rid.action) ;< g=group bind:m (scry-group group-rid) ?. hidden.g - ;< ~ bind:m (delete-graph rid.action) + ;< ~ bind:m (delete-graph now.bowl rid.action) (pure:m !>(~)) ;< ~ bind:m - (poke-our %group-push-hook %pull-hook-action !>([%remove rid.action])) + %+ poke-our %metadata-hook + metadata-hook-action+!>([%remove (en-path:resource rid.action)]) +;< ~ bind:m + %+ poke-our %metadata-store + :- %metadata-action + !> :+ %remove + (en-path:resource rid.action) + [%graph (en-path:resource rid.action)] +;< ~ bind:m + (poke-our %group-pull-hook %pull-hook-action !>([%remove rid.action])) ;< ~ bind:m (poke-our %group-store %group-action !>([%remove-group rid.action ~])) -;< ~ bind:m (delete-graph rid.action) +;< ~ bind:m (delete-graph now.bowl rid.action) (pure:m !>(~)) From aeec7f4c5e308f0f0ddae83cae22b2b856ffc94c Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Mon, 19 Oct 2020 21:18:02 -0400 Subject: [PATCH 6/9] groups: add 'kick from' action --- .../src/views/landscape/components/Participants.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/interface/src/views/landscape/components/Participants.tsx b/pkg/interface/src/views/landscape/components/Participants.tsx index fff6e72e3f..89564ff863 100644 --- a/pkg/interface/src/views/landscape/components/Participants.tsx +++ b/pkg/interface/src/views/landscape/components/Participants.tsx @@ -289,6 +289,11 @@ function Participant(props: { }); }, [api, association]); + const onKick = useCallback(async () => { + const resource = resourceFromPath(association["group-path"]); + await api.groups.remove(resource, [`~${contact.patp}`]); + }, [api, association]); + const avatar = contact?.avatar !== null && !props.hideAvatars ? ( @@ -337,9 +342,14 @@ function Participant(props: { {props.role === "admin" && ( <> {!isInvite && ( + <> Ban from {title} + + Kick from {title} + + )} {role === "admin" ? ( From bb37ba82369103b0dbce21bf9104a542460b899d Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Mon, 19 Oct 2020 21:26:44 -0400 Subject: [PATCH 7/9] groups: new channel only shows ship search at home --- pkg/interface/src/views/landscape/components/GroupsPane.tsx | 1 + pkg/interface/src/views/landscape/components/NewChannel.tsx | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/interface/src/views/landscape/components/GroupsPane.tsx b/pkg/interface/src/views/landscape/components/GroupsPane.tsx index 8a8b66eb10..b8f91a618c 100644 --- a/pkg/interface/src/views/landscape/components/GroupsPane.tsx +++ b/pkg/interface/src/views/landscape/components/GroupsPane.tsx @@ -176,6 +176,7 @@ export function GroupsPane(props: GroupsPaneProps) { groups={groups} group={groupPath} contacts={props.contacts} + workspace={workspace} /> {popovers(routeProps, baseUrl)} diff --git a/pkg/interface/src/views/landscape/components/NewChannel.tsx b/pkg/interface/src/views/landscape/components/NewChannel.tsx index e95de03886..7224d0b3db 100644 --- a/pkg/interface/src/views/landscape/components/NewChannel.tsx +++ b/pkg/interface/src/views/landscape/components/NewChannel.tsx @@ -45,7 +45,7 @@ interface NewChannelProps { export function NewChannel(props: NewChannelProps & RouteComponentProps) { - const { history, api, group } = props; + const { history, api, group, workspace } = props; const waiter = useWaitForProps(props, 5000); @@ -146,12 +146,13 @@ export function NewChannel(props: NewChannelProps & RouteComponentProps) { caption="What's your channel about?" placeholder="Channel description" /> + {(workspace?.type === 'home') && + />} Date: Mon, 19 Oct 2020 21:37:32 -0400 Subject: [PATCH 8/9] groups: allow search to have sigs --- .../src/views/landscape/components/Participants.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/interface/src/views/landscape/components/Participants.tsx b/pkg/interface/src/views/landscape/components/Participants.tsx index fff6e72e3f..80ad44e79d 100644 --- a/pkg/interface/src/views/landscape/components/Participants.tsx +++ b/pkg/interface/src/views/landscape/components/Participants.tsx @@ -45,8 +45,9 @@ const searchParticipant = (search: string) => (p: Participant) => { if (search.length == 0) { return true; } - const s = search.toLowerCase(); - return p.patp.includes(s) || p.nickname.toLowerCase().includes(search); + let s = search.toLowerCase(); + s = (s.startsWith('~')) ? s.substr(1) : s; + return p.patp.includes(s) || p.nickname.toLowerCase().includes(s); }; function getParticipants(cs: Contacts, group: Group) { From 164e90b53faca184e94c67c066d0d50a877b4142 Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Mon, 19 Oct 2020 22:04:41 -0400 Subject: [PATCH 9/9] chat: prevent crashes if join is interrupted Fixes #3748. --- pkg/interface/src/views/apps/chat/ChatResource.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/interface/src/views/apps/chat/ChatResource.tsx b/pkg/interface/src/views/apps/chat/ChatResource.tsx index ec64f1a7bc..b36a92a75d 100644 --- a/pkg/interface/src/views/apps/chat/ChatResource.tsx +++ b/pkg/interface/src/views/apps/chat/ChatResource.tsx @@ -25,8 +25,8 @@ export function ChatResource(props: ChatResourceProps) { return null; } - const { envelopes, config } = props.inbox[station]; - const { read, length } = config; + const { envelopes, config } = (props.inbox?.[station]) ? props.inbox[station] : {envelopes: [], config: {}}; + const { read, length } = (config) ? config : undefined; const groupPath = props.association["group-path"]; const group = props.groups[groupPath];