Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
c352f695
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,发现更多精彩内容 >>
提交
c352f695
编写于
4月 18, 2018
作者:
A
André Luís
提交者:
Mike Greiling
4月 18, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Resolve "View labels when editing labels in sidebar and board sidebar"
上级
8cce96b1
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
43 addition
and
8 deletion
+43
-8
app/assets/javascripts/issuable_context.js
app/assets/javascripts/issuable_context.js
+2
-2
app/assets/stylesheets/framework/sidebar.scss
app/assets/stylesheets/framework/sidebar.scss
+7
-2
app/views/shared/boards/components/sidebar/_labels.html.haml
app/views/shared/boards/components/sidebar/_labels.html.haml
+1
-1
app/views/shared/issuable/_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+1
-1
changelogs/unreleased/34262-show-current-labels-when-editing.yml
...ogs/unreleased/34262-show-current-labels-when-editing.yml
+5
-0
spec/features/boards/sidebar_spec.rb
spec/features/boards/sidebar_spec.rb
+19
-1
spec/features/issues/issue_sidebar_spec.rb
spec/features/issues/issue_sidebar_spec.rb
+8
-1
未找到文件。
app/assets/javascripts/issuable_context.js
浏览文件 @
c352f695
...
...
@@ -30,10 +30,10 @@ export default class IssuableContext {
const
$selectbox
=
$block
.
find
(
'
.selectbox
'
);
if
(
$selectbox
.
is
(
'
:visible
'
))
{
$selectbox
.
hide
();
$block
.
find
(
'
.value
'
).
show
();
$block
.
find
(
'
.value
:not(.dont-hide)
'
).
show
();
}
else
{
$selectbox
.
show
();
$block
.
find
(
'
.value
'
).
hide
();
$block
.
find
(
'
.value
:not(.dont-hide)
'
).
hide
();
}
if
(
$selectbox
.
is
(
'
:visible
'
))
{
...
...
app/assets/stylesheets/framework/sidebar.scss
浏览文件 @
c352f695
...
...
@@ -16,7 +16,7 @@
.nav-header-btn
{
padding
:
10px
$gl-sidebar-padding
;
color
:
inherit
;
transition-duration
:
.3s
;
transition-duration
:
0
.3s
;
position
:
absolute
;
top
:
0
;
cursor
:
pointer
;
...
...
@@ -137,6 +137,12 @@
}
}
.issuable-sidebar
.labels
{
.value.dont-hide
~
.selectbox
{
padding-top
:
$gl-padding-8
;
}
}
.pikaday-container
{
.pika-single
{
margin-top
:
2px
;
...
...
@@ -151,4 +157,3 @@
.sidebar-collapsed-icon
.sidebar-collapsed-value
{
font-size
:
12px
;
}
app/views/shared/boards/components/sidebar/_labels.html.haml
浏览文件 @
c352f695
...
...
@@ -4,7 +4,7 @@
-
if
can_admin_issue?
=
icon
(
"spinner spin"
,
class:
"block-loading"
)
=
link_to
"Edit"
,
"#"
,
class:
"js-sidebar-dropdown-toggle edit-link pull-right"
.value.issuable-show-labels
.value.issuable-show-labels
.dont-hide
%span
.no-value
{
"v-if"
=>
"issue.labels && issue.labels.length === 0"
}
None
%a
{
href:
"#"
,
...
...
app/views/shared/issuable/_sidebar.html.haml
浏览文件 @
c352f695
...
...
@@ -96,7 +96,7 @@
=
icon
(
'spinner spin'
,
class:
'hidden block-loading'
,
'aria-hidden'
:
'true'
)
-
if
can_edit_issuable
=
link_to
_
(
'Edit'
),
'#'
,
class:
'js-sidebar-dropdown-toggle edit-link pull-right'
.value.issuable-show-labels.hide-collapsed
{
class:
(
"has-labels"
if
selected_labels
.
any?
)
}
.value.issuable-show-labels.
dont-hide.
hide-collapsed
{
class:
(
"has-labels"
if
selected_labels
.
any?
)
}
-
if
selected_labels
.
any?
-
selected_labels
.
each
do
|
label
|
=
link_to_label
(
label
,
subject:
issuable
.
project
,
type:
issuable
.
to_ability_name
)
...
...
changelogs/unreleased/34262-show-current-labels-when-editing.yml
0 → 100644
浏览文件 @
c352f695
---
title
:
Keep current labels visible when editing them in the sidebar
merge_request
:
author
:
type
:
changed
spec/features/boards/sidebar_spec.rb
浏览文件 @
c352f695
...
...
@@ -237,6 +237,22 @@ describe 'Issue Boards', :js do
end
context
'labels'
do
it
'shows current labels when editing'
do
click_card
(
card
)
page
.
within
(
'.labels'
)
do
click_link
'Edit'
wait_for_requests
page
.
within
(
'.value'
)
do
expect
(
page
).
to
have_selector
(
'.label'
,
count:
2
)
expect
(
page
).
to
have_content
(
development
.
title
)
expect
(
page
).
to
have_content
(
stretch
.
title
)
end
end
end
it
'adds a single label'
do
click_card
(
card
)
...
...
@@ -296,7 +312,9 @@ describe 'Issue Boards', :js do
wait_for_requests
click_link
stretch
.
title
within
(
'.dropdown-menu-labels'
)
do
click_link
stretch
.
title
end
wait_for_requests
...
...
spec/features/issues/issue_sidebar_spec.rb
浏览文件 @
c352f695
...
...
@@ -5,9 +5,9 @@ feature 'Issue Sidebar' do
let
(
:group
)
{
create
(
:group
,
:nested
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
namespace:
group
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let!
(
:user
)
{
create
(
:user
)}
let!
(
:label
)
{
create
(
:label
,
project:
project
,
title:
'bug'
)
}
let
(
:issue
)
{
create
(
:labeled_issue
,
project:
project
,
labels:
[
label
])
}
let!
(
:xss_label
)
{
create
(
:label
,
project:
project
,
title:
'<script>alert("xss");</script>'
)
}
before
do
...
...
@@ -112,11 +112,18 @@ feature 'Issue Sidebar' do
context
'editing issue labels'
,
:js
do
before
do
issue
.
update_attributes
(
labels:
[
label
])
page
.
within
(
'.block.labels'
)
do
find
(
'.edit-link'
).
click
end
end
it
'shows the current set of labels'
do
page
.
within
(
'.issuable-show-labels'
)
do
expect
(
page
).
to
have_content
label
.
title
end
end
it
'shows option to create a project label'
do
page
.
within
(
'.block.labels'
)
do
expect
(
page
).
to
have_content
'Create project'
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录