mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Require codereview to have content (#18156)
- Report a validityError when the codeReview have no comment. - Resolves #18151 - Refactor
This commit is contained in:
		@@ -1,5 +1,6 @@
 | 
			
		||||
import {initCompReactionSelector} from './comp/ReactionSelector.js';
 | 
			
		||||
import {initRepoIssueContentHistory} from './repo-issue-content.js';
 | 
			
		||||
import {validateTextareaNonEmpty} from './comp/CommentEasyMDE.js';
 | 
			
		||||
const {csrfToken} = window.config;
 | 
			
		||||
 | 
			
		||||
export function initRepoDiffReviewButton() {
 | 
			
		||||
@@ -23,7 +24,13 @@ export function initRepoDiffFileViewToggle() {
 | 
			
		||||
export function initRepoDiffConversationForm() {
 | 
			
		||||
  $(document).on('submit', '.conversation-holder form', async (e) => {
 | 
			
		||||
    e.preventDefault();
 | 
			
		||||
 | 
			
		||||
    const form = $(e.target);
 | 
			
		||||
    const $textArea = form.find('textarea');
 | 
			
		||||
    if (!validateTextareaNonEmpty(form, $textArea)) {
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const newConversationHolder = $(await $.post(form.attr('action'), form.serialize()));
 | 
			
		||||
    const {path, side, idx} = newConversationHolder.data();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user