aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Move some functions into services/repository (#17660)Lunny Xiao2021-11-1619-136/+114
|
* Remove superfluous argument (#17667)Gusted2021-11-161-1/+1
| | | As title.
* Decouple unit test, remove intermediate `unittestbridge` package (#17662)wxiaoguang2021-11-16151-1781/+1719
| | | Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add copy button to markdown code blocks (#17638)silverwind2021-11-1619-44/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add copy button to markdown code blocks Done mostly in JS because I think it's better not to try getting buttons past the markup sanitizer. * add svg module tests * fix sanitizer regexp * remove outdated comment * vertically center button in issue comments as well * add comment to css * fix undefined on view file line copy * combine animation less files * Update modules/markup/markdown/markdown.go Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> * add test for different sizes * add cloneNode and add tests for it * use deep clone * remove useless optional chaining * remove the svg node cache * unify clipboard copy string and i18n * remove unused var * remove unused localization * minor css tweaks to the button * comment tweak * remove useless attribute Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Migrating wiki don't require token, so we should move it out of the require ↵Lunny Xiao2021-11-166-62/+78
| | | | | | | form (#17645) * Migrating wiki don't require token, so we should move it out of the require form * Fix lint
* Fix GitBucket icon (#17644)silverwind2021-11-162-2/+2
| | | | | Partial fix for https://github.com/go-gitea/gitea/issues/17642. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix database deadlock when update issue labels (#17649)wxiaoguang2021-11-162-26/+22
| | | | This fix updates issue labels one by one, and won't cause database deadlock. In future, we can use a batch API to update all changed labels by one request.
* [skip ci] Updated translations via CrowdinGiteaBot2021-11-162-1/+2
|
* Changed migration text. (#17654)KN4CK3R2021-11-151-1/+1
|
* Fix nil checking on typed interface (#17598)Gusted2021-11-154-15/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | * Fix nil checking on typed interface - Partially resoles #17596 - Resolves SA4023 errors. - Ensure correctly that typed interface are nil. * Remove unnecessary code `NewBleveIndexer` will never return nil, even on errors. * Patch `NewBleveIndexer` * Fix low-level functions * Remove deadcode * Fix GetSession * Close Elastic search when err isn't nil * Update elastic_search.go Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Remove unnecassary calls to `filepath.Join` (#17608)Gusted2021-11-154-5/+5
| | | | | | | | | | | - Partialy resolvess #17596 - Resolves `badCall` errors from go-critic `badCall: suspicious Join on 1 argument` - When only 1 argument is passed into `filepath.Join`, it won't do anything special other than `filepath.Clean(...)` will be applied over it. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: 6543 <6543@obermui.de>
* Add download button for file viewer (#17640)Gusted2021-11-152-0/+2
| | | | | | | | - Resolves #17286 - Use the `download` attribute such that the browser will natively initate a download dialog for the given URL. Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* [skip ci] Updated translations via CrowdinGiteaBot2021-11-151-0/+4
|
* fix typo (#17614)缘生2021-11-141-1/+3
|
* Add icon to vscode clone link (#17641)silverwind2021-11-143-6/+6
|
* Add migration from GitBucket (#16767)KN4CK3R2021-11-148-106/+365
| | | | | | | | | | | | | This PR adds [GitBucket](https://gitbucket.github.io/) as migration source. Supported: - Milestones - Issues - Pull Requests - Comments - Reviews - Labels There is no public usable instance so no integration tests added.
* Fix offBy1 errors (#17606)Gusted2021-11-142-2/+13
| | | | | | | | | | | | | | | | | | | | | * Fix offBy1 errors - Partially resolves #17596 - Resolve errors from go-critic `offBy1: Index() can return -1; maybe you wanted to do Index()+1`. * Match golang spec * Remove comments * Update migrations.go * Apply suggestions from code review Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* perf: only generate data-comment-url once (#17618)Gusted2021-11-144-7/+7
|
* [skip ci] Updated licenses and gitignoresGiteaBot2021-11-145-19/+408
|
* Correctly handle failed migrations (#17575)zeripath2021-11-136-4/+26
| | | | | | | | | | | | | | * Correctly handle failed migrations There is a bug in handling failed migrations whereby the migration task gets decoupled from the migration repository. This leads to a failure of the task to get deleted with the repository and also leads to the migration failed page resulting in a ISE. This PR removes the zeroing out of the task id from the migration but also makes the migration handler tolerate missing tasks much nicer. Fix #17571 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Minor readability patch. (#17627)Michael Grigoryan2021-11-121-1/+1
|
* Decouple unit test code from business code (#17623)wxiaoguang2021-11-12136-829/+1057
|
* Fix some incorrect async functions, improve frontend document. (#17597)wxiaoguang2021-11-127-44/+107
|
* unbind the CheckConsistency for some structs so that they can be moved to ↵Lunny Xiao2021-11-121-20/+33
| | | | | | | | | sub packages easier (#17612) * unbind the CheckConsistency for some structs so that they can be moved to sub packages easier * Fix functions name * Fix typo
* Move EmailAddress & UserRedirect into models/user/ (#17607)Lunny Xiao2021-11-1132-644/+719
| | | | | | | | | | | | | | | | | | | | | * Move EmailAddress into models/user/ * Fix test * rename user_mail to user_email * Fix test * Move UserRedirect into models/user/ * Fix lint & test * Fix lint * Fix lint * remove nolint comment * Fix lint
* Refactor commentTags functionality (#17558)Gusted2021-11-115-74/+111
| | | | | | | | | | | | | | | | | | | | | | | | * feat: Allow multiple tags on comments - Allow for multiples tags(Currently Poster + {Owner, Writer}). - Utilize the Poster tag within the commentTag function and remove the checking from templates. - Use bitwise on CommentTags to enable specific tags. - Don't show poster tag(view_content.tmpl) on the initial issue comment. * Change parameters naming * Change function name * refactor variable wording * Merge 'master' branch into 'tags-comments' branch * Change naming * `tag` -> `role` Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Remove `golint` as linter (#17609)Gusted2021-11-111-1/+0
| | | | | | | | | | - Partialy resolvess #17596 - In the newer versions of `golangci-lint`, golint is deprecated and replaced by the `revive` linter. Thus removing the `golint` linter is a good idea, as we're already using the `revive` linter which covers all the current `golint` cases. Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Update JS dependencies (#17611)silverwind2021-11-1110-3190/+1394
| | | | | | | | | - Update monaco, adapting to breaking changes - Update dropzone, adapting to breaking changes - Update linters, fix new issues, disable opinionated stylelint rules - Rebuild SVGs and images - Tested Dropzone and Monaco Replaces: https://github.com/go-gitea/gitea/pull/17574
* Move oauth2 error to oauth2 service package (#17603)Lunny Xiao2021-11-113-28/+20
|
* Fix 500 when a comment was deleted which has a notification (#17550)Lunny Xiao2021-11-103-5/+11
| | | | | | | | | | * Fix 500 when a comment was deleted which has a notification * Tolerate missing Comment in other places too Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Andrew Thornton <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Move webhook into models/webhook/ (#17579)Lunny Xiao2021-11-1047-717/+770
|
* Added GetUserByIDCtx. (#17602)KN4CK3R2021-11-093-5/+10
| | | Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* [skip ci] Updated translations via CrowdinGiteaBot2021-11-1022-22/+0
|
* Move unit into models/unit/ (#17576)Lunny Xiao2021-11-0968-491/+556
| | | | | * Move unit into models/unit/ * Rename unit.UnitType as unit.Type
* tune sqlite3 message (#17601)wxiaoguang2021-11-091-2/+2
|
* Remove me from the maintainers (#17599)Andrey Nering2021-11-091-1/+0
| | | I haven't being involved in a while.
* Fix 500 when review pull request with anonymous (#17594)Lunny Xiao2021-11-091-1/+5
|
* Move merge-section to `> .content` (#17582)Gusted2021-11-091-8/+15
| | | | | | | | | | | | * Move `> .merge-section` to `> .content` scope - Fixes a issue that started from https://github.com/go-gitea/gitea/pull/17317 - Move `> .merge-section` to the `> .content` scope. - Resolves #17480 * Move `.merge-section` back to outside scope Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Update `User` model comments about permissions (#17583)wxiaoguang2021-11-091-5/+12
|
* Improve async/await usage, and sort init calls in `index.js` (#17386)wxiaoguang2021-11-0921-202/+214
| | | | * clean up async/await, and sort init calls in `index.js * use `const _promise` to indicate that we do not need await an async function
* Use provided database Engine (#17595)Gusted2021-11-092-2/+2
| | | | - Don't get the engine from `db.DefaultContext`, instead use the provided one which is passed as paramater `e`.
* Fix bug on detect issue/comment writer (#17591)Lunny Xiao2021-11-091-1/+1
|
* Allow U2F 2FA without TOTP (#11573)Kamil Domański2021-11-0812-57/+100
| | | | | | | This change enables the usage of U2F without being forced to enroll an TOTP authenticator. The `/user/auth/u2f` has been changed to hide the "use TOTP instead" bar if TOTP is not enrolled. Fixes #5410 Fixes #17495
* Fix stats upon searching issues (#17566)Gusted2021-11-082-5/+45
| | | | | | | | | | | * Fix stat chunks searching - Fixes a issue whereby the given chunk of issueIDs wasn't respected and thus the returned results where not the correct results. * Add tests Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
* Only allow returned deleted branche to be on repo (#17570)Gusted2021-11-082-1/+26
| | | | | | | - This will only allow `GetDeletedBranchByID` to return deletedBranch which are on the repo, and thus don't return a deletedBranch from another repo. - This just should prevent possible bugs in the futher when a code is passing the wrong ID into this function.
* Avoid double imports (#17569)Gusted2021-11-085-10/+7
| | | | | Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Remove appSubUrl from pasted images (#17572)zeripath2021-11-081-3/+3
| | | | | | | | | | * Remove appSubUrl from pasted images Since we fixed the url base for the links in repositories we no longer need to add the appsuburl to pasted image links. Fix #17057 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix documents for ALLOWED_HOST_LIST, its default value differs between 1.15 ↵wxiaoguang2021-11-082-1/+2
| | | | | and 1.16 (#17530) * fix documents for ALLOWED_HOST_LIST, its default value differs between 1.15 and 1.16
* Add @Gusted to maintainers filer (#17581)Gusted2021-11-071-0/+1
|
* Make ParsePatch more robust (#17573)Gusted2021-11-072-1/+30
|