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.statusButton.Hide()
// r.diffButton.Hide()
r.goSumStatus.Hide()
r.goState.Hide()
r.targetV.Hide()
r.hidden = true
}
@ -42,7 +43,8 @@ func (r *Repo) Show() {
r.endBox.Show()
// r.statusButton.Show()
// r.diffButton.Show()
r.goSumStatus.Show()
r.goState.Show()
r.targetV.Show()
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.lastTag = grid.NewLabel("").SetProgName("lastTag")
newRepo.masterVersion = grid.NewLabel("").SetProgName("masterVersion")
newRepo.hidden = false
switch r.viewName {
case "autotypist":
newRepo.lastTag = grid.NewLabel("").SetProgName("lastTag")
newRepo.masterVersion = grid.NewLabel("").SetProgName("masterVersion")
newRepo.develVersion = grid.NewLabel("").SetProgName("develVersion")
newRepo.userVersion = grid.NewLabel("").SetProgName("userVersion")
newRepo.targetV = r.blind.NewLabel("")
newRepo.dirtyLabel = grid.NewLabel("")
newRepo.vLabel = grid.NewLabel("").SetProgName("current")
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.goSumStatus = r.blind.NewLabel("in the blind")
newRepo.goState = r.blind.NewLabel("in the blind")
case "guireleaser":
newRepo.develVersion = r.blind.NewLabel("").SetProgName("develVersion")
newRepo.userVersion = r.blind.NewLabel("").SetProgName("userVersion")
newRepo.targetV = grid.NewLabel("")
newRepo.lastTag = grid.NewLabel("").SetProgName("lastTag")
newRepo.masterVersion = grid.NewLabel("").SetProgName("masterVersion")
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.endBox = grid.NewHorizontalBox("HBOX")
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.develVersion = r.blind.NewLabel("").SetProgName("develVersion")
newRepo.userVersion = r.blind.NewLabel("").SetProgName("userVersion")
default:
}
grid.NextRow()

View File

@ -2,6 +2,7 @@ package repolist
import (
"go.wit.com/lib/gui/repostatus"
"go.wit.com/log"
)
func (r *RepoList) Hidden() bool {
@ -88,11 +89,27 @@ func (r *Repo) LastTag() string {
// because this are changing too often at this point
// TODO: revisit this in 2025 or 2026
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) {
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 {

View File

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

View File

@ -30,7 +30,7 @@ type RepoList struct {
reposgroup *gui.Node
// put things here that can't be seen
blind *gui.Node
blind *gui.Node
}
type Repo struct {
@ -41,10 +41,11 @@ type Repo struct {
pLabel *gui.Node // path label
lastTag *gui.Node // last tagged version label
vLabel *gui.Node // version label
dirtyLabel *gui.Node // git state (dirty or not?)
goSumStatus *gui.Node // what is the state of the go.sum file
targetV *gui.Node // the target version
lastTag *gui.Node // last tagged version label
vLabel *gui.Node // version label
dirtyLabel *gui.Node // git state (dirty or not?)
goState *gui.Node // what is the state of the go.sum file
masterVersion *gui.Node // the master 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.NewLabel("") // path goes here
me.reposgrid.NewLabel("target")
me.reposgrid.NewLabel("last tag").SetProgName("last tag")
me.reposgrid.NewLabel("master version")
me.reposgrid.NewLabel("Status")