0
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-02-18 21:40:08 +01:00
forgejo/models
JakobDev aaa1094663
Add the ability to pin Issues ()
This adds the ability to pin important Issues and Pull Requests. You can
also move pinned Issues around to change their Position. Resolves .

## Screenshots

![grafik](https://user-images.githubusercontent.com/15185051/235123207-0aa39869-bb48-45c3-abe2-ba1e836046ec.png)

![grafik](https://user-images.githubusercontent.com/15185051/235123297-152a16ea-a857-451d-9a42-61f2cd54dd75.png)

![grafik](https://user-images.githubusercontent.com/15185051/235640782-cbfe25ec-6254-479a-a3de-133e585d7a2d.png)

The Design was mostly copied from the Projects Board.

## Implementation
This uses a new `pin_order` Column in the `issue` table. If the value is
set to 0, the Issue is not pinned. If it's set to a bigger value, the
value is the Position. 1 means it's the first pinned Issue, 2 means it's
the second one etc. This is dived into Issues and Pull requests for each
Repo.

## TODO
- [x] You can currently pin as many Issues as you want. Maybe we should
add a Limit, which is configurable. GitHub uses 3, but I prefer 6, as
this is better for bigger Projects, but I'm open for suggestions.
- [x] Pin and Unpin events need to be added to the Issue history.
- [x] Tests
- [x] Migration

**The feature itself is currently fully working, so tester who may find
weird edge cases are very welcome!**

---------

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
2023-05-25 15:17:19 +02:00
..
actions Implement actions artifacts () 2023-05-19 21:37:57 +08:00
activities Fix commits pushed with deploy keys not shown in dashboard () 2023-05-10 04:14:58 +00:00
admin Make repo migration cancelable and fix various bugs () 2023-05-11 08:25:46 +00:00
asymkey Merge setting.InitXXX into one function with options () 2023-05-04 11:55:35 +08:00
auth Fix 500 error if there is a name conflict when edit authentication source () 2023-03-31 22:32:18 +08:00
avatars Avoid warning for system setting when start up () 2023-02-24 18:23:13 +08:00
db Rewrite logger system () 2023-05-21 22:35:11 +00:00
dbfs Merge setting.InitXXX into one function with options () 2023-05-04 11:55:35 +08:00
fixtures Implement actions artifacts () 2023-05-19 21:37:57 +08:00
git Fix missed table name on iterate lfs meta objects () 2023-05-17 23:51:22 +08:00
issues Add the ability to pin Issues () 2023-05-25 15:17:19 +02:00
migrations Add the ability to pin Issues () 2023-05-25 15:17:19 +02:00
organization Add missing test case and fix typo in tests () 2023-05-24 21:06:04 +02:00
packages Add CRAN package registry () 2023-05-22 10:57:49 +08:00
perm Rewrite logger system () 2023-05-21 22:35:11 +00:00
project Improve GetBoards and getDefaultBoard () 2023-04-09 22:07:23 +08:00
pull refactor some functions to support ctx as first parameter () 2022-12-03 10:48:26 +08:00
repo Rewrite logger system () 2023-05-21 22:35:11 +00:00
secret Respect original content when creating secrets () 2023-05-16 14:49:40 +08:00
shared/types Display owner of a runner as a tooltip instead of static text () 2023-05-12 08:43:27 +00:00
system Avoid warning for system setting when start up () 2023-02-24 18:23:13 +08:00
unit Rewrite logger system () 2023-05-21 22:35:11 +00:00
unittest Implement actions artifacts () 2023-05-19 21:37:57 +08:00
user New webhook trigger for receiving Pull Request review requests () 2023-05-24 22:06:27 -04:00
webhook New webhook trigger for receiving Pull Request review requests () 2023-05-24 22:06:27 -04:00
error.go Implement FSFE REUSE for golang files () 2022-11-27 18:20:29 +00:00
fixture_generation.go Implement FSFE REUSE for golang files () 2022-11-27 18:20:29 +00:00
fixture_test.go Implement FSFE REUSE for golang files () 2022-11-27 18:20:29 +00:00
main_test.go Merge setting.InitXXX into one function with options () 2023-05-04 11:55:35 +08:00
migrate.go Check primary keys for all tables and drop ForeignReference () 2022-12-23 19:35:43 +08:00
migrate_test.go Check primary keys for all tables and drop ForeignReference () 2022-12-23 19:35:43 +08:00
org.go refactor some functions to support ctx as first parameter () 2022-12-03 10:48:26 +08:00
org_team.go Remove org users who belong to no teams () 2023-04-24 15:52:38 -04:00
org_team_test.go Implement FSFE REUSE for golang files () 2022-11-27 18:20:29 +00:00
org_test.go Implement FSFE REUSE for golang files () 2022-11-27 18:20:29 +00:00
repo.go Implement actions artifacts () 2023-05-19 21:37:57 +08:00
repo_collaboration.go refactor some functions to support ctx as first parameter () 2022-12-03 10:48:26 +08:00
repo_collaboration_test.go Rename repo.GetOwner to repo.LoadOwner () 2023-02-18 20:11:03 +08:00
repo_test.go Implement FSFE REUSE for golang files () 2022-11-27 18:20:29 +00:00
repo_transfer.go Fix unclear IsRepositoryExist logic () 2023-04-28 14:14:26 -04:00
repo_transfer_test.go Rename almost all Ctx functions () 2022-12-10 10:46:31 +08:00