Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
016c79ca
Commit
016c79ca
authored
May 23, 2019
by
sarahghp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add changes to match ee
parent
7b5cc7b4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
16 deletions
+18
-16
app/assets/javascripts/vue_merge_request_widget/components/deployment.vue
...cripts/vue_merge_request_widget/components/deployment.vue
+1
-1
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline_container.vue
...equest_widget/components/mr_widget_pipeline_container.vue
+1
-1
public/visual-review-toolbar.js
public/visual-review-toolbar.js
+16
-14
No files found.
app/assets/javascripts/vue_merge_request_widget/components/deployment.vue
View file @
016c79ca
...
@@ -49,7 +49,7 @@ export default {
...
@@ -49,7 +49,7 @@ export default {
required
:
false
,
required
:
false
,
default
:
()
=>
({
default
:
()
=>
({
sourceProjectId
:
''
,
sourceProjectId
:
''
,
issue
Id
:
''
,
mergeRequest
Id
:
''
,
appUrl
:
''
,
appUrl
:
''
,
}),
}),
},
},
...
...
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline_container.vue
View file @
016c79ca
...
@@ -48,7 +48,7 @@ export default {
...
@@ -48,7 +48,7 @@ export default {
visualReviewAppMeta
()
{
visualReviewAppMeta
()
{
return
{
return
{
appUrl
:
this
.
mr
.
appUrl
,
appUrl
:
this
.
mr
.
appUrl
,
issue
Id
:
this
.
mr
.
iid
,
mergeRequest
Id
:
this
.
mr
.
iid
,
sourceProjectId
:
this
.
mr
.
sourceProjectId
,
sourceProjectId
:
this
.
mr
.
sourceProjectId
,
};
};
},
},
...
...
public/visual-review-toolbar.js
View file @
016c79ca
...
@@ -374,12 +374,12 @@ function clearNote (inputId) {
...
@@ -374,12 +374,12 @@ function clearNote (inputId) {
}
}
}
}
function
confirmAndClear
(
discussion
Id
)
{
function
confirmAndClear
(
mergeRequest
Id
)
{
const
commentButton
=
document
.
getElementById
(
'
gitlab-comment-button
'
);
const
commentButton
=
document
.
getElementById
(
'
gitlab-comment-button
'
);
const
note
=
document
.
getElementById
(
'
gitlab-validation-note
'
);
const
note
=
document
.
getElementById
(
'
gitlab-validation-note
'
);
commentButton
.
innerText
=
'
Feedback sent
'
;
commentButton
.
innerText
=
'
Feedback sent
'
;
note
.
innerText
=
`Your comment was successfully posted to
issue #
${
discussion
Id
}
`
;
note
.
innerText
=
`Your comment was successfully posted to
merge request #
${
mergeRequest
Id
}
`
;
setTimeout
(
resetCommentButton
,
1000
);
setTimeout
(
resetCommentButton
,
1000
);
}
}
...
@@ -412,7 +412,7 @@ function getProjectDetails () {
...
@@ -412,7 +412,7 @@ function getProjectDetails () {
const
browser
=
getBrowserId
(
userAgent
);
const
browser
=
getBrowserId
(
userAgent
);
const
scriptEl
=
document
.
getElementById
(
'
review-app-toolbar-script
'
)
const
scriptEl
=
document
.
getElementById
(
'
review-app-toolbar-script
'
)
const
{
projectId
,
discussion
Id
,
mrUrl
}
=
scriptEl
.
dataset
;
const
{
projectId
,
mergeRequest
Id
,
mrUrl
}
=
scriptEl
.
dataset
;
return
{
return
{
href
,
href
,
...
@@ -422,7 +422,7 @@ function getProjectDetails () {
...
@@ -422,7 +422,7 @@ function getProjectDetails () {
innerWidth
,
innerWidth
,
innerHeight
,
innerHeight
,
projectId
,
projectId
,
discussion
Id
,
mergeRequest
Id
,
mrUrl
,
mrUrl
,
};
};
}
}
...
@@ -449,7 +449,7 @@ function postComment ({
...
@@ -449,7 +449,7 @@ function postComment ({
innerWidth
,
innerWidth
,
innerHeight
,
innerHeight
,
projectId
,
projectId
,
discussion
Id
,
mergeRequest
Id
,
mrUrl
,
mrUrl
,
})
{
})
{
// Clear any old errors
// Clear any old errors
...
@@ -466,18 +466,20 @@ function postComment ({
...
@@ -466,18 +466,20 @@ function postComment ({
}
}
const
detailText
=
`
const
detailText
=
`
<details>
\n
<details>
<summary>Metadata</summary>
<summary>Metadata</summary>
Posted from
${
href
}
|
${
platform
}
|
${
browser
}
|
${
innerWidth
}
x
${
innerHeight
}
.
Posted from
${
href
}
|
${
platform
}
|
${
browser
}
|
${
innerWidth
}
x
${
innerHeight
}
.
<br /><br />
<br /><br />
*User agent:
${
userAgent
}
*
<em>User agent:
${
userAgent
}
</em>
</details>
</details>
`
;
`
;
const
url
=
`
const
url
=
`
${
mrUrl
}
/api/v4/projects/
${
projectId
}
/
issues/
${
discussion
Id
}
/discussions`
;
${
mrUrl
}
/api/v4/projects/
${
projectId
}
/
merge_requests/
${
mergeRequest
Id
}
/discussions`
;
const
body
=
`
${
commentText
}${
detailText
}
`
;
const
body
=
`
${
commentText
}
${
detailText
}
`
;
fetch
(
url
,
{
fetch
(
url
,
{
method
:
'
POST
'
,
method
:
'
POST
'
,
...
@@ -489,7 +491,7 @@ function postComment ({
...
@@ -489,7 +491,7 @@ function postComment ({
})
})
.
then
((
response
)
=>
{
.
then
((
response
)
=>
{
if
(
response
.
ok
)
{
if
(
response
.
ok
)
{
confirmAndClear
(
discussion
Id
);
confirmAndClear
(
mergeRequest
Id
);
return
;
return
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment