From 454fcf2eae385c3de24d6ff03a2ac1cc4c53a4b9 Mon Sep 17 00:00:00 2001 From: Leon Mika Date: Sat, 3 Sep 2022 09:41:47 +1000 Subject: [PATCH] issue-20: Added binding action for prompting for tables At the moment, this is not bound to anything --- internal/dynamo-browse/ui/keybindings/keybindings.go | 1 + internal/dynamo-browse/ui/model.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/internal/dynamo-browse/ui/keybindings/keybindings.go b/internal/dynamo-browse/ui/keybindings/keybindings.go index 4842c55..55b5dc6 100644 --- a/internal/dynamo-browse/ui/keybindings/keybindings.go +++ b/internal/dynamo-browse/ui/keybindings/keybindings.go @@ -24,6 +24,7 @@ type ViewKeyBindings struct { Rescan key.Binding `keymap:"rescan"` PromptForQuery key.Binding `keymap:"prompt-for-query"` PromptForFilter key.Binding `keymap:"prompt-for-filter"` + PromptForTable key.Binding `keymap:"prompt-for-table"` ViewBack key.Binding `keymap:"view-back"` ViewForward key.Binding `keymap:"view-forward"` CycleLayoutForward key.Binding `keymap:"cycle-layout-forward"` diff --git a/internal/dynamo-browse/ui/model.go b/internal/dynamo-browse/ui/model.go index 5c32200..fd50a2c 100644 --- a/internal/dynamo-browse/ui/model.go +++ b/internal/dynamo-browse/ui/model.go @@ -227,6 +227,10 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { // return m, nil case key.Matches(msg, m.keyMap.PromptForCommand): return m, m.commandController.Prompt + case key.Matches(msg, m.keyMap.PromptForTable): + return m, func() tea.Msg { + return m.tableReadController.ListTables() + } case key.Matches(msg, m.keyMap.Quit): return m, tea.Quit }