Merge pull request #897 from tlipinski/aliases-colorer

Use DefaultColorer for aliases rendering
mine
Fernand Galiana 2020-10-26 20:33:51 -06:00 committed by GitHub
commit e752cc1433
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 7 deletions

View File

@ -5,7 +5,6 @@ import (
"strings"
"github.com/derailed/k9s/internal/client"
"github.com/gdamore/tcell"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
@ -15,9 +14,7 @@ type Alias struct{}
// ColorerFunc colors a resource row.
func (Alias) ColorerFunc() ColorerFunc {
return func(ns string, _ Header, re RowEvent) tcell.Color {
return tcell.ColorAliceBlue
}
return DefaultColorer
}
// Header returns a header row.

View File

@ -25,15 +25,15 @@ func TestAliasColorer(t *testing.T) {
"addAll": {
ns: client.AllNamespaces,
re: render.RowEvent{Kind: render.EventAdd, Row: r},
e: tcell.ColorAliceBlue},
e: tcell.ColorBlue},
"deleteAll": {
ns: client.AllNamespaces,
re: render.RowEvent{Kind: render.EventDelete, Row: r},
e: tcell.ColorAliceBlue},
e: tcell.ColorGray},
"updateAll": {
ns: client.AllNamespaces,
re: render.RowEvent{Kind: render.EventUpdate, Row: r},
e: tcell.ColorAliceBlue,
e: tcell.ColorBlack,
},
}