mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 02:46:04 +01:00 
			
		
		
		
	Improvements to content history (#17746)
* Improvements to content history * initialize content history when making an edit to an old item created before the introduction of content history * show edit history for code comments on pull request files tab * Fix a flaw in keepLimitedContentHistory Fix a flaw in keepLimitedContentHistory, the first and the last should never be deleted * Remove obsolete eager initialization of content history
This commit is contained in:
		| @@ -106,8 +106,11 @@ function showContentHistoryMenu(issueBaseUrl, $item, commentId) { | ||||
|  | ||||
| export function initRepoIssueContentHistory() { | ||||
|   const issueIndex = $('#issueIndex').val(); | ||||
|   const $itemIssue = $('.timeline-item.comment.first'); | ||||
|   if (!issueIndex || !$itemIssue.length) return; | ||||
|   if (!issueIndex) return; | ||||
|  | ||||
|   const $itemIssue = $('.repository.issue .timeline-item.comment.first'); // issue(PR) main content | ||||
|   const $comments = $('.repository.issue .comment-list .comment'); // includes: issue(PR) comments, code rerview comments | ||||
|   if (!$itemIssue.length && !$comments.length) return; | ||||
|  | ||||
|   const repoLink = $('#repolink').val(); | ||||
|   const issueBaseUrl = `${appSubUrl}/${repoLink}/issues/${issueIndex}`; | ||||
| @@ -123,7 +126,7 @@ export function initRepoIssueContentHistory() { | ||||
|     i18nTextDeleteFromHistoryConfirm = resp.i18n.textDeleteFromHistoryConfirm; | ||||
|     i18nTextOptions = resp.i18n.textOptions; | ||||
|  | ||||
|     if (resp.editedHistoryCountMap[0]) { | ||||
|     if (resp.editedHistoryCountMap[0] && $itemIssue.length) { | ||||
|       showContentHistoryMenu(issueBaseUrl, $itemIssue, '0'); | ||||
|     } | ||||
|     for (const [commentId, _editedCount] of Object.entries(resp.editedHistoryCountMap)) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user