Skip to content

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

Merged
merged 5 commits into from Jun 9, 2018
Merged

Only show "You cannot fork a repository you own" when needed. #4130

merged 5 commits into from Jun 9, 2018

Conversation

ghost
Copy link

@ghost ghost commented Jun 5, 2018

Fix #4126

@codecov-io
Copy link

codecov-io commented Jun 5, 2018

Codecov Report

Merging #4130 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ef0bc57...ff02d50. Read the comment docs.

@bkcsoft bkcsoft added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 5, 2018
@lunny lunny added type/bug topic/ui Change the appearance of the Gitea UI labels Jun 5, 2018
@lunny
Copy link
Member

lunny commented Jun 5, 2018

LGTM

@bkcsoft bkcsoft added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jun 5, 2018
@bkcsoft bkcsoft added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 5, 2018
@@ -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}}>
Copy link
Member

@daviian daviian Jun 5, 2018

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?

Copy link

@oszilloskop oszilloskop Jun 5, 2018

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]

Copy link
Member

@axifive axifive Jun 6, 2018

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(

Copy link
Author

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

Copy link

@oszilloskop oszilloskop Jun 6, 2018

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.

Copy link
Author

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.

@lafriks lafriks added this to the 1.5.0 milestone Jun 7, 2018
@techknowlogick techknowlogick merged commit 9033eae into go-gitea:master Jun 9, 2018
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/ui Change the appearance of the Gitea UI type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants