Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
20abacca
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
20abacca
编写于
4月 20, 2020
作者:
G
GitLab Bot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add latest changes from gitlab-org/gitlab@12-10-stable-ee
上级
8bdbf220
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
43 addition
and
13 deletion
+43
-13
app/assets/javascripts/repository/components/breadcrumbs.vue
app/assets/javascripts/repository/components/breadcrumbs.vue
+2
-2
app/assets/javascripts/repository/components/table/parent_row.vue
...ts/javascripts/repository/components/table/parent_row.vue
+2
-1
app/assets/javascripts/repository/components/table/row.vue
app/assets/javascripts/repository/components/table/row.vue
+1
-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
+28
-0
spec/frontend/repository/router_spec.js
spec/frontend/repository/router_spec.js
+9
-8
未找到文件。
app/assets/javascripts/repository/components/breadcrumbs.vue
浏览文件 @
20abacca
...
...
@@ -108,14 +108,14 @@ export default {
return
acc
.
concat
({
name
,
path
,
to
:
`/-/tree/
${
joinPaths
(
e
ncodeURIComponent
(
this
.
ref
),
path
)}
`
,
to
:
`/-/tree/
${
joinPaths
(
e
scapeFileUrl
(
this
.
ref
),
path
)}
`
,
});
},
[
{
name
:
this
.
projectShortPath
,
path
:
'
/
'
,
to
:
`/-/tree/
${
e
ncodeURIComponent
(
this
.
ref
)}
/`
,
to
:
`/-/tree/
${
e
scapeFileUrl
(
this
.
ref
)}
/`
,
},
],
);
...
...
app/assets/javascripts/repository/components/table/parent_row.vue
浏览文件 @
20abacca
<
script
>
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
escapeFileUrl
}
from
'
~/lib/utils/url_utility
'
;
export
default
{
components
:
{
...
...
@@ -28,7 +29,7 @@ export default {
return
splitArray
.
map
(
p
=>
encodeURIComponent
(
p
)).
join
(
'
/
'
);
},
parentRoute
()
{
return
{
path
:
`/-/tree/
${
e
ncodeURIComponent
(
this
.
commitRef
)}
/
${
this
.
parentPath
}
`
};
return
{
path
:
`/-/tree/
${
e
scapeFileUrl
(
this
.
commitRef
)}
/
${
this
.
parentPath
}
`
};
},
},
methods
:
{
...
...
app/assets/javascripts/repository/components/table/row.vue
浏览文件 @
20abacca
...
...
@@ -99,7 +99,7 @@ export default {
computed
:
{
routerLinkTo
()
{
return
this
.
isFolder
?
{
path
:
`/-/tree/
${
e
ncodeURIComponent
(
this
.
ref
)}
/
${
escapeFileUrl
(
this
.
path
)}
`
}
?
{
path
:
`/-/tree/
${
e
scapeFileUrl
(
this
.
ref
)}
/
${
escapeFileUrl
(
this
.
path
)}
`
}
:
null
;
},
isFolder
()
{
...
...
app/assets/javascripts/repository/router.js
浏览文件 @
20abacca
...
...
@@ -12,7 +12,7 @@ export default function createRouter(base, baseRef) {
base
:
joinPaths
(
gon
.
relative_url_root
||
''
,
base
),
routes
:
[
{
path
:
`(/-)?/tree/(
${
encodeURIComponent
(
baseRef
)}
|
${
baseRef
}
)/:path*`
,
path
:
`(/-)?/tree/(
${
encodeURIComponent
(
baseRef
)
.
replace
(
/%2F/g
,
'
/
'
)
}
|
${
baseRef
}
)/:path*`
,
name
:
'
treePath
'
,
component
:
TreePage
,
props
:
route
=>
({
...
...
spec/features/projects/files/user_browses_files_spec.rb
浏览文件 @
20abacca
...
...
@@ -180,6 +180,20 @@ describe "User browses files" do
expect
(
page
).
to
have_content
(
"VERSION"
)
.
and
have_content
(
".gitignore"
)
.
and
have_content
(
"LICENSE"
)
click_link
(
"files"
)
page
.
within
(
'.repo-breadcrumb'
)
do
expect
(
page
).
to
have_link
(
'files'
)
end
click_link
(
"html"
)
page
.
within
(
'.repo-breadcrumb'
)
do
expect
(
page
).
to
have_link
(
'html'
)
end
expect
(
page
).
to
have_link
(
'500.html'
)
end
end
...
...
@@ -193,6 +207,20 @@ describe "User browses files" do
expect
(
page
).
to
have_content
(
"VERSION"
)
.
and
have_content
(
".gitignore"
)
.
and
have_content
(
"LICENSE"
)
click_link
(
"files"
)
page
.
within
(
'.repo-breadcrumb'
)
do
expect
(
page
).
to
have_link
(
'files'
)
end
click_link
(
"html"
)
page
.
within
(
'.repo-breadcrumb'
)
do
expect
(
page
).
to
have_link
(
'html'
)
end
expect
(
page
).
to
have_link
(
'500.html'
)
end
end
...
...
spec/frontend/repository/router_spec.js
浏览文件 @
20abacca
...
...
@@ -4,14 +4,15 @@ import createRouter from '~/repository/router';
describe
(
'
Repository router spec
'
,
()
=>
{
it
.
each
`
path | component | componentName
${
'
/
'
}
|
${
IndexPage
}
|
${
'
IndexPage
'
}
${
'
/tree/master
'
}
|
${
TreePage
}
|
${
'
TreePage
'
}
${
'
/-/tree/master
'
}
|
${
TreePage
}
|
${
'
TreePage
'
}
${
'
/-/tree/master/app/assets
'
}
|
${
TreePage
}
|
${
'
TreePage
'
}
${
'
/-/tree/123/app/assets
'
}
|
${
null
}
|
${
'
null
'
}
`
(
'
sets component as $componentName for path "$path"
'
,
({
path
,
component
})
=>
{
const
router
=
createRouter
(
''
,
'
master
'
);
path | branch | component | componentName
${
'
/
'
}
|
${
'
master
'
}
|
${
IndexPage
}
|
${
'
IndexPage
'
}
${
'
/tree/master
'
}
|
${
'
master
'
}
|
${
TreePage
}
|
${
'
TreePage
'
}
${
'
/-/tree/master
'
}
|
${
'
master
'
}
|
${
TreePage
}
|
${
'
TreePage
'
}
${
'
/-/tree/master/app/assets
'
}
|
${
'
master
'
}
|
${
TreePage
}
|
${
'
TreePage
'
}
${
'
/-/tree/feature/test-%23/app/assets
'
}
|
${
'
feature/test-#
'
}
|
${
TreePage
}
|
${
'
TreePage
'
}
${
'
/-/tree/123/app/assets
'
}
|
${
'
master
'
}
|
${
null
}
|
${
'
null
'
}
`
(
'
sets component as $componentName for path "$path"
'
,
({
path
,
component
,
branch
})
=>
{
const
router
=
createRouter
(
''
,
branch
);
const
componentsForRoute
=
router
.
getMatchedComponents
(
path
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录