Monorepo for Tangled tangled.org

fix a few final bugs

Changed files
+22 -19
appview
pages
templates
fragments
state
+2 -2
appview/pages/templates/fragments/pullActions.html
··· 46 46 </button> 47 47 {{ end }} 48 48 49 - {{ if and $isPullAuthor $isPushAllowed $isOpen $isLastRound }} 49 + {{ if and (or $isPullAuthor $isPushAllowed) $isOpen $isLastRound }} 50 50 <button 51 51 hx-post="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/close" 52 52 hx-swap="none" ··· 56 56 </button> 57 57 {{ end }} 58 58 59 - {{ if and $isPullAuthor $isPushAllowed $isClosed $isLastRound }} 59 + {{ if and (or $isPullAuthor $isPushAllowed) $isClosed $isLastRound }} 60 60 <button 61 61 hx-post="/{{ .RepoInfo.FullName }}/pulls/{{ .Pull.PullId }}/reopen" 62 62 hx-swap="none"
+13 -10
appview/state/pull.go
··· 136 136 } 137 137 } 138 138 139 - resp, err := ksClient.MergeCheck([]byte(pull.LatestPatch()), pull.OwnerDid, f.RepoName, pull.TargetBranch) 139 + resp, err := ksClient.MergeCheck([]byte(pull.LatestPatch()), f.OwnerDid(), f.RepoName, pull.TargetBranch) 140 140 if err != nil { 141 141 log.Println("failed to check for mergeability:", err) 142 - switch resp.StatusCode { 143 - case 400: 144 - return types.MergeCheckResponse{ 145 - Error: "failed to check merge status: does this knot support PRs?", 146 - } 147 - default: 148 - return types.MergeCheckResponse{ 149 - Error: "failed to check merge status: this knot is unreachable", 150 - } 142 + return types.MergeCheckResponse{ 143 + Error: "failed to check merge status", 144 + } 145 + } 146 + switch resp.StatusCode { 147 + case 404: 148 + return types.MergeCheckResponse{ 149 + Error: "failed to check merge status: this knot does not support PRs", 150 + } 151 + case 400: 152 + return types.MergeCheckResponse{ 153 + Error: "failed to check merge status: does this knot support PRs?", 151 154 } 152 155 } 153 156
+7 -7
appview/state/signer.go
··· 166 166 Method = "POST" 167 167 ) 168 168 endpoint := fmt.Sprintf("/%s/%s/merge", ownerDid, targetRepo) 169 - 169 + 170 170 mr := types.MergeRequest{ 171 - Branch: branch, 171 + Branch: branch, 172 172 CommitMessage: commitMessage, 173 - CommitBody: commitBody, 174 - AuthorName: authorName, 175 - AuthorEmail: authorEmail, 176 - Patch: string(patch), 173 + CommitBody: commitBody, 174 + AuthorName: authorName, 175 + AuthorEmail: authorEmail, 176 + Patch: string(patch), 177 177 } 178 178 179 179 body, _ := json.Marshal(mr) ··· 192 192 ) 193 193 endpoint := fmt.Sprintf("/%s/%s/merge/check", ownerDid, targetRepo) 194 194 195 - body, _ := json.Marshal(map[string]interface{}{ 195 + body, _ := json.Marshal(map[string]any{ 196 196 "patch": string(patch), 197 197 "branch": branch, 198 198 })