Fix issue content history problems, improve UI (#17404)

* Improve: make diff result better, make the HTML element fit the full height in the content history diff dialog
* Bug fix: when edit the main issue, the poster is wrongly set to the issue poster
This commit is contained in:
wxiaoguang 2021-10-23 22:47:38 +08:00 committed by GitHub
parent 6c49517cbd
commit 943dc08722
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 8 deletions

View file

@ -804,7 +804,7 @@ func (issue *Issue) ChangeContent(doer *User, content string) (err error) {
return fmt.Errorf("UpdateIssueCols: %v", err)
}
if err = issues.SaveIssueContentHistory(db.GetEngine(ctx), issue.PosterID, issue.ID, 0,
if err = issues.SaveIssueContentHistory(db.GetEngine(ctx), doer.ID, issue.ID, 0,
timeutil.TimeStampNow(), issue.Content, false); err != nil {
return fmt.Errorf("SaveIssueContentHistory: %v", err)
}
@ -979,7 +979,7 @@ func newIssue(e db.Engine, doer *User, opts NewIssueOptions) (err error) {
return err
}
if err = issues.SaveIssueContentHistory(e, opts.Issue.PosterID, opts.Issue.ID, 0,
if err = issues.SaveIssueContentHistory(e, doer.ID, opts.Issue.ID, 0,
timeutil.TimeStampNow(), opts.Issue.Content, true); err != nil {
return err
}

View file

@ -357,6 +357,7 @@ func testInsertIssue(t *testing.T, title, content string, expectIndex int64) *Is
issue := Issue{
RepoID: repo.ID,
PosterID: user.ID,
Poster: user,
Title: title,
Content: content,
}