Require codereview to have content (#18156)
- Report a validityError when the codeReview have no comment. - Resolves #18151 - Refactor
This commit is contained in:
parent
948949f429
commit
496acbe9e5
3 changed files with 38 additions and 13 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue