forked from tangled.org/core
this repo has no description

appview: pull: show resubmit status to all users

any viewer should be able to tell if a PR is outdated.

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

Changed files
+4 -11
appview
pages
templates
repo
pulls
pulls
+2 -1
appview/pages/templates/repo/pulls/pull.html
···
{{ end }}
{{ define "resubmitStatus" }}
+
{{ $isAuthor := and .LoggedInUser (eq .LoggedInUser.Did .Pull.OwnerDid) }}
{{ if .ResubmitCheck.Yes }}
<div class="bg-amber-50 dark:bg-amber-900 border border-amber-500 rounded drop-shadow-sm px-6 py-2 relative w-fit">
<div class="flex items-center gap-2 text-amber-500 dark:text-amber-300">
{{ i "triangle-alert" "w-4 h-4" }}
-
<span class="font-medium">this branch has been updated, consider resubmitting</span>
+
<span class="font-medium">this branch has been updated<span class="{{if not $isAuthor}}hidden{{end}}">, consider resubmitting<span></span>
</div>
</div>
{{ end }}
+2 -10
appview/pulls/pulls.go
···
}
mergeCheckResponse := s.mergeCheck(f, pull, stack)
-
resubmitResult := pages.Unknown
-
if user.Did == pull.OwnerDid {
-
resubmitResult = s.resubmitCheck(f, pull, stack)
-
}
+
resubmitResult := s.resubmitCheck(f, pull, stack)
s.pages.PullActionsFragment(w, pages.PullActionsParams{
LoggedInUser: user,
···
}
mergeCheckResponse := s.mergeCheck(f, pull, stack)
-
resubmitResult := pages.Unknown
-
if user != nil && user.Did == pull.OwnerDid {
-
resubmitResult = s.resubmitCheck(f, pull, stack)
-
}
+
resubmitResult := s.resubmitCheck(f, pull, stack)
s.pages.RepoSinglePull(w, pages.RepoSinglePullParams{
LoggedInUser: user,
···
top := stack[0]
latestSourceRev = top.Submissions[top.LastRoundNumber()].SourceRev
}
-
-
log.Println(latestSourceRev, result.Branch.Hash)
if latestSourceRev != result.Branch.Hash {
return pages.ShouldResubmit