Quellcode durchsuchen

Squashes a number of bugs relating to human -> path parsing

arianagiroux vor 2 Wochen
Ursprung
Commit
2dc70a312f

+ 1 - 1
issue.go

@@ -220,7 +220,7 @@ func (vf VariadicField) NewFromPath(pathOnDisk string) (v VariadicField, err err
 func (vf VariadicField) AsString() string {
 	var output string
 	for _, field := range vf.Fields {
-		output = output + strings.TrimRight(field.Path, " \t\n") + ", "
+		output = output + strings.TrimRight(parsePathToHuman(field.Path), " \t\n") + ", "
 	}
 
 	output = strings.TrimRight(output, ", ")

+ 0 - 0
issues/bug: create fails to machine parse title/description


+ 0 - 1
issues/bug: create fails to machine parse title/status

@@ -1 +0,0 @@
-open

+ 5 - 7
tui.go

@@ -408,7 +408,7 @@ func (e edit) createIssueObject() tea.Msg {
 			newIssue.Title = value
 			if parsePathToHuman(newIssue.Path) != value {
 				dir, _ := filepath.Split(newIssue.Path)
-				newIssue.Path = filepath.Join(dir, value)
+				newIssue.Path = filepath.Join(dir, parseHumanToPath(value))
 			}
 		case "status":
 			newIssue.Status = Field{Path: "/status", Data: value}
@@ -461,7 +461,7 @@ func (e edit) editBlankDescription(issue Issue) tea.Cmd {
 	}
 }
 
-// does this just call InvokeEditor?
+// Calls InvokeEditor with e.Path, reports output via ReadTemplate
 func (e edit) editExistingDescription(issue Issue) tea.Cmd {
 	err := InvokeEditor(filepath.Join(e.Path, "description"))
 	if err != nil {
@@ -556,13 +556,13 @@ func (i Issue) render() tea.Msg {
 	// variadics
 	var tags string
 	for _, field := range i.Tags.Fields {
-		tags = tags + field.Path + ", "
+		tags = tags + parsePathToHuman(field.Path) + ", "
 	}
 	tags = strings.TrimRight(tags, ", ")
 
 	var blockedby string
 	for _, field := range i.Blockedby.Fields {
-		blockedby = blockedby + field.Path + ", "
+		blockedby = blockedby + parsePathToHuman(field.Path) + ", "
 	}
 	blockedby = strings.TrimRight(blockedby, ", ")
 
@@ -642,8 +642,6 @@ func (ic IssueCollection) edit() tea.Msg { return newEditWidget(ic.Path) }
 // render cmd for IssueCollection widget
 func (ic IssueCollection) render() tea.Msg {
 	var output string
-	if ic.selection == -1 {
-	}
 	var left string
 	output = output + "Issues in " + ic.Path + "...\n\n"
 	for i, issue := range ic.Collection {
@@ -701,7 +699,7 @@ func (w createInCollection) update(msg tea.Msg) (widget, tea.Cmd) {
 }
 
 func (w createInCollection) create() tea.Msg {
-	w.Path = filepath.Join(w.Path, w.name)
+	w.Path = filepath.Join(w.Path, parseHumanToPath(w.name))
 	return newEditWidget(w.Path)
 }