Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
6ea92ef1
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,发现更多精彩内容 >>
提交
6ea92ef1
编写于
4月 19, 2019
作者:
I
Illya Klymov
提交者:
Stan Hu
4月 19, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improvements to Project overview UI
上级
48b025d1
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
45 addition
and
4 deletion
+45
-4
app/helpers/notifications_helper.rb
app/helpers/notifications_helper.rb
+7
-0
app/presenters/project_presenter.rb
app/presenters/project_presenter.rb
+2
-2
app/views/shared/notifications/_new_button.html.haml
app/views/shared/notifications/_new_button.html.haml
+2
-2
changelogs/unreleased/xanf-gitlab-ce-improve-project-overview.yml
...gs/unreleased/xanf-gitlab-ce-improve-project-overview.yml
+5
-0
spec/features/projects/show/user_manages_notifications_spec.rb
...features/projects/show/user_manages_notifications_spec.rb
+10
-0
spec/presenters/project_presenter_spec.rb
spec/presenters/project_presenter_spec.rb
+19
-0
未找到文件。
app/helpers/notifications_helper.rb
浏览文件 @
6ea92ef1
...
...
@@ -93,4 +93,11 @@ module NotificationsHelper
s_
(
event
.
to_s
.
humanize
)
end
end
def
notification_setting_icon
(
notification_setting
)
sprite_icon
(
notification_setting
.
disabled?
?
"notifications-off"
:
"notifications"
,
css_class:
"icon notifications-icon js-notifications-icon"
)
end
end
app/presenters/project_presenter.rb
浏览文件 @
6ea92ef1
...
...
@@ -37,7 +37,7 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
autodevops_anchor_data
(
show_auto_devops_callout:
show_auto_devops_callout
),
kubernetes_cluster_anchor_data
,
gitlab_ci_anchor_data
].
compact
.
reject
(
&
:is_link
)
].
compact
.
reject
(
&
:is_link
)
.
sort_by
.
with_index
{
|
item
,
idx
|
[
item
.
class_modifier
?
0
:
1
,
idx
]
}
end
def
empty_repo_statistics_anchors
...
...
@@ -259,7 +259,7 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated
if
current_user
&&
can?
(
current_user
,
:admin_pipeline
,
project
)
&&
repository
.
gitlab_ci_yml
.
blank?
&&
!
show_auto_devops_callout
if
auto_devops_enabled?
AnchorData
.
new
(
false
,
statistic_icon
(
'
doc-text
'
)
+
_
(
'Auto DevOps enabled'
),
statistic_icon
(
'
settings
'
)
+
_
(
'Auto DevOps enabled'
),
project_settings_ci_cd_path
(
project
,
anchor:
'autodevops-settings'
),
'default'
)
else
...
...
app/views/shared/notifications/_new_button.html.haml
浏览文件 @
6ea92ef1
...
...
@@ -10,14 +10,14 @@
%div
{
class:
(
"btn-group"
if
notification_setting
.
custom?
)
}
-
if
notification_setting
.
custom?
%button
.dropdown-new.btn.btn-default.has-tooltip.notifications-btn
#notifications-button
{
type:
"button"
,
title:
_
(
"Notification setting - %{notification_title}"
)
%
{
notification_title:
notification_title
(
notification_setting
.
level
)
},
class:
"#{btn_class}"
,
"aria-label"
=>
_
(
"Notification setting - %{notification_title}"
)
%
{
notification_title:
notification_title
(
notification_setting
.
level
)
},
data:
{
container:
"body"
,
placement:
'top'
,
toggle:
"modal"
,
target:
"#"
+
notifications_menu_identifier
(
"modal"
,
notification_setting
),
display:
'static'
}
}
=
sprite_icon
(
"notifications"
,
css_class:
"icon notifications-icon js-notifications-icon"
)
=
notification_setting_icon
(
notification_setting
)
%span
.js-notification-loading.fa.hidden
%button
.btn.dropdown-toggle
{
data:
{
toggle:
"dropdown"
,
target:
notifications_menu_identifier
(
"dropdown"
,
notification_setting
),
flip:
"false"
},
class:
"#{btn_class}"
}
=
sprite_icon
(
"arrow-down"
,
css_class:
"icon mr-0"
)
.sr-only
Toggle dropdown
-
else
%button
.dropdown-new.btn.btn-default.has-tooltip.notifications-btn
#notifications-button
{
type:
"button"
,
title:
"Notification setting - #{notification_title(notification_setting.level)}"
,
class:
"#{btn_class}"
,
"aria-label"
=>
"Notification setting: #{notification_title(notification_setting.level)}"
,
data:
{
container:
"body"
,
placement:
'top'
,
toggle:
"dropdown"
,
target:
notifications_menu_identifier
(
"dropdown"
,
notification_setting
),
flip:
"false"
}
}
=
sprite_icon
(
"notifications"
,
css_class:
"icon notifications-icon js-notifications-icon"
)
=
notification_setting_icon
(
notification_setting
)
%span
.js-notification-loading.fa.hidden
=
sprite_icon
(
"arrow-down"
,
css_class:
"icon"
)
...
...
changelogs/unreleased/xanf-gitlab-ce-improve-project-overview.yml
0 → 100644
浏览文件 @
6ea92ef1
---
title
:
Improve icons and button order in project overview
merge_request
:
26796
author
:
type
:
other
spec/features/projects/show/user_manages_notifications_spec.rb
浏览文件 @
6ea92ef1
...
...
@@ -20,6 +20,16 @@ describe 'Projects > Show > User manages notifications', :js do
click_notifications_button
expect
(
find
(
'.update-notification.is-active'
)).
to
have_content
(
'On mention'
)
expect
(
find
(
'.notifications-icon use'
)[
:'xlink:href'
]).
to
end_with
(
'#notifications'
)
end
it
'changes the notification setting to disabled'
do
click_notifications_button
click_link
'Disabled'
wait_for_requests
expect
(
find
(
'.notifications-icon use'
)[
:'xlink:href'
]).
to
end_with
(
'#notifications-off'
)
end
context
'custom notification settings'
do
...
...
spec/presenters/project_presenter_spec.rb
浏览文件 @
6ea92ef1
...
...
@@ -411,4 +411,23 @@ describe ProjectPresenter do
end
end
end
describe
'#statistics_buttons'
do
let
(
:project
)
{
build
(
:project
)
}
let
(
:presenter
)
{
described_class
.
new
(
project
,
current_user:
user
)
}
it
'orders the items correctly'
do
allow
(
project
.
repository
).
to
receive
(
:readme
).
and_return
(
double
(
name:
'readme'
))
allow
(
project
.
repository
).
to
receive
(
:changelog
).
and_return
(
nil
)
allow
(
project
.
repository
).
to
receive
(
:contribution_guide
).
and_return
(
double
(
name:
'foo'
))
allow
(
presenter
).
to
receive
(
:filename_path
).
and_return
(
'fake/path'
)
allow
(
presenter
).
to
receive
(
:contribution_guide_path
).
and_return
(
'fake_path'
)
buttons
=
presenter
.
statistics_buttons
(
show_auto_devops_callout:
false
)
expect
(
buttons
.
map
(
&
:label
)).
to
start_with
(
a_string_including
(
'README'
),
a_string_including
(
'CONTRIBUTING'
)
)
end
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录