Monorepo for Tangled tangled.org
856
fork

Configure Feed

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

appview/repo: fix treeview permalinks to use repoDIDs

only blobs used repoDIDs, this patches the permalinkShortcut template to
make this work on tree views as well.

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

+10 -1
+8
appview/pages/repoinfo/repoinfo.go
··· 23 23 return path.Join(r.owner(), r.Name) 24 24 } 25 25 26 + func (r RepoInfo) RepoIdentifier() string { 27 + if r.RepoDid != "" { 28 + return r.RepoDid 29 + } 30 + return path.Join(r.OwnerDid, r.Name) 31 + } 32 + 26 33 func (r RepoInfo) ownerWithoutAt() string { 27 34 if r.OwnerHandle != "" { 28 35 return r.OwnerHandle ··· 59 66 Rkey string 60 67 OwnerDid string 61 68 OwnerHandle string 69 + RepoDid string 62 70 Description string 63 71 Website string 64 72 Topics []string
+1 -1
appview/pages/templates/repo/fragments/permalinkShortcut.html
··· 7 7 document.addEventListener('keydown', (e) => { 8 8 if(e.key === 'y' && !e.ctrlKey && !e.metaKey && !e.altKey) { 9 9 if(e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') return; 10 - const permalinkUrl = '/{{ .RepoInfo.FullName }}/tree/{{ .LastCommitInfo.Hash }}/{{ .Path }}'; 10 + const permalinkUrl = '/{{ .RepoInfo.RepoIdentifier }}/tree/{{ .LastCommitInfo.Hash }}/{{ .Path }}'; 11 11 window.location.href = permalinkUrl; 12 12 } 13 13 }, {signal: abortController.signal});
+1
appview/reporesolver/resolver.go
··· 127 127 // this is basically a models.Repo 128 128 OwnerDid: ownerId.DID.String(), 129 129 OwnerHandle: ownerHandle, 130 + RepoDid: repo.RepoDid, 130 131 Name: repo.Name, 131 132 Rkey: repo.Rkey, 132 133 Description: repo.Description,