Commit Graph
13 Commits
Author SHA1 Message Date
Bo-Yi WuandGitHub 167b0f46ef chore(models): rewrite code format. (#14754)
* chore: rewrite format.

* chore: update format

Signed-off-by: Bo-Yi Wu <[email protected]>

* chore: update format

Signed-off-by: Bo-Yi Wu <[email protected]>

* chore: Adjacent parameters with the same type should be grouped together

* chore: update format.
2021-03-14 19:52:12 +01:00
cf9d471631 Change topic name size from 25 to 50 (#14150)
* Change topic name size from 25 to 50

* recreateTable requires full bean definition

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: zeripath <[email protected]>
2020-12-26 23:28:47 +00:00
4099e4f1b6 Ensure topics added using the API are added to the repository (#13285)
* Ensure topics added using the API are added to the repository

Fix #12426

Signed-off-by: Andrew Thornton <[email protected]>
Co-authored-by: Lunny Xiao <[email protected]>
2020-10-24 15:11:30 +01:00
zeripathandGitHub 47289344e2 Add Primary Key to Topic and RepoTopic (#12639)
Add a primary key to Topic and RepoTopic tables

Fix #8920

Signed-off-by: Andrew Thornton <[email protected]>
2020-09-10 20:45:01 +01:00
Lauris BHandGitHub b3d8e2d4f7 Update topics repo count when deleting repository (#10051)
* Update topics repo count when deleting repository

* Add migration to fix incorrect data

* Optimize to use single update to recalculate values
2020-01-31 08:57:19 +02:00
1f01f53c53 API add/generalize pagination (#9452)
* paginate results

* fixed deadlock

* prevented breaking change

* updated swagger

* go fmt

* fixed find topic

* go mod tidy

* go mod vendor with go1.13.5

* fixed repo find topics

* fixed unit test

* added Limit method to Engine struct; use engine variable when provided; fixed gitignore

* use ItemsPerPage for default pagesize; fix GetWatchers, getOrgUsersByOrgID and GetStargazers; fix GetAllCommits headers; reverted some changed behaviors

* set Page value on Home route

* improved memory allocations

* fixed response headers

* removed logfiles

* fixed import order

* import order

* improved swagger

* added function to get models.ListOptions from context

* removed pagesize diff on unit test

* fixed imports

* removed unnecessary struct field

* fixed go fmt

* scoped PR

* code improvements

* code improvements

* go mod tidy

* fixed import order

* fixed commit statuses session

* fixed files headers

* fixed headers; added pagination for notifications

* go mod tidy

* go fmt

* removed Private from user search options; added setting.UI.IssuePagingNum as default valeu on repo's issues list

* Apply suggestions from code review

Co-Authored-By: 6543 <[email protected]>
Co-Authored-By: zeripath <[email protected]>

* fixed build error

* CI.restart()

* fixed merge conflicts resolve

* fixed conflicts resolve

* improved FindTrackedTimesOptions.ToOptions() method

* added backwards compatibility on ListReleases request; fixed issue tracked time ToSession

* fixed build error; fixed swagger template

* fixed swagger template

* fixed ListReleases backwards compatibility

* added page to user search route

Co-authored-by: techknowlogick <[email protected]>
Co-authored-by: 6543 <[email protected]>
Co-authored-by: zeripath <[email protected]>
2020-01-24 14:00:29 -05:00
David SvantessonandLunny Xiao 1f951cdeba Add API endpoint for accessing repo topics (#7963)
* Create API endpoints for repo topics.

Signed-off-by: David Svantesson <[email protected]>

* Generate swagger

Signed-off-by: David Svantesson <[email protected]>

* Add documentation to functions

Signed-off-by: David Svantesson <[email protected]>

* Grammar fix

Signed-off-by: David Svantesson <[email protected]>

* Fix function comment

Signed-off-by: David Svantesson <[email protected]>

* Can't use FindTopics when looking for a single repo topic, as it doesnt use exact match

Signed-off-by: David Svantesson <[email protected]>

* Add PUT ​/repos​/{owner}​/{repo}​/topics and remove GET ​/repos​/{owner}​/{repo}​/topics

* Ignore if topic is sent twice in same request, refactoring.

Signed-off-by: David Svantesson <[email protected]>

* Fix topic dropdown with api changes.

Signed-off-by: David Svantesson <[email protected]>

* Style fix

Signed-off-by: David Svantesson <[email protected]>

* Update API documentation

Signed-off-by: David Svantesson <[email protected]>

* Better way to handle duplicate topics in slice

Signed-off-by: David Svantesson <[email protected]>

* Make response element TopicName an array of strings, instead of using an array of TopicName

Signed-off-by: David Svantesson <[email protected]>

* Add test cases for API Repo Topics.

Signed-off-by: David Svantesson <[email protected]>

* Fix format of tests

Signed-off-by: David Svantesson <[email protected]>

* Fix comments

Signed-off-by: David Svantesson <[email protected]>

* Fix unit tests after adding some more topics to the test fixture.

Signed-off-by: David Svantesson <[email protected]>

* Update models/topic.go

Limit multiple if else if ...

Co-Authored-By: Antoine GIRARD <[email protected]>

* Engine as first parameter in function

Co-Authored-By: Antoine GIRARD <[email protected]>

* Replace magic numbers with http status code constants.

Signed-off-by: David Svantesson <[email protected]>

* Fix variable scope

Signed-off-by: David Svantesson <[email protected]>

* Test one read with login and one with token

Signed-off-by: David Svantesson <[email protected]>

* Add some more tests

Signed-off-by: David Svantesson <[email protected]>

* Apply suggestions from code review

Use empty struct for efficiency

Co-Authored-By: Lauris BH <[email protected]>

* Add test case to check access for user with write access

Signed-off-by: David Svantesson <[email protected]>

* Fix access, repo admin required to change topics

Signed-off-by: David Svantesson <[email protected]>

* Correct first test to be without token

Signed-off-by: David Svantesson <[email protected]>

* Any repo reader should be able to access topics.

* No need for string pointer

Signed-off-by: David Svantesson <[email protected]>
2019-09-03 23:46:24 +08:00
Lunny XiaoandGitHub 85202d4784 Display ui time with customize time location (#7792)
* display ui time with customize time location

* fix lint

* rename UILocation to DefaultUILocation

* move time related functions to modules/timeutil

* fix tests

* fix tests

* fix build

* fix swagger
2019-08-15 22:46:21 +08:00
Lunny XiaoandLauris BH aa7c34cf86 Fix error log when loading issues caused by a xorm bug (#7271)
* fix error log when loading issues caused by a xorm bug

* upgrade packages

* fix fmt

* fix Consistency

* fix tests
2019-06-23 18:22:43 +03:00
Lunny XiaoandLauris BH 4b4453cb92 fix topic name length on database (#5493) 2018-12-08 14:27:30 +02:00
Alexey Terentyevandtechknowlogick 91ff87c0e5 Fixed violation of the unique constraint for v68 migration (#4297) 2018-06-27 01:23:10 -04:00
Alexey TerentyevandLunny Xiao 46d19c4676 Fix topics addition (Another solution) (#4031) (#4258)
* Added topics validation, fixed repo topics duplication (#4031)

Signed-off-by: Alexey Terentyev <[email protected]>

* Added tests

Signed-off-by: Alexey Terentyev <[email protected]>

* Fixed fmt

Signed-off-by: Alexey Terentyev <[email protected]>

* Added comments to exported functions

Signed-off-by: Alexey Terentyev <[email protected]>

* Deleted RemoveDuplicateTopics function

Signed-off-by: Alexey Terentyev <[email protected]>

* Fixed messages

Signed-off-by: Alexey Terentyev <[email protected]>

* Added migration

Signed-off-by: Alexey Terentyev <[email protected]>

* fmt migration file

Signed-off-by: Alexey Terentyev <[email protected]>

* fixed lint

Signed-off-by: Alexey Terentyev <[email protected]>

* Added Copyright

Signed-off-by: Alexey Terentyev <[email protected]>

* Added query solution for duplicates

Signed-off-by: Alexey Terentyev <[email protected]>

* Fixed migration query

Signed-off-by: Alexey Terentyev <[email protected]>

* Changed RegExp. Fixed migration

Signed-off-by: Alexey Terentyev <[email protected]>

* fmt migration file

Signed-off-by: Alexey Terentyev <[email protected]>

* Fixed test for changed regexp

Signed-off-by: Alexey Terentyev <[email protected]>

* Removed validation log messages

Signed-off-by: Alexey Terentyev <[email protected]>

* Renamed migration file

Signed-off-by: Alexey Terentyev <[email protected]>

* Renamed validate function

Signed-off-by: Alexey Terentyev <[email protected]>
2018-06-21 17:09:46 +08:00
Lunny XiaoandGitHub bec69f702b Add topic support (#3711)
* add topic models and unit tests

* fix comments

* fix comment

* add the UI to show or add topics for a repo

* show topics on repositories list

* fix test

* don't show manage topics link when no permission

* use green basic as topic label

* fix topic label color

* remove trace content

* remove debug function
2018-04-11 10:51:44 +08:00