|
|
|
@ -82,10 +82,6 @@ const (
|
|
|
|
|
CommentTypeAddDependency |
|
|
|
|
// 20 Dependency removed
|
|
|
|
|
CommentTypeRemoveDependency |
|
|
|
|
// 19 Parent added
|
|
|
|
|
CommentTypeAddParent |
|
|
|
|
// 20 Parent removed
|
|
|
|
|
CommentTypeRemoveParent |
|
|
|
|
// 21 Comment a line of code
|
|
|
|
|
CommentTypeCode |
|
|
|
|
// 22 Reviews a pull request by giving general feedback
|
|
|
|
@ -112,6 +108,10 @@ const (
|
|
|
|
|
CommentTypeDismissReview |
|
|
|
|
// 33 Change issue ref
|
|
|
|
|
CommentTypeChangeIssueRef |
|
|
|
|
// 34 Parent added
|
|
|
|
|
CommentTypeAddParent |
|
|
|
|
// 35 Parent removed
|
|
|
|
|
CommentTypeRemoveParent |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
var commentStrings = []string{ |
|
|
|
@ -149,6 +149,8 @@ var commentStrings = []string{
|
|
|
|
|
"project_board", |
|
|
|
|
"dismiss_review", |
|
|
|
|
"change_issue_ref", |
|
|
|
|
"add_parent", |
|
|
|
|
"remove_parent", |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (t CommentType) String() string { |
|
|
|
@ -228,6 +230,8 @@ type Comment struct {
|
|
|
|
|
NewRef string |
|
|
|
|
DependentIssueID int64 |
|
|
|
|
DependentIssue *Issue `xorm:"-"` |
|
|
|
|
ParentIssueID int64 |
|
|
|
|
ParentIssue *Issue `xorm:"-"` |
|
|
|
|
|
|
|
|
|
CommitID int64 |
|
|
|
|
Line int64 // - previous line / + proposed line
|
|
|
|
@ -623,6 +627,15 @@ func (c *Comment) LoadDepIssueDetails() (err error) {
|
|
|
|
|
return err |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// LoadParentIssueDetails loads Parent Issue Details
|
|
|
|
|
func (c *Comment) LoadParentIssueDetails() (err error) { |
|
|
|
|
if c.ParentIssueID <= 0 || c.ParentIssue != nil { |
|
|
|
|
return nil |
|
|
|
|
} |
|
|
|
|
c.ParentIssue, err = getIssueByID(db.GetEngine(db.DefaultContext), c.ParentIssueID) |
|
|
|
|
return err |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// LoadTime loads the associated time for a CommentTypeAddTimeManual
|
|
|
|
|
func (c *Comment) LoadTime() error { |
|
|
|
|
if c.Time != nil || c.TimeID == 0 { |
|
|
|
@ -793,6 +806,7 @@ func createComment(ctx context.Context, opts *CreateCommentOptions) (_ *Comment,
|
|
|
|
|
OldRef: opts.OldRef, |
|
|
|
|
NewRef: opts.NewRef, |
|
|
|
|
DependentIssueID: opts.DependentIssueID, |
|
|
|
|
ParentIssueID: opts.ParentIssueID, |
|
|
|
|
TreePath: opts.TreePath, |
|
|
|
|
ReviewID: opts.ReviewID, |
|
|
|
|
Patch: opts.Patch, |
|
|
|
|