aboutsummaryrefslogtreecommitdiffstats
path: root/models/notification.go
Commit message (Collapse)AuthorAgeFilesLines
* Improve notifications for WIP draft PR's (#14663)Jimmy Praet2021-06-231-7/+8
| | | | | | | | | | | | | | | | | | | * #14559 Reduce amount of email notifications for WIP draft PR's don't notify repo watchers of WIP draft PR's * #13190 Notification when WIP Pull Request is ready for review * Send email notification to repo watchers when WIP PR is created * Send ui notification to repo watchers when WIP PR is created * send specific email notification when PR is marked ready for review instead of reusing the CreatePullRequest action * Fix lint error Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Add subject-type filter to list notification API endpoints (#16177)65432021-06-161-2/+6
| | | Close #15886
* chore(models): rewrite code format. (#14754)Bo-Yi Wu2021-03-141-19/+17
| | | | | | | | | | | | | | | * chore: rewrite format. * chore: update format Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * chore: update format Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com> * chore: Adjacent parameters with the same type should be grouped together * chore: update format.
* Repository transfer has to be confirmed, if user can not create repo for new ↵65432021-03-011-8/+70
| | | | | | | owner (#14792) * make repo as "pending transfer" if on transfer start doer has no right to create repo in new destination * if new pending transfer ocured, create UI & Mail notifications
* Clarify the suffices and prefixes of setting.AppSubURL and setting.AppURL ↵zeripath2021-02-191-2/+2
| | | | | | | | (#12999) Also removes some unnecessary uses of fmt.Sprintf and adds documentation strings Signed-off-by: Andrew Thornton <art27@cantab.net>
* move notification APIFormat (#13783)65432020-12-021-60/+0
|
* API: NotificationSubject show Issue/Pull State (#12901)65432020-09-201-0/+2
|
* Simplify CheckUnitUser logic (#12854)赵智超2020-09-151-2/+10
| | | | | | | | if check one user's unit in different repos, it's not necessary to get user data every time. Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Extend Notifications API and return pinned notifications by default (#12164)zeripath2020-07-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Extend notifications API and return pinned notifications in notifications list Signed-off-by: Andrew Thornton <art27@cantab.net> * fix swagger Signed-off-by: Andrew Thornton <art27@cantab.net> * Fix swagger again Signed-off-by: Andrew Thornton <art27@cantab.net> * fix test Signed-off-by: Andrew Thornton <art27@cantab.net> * remove spurious debugs * as per @6543 Signed-off-by: Andrew Thornton <art27@cantab.net> * Update models/notification.go * as per @6543 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Add EventSource support (#11235)zeripath2020-05-071-0/+15
| | | | | | If the browser supports EventSource switch to use this instead of polling notifications. Signed-off-by: Andrew Thornton art27@cantab.net
* make pagination optional for notifications (#10714)65432020-04-211-1/+5
|
* add request review from specific reviewers feature in pull request (#10756)赵智超2020-04-061-34/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add request review feature in pull request add a way to notify specific reviewers to review like github , by add or delet a special type review . The acton is is similar to Assign , so many code reuse the function and items of Assignee, but the meaning and result is different. The Permission style is is similar to github, that only writer can add a review request from Reviewers, but the poster can recall and remove a review request after a reviwer has revied even if he don't have Write Premission. only manager , the poster and reviewer of a request review can remove it. The reviewers can be requested to review contain all readers for private repo , for public, contain all writers and watchers. The offical Review Request will block merge if Reject can block it. an other change: add ui otify for Assignees. Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: Lauris BH <lauris@nix.lv> Signed-off-by: a1012112796 <1012112796@qq.com> * new change * add placeholder string * do some changes follow #10238 to add review requests num on lists also change icon for review requests to eye Co-authored-by: Lauris BH <lauris@nix.lv>
* Upgrade golangci-lint to 1.24.0 (#10894)zeripath2020-03-301-1/+1
| | | | | | | * upgrade golangci-lint to 1.24.0 to allow go 1.14 compatibility * fix golangci-lint errors * make make golangci-lint work when out of go-path Signed-off-by: Andrew Thornton <art27@cantab.net>
* Protect against NPEs in notifications list (#10879)zeripath2020-03-291-19/+57
| | | | | | | | | | | | Unfortunately there appears to be potential race with notifications being set before the associated issue has been committed. This PR adds protection in to the notifications list to log any failures and remove these notifications from the display. References #10815 - and prevents the panic but does not completely fix this. Signed-off-by: Andrew Thornton <art27@cantab.net>
* inform participants on UI too (#10473)65432020-02-281-0/+7
| | | | | | | | * inform participants on UI too * ajust test * refactor getParticipantIDsByIssue
* Fix potential bugs (#10513)65432020-02-271-1/+1
| | | | | | | * use e if it is an option * potential nil so check err first * check err first * m == nil already checked
* Code Refactor of IssueWatch related things (#10401)65432020-02-261-36/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | * refactor * optimize * remove Iretating function LoadWatchUsers do not load Users into IW object and it is used only in api ... so move this logic * remove unessesary * Apply suggestions from code review Thx Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> * make Tests more robust * fix rebase * restart CI * CI no dont hit sqlites deadlock Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
* API add/generalize pagination (#9452)SpaWn2KiLl2020-01-241-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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 <6543@obermui.de> Co-Authored-By: zeripath <art27@cantab.net> * 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 <matti@mdranta.net> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: zeripath <art27@cantab.net>
* [API] add endpoint to check notifications [Extend #9488] (#9595)65432020-01-141-1/+16
| | | | | | | | | | | | | | * introduce GET /notifications/new * add TEST * use Sprintf instead of path.Join * Error more verbose * return number of notifications if unreaded exist * 200 http status for available notifications
* [API] Add notification endpoint (#9488)65432020-01-091-15/+203
| | | | | | | | | | | | | | | | | | | | | | | | | * [API] Add notification endpoints * add func GetNotifications(opts FindNotificationOptions) * add func (n *Notification) APIFormat() * add func (nl NotificationList) APIFormat() * add func (n *Notification) APIURL() * add func (nl NotificationList) APIFormat() * add LoadAttributes functions (loadRepo, loadIssue, loadComment, loadUser) * add func (c *Comment) APIURL() * add func (issue *Issue) GetLastComment() * add endpoint GET /notifications * add endpoint PUT /notifications * add endpoint GET /repos/{owner}/{repo}/notifications * add endpoint PUT /repos/{owner}/{repo}/notifications * add endpoint GET /notifications/threads/{id} * add endpoint PATCH /notifications/threads/{id} * Add TEST * code format * code format
* Fix notification page panic (#9337)jaqra2019-12-131-1/+1
|
* Improve notification (#8835)Lunny Xiao2019-11-121-15/+230
| | | | | | | | | | | | | | | | | | | | * Improve notifications * batch load user * Update notification only when read * Fix reorder * fix lint * fix test * fix lint * make function meaningful * fix comment
* Display ui time with customize time location (#7792)Lunny Xiao2019-08-151-3/+3
| | | | | | | | | | | | | | | | | | * 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
* Add golangci (#6418)kolaente2019-06-121-1/+4
|
* Fix sqlite lock (#5176)Lunny Xiao2018-10-251-2/+2
| | | | | | * fix sqlite lock * fix sqlite lock on getUnitType
* hide issues from org private repos w/o team assignment (#4034)David Schneiderbauer2018-06-211-0/+10
|
* Refactor struct's time to remove unnecessary memory usage (#3142)Lunny Xiao2017-12-111-27/+5
| | | | | | | | | | | | | | * refactor struct's time to remove unnecessary memory usage * use AsTimePtr simple code * fix tests * fix time compare * fix template on gpg * use AddDuration instead of Add
* Add 'mark all read' option to notifications (#3097)Sasha Varlamov2017-12-071-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add 'mark all read' option to notifications Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com> * Fix exported comment Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com> * Format method comments Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com> * Fix exported comment Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com> Format method comments Signed-off-by: Sasha Varlamov <sasha@sashavarlamov.com> Tests for reactions (#3083) * Unit tests for reactions * Fix import order Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv> Fix reaction possition when there is attachments (#3099) Refactor notifications swap function * Accept change to drop beforeupdate call * Update purge notifications error message for consistency * Drop unnecessary check for mark all as read button * Remove debugging comment
* Replace deprecated Id method with ID (#2655)Ethan Koenig2017-10-051-3/+3
|
* Consider issue_watchers while sending notificationsAndrey Nering2017-03-291-8/+32
|
* refactor notificationsForUser since xorm In support slice of customerize ↵Lunny Xiao2017-02-161-7/+4
| | | | type (#956)
* Unit tests and remove unused functions in models/notification (#796)Ethan Koenig2017-01-301-10/+0
| | | | | | * Unit tests and remove unused functions in models/notification * Read -> Unread
* Notifications: mark as read/unread and pin (#629)Andrey Nering2017-01-121-5/+52
| | | | | | | | | | * Use relative URLs * Notifications - Mark as read/unread * Feature of pinning a notification * On view issue, do not mark as read a pinned notification
* Merge pull request #539 from andreynering/notifications-step-2Andrey Nering2017-01-051-5/+11
|\ | | | | Notifications - Step 2
| * Add pagination for notificationsAndrey Nering2017-01-031-5/+11
| |
* | Fix typos in models/ (#576)Ethan Koenig2017-01-051-1/+1
|/
* Notification - Step 1 (#523)Andrey Nering2016-12-311-0/+249
* Notification - Step 1 * Add copyright headers * Cache issue and repository on notification model