Skip to content

Commit

Permalink
Merge pull request #31 from urbit/philip/kelvin
Browse files Browse the repository at this point in the history
Handle kelvin update error cases
  • Loading branch information
zalberico authored Jan 4, 2023
2 parents e9bc40e + d550405 commit 2021575
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 33 deletions.
2 changes: 1 addition & 1 deletion desk/desk.docket-0
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
:~ title+'System'
:~ title+'Grid'
info+'An app launcher for Urbit.'
color+0xee.5432
glob-http+['https://bootstrap.urbit.org/glob-0v1.tqd6t.ggt8r.roheb.l3bvq.sbm6d.glob' 0v1.tqd6t.ggt8r.roheb.l3bvq.sbm6d]
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/ErrorAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const SubmitIssue = ({ error }: { error: Error }) => {
<Button
as="a"
variant="caution"
href={`https://github.com/urbit/landscape/issues/new?assignees=&labels=bug&title=${title}&body=${body}`}
href={`https://github.com/tloncorp/landscape-apps/issues/new?assignees=&labels=bug&title=${title}&body=${body}`}
target="_blank"
rel="noreferrer"
>
Expand Down
1 change: 0 additions & 1 deletion ui/src/preferences/SystemPreferences.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ export const SystemPreferences = (
const { systemBlocked } = useSystemUpdate();
const charges = useCharges();
const filteredCharges = Object.values(charges)
.filter((charge) => charge.desk !== window.desk)
.filter((charge) => charge.desk !== 'landscape');
const isMobile = useMedia('(max-width: 639px)');
const settingsPath = isMobile ? `${match.url}/:submenu` : '/';
Expand Down
104 changes: 74 additions & 30 deletions ui/src/preferences/about-system/AboutSystem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Dialog, DialogClose, DialogContent, DialogTrigger } from '../../compone
import { FullTlon16Icon } from '../../components/icons/FullTlon16Icon';
import { useSystemUpdate } from '../../logic/useSystemUpdate';
import { useCharge } from '../../state/docket';
import { usePike } from '../../state/kiln';
import { usePike, useLag } from '../../state/kiln';
import { disableDefault, pluralize } from '../../state/util';
import { UpdatePreferences } from './UpdatePreferences';

Expand All @@ -20,7 +20,9 @@ export const AboutSystem = () => {
const gardenPike = usePike(window.desk);
const { systemBlocked, blockedCharges, blockedCount, freezeApps } =
useSystemUpdate();
const gardenBlocked = null != blockedCharges.find(charge => charge.desk == 'garden');
const hash = gardenPike && getHash(gardenPike);
const lag = useLag();

return (
<>
Expand All @@ -46,41 +48,83 @@ export const AboutSystem = () => {
</div>
{systemBlocked ? (
<>
<p className="text-orange-500">Update is currently blocked by the following apps:</p>
{lag ? (
<>
<p className="text-orange-500">
System update failed because your runtime was out of date.
</p>
<p>
Update your runtime or contact your hosting provider.
</p>
<p>
Once your runtime is up to date, click retry below.
</p>
<Button variant="caution" onClick={freezeApps}>
Retry System Update
</Button>
</>
) : (blockedCount == 0) ? (
<>
<p className="text-orange-500">
System update failed.
</p>
<p>
For additional debugging output, open the terminal and click retry below.
</p>
<Button variant="caution" onClick={freezeApps}>
Retry System Update
</Button>
</>
) : (
<>
<p className="text-orange-500">
Update is currently blocked by the following {pluralize('app', blockedCount)}:
</p>
<AppList
apps={blockedCharges}
labelledBy="blocked-apps"
size="xs"
className="font-medium"
/>
<Dialog>
<DialogTrigger as={Button} variant="caution">
Freeze {blockedCount} {pluralize('app', blockedCount)} and Apply Update
</DialogTrigger>
<DialogContent
showClose={false}
onOpenAutoFocus={disableDefault}
className="space-y-6 tracking-tight"
containerClass="w-full max-w-md"
>
<h2 className="h4">
Freeze {blockedCount} {pluralize('App', blockedCount)} and Apply System Update
</h2>
<p>
The following apps will be archived until their developer provides a compatible
update to your system.
</p>
<AppList apps={blockedCharges} labelledBy="blocked-apps" size="xs" />
<div className="flex space-x-6">
<DialogClose as={Button} variant="secondary">
Cancel
</DialogClose>
<DialogClose as={Button} variant="caution" onClick={freezeApps}>
Freeze Apps
</DialogClose>
</div>
</DialogContent>
</Dialog>
{gardenBlocked ? (
<>
<p>
Grid is the application launcher and system interface.
It needs an update before you can apply the System Update.
</p>
</>
) : (
<Dialog>
<DialogTrigger as={Button} variant="caution">
Suspend {blockedCount} {pluralize('App', blockedCount)} and Apply Update
</DialogTrigger>
<DialogContent
showClose={false}
onOpenAutoFocus={disableDefault}
className="space-y-6 tracking-tight"
containerClass="w-full max-w-md"
>
<h2 className="h4">
Suspend {blockedCount} {pluralize('App', blockedCount)} and Apply System Update
</h2>
<p>
The following {pluralize('app', blockedCount)} will be suspended until their
developer provides an update.
</p>
<AppList apps={blockedCharges} labelledBy="blocked-apps" size="xs" />
<div className="flex space-x-6">
<DialogClose as={Button} variant="secondary">
Cancel
</DialogClose>
<DialogClose as={Button} variant="caution" onClick={freezeApps}>
Suspend {pluralize('App', blockedCount)} and Update
</DialogClose>
</div>
</DialogContent>
</Dialog>
)}
</>
)}
</>
) : (
<p>Your urbit is up to date.</p>
Expand Down

1 comment on commit 2021575

@vercel
Copy link

@vercel vercel bot commented on 2021575 Jan 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

garden – ./

garden-beige.vercel.app
garden-urbit.vercel.app
garden-git-master-urbit.vercel.app

Please sign in to comment.