aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Always use HTML attributes for avatar size (#31509)silverwind2024-06-2810-59/+11
| | | | | | | | | | Many avatars were rendered in HTML with certain width/height but then resized again in CSS. This was pointless so I removed all these cases and made the HTML size match the previous render size. Also did a few CSS cleanups in the tribute rendering: <img width="648" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/cb2fafb3-5e20-46e9-814f-07df20038beb">
* Add initial typescript config and use it for eslint,vitest,playwright (#31186)silverwind2024-06-2815-66/+249
| | | | | | | | | | | | | | | | | | | | This enables eslint to use the typescript parser and resolver which brings some benefits that eslint rules now have type information available and a tsconfig.json is required for the upcoming typescript migration as well. Notable changes done: - Add typescript parser and resolver - Move the vue-specific config into the root file - Enable `vue-scoped-css/enforce-style-type` rule, there was only one violation and I added a inline disable there. - Fix new lint errors that were detected because of the parser change - Update `i/no-unresolved` to remove now-unnecessary workaround for the resolver - Disable `i/no-named-as-default` as it seems to raise bogus issues in the webpack config - Change vitest config to typescript - Change playwright config to typescript - Add `eslint-plugin-playwright` and fix issues - Add `tsc` linting to `make lint-js`
* Support legacy _links LFS batch responses (#31513)Royce Remer2024-06-283-0/+21
| | | | | | | | | | | | | | | | | | | | | Support legacy _links LFS batch response. Fixes #31512. This is backwards-compatible change to the LFS client so that, upon mirroring from an upstream which has a batch api, it can download objects whether the responses contain the `_links` field or its successor the `actions` field. When Gitea must fallback to the legacy `_links` field a logline is emitted at INFO level which looks like this: ``` ...s/lfs/http_client.go:188:performOperation() [I] <LFSPointer ee95d0a27ccdfc7c12516d4f80dcf144a5eaf10d0461d282a7206390635cdbee:160> is using a deprecated batch schema response! ``` I've only run `test-backend` with this code, but added a new test to cover this case. Additionally I have a fork with this change deployed which I've confirmed syncs LFS from Gitea<-Artifactory (which has legacy `_links`) as well as from Gitea<-Gitea (which has the modern `actions`). Signed-off-by: Royce Remer <royceremer@gmail.com>
* Fix JS error with disabled attachment and easymde (#31511)silverwind2024-06-281-1/+3
| | | | | | Not sure if this is a regression from https://github.com/go-gitea/gitea/pull/30513, but when attachments are disabled, `this.dropzone` is null and the code had failed in `initEasyMDEPaste` trying to access `dropzoneEl.dropzone`.
* Fix avatar radius problem on the new issue page (#31506)charles2024-06-271-1/+1
| | | | | | | | | | | | | | | Close #31502 Related to #31419. In this PR, the avatar width is set to 3em, but the height is not set, so the image is not squared. When object-fit is set to contain, it can't maintain the radius of the image. Result: ![圖片](https://github.com/go-gitea/gitea/assets/30816317/bceb98aa-b0f7-4753-bc8b-3b9c41dfd55a)
* Make toast support preventDuplicates (#31501)wxiaoguang2024-06-278-39/+86
| | | | | | | | | | make preventDuplicates default to true, users get a clear UI feedback and know that "a new message appears". Fixes: https://github.com/go-gitea/gitea/issues/26651 --------- Co-authored-by: silverwind <me@silverwind.io>
* Improve attachment upload methods (#30513)Tyrone Yeh2024-06-2710-99/+171
| | | | | | | | | | | | * Use dropzone to handle file uploading for all cases, including pasting and dragging * Merge duplicate code, use consistent behavior for link generating Close #20130 --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor issue label selection (#31497)wxiaoguang2024-06-262-30/+26
| | | Follow #26460
* Refactor dropzone (#31482)wxiaoguang2024-06-278-184/+184
| | | Refactor the legacy code and remove some jQuery calls.
* [skip ci] Updated translations via CrowdinGiteaBot2024-06-261-1/+1
|
* Optimization of labels handling in issue_search (#26460)Chl2024-06-253-9/+59
| | | | | | | | This PR enhances the labels handling in issue_search by optimizing the SQL query and de-duplicate the IDs when generating the query string. --------- Co-authored-by: techknowlogick <techknowlogick@gitea.com>
* use correct l10n string (#31487)CyberFlame2024-06-251-1/+1
| | | | | | | | Uses the correct string for searching - this is what it looks like prior to the change: ![image](https://github.com/go-gitea/gitea/assets/24910512/38519825-c347-44d6-85d4-6fa3c71ddb7c) (observe how the top box has "Search teams" even though collaborator would be user
* Fix overflow menu flickering on mobile (#31484)Brecht Van Lommel2024-06-251-0/+4
| | | | | | The overflow menu button was incorrectly included in the measurement of the width of the items. As a result, it could get stuck in a loop alternating between different measurements as the button appears and disappears.
* [skip ci] Updated translations via CrowdinGiteaBot2024-06-251-5/+5
|
* Fix poor table column width due to breaking words (#31473)Brecht Van Lommel2024-06-241-1/+5
| | | | | | | Caused by #31091 --------- Co-authored-by: silverwind <me@silverwind.io>
* bump golang deps (#31422)techknowlogick2024-06-245-218/+217
|
* Disable issue/PR comment button given empty input (#31463)Kemal Zebari2024-06-232-13/+18
| | | | | | | | | | | Given an empty issue/PR comment, the comment history would not be updated if the user were to submit it. Therefore, it would make since to just disable the comment button when the text editor is empty. This is inline with what GitHub does when given empty text editor input. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Simplify 404/500 page (#31409)wxiaoguang2024-06-237-19/+39
|
* Fix web notification icon not updated once you read all notifications (#31447)kiatt2102024-06-231-4/+5
| | | | | | | | | Fix #29065 Remove status filtering from GetUIDsAndNotificationCounts sql. --------- Co-authored-by: kiatt210 <kiatt210@github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Switch to "Write" tab when edit comment again (#31445)wxiaoguang2024-06-222-12/+17
| | | Fix #19031
* Add simple JS init performance trace (#31459)wxiaoguang2024-06-221-101/+129
| | | | | | | | | | | | | Related to #23461, and help some cases like #31412 For developers, they could use browser's Performance tool to collect performance data, while this PR is also quite handy to optimize the `index.js`. For end users, this PR is simple enough and could figure out the slow function quickly. ![image](https://github.com/go-gitea/gitea/assets/2114189/a557b08e-6594-474b-81a3-03d5ac2bd68e)
* Refactor image diff (#31444)wxiaoguang2024-06-226-169/+193
| | | And remove some jQuery functions
* [skip ci] Updated translations via CrowdinGiteaBot2024-06-221-0/+6
|
* Support relative paths to videos from Wiki pages (#31061)Sergey Sharybin2024-06-213-43/+83
| | | | | | | | | | | | | | | | | | This change fixes cases when a Wiki page refers to a video stored in the Wiki repository using relative path. It follows the similar case which has been already implemented for images. Test plan: - Create repository and Wiki page - Clone the Wiki repository - Add video to it, say `video.mp4` - Modify the markdown file to refer to the video using `<video src="video.mp4">` - Commit the Wiki page - Observe that the video is properly displayed --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix deprecated Dockerfile ENV format (#31450)silverwind2024-06-212-12/+12
| | | | | | | | | | | | | | | See https://docs.docker.com/reference/build-checks/legacy-key-value-format/. Fixes these warnings seen during the docker build: ``` 4 warnings found (use --debug to expand): - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 5) - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 9) - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 75) - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 76) ``` Introduced in: https://github.com/moby/buildkit/pull/4923
* README Badge maintenance (#31441)silverwind2024-06-212-4/+2
| | | | | | | 1. Remove tickgit badge, the service [only gives errors](https://www.tickgit.com/browse?repo=github.com/go-gitea/gitea&branch=main) and the repo [seems unmaintained](https://github.com/augmentable-dev/tickgit). 2. Color the gitpod badge green because grey badges look odd.
* Improve markdown textarea for indentation and lists (#31406)wxiaoguang2024-06-213-18/+121
| | | | | | Almost works like GitHub * use Tab/Shift-Tab to indent/unindent the selected lines * use Enter to insert a new line with the same indentation and prefix
* Split common-global.js into separate files (#31438)wxiaoguang2024-06-2110-484/+497
| | | To improve maintainability
* Fix the link for .git-blame-ignore-revs bypass (#31432)wxiaoguang2024-06-201-1/+1
| | | A quick fix for #31429
* Bump htmx to 2.0.0 (#31413)Yarden Shoham2024-06-209-14/+13
| | | | | | | | | Tested Subscribe, Follow, Star, Watch, and System Status. --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
* Fix the wrong line number in the diff view page when expanded twice. (#31431)charles2024-06-201-3/+3
| | | close #31149, regression of #29385 (incorrect `data-query=`)
* Fix labels and projects menu overflow on issue page (#31435)Brecht Van Lommel2024-06-201-5/+5
| | | | | It was correct only on the new issue page. Resolves #31415
* [Fix] Account Linking UpdateMigrationsByType (#31428)Sumit2024-06-201-0/+6
| | | Fix https://github.com/go-gitea/gitea/issues/31427
* Fix markdown math brackets render problem (#31420)charles2024-06-202-1/+9
| | | | | Close #31371, support `($ ... $)` like GitHub Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Reduce `air` verbosity (#31417)silverwind2024-06-191-0/+3
| | | | Make `air` log less. Uses the option added in https://github.com/air-verse/air/pull/367.
* Fix new issue/pr avatar (#31419)silverwind2024-06-191-5/+1
| | | | | | The avatar on "New Issue" and "New Pull Request" pages was inconsistent. Removed the extra margin and the new CSS rules now use common parent `<form id="#new-issue">` because `.repository.new.issue` is not present on pull request page.
* Increase max length of org team names from 30 to 255 characters (#31410)Tobias Balle-Petersen2024-06-191-2/+2
| | | | | This PR modifies the structs for editing and creating org teams to allow team names to be up to 255 characters. The previous maximum length was 30 characters.
* [skip ci] Updated translations via CrowdinGiteaBot2024-06-192-0/+10
|
* Refactor names (#31405)wxiaoguang2024-06-19177-837/+837
| | | | | | | This PR only does "renaming": * `Route` should be `Router` (and chi router is also called "router") * `Params` should be `PathParam` (to distingush it from URL query param, and to match `FormString`) * Use lower case for private functions to avoid exposing or abusing
* Update JS dependencies, remove `eslint-plugin-jquery` (#31402)silverwind2024-06-184-526/+482
| | | | | | | | | | | | - Result of `make update-js` - Added 1 new eslint rule - Autofixed 1 new eslint issue - Remove `eslint-plugin-jquery` as `eslint-plugin-no-jquery` does all it does and is actually the maintained fork of it. - Tested all affected `dependencies` --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Switch to upstream of `gorilla/feeds` (#31400)Yarden Shoham2024-06-182-5/+3
| | | | | | | | | They merged the PR we waited for. - Reference: https://github.com/gorilla/feeds/pull/107 - Follows: https://github.com/go-gitea/gitea/pull/28860 Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix rendered wiki page link (#31398)wxiaoguang2024-06-1810-73/+58
| | | Fix #31395
* Refactor repo unit "disabled" check (#31389)wxiaoguang2024-06-1811-55/+25
| | | | | | | | 1. There are already global "unit consts", no need to use context data, which is fragile 2. Remove the "String()" method from "unit", it would only cause rendering problems in templates --------- Co-authored-by: silverwind <me@silverwind.io>
* Refactor route path normalization (#31381)wxiaoguang2024-06-178-157/+153
| | | | Refactor route path normalization and decouple it from the chi router. Fix the TODO, fix the legacy strange path behavior.
* Refactor markup code (#31399)wxiaoguang2024-06-172-37/+10
| | | | | | 1. use clearer names 2. remove deadcode 3. avoid name shadowing 4. eliminate some lint warnings
* Add cache test for admins (#31265)65432024-06-178-27/+119
| | | | | | | | | | | | | | | | | Add a test to probe the cache similar to the email test func. ![image](https://github.com/go-gitea/gitea/assets/24977596/700e2733-586d-4091-900f-f5f71e6e94bf) ![image](https://github.com/go-gitea/gitea/assets/24977596/2a953802-18fc-4e81-a37d-24ebe1297365) ![image](https://github.com/go-gitea/gitea/assets/24977596/e00d62ad-bb60-41cc-9138-09993daee156) --------- Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: silverwind <me@silverwind.io>
* Fix double border in system status table (#31363)silverwind2024-06-171-3/+5
| | | | | | | | | | | | | | | | | | | Fix regression from https://github.com/go-gitea/gitea/pull/30712 where the introduction of this `<div>` caused the `.ui.attached:not(.message) + .ui.attached.segment:not(.top)` CSS selector to no longer work and cause a double border. Before: <img width="200" alt="Screenshot 2024-06-13 at 19 06 12" src="https://github.com/go-gitea/gitea/assets/115237/a9fa0688-adf0-4b2d-a958-6a7679a62031"> After: <img width="232" alt="Screenshot 2024-06-13 at 19 05 57" src="https://github.com/go-gitea/gitea/assets/115237/025b780f-f72f-4049-86de-a5d84851bd1d"> --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Improve rubygems package registry (#31357)wxiaoguang2024-06-173-108/+346
| | | | | | | To make it work with Bundler: https://guides.rubygems.org/rubygems-org-compact-index-api/ It only adds 2 new API endpoints and improves some tests, existing logic is not changed.
* Fix natural sort (#31384)wxiaoguang2024-06-172-17/+87
| | | Fix #31374
* Fix missing images in editor preview due to wrong links (#31299)Brecht Van Lommel2024-06-175-78/+103
| | | | | | | | | | Parse base path and tree path so that media links can be correctly created with /media/. Resolves #31294 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>