Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
leg100 committed Apr 2, 2024
1 parent e1bc70b commit cb43405
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 30 deletions.
23 changes: 2 additions & 21 deletions internal/tui/module/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,27 +124,6 @@ func (m list) Update(msg tea.Msg) (tui.Model, tea.Cmd) {
cmds []tea.Cmd
)

switch msg := msg.(type) {
case resource.Event[*workspace.Workspace]:
switch msg.Type {
case resource.CreatedEvent:
//cmds = append(cmds, m.createRun(run.CreateOptions{}))
// navigate to the resources tab on the newly created workspace
if msg.Payload.Name == "staging" {
return m, tui.NavigateTo(tui.WorkspaceKind,
tui.WithParent(msg.Payload.Resource),
)
}
}
case resource.Event[*run.Run]:
switch msg.Type {
case resource.UpdatedEvent:
if msg.Payload.Status == run.Planned {
//return m, tui.NavigateTo(tui.RunKind, &msg.Payload.Resource)
}
}
}

switch msg := msg.(type) {
case resource.Event[*workspace.Workspace]:
// Update current workspace and current run
Expand All @@ -160,6 +139,8 @@ func (m list) Update(msg tea.Msg) (tui.Model, tea.Cmd) {
}

// Only handle following keys if there are modules present
//
// TODO: don't do this.
if len(m.table.Items()) == 0 {
break
}
Expand Down
9 changes: 0 additions & 9 deletions internal/tui/top/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/charmbracelet/lipgloss"
"github.com/davecgh/go-spew/spew"
"github.com/leg100/pug/internal/logging"
"github.com/leg100/pug/internal/module"
"github.com/leg100/pug/internal/resource"
"github.com/leg100/pug/internal/task"
"github.com/leg100/pug/internal/tui"
Expand Down Expand Up @@ -125,14 +124,6 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
}

switch msg := msg.(type) {
case resource.Event[*module.Module]:
switch msg.Type {
case resource.CreatedEvent:
// cmds = append(cmds, tui.NavigateTo(tui.ModuleKind, &msg.Payload.Resource))
}
}

if m.showQuitPrompt {
switch msg := msg.(type) {
case tea.KeyMsg:
Expand Down

0 comments on commit cb43405

Please sign in to comment.