Monorepo for Tangled tangled.org

appview: allows a default knot to be configured #858

closed opened by willdot.net targeting master from [deleted fork]: master

This follows on from the work carried out in #836

I've added a select box in the Knots settings page which pulls in the users knots and also adds in knot1.tangled.sh. When the user selects one of these options, it will save to their profile in the database. NOTE: I haven't yet implemented adding that to the AT record because I'm not sure on how the lexicon setup works yet!

Then when users go to create a new repo / fork, if there is a value in their profile for the default knot, then that will pre select the knot to use for the new repo / fork.

Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:dadhhalkfcq3gucaq25hjqon/sh.tangled.repo.pull/3m7glmp44b322
+12 -26
Interdiff #1 โ†’ #2
appview/db/db.go

This file has not been changed.

appview/db/profile.go

This file has not been changed.

appview/knots/knots.go

This file has not been changed.

appview/models/profile.go

This file has not been changed.

appview/pages/pages.go

This file has not been changed.

appview/pages/templates/knots/index.html

This file has not been changed.

appview/pages/templates/repo/fork.html

This file has not been changed.

appview/pages/templates/repo/new.html

This file has not been changed.

appview/repo/repo.go

This file has not been changed.

+4
appview/state/profile.go
··· 626 626 log.Printf("getting profile data for %s: %s", user.Did, err) 627 627 } 628 628 629 + if profile == nil { 630 + return 631 + } 632 + 629 633 profile.DefaultKnot = r.Form.Get("default-knot") 630 634 631 635 tx, err := s.db.BeginTx(r.Context(), nil)
appview/state/router.go

This file has not been changed.

appview/state/state.go

This file has not been changed.

+1 -1
appview/pages/templates/repo/index.html
··· 47 47 <div class="px-4 py-2 border-b border-gray-200 dark:border-gray-600 flex items-center gap-4 flex-wrap"> 48 48 {{ range $value := .Languages }} 49 49 <div 50 - class="flex items-center gap-2 text-xs align-items-center justify-center" 50 + class="flex flex-grow items-center gap-2 text-xs align-items-center justify-center" 51 51 > 52 52 {{ template "repo/fragments/colorBall" (dict "color" (langColor $value.Name)) }} 53 53 <div>{{ or $value.Name "Other" }}
+1 -3
appview/pages/templates/user/followers.html
··· 19 19 "FollowersCount" .FollowersCount 20 20 "FollowingCount" .FollowingCount) }} 21 21 {{ else }} 22 - <div class="text-base text-gray-500 flex items-center justify-center italic p-12 border border-gray-200 dark:border-gray-700 rounded"> 23 - <span>This user does not have any followers yet.</span> 24 - </div> 22 + <p class="px-6 dark:text-white">This user does not have any followers yet.</p> 25 23 {{ end }} 26 24 </div> 27 25 {{ end }}
+1 -3
appview/pages/templates/user/following.html
··· 19 19 "FollowersCount" .FollowersCount 20 20 "FollowingCount" .FollowingCount) }} 21 21 {{ else }} 22 - <div class="text-base text-gray-500 flex items-center justify-center italic p-12 border border-gray-200 dark:border-gray-700 rounded"> 23 - <span>This user does not follow anyone yet.</span> 24 - </div> 22 + <p class="px-6 dark:text-white">This user does not follow anyone yet.</p> 25 23 {{ end }} 26 24 </div> 27 25 {{ end }}
+2 -10
appview/pages/templates/user/overview.html
··· 16 16 <p class="text-sm font-bold px-2 pb-4 dark:text-white">ACTIVITY</p> 17 17 <div class="flex flex-col gap-4 relative"> 18 18 {{ if .ProfileTimeline.IsEmpty }} 19 - <div class="text-base text-gray-500 flex items-center justify-center italic p-12 border border-gray-200 dark:border-gray-700 rounded"> 20 - <span class="flex items-center gap-2"> 21 - This user does not have any activity yet. 22 - </span> 23 - </div> 19 + <p class="dark:text-white">This user does not have any activity yet.</p> 24 20 {{ end }} 25 21 26 22 {{ with .ProfileTimeline }} ··· 258 254 {{ template "user/fragments/repoCard" (list $ . false) }} 259 255 </div> 260 256 {{ else }} 261 - <div class="text-base text-gray-500 flex items-center justify-center italic p-12 border border-gray-200 dark:border-gray-700 rounded"> 262 - <span class="flex items-center gap-2"> 263 - This user does not have any pinned repos. 264 - </span> 265 - </div> 257 + <p class="dark:text-white">This user does not have any pinned repos.</p> 266 258 {{ end }} 267 259 </div> 268 260 </div>
+1 -3
appview/pages/templates/user/repos.html
··· 13 13 {{ template "user/fragments/repoCard" (list $ . false) }} 14 14 </div> 15 15 {{ else }} 16 - <div class="text-base text-gray-500 flex items-center justify-center italic p-12 border border-gray-200 dark:border-gray-700 rounded"> 17 - <span>This user does not have any repos yet.</span> 18 - </div> 16 + <p class="px-6 dark:text-white">This user does not have any repos yet.</p> 19 17 {{ end }} 20 18 </div> 21 19 {{ end }}
+1 -3
appview/pages/templates/user/starred.html
··· 13 13 {{ template "user/fragments/repoCard" (list $ . true) }} 14 14 </div> 15 15 {{ else }} 16 - <div class="text-base text-gray-500 flex items-center justify-center italic p-12 border border-gray-200 dark:border-gray-700 rounded"> 17 - <span>This user does not have any starred repos yet.</span> 18 - </div> 16 + <p class="px-6 dark:text-white">This user does not have any starred repos yet.</p> 19 17 {{ end }} 20 18 </div> 21 19 {{ end }}
+1 -3
appview/pages/templates/user/strings.html
··· 13 13 {{ template "singleString" (list $ .) }} 14 14 </div> 15 15 {{ else }} 16 - <div class="text-base text-gray-500 flex items-center justify-center italic p-12 border border-gray-200 dark:border-gray-700 rounded"> 17 - <span>This user does not have any strings yet.</span> 18 - </div> 16 + <p class="px-6 dark:text-white">This user does not have any strings yet.</p> 19 17 {{ end }} 20 18 </div> 21 19 {{ end }}

History

4 rounds 8 comments
sign up or login to add to the discussion
1 commit
expand
ead0762e
appview: allows a default knot to be configured
expand 2 comments

I've fucked up @oppi.li

I had to delete my fork last week because I messed it up badly ๐Ÿ™ˆ And now I can't fix the merge conflicts.

Is there an easy way to rectify changing this PR to my new fork or should I just cut my losses and start the PR from scratch (fixing the merge conflicts by doing so)

im afraid there is no way to do that right now, probably best to open a new PR!

closed without merging
3 commits
expand
fe49521e
appview: allows a default knot to be configured
48ed4260
undo flake.lock change
3eae6087
appview: nil check when getting profile
expand 6 comments

valuable addition!

this strikes me more as a preference, i don't think this should go into the profile record however.

Do you mean the AT record or the database record?

Iโ€™m now doubting storing it in AT record because the default knot1.tangled.sh is only available in the tangled app view, not a 3rd party app view!

thanks for the work on this. comments:

  • can we squash all of this work into just one commit?
  • the PR also touches a few other template files, are these changes relevant to this addition? could we extract that to a different PR/commit?

will give this a quick test!

Oh Iโ€™m not sure why those files have changed. Iโ€™ll revert them. Probably my IDE autoformat.

Ok squashed the commits into a single commit, which also removed the random files that had been changed from the diff ๐Ÿคฃ

2 commits
expand
fe49521e
appview: allows a default knot to be configured
48ed4260
undo flake.lock change
expand 0 comments
1 commit
expand
fe49521e
appview: allows a default knot to be configured
expand 0 comments