BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
9ec4b5c9
Unverified
Commit
9ec4b5c9
authored
Apr 26, 2018
by
Nick Thomas
Committed by
James Lopez
May 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'ide-relative-url-fix' of gitlab.com:gitlab-org/gitlab-ce
parent
4eb0be68
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
2 deletions
+27
-2
file.js
app/assets/javascripts/ide/stores/actions/file.js
+1
-1
blob_helper.rb
app/helpers/blob_helper.rb
+1
-1
blob_helper_spec.rb
spec/helpers/blob_helper_spec.rb
+25
-0
No files found.
app/assets/javascripts/ide/stores/actions/file.js
View file @
9ec4b5c9
...
...
@@ -60,7 +60,7 @@ export const getFileData = ({ state, commit, dispatch }, { path, makeFileActive
const
file
=
state
.
entries
[
path
];
commit
(
types
.
TOGGLE_LOADING
,
{
entry
:
file
});
return
service
.
getFileData
(
file
.
url
)
.
getFileData
(
`
${
gon
.
relative_url_root
?
gon
.
relative_url_root
:
''
}${
file
.
url
}
`
)
.
then
(
res
=>
{
const
pageTitle
=
decodeURI
(
normalizeHeaders
(
res
.
headers
)[
'PAGE-TITLE'
]);
setPageTitle
(
pageTitle
);
...
...
app/helpers/blob_helper.rb
View file @
9ec4b5c9
...
...
@@ -17,7 +17,7 @@ module BlobHelper
end
def
ide_edit_path
(
project
=
@project
,
ref
=
@ref
,
path
=
@path
,
options
=
{})
"
#{
ide_path
}
/project
#{
edit_blob_path
(
project
,
ref
,
path
,
options
)
}
"
"
#{
ide_path
}
/project
#{
url_for
([
project
,
"edit"
,
"blob"
,
id:
[
ref
,
path
],
script_name:
"/"
]
)
}
"
end
def
edit_blob_button
(
project
=
@project
,
ref
=
@ref
,
path
=
@path
,
options
=
{})
...
...
spec/helpers/blob_helper_spec.rb
View file @
9ec4b5c9
...
...
@@ -242,4 +242,29 @@ describe BlobHelper do
end
end
end
describe
'#ide_edit_path'
do
let
(
:project
)
{
create
(
:project
)
}
around
do
|
example
|
old_script_name
=
Rails
.
application
.
routes
.
default_url_options
[
:script_name
]
begin
example
.
run
ensure
Rails
.
application
.
routes
.
default_url_options
[
:script_name
]
=
old_script_name
end
end
it
'returns full IDE path'
do
Rails
.
application
.
routes
.
default_url_options
[
:script_name
]
=
nil
expect
(
helper
.
ide_edit_path
(
project
,
"master"
,
""
)).
to
eq
(
"/-/ide/project/
#{
project
.
namespace
.
path
}
/
#{
project
.
path
}
/edit/master/"
)
end
it
'returns IDE path without relative_url_root'
do
Rails
.
application
.
routes
.
default_url_options
[
:script_name
]
=
"/gitlab"
expect
(
helper
.
ide_edit_path
(
project
,
"master"
,
""
)).
to
eq
(
"/gitlab/-/ide/project/
#{
project
.
namespace
.
path
}
/
#{
project
.
path
}
/edit/master/"
)
end
end
end
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