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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
9b9cbb4a
Commit
9b9cbb4a
authored
Jul 13, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed test to correctly text relative URLs
doesnt add query param if source & target projects match
parent
246ac064
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
13 deletions
+32
-13
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue
.../vue_merge_request_widget/components/mr_widget_header.vue
+5
-6
spec/javascripts/vue_mr_widget/components/mr_widget_header_spec.js
...scripts/vue_mr_widget/components/mr_widget_header_spec.js
+27
-7
No files found.
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue
View file @
9b9cbb4a
<
script
>
<
script
>
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
tooltip
from
'
~/vue_shared/directives/tooltip
'
;
import
{
n__
}
from
'
~/locale
'
;
import
{
n__
}
from
'
~/locale
'
;
import
{
webIDEUrl
}
from
'
~/lib/utils/url_utility
'
;
import
{
mergeUrlParams
,
webIDEUrl
}
from
'
~/lib/utils/url_utility
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
clipboardButton
from
'
~/vue_shared/components/clipboard_button.vue
'
;
import
clipboardButton
from
'
~/vue_shared/components/clipboard_button.vue
'
;
...
@@ -43,11 +43,10 @@ export default {
...
@@ -43,11 +43,10 @@ export default {
return
this
.
isBranchTitleLong
(
this
.
mr
.
targetBranch
);
return
this
.
isBranchTitleLong
(
this
.
mr
.
targetBranch
);
},
},
webIdePath
()
{
webIdePath
()
{
return
webIDEUrl
(
return
mergeUrlParams
({
`/
${
this
.
mr
.
sourceProjectFullPath
}
/merge_requests/
${
this
.
mr
.
iid
}
?target_project=
${
target_project
:
this
.
mr
.
sourceProjectFullPath
!==
this
.
mr
.
targetProjectFullPath
?
this
.
mr
.
targetProjectFullPath
this
.
mr
.
targetProjectFullPath
:
''
,
}
`
,
},
webIDEUrl
(
`/
${
this
.
mr
.
sourceProjectFullPath
}
/merge_requests/
${
this
.
mr
.
iid
}
`
));
);
},
},
},
},
methods
:
{
methods
:
{
...
...
spec/javascripts/vue_mr_widget/components/mr_widget_header_spec.js
View file @
9b9cbb4a
...
@@ -150,19 +150,39 @@ describe('MRWidgetHeader', () => {
...
@@ -150,19 +150,39 @@ describe('MRWidgetHeader', () => {
expect
(
button
.
textContent
.
trim
()).
toEqual
(
'
Open in Web IDE
'
);
expect
(
button
.
textContent
.
trim
()).
toEqual
(
'
Open in Web IDE
'
);
expect
(
button
.
getAttribute
(
'
href
'
)).
toEqual
(
expect
(
button
.
getAttribute
(
'
href
'
)).
toEqual
(
'
/-/ide/project/root/gitlab-ce/merge_requests/1?target_project=gitlab-org
/
gitlab-ce
'
,
'
/-/ide/project/root/gitlab-ce/merge_requests/1?target_project=gitlab-org
%2F
gitlab-ce
'
,
);
);
});
});
it
(
'
renders web ide button with relative URL
'
,
()
=>
{
it
(
'
renders web ide button with blank query string if target & source project branch
'
,
done
=>
{
vm
.
mr
.
targetProjectFullPath
=
'
root/gitlab-ce
'
;
vm
.
$nextTick
(()
=>
{
const
button
=
vm
.
$el
.
querySelector
(
'
.js-web-ide
'
);
expect
(
button
.
textContent
.
trim
()).
toEqual
(
'
Open in Web IDE
'
);
expect
(
button
.
getAttribute
(
'
href
'
)).
toEqual
(
'
/-/ide/project/root/gitlab-ce/merge_requests/1?target_project=
'
,
);
done
();
});
});
it
(
'
renders web ide button with relative URL
'
,
done
=>
{
gon
.
relative_url_root
=
'
/gitlab
'
;
gon
.
relative_url_root
=
'
/gitlab
'
;
vm
.
mr
.
iid
=
2
;
const
button
=
vm
.
$el
.
querySelector
(
'
.js-web-ide
'
);
vm
.
$nextTick
(()
=>
{
const
button
=
vm
.
$el
.
querySelector
(
'
.js-web-ide
'
);
expect
(
button
.
textContent
.
trim
()).
toEqual
(
'
Open in Web IDE
'
);
expect
(
button
.
textContent
.
trim
()).
toEqual
(
'
Open in Web IDE
'
);
expect
(
button
.
getAttribute
(
'
href
'
)).
toEqual
(
expect
(
button
.
getAttribute
(
'
href
'
)).
toEqual
(
'
/-/ide/project/root/gitlab-ce/merge_requests/1?target_project=gitlab-org/gitlab-ce
'
,
'
/gitlab/-/ide/project/root/gitlab-ce/merge_requests/2?target_project=gitlab-org%2Fgitlab-ce
'
,
);
);
done
();
});
});
});
it
(
'
renders download dropdown with links
'
,
()
=>
{
it
(
'
renders download dropdown with links
'
,
()
=>
{
...
...
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