Mark codespace with pending op as disabled with reason instead of state

This commit is contained in:
Charlie Andrews 2022-03-15 11:47:10 -04:00
parent 3f65e5ae24
commit 3d28c52104

View file

@ -89,10 +89,22 @@ func (a *App) List(ctx context.Context, limit int, exporter cmdutil.Exporter) er
formattedName := formatNameForVSCSTarget(c.Name, c.VSCSTarget)
tp.AddField(formattedName, nil, cs.Yellow)
var nameColor func(string) string
switch c.PendingOperation {
case false:
nameColor = cs.Yellow
case true:
nameColor = cs.Gray
}
tp.AddField(formattedName, nil, nameColor)
tp.AddField(c.Repository.FullName, nil, nil)
tp.AddField(c.branchWithGitStatus(), nil, cs.Cyan)
tp.AddField(c.State, nil, stateColor)
if c.PendingOperation {
tp.AddField(c.PendingOperationDisabledReason, nil, cs.Gray)
} else {
tp.AddField(c.State, nil, stateColor)
}
if tp.IsTTY() {
ct, err := time.Parse(time.RFC3339, c.CreatedAt)