trying to set the target version

This commit is contained in:
Jeff Carr 2024-02-18 17:56:25 -06:00
parent dc0040f080
commit 5d0c793ae9
5 changed files with 42 additions and 15 deletions

View File

@ -21,7 +21,8 @@ func (r *Repo) Hide() {
r.endBox.Hide() r.endBox.Hide()
// r.statusButton.Hide() // r.statusButton.Hide()
// r.diffButton.Hide() // r.diffButton.Hide()
r.goSumStatus.Hide() r.goState.Hide()
r.targetV.Hide()
r.hidden = true r.hidden = true
} }
@ -42,7 +43,8 @@ func (r *Repo) Show() {
r.endBox.Show() r.endBox.Show()
// r.statusButton.Show() // r.statusButton.Show()
// r.diffButton.Show() // r.diffButton.Show()
r.goSumStatus.Show() r.goState.Show()
r.targetV.Show()
r.hidden = false r.hidden = false
} }
@ -75,13 +77,14 @@ func (r *RepoList) addRepo(grid *gui.Node, path string, master string, devel str
} }
newRepo.pLabel = grid.NewLabel(path).SetProgName("path") newRepo.pLabel = grid.NewLabel(path).SetProgName("path")
newRepo.lastTag = grid.NewLabel("").SetProgName("lastTag")
newRepo.masterVersion = grid.NewLabel("").SetProgName("masterVersion")
newRepo.hidden = false newRepo.hidden = false
switch r.viewName { switch r.viewName {
case "autotypist": case "autotypist":
newRepo.lastTag = grid.NewLabel("").SetProgName("lastTag")
newRepo.masterVersion = grid.NewLabel("").SetProgName("masterVersion")
newRepo.develVersion = grid.NewLabel("").SetProgName("develVersion") newRepo.develVersion = grid.NewLabel("").SetProgName("develVersion")
newRepo.userVersion = grid.NewLabel("").SetProgName("userVersion") newRepo.userVersion = grid.NewLabel("").SetProgName("userVersion")
newRepo.targetV = r.blind.NewLabel("")
newRepo.dirtyLabel = grid.NewLabel("") newRepo.dirtyLabel = grid.NewLabel("")
newRepo.vLabel = grid.NewLabel("").SetProgName("current") newRepo.vLabel = grid.NewLabel("").SetProgName("current")
newRepo.endBox = grid.NewHorizontalBox("HBOX") newRepo.endBox = grid.NewHorizontalBox("HBOX")
@ -138,12 +141,13 @@ func (r *RepoList) addRepo(grid *gui.Node, path string, master string, devel str
newRepo.Status.Build() newRepo.Status.Build()
}) })
} }
newRepo.goSumStatus = r.blind.NewLabel("in the blind") newRepo.goState = r.blind.NewLabel("in the blind")
case "guireleaser": case "guireleaser":
newRepo.develVersion = r.blind.NewLabel("").SetProgName("develVersion") newRepo.targetV = grid.NewLabel("")
newRepo.userVersion = r.blind.NewLabel("").SetProgName("userVersion") newRepo.lastTag = grid.NewLabel("").SetProgName("lastTag")
newRepo.masterVersion = grid.NewLabel("").SetProgName("masterVersion")
newRepo.dirtyLabel = grid.NewLabel("") newRepo.dirtyLabel = grid.NewLabel("")
newRepo.goSumStatus = grid.NewLabel("in the blind") newRepo.goState = grid.NewLabel("not in the blind")
newRepo.vLabel = grid.NewLabel("").SetProgName("current") newRepo.vLabel = grid.NewLabel("").SetProgName("current")
newRepo.endBox = grid.NewHorizontalBox("HBOX") newRepo.endBox = grid.NewHorizontalBox("HBOX")
newRepo.endBox.NewButton("Configure", func() { newRepo.endBox.NewButton("Configure", func() {
@ -171,6 +175,8 @@ func (r *RepoList) addRepo(grid *gui.Node, path string, master string, devel str
newRepo.Status.Build() newRepo.Status.Build()
}) })
} }
newRepo.develVersion = r.blind.NewLabel("").SetProgName("develVersion")
newRepo.userVersion = r.blind.NewLabel("").SetProgName("userVersion")
default: default:
} }
grid.NextRow() grid.NextRow()

View File

@ -2,6 +2,7 @@ package repolist
import ( import (
"go.wit.com/lib/gui/repostatus" "go.wit.com/lib/gui/repostatus"
"go.wit.com/log"
) )
func (r *RepoList) Hidden() bool { func (r *RepoList) Hidden() bool {
@ -88,11 +89,27 @@ func (r *Repo) LastTag() string {
// because this are changing too often at this point // because this are changing too often at this point
// TODO: revisit this in 2025 or 2026 // TODO: revisit this in 2025 or 2026
func (r *Repo) GoState() string { func (r *Repo) GoState() string {
return r.Status.GetGoSumStatus() if r == nil {
log.Info("GoState() r == nil")
return "goState == nil"
}
if r.goState == nil {
log.Info("GoState() r.goState == nil")
return "goState == nil"
}
return r.goState.String()
} }
func (r *Repo) SetGoState(s string) { func (r *Repo) SetGoState(s string) {
r.Status.SetGoSumStatus(s) if r == nil {
log.Info("SetGoState() r == nil")
return
}
if r.goState == nil {
log.Info("goState == nil")
return
}
r.goState.SetText(s)
} }
func (r *Repo) IsPerfect() bool { func (r *Repo) IsPerfect() bool {

View File

@ -67,6 +67,8 @@ func (r *Repo) NewScan() bool {
log.Info(r.Status.Path(), line) log.Info(r.Status.Path(), line)
} }
} }
r.targetV.SetText(r.Status.GetTargetVersion())
status := r.Status.GetStatus() status := r.Status.GetStatus()
r.dirtyLabel.SetLabel(status) r.dirtyLabel.SetLabel(status)
if status == "PERFECT" { if status == "PERFECT" {

View File

@ -41,10 +41,11 @@ type Repo struct {
pLabel *gui.Node // path label pLabel *gui.Node // path label
targetV *gui.Node // the target version
lastTag *gui.Node // last tagged version label lastTag *gui.Node // last tagged version label
vLabel *gui.Node // version label vLabel *gui.Node // version label
dirtyLabel *gui.Node // git state (dirty or not?) dirtyLabel *gui.Node // git state (dirty or not?)
goSumStatus *gui.Node // what is the state of the go.sum file goState *gui.Node // what is the state of the go.sum file
masterVersion *gui.Node // the master branch version masterVersion *gui.Node // the master branch version
develVersion *gui.Node // the devel branch version develVersion *gui.Node // the devel branch version

View File

@ -19,6 +19,7 @@ func GuireleaserView(parent *gui.Node) *RepoList {
me.reposgrid = me.reposgroup.NewGrid("test", 0, 0) me.reposgrid = me.reposgroup.NewGrid("test", 0, 0)
me.reposgrid.NewLabel("") // path goes here me.reposgrid.NewLabel("") // path goes here
me.reposgrid.NewLabel("target")
me.reposgrid.NewLabel("last tag").SetProgName("last tag") me.reposgrid.NewLabel("last tag").SetProgName("last tag")
me.reposgrid.NewLabel("master version") me.reposgrid.NewLabel("master version")
me.reposgrid.NewLabel("Status") me.reposgrid.NewLabel("Status")