Skip to content

feat(cli): show workspace favorite status in list output #11878

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

Merged
merged 3 commits into from
Jan 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove favorite from default columns, prefix name with star if favorite
  • Loading branch information
johnstcn committed Jan 29, 2024
commit 7c8eda5b35d4e62ed5d1efdb794a58d521f93e03
8 changes: 6 additions & 2 deletions cli/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,15 @@ func workspaceListRowFromWorkspace(now time.Time, workspace codersdk.Workspace)
if status == "Starting" || status == "Started" {
healthy = strconv.FormatBool(workspace.Health.Healthy)
}
favIco := " "
if workspace.Favorite {
favIco = "★"
}
workspaceName := favIco + " " + workspace.OwnerName + "/" + workspace.Name
return workspaceListRow{
Favorite: workspace.Favorite,
Workspace: workspace,
WorkspaceName: workspace.OwnerName + "/" + workspace.Name,
WorkspaceName: workspaceName,
Template: workspace.TemplateName,
Status: status,
Healthy: healthy,
Expand All @@ -72,7 +77,6 @@ func (r *RootCmd) list() *clibase.Cmd {
cliui.TableFormat(
[]workspaceListRow{},
[]string{
"favorite",
"workspace",
"template",
"status",
Expand Down