summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Show empty repos in Admin Repository Management page (#23114) (#23130)Yarden Shoham2023-02-242-21/+23
| | | | | | | | | | | | | | | | | | | | | | Backport #23114 The **Admin Repository Management** page and the **Explore Repository** page both use the `RenderRepoSearch` function. In this function, the `OnlyShowRelevant` search option is `true` when querying repositories for admin page. https://github.com/go-gitea/gitea/blob/edf98a2dc30956c8e04b778bb7f1ce55c14ba963/routers/web/explore/repo.go#L99-L115 Refer to [#19361](https://github.com/go-gitea/gitea/pull/19361/files#diff-8058dfb85557010e0592d586675ec62ce406af7068e6311f39c160deac37f149R497), the repositories with `is_empty=true` will be hidden if `OnlyShowRelevant` is `true`. Administrators should be able to see all repositories. So `OnlyShowRelevant` shouldn't be set to `true` . Co-authored-by: Zettat123 <zettat123@gmail.com> Co-authored-by: Andrew Thornton <art27@cantab.net>
* Change style to improve whitespaces trimming inside inline markdown code ↵silverwind2023-02-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | (#23093) (#23120) Backport #23093 Given mardown source ``` x ` a` y x `a ` y x ` a ` y ``` Render <img width="1421" alt="2023-02-23 15 33 14" src="https://user-images.githubusercontent.com/17645053/220844280-a304c788-ac79-4a26-a55a-0db00f2fb3f3.png"> Fixes #23080. Co-authored-by: HesterG <hestergong@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix height for sticky head on large screen on PR page (#23111) (#23123)Yarden Shoham2023-02-241-10/+2
| | | | | | | | | | | | | | | | | | Backport #23111 Right now on the PR 'File Change' Tab, the file title header sticky to the top on large screens has wrong height, resulting in wrong ui behavior when scrolling down. This PR is to fix this. Before: <img width="964" alt="截屏2023-02-24 17 12 29" src="https://user-images.githubusercontent.com/17645053/221140409-025c4a84-6bbe-4b5b-a13f-bd2b79063522.png"> After: <img width="1430" alt="截屏2023-02-24 21 10 12" src="https://user-images.githubusercontent.com/17645053/221186750-0344d652-4610-4a90-a4c0-7f6269f950d6.png"> Co-authored-by: HesterG <hestergong@gmail.com>
* Fix db.Find bug (#23115) (#23119)Yarden Shoham2023-02-242-2/+50
| | | | | | | | Backport #23115 Caused by #20821 Fix #23110
* Fix nil context in RenderMarkdownToHtml (#23092) (#23108)Yarden Shoham2023-02-2413-23/+24
| | | | | | | | | | | Backport #23092 Fix #23082. This bug is caused by a nil context in https://github.com/go-gitea/gitea/issues/23082#issuecomment-1441276546 . Co-authored-by: Zettat123 <zettat123@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Make issue meta dropdown support Enter, confirm before reloading (#23014) ↵Yarden Shoham2023-02-245-20/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#23102) Backport #23014 As the title. Label/assignee share the same code. * Close #22607 * Close #20727 Also: * partially fix for #21742, now the comment reaction and menu work with keyboard. * partially fix for #17705, in most cases the comment won't be lost. * partially fix for #21539 * partially fix for #20347 * partially fix for #7329 ### The `Enter` support Before, if user presses Enter, the dropdown just disappears and nothing happens or the window reloads. After, Enter can be used to select/deselect labels, and press Esc to hide the dropdown to update the labels (still no way to cancel .... maybe you can do a Cmd+R or F5 to refresh the window to discard the changes .....) This is only a quick patch, the UX is still not perfect, but it's much better than before. ### The `confirm` before reloading And more fixes for the `reload` problem, the new behaviors: * If nothing changes (just show/hide the dropdown), then the page won't be reloaded. * If there are draft comments, show a confirm dialog before reloading, to avoid losing comments. That's the best effect can be done at the moment, unless completely refactor these dropdown related code. Screenshot of the confirm dialog: <details> ![image](https://user-images.githubusercontent.com/2114189/220538288-e2da8459-6a4e-43cb-8596-74057f8a03a2.png) </details> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Brecht Van Lommel <brecht@blender.org> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix SyncOnCommit always return false in API of push_mirrors (#23088) (#23100)Yarden Shoham2023-02-241-0/+1
| | | | | | | | | | | | | | | Backport #23088 Fix: #22990 --- Before, the return value of the api is always false,regrardless of whether the entry of `sync_on_commit` is true or false. I have confirmed that the value of `sync_on_commit` dropped into the database is correct. So, I think it is enough to make some small changes. Co-authored-by: sillyguodong <33891828+sillyguodong@users.noreply.github.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add wrapper to author to avoid long name ui problem (#23030) (#23098)Yarden Shoham2023-02-242-7/+18
| | | | | | | | | | | | | | | | | | | | Backport #23030 This PR is a possible solution for issue #22866. Main change is to add a `author-wrapper` class around author name, like the wrapper added to message. The `max-width` is set to 200px on PC, and 100px on mobile device for now. Which will work like below: <img width="1183" alt="2023-02-21 11 57 53" src="https://user-images.githubusercontent.com/17645053/220244146-3d47c512-33b6-4ed8-938e-de0a8bc26ffb.png"> <img width="417" alt="2023-02-21 11 58 43" src="https://user-images.githubusercontent.com/17645053/220244154-1ea0476b-9d1c-473a-9917-d3216860f9a9.png"> And `title` is added to the wrapper like it did in message wrapper. So the full author name will show on hover. Co-authored-by: HesterG <hestergong@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix commit name in Apply Patch page (#23086) (#23099)Yarden Shoham2023-02-242-1/+4
| | | | | | | | Backport #23086 Fixes https://github.com/go-gitea/gitea/issues/22621#issuecomment-1439309200 Co-authored-by: yp05327 <576951401@qq.com>
* Add accessibility to the menu on the navbar (#23059) (#23095)HesterG2023-02-231-2/+2
| | | | | | | | | | Backport #23059 This PR is trying to add accessibility to the menu as mentioned in #23053 so the menu can be accessed using keyboard (A quick demo is added below), with a reference to [PR2612](https://github.com/go-gitea/gitea/pull/22612). The goal is to make the menu accessible merely using keyboard like shown below. And this PR might need confirmation from developers using screen readers.
* Nest metadata in refactoring docs (#23087) (#23091)Yarden Shoham2023-02-231-5/+5
| | | | | | | | | Backport #23087 Whitespace was missing from refactoring docs metadata. backport label applied so it is included in versioned docs. Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Improve accessibility for issue comments (#22612) (#23083)Yarden Shoham2023-02-232-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport #22612 ### Preamble Gitea is an extremely great and smart solution perfectly suitable for smaller systems and self-hosted Git-powered setups. However, there is a group of people who have indredible difficulties in using Gitea, rendering it useless in many cases. Those people are blind developers using [screen readers](https://en.wikipedia.org/wiki/Screen_reader). Unfortunately, the frontend framework is super convoluted, and Go templates don’t allow accessibility improvements in a straightforward way. As a blind developer myself, I'm trying to start fixing smaller accessibility quirks with intention to go deeper and eventually, alone or not, make Gitea at least mostly accessible for screen reader users. ### What This Fix Does My blind fellows and me navigate webpages not very similarly to how a sighted person does it. For instance, we love semantic HTML markup like headings, lists, tables etc. because our screen readers allow us to jump by those landmarks with a single keypress. Currently in Gitea issue comments are not marked up with headings. I'm trying to fix this by adding an appropriate [ARIA](https://www.w3.org/WAI/standards-guidelines/aria/) role for comment header and also by enclosing the comment itself in a semantical article element. Co-authored-by: Andre Polykanine <ap@oire.me> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Wrap unless-check in docker manifests (#23079) (#23081)Yarden Shoham2023-02-232-2/+2
| | | | | | | | | | | | Backport #23079 Should fix the following: > failed to render template: Evaluation error: Helper 'unless' called with wrong number of arguments, needed 2 but got 3 https://go.dev/play/p/h7bt7MWKTcv Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Fix some more hidden problems (#23074) (#23075)wxiaoguang2023-02-223-6/+6
| | | Backport #23074
* Add sillyguodong to maintainers (#23067)v1.20.0-devv1.19.0-rc0sillyguodong2023-02-221-0/+1
| | | | [List of mine merged PR](https://github.com/go-gitea/gitea/pulls?q=is%3Apr+author%3Asillyguodong+is%3Amerged+)
* Improving CONTRIBUTING.md for backport details (#23057)wxiaoguang2023-02-221-3/+11
| | | | | | | See the changes. Two key points: * Necessary enhancements could be backported. * The backports shouldn't break downgrade between minor releases.
* Changelog 1.18.5 (#23045) (#23049)John Olheiser2023-02-212-1/+14
| | | | Frontport #23045
* Add Bash and Zsh completion scripts (#22646)zeripath2023-02-218-0/+103
| | | | | | | | | | | | | | | | | | | | | | | This PR adds contrib scripts for bash and zsh completion. Simply call: ```bash source contrib/autocompletion/bash_autocomplete ``` or for Zsh: ```bash source contrib/autocompletion/zsh_autocomplete ``` Signed-off-by: Andrew Thornton <art27@cantab.net> --------- Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: a1012112796 <1012112796@qq.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Return empty url for submodule tree entries (#23043)Zettat1232023-02-211-0/+5
| | | | | | | | | | | | Close #22614. Refer to [Github's API](https://docs.github.com/en/rest/git/trees?apiVersion=2022-11-28#get-a-tree), if a tree entry is a submodule, its url will be an empty string. --------- Co-authored-by: delvh <leon@kske.dev> Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Fix the show/hide methods for string selector (#23042)wxiaoguang2023-02-211-1/+5
| | | | | | At that moment I made a mistake (failed to detect a JS variable type correctly) Close #23040
* display attachments of review comment when comment content is blank (#23035)sillyguodong2023-02-211-1/+1
| | | | fix: #22647
* Upgrade to stylelint 15 (#22944)silverwind2023-02-218-139/+232
| | | | | | | | - Upgrade stylelint and plugin - Change ruleset to a explicit one, with all deprecated rules removed - Fix new issues detected by value validation For `overflow: overlay` see https://github.com/stylelint/stylelint/issues/6667
* Add force_merge to merge request and fix checking mergable (#23010)Jason Song2023-02-216-20/+59
| | | Fix #23000.
* Improve PR Review Box UI (#22986)wxiaoguang2023-02-219-52/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR follows: * #22950 ### Before The Review Box has many problems: * It doesn't work for small screens. * It has an anonying animation which makes the UI laggy. * It uses "custom dropdown menu" which is very difficult to fine tune. * `$().toggle('visible')` is not a correct call * jQuery just accepts any invalid `duration` argument: `$().toggle('anyting')` * The button is not a button. <details> ![image](https://user-images.githubusercontent.com/2114189/219948865-6da3f39c-6fde-4c86-9e42-da5020f3d0c3.png) </details> ### After These problems are fixed, and eliminate many `!important` games. <details> ![image](https://user-images.githubusercontent.com/2114189/219952744-8862fe1a-7ef1-49e4-bf92-2d0c1f104ee4.png) ![image](https://user-images.githubusercontent.com/2114189/219952771-be169a76-45fd-47a8-8f9c-b447d064f4ca.png) ![image](https://user-images.githubusercontent.com/2114189/219952784-3f52e9b7-64ce-4ad1-9553-64c33fb83042.png) </details> And most dropdown icons still looks good: <details> ![image](https://user-images.githubusercontent.com/2114189/219952942-52866a00-e0f9-4af7-8fb5-eb1a8cad1ff3.png) ![image](https://user-images.githubusercontent.com/2114189/219948909-b3bfb844-f84e-4b79-ab1f-382ec66dec31.png) </details> Co-authored-by: delvh <leon@kske.dev>
* Remove dashes between organization member avatars on hover (#23034)HesterG2023-02-211-0/+4
| | | | | | | | | | | | | | | | | | On the home page of an organization, there are unexpected dashes between the avatars of the members when hovering over the avatars, as shown in below: ![hover including title](https://user-images.githubusercontent.com/17645053/220271470-4f49e16f-87eb-4ffa-b38e-23feae1ff92d.png) ![hover without title](https://user-images.githubusercontent.com/17645053/220271512-e4a67685-6b72-4742-a34f-e01ed248c1de.png) This is because in `fomantic/build/semantic.css` there is a rule `text-decoration: underline;` when hovering over the `<a>` tag. Here, the `<a>` tag has width and height because of the avatar image inside, leading to the unexpected underlines. This PR overrides the `a:hover` rule so the underline does not exist anymore. Co-authored-by: delvh <leon@kske.dev>
* Fix the Manually Merged form (#23015)wxiaoguang2023-02-212-13/+11
| | | | | | | | | | | | | | | | | | | Regression bug of #19650 Close #20983 Close #21912 ### The "Manually Merged" form ![image](https://user-images.githubusercontent.com/2114189/220170503-32638994-b509-4251-8aa1-d8393dda7184.png) ### Mark a PR as Manually Merged and close it ![image](https://user-images.githubusercontent.com/2114189/220170537-25c91b2c-7a9a-44d1-9e6a-ebe3f1dfc26a.png) --------- Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Remove delete button for review comment (#23036)Zettat1232023-02-211-1/+1
| | | | | | | | | | | | | | | | | | | | Fix #23031. Currently, only comments with type `CommentTypeComment` or `CommentTypeCode` can be deleted. If user create a review comment, the type of the comment will be `CommentTypeReview` so the comment cannot be deleted. https://github.com/go-gitea/gitea/blob/e7be610d5773e69abbfb98d19e23112dfad6dfcc/routers/web/repo/issue.go#L2860-L2868 And in Github, user also cannot delete a review comment. There isn't a delete button in the menu. <img src="https://user-images.githubusercontent.com/15528715/220275166-5ae2dc10-4003-4857-b14e-d7b02644345f.png" width="640px" /> So we should remove the delete button from the menu when the comment's type is `CommentTypeReview`.
* Improve frontend guidelines (#23007)wxiaoguang2023-02-212-8/+43
| | | Some were out-dated, some are added.
* Use `--message=%s` for git commit message (#23028)wxiaoguang2023-02-213-6/+5
| | | | | | | | | | | | | | | | | | | Close #23027 `git commit` message option _only_ supports 4 formats (well, only ....): * `"commit", "-m", msg` * `"commit", "-m{msg}"` (no space) * `"commit", "--message", msg` * `"commit", "--message={msg}"` The long format with `=` is the best choice, and it's documented in `man git-commit`: `-m <msg>, --message=<msg> ...` ps: I would suggest always use long format option for git command, as much as possible. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* add margin top to the top of branches (#23002)HesterG2023-02-211-1/+1
| | | | | | | | add margin top as mentioned in #22973 --------- Co-authored-by: jidi <jidi@jidideMacBook-Pro.local> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add me to maintainers (#23026)yp053272023-02-211-0/+1
| | | | | | Add me to maintainers. [My PRs list](https://github.com/go-gitea/gitea/pulls?q=is%3Apr+author%3Ayp05327+is%3Amerged+)
* Render access log template as text instead of HTML (#23013)Lunny Xiao2023-02-211-1/+1
| | | Fix https://github.com/go-gitea/gitea/pull/22906#discussion_r1112106675
* Use `gt-relative` class instead of the ambiguous `gt-pr` class (#23008)wxiaoguang2023-02-202-2/+1
| | | | | | | | | | `.gt-relative` is also `position: relative !important;` There are `gt-pr-?` styles below (line 140) for `padding-right`, which makes `.gt-pr` ambiguous Co-authored-by: delvh <leon@kske.dev> Co-authored-by: John Olheiser <john.olheiser@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix intermittent panic in notify issue change content (#23019)zeripath2023-02-202-9/+12
| | | | | | | | Ensure that issue pullrequests are loaded before trying to set the self-reference. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: delvh <leon@kske.dev> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Improve pull_request_template.md (#22888)Jason Song2023-02-201-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update `pull_request_template.md` because: - It's a kind idea to hide the tips. However, it's easier to include them in the commit message by mistake when you cannot see them. Check `git log | grep 'Please check the following:'`. So don't hide it, expose it and help fix it. - "for backports" is much clearer than "for bug fixes". I saw someone post a PR to a release branch because they believed it was the right way for a bugfix. - "Allow edits by maintainers", or we have to ask the contributor to update the branch and they could be confused. - Remind the contributor that the words could be included in the commit message, to avoid some words like "Hello", "Sorry". If they really need them, they can separate them with a line, like: ```markdown Close #xxxx Because ... Then ... Finally ... --- Hello, this is my first time opening a pull request. Sorry for any mistakes. ``` And the merger should be careful, check and delete the extra content before merging. --------- Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Hide 2FA status from other members in organization members list (#22999)Brecht Van Lommel2023-02-201-0/+2
| | | | | This is rather private information that should not be given to all members in the same organization. Only show it to organization owners.
* handle deprecated settings (#22992)Lunny Xiao2023-02-207-42/+41
| | | Fix #22736
* Add scopes to API to create token and display them (#22989)zeripath2023-02-206-14/+68
| | | | | | | | The API to create tokens is missing the ability to set the required scopes for tokens, and to show them on the API and on the UI. This PR adds this functionality. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Remove unnecessary and incorrect `find('.menu').toggle()` (#22987)wxiaoguang2023-02-202-4/+0
| | | | | | | | | | Follows: * #22950 The dropdown menu works well without these codes. The reason is that the event bubbling still works for the dropdown menu, the Fomantic UI dropdown menu module will hide the menu correctly if an item is clicked.
* Improve issues.LoadProject (#22982)yp053272023-02-202-6/+2
| | | | | issues.LoadProject() is no use change `issues.loadProject(ctx)` to issues.LoadProject(ctx)
* Add 1.18.4 changelog (#22991) (#22995)Lunny Xiao2023-02-201-0/+37
| | | Frontport from #22991
* Fix pull request branch selector visible without clicking Edit (#23012)Brecht Van Lommel2023-02-211-1/+1
| | | Caused by #22950
* Bump golang.org/x/net from 0.4.0 to 0.7.0 (#22980)dependabot[bot]2023-02-202-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bumps [golang.org/x/net](https://github.com/golang/net) from 0.4.0 to 0.7.0. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/golang/net/commit/8e2b117aee74f6b86c207a808b0255de45c0a18a"><code>8e2b117</code></a> http2/hpack: avoid quadratic complexity in hpack decoding</li> <li><a href="https://github.com/golang/net/commit/547e7edf3873d6f3a9c093d3785f9e2289e00746"><code>547e7ed</code></a> http2: avoid referencing ResponseWrite.Write parameter after returning</li> <li><a href="https://github.com/golang/net/commit/39940adcaaa73e661124cb80fb8dd57ea929dbaf"><code>39940ad</code></a> html: parse comments per HTML spec</li> <li><a href="https://github.com/golang/net/commit/87ce33ecb484cbb6bcfc8e506ce0330ef72e0847"><code>87ce33e</code></a> go.mod: update golang.org/x dependencies</li> <li><a href="https://github.com/golang/net/commit/415cb6d518e71d202e2dc2f44c475cbff84eee72"><code>415cb6d</code></a> all: fix some comments</li> <li><a href="https://github.com/golang/net/commit/7e3c19ca52e202ae203b1914fc00c8e47a4d72fa"><code>7e3c19c</code></a> all: correct typos in comments</li> <li><a href="https://github.com/golang/net/commit/296f09aa3817abc1ddff7703799bf9babb7bbd16"><code>296f09a</code></a> http2: case insensitive handling for 100-continue</li> <li><a href="https://github.com/golang/net/commit/f8411da775a685be247bbedcb3ed2c998f895cd2"><code>f8411da</code></a> nettest: fix tests on dragonfly and js/wasm</li> <li><a href="https://github.com/golang/net/commit/8e0e7d8d38f2b6d21d742845570dde2902d06a1d"><code>8e0e7d8</code></a> go.mod: update golang.org/x dependencies</li> <li><a href="https://github.com/golang/net/commit/7805fdc37dc2b54b28b9d621030e14dcf1dab67c"><code>7805fdc</code></a> http2: rewrite inbound flow control tracking</li> <li>Additional commits viewable in <a href="https://github.com/golang/net/compare/v0.4.0...v0.7.0">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=golang.org/x/net&package-manager=go_modules&previous-version=0.4.0&new-version=0.7.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: delvh <leon@kske.dev> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix panic when call api (/repos/{owner}/{repo}/pulls/{index}/files) (#22921)sillyguodong2023-02-201-2/+4
| | | | | | | | | | | | | | | Close: #22910 --- I'm confused about that why does the api (`GET /repos/{owner}/{repo}/pulls/{index}/files`) require caller to pass the parameters `limit` and `page`. In my case, the caller only needs to pass a `skip-to` to paging. This is consistent with the api `GET /{owner}/{repo}/pulls/{index}/files` So, I deleted the code related to `listOptions` --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* only trigger docs build and publish when docs changed (#22968)Lunny Xiao2023-02-201-4/+21
| | | | | | | | | | | Since drone plugin https://github.com/meltwater/drone-convert-pathschanged/ enabled, we can filter event with path in drone. Building docs will now only be triggered when documentations changed. --------- Co-authored-by: Jason Song <i@wolfogre.com>
* Get rules by id when editing branch protection rule (#22932)Zettat1232023-02-203-4/+32
| | | | | | | | | | | | | | | | | | | | When users rename an existing branch protection rule, a new rule with the new name will be created and the old rule will still exist. ![image](https://user-images.githubusercontent.com/15528715/219276442-d3c001ad-e693-44ec-9ad2-b33f2666b49b.png) --- ![image](https://user-images.githubusercontent.com/15528715/219276478-547c3b93-b3f1-4292-a1ef-c1b7747fe1bb.png) The reason is that the `SettingsProtectedBranchPost` function only get branch protection rule by name before updating or creating a rule. When the rule name changes, the function cannot find the existing rule so it will create a new rule rather than update the existing rule. To fix the bug, the function should get rule by id first. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix hidden commit status on multiple checks (#22889)oliverpool2023-02-207-47/+92
| | | | | | | | | | | | | | Since #22632, when a commit status has multiple checks, no check is shown at all (hence no way to see the other checks). This PR fixes this by always adding a tag with the `.commit-statuses-trigger` to the DOM (the `.vm` is for vertical alignment). ![2023-02-13-120528](https://user-images.githubusercontent.com/3864879/218441846-1a79c169-2efd-46bb-9e75-d8b45d7cc8e3.png) --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add me to maintainers (#22998)Zettat1232023-02-201-0/+1
| | | | | | | | Add me to maintainers. [List of merged PRs](https://github.com/go-gitea/gitea/pulls?q=is%3Apr+author%3AZettat123+is%3Amerged) Co-authored-by: Jason Song <i@wolfogre.com>
* Add all units to the units permission list in org team members sidebar (#22971)yp053272023-02-201-1/+1
| | | | | | | | | | | | Add all units to the units permission list in org team members sidebar. Before: ![BQF448EIHEYKY62XGG(5101](https://user-images.githubusercontent.com/18380374/219877772-b57df8fb-2b82-4b1a-85c8-3809f8751cab.png) After: ![image](https://user-images.githubusercontent.com/18380374/219877762-f69482b8-abf9-4333-978e-6a3f52039a16.png) Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Make CI use a dummy password hasher for all tests (#22983)zeripath2023-02-2011-74/+160
| | | | | | | | | | | | | | | | During the recent hash algorithm change it became clear that the choice of password hash algorithm plays a role in the time taken for CI to run. Therefore as attempt to improve CI we should consider using a dummy hashing algorithm instead of a real hashing algorithm. This PR creates a dummy algorithm which is then set as the default hashing algorithm during tests that use the fixtures. This hopefully will cause a reduction in the time it takes for CI to run. --------- Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>