-
Notifications
You must be signed in to change notification settings - Fork 5
fix: make sure Coder plugin indicates when a workspace is being deleted #82
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
Conversation
@@ -226,6 +230,37 @@ export const WorkspacesListItem = ({ | |||
); | |||
}; | |||
|
|||
const deletingStatuses: readonly WorkspaceStatus[] = ['deleting', 'deleted']; |
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.
Should deleted
be moved to offline
? Worried folks might assume a workspace is stuck in a transient state.
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.
Actually, that's a good call. I think I over-complicated things, and we can keep the status a binary offline/online
Will fix really quick
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.
I just realized how unlikely we are to show deleted workspaces in a filtered list view.
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.
Well, I think it still makes sense to make the change – at the very least, the deleting workspaces would show up for "owner:me", which is the first filter people are going to see
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.
@Parkreiner I like deleting! We can definitely keep this addition! I more meant that if a workspace is deleted, it is also offline.
In general, these boundary states (deleting, starting, etc) are useful and down the road I'd love to expose more of them as you've done here.
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.
Looking good!
plugins/backstage-plugin-coder/src/components/CoderWorkspacesCard/WorkspacesListItem.tsx
Outdated
Show resolved
Hide resolved
type AvailabilityStatus = 'online' | 'offline' | 'deleting'; | ||
|
||
function getAvailabilityStatus(workspace: Workspace): AvailabilityStatus { | ||
const currentStatus = workspace.latest_build.status; |
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.
I find myself again really wishing we had pattern matching!
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.
Yeah...Yeah.
No issue to link – something I noticed in the past few days.
Changes made
WorkspacesListItem