Commit Graph

8492 Commits

Author SHA1 Message Date
silverwind
d9c67a8c90 Add Node.js build dep, remove built js/css files (#9114)
- Added Node.js as build dependency and removes build files from git.
- Added version checks for both Go and Node.js.
- Overhauled the js/css make target to only run when needed.
- Merged the `generate` make target into `build` as per suggestion.

Fixes: https://github.com/go-gitea/gitea/issues/6782
Fixes: https://github.com/go-gitea/gitea/issues/9216
2019-12-05 11:41:38 +08:00
Alexey 〒erentyev
e80fe201c0 Fixed topics margin (#9248)
Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
2019-12-03 23:10:40 -05:00
GiteaBot
7ccaf54140 [skip ci] Updated translations via Crowdin 2019-12-04 01:42:09 +00:00
jaqra
8875586570 Change some label colors (#9051)
* Change label colors

* Override black basic label background for green theme on label list
2019-12-03 20:39:58 -05:00
David Svantesson
bac4b78e09 Branch protection: Possibility to not use whitelist but allow anyone with write access (#9055)
* Possibility to not use whitelist but allow anyone with write access

* fix existing test

* rename migration function

* Try to give a better name for migration step

* Clear settings if higher level setting is not set

* Move official reviews to db instead of counting approvals each time

* migration

* fix

* fix migration

* fix migration

* Remove NOT NULL from EnableWhitelist as migration isn't possible

* Fix migration, reviews are connected to issues.

* Fix SQL query issues in GetReviewersByPullID.

* Simplify function GetReviewersByIssueID

* Handle reviewers that has been deleted

* Ensure reviews for test is in a well defined order

* Only clear and set official reviews when it is an approve or reject.
2019-12-03 20:08:56 -05:00
David Svantesson
6460284085 Add comment to exported function WindowsServiceName (make revive) (#9241) 2019-12-03 19:16:29 -05:00
John Olheiser
9a33adcdd3 Allow kbd tags (#9245)
* Allow kbd tags

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Add test

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2019-12-03 14:02:41 -05:00
mrsdizzie
bdbdd6608f Don't link wiki revision to commit (#9244)
In #7907 a change was made to use the same template for repo and wiki
commit lists. However, there is no code or logic for showing the diff of
a wiki commit so it just produces broken links like:

 5e72eeb008

This just removes the link for now until that feature is implemented
2019-12-03 13:15:41 -05:00
GiteaBot
18236973e9 [skip ci] Updated translations via Crowdin 2019-12-03 13:08:09 +00:00
David Svantesson
4256781781 Add myself to maintainers (#9240) 2019-12-03 14:05:23 +01:00
6543
e43de0db4c Fix Dashboard Issues/PR list (#9235)
* fix it

* revert suggestion part
2019-12-03 09:26:02 +02:00
John Olheiser
e459f99ef2 Fix active issue (#9238)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2019-12-03 14:01:29 +08:00
John Olheiser
23ef9ff516 Remove empty lines (#9232)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2019-12-03 08:33:25 +08:00
John Olheiser
51432ebb9c Fix context menu overflow & review tag margin (#9231)
* Fix context menu overflow

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Add review tag CSS

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2019-12-03 01:03:30 +02:00
GiteaBot
a00d7200b1 [skip ci] Updated translations via Crowdin 2019-12-02 18:35:05 +00:00
David Svantesson
1aa7e27dd0 Change review content column to type text in db (#9229) 2019-12-02 13:32:40 -05:00
GiteaBot
33fc48c8ae [skip ci] Updated translations via Crowdin 2019-12-02 14:45:50 +00:00
Lunny Xiao
6e81eafdd6 Remove unused comment actions (#9222)
* Remove unused comment actions

* improve code
2019-12-02 16:43:39 +02:00
Alexey 〒erentyev
2fc3eb1d15 Fixed topic regex pattern and added search by topic links after save (#9219)
Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
2019-12-02 11:13:19 +02:00
6543
66028d58f9 [UI] IssuePage multi repo select (#8741)
* Make repository list @ issues/PR page persist

Will partially fix #6355

* Enable multiple selections in repo list @ issues/PR page

Part of issue #6355

* Add RepoIDs to UserIssueStatsOptions to make "type" count correct when selecting one/multiple repos.
* Replace variable "repo" with list "repos[]" and enable multiple selections of repositories from list by including/excluding RepoIDs in list.
*

* Remove redundant code

* Add 'All' button 

Improves functionality of the page, so that backtracking is not necessary to reset the page

* Remove redundant variable

Completely replace 'RepoID' with 'RepoIDs' and remove redundant code

* Add RepoIDs to label link

* Revert part of code to previous version to troubleshoot build failure

* Implement old and new pieces of code whilst adhering to multi select

* Attempt to join the two versions

Last commit passed tests but doesn't work in practice, this works in practice and hopefully passes the tests.

* Update tests to desired state

* Fix pagination implementation and tests

* Pass repoIDs as `repos=[1,2,3...]` instead of several `repos[]=..`
* Update tests file to reflect new functionality
* Update template with new `repos` format
* Implement new solution to show constant "total issues" count for "All" button

* Correct behavior when passing zero to array

* Comment out test url returning 404

This keeps returning 404 in the test despite working in practice, for the sake of running more tests I am commenting it out

* Comment out another test url returning 404

Last attempt, if more tests crash I will uncomment the urls and request assistance.

* Reenable tests and test fix

* Re-enable tests
* Make selecting "In your repositories" reset selection as passing IDs of repos belonging to other profiles causes breakage
* Remove unnecessary (with multi-selection enable) code

* Drop repo from repo map and total count if permission denied

* Remove extra parenthesis

* make template work again

* find bug!

* forgot the '#' at bugfixing

* delete unused RepoID

* compile regex only one time

* make fmt

* local variable = capital letter lower

* check if repos query pattern is correct

* pagination remove last , - make regex work again

* use Replace instead of ReplaceAll; del delete

* fix test

* how did this test binary got in?!?
dont forgot the "-p" at git add * !

* dont replace -> cut fisrt & last string

Co-Authored-By: zeripath <art27@cantab.net>

* jet another regex

dont mind as long as it has the same result and is performatn ...

Co-Authored-By: zeripath <art27@cantab.net>

* dont use nonexisting repo for test

* exclude /issues?type=created_by from test

* add table to querys
use same syntax in each query (table.colum)

* add new issue for test

* dont make a workaround or something else
this need a refactor itself and is out of scope for this PR

* fix misspell

* CI.redo()

* englisch txt update

Co-Authored-By: zeripath <art27@cantab.net>

* add sugestions

* Tweak & Fix

* CI.restart()
2019-12-01 22:50:36 -05:00
6543
668eaf95d5 [Feature] Custom Reactions (#8886)
* add [ui] Reactions

* move contend check from form to go functions

* use else if

* check if reaction is allowed only on react
(so previous custom reaction can be still removed)

* use $.AllowedReactions in templates

* use ctx.Flash.Error

* use it there too

* add redirection

* back to server error
because a wrong reaction is a template issue ...

* add emoji list link

* add docs entry

* small wording nit
suggestions from @jolheiser - thx

* same reactions as github

* fix PR reactions

* handle error so template JS could check

* Add Integrations Test

* add REACTIONS setting to cheat-sheet doc page
2019-12-01 17:57:24 -05:00
GiteaBot
674bc772fb [skip ci] Updated translations via Crowdin 2019-12-01 13:59:18 +00:00
guillep2k
6a90c7e3dd Alternate syntax for cross references (#9116)
* Add support for local vs. remote xrefs

* Add doc for references

* Docs: fix cases not currently supported

* One more doc fix

* Doc: mentions for teams and orgs

* Change !num ref concept, no change in functionality

* Fix test

* Improve table of issue reference types

* Fix paragraph mark
2019-12-01 15:57:05 +02:00
Lunny Xiao
2011a5b818 Extract createComment (#9125)
* Extract createComment

* fix lint

* fix lint
2019-11-30 21:44:39 -05:00
6543
7c6f2e27be Add release_counter to Repo API (#9214) 2019-11-30 14:28:47 -05:00
6543
61c59bd695 [Bug] [API] Add language to user api (#9215)
* add language to user api

* OK

Co-Authored-By: Lauris BH <lauris@nix.lv>
2019-11-30 11:18:40 -05:00
zeripath
60c5339042 Graceful: Cancel Process on monitor pages & HammerTime (#9213)
* Graceful: Create callbacks to with contexts

* Graceful: Say when Gitea is completely finished

* Graceful: Git and Process within HammerTime

Force all git commands to terminate at HammerTime
Force all process commands to terminate at HammerTime
Move almost all git processes to run as git Commands

* Graceful: Always Hammer after Shutdown

* ProcessManager: Add cancel functionality

* Fix tests

* Make sure that process.Manager.Kill() cancels

* Make threadsafe access to Processes and remove own unused Kill

* Remove cmd from the process manager as it is no longer used

* the default context is the correct context

* get rid of double till
2019-11-30 16:40:22 +02:00
Lauris BH
8f8c250ddb
Make consistent links to repository in the Slack/Mattermost notificiations (#9205) 2019-11-30 12:23:37 +02:00
John Olheiser
15a5c10d33 Variable expansion in repository templates (#9163)
* Start expansion

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* _template rather than .template

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Use ioutil

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Add descriptions to mapping

* Start globbing

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Tune globbing

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Re-arrange imports

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Don't expand git hooks

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Add glob tests for .giteatemplate

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Parse globs separately so they can be tested more easily

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Change template location and add docs

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* nit

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Update docs/content/doc/features/gitea-directory.md

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>

* Update docs/content/doc/features/gitea-directory.md

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>

* Add upper-lower case match

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Nits

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Update models/repo_generate.go

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
2019-11-30 01:54:47 -05:00
programkode
c9d50bcab5 Correct tooltip msg blocked by dependencies (#9211) 2019-11-29 14:05:49 -05:00
6543
d7c1310353 expose PR counter on Repo API (#9202) 2019-11-29 23:14:24 +08:00
Lunny Xiao
e151674cfa
Move PushUpdateOptions from models to repofiles (#9124) 2019-11-29 10:21:05 +08:00
zeripath
54dab5aed9 Properly fix displaying virtual session provider in admin panel (#9137)
* Properly fix #7127

Although #7300 properly shadows the password from the virtual session
provider, the template displaying the provider config still presumed
that the config was JSON.

This PR updates the template and properly hides the Virtual Session
provider.

Fixes #7127

* update per @silverwind's suggestion
2019-11-28 12:35:41 -05:00
Lunny Xiao
3bdce82ce9
upgrade levelqueue to 0.1.0 (#9192) 2019-11-28 23:37:33 +08:00
Lunny Xiao
ef9a0370ca
Fix panic when diff (#9187)
* fix panic when diff

* improve code
2019-11-28 17:05:57 +08:00
Antoine GIRARD
6e578dd0c9 docker: ask s6 to stop all service when gitea stop (#9171)
* fix: ask s6 to stop all service when gitea stop

https://github.com/just-containers/s6-overlay#writing-an-optional-finish-script

* change service folder
2019-11-27 13:08:57 -05:00
Mura Li
9591185c8f Upgrade blevesearch to v0.8.1 (#9177)
For #1441

a91b427b59
2019-11-27 11:23:33 +02:00
GiteaBot
b50dee5a61 [skip ci] Updated translations via Crowdin 2019-11-27 00:53:49 +00:00
Lunny Xiao
7b7d382b8b Fix datarace on git.GlobalCommandArgs on tests (#9162)
* fix datarace on git.GlobalCommandArgs on tests

* fix tests

* fix tests

* fix tests
2019-11-27 01:35:52 +01:00
zeripath
9d9e6ac411 Yet another attempt to fix the intermittent failure of gpg git test (#9146)
* Yet another attempt to fix the race in gpg_git_test

* add some fail nows

* Need to set preparetestenv

* Ensure that http messages go to the correct server
2019-11-26 23:35:41 +08:00
zeripath
055f6d2296 Fix "data race" in testlogger (#9159)
* Fix data race in testlogger

* Update git_helper_for_declarative_test.go
2019-11-26 01:21:37 +02:00
zeripath
f5bd0884d2
Fix #9151 - smtp logger configuration sendTos should be an array (#9154)
* Fix #9151 - sendTos should be an array

* trimspace from the addresses
2019-11-25 13:38:57 +00:00
jaqra
802aa6d5f3 Add comment highlight when target from url (#9047)
* Add comment highlight css

* Add js to remove highlight on click outside

* Improve refresh page on click outside

* Use location.hash property to remove target

* Handle click ONLY clicked outside of 'targetted comment' (not other comment)

* Remove unnecessary checks and simply code

* Combine hash and setState to remove target path
2019-11-25 11:50:46 +00:00
John Olheiser
62bcb2b7f1 Add avatar and issue labels to template repositories (#9149)
* Add avatar and issue labels

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Fix redundant if-err

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2019-11-25 13:17:51 +08:00
Lauris BH
95c3dc856a
Fix max length check and limit in multiple repo forms (#9148)
* Fix input field max length for release, label and milestone forms

* Add max length for isseu and PR title
2019-11-25 01:06:23 +02:00
Benno
e8241bf55e update #9066 Always show Password field on link account sign in page (#9147) 2019-11-24 15:17:53 -05:00
David Svantesson
d0edb607a3 Fix what information is shown about user in API. (#9115)
* Fix what information is shown about user in API.

* Use Email directly, as KeepEmailPrivate is already handled.
2019-11-24 14:45:58 -05:00
John Olheiser
e84326aaec Add git hooks and webhooks to template repositories; move to services (#8926)
* Add git hooks and webhooks to template options

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Update models/repo.go

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>

* Add tooltip if the user can't edit git hooks

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Close repositories after copying git hooks

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Wording

Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>

* Restructure for services

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Return errors

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Move GenerateRepository to using a DBContext

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Wrap with models.WithTx

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Remove debug print

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Move if-error-delete-repo outside WithTx

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Return nil if no repo generated

Signed-off-by: jolheiser <john.olheiser@gmail.com>
2019-11-24 12:57:52 -05:00
guillep2k
f25fd5c8eb Fix team links in HTML rendering (#9127)
* Fix team links in HTML rendering

* Fix check and lint
2019-11-24 11:34:44 -05:00
zeripath
7523314ef8
Graceful: Allow graceful restart for fcgi (#9112)
* Graceful: Allow graceful restart for fcgi

My previous interpretation was incorrect - we do not handle sockets
being passed in over stdin

* Update web.go
2019-11-24 10:39:50 +00:00