From e2aa7af176ae7b5978deb10354ed4d3db2abbdff Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Wed, 1 May 2024 12:12:07 -0500 Subject: [PATCH] chore(tui): Skip context row if empty --- internal/actions/dump/dump.go | 2 +- internal/actions/portforward/portforward.go | 2 +- internal/actions/restore/restore.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/actions/dump/dump.go b/internal/actions/dump/dump.go index 3c1a91e8..88009a32 100644 --- a/internal/actions/dump/dump.go +++ b/internal/actions/dump/dump.go @@ -219,7 +219,7 @@ func (action Dump) summary(err error, took time.Duration, size *util.SizeWriter, } t := tui.MinimalTable(r). - Row("Context", action.Context). + RowIfNotEmpty("Context", action.Context). Row("Namespace", action.Namespace). Row("Pod", action.DBPod.Name). RowIfNotEmpty("Username", action.Username). diff --git a/internal/actions/portforward/portforward.go b/internal/actions/portforward/portforward.go index 3e6e473e..6f7c93a5 100644 --- a/internal/actions/portforward/portforward.go +++ b/internal/actions/portforward/portforward.go @@ -79,7 +79,7 @@ func (a PortForward) printTable() { Msg("port forward is ready") info := tui.MinimalTable(nil). - Row("Context", a.Context). + RowIfNotEmpty("Context", a.Context). Row("Namespace", a.Namespace). Row("Pod", a.DBPod.Name) diff --git a/internal/actions/restore/restore.go b/internal/actions/restore/restore.go index 28e4a26f..ceb561ba 100644 --- a/internal/actions/restore/restore.go +++ b/internal/actions/restore/restore.go @@ -227,7 +227,7 @@ func (action Restore) runInDatabasePod(ctx context.Context, r *io.PipeReader, st func (action Restore) Table() *tui.Table { return tui.MinimalTable(nil). - Row("Context", action.Context). + RowIfNotEmpty("Context", action.Context). Row("Namespace", action.Namespace). Row("Pod", action.DBPod.Name). RowIfNotEmpty("Username", action.Username).