Monorepo for Tangled tangled.org
776
fork

Configure Feed

Select the types of activity you want to include in your feed.

appview/pages: add vouch hats #14

open opened by oppi.li targeting master from op/uxqspoupnxkp
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:qfpnj4og54vl56wngdriaxug/sh.tangled.repo.pull/3mkavb2ffwi22
+40 -40
Interdiff #1 #2
+6 -6
appview/issues/issues.go
··· 127 127 return 128 128 } 129 129 130 - vouchRelationships := make(map[string]*models.VouchRelationship) 130 + vouchRelationships := make(map[syntax.DID]*models.VouchRelationship) 131 131 if user != nil { 132 132 participants := issue.Participants() 133 - vouchRelationships, err = db.GetVouchRelationshipsBatch(rp.db, user.Did, participants) 133 + vouchRelationships, err = db.GetVouchRelationshipsBatch(rp.db, syntax.DID(user.Did), participants) 134 134 if err != nil { 135 135 l.Error("failed to fetch vouch relationships", "err", err) 136 136 } ··· 991 991 } 992 992 } 993 993 994 - vouchRelationships := make(map[string]*models.VouchRelationship) 994 + vouchRelationships := make(map[syntax.DID]*models.VouchRelationship) 995 995 if user != nil { 996 - dids := make([]string, len(issues)) 996 + dids := make([]syntax.DID, len(issues)) 997 997 for i, u := range issues { 998 - dids[i] = u.Did 998 + dids[i] = syntax.DID(u.Did) 999 999 } 1000 - vouchRelationships, err = db.GetVouchRelationshipsBatch(rp.db, user.Did, dids) 1000 + vouchRelationships, err = db.GetVouchRelationshipsBatch(rp.db, syntax.DID(user.Did), dids) 1001 1001 if err != nil { 1002 1002 l.Error("failed to fetch vouch relationships", "err", err) 1003 1003 }
appview/models/vouch.go

This patch was likely rebased, as context lines do not match.

appview/pages/funcmap.go

This file has not been changed.

+4 -4
appview/pages/pages.go
··· 1150 1150 Page pagination.Page 1151 1151 FilterState string 1152 1152 FilterQuery string 1153 - VouchRelationships map[string]*models.VouchRelationship 1153 + VouchRelationships map[syntax.DID]*models.VouchRelationship 1154 1154 } 1155 1155 1156 1156 func (p *Pages) RepoIssues(w io.Writer, params RepoIssuesParams) error { ··· 1169 1169 1170 1170 Reactions map[models.ReactionKind]models.ReactionDisplayData 1171 1171 UserReacted map[models.ReactionKind]bool 1172 - VouchRelationships map[string]*models.VouchRelationship 1172 + VouchRelationships map[syntax.DID]*models.VouchRelationship 1173 1173 } 1174 1174 1175 1175 func (p *Pages) RepoSingleIssue(w io.Writer, params RepoSingleIssueParams) error { ··· 1288 1288 LabelDefs map[string]*models.LabelDefinition 1289 1289 Page pagination.Page 1290 1290 PullCount int 1291 - VouchRelationships map[string]*models.VouchRelationship 1291 + VouchRelationships map[syntax.DID]*models.VouchRelationship 1292 1292 } 1293 1293 1294 1294 func (p *Pages) RepoPulls(w io.Writer, params RepoPullsParams) error { ··· 1334 1334 UserReacted map[models.ReactionKind]bool 1335 1335 1336 1336 LabelDefs map[string]*models.LabelDefinition 1337 - VouchRelationships map[string]*models.VouchRelationship 1337 + VouchRelationships map[syntax.DID]*models.VouchRelationship 1338 1338 } 1339 1339 1340 1340 func (p *Pages) RepoSinglePull(w io.Writer, params RepoSinglePullParams) error {
appview/pages/templates/fragments/icons/shield-direct-denounce.html

This file has not been changed.

appview/pages/templates/fragments/icons/shield-direct-vouch.html

This file has not been changed.

appview/pages/templates/fragments/icons/shield-empty.html

This file has not been changed.

appview/pages/templates/fragments/icons/shield-indirect-denounce.html

This file has not been changed.

appview/pages/templates/fragments/icons/shield-indirect-vouch.html

This file has not been changed.

appview/pages/templates/fragments/icons/shield-mixed.html

This file has not been changed.

appview/pages/templates/fragments/icons/shield-plain.html

This file has not been changed.

appview/pages/templates/repo/issues/fragments/commentList.html

This file has not been changed.

appview/pages/templates/repo/issues/fragments/issueListing.html

This file has not been changed.

appview/pages/templates/repo/issues/issue.html

This file has not been changed.

appview/pages/templates/repo/issues/issues.html

This file has not been changed.

appview/pages/templates/repo/pulls/fragments/pullHeader.html

This file has not been changed.

appview/pages/templates/repo/pulls/pull.html

This file has not been changed.

appview/pages/templates/repo/pulls/pulls.html

This file has not been changed.

appview/pages/templates/user/fragments/networkVouches.html

This file has not been changed.

appview/pages/templates/user/fragments/picLink.html

This file has not been changed.

appview/pages/templates/user/fragments/vouchButton.html

This file has not been changed.

appview/pages/templates/user/fragments/vouchPopover.html

This file has not been changed.

+12 -12
appview/pulls/pulls.go
··· 266 266 defs[l.AtUri().String()] = &l 267 267 } 268 268 269 - vouchRelationships := make(map[string]*models.VouchRelationship) 269 + vouchRelationships := make(map[syntax.DID]*models.VouchRelationship) 270 270 if user != nil { 271 271 participants := pull.Participants() 272 - vouchRelationships, err = db.GetVouchRelationshipsBatch(s.db, user.Did, participants) 272 + vouchRelationships, err = db.GetVouchRelationshipsBatch(s.db, syntax.DID(user.Did), participants) 273 273 if err != nil { 274 274 l.Error("failed to fetch vouch relationships", "err", err) 275 275 } ··· 792 792 filterState = state.String() 793 793 } 794 794 795 - vouchRelationships := make(map[string]*models.VouchRelationship) 795 + vouchRelationships := make(map[syntax.DID]*models.VouchRelationship) 796 796 if user != nil { 797 - dids := make([]string, len(pulls)) 797 + dids := make([]syntax.DID, len(pulls)) 798 798 for i, p := range pulls { 799 - dids[i] = p.OwnerDid 799 + dids[i] = syntax.DID(p.OwnerDid) 800 800 } 801 - vouchRelationships, err = db.GetVouchRelationshipsBatch(s.db, user.Did, dids) 801 + vouchRelationships, err = db.GetVouchRelationshipsBatch(s.db, syntax.DID(user.Did), dids) 802 802 if err != nil { 803 803 l.Error("failed to fetch vouch relationships", "err", err) 804 804 } 805 805 } 806 806 807 807 s.pages.RepoPulls(w, pages.RepoPullsParams{ 808 - LoggedInUser: s.oauth.GetMultiAccountUser(r), 809 - RepoInfo: repoInfo, 810 - Pulls: pulls, 811 - LabelDefs: defs, 812 - FilterState: filterState, 813 - FilterQuery: query.String(), 808 + LoggedInUser: s.oauth.GetMultiAccountUser(r), 809 + RepoInfo: repoInfo, 810 + Pulls: pulls, 811 + LabelDefs: defs, 812 + FilterState: filterState, 813 + FilterQuery: query.String(), 814 814 Stacks: stacks, 815 815 Pipelines: m, 816 816 Page: page,
+4 -4
appview/state/profile.go
··· 102 102 if loggedInUser != nil { 103 103 followStatus = db.GetFollowStatus(s.db, loggedInUser.Did, did) 104 104 loggedInDid = loggedInUser.Did 105 - vouchRelationship, err = db.GetVouchRelationship(s.db, loggedInUser.Did, did) 105 + vouchRelationship, err = db.GetVouchRelationship(s.db, syntax.DID(loggedInUser.Did), syntax.DID(did)) 106 106 } 107 107 108 108 showPunchcard := s.shouldShowPunchcard(did, loggedInDid) ··· 423 423 } 424 424 425 425 if len(suggestions) > 0 { 426 - suggestionDids := make([]string, len(suggestions)) 426 + suggestionDids := make([]syntax.DID, len(suggestions)) 427 427 for i, s := range suggestions { 428 - suggestionDids[i] = s.Did 428 + suggestionDids[i] = syntax.DID(s.Did) 429 429 } 430 - relationships, err := db.GetVouchRelationshipsBatch(s.db, loggedInUser.Did, suggestionDids) 430 + relationships, err := db.GetVouchRelationshipsBatch(s.db, syntax.DID(loggedInUser.Did), suggestionDids) 431 431 if err != nil { 432 432 l.Error("failed to get vouch relationships for suggestions", "err", err) 433 433 } else {
input.css

This file has not been changed.

+6 -6
appview/models/issue.go
··· 135 135 return listing 136 136 } 137 137 138 - func (i *Issue) Participants() []string { 139 - participantSet := make(map[string]struct{}) 140 - participants := []string{} 138 + func (i *Issue) Participants() []syntax.DID { 139 + participantSet := make(map[syntax.DID]struct{}) 140 + participants := []syntax.DID{} 141 141 142 - addParticipant := func(did string) { 142 + addParticipant := func(did syntax.DID) { 143 143 if _, exists := participantSet[did]; !exists { 144 144 participantSet[did] = struct{}{} 145 145 participants = append(participants, did) 146 146 } 147 147 } 148 148 149 - addParticipant(i.Did) 149 + addParticipant(syntax.DID(i.Did)) 150 150 151 151 for _, c := range i.Comments { 152 - addParticipant(c.Did) 152 + addParticipant(syntax.DID(c.Did)) 153 153 } 154 154 155 155 return participants
+6 -6
appview/models/pull.go
··· 386 386 return false 387 387 } 388 388 389 - func (p *Pull) Participants() []string { 390 - participantSet := make(map[string]struct{}) 391 - participants := []string{} 389 + func (p *Pull) Participants() []syntax.DID { 390 + participantSet := make(map[syntax.DID]struct{}) 391 + participants := []syntax.DID{} 392 392 393 - addParticipant := func(did string) { 393 + addParticipant := func(did syntax.DID) { 394 394 if _, exists := participantSet[did]; !exists { 395 395 participantSet[did] = struct{}{} 396 396 participants = append(participants, did) 397 397 } 398 398 } 399 399 400 - addParticipant(p.OwnerDid) 400 + addParticipant(syntax.DID(p.OwnerDid)) 401 401 402 402 for _, s := range p.Submissions { 403 403 for _, sp := range s.Participants() { 404 - addParticipant(sp) 404 + addParticipant(syntax.DID(sp)) 405 405 } 406 406 } 407 407
+2 -2
appview/notify/db/db.go
··· 305 305 // - remove those already mentioned 306 306 recipients := sets.Singleton(syntax.DID(repo.Did)) 307 307 for _, p := range pull.Participants() { 308 - recipients.Insert(syntax.DID(p)) 308 + recipients.Insert(p) 309 309 } 310 310 for _, m := range mentions { 311 311 recipients.Remove(m) ··· 439 439 recipients.Insert(c.SubjectDid) 440 440 } 441 441 for _, p := range pull.Participants() { 442 - recipients.Insert(syntax.DID(p)) 442 + recipients.Insert(p) 443 443 } 444 444 445 445 entityType := "pull"

History

3 rounds 0 comments
sign up or login to add to the discussion
oppi.li submitted #2
1 commit
expand
appview/pages: add vouch hats
merge conflicts detected
expand
  • api/tangled/cbor_gen.go:9735
  • cmd/cborgen/cborgen.go:24
expand 0 comments
1 commit
expand
appview/pages: add vouch hats
expand 0 comments
oppi.li submitted #0
1 commit
expand
appview/pages: add vouch hats
expand 0 comments