diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 14:34:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 14:34:42 +0000 |
commit | 9f46488805e86b1bc341ea1620b866016c2ce5ed (patch) | |
tree | f9748c7e287041e37d6da49e0a29c9511dc34768 /app/assets/javascripts/notes.js | |
parent | dfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff) | |
download | gitlab-ce-9f46488805e86b1bc341ea1620b866016c2ce5ed.tar.gz |
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'app/assets/javascripts/notes.js')
-rw-r--r-- | app/assets/javascripts/notes.js | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index 9e2231922b7..6e695de447d 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -1,6 +1,6 @@ /* eslint-disable no-restricted-properties, babel/camelcase, no-unused-expressions, default-case, -consistent-return, no-alert, no-param-reassign, no-else-return, +consistent-return, no-alert, no-param-reassign, no-shadow, no-useless-escape, class-methods-use-this */ @@ -256,7 +256,7 @@ export default class Notes { discussionNoteForm = $textarea.closest('.js-discussion-note-form'); if (discussionNoteForm.length) { if ($textarea.val() !== '') { - if (!window.confirm(__('Are you sure you want to cancel creating this comment?'))) { + if (!window.confirm(__('Your comment will be discarded.'))) { return; } } @@ -268,7 +268,7 @@ export default class Notes { originalText = $textarea.closest('form').data('originalNote'); newText = $textarea.val(); if (originalText !== newText) { - if (!window.confirm(__('Are you sure you want to cancel editing this comment?'))) { + if (!window.confirm(__('Are you sure you want to discard this comment?'))) { return; } } @@ -964,11 +964,11 @@ export default class Notes { form .prepend( - `<div class="avatar-note-form-holder"><div class="content"><a href="${escape( + `<a href="${escape( gon.current_username, )}" class="user-avatar-link d-none d-sm-block"><img class="avatar s40" src="${encodeURI( - gon.current_user_avatar_url, - )}" alt="${escape(gon.current_user_fullname)}" /></a></div></div>`, + gon.current_user_avatar_url || gon.default_avatar_url, + )}" alt="${escape(gon.current_user_fullname)}" /></a>`, ) .append('</div>') .find('.js-close-discussion-note-form') @@ -1123,10 +1123,9 @@ export default class Notes { if (row.is('.js-temp-notes-holder')) { // remove temporary row for diff lines return row.remove(); - } else { - // only remove the form - return form.remove(); } + // only remove the form + return form.remove(); } cancelDiscussionForm(e) { @@ -1397,7 +1396,7 @@ export default class Notes { } /** - * Check if note does not exists on page + * Check if note does not exist on page */ static isNewNote(noteEntity, noteIds) { return $.inArray(noteEntity.id, noteIds) === -1; |