Merge branch 'release/next-userspace' into lf/graph-publish-fe

This commit is contained in:
Logan Allen 2020-10-20 15:08:40 -05:00
commit 79ac6eb8cd
15 changed files with 47 additions and 24 deletions

View File

@ -290,7 +290,7 @@
=/ body=json =/ body=json
(need (de-json:html q.u.body.request.inbound-request)) (need (de-json:html q.u.body.request.inbound-request))
=/ input=vase =/ input=vase
(tube !>(body)) (slop (tube !>(body)) !>(~))
=/ =start-args =/ =start-args
[~ `tid thread input] [~ `tid thread input]
=^ cards state =^ cards state

View File

@ -24,7 +24,7 @@
|= arg=vase |= arg=vase
=/ m (strand ,vase) =/ m (strand ,vase)
^- form:m ^- form:m
=+ !<(=action:graph-view arg) =+ !<([=action:graph-view ~] arg)
?> ?=(%create -.action) ?> ?=(%create -.action)
;< =bowl:spider bind:m get-bowl:strandio ;< =bowl:spider bind:m get-bowl:strandio
:: Add graph to graph-store :: Add graph to graph-store

View File

@ -48,7 +48,7 @@
|= arg=vase |= arg=vase
=/ m (strand ,vase) =/ m (strand ,vase)
^- form:m ^- form:m
=+ !<(=action:graph-view arg) =+ !<([=action:graph-view ~] arg)
?> ?=(%delete -.action) ?> ?=(%delete -.action)
;< =bowl:spider bind:m get-bowl:strandio ;< =bowl:spider bind:m get-bowl:strandio
?. =(our.bowl entity.rid.action) ?. =(our.bowl entity.rid.action)

View File

@ -43,7 +43,7 @@
|= arg=vase |= arg=vase
=/ m (strand ,vase) =/ m (strand ,vase)
^- form:m ^- form:m
=+ !<(=action:graph-view arg) =+ !<([=action:graph-view ~] arg)
?> ?=(%groupify -.action) ?> ?=(%groupify -.action)
;< =group bind:m (scry-group rid.action) ;< =group bind:m (scry-group rid.action)
?. hidden.group ?. hidden.group

View File

@ -28,7 +28,7 @@
|= arg=vase |= arg=vase
=/ m (strand ,vase) =/ m (strand ,vase)
^- form:m ^- form:m
=+ !<(=action:graph-view arg) =+ !<([=action:graph-view ~] arg)
?> ?=(%join -.action) ?> ?=(%join -.action)
;< =bowl:spider bind:m get-bowl:strandio ;< =bowl:spider bind:m get-bowl:strandio
?: =(our.bowl entity.rid.action) ?: =(our.bowl entity.rid.action)

View File

@ -28,20 +28,20 @@
;< ugroup=(unit group) bind:m ;< ugroup=(unit group) bind:m
%+ scry:strandio ,(unit group) %+ scry:strandio ,(unit group)
;: weld ;: weld
/gx/group-store/resource/graph /gx/group-store/groups
(en-path:resource rid) (en-path:resource rid)
/noun /noun
== ==
(pure:m (need ugroup)) (pure:m (need ugroup))
:: ::
++ delete-graph ++ delete-graph
|= rid=resource |= [now=time rid=resource]
=/ m (strand ,~) =/ m (strand ,~)
^- form:m ^- form:m
;< ~ bind:m ;< ~ bind:m
(poke-our %graph-pull-hook %pull-hook-action !>([%remove rid])) (poke-our %graph-pull-hook %pull-hook-action !>([%remove rid]))
;< ~ bind:m ;< ~ bind:m
(poke-our %graph-store %graph-update !>([%remove-graph rid])) (poke-our %graph-store %graph-update !>([%0 now [%remove-graph rid]]))
(pure:m ~) (pure:m ~)
-- --
:: ::
@ -49,7 +49,7 @@
|= arg=vase |= arg=vase
=/ m (strand ,vase) =/ m (strand ,vase)
^- form:m ^- form:m
=+ !<(=action:graph-view arg) =+ !<([=action:graph-view ~] arg)
?> ?=(%leave -.action) ?> ?=(%leave -.action)
;< =bowl:spider bind:m get-bowl:strandio ;< =bowl:spider bind:m get-bowl:strandio
?: =(our.bowl entity.rid.action) ?: =(our.bowl entity.rid.action)
@ -57,11 +57,20 @@
;< group-rid=resource bind:m (scry-metadata rid.action) ;< group-rid=resource bind:m (scry-metadata rid.action)
;< g=group bind:m (scry-group group-rid) ;< g=group bind:m (scry-group group-rid)
?. hidden.g ?. hidden.g
;< ~ bind:m (delete-graph rid.action) ;< ~ bind:m (delete-graph now.bowl rid.action)
(pure:m !>(~)) (pure:m !>(~))
;< ~ bind: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 ;< ~ bind:m
(poke-our %group-store %group-action !>([%remove-group rid.action ~])) (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 !>(~)) (pure:m !>(~))

View File

@ -11,7 +11,9 @@
|= arg=vase |= arg=vase
=/ m (strand ,vase) =/ m (strand ,vase)
^- form:m ^- 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 ;< =bowl:spider bind:m get-bowl:strandio
:: unarchive graph and share it :: unarchive graph and share it
;< ~ bind:m ;< ~ bind:m

View File

@ -25,8 +25,8 @@ export function ChatResource(props: ChatResourceProps) {
return null; return null;
} }
const { envelopes, config } = props.inbox[station]; const { envelopes, config } = (props.inbox?.[station]) ? props.inbox[station] : {envelopes: [], config: {}};
const { read, length } = config; const { read, length } = (config) ? config : undefined;
const groupPath = props.association["group-path"]; const groupPath = props.association["group-path"];
const group = props.groups[groupPath]; const group = props.groups[groupPath];

View File

@ -47,11 +47,9 @@ export default class LaunchApp extends React.Component {
p={2} p={2}
> >
<Tile <Tile
border={1}
bg="#fff" bg="#fff"
borderColor="green" color="green"
to="/~landscape/home" to="/~landscape/home"
boxShadow='none'
p={0} p={0}
> >
<Box p={2} height='100%' width='100%' bg='washedGreen'> <Box p={2} height='100%' width='100%' bg='washedGreen'>

View File

@ -30,7 +30,7 @@ export default class Tile extends React.Component {
borderRadius={2} borderRadius={2}
overflow="hidden" overflow="hidden"
bg={bg || "white"} bg={bg || "white"}
color='washedGray' color={props?.color || 'washedGray'}
boxShadow={boxShadow || '0 0 0px 1px inset'} boxShadow={boxShadow || '0 0 0px 1px inset'}
> >
<Box <Box

View File

@ -93,7 +93,7 @@ export default class WeatherTile extends React.Component {
weatherStyle = { bg: 'white', text: 'black' } weatherStyle = { bg: 'white', text: 'black' }
) { ) {
return ( return (
<Tile bg={weatherStyle.bg} color={weatherStyle.text}> <Tile bg={weatherStyle.bg}>
{child} {child}
</Tile> </Tile>
); );

View File

@ -173,6 +173,7 @@ export function GroupsPane(props: GroupsPaneProps) {
groups={groups} groups={groups}
group={groupPath} group={groupPath}
contacts={props.contacts} contacts={props.contacts}
workspace={workspace}
/> />
{popovers(routeProps, baseUrl)} {popovers(routeProps, baseUrl)}
</Skeleton> </Skeleton>

View File

@ -45,7 +45,7 @@ interface NewChannelProps {
export function NewChannel(props: NewChannelProps & RouteComponentProps) { export function NewChannel(props: NewChannelProps & RouteComponentProps) {
const { history, api, group } = props; const { history, api, group, workspace } = props;
const waiter = useWaitForProps(props, 5000); const waiter = useWaitForProps(props, 5000);
@ -145,12 +145,13 @@ export function NewChannel(props: NewChannelProps & RouteComponentProps) {
caption="What's your channel about?" caption="What's your channel about?"
placeholder="Channel description" placeholder="Channel description"
/> />
{(workspace?.type === 'home') &&
<ShipSearch <ShipSearch
groups={props.groups} groups={props.groups}
contacts={props.contacts} contacts={props.contacts}
id="ships" id="ships"
label="Invitees" label="Invitees"
/> />}
<Box justifySelf="start"> <Box justifySelf="start">
<AsyncButton <AsyncButton
primary primary

View File

@ -45,8 +45,9 @@ const searchParticipant = (search: string) => (p: Participant) => {
if (search.length == 0) { if (search.length == 0) {
return true; return true;
} }
const s = search.toLowerCase(); let s = search.toLowerCase();
return p.patp.includes(s) || p.nickname.toLowerCase().includes(search); s = (s.startsWith('~')) ? s.substr(1) : s;
return p.patp.includes(s) || p.nickname.toLowerCase().includes(s);
}; };
function getParticipants(cs: Contacts, group: Group) { function getParticipants(cs: Contacts, group: Group) {
@ -289,6 +290,11 @@ function Participant(props: {
}); });
}, [api, association]); }, [api, association]);
const onKick = useCallback(async () => {
const resource = resourceFromPath(association["group-path"]);
await api.groups.remove(resource, [`~${contact.patp}`]);
}, [api, association]);
const avatar = const avatar =
contact?.avatar !== null && !props.hideAvatars ? ( contact?.avatar !== null && !props.hideAvatars ? (
<img src={contact.avatar} height={32} width={32} className="dib" /> <img src={contact.avatar} height={32} width={32} className="dib" />
@ -337,9 +343,14 @@ function Participant(props: {
{props.role === "admin" && ( {props.role === "admin" && (
<> <>
{!isInvite && ( {!isInvite && (
<>
<StatelessAsyncAction onClick={onBan} bg="transparent"> <StatelessAsyncAction onClick={onBan} bg="transparent">
<Text color="red">Ban from {title}</Text> <Text color="red">Ban from {title}</Text>
</StatelessAsyncAction> </StatelessAsyncAction>
<StatelessAsyncAction onClick={onKick} bg="transparent">
<Text color="red">Kick from {title}</Text>
</StatelessAsyncAction>
</>
)} )}
{role === "admin" ? ( {role === "admin" ? (
<StatelessAsyncAction onClick={onDemote} bg="transparent"> <StatelessAsyncAction onClick={onDemote} bg="transparent">

View File

@ -105,6 +105,7 @@ export function Sidebar(props: SidebarProps) {
width="100%" width="100%"
gridRow="1/2" gridRow="1/2"
gridColumn="1/2" gridColumn="1/2"
borderTopLeftRadius='2'
borderRight={1} borderRight={1}
borderRightColor="washedGray" borderRightColor="washedGray"
overflowY="scroll" overflowY="scroll"