Skip to content
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

Add link to home page on swagger ui #12601

Merged
merged 9 commits into from
Aug 26, 2020

Conversation

a1012112796
Copy link
Member

@a1012112796 a1012112796 commented Aug 25, 2020

As title. I think it's useful. After view api documentation, maybe you will want to return to the home page.

example view:
image

Signed-off-by: a1012112796 <1012112796@qq.com>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 25, 2020
@lunny
Copy link
Member

lunny commented Aug 25, 2020

You could go back via webbrowser's button.

@a1012112796

This comment has been minimized.

@codecov-commenter
Copy link

codecov-commenter commented Aug 25, 2020

Codecov Report

Merging #12601 into master will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #12601      +/-   ##
==========================================
- Coverage   43.43%   43.41%   -0.03%     
==========================================
  Files         645      645              
  Lines       71288    71288              
==========================================
- Hits        30967    30948      -19     
- Misses      35309    35321      +12     
- Partials     5012     5019       +7     
Impacted Files Coverage Δ
services/pull/update.go 51.92% <0.00%> (-5.77%) ⬇️
modules/git/utils.go 73.77% <0.00%> (-3.28%) ⬇️
services/pull/temp_repo.go 26.59% <0.00%> (-3.20%) ⬇️
modules/process/manager.go 72.50% <0.00%> (-2.50%) ⬇️
services/pull/check.go 47.69% <0.00%> (-2.31%) ⬇️
services/pull/pull.go 41.57% <0.00%> (-0.70%) ⬇️
models/error.go 34.81% <0.00%> (-0.52%) ⬇️
modules/git/repo.go 49.23% <0.00%> (-0.51%) ⬇️
models/issue_comment.go 53.75% <0.00%> (-0.16%) ⬇️
modules/log/event.go 58.49% <0.00%> (+0.94%) ⬆️

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 69b3dd6...e304d49. Read the comment docs.

@GiteaBot GiteaBot 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 Aug 25, 2020
@jolheiser jolheiser added this to the 1.13.0 milestone Aug 25, 2020
@GiteaBot GiteaBot 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 Aug 25, 2020
@jolheiser jolheiser added topic/ui Change the appearance of the Gitea UI lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. labels Aug 25, 2020
Copy link
Member

@silverwind silverwind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you put that link in the top-right of the page. I think it should not disrupt the page layout like that. Something like:

.swagger-back-link {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

@silverwind
Copy link
Member

Please cherry-pick silverwind@7f9d52e.

image

@a1012112796
Copy link
Member Author

@silverwind Looks good to me, Thanks
@mrsdizzie @jolheiser Please review again, Thanks.

Copy link
Member

@silverwind silverwind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think we can window.history.back() to return the user to the page they came frome instead of /, will provide you another patch for that.

@a1012112796
Copy link
Member Author

Actually I think we can window.history.back() to return the user to the page they came frome instead of /, will provide you another patch for that.

Maybe it's not a good idea because of the anchor link.
tmp

@silverwind
Copy link
Member

silverwind commented Aug 26, 2020

Hmm it's not impossible but not a simple implementation either. We can't be certain that a browser sends a referrer header (some don't in private mode) so we'd need to enumerate the browser history entries and find the first one that matches the origin but not the swagger page. Probably too much work and could be prone to break so this is LGTM.

@techknowlogick
Copy link
Member

🚀

@techknowlogick techknowlogick merged commit 65444c5 into go-gitea:master Aug 26, 2020
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants