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
96d9da9e
Commit
96d9da9e
authored
Jan 28, 2020
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Vue file browser not working with special characters
Closes
https://gitlab.com/gitlab-org/gitlab/issues/199308
parent
3b9944fc
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
6 deletions
+40
-6
app/assets/javascripts/repository/components/breadcrumbs.vue
app/assets/javascripts/repository/components/breadcrumbs.vue
+8
-2
app/assets/javascripts/repository/components/table/parent_row.vue
...ts/javascripts/repository/components/table/parent_row.vue
+1
-1
app/assets/javascripts/repository/components/table/row.vue
app/assets/javascripts/repository/components/table/row.vue
+1
-1
app/assets/javascripts/repository/log_tree.js
app/assets/javascripts/repository/log_tree.js
+4
-1
app/assets/javascripts/repository/router.js
app/assets/javascripts/repository/router.js
+1
-1
spec/features/projects/files/user_browses_files_spec.rb
spec/features/projects/files/user_browses_files_spec.rb
+25
-0
No files found.
app/assets/javascripts/repository/components/breadcrumbs.vue
View file @
96d9da9e
...
@@ -107,10 +107,16 @@ export default {
...
@@ -107,10 +107,16 @@ export default {
return
acc
.
concat
({
return
acc
.
concat
({
name
,
name
,
path
,
path
,
to
:
`/-/tree/
${
this
.
ref
}${
path
}
`
,
to
:
`/-/tree/
${
escape
(
this
.
ref
)
}${
path
}
`
,
});
});
},
},
[{
name
:
this
.
projectShortPath
,
path
:
'
/
'
,
to
:
`/-/tree/
${
this
.
ref
}
/`
}],
[
{
name
:
this
.
projectShortPath
,
path
:
'
/
'
,
to
:
`/-/tree/
${
escape
(
this
.
ref
)}
/`
,
},
],
);
);
},
},
canCreateMrFromFork
()
{
canCreateMrFromFork
()
{
...
...
app/assets/javascripts/repository/components/table/parent_row.vue
View file @
96d9da9e
...
@@ -28,7 +28,7 @@ export default {
...
@@ -28,7 +28,7 @@ export default {
return
splitArray
.
join
(
'
/
'
);
return
splitArray
.
join
(
'
/
'
);
},
},
parentRoute
()
{
parentRoute
()
{
return
{
path
:
`/-/tree/
${
this
.
commitRef
}
/
${
this
.
parentPath
}
`
};
return
{
path
:
`/-/tree/
${
escape
(
this
.
commitRef
)
}
/
${
this
.
parentPath
}
`
};
},
},
},
},
methods
:
{
methods
:
{
...
...
app/assets/javascripts/repository/components/table/row.vue
View file @
96d9da9e
...
@@ -90,7 +90,7 @@ export default {
...
@@ -90,7 +90,7 @@ export default {
},
},
computed
:
{
computed
:
{
routerLinkTo
()
{
routerLinkTo
()
{
return
this
.
isFolder
?
{
path
:
`/-/tree/
${
this
.
ref
}
/
${
this
.
path
}
`
}
:
null
;
return
this
.
isFolder
?
{
path
:
`/-/tree/
${
escape
(
this
.
ref
)
}
/
${
this
.
path
}
`
}
:
null
;
},
},
iconName
()
{
iconName
()
{
return
`fa-
${
getIconName
(
this
.
type
,
this
.
path
)}
`
;
return
`fa-
${
getIconName
(
this
.
type
,
this
.
path
)}
`
;
...
...
app/assets/javascripts/repository/log_tree.js
View file @
96d9da9e
...
@@ -27,7 +27,10 @@ export function fetchLogsTree(client, path, offset, resolver = null) {
...
@@ -27,7 +27,10 @@ export function fetchLogsTree(client, path, offset, resolver = null) {
fetchpromise
=
axios
fetchpromise
=
axios
.
get
(
.
get
(
`
${
gon
.
relative_url_root
}
/
${
projectPath
}
/-/refs/
${
ref
}
/logs_tree/
${
path
.
replace
(
/^
\/
/
,
''
)}
`
,
`
${
gon
.
relative_url_root
}
/
${
projectPath
}
/-/refs/
${
escape
(
ref
)}
/logs_tree/
${
path
.
replace
(
/^
\/
/
,
''
,
)}
`
,
{
{
params
:
{
format
:
'
json
'
,
offset
},
params
:
{
format
:
'
json
'
,
offset
},
},
},
...
...
app/assets/javascripts/repository/router.js
View file @
96d9da9e
...
@@ -12,7 +12,7 @@ export default function createRouter(base, baseRef) {
...
@@ -12,7 +12,7 @@ export default function createRouter(base, baseRef) {
base
:
joinPaths
(
gon
.
relative_url_root
||
''
,
base
),
base
:
joinPaths
(
gon
.
relative_url_root
||
''
,
base
),
routes
:
[
routes
:
[
{
{
path
:
`/-/tree/
${
baseRef
}
(/.*)?`
,
path
:
`/-/tree/
${
escape
(
baseRef
)
}
(/.*)?`
,
name
:
'
treePath
'
,
name
:
'
treePath
'
,
component
:
TreePage
,
component
:
TreePage
,
props
:
route
=>
({
props
:
route
=>
({
...
...
spec/features/projects/files/user_browses_files_spec.rb
View file @
96d9da9e
...
@@ -171,6 +171,31 @@ describe "User browses files" do
...
@@ -171,6 +171,31 @@ describe "User browses files" do
end
end
end
end
context
"when browsing a `improve/awesome` branch"
,
:js
do
before
do
visit
(
project_tree_path
(
project
,
"improve/awesome"
))
end
it
"shows files from a repository"
do
expect
(
page
).
to
have_content
(
"VERSION"
)
.
and
have_content
(
".gitignore"
)
.
and
have_content
(
"LICENSE"
)
end
end
context
"when browsing a `test-#` branch"
,
:js
do
before
do
project
.
repository
.
create_branch
(
'test-#'
,
project
.
repository
.
root_ref
)
visit
(
project_tree_path
(
project
,
"test-#"
))
end
it
"shows files from a repository"
do
expect
(
page
).
to
have_content
(
"VERSION"
)
.
and
have_content
(
".gitignore"
)
.
and
have_content
(
"LICENSE"
)
end
end
context
"when browsing a specific ref"
,
:js
do
context
"when browsing a specific ref"
,
:js
do
let
(
:ref
)
{
project_tree_path
(
project
,
"6d39438"
)
}
let
(
:ref
)
{
project_tree_path
(
project
,
"6d39438"
)
}
...
...
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