summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix issue attachment handling (#24202)wxiaoguang2023-04-2012-154/+149
| | | | | | | | | | | | | | | | | | | | | | Close #24195 Some of the changes are taken from my another fix https://github.com/go-gitea/gitea/pull/20147/commits/f07b0de997125c9b79cc5af27966a7cdd1803a4d in #20147 (although that PR was discarded ....) The bug is: 1. The old code doesn't handle `removedfile` event correctly 2. The old code doesn't provide attachments for type=CommentTypeReview This PR doesn't intend to refactor the "upload" code to a perfect state (to avoid making the review difficult), so some legacy styles are kept. --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io>
* Update JS dependencies (#24218)silverwind2023-04-195-548/+659
| | | | | | - Update all js dependencies, update playwright image to jammy - Adjust eslint and vitest config - Tested build, monaco, mermaid, katex
* Remove most path-based golangci exclusions (#24214)silverwind2023-04-1912-80/+29
| | | | | They are non-obvious and do not survive refactor. Will replace with `//nolint` comments after CI results are in.
* [skip ci] Updated translations via CrowdinGiteaBot2023-04-201-0/+87
|
* Fix internal sever error when visiting a PR that bound to the deleted team ↵sillyguodong2023-04-192-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#24127) Close: #23738 The actual cause of `500 Internal Server Error` in the issue is not what is descirbed in the issue. The actual cause is that after deleting team, if there is a PR which has requested reivew from the deleted team, the comment could not match with the deleted team by `assgin_team_id`. So the value of `.AssigneeTeam` (see below code block) is `nil` which cause `500 error`. https://github.com/go-gitea/gitea/blob/1c8bc4081a4f4d0d921ac218cb724ce97924d410/templates/repo/issue/view_content/comments.tmpl#L691-L695 To fix this bug, there are the following problems to be resolved: - [x] 1. ~~Stroe the name of the team in `content` column when inserting `comment` into DB in case that we cannot get the name of team after it is deleted. But for comments that already exist, just display "Unknown Team"~~ Just display "Ghost Team" in the comment if the assgined team is deleted. - [x] 2. Delete the PR&team binding (the row of which `review_team_id = ${team_id} ` in table `review`) when deleting team. - [x] 3.For already exist and undeleted binding rows in in table `review`, ~~we can delete these rows when executing migrations.~~ they do not affect the function, so won't delete them.
* Add owner team permission check test (#24096)yp053272023-04-192-1/+25
| | | | | | | | | Add test for https://github.com/go-gitea/gitea/pull/23675 Should be merged after #24117 --------- Co-authored-by: silverwind <me@silverwind.io>
* Fix incorrect CORS default values (#24206)wxiaoguang2023-04-191-2/+3
| | | | | | | | | | Document: ``` ;ALLOW_DOMAIN = * ;METHODS = GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS ``` Co-authored-by: Giteabot <teabot@gitea.io>
* Add repository counter badge to repository tab (#24205)Jakob2023-04-192-3/+9
| | | | | | | | | Add a new badge to the repository tab for users and organizations. The badge is only visible if a repo exists. Change the badge color of existing "Starred Repositories". (from primary to small) Closes #24188
* Fix template error in pull request with deleted head repo (#24192)Brecht Van Lommel2023-04-191-1/+1
| | | | Rendering of Allow Edits from Maintainers did not check if the head repo exists, while other parts of the page handle it gracefully.
* Make wiki title supports dashes and improve wiki name related features (#24143)wxiaoguang2023-04-1913-256/+400
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Close #7570 1. Clearly define the wiki path behaviors, see `services/wiki/wiki_path.go` and tests 2. Keep compatibility with old contents 3. Allow to use dashes in titles, eg: "2000-01-02 Meeting record" 4. Add a "Pages" link in the dropdown, otherwise users can't go to the Pages page easily. 5. Add a "View original git file" link in the Pages list, even if some file names are broken, users still have a chance to edit or remove it, without cloning the wiki repo to local. 6. Fix 500 error when the name contains prefix spaces. This PR also introduces the ability to support sub-directories, but it can't be done at the moment due to there are a lot of legacy wiki data, which use "%2F" in file names. ![image](https://user-images.githubusercontent.com/2114189/232239004-3359d7b9-7bf3-4ff3-8446-bfb0e79645dd.png) ![image](https://user-images.githubusercontent.com/2114189/232239020-74b92c72-bf73-4377-a319-1c85609f82b1.png) Co-authored-by: Giteabot <teabot@gitea.io>
* Fix Resolve Conversation not working in Conversation view (#24191)Brecht Van Lommel2023-04-191-1/+1
| | | | | It only worked in the Files Changed view. Caused by #23639.
* Vertical widths of containers removed (#24184)Krzysztof Jeziorny2023-04-192-4/+2
| | | | | | | | A vertical overflow appears in Firefox 112/MacOS 12.6 when the system setting for scrollbars is to "Always" show them. --- Here, the fixed 100vw container widths are removed, which removes the overflow. It is, however, only simulated in Developer Tools in latest Firefox and Chromium, so please test on a Gitea installation.
* Don't list root repository on compare page if pulls not allowed (#24183)Lunny Xiao2023-04-191-1/+1
| | | Fix #24165
* Add unset default project column (#23531)yp053272023-04-197-25/+102
| | | | Close: https://github.com/go-gitea/gitea/issues/23401
* Allow adding new files to an empty repo (#24164)wxiaoguang2023-04-1931-138/+314
| | | ![image](https://user-images.githubusercontent.com/2114189/232561612-2bfcfd0a-fc04-47ba-965f-5d0bcea46c54.png)
* Add runner check in repo action page (#24124)yp053272023-04-193-13/+43
| | | | | | ![image](https://user-images.githubusercontent.com/18380374/232996647-13c2b9f1-c9e9-42d9-acbf-8a6e16b175a6.png) Maybe we can also add online runner check? e.g. : Target runner is offline.
* Use same action status svg icons on actions list as on action page (#24178)Hester Gong2023-04-193-19/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Close #24020 After: These icons are the same now: <img width="1287" alt="截屏2023-04-18 13 52 11" src="https://user-images.githubusercontent.com/17645053/232684252-05ddc101-dc5b-41b5-b374-132c3d853a41.png"> <img width="1141" alt="截屏2023-04-18 13 54 48" src="https://user-images.githubusercontent.com/17645053/232684261-6ebd864a-a9aa-4982-af32-2cea91c35be8.png"> In this PR, didn't use `ActionRunStatus.vue` because the mounting of the component will cause flash of the icons like below: https://user-images.githubusercontent.com/17645053/232682646-713202dc-9023-4b9c-a849-c3a1ae6dd155.mov Instead, modified and used `status.tmpl` to make it the same as `ActionRunStatus.vue` to avoid the ui flash (Welcomed to show how to use `ActionRunStatus.vue` without flashing if there is a way). Added comments to both of them for reminding synchronization of these two files. --------- Co-authored-by: Jason Song <i@wolfogre.com>
* [skip ci] Updated translations via CrowdinGiteaBot2023-04-1927-1706/+286
|
* fix calReleaseNumCommitsBehind (#24148)oliverpool2023-04-1853-21/+933
| | | | | | | | | | | | | | | | | | | | | | | | | | | | `repoCtx.CommitsCount` is not reliably the commit count of the default branch (Repository.GetCommitsCount depends on what is currently displayed). For instance on the releases page the commit count is correct: https://codeberg.org/Codeberg/pages-server/releases ![2023-04-15-215027](https://user-images.githubusercontent.com/3864879/232250500-6c05dc00-7030-4ec9-87f1-18c7797d36bf.png) However it is not on the single page: https://codeberg.org/Codeberg/pages-server/releases/tag/v4.6.2 ![2023-04-15-215036](https://user-images.githubusercontent.com/3864879/232250503-620c8038-7c2c-45a1-b99d-cb994ef955a6.png) This PR fixes this by removing a "fast branch" which was using this field (I think this field should be removed, since it is a bit unpredictable - but this would mean a larger refactoring PR). _contributed in the context of @forgejo_ --------- Co-authored-by: Giteabot <teabot@gitea.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Mark `public/img/svg/*.svg` as generated files (#24193)Yarden Shoham2023-04-181-0/+1
| | | These files are generated using `make svg`
* Make mention autocomplete case insensitive in new markdown editor (#24190)Brecht Van Lommel2023-04-181-2/+4
| | | | | | | | This matches EasyMDE, and makes it easier to find the right user without having to remember the exact name. --------- Co-authored-by: silverwind <me@silverwind.io>
* Fix duplicate modals when clicking on "remove all" repository button (#24129)Hester Gong2023-04-192-8/+8
| | | | | | | | | | | | | Under Team tab of an organization, click on "remove all" repositories button will trigger two modals. Because `data-modal-id` is not proerly added. Before: https://user-images.githubusercontent.com/17645053/231988545-ac690b86-e3fe-4bf5-81c6-5ef09302e849.mov After: https://user-images.githubusercontent.com/17645053/231989678-53be4f91-fdc9-4bc5-ba11-a08aa4548e37.mov
* Bump GitHub's `relative-time-element` to `v4.3.0` (#24187)Yarden Shoham2023-04-192-5/+5
| | | | | https://github.com/github/relative-time-element/releases/tag/v4.3.0 I checked and everything still works
* Fix wrong scopes of locale.PrettyNumber (#24181)Hester Gong2023-04-182-4/+4
|
* Fix incorrect internal response type (#24173)wxiaoguang2023-04-171-1/+2
| | | | | | Close #24167 The endpoint "set-default-branch" returns `success`, so just decode it as `responseText`
* zh-cn support on doc pages (#24166)Kroytz2023-04-182-2/+93
| | | | + Add zh-cn support for upgrade-from-gitea page + Fix typo error on https-support.zh-cn page
* [skip ci] Updated translations via CrowdinGiteaBot2023-04-181-6/+23
|
* Use double quotes consistently in en-US (#24141)Panagiotis "Ivory" Vasilopoulos2023-04-178-86/+86
| | | | Also removes quotes in commit messages related to file modifications made in the Web UI.
* Use correct locale key for forks page (#24172)John Olheiser2023-04-171-1/+1
| | | | | https://github.com/go-gitea/gitea/blob/4014200021a1997283c779a815fe9e5febf1fda1/options/locale/locale_en-US.ini#L873 https://github.com/go-gitea/gitea/blob/4014200021a1997283c779a815fe9e5febf1fda1/options/locale/locale_en-US.ini#L943
* Improve Wiki TOC (#24137)wxiaoguang2023-04-1712-117/+128
| | | | | | | | | | The old code has a lot of technical debts, eg: `repo/wiki/view.tmpl` / `Iterate` This PR improves the Wiki TOC display and improves the code. --------- Co-authored-by: delvh <dev.lh@web.de>
* Localize activity heatmap (except tooltip) (#24131)Yarden Shoham2023-04-177-12/+30
| | | | | | | | | | | | | | | The calculation of the total sum is moved to the backend so a full HTML string could be sent. ![image](https://user-images.githubusercontent.com/20454870/232112381-c11d896b-ba47-40f8-b2a3-71cf4b3208de.png) - Closes #10669 - 2nd attempt (the first was in #21570) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: Giteabot <teabot@gitea.io>
* Support triggering workflows by wiki related events (#24119)Zettat1232023-04-174-2/+47
| | | | | | This PR is to support triggering workflows by wiki related events like creating, editing or deleting wiki pages. In GitHub, this event is called [gollum](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#gollum)
* add CLI command to register runner tokens (#23762)techknowlogick2023-04-176-0/+201
| | | | | | | | | | This is a CLI command to generate new tokens for the runners to register with Fix https://github.com/go-gitea/gitea/issues/23643 --------- Co-authored-by: delvh <dev.lh@web.de>
* Add new user types `reserved`, `bot`, and `remote` (#24026)techknowlogick2023-04-172-1/+23
| | | | | | | | | | | | | | | | | | | | This allows for usernames, and emails connected to them to be reserved and not reused. Use case, I manage an instance with open registration, and sometimes when users are deleted for spam (or other purposes), their usernames are freed up and they sign up again with the same information. This could also be used to reserve usernames, and block them from being registered (in case an instance would like to block certain things without hardcoding the list in code and compiling from scratch). This is an MVP, that will allow for future work where you can set something as reserved via the interface. --------- Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Fix Org edit page bugs: renaming detection, maxlength (#24161)wxiaoguang2023-04-174-25/+17
| | | | | | | | | | | | | | | | | | | | | ## Before * The renaming detection is wrong (eg: pasting a new name into the input doesn't trigger the detection) * The renaming prompt layout is not good * Some MaxSize/maxlength rules is missing ![image](https://user-images.githubusercontent.com/2114189/232379191-5d0f6d10-56ca-4cec-ac52-7f77b9cb4a8a.png) ![image](https://user-images.githubusercontent.com/2114189/232379234-3289373b-9ddb-4627-ae86-f4d74589fa0c.png) ## After * Fix these problems ![image](https://user-images.githubusercontent.com/2114189/232379098-31c6fa21-c210-4e7f-a337-b38b99670835.png)
* Make HAS_GO a simply expanded variable (#24169)silverwind2023-04-171-2/+2
| | | | Avoid recursive expansion on this variable and simplify the value. [Reference](https://www.gnu.org/software/make/manual/html_node/Setting.html).
* Support converting varchar to nvarchar for mssql database (#24105)Lunny Xiao2023-04-172-11/+43
|
* Fix math and mermaid rendering bugs (#24049)silverwind2023-04-178-43/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Fix multiple error display for math and mermaid: ![err](https://user-images.githubusercontent.com/115237/231126411-8a21a777-cd53-4b7e-ac67-5332623106e8.gif) 2. Fix height calculation of certain mermaid diagrams by reading the iframe inner height from it's document instead of parsing it from SVG: Before: <img width="866" alt="Screenshot 2023-04-11 at 11 56 27" src="https://user-images.githubusercontent.com/115237/231126480-b194e02b-ea8c-4ddf-8c79-50c525815d92.png"> After: <img width="855" alt="Screenshot 2023-04-11 at 11 56 35" src="https://user-images.githubusercontent.com/115237/231126494-5fe86a48-8d21-455a-8b95-79b6ee27a16f.png"> 3. Refactor error handling to a common function 4. Rename to `renderAsciicast` for consistency 5. Improve mermaid loading sequence Note: I did try `securityLevel: 'sandbox'` to make mermaid output a iframe directly, but that showed a bug in mermaid where the iframe style height was set incorrectly. Opened https://github.com/mermaid-js/mermaid/issues/4289 for this. --------- Co-authored-by: Giteabot <teabot@gitea.io>
* Refactor locale number (#24134)wxiaoguang2023-04-1719-106/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | Before, the `GiteaLocaleNumber.js` was just written as a a drop-in replacement for old `js-pretty-number`. Actually, we can use Golang's `text` package to format. This PR partially completes the TODOs in `GiteaLocaleNumber.js`: > if we have complete backend locale support (eg: Golang "x/text" package), we can drop this component. > tooltip: only 2 usages of this, we can replace it with Golang's "x/text/number" package in the future. This PR also helps #24131 Screenshots: <details> ![image](https://user-images.githubusercontent.com/2114189/232179420-b1b9974b-9d96-4408-b209-b80182c8b359.png) ![image](https://user-images.githubusercontent.com/2114189/232179416-14f36aa0-3f3e-4ac9-b366-7bd3a4464a11.png) </details>
* [skip ci] Updated translations via CrowdinGiteaBot2023-04-1727-79/+0
|
* Use 1.18's aria role for dropdown menus (#24144)wxiaoguang2023-04-161-2/+2
| | | | | | | | | | | | According to erion's feedback, the 1.18 approach works with Safari (`role=menu` on the parent container), while the 1.19's approach doesn't work well with Safari+VoiceOver (although I tested it worked with Chrome a little better). I have tested this 1.18 approach could work for all Safari/Chrome+VoiceOver and Chrome+Talkback. Let's try to make it on try.gitea.io to see whether it helps Safari users.
* Set EasyMDE heading font-size to the same size as the resulting markdown ↵wxiaoguang2023-04-161-0/+25
| | | | | | | | | | | | | | | | | | | | (#24151) Fix #23816 According to my personal experience, the EasyMDE is still useful when writing a lot of contents, eg: the wiki page. It's not difficult to improve its heading styles, so let's make it. Before: <img width="815" alt="image" src="https://user-images.githubusercontent.com/2114189/232280943-9177f0bc-e380-426f-8588-20ff8d8e5293.png"> After: <img width="538" alt="image" src="https://user-images.githubusercontent.com/2114189/232280903-e8c476ee-f5b1-48fe-8a93-86fcd79680c3.png">
* Fix 2-dot direct compare to use the right base commit (#24133)Jonathan Tran2023-04-161-1/+5
| | | | | | For 2-dot direct compare, we should use the base commit in the title and templates, as is used elsewhere, not the common ancestor which is used for 3-dot compare. I believe that this change should have been included in #22949.
* Add migration to fix external unit access mode of owner/admin team (#24117)yp053272023-04-152-0/+51
| | | | | | Fix the incorrect migration in #23675 and #24012 External Unit (Tracker and Wiki) access mode should be `read` in owner/admin team.
* Remove untranslatable `on_date` key (#24106)Yarden Shoham2023-04-155-15/+74
| | | | | | | | | | | | | | | | | | | | - Follows #23988 - Fixes: #24074 by removing this key GitHub's `relative-time` elements allow us to force their rendering to `auto`, `past`, or `future` tense. We will never show an absolute date `on ...` in `TimeSince` ## Before ![image](https://user-images.githubusercontent.com/20454870/231735872-048c7bf3-6aa1-4113-929d-75a985c9922c.png) ## After ![image](https://user-images.githubusercontent.com/20454870/231736116-6ad47b63-77f4-4d3f-82a2-ee9a46ba2bd1.png) --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* [skip ci] Updated translations via CrowdinGiteaBot2023-04-153-15/+72
|
* Sort repo topic labels by name (#24123)wxiaoguang2023-04-143-9/+7
| | | | Close #24077
* Add option to search for users is active join a team (#24093)Tyrone Yeh2023-04-142-1/+2
| | | | | | | | Adding a user in a team to enter a username gives a list of no active users --------- Co-authored-by: Jason Song <i@wolfogre.com>
* Make more functions use ctx instead of db.DefaultContext (#24068)wxiaoguang2023-04-1417-79/+79
| | | | | | Continue the "ctx refactoring" work. There are still a lot db.DefaultContext, incorrect context could cause database deadlock errors.
* Fix meilisearch not working when searching across multiple repositories (#24109)Brecht Van Lommel2023-04-141-2/+4
| | | | | | This would happen in the issue and pull request dashboards, while the per repository lists worked fine. Use OR instead of AND for repo IDs.