Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
19e2bf1c
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 搜索 >>
提交
19e2bf1c
编写于
8月 22, 2016
作者:
A
Alfredo Sumaran
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix failing specs and improve html
上级
894bd04d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
26 addition
and
15 deletion
+26
-15
CHANGELOG
CHANGELOG
+1
-3
app/assets/stylesheets/pages/milestone.scss
app/assets/stylesheets/pages/milestone.scss
+11
-0
app/helpers/milestones_helper.rb
app/helpers/milestones_helper.rb
+1
-1
app/views/shared/milestones/_milestone.html.haml
app/views/shared/milestones/_milestone.html.haml
+1
-1
spec/helpers/milestones_helper_spec.rb
spec/helpers/milestones_helper_spec.rb
+12
-10
未找到文件。
CHANGELOG
浏览文件 @
19e2bf1c
...
...
@@ -31,6 +31,7 @@ v 8.12.0 (unreleased)
- Fix markdown anchor icon interaction (ClemMakesApps)
- Test migration paths from 8.5 until current release !4874
- Replace animateEmoji timeout with eventListener (ClemMakesApps)
- Show badges in Milestone tabs. !5946 (Dan Rowden)
- Optimistic locking for Issues and Merge Requests (title and description overriding prevention)
- Add `wiki_page_events` to project hook APIs (Ben Boeckel)
- Remove Gitorious import
...
...
@@ -364,9 +365,6 @@ v 8.10.1
- Add links to the real markdown.md file for all GFM examples. !5458
v 8.10.0
- Show badges in Milestone tabs
v 8.10.0 (unreleased)
- Fix profile activity heatmap to show correct day name (eanplatter)
- Speed up ExternalWikiHelper#get_project_wiki_path
- Expose {should,force}_remove_source_branch (Ben Boeckel)
...
...
app/assets/stylesheets/pages/milestone.scss
浏览文件 @
19e2bf1c
...
...
@@ -68,3 +68,14 @@
border-bottom
:
1px
solid
$border-color
;
padding
:
20px
0
;
}
@media
(
max-width
:
$screen-sm-min
)
{
.milestone-actions
{
@include
clearfix
();
padding-top
:
$gl-vert-padding
;
.btn
:first-child
{
margin-left
:
0
;
}
}
}
app/helpers/milestones_helper.rb
浏览文件 @
19e2bf1c
...
...
@@ -50,7 +50,7 @@ module MilestonesHelper
# Show 'active' class if provided GET param matches check
# `or_blank` allows the function to return 'active' when given an empty param
# Could be refactored to be simpler but that may make it harder to read
def
milestone_class_for_state
(
param
,
check
,
match_blank_param
=
false
)
def
milestone_class_for_state
(
param
,
check
,
match_blank_param
=
false
)
if
match_blank_param
'active'
if
param
.
blank?
||
param
==
check
else
...
...
app/views/shared/milestones/_milestone.html.haml
浏览文件 @
19e2bf1c
...
...
@@ -33,7 +33,7 @@
-
if
@project
.row
.col-sm-6
=
render
(
'shared/milestone_expired'
,
milestone:
milestone
)
.col-sm-6
.col-sm-6
.milestone-actions
-
if
can?
(
current_user
,
:admin_milestone
,
milestone
.
project
)
and
milestone
.
active?
=
link_to
edit_namespace_project_milestone_path
(
milestone
.
project
.
namespace
,
milestone
.
project
,
milestone
),
class:
"btn btn-xs btn-grouped"
do
Edit
...
...
spec/helpers/milestones_helper_spec.rb
浏览文件 @
19e2bf1c
require
'spec_helper'
describe
MilestonesHelper
do
describe
'#milestone_counts'
do
let
(
:project
)
{
FactoryGirl
.
create
(
:project
)
}
let
(
:milestone_1
)
{
FactoryGirl
.
create
(
:active_milestone
,
project:
project
)
}
let
(
:milestone_2
)
{
FactoryGirl
.
create
(
:active_milestone
,
project:
project
)
}
let
(
:milestone_3
)
{
FactoryGirl
.
create
(
:closed_milestone
,
project:
project
)
}
let
!
(
:milestone_1
)
{
FactoryGirl
.
create
(
:active_milestone
,
project:
project
)
}
let
!
(
:milestone_2
)
{
FactoryGirl
.
create
(
:active_milestone
,
project:
project
)
}
let
!
(
:milestone_3
)
{
FactoryGirl
.
create
(
:closed_milestone
,
project:
project
)
}
let
(
:counts
)
{
helper
.
milestone_counts
(
project
.
milestones
)
}
it
'returns a hash containing three items'
do
expect
(
counts
.
length
).
to
eq
3
end
it
'returns a hash containing "opened" key'
do
expect
(
counts
.
has_key?
(
:opened
)).
to
eq
true
end
it
'returns a hash containing "closed" key'
do
expect
(
counts
.
has_key?
(
:closed
)).
to
eq
true
end
it
'returns a hash containing "all" key'
do
expect
(
counts
.
has_key?
(
:all
)).
to
eq
true
end
# This throws a "NoMethodError: undefined method `+' for nil:NilClass" error for line 27; can't figure out why it can't find the keys in the hash
# it 'shows "all" object is the sum of "opened" and "closed" objects' do
# total = counts[:opened] + counts[:closed]
# expect(counts[:all]).to eq total
# end
it
'shows "all" object is the sum of "opened" and "closed" objects'
do
puts
counts
.
as_json
total
=
counts
[
:opened
]
+
counts
[
:closed
]
expect
(
counts
[
:all
]).
to
eq
total
end
end
end
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录