Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
3d2c3878
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 搜索 >>
提交
3d2c3878
编写于
3月 30, 2015
作者:
S
Stan Hu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move current user to the top of the list in author/assignee filters
Closes #1321
上级
f3f85602
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
39 addition
and
3 deletion
+39
-3
CHANGELOG
CHANGELOG
+1
-0
app/assets/javascripts/users_select.js.coffee
app/assets/javascripts/users_select.js.coffee
+8
-0
app/helpers/selects_helper.rb
app/helpers/selects_helper.rb
+2
-0
app/views/projects/issues/_issue_context.html.haml
app/views/projects/issues/_issue_context.html.haml
+1
-1
app/views/shared/_issuable_filter.html.haml
app/views/shared/_issuable_filter.html.haml
+2
-2
features/project/issues/issues.feature
features/project/issues/issues.feature
+6
-0
features/steps/project/issues/issues.rb
features/steps/project/issues/issues.rb
+12
-0
features/steps/shared/project.rb
features/steps/shared/project.rb
+7
-0
未找到文件。
CHANGELOG
浏览文件 @
3d2c3878
...
...
@@ -4,6 +4,7 @@ v 7.10.0 (unreleased)
- Fix bug where Wiki pages that included a '/' were no longer accessible (Stan Hu)
- Fix bug where error messages from Dropzone would not be displayed on the issues page (Stan Hu)
- Add ability to configure Reply-To address in gitlab.yml (Stan Hu)
- Move current user to the top of the list in assignee/author filters (Stan Hu)
- Fix broken side-by-side diff view on merge request page (Stan Hu)
- Set Application controller default URL options to ensure all url_for calls are consistent (Stan Hu)
- Allow HTML tags in Markdown input
...
...
app/assets/javascripts/users_select.js.coffee
浏览文件 @
3d2c3878
...
...
@@ -8,6 +8,7 @@ class @UsersSelect
@
groupId
=
$
(
select
).
data
(
'group-id'
)
showNullUser
=
$
(
select
).
data
(
'null-user'
)
showAnyUser
=
$
(
select
).
data
(
'any-user'
)
firstUser
=
$
(
select
).
data
(
'first-user'
)
$
(
select
).
select2
placeholder
:
"Search for a user"
...
...
@@ -32,6 +33,13 @@ class @UsersSelect
id
:
0
}
if
firstUser
# Move current user to the front of the list
for
obj
,
index
in
data
.
results
if
obj
.
username
==
firstUser
data
.
results
.
splice
(
index
,
1
)
data
.
results
.
unshift
(
obj
)
break
if
showNullUser
data
.
results
.
unshift
(
nullUser
)
if
showAnyUser
...
...
app/helpers/selects_helper.rb
浏览文件 @
3d2c3878
...
...
@@ -8,12 +8,14 @@ module SelectsHelper
null_user
=
opts
[
:null_user
]
||
false
any_user
=
opts
[
:any_user
]
||
false
first_user
=
opts
[
:first_user
]
&&
current_user
?
current_user
.
username
:
false
html
=
{
class:
css_class
,
'data-placeholder'
=>
placeholder
,
'data-null-user'
=>
null_user
,
'data-any-user'
=>
any_user
,
'data-first-user'
=>
first_user
}
unless
opts
[
:scope
]
==
:all
...
...
app/views/projects/issues/_issue_context.html.haml
浏览文件 @
3d2c3878
...
...
@@ -8,7 +8,7 @@
-
else
none
-
if
can?
(
current_user
,
:modify_issue
,
@issue
)
=
users_select_tag
(
'issue[assignee_id]'
,
placeholder:
'Select assignee'
,
class:
'custom-form-control js-select2 js-assignee'
,
selected:
@issue
.
assignee_id
,
null_user:
true
)
=
users_select_tag
(
'issue[assignee_id]'
,
placeholder:
'Select assignee'
,
class:
'custom-form-control js-select2 js-assignee'
,
selected:
@issue
.
assignee_id
,
null_user:
true
,
first_user:
true
)
%div
.prepend-top-20.clearfix
.issuable-context-title
...
...
app/views/shared/_issuable_filter.html.haml
浏览文件 @
3d2c3878
...
...
@@ -24,11 +24,11 @@
.issues-other-filters
.filter-item.inline
=
users_select_tag
(
:assignee_id
,
selected:
params
[
:assignee_id
],
placeholder:
'Assignee'
,
class:
'trigger-submit'
,
any_user:
true
,
null_user:
true
)
placeholder:
'Assignee'
,
class:
'trigger-submit'
,
any_user:
true
,
null_user:
true
,
first_user:
true
)
.filter-item.inline
=
users_select_tag
(
:author_id
,
selected:
params
[
:author_id
],
placeholder:
'Author'
,
class:
'trigger-submit'
,
any_user:
true
)
placeholder:
'Author'
,
class:
'trigger-submit'
,
any_user:
true
,
first_user:
true
)
.filter-item.inline.milestone-filter
=
select_tag
(
'milestone_id'
,
projects_milestones_options
,
class:
"select2 trigger-submit"
,
prompt:
'Milestone'
)
...
...
features/project/issues/issues.feature
浏览文件 @
3d2c3878
...
...
@@ -25,6 +25,12 @@ Feature: Project Issues
Given
I click link
"Release 0.4"
Then
I should see issue
"Release 0.4"
@javascript
Scenario
:
I
visit issue page
Given
I add a user to project
"Shop"
And
I click
"author"
dropdown
Then
I see current user as the first user
Scenario
:
I
submit new unassigned issue
Given
I click link
"New Issue"
And
I submit new issue
"500 error on profile"
...
...
features/steps/project/issues/issues.rb
浏览文件 @
3d2c3878
...
...
@@ -59,6 +59,18 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
click_link
"New Issue"
end
step
'I click "author" dropdown'
do
first
(
'.ajax-users-select'
).
click
end
step
'I see current user as the first user'
do
expect
(
page
).
to
have_selector
(
'.user-result'
,
visible:
true
,
count:
4
)
users
=
page
.
all
(
'.user-name'
)
users
[
0
].
text
.
should
==
'Any'
users
[
1
].
text
.
should
==
'Unassigned'
users
[
2
].
text
.
should
==
current_user
.
name
end
step
'I submit new issue "500 error on profile"'
do
fill_in
"issue_title"
,
with:
"500 error on profile"
click_button
"Submit new issue"
...
...
features/steps/shared/project.rb
浏览文件 @
3d2c3878
...
...
@@ -14,6 +14,13 @@ module SharedProject
@project
.
team
<<
[
@user
,
:master
]
end
# Add another user to project "Shop"
step
'I add a user to project "Shop"'
do
@project
=
Project
.
find_by
(
name:
"Shop"
)
other_user
=
create
(
:user
,
name:
'Alpha'
)
@project
.
team
<<
[
other_user
,
:master
]
end
# Create another specific project called "Forum"
step
'I own project "Forum"'
do
@project
=
Project
.
find_by
(
name:
"Forum"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录