Add action feed for new release (#12324)

* Add action feed for new release

Signed-off-by: a1012112796 <1012112796@qq.com>

* fix lint

* Apply suggestions from code review

* Add ReleaseID to the action table
* Remove error message
* Fold the attachments download list

* remove attchment download list

* simplify code

* fix create release from existing tag

* simplify ui

* translation change

* fix test

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
赵智超 2020-07-30 03:20:54 +08:00 committed by GitHub
parent 2fd78c151e
commit 1f12dc8e88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 49 additions and 15 deletions

View file

@ -314,3 +314,22 @@ func (a *actionNotifier) NotifySyncDeleteRef(doer *models.User, repo *models.Rep
log.Error("notifyWatchers: %v", err)
}
}
func (a *actionNotifier) NotifyNewRelease(rel *models.Release) {
if err := rel.LoadAttributes(); err != nil {
log.Error("NotifyNewRelease: %v", err)
return
}
if err := models.NotifyWatchers(&models.Action{
ActUserID: rel.PublisherID,
ActUser: rel.Publisher,
OpType: models.ActionPublishRelease,
RepoID: rel.RepoID,
Repo: rel.Repo,
IsPrivate: rel.Repo.IsPrivate,
Content: rel.Title,
RefName: rel.TagName,
}); err != nil {
log.Error("notifyWatchers: %v", err)
}
}

View file

@ -640,6 +640,8 @@ func ActionIcon(opType models.ActionType) string {
return "check"
case models.ActionRejectPullRequest:
return "diff"
case models.ActionPublishRelease:
return "tag"
default:
return "question"
}