-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Add Hide/Show all checks
button to commit status check
#26284
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
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
7f433d2
improve
yp05327 b56220e
fix lint
yp05327 5303f8f
improve
yp05327 bd2214f
improve
yp05327 97e60b3
improve
yp05327 4a189a5
improve tiddy commit status
yp05327 5efcc51
Merge branch 'main' into improve-commit-status-ui
yp05327 a2cf202
convert to ctx.Locale.Tr
yp05327 711c2f8
Update web_src/js/features/repo-issue-pr-status.js
yp05327 aead5a5
Update templates/repo/commit_statuses.tmpl
yp05327 339dad1
Update templates/repo/issue/view_content/pull.tmpl
yp05327 6c38900
Merge branch 'main' into improve-commit-status-ui
yp05327 e8ddbc9
rename IsTippy into IsPopup
yp05327 fbcc124
Merge branch 'main' into improve-commit-status-ui
yp05327 2695093
Update web_src/css/repo.css
yp05327 9969800
Update web_src/css/repo.css
yp05327 08b7951
convert max-height to 231px
yp05327 fef5fc1
convert border-bottom 0 into none
yp05327 9e4dfa5
remove jQuery
yp05327 bef80d4
Update templates/repo/pulls/status.tmpl
yp05327 08f9ccd
improve
yp05327 3b3f767
improve
yp05327 f538d0e
Merge branch 'main' into improve-commit-status-ui
silverwind 4a92356
various styling improvments
silverwind 228eb7b
set menu theme
silverwind 483bab0
use data-toggled attribute and improve transition
silverwind 57cbaf7
make popup fit exactly 5 items
silverwind e873cb4
fit 4 items, add dedicated tippy theme
silverwind 4996b72
document new theme
silverwind 3719769
add comment and move rule
silverwind a91edb8
remove unused ShowHideButton variable
silverwind 94d328c
update comment
silverwind ac890d5
clean up tippy.js and remove unused form-fetch-error theme
silverwind b22407b
Add comment
silverwind f9893fc
remove unnecessary "root" parameters for "repo/commit_statuses"
wxiaoguang 0025ea9
better tippy width calc
wxiaoguang 95062f1
fix
wxiaoguang ee19a33
avoid scrollbar flicker when show/hide the checks
wxiaoguang 4e02ba0
fix lint
yp05327 6743030
Merge branch 'main' into improve-commit-status-ui
yp05327 a5f5953
fix
wxiaoguang 5b8a735
add background color to box-with-header theme
silverwind 222faec
update comment
silverwind 0bf56ed
Merge branch 'main' into improve-commit-status-ui
GiteaBot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,51 @@ | ||
{{if $.LatestCommitStatus}} | ||
{{if not $.Issue.PullRequest.HasMerged}} | ||
<div class="ui top attached header"> | ||
{{if eq .LatestCommitStatus.State "pending"}} | ||
{{ctx.Locale.Tr "repo.pulls.status_checking"}} | ||
{{else if eq .LatestCommitStatus.State "success"}} | ||
{{ctx.Locale.Tr "repo.pulls.status_checks_success"}} | ||
{{else if eq .LatestCommitStatus.State "warning"}} | ||
{{ctx.Locale.Tr "repo.pulls.status_checks_warning"}} | ||
{{else if eq .LatestCommitStatus.State "failure"}} | ||
{{ctx.Locale.Tr "repo.pulls.status_checks_failure"}} | ||
{{else if eq .LatestCommitStatus.State "error"}} | ||
{{ctx.Locale.Tr "repo.pulls.status_checks_error"}} | ||
{{else}} | ||
{{ctx.Locale.Tr "repo.pulls.status_checking"}} | ||
{{end}} | ||
</div> | ||
{{end}} | ||
{{/* | ||
Template Attributes: | ||
* CommitStatus: summary of all commit status state | ||
* CommitStatuses: all commit status elements | ||
* ShowHideChecks: whether use a button to show/hide the checks | ||
* is_context_required: Used in pull request commit status check table | ||
*/}} | ||
|
||
{{if .CommitStatus}} | ||
<div class="commit-status-panel"> | ||
<div class="ui top attached header commit-status-header"> | ||
{{if eq .CommitStatus.State "pending"}} | ||
{{ctx.Locale.Tr "repo.pulls.status_checking"}} | ||
{{else if eq .CommitStatus.State "success"}} | ||
{{ctx.Locale.Tr "repo.pulls.status_checks_success"}} | ||
{{else if eq .CommitStatus.State "warning"}} | ||
{{ctx.Locale.Tr "repo.pulls.status_checks_warning"}} | ||
{{else if eq .CommitStatus.State "failure"}} | ||
{{ctx.Locale.Tr "repo.pulls.status_checks_failure"}} | ||
{{else if eq .CommitStatus.State "error"}} | ||
{{ctx.Locale.Tr "repo.pulls.status_checks_error"}} | ||
{{else}} | ||
{{ctx.Locale.Tr "repo.pulls.status_checking"}} | ||
{{end}} | ||
|
||
{{range $.LatestCommitStatuses}} | ||
<div class="ui attached segment pr-status"> | ||
{{template "repo/commit_status" .}} | ||
<div class="status-context"> | ||
<span>{{.Context}} <span class="text grey">{{.Description}}</span></span> | ||
{{if .ShowHideChecks}} | ||
<div class="ui right"> | ||
<button class="commit-status-hide-checks btn interact-fg" | ||
data-show-all="{{ctx.Locale.Tr "repo.pulls.status_checks_show_all"}}" | ||
data-hide-all="{{ctx.Locale.Tr "repo.pulls.status_checks_hide_all"}}"> | ||
{{ctx.Locale.Tr "repo.pulls.status_checks_hide_all"}}</button> | ||
</div> | ||
{{end}} | ||
</div> | ||
|
||
<div class="commit-status-list"> | ||
{{range .CommitStatuses}} | ||
<div class="commit-status-item"> | ||
{{template "repo/commit_status" .}} | ||
<div class="status-context gt-ellipsis">{{.Context}} <span class="text light-2">{{.Description}}</span></div> | ||
<div class="ui status-details"> | ||
{{if $.is_context_required}} | ||
{{if (call $.is_context_required .Context)}}<div class="ui label">{{ctx.Locale.Tr "repo.pulls.status_checks_requested"}}</div>{{end}} | ||
{{end}} | ||
<span>{{if .TargetURL}}<a href="{{.TargetURL}}">{{ctx.Locale.Tr "repo.pulls.status_checks_details"}}</a>{{end}}</span> | ||
</div> | ||
</div> | ||
</div> | ||
{{end}} | ||
{{end}} | ||
</div> | ||
</div> | ||
{{end}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export function initRepoPullRequestCommitStatus() { | ||
wxiaoguang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
for (const btn of document.querySelectorAll('.commit-status-hide-checks')) { | ||
const panel = btn.closest('.commit-status-panel'); | ||
const list = panel.querySelector('.commit-status-list'); | ||
btn.addEventListener('click', () => { | ||
list.style.maxHeight = list.style.maxHeight ? '' : '0px'; // toggle | ||
list.style.overflow = 'hidden'; // hide scrollbar when hiding | ||
btn.textContent = btn.getAttribute(list.style.maxHeight ? 'data-show-all' : 'data-hide-all'); | ||
}); | ||
list.addEventListener('animationend', () => list.style.overflow = ''); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.