diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2019-05-27 14:49:47 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2019-05-27 14:49:47 +0200 |
commit | a66cbb6e733f90ce42c53fdc605678ebcbaf79e7 (patch) | |
tree | d65fa773693c412a593da53d12a2369bbddf7449 /public | |
parent | fe225fd9289acb8d50157703849363de39046bca (diff) | |
parent | 2d980fadb8fe6c54ebcbb56130c88aae2832c9c6 (diff) | |
download | gitlab-ce-a66cbb6e733f90ce42c53fdc605678ebcbaf79e7.tar.gz |
Merge commit '2d980fadb8fe6c54ebcbb56130c88aae2832c9c6' into backstage/gb/improve-jobs-controller-performancebackstage/gb/improve-jobs-controller-performance
* commit '2d980fadb8fe6c54ebcbb56130c88aae2832c9c6': (51 commits)
Diffstat (limited to 'public')
-rw-r--r-- | public/visual-review-toolbar.js | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/public/visual-review-toolbar.js b/public/visual-review-toolbar.js index dc21197bda9..6a0fdb29cc2 100644 --- a/public/visual-review-toolbar.js +++ b/public/visual-review-toolbar.js @@ -374,12 +374,12 @@ function clearNote (inputId) { } } -function confirmAndClear (discussionId) { +function confirmAndClear (mergeRequestId) { const commentButton = document.getElementById('gitlab-comment-button'); const note = document.getElementById('gitlab-validation-note'); commentButton.innerText = 'Feedback sent'; - note.innerText = `Your comment was successfully posted to issue #${discussionId}`; + note.innerText = `Your comment was successfully posted to merge request #${mergeRequestId}`; setTimeout(resetCommentButton, 1000); } @@ -412,7 +412,7 @@ function getProjectDetails () { const browser = getBrowserId(userAgent); const scriptEl = document.getElementById('review-app-toolbar-script') - const { projectId, discussionId, mrUrl } = scriptEl.dataset; + const { projectId, mergeRequestId, mrUrl } = scriptEl.dataset; return { href, @@ -422,7 +422,7 @@ function getProjectDetails () { innerWidth, innerHeight, projectId, - discussionId, + mergeRequestId, mrUrl, }; } @@ -449,7 +449,7 @@ function postComment ({ innerWidth, innerHeight, projectId, - discussionId, + mergeRequestId, mrUrl, }) { // Clear any old errors @@ -466,18 +466,20 @@ function postComment ({ } const detailText = ` - <details> - <summary>Metadata</summary> - Posted from ${href} | ${platform} | ${browser} | ${innerWidth} x ${innerHeight}. - <br /><br /> - *User agent: ${userAgent}* - </details> + \n +<details> + <summary>Metadata</summary> + Posted from ${href} | ${platform} | ${browser} | ${innerWidth} x ${innerHeight}. + <br /><br /> + <em>User agent: ${userAgent}</em> +</details> `; const url = ` - ${mrUrl}/api/v4/projects/${projectId}/issues/${discussionId}/discussions`; + ${mrUrl}/api/v4/projects/${projectId}/merge_requests/${mergeRequestId}/discussions`; - const body = `${commentText}${detailText}`; + + const body = `${commentText} ${detailText}`; fetch(url, { method: 'POST', @@ -489,7 +491,7 @@ function postComment ({ }) .then((response) => { if (response.ok) { - confirmAndClear(discussionId); + confirmAndClear(mergeRequestId); return; } |