Skip to content

Commit 2fb523a

Browse files
authored
remove shared (#232)
* remove shared * remove unused field * remove more user id
1 parent 435e615 commit 2fb523a

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

pkg/cmd/ls/ls.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ func (ls Ls) RunUser(_ bool) error {
282282

283283
func (ls Ls) ShowAllWorkspaces(org *entity.Organization, otherOrgs []entity.Organization, user *entity.User, allWorkspaces []entity.Workspace) {
284284
userWorkspaces := store.FilterForUserWorkspaces(allWorkspaces, user.ID)
285-
ls.displayWorkspacesAndHelp(org, otherOrgs, userWorkspaces, allWorkspaces, user.ID)
285+
ls.displayWorkspacesAndHelp(org, otherOrgs, userWorkspaces, allWorkspaces)
286286

287287
projects := virtualproject.NewVirtualProjects(allWorkspaces)
288288

@@ -300,10 +300,10 @@ func (ls Ls) ShowAllWorkspaces(org *entity.Organization, otherOrgs []entity.Orga
300300
func (ls Ls) ShowUserWorkspaces(org *entity.Organization, otherOrgs []entity.Organization, user *entity.User, allWorkspaces []entity.Workspace) {
301301
userWorkspaces := store.FilterForUserWorkspaces(allWorkspaces, user.ID)
302302

303-
ls.displayWorkspacesAndHelp(org, otherOrgs, userWorkspaces, allWorkspaces, user.ID)
303+
ls.displayWorkspacesAndHelp(org, otherOrgs, userWorkspaces, allWorkspaces)
304304
}
305305

306-
func (ls Ls) displayWorkspacesAndHelp(org *entity.Organization, otherOrgs []entity.Organization, userWorkspaces []entity.Workspace, allWorkspaces []entity.Workspace, userID string) {
306+
func (ls Ls) displayWorkspacesAndHelp(org *entity.Organization, otherOrgs []entity.Organization, userWorkspaces []entity.Workspace, allWorkspaces []entity.Workspace) {
307307
if len(userWorkspaces) == 0 {
308308
ls.terminal.Vprint(ls.terminal.Yellow("No instances in org %s\n", org.Name))
309309
if len(allWorkspaces) > 0 {
@@ -319,7 +319,7 @@ func (ls Ls) displayWorkspacesAndHelp(org *entity.Organization, otherOrgs []enti
319319
}
320320
} else {
321321
ls.terminal.Vprintf("You have %d instances in Org "+ls.terminal.Yellow(org.Name)+"\n", len(userWorkspaces))
322-
displayWorkspacesTable(ls.terminal, userWorkspaces, userID)
322+
displayWorkspacesTable(ls.terminal, userWorkspaces)
323323

324324
fmt.Print("\n")
325325

@@ -405,20 +405,16 @@ func getBrevTableOptions() table.Options {
405405
return options
406406
}
407407

408-
func displayWorkspacesTable(t *terminal.Terminal, workspaces []entity.Workspace, userID string) {
408+
func displayWorkspacesTable(t *terminal.Terminal, workspaces []entity.Workspace) {
409409
ta := table.NewWriter()
410410
ta.SetOutputMirror(os.Stdout)
411411
ta.Style().Options = getBrevTableOptions()
412412
header := table.Row{"Name", "Status", "Build", "Shell", "ID", "Machine"}
413413
ta.AppendHeader(header)
414414
for _, w := range workspaces {
415-
isShared := ""
416-
if w.IsShared(userID) {
417-
isShared = "(shared)"
418-
}
419415
status := getWorkspaceDisplayStatus(w)
420416
instanceString := utilities.GetInstanceString(w)
421-
workspaceRow := []table.Row{{fmt.Sprintf("%s %s", w.Name, isShared), getStatusColoredText(t, status), getStatusColoredText(t, string(w.VerbBuildStatus)), getStatusColoredText(t, getShellDisplayStatus(w)), w.ID, instanceString}}
417+
workspaceRow := []table.Row{{w.Name, getStatusColoredText(t, status), getStatusColoredText(t, string(w.VerbBuildStatus)), getStatusColoredText(t, getShellDisplayStatus(w)), w.ID, instanceString}}
422418
ta.AppendRows(workspaceRow)
423419
}
424420
ta.Render()

0 commit comments

Comments
 (0)