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
8b72bcfa
Commit
8b72bcfa
authored
Mar 28, 2018
by
Tim Zallmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Utility Function for WebIDE URL
parent
8f7cf2ed
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
app/assets/javascripts/lib/utils/url_utility.js
app/assets/javascripts/lib/utils/url_utility.js
+11
-1
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue
.../vue_merge_request_widget/components/mr_widget_header.vue
+2
-1
No files found.
app/assets/javascripts/lib/utils/url_utility.js
View file @
8b72bcfa
import
project
from
'
../../ide/stores/mutations/project
'
;
// Returns an array containing the value(s) of the
// Returns an array containing the value(s) of the
// of the key passed as an argument
// of the key passed as an argument
export
function
getParameterValues
(
sParam
)
{
export
function
getParameterValues
(
sParam
)
{
...
@@ -51,7 +53,7 @@ export function removeParams(params) {
...
@@ -51,7 +53,7 @@ export function removeParams(params) {
const
url
=
document
.
createElement
(
'
a
'
);
const
url
=
document
.
createElement
(
'
a
'
);
url
.
href
=
window
.
location
.
href
;
url
.
href
=
window
.
location
.
href
;
params
.
forEach
(
(
param
)
=>
{
params
.
forEach
(
param
=>
{
url
.
search
=
removeParamQueryString
(
url
.
search
,
param
);
url
.
search
=
removeParamQueryString
(
url
.
search
,
param
);
});
});
...
@@ -83,3 +85,11 @@ export function refreshCurrentPage() {
...
@@ -83,3 +85,11 @@ export function refreshCurrentPage() {
export
function
redirectTo
(
url
)
{
export
function
redirectTo
(
url
)
{
return
window
.
location
.
assign
(
url
);
return
window
.
location
.
assign
(
url
);
}
}
export
function
webIDEUrl
(
projectUrl
=
undefined
)
{
let
returnUrl
=
`
${
gon
.
relative_url_root
}
/-/ide/`
;
if
(
projectUrl
)
{
returnUrl
+=
`project
${
projectUrl
}
`
;
}
return
returnUrl
;
}
app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue
View file @
8b72bcfa
<
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
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
'
;
...
@@ -42,7 +43,7 @@ export default {
...
@@ -42,7 +43,7 @@ export default {
return
this
.
isBranchTitleLong
(
this
.
mr
.
targetBranch
);
return
this
.
isBranchTitleLong
(
this
.
mr
.
targetBranch
);
},
},
webIdePath
()
{
webIdePath
()
{
return
`
${
gon
.
relative_url_root
}
/-/ide/project
${
this
.
mr
.
statusPath
.
replace
(
'
.json
'
,
''
)}
`
;
return
webIDEUrl
(
this
.
mr
.
statusPath
.
replace
(
'
.json
'
,
''
))
;
},
},
},
},
methods
:
{
methods
:
{
...
...
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