Monorepo for Tangled tangled.org

appview/models: rename Pull.PullAt() to Pull.AtUri()

in sync with Issue.AtUri.

Signed-off-by: oppiliappan <me@oppi.li>

oppi.li ee35579b 3d47ba6e

verified
Changed files
+15 -15
appview
db
models
notify
db
pages
templates
repo
pulls
pulls
+4 -4
appview/db/pulls.go
··· 92 92 _, err = tx.Exec(` 93 93 insert into pull_submissions (pull_at, round_number, patch, combined, source_rev) 94 94 values (?, ?, ?, ?, ?) 95 - `, pull.PullAt(), 0, pull.Submissions[0].Patch, pull.Submissions[0].Combined, pull.Submissions[0].SourceRev) 95 + `, pull.AtUri(), 0, pull.Submissions[0].Patch, pull.Submissions[0].Combined, pull.Submissions[0].SourceRev) 96 96 return err 97 97 } 98 98 ··· 101 101 if err != nil { 102 102 return "", err 103 103 } 104 - return pull.PullAt(), err 104 + return pull.AtUri(), err 105 105 } 106 106 107 107 func NextPullId(e Execer, repoAt syntax.ATURI) (int, error) { ··· 214 214 pull.ParentChangeId = parentChangeId.String 215 215 } 216 216 217 - pulls[pull.PullAt()] = &pull 217 + pulls[pull.AtUri()] = &pull 218 218 } 219 219 220 220 var pullAts []syntax.ATURI 221 221 for _, p := range pulls { 222 - pullAts = append(pullAts, p.PullAt()) 222 + pullAts = append(pullAts, p.AtUri()) 223 223 } 224 224 submissionsMap, err := GetPullSubmissions(e, FilterIn("pull_at", pullAts)) 225 225 if err != nil {
+1 -1
appview/models/pull.go
··· 167 167 return p.LatestSubmission().SourceRev 168 168 } 169 169 170 - func (p *Pull) PullAt() syntax.ATURI { 170 + func (p *Pull) AtUri() syntax.ATURI { 171 171 return syntax.ATURI(fmt.Sprintf("at://%s/%s/%s", p.OwnerDid, tangled.RepoPullNSID, p.Rkey)) 172 172 } 173 173
+3 -3
appview/notify/db/db.go
··· 203 203 actorDid := syntax.DID(pull.OwnerDid) 204 204 eventType := models.NotificationTypePullCreated 205 205 entityType := "pull" 206 - entityId := pull.PullAt().String() 206 + entityId := pull.AtUri().String() 207 207 repoId := &repo.Id 208 208 var issueId *int64 209 209 p := int64(pull.ID) ··· 249 249 actorDid := syntax.DID(comment.OwnerDid) 250 250 eventType := models.NotificationTypePullCommented 251 251 entityType := "pull" 252 - entityId := pull.PullAt().String() 252 + entityId := pull.AtUri().String() 253 253 repoId := &repo.Id 254 254 var issueId *int64 255 255 p := int64(pull.ID) ··· 353 353 } 354 354 355 355 entityType := "pull" 356 - entityId := pull.PullAt().String() 356 + entityId := pull.AtUri().String() 357 357 repoId := &repo.Id 358 358 var issueId *int64 359 359 var eventType models.NotificationType
+1 -1
appview/pages/templates/repo/pulls/fragments/pullHeader.html
··· 75 75 "Kind" $kind 76 76 "Count" $reactionData.Count 77 77 "IsReacted" (index $.UserReacted $kind) 78 - "ThreadAt" $.Pull.PullAt 78 + "ThreadAt" $.Pull.AtUri 79 79 "Users" $reactionData.Users) 80 80 }} 81 81 {{ end }}
+1 -1
appview/pages/templates/repo/pulls/pull.html
··· 18 18 {{ template "repo/fragments/labelPanel" 19 19 (dict "RepoInfo" $.RepoInfo 20 20 "Defs" $.LabelDefs 21 - "Subject" $.Pull.PullAt 21 + "Subject" $.Pull.AtUri 22 22 "State" $.Pull.Labels) }} 23 23 {{ template "repo/fragments/participants" $.Pull.Participants }} 24 24 </div>
+5 -5
appview/pulls/pulls.go
··· 192 192 m[p.Sha] = p 193 193 } 194 194 195 - reactionMap, err := db.GetReactionMap(s.db, 20, pull.PullAt()) 195 + reactionMap, err := db.GetReactionMap(s.db, 20, pull.AtUri()) 196 196 if err != nil { 197 197 log.Println("failed to get pull reactions") 198 198 s.pages.Notice(w, "pulls", "Failed to load pull. Try again later.") ··· 200 200 201 201 userReactions := map[models.ReactionKind]bool{} 202 202 if user != nil { 203 - userReactions = db.GetReactionStatusMap(s.db, user.Did, pull.PullAt()) 203 + userReactions = db.GetReactionStatusMap(s.db, user.Did, pull.AtUri()) 204 204 } 205 205 206 206 labelDefs, err := db.GetLabelDefinitions( ··· 752 752 Rkey: tid.TID(), 753 753 Record: &lexutil.LexiconTypeDecoder{ 754 754 Val: &tangled.RepoPullComment{ 755 - Pull: pull.PullAt().String(), 755 + Pull: pull.AtUri().String(), 756 756 Body: body, 757 757 CreatedAt: createdAt, 758 758 }, ··· 1839 1839 } 1840 1840 defer tx.Rollback() 1841 1841 1842 - pullAt := pull.PullAt() 1842 + pullAt := pull.AtUri() 1843 1843 newRoundNumber := len(pull.Submissions) 1844 1844 newPatch := patch 1845 1845 newSourceRev := sourceRev ··· 2036 2036 } 2037 2037 2038 2038 // resubmit the new pull 2039 - pullAt := op.PullAt() 2039 + pullAt := op.AtUri() 2040 2040 newRoundNumber := len(op.Submissions) 2041 2041 newPatch := np.LatestPatch() 2042 2042 combinedPatch := np.LatestSubmission().Combined