-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dash: adapt to richer child computer status #442
Conversation
Deploying gertrude-parents with Cloudflare Pages
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
PR for changed screenshots: #443 |
Deploying gertrude-storybook with Cloudflare Pages
|
Deploying gertrude-site with Cloudflare Pages
|
</Link> | ||
); | ||
const ComputerUser: React.FC<ComputerUserProps> = ({ name, id, status }) => { | ||
const isOnline = status.case !== `offline`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're getting much richer detail from the API now, but to leverage it well will take some UI design work, to show stuff like "Suspended, resuming in 30 minutes" in the various places where this data is surfaced. So, for now, what I've done is basically downcast the data back to a boolean of "offline/online" like we used to get. This preserves the current behavior, and allows us to release the Macapp Version 2.7.0 which will start sending the richer data, and then we can as soon as we're ready start surfacing it to the parents in the dashboard. Basically, whenever you're ready to do a little design/component work on it.
@@ -26,7 +26,7 @@ const ListComputers: React.FC<Props> = ({ devices }) => ( | |||
)} | |||
<div className="mt-8 grid grid-cols-1 lg+:grid-cols-2 2xl:grid-cols-3 gap-8"> | |||
{devices.map((device) => { | |||
const onlineUser = device.users.find((user) => user.isOnline); | |||
const onlineUser = device.users.find((user) => user.status.case !== `offline`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another case where i simplify the new state back into the old boolean for now
<div className="flex justify-between items-center rounded-xl py-4 px-4 even:bg-slate-50/50"> | ||
<h3 className="font-medium text-slate-900">{name}</h3> | ||
{isOnline ? ( | ||
{status.case !== `offline` ? ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another spot
@@ -42,7 +43,7 @@ const UserDevice: React.FC<Props> = ({ | |||
{name && <h4 className="text-sm text-slate-500 line-clamp-1">{modelTitle}</h4>} | |||
</div> | |||
</div> | |||
{status === `online` && ( | |||
{status.case !== `offline` && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the final spot
@@ -34,13 +34,21 @@ export interface BlockedApp { | |||
schedule?: RuleSchedule; | |||
} | |||
|
|||
export type ChildComputerStatus = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the new enum that the API sends back. in a few months, when we push everyone past 2.7.0, the dates will no longer be optional. but for now we'll have to support both types of data, since < 2.7.0 macapps don't send the richer detaill.
796ebde
to
66700a5
Compare
partially addresses https://github.com/gertrude-app/project/issues/225, with gertrude-app/swift#144