Issue 18: Added a popup to modify table columns (#31)

Added a new popup to modify the columns of the table. With this new popup, the user can:

- Show and hide columns
- Move columns around
- Add new columns which are derived from the value of an expression
- Delete columns

Also got the overlay mechanisms working.
This commit is contained in:
Leon Mika 2022-10-04 22:23:48 +11:00 committed by GitHub
parent f373a3313a
commit 982d3a9ca7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 1050 additions and 166 deletions

View file

@ -32,13 +32,13 @@ func (s *Service) RenderItem(w io.Writer, item models.Item, resultSet *models.Re
seenColumns := make(map[string]struct{})
for _, colName := range resultSet.Columns() {
seenColumns[colName] = struct{}{}
if r := item.Renderer(colName); r != nil {
if r := itemrender.ToRenderer(item[colName]); r != nil {
s.renderItem(tabWriter, "", colName, r, styles)
}
}
for k, _ := range item {
if _, seen := seenColumns[k]; !seen {
if r := item.Renderer(k); r != nil {
if r := itemrender.ToRenderer(item[k]); r != nil {
s.renderItem(tabWriter, "", k, r, styles)
}
}