You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
forgejo/web_src/js/features
JakobDev aaa1094663
Add the ability to pin Issues (#24406)
This adds the ability to pin important Issues and Pull Requests. You can
also move pinned Issues around to change their Position. Resolves #2175.

## 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>
1 year ago
..
admin Introduce eslint-plugin-no-jquery/no-event-shorthand (#24198) 1 year ago
comp Support markdown editor for issue template (#24400) 1 year ago
captcha.js Add new captcha: cloudflare turnstile (#22369) 2 years ago
citation.js Introduce eslint-plugin-no-jquery/no-event-shorthand (#24198) 1 year ago
clipboard.js Use clippie module to copy to clipboard (#23801) 1 year ago
codeeditor.js Improve "goto issue by number" button (#24577) 1 year ago
colorpicker.js JS refactors (#22227) 2 years ago
common-global.js Support Copy Link for video attachments (#24833) 1 year ago
common-issue-list.js Improve "goto issue by number" button (#24577) 1 year ago
common-issue-list.test.js Improve "goto issue by number" button (#24577) 1 year ago
common-organization.js Fix Org edit page bugs: renaming detection, maxlength (#24161) 1 year ago
contextpopup.js Introduce GitHub markdown editor, keep EasyMDE as fallback (#23876) 1 year ago
copycontent.js Add two eslint plugins (#24776) 1 year ago
dropzone.js JS refactors (#22227) 2 years ago
emoji.js JS refactors (#22227) 2 years ago
eventsource.sharedworker.js Fix the JS error "EventSource is not defined" caused by some non-standard browsers (#20584) 2 years ago
file-fold.js Scroll collapsed file into view (#23702) 1 year ago
heatmap.js Localize activity heatmap (except tooltip) (#24131) 1 year ago
imagediff.js Fix various ImageDiff/SVG bugs (#23312) 1 year ago
install.js Fix various bugs for "install" page (#23194) 1 year ago
notification.js Rework notifications list (#24812) 1 year ago
org-team.js Add status indicator on main home screen for each repo (#24638) 1 year ago
pull-view-file.js Improve accessibility when (re-)viewing files (#24817) 1 year ago
repo-branch.js Display warning when user try to rename default branch (#24512) 1 year ago
repo-code.js Improve accessibility when (re-)viewing files (#24817) 1 year ago
repo-code.test.js Ignore line anchor links with leading zeroes (#21728) 2 years ago
repo-commit.js Fix hidden commit status on multiple checks (#22889) 1 year ago
repo-common.js Introduce eslint-plugin-no-jquery/no-event-shorthand (#24198) 1 year ago
repo-diff-filetree.js JS refactors (#22227) 2 years ago
repo-diff.js Improve accessibility when (re-)viewing files (#24817) 1 year ago
repo-editor.js Add popup to hashed comments/pull requests/issues in file editing/adding preview tab (#24040) 1 year ago
repo-findfile.js Refactor branch/tag selector to Vue SFC (#23421) 1 year ago
repo-findfile.test.js Refactor branch/tag selector to Vue SFC (#23421) 1 year ago
repo-graph.js Refactor hiding-methods, remove jQuery show/hide, remove `.hide` class, remove inline style=display:none (#22950) 1 year ago
repo-home.js Sort repo topic labels by name (#24123) 1 year ago
repo-issue-content.js Refactor hiding-methods, remove jQuery show/hide, remove `.hide` class, remove inline style=display:none (#22950) 1 year ago
repo-issue-list.js Add the ability to pin Issues (#24406) 1 year ago
repo-issue-pr-form.js JS refactors (#22227) 2 years ago
repo-issue.js Improve accessibility when (re-)viewing files (#24817) 1 year ago
repo-legacy.js Support markdown editor for issue template (#24400) 1 year ago
repo-migrate.js Make repo migration cancelable and fix various bugs (#24605) 1 year ago
repo-migration.js Refactor hiding-methods, remove jQuery show/hide, remove `.hide` class, remove inline style=display:none (#22950) 1 year ago
repo-projects.js Add two eslint plugins (#24776) 1 year ago
repo-release.js Update JS dependencies, add new eslint rules (#24597) 1 year ago
repo-settings.js Support for status check pattern (#24633) 1 year ago
repo-template.js Add status indicator on main home screen for each repo (#24638) 1 year ago
repo-unicode-escape.js Improve accessibility when (re-)viewing files (#24817) 1 year ago
repo-wiki.js Fix EasyMDE toolbar (#24489) 1 year ago
serviceworker.js JS refactors (#22227) 2 years ago
sshkey-helper.js Use explicit jQuery import, remove unused eslint globals (#18435) 3 years ago
stopwatch.js Move helpers to be prefixed with `gt-` (#22879) 1 year ago
tablesort.js JS refactors (#22227) 2 years ago
tribute.js Introduce GitHub markdown editor, keep EasyMDE as fallback (#23876) 1 year ago
user-auth-webauthn.js Refactor hiding-methods, remove jQuery show/hide, remove `.hide` class, remove inline style=display:none (#22950) 1 year ago
user-auth.js Fix OAuth loading state (#24788) 1 year ago
user-settings.js Refactor hiding-methods, remove jQuery show/hide, remove `.hide` class, remove inline style=display:none (#22950) 1 year ago