Commit Graph
100 Commits
Author SHA1 Message Date
c1fe6fbcc3 Make toast support preventDuplicates (#31501)
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>
2024-06-27 13:58:38 +00:00
wxiaoguangandGitHub 00fc29aee1 Refactor issue label selection (#31497)
Follow #26460
2024-06-26 23:41:59 +00:00
wxiaoguangandGitHub a88f718c10 Refactor dropzone (#31482)
Refactor the legacy code and remove some jQuery calls.
2024-06-27 01:01:20 +08:00
wxiaoguangandGitHub f4921b9daa Simplify 404/500 page (#31409) 2024-06-23 17:45:21 +00:00
wxiaoguangandGitHub bda875b6e6 Switch to "Write" tab when edit comment again (#31445)
Fix #19031
2024-06-22 09:25:04 +00:00
wxiaoguangandGitHub 1d76e9aabf Add simple JS init performance trace (#31459)
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)
2024-06-22 17:20:20 +08:00
wxiaoguangandGitHub 1a811c0bd1 Refactor image diff (#31444)
And remove some jQuery functions
2024-06-22 04:52:09 +00:00
wxiaoguangandGitHub 621e1ff9c9 Improve markdown textarea for indentation and lists (#31406)
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
2024-06-21 08:14:40 +00:00
wxiaoguangandGitHub 06782872c4 Split common-global.js into separate files (#31438)
To improve maintainability
2024-06-21 15:40:33 +08:00
wxiaoguangandGitHub ed5ded3ff8 Fix the link for .git-blame-ignore-revs bypass (#31432)
A quick fix for #31429
2024-06-20 23:28:34 +00:00
wxiaoguangandGitHub 43c7a2e7b1 Refactor names (#31405)
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
2024-06-19 06:32:45 +08:00
wxiaoguangandGitHub 21783a5752 Fix rendered wiki page link (#31398)
Fix #31395
2024-06-18 03:09:20 +00:00
37a4b233a0 Refactor repo unit "disabled" check (#31389)
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>
2024-06-18 00:51:13 +00:00
wxiaoguangandGitHub d32648b204 Refactor route path normalization (#31381)
Refactor route path normalization and decouple it from the chi router.
Fix the TODO, fix the legacy strange path behavior.
2024-06-17 23:28:47 +00:00
wxiaoguangandGitHub 5a7376c060 Refactor markup code (#31399)
1. use clearer names
2. remove deadcode
3. avoid name shadowing
4. eliminate some lint warnings
2024-06-17 22:56:45 +00:00
wxiaoguangandGitHub 0f09c22663 Improve rubygems package registry (#31357)
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.
2024-06-17 08:42:46 +00:00
wxiaoguangandGitHub 25f3ec5b65 Fix natural sort (#31384)
Fix #31374
2024-06-17 06:45:12 +00:00
wxiaoguangandGitHub f5dfd7d73c Add a simple test for AdoptRepository (#31391)
Follow #31333
2024-06-17 01:18:35 +00:00
wxiaoguangandGitHub f446e3b4ab Fix JS error when creating new issue (#31383)
Fix #31336
2024-06-16 02:07:21 +00:00
84cbb6c4d2 Fix duplicate sub-path for avatars (#31365)
Fix #31361, and add tests

And this PR introduces an undocumented & debug-purpose-only config
option: `USE_SUB_URL_PATH`. It does nothing for end users, it only helps
the development of sub-path related problems.

And also fix #31366

Co-authored-by: @ExplodingDragon
2024-06-15 11:43:57 +08:00
47ca61d8ba Improve detecting empty files (#31332)
Co-authored-by: silverwind <me@silverwind.io>
2024-06-13 01:06:46 +00:00
wxiaoguangandGitHub 4bf848a06b Make template Iif exactly match if (#31322) 2024-06-11 14:52:12 +00:00
wxiaoguangandGitHub 5342a61124 Delete legacy cookie before setting new cookie (#31306)
Try to fix #31202
2024-06-11 11:31:23 +08:00
wxiaoguangandGitHub 6106a61eff Remove sub-path from container registry realm (#31293)
Container registry requires that the "/v2" must be in the root, so the
sub-path in AppURL should be removed
2024-06-09 16:29:29 +08:00
wxiaoguangandGitHub 0188d82e49 Fix some URLs whose sub-path is missing (#31289)
Fix #31285
2024-06-07 15:15:17 +00:00
wxiaoguangandGitHub e728fd741b Fix Activity Page Contributors dropdown (#31264)
Fix #31261
2024-06-06 10:28:33 +08:00
wxiaoguangandGitHub bd80225ec3 Make blockquote attention recognize more syntaxes (#31240)
Fix #31214
2024-06-04 15:35:29 +00:00
wxiaoguangandGitHub fcc061ae44 Fix admin oauth2 custom URL settings (#31246)
Fix #31244
2024-06-04 23:06:21 +08:00
9000811118 Make pasted "img" tag has the same behavior as markdown image (#31235)
Fix #31230

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2024-06-04 12:19:41 +00:00
wxiaoguangandGitHub a4275951ba Split sanitizer functions and fine-tune some tests (#31192) 2024-05-31 13:26:01 +00:00
wxiaoguangandGitHub d612a24e3e Ignore FindRecentlyPushedNewBranches err (#31164)
Fix #31163
2024-05-30 02:24:22 +00:00
wxiaoguangandGitHub 34daee6baf Fix markup preview (#31158)
Fix #31157

After:

![image](https://github.com/go-gitea/gitea/assets/2114189/4d918cce-cd0d-4601-9c81-4b32df1b0b38)
2024-05-29 16:28:55 +00:00
wxiaoguangandGitHub 8fc2ec1872 Update pip related commands for docker (#31106)
Thanks to graelo and silverwind for figuring out the problem.

Fix #31101
2024-05-27 13:53:33 +00:00
wxiaoguangandGitHub 20c40259f1 Fix missing memcache import (#31105)
Fix #31102
2024-05-27 13:43:32 +00:00
wxiaoguangandGitHub fb1ad920b7 Refactor sha1 and time-limited code (#31023)
Remove "EncodeSha1", it shouldn't be used as a general purpose hasher
(just like we have removed "EncodeMD5" in #28622)

Rewrite the "time-limited code" related code and write better tests, the
old code doesn't seem quite right.
2024-05-20 15:12:50 +00:00
wxiaoguangandGitHub de9bcd1d23 Avoid 500 panic error when uploading invalid maven package file (#31014)
PackageDescriptor.Metadata might be nil (and maybe not only for maven).
This is only a quick fix.

The new `if` block is written intentionally to avoid unnecessary
indenting to the existing code.
2024-05-20 06:44:16 +00:00
f48cc501c4 Fix incorrect "blob excerpt" link when comparing files (#31013)
When comparing files between the base repo and forked repo, the "blob
excerpt" link should point to the forked repo, because the commit
doesn't exist in base repo.

Co-authored-by: Giteabot <teabot@gitea.io>
2024-05-20 05:57:57 +00:00
wxiaoguangandGitHub b6574099ed Fix project column title overflow (#31011)
By the way:
* Re-format the "color.go" to Golang code style
* Remove unused `overflow-y: scroll;` from `.project-column` because
there is `overflow: visible`
2024-05-20 05:21:01 +00:00
wxiaoguangandGitHub 47accfebbd Fix data-race during testing (#30999)
Fix #30992
2024-05-20 04:35:38 +00:00
wxiaoguangandGitHub edbf74c418 Fix "force private" logic (#31012)
When creating a repo, the "FORCE_PRIVATE" config option should be
respected, `readonly` doesn't work for checkbox, so it should use
`disabled` attribute.
2024-05-20 00:56:45 +00:00
339bc8bc8f Improve reverse proxy documents and clarify the AppURL guessing behavior (#31003)
Fix #31002

1. Mention Make sure `Host` and `X-Fowarded-Proto` headers are correctly passed to Gitea
2. Clarify the basic requirements and move the "general configuration" to the top
3. Add a comment for the "container registry"
4. Use 1.21 behavior if the reverse proxy is not correctly configured

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2024-05-19 14:56:08 +00:00
wxiaoguangandGitHub 821d2fc2a3 Simplify mirror repository API logic (#30963)
Fix #30921
2024-05-17 16:07:41 +00:00
wxiaoguangandGitHub 740b6e1389 Fix JS error when editing a merged PR's title (#30990) 2024-05-16 13:04:25 +00:00
wxiaoguangandGitHub effb405cae Always load or generate oauth2 jwt secret (#30942)
Fix #30923
2024-05-14 14:21:38 +00:00
wxiaoguangandGitHub f4f4e18b14 Filter out duplicate action(activity) items for a repository (#30957)
Fix #20986
2024-05-14 13:47:03 +00:00
080486e47d Fix some UI regressions for commit list (#30920)
Close #30919

---------

Co-authored-by: silverwind <me@silverwind.io>
2024-05-10 12:58:05 +00:00
7424f27cf3 Check if reverse proxy is correctly configured (#30890)
Follow #27011
Follow #30885

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
2024-05-10 20:07:01 +08:00
wxiaoguangandGitHub ed0fc2729e Add missing menu active item background back (#30897)
Fix #30578
2024-05-08 23:01:25 +00:00
wxiaoguangandGitHub 3fdb2d4ad8 Fix incorrect issue form (#30881)
Fix #30864
2024-05-08 15:39:13 +00:00
67c1a07285 Refactor AppURL usage (#30885)
Fix #30883
Fix #29591

---------

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
2024-05-07 08:26:13 +00:00
wxiaoguangandGitHub 9c08637eae Make "sync branch" also sync object format and add tests (#30878) 2024-05-06 17:02:30 +00:00
wxiaoguangandGitHub 7c613f100e Make sure git version&feature are always prepared (#30877)
Otherwise there would be more similar issues like #29287
2024-05-06 18:34:16 +02:00
wxiaoguangandGitHub eda10cc2bb Fix some UI problems (dropdown/container) (#30849)
Follow #30345
Follow #30547

`ellipsis` / `white-space` shouldn't be put on the general dropdown components.
2024-05-06 07:17:22 +00:00
wxiaoguangandGitHub ce8b11ae13 Fix some UI problems (install/checkbox) (#30854)
Fix the space between the box and label for checkboxes, and fix incorrect usages in "repo-issue.js"
2024-05-06 06:32:05 +00:00
wxiaoguangandGitHub 982b20d259 Do not show monaco JS errors (#30862)
Fix #30861
2024-05-05 16:34:13 +00:00
wxiaoguangandGitHub 5c236bd4c0 Fix issue/PR title edit (#30858)
1. "enter" doesn't work (I think it is the last enter support for #14843)
2. if a branch name contains something like `&`, then the branch selector doesn't update
2024-05-05 13:09:41 +00:00
wxiaoguangandGitHub c7bb3aa034 Fix markdown URL parsing for commit ID (#30812) 2024-05-04 09:48:16 +08:00
wxiaoguangandGitHub 0f3e717a1a Improve grep search (#30843)
Reduce the context line number to 1, make "git grep" search respect the
include/exclude patter, and fix #30785
2024-05-03 09:13:48 +00:00
wxiaoguangandGitHub 53b55223d1 Ignore useless error message "broken pipe" (#30801)
Fix #30792
2024-05-03 02:39:36 +00:00
wxiaoguangandGitHub 677032d36a Fix incorrect message id for releaes email (#30825)
Make generateMessageIDForRelease outputs the same format as
generateMessageIDForIssue (old `createReference`)
2024-05-02 15:24:21 +00:00
eb8bb82e58 Fix activity heat map padding & locale (#30823)
Fix #30808

---------

Co-authored-by: silverwind <me@silverwind.io>
2024-05-02 13:22:55 +00:00
wxiaoguangandGitHub 6ff2acc52c Fix issue card layout (#30800)
Fix #30788
2024-05-02 11:19:44 +00:00
wxiaoguangandGitHub ebe6f4cad7 Fix branch selector UI (#30803)
Fix  #30802
2024-05-02 10:45:23 +00:00
be112c1fc3 Skip gzip for some well-known compressed file types (#30796)
Co-authored-by: silverwind <me@silverwind.io>
2024-05-02 02:27:25 +00:00
wxiaoguangandGitHub ce08a9fe2f Fix markdown rendering when mentioning users (#30795) 2024-05-02 01:00:46 +00:00
wxiaoguangandGitHub 6f7cd94a02 Fix bleve fuzziness (#30799)
Fix #30797
Fix #30317
2024-05-01 15:32:52 +03:00
wxiaoguangandGitHub a988237eb4 Improve logout from worker (#30775)
A quick fix for #30756
2024-04-30 15:35:42 +00:00
wxiaoguangandGitHub 5f05e7b41a Fix dashboard commit status null access (#30771)
Fix #30768
2024-04-30 12:39:36 +00:00
wxiaoguangandGitHub 059b2718a5 Right align the "Settings" menu item in overflow-menu (#30764)
I guess there could be enough people liking to make the Settings menu
item right aligned. As a site admin, I found it's easier to find the
right-aligned Settings menu item.

Tested with various sizes:

![image](https://github.com/go-gitea/gitea/assets/2114189/92836527-2cb2-4531-9296-233c5bd698f4)

![image](https://github.com/go-gitea/gitea/assets/2114189/3a0729fc-5e33-44b5-9fb4-3a4e787405b5)

![image](https://github.com/go-gitea/gitea/assets/2114189/9845ab6b-88e3-4e5a-8d6d-2b8af259d593)
2024-04-30 04:26:13 +00:00
wxiaoguangandGitHub 61b495e5ab Fix issue label rendering in the issue popup (#30763) 2024-04-30 02:36:32 +00:00
wxiaoguangandGitHub 4daea7c603 Rename CodeIndexerEnabled to IsRepoIndexerEnabled (#30762)
Fix  #30761

Most places use `IsRepoIndexerEnabled` but not `CodeIndexerEnabled`, so
it should always use `IsRepoIndexerEnabled` for consistency.
2024-04-29 20:15:35 +00:00
wxiaoguangandGitHub 8de2992ffb Make Ctrl+Enter work for issue/comment edit (#30720)
Fix #30710
2024-04-27 14:32:00 +00:00
wxiaoguangandGitHub 6d2a307ad8 Rename migration package name for 1.22-rc1 (#30730)
Ref: Propose to restart 1.22 release #30501
2024-04-27 14:02:07 +00:00
wxiaoguangandGitHub d3cdef88ad Add some tests to clarify the "must-change-password" behavior (#30693)
Follow  #30472:

When a user is created by command line `./gitea admin user create`:

Old behavior before #30472: the first user (admin or non-admin) doesn't
need to change password.

Revert to the old behavior before #30472
2024-04-27 12:23:37 +00:00
wxiaoguangandGitHub 993736d838 Fix code search input for different views (#30678)
Now only show the "code search" on the repo home page, because it only
does global search.
So do not show it when viewing file or directory to avoid misleading
users (it doesn't search in a directory)
2024-04-26 11:21:04 +00:00
cd70ab31cd Fix incorrect object id hash function (#30708)
Great thanks to @oliverpool for figuring out the problem and proposing a
fix.

Regression of #28138

Incorrect hash causes the user's LFS files get all deleted when running
`doctor fix all`

(by the way, remove unused/non-standard comments)

Co-authored-by: Giteabot <teabot@gitea.io>
2024-04-26 09:49:48 +00:00
wxiaoguangandGitHub 1e749b80d7 Add route handler info for debugging purpose (#30705)
Follow #30519
2024-04-26 09:09:49 +00:00
wxiaoguangandGitHub ed8c63cea3 Deduplicate lfs common code (#30704) 2024-04-26 02:53:30 +00:00
wxiaoguangandGitHub 6a0750177f Allow to save empty comment (#30706)
Fix #29986
2024-04-26 01:17:43 +00:00
wxiaoguangandGitHub fd63b96f6a Refactor imagediff and fix regression bug (#30694)
Fix #30683
2024-04-25 21:01:38 +08:00
wxiaoguangandGitHub bffbbf5470 Improve oauth2 client "preferred username field" logic and the error handling (#30622)
Follow #30454
And fix #24957

When using "preferred_username", if no such field,
`extractUserNameFromOAuth2` (old `getUserName`) shouldn't return an
error. All other USERNAME options do not return such error.

And fine tune some logic and error messages, make code more stable and
more friendly to end users.
2024-04-25 11:22:32 +00:00
wxiaoguangandGitHub 2ee93ea178 Avoid doubled border for the PR info segment (#30663) 2024-04-23 19:24:10 +00:00
wxiaoguangandGitHub b79e3db264 Initial support for colorblindness-friendly themes (#30625)
Initial support for #25680

This PR only adds some simple styles from GitHub, it is big enough and
it focuses on adding the necessary framework-level supports. More styles
could be fine-tuned later.
2024-04-24 00:18:41 +08:00
wxiaoguangandGitHub dd2aaadce3 Fix flash message for flex-container (#30657) 2024-04-23 08:31:51 +00:00
wxiaoguangandGitHub e6103955cc Fix queue test (#30646)
Fix #30643

The old test code is not stable due to the data-race described in the
TODO added at that time.

Make it stable, and remove a debug-only field from old test code.
2024-04-22 23:55:43 +00:00
wxiaoguangandGitHub 7cb88e9c18 Use correct hash for "git update-index" (#30626) 2024-04-22 00:13:44 +00:00
wxiaoguangandGitHub f4a1cf7eab Fix repo home UI when there is no repo description (#30552)
Fix #30502 by a new approach.


![image](https://github.com/go-gitea/gitea/assets/2114189/22f48bca-82d1-45cc-b1b7-ee2344b81a76)
2024-04-21 23:47:31 +00:00
wxiaoguangandGitHub 1e4867730b Fix dropdown text ellipsis (#30628)
Follow
https://github.com/go-gitea/gitea/pull/30547#discussion_r1573866519

Fix #30624

The Fomantic UI Dropdown wasn't designed to work that way, its "text"
element might contain images. So the "overflow" shouldn't be added to
any general dropdown text.


![image](https://github.com/go-gitea/gitea/assets/2114189/f6ceaabd-bc89-4bf2-baa2-a6f0324c1962)
2024-04-21 23:14:33 +00:00
wxiaoguangandGitHub f95622cddc Fix issue comment form and quick-submit (#30623)
1. Rewrite initGlobalEnterQuickSubmit (by the way, remove jQuery)
2. Fix issue comment form layout
2024-04-22 01:00:04 +08:00
48d4580dd5 Clarify permission "HasAccess" behavior (#30585)
Follow #30495

"HasAccess" behavior wasn't clear, to make it clear:

* Use a new name `HasAnyUnitAccess`, it will be easier to review related
code and permission problems.
* Separate everyone access mode to a separate field, then all calls to
HasAccess are reverted to old behavior before #30495.
* Add new tests.

---------

Co-authored-by: Giteabot <teabot@gitea.io>
2024-04-20 03:15:04 +00:00
89e39872ff Fix links in PyPI Simple Repository API page (#30594)
Thanks to @Zottelchen for looking into problem and proposing the fix.

Ref: https://github.com/astral-sh/uv/issues/3017 ,
https://peps.python.org/pep-0503/

This PR's change is from Zottelchen's work.

And I by the way rename the `$p` to `$pd` because `p` is used as
"package" in code, while `pd` is used as "package description".

----

Co-authored-by: Zottelchen
2024-04-20 01:15:14 +00:00
wxiaoguangandGitHub 53cf46cae7 Fix commit file status parser (#30602)
Try to fix  #30492
2024-04-19 14:41:03 +00:00
wxiaoguangandGitHub f60e1a1af2 Fix HEAD method for robots.txt (#30603)
Fix #30601
2024-04-19 21:43:56 +08:00
eb24d973b0 Fix project description rendering for org (#30587)
Fix #30263


![image](https://github.com/go-gitea/gitea/assets/2114189/41cabe6c-f94a-4874-a26f-d01bb89bb28c)

Co-authored-by: Giteabot <teabot@gitea.io>
2024-04-19 07:58:56 +00:00
wxiaoguangandGitHub fe82991547 Fix changelog (main) (#30582)
1. The 1.21.11 changelog is missing
2. Split the old content to CHANGELOG-archived.md, to reduce the size of
CHANGELOG.md
2024-04-19 06:08:30 +00:00
wxiaoguangandGitHub bcbeb24dba Mock queue backoff duration (#30553)
During testing, the backoff duration shouldn't be longer than other
durations
2024-04-18 20:00:59 +00:00
d0e0708355 Refactor and fix archive link bug (#30535)
Regression of #29920
Fixes: #30569

Also this is a rewriting to eliminate the remaining jQuery usages from code.

Co-authored-by: Giteabot <teabot@gitea.io>
2024-04-19 00:45:50 +08:00
wxiaoguangandGitHub d1ba5f431b Some following up changes for routes (#30550)
1. Switch back to the old order for `reqRepoAdmin, context.RepoRef()`
2. Add a routing function info for global NotFound
2024-04-18 09:36:19 +00:00
wxiaoguangandGitHub 3feba9f1f4 Allow everyone to read or write a wiki by a repo unit setting (#30495)
Replace #6312
Help #5833
Wiki solution for #639
2024-04-17 15:58:37 +00:00
0798370f25 Correct locale string rendering (#30522)
Since #29165, the translations are rendered as HTML in templates, so:

1. if the translation does contain `<>`, use `TrString`
2. use `{dummy}` instead of `<dummy>` as much as possible

Co-authored-by: Giteabot <teabot@gitea.io>
2024-04-17 10:24:08 +00:00