Merge branch 'next/groups'

This commit is contained in:
Hunter Miller 2022-02-24 10:44:08 -06:00
commit ce75499ae5
6 changed files with 39 additions and 14 deletions

View File

@ -7,7 +7,6 @@
content="width=device-width, initial-scale=1, shrink-to-fit=no,maximum-scale=1"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-touch-fullscreen" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
<link rel="manifest"
href='data:application/manifest+json,{
"name": "Groups",
@ -16,6 +15,9 @@
"display": "standalone",
"background_color": "%23FFFFFF",
"theme_color": "%23000000"}' />
<meta name="theme-color" content="#FFFFFF" media="(prefers-color-scheme: light)">
<meta name="theme-color" content="#1A1A1A" media="(prefers-color-scheme: dark)">
<meta name="theme-color" content="#FFFFFF">
<script src="/apps/landscape/desk.js"></script>
<script src="/session.js"></script>
</head>

View File

@ -143,6 +143,8 @@ function PendingGroup(props: PendingGroupProps) {
<Box>
{!joining ? (
<Text color="blue">Invited</Text>
) : joining === 'no-perms' || joining == 'strange' ? (
<Text color="red">Join Failed</Text>
) : joining !== "done" ? (
<Text gray>Joining...</Text>
) : (

View File

@ -150,22 +150,38 @@ function JoinError(props: {
desc: JoinDesc;
request: JoinRequest;
modal: boolean;
dismiss: () => void;
}) {
const { desc, request, modal } = props;
const { dismiss, desc, request, modal } = props;
const { preview } = usePreview(desc.group);
const group = preview?.metadata?.title ?? desc.group;
const title = `Joining ${group} failed`;
const explanation =
request.progress === 'no-perms'
? 'You do not have the correct permissions'
: 'An unexpected error occurred';
: 'An unexpected error occurred';
const onRetry = () => {
useGroupState.getState().abortJoin(desc.group);
const [,,ship,name] = group.split('/');
airlock.poke(
join(ship, name, desc.kind, false, false)
);
};
const onAbort = () => {
useGroupState.getState().abortJoin(desc.group);
dismiss();
};
return (
<JoinSkeleton modal={modal} title={title} desc={desc}>
<Col p='4' gapY='4'>
<Text fontWeight='medium'>{explanation}</Text>
<Row>
<Button>Dismiss</Button>
<Row gapX="2">
<Button onClick={onRetry} primary>Retry</Button>
<Button onClick={onAbort} destructive>Abort</Button>
</Row>
</Col>
</JoinSkeleton>
@ -233,7 +249,7 @@ export function Join(props: JoinProps) {
finished={finishedPath}
/>
) : isErrored ? (
<JoinError modal={modal} desc={desc} request={openedRequest} />
<JoinError dismiss={dismiss} modal={modal} desc={desc} request={openedRequest} />
) : (
<JoinInitial modal={modal} dismiss={dismiss} desc={desc} invite={invite} />
);

View File

@ -295,12 +295,14 @@
::
++ rollback
|^
=/ =request:view (~(got by joining) rid)
=/ =request:view (~(got by joining) rid)
?+ progress.request ~|(cannot-rollback/progress.request !!)
%start start
%added added
%metadata metadata
%start start
%added added
%metadata metadata
?(%no-perms %strange %abort) error
==
++ error jn-core
++ start jn-core
++ added (emit del-us:pass)
++ metadata (emit:added remove-pull-groups:pass)

View File

@ -22,6 +22,7 @@
[%4 observers=(map serial observer:sur)]
[%5 observers=(map serial observer:sur) warm-cache=_|]
[%6 state-0]
[%7 state-0]
==
::
+$ serial @uv
@ -35,7 +36,7 @@
--
::
%- agent:dbug
=| [%6 state-0]
=| [%7 state-0]
=* state -
::
^- agent:gall
@ -117,8 +118,10 @@
=| cards=(list card)
|-
?- -.old-state
%6
%7
[cards this(state old-state)]
%6
$(-.old-state %7, cards :_(cards (act %warm-cache-all ~)))
::
%5
=. cards

View File

@ -1,10 +1,10 @@
:~ title+'Groups'
info+'A suite of applications to communicate on Urbit'
color+0xee.5432
glob-http+['https://bootstrap.urbit.org/glob-0v2.2tc97.h3e0k.7b26d.a0ma8.em5ce.glob' 0v2.2tc97.h3e0k.7b26d.a0ma8.em5ce]
glob-http+['https://bootstrap.urbit.org/glob-0v7.gib8r.r1bb5.a1e66.894c5.8ibm0.glob' 0v7.gib8r.r1bb5.a1e66.894c5.8ibm0]
base+'landscape'
version+[1 0 6]
version+[1 0 7]
website+'https://tlon.io'
license+'MIT'
==