Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into feature/i31-live-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
canack committed Jun 26, 2024
2 parents 5b4f1dc + 4b434b4 commit 44e7f4a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions internal/terminal/handler/ghtrigger/ghtrigger.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ func (m *ModelGithubTrigger) syncWorkflowContent(ctx context.Context) {
if len(workflowContent.Workflow.KeyVals) == 0 &&
len(workflowContent.Workflow.Choices) == 0 &&
len(workflowContent.Workflow.Inputs) == 0 {
m.fillTableWithEmptyMessage()
m.modelError.SetDefaultMessage(fmt.Sprintf("[%s@%s] Workflow doesn't contain options but still triggerable",
m.SelectedRepository.RepositoryName, m.SelectedRepository.BranchName))
} else {
Expand All @@ -483,6 +484,19 @@ func (m *ModelGithubTrigger) syncWorkflowContent(ctx context.Context) {
go m.Update(m) // update model
}

func (m *ModelGithubTrigger) fillTableWithEmptyMessage() {
var rows []table.Row
for i := 0; i < 100; i++ {
idx := fmt.Sprintf("%d", i)
rows = append(rows, table.Row{
idx, "EMPTY", "EMPTY", "EMPTY", "No workflow input found",
})
}

m.tableTrigger.SetRows(rows)
m.tableTrigger.SetCursor(0)
}

func (m *ModelGithubTrigger) showInformationIfAnyEmptyValue() {
for _, row := range m.tableTrigger.Rows() {
if row[4] == "" {
Expand Down

0 comments on commit 44e7f4a

Please sign in to comment.