Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
1a7c293c
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 搜索 >>
提交
1a7c293c
编写于
8月 22, 2016
作者:
S
Sean McGivern
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix file links on project page Files view
上级
f633f7db
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
41 addition
and
3 deletion
+41
-3
CHANGELOG
CHANGELOG
+4
-2
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+8
-1
spec/features/projects_spec.rb
spec/features/projects_spec.rb
+29
-0
未找到文件。
CHANGELOG
浏览文件 @
1a7c293c
Please view this file on the master branch, on stable branches it's out of date.
v 8.12.0 (unreleased)
- Optimistic locking for Issues and Merge Requests (title and description overriding prevention)
v 8.11.1 (unreleased)
- Fix file links on project page when default view is Files !5933
v 8.11.0
- Use test coverage value from the latest successful pipeline in badge. !5862
- Add test coverage report badge. !5708
...
...
@@ -198,8 +202,6 @@ v 8.10.3
- Trim extra displayed carriage returns in diffs and files with CRLFs. !5588
- Fix label already exist error message in the right sidebar.
v 8.10.3 (unreleased)
v 8.10.2
- User can now search branches by name. !5144
- Page is now properly rendered after committing the first file and creating the first branch. !5399
...
...
app/controllers/projects_controller.rb
浏览文件 @
1a7c293c
...
...
@@ -5,7 +5,7 @@ class ProjectsController < Projects::ApplicationController
before_action
:project
,
except:
[
:new
,
:create
]
before_action
:repository
,
except:
[
:new
,
:create
]
before_action
:assign_ref_vars
,
only:
[
:show
],
if: :repo_exists?
before_action
:
tree
,
only:
[
:show
],
if:
[
:repo_exists?
,
:project_view_files?
]
before_action
:
assign_tree_vars
,
only:
[
:show
],
if:
[
:repo_exists?
,
:project_view_files?
]
# Authorize
before_action
:authorize_admin_project!
,
only:
[
:edit
,
:update
,
:housekeeping
,
:download_export
,
:export
,
:remove_export
,
:generate_new_export
]
...
...
@@ -332,4 +332,11 @@ class ProjectsController < Projects::ApplicationController
def
get_id
project
.
repository
.
root_ref
end
# ExtractsPath will set @id = project.path on the show route, but it has to be the
# branch name for the tree view to work correctly.
def
assign_tree_vars
@id
=
get_id
tree
end
end
spec/features/projects_spec.rb
浏览文件 @
1a7c293c
...
...
@@ -115,6 +115,35 @@ feature 'Project', feature: true do
end
end
describe
'tree view (default view is set to Files)'
do
let
(
:user
)
{
create
(
:user
,
project_view:
'files'
)
}
let
(
:project
)
{
create
(
:forked_project_with_submodules
)
}
before
do
project
.
team
<<
[
user
,
:master
]
login_as
user
visit
namespace_project_path
(
project
.
namespace
,
project
)
end
it
'has working links to files'
do
click_link
(
'PROCESS.md'
)
expect
(
page
.
status_code
).
to
eq
(
200
)
end
it
'has working links to directories'
do
click_link
(
'encoding'
)
expect
(
page
.
status_code
).
to
eq
(
200
)
end
it
'has working links to submodules'
do
click_link
(
'645f6c4c'
)
expect
(
page
.
status_code
).
to
eq
(
200
)
end
end
def
remove_with_confirm
(
button_text
,
confirm_with
)
click_button
button_text
fill_in
'confirm_name_input'
,
with:
confirm_with
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录