summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsarahghp <sarah.groff.palermo@gmail.com>2019-05-23 18:44:06 -0400
committersarahghp <sarah.groff.palermo@gmail.com>2019-05-23 18:44:06 -0400
commit016c79cad736df18b8777be53efd4e261341edb2 (patch)
tree4e8d9809b07d357d83592744a6ae6f48bb22421a
parent7b5cc7b47e1aa0221b9aac85049388192ade4ed4 (diff)
downloadgitlab-ce-016c79cad736df18b8777be53efd4e261341edb2.tar.gz
Add changes to match eevrt-mr-update-ce-backport
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/components/deployment.vue2
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline_container.vue2
-rw-r--r--public/visual-review-toolbar.js30
3 files changed, 18 insertions, 16 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/deployment.vue b/app/assets/javascripts/vue_merge_request_widget/components/deployment.vue
index 8f4cae8ae58..ad0464a3a98 100644
--- a/app/assets/javascripts/vue_merge_request_widget/components/deployment.vue
+++ b/app/assets/javascripts/vue_merge_request_widget/components/deployment.vue
@@ -49,7 +49,7 @@ export default {
required: false,
default: () => ({
sourceProjectId: '',
- issueId: '',
+ mergeRequestId: '',
appUrl: '',
}),
},
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline_container.vue b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline_container.vue
index b9f5f602117..0686409a785 100644
--- a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline_container.vue
+++ b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline_container.vue
@@ -48,7 +48,7 @@ export default {
visualReviewAppMeta() {
return {
appUrl: this.mr.appUrl,
- issueId: this.mr.iid,
+ mergeRequestId: this.mr.iid,
sourceProjectId: this.mr.sourceProjectId,
};
},
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;
}