-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Only show "You cannot fork a repository you own" when needed. #4130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4130 +/- ##
=======================================
Coverage 19.97% 19.97%
=======================================
Files 153 153
Lines 30494 30494
=======================================
Hits 6091 6091
Misses 23489 23489
Partials 914 914 Continue to review full report at Codecov.
|
LGTM |
@@ -32,7 +32,7 @@ | |||
</div> | |||
{{if .CanBeForked}} | |||
<div class="ui compact labeled button" tabindex="0"> | |||
<a class="ui compact button {{if not $.CanSignedUserFork}}poping up{{end}}" {{if $.CanSignedUserFork}}href="{{AppSubUrl}}/repo/fork/{{.ID}}"{{else}} data-content="{{$.i18n.Tr "repo.fork_from_self"}}" data-position="top center" data-variation="tiny"{{end}}> | |||
<a class="ui compact button {{if not $.CanSignedUserFork}}poping up{{end}}" {{if $.CanSignedUserFork}}href="{{AppSubUrl}}/repo/fork/{{.ID}}"{{else if $.IsSigned}} data-content="{{$.i18n.Tr "repo.fork_from_self"}}" data-position="top center" data-variation="tiny"{{end}}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be much more clearer if we check IsSigned in the same ifs as CanSignedUserFork?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[No code review text]
I'm not understand much but here is the view of a normal user:
It would be great if the behavior is identical to the neighboring buttons "Watch" and "Star".
When I press one of those two buttons I'm asked to sign in.
[/No code review text]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@daviian It doesn't work out(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@daviian I keep it in else if because logic I use is:
if user can fork & signed in: let them click link
if user can't for & signed in: show them message letting them know not able to fork
if user not signed in: show fork butt with number of forks, but don't let them click
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@flufmonster
if user not signed in: let them click and offer the same behavior like the neighboring buttons "Watch" and "Star".
This would create an uniform operation of all those three buttons at the right upper corner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oszilloskop sadly we don't know if when the user logs in they can fork, so if we send them to login then it might create a poor experience for them.
Fix #4126