Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
c352f695
Commit
c352f695
authored
Apr 18, 2018
by
André Luís
Committed by
Mike Greiling
Apr 18, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "View labels when editing labels in sidebar and board sidebar"
parent
8cce96b1
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
43 additions
and
8 deletions
+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
No files found.
app/assets/javascripts/issuable_context.js
View file @
c352f695
...
@@ -30,10 +30,10 @@ export default class IssuableContext {
...
@@ -30,10 +30,10 @@ export default class IssuableContext {
const
$selectbox
=
$block
.
find
(
'
.selectbox
'
);
const
$selectbox
=
$block
.
find
(
'
.selectbox
'
);
if
(
$selectbox
.
is
(
'
:visible
'
))
{
if
(
$selectbox
.
is
(
'
:visible
'
))
{
$selectbox
.
hide
();
$selectbox
.
hide
();
$block
.
find
(
'
.value
'
).
show
();
$block
.
find
(
'
.value
:not(.dont-hide)
'
).
show
();
}
else
{
}
else
{
$selectbox
.
show
();
$selectbox
.
show
();
$block
.
find
(
'
.value
'
).
hide
();
$block
.
find
(
'
.value
:not(.dont-hide)
'
).
hide
();
}
}
if
(
$selectbox
.
is
(
'
:visible
'
))
{
if
(
$selectbox
.
is
(
'
:visible
'
))
{
...
...
app/assets/stylesheets/framework/sidebar.scss
View file @
c352f695
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
.nav-header-btn
{
.nav-header-btn
{
padding
:
10px
$gl-sidebar-padding
;
padding
:
10px
$gl-sidebar-padding
;
color
:
inherit
;
color
:
inherit
;
transition-duration
:
.3s
;
transition-duration
:
0
.3s
;
position
:
absolute
;
position
:
absolute
;
top
:
0
;
top
:
0
;
cursor
:
pointer
;
cursor
:
pointer
;
...
@@ -137,6 +137,12 @@
...
@@ -137,6 +137,12 @@
}
}
}
}
.issuable-sidebar
.labels
{
.value.dont-hide
~
.selectbox
{
padding-top
:
$gl-padding-8
;
}
}
.pikaday-container
{
.pikaday-container
{
.pika-single
{
.pika-single
{
margin-top
:
2px
;
margin-top
:
2px
;
...
@@ -151,4 +157,3 @@
...
@@ -151,4 +157,3 @@
.sidebar-collapsed-icon
.sidebar-collapsed-value
{
.sidebar-collapsed-icon
.sidebar-collapsed-value
{
font-size
:
12px
;
font-size
:
12px
;
}
}
app/views/shared/boards/components/sidebar/_labels.html.haml
View file @
c352f695
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
-
if
can_admin_issue?
-
if
can_admin_issue?
=
icon
(
"spinner spin"
,
class:
"block-loading"
)
=
icon
(
"spinner spin"
,
class:
"block-loading"
)
=
link_to
"Edit"
,
"#"
,
class:
"js-sidebar-dropdown-toggle edit-link pull-right"
=
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"
}
%span
.no-value
{
"v-if"
=>
"issue.labels && issue.labels.length === 0"
}
None
None
%a
{
href:
"#"
,
%a
{
href:
"#"
,
...
...
app/views/shared/issuable/_sidebar.html.haml
View file @
c352f695
...
@@ -96,7 +96,7 @@
...
@@ -96,7 +96,7 @@
=
icon
(
'spinner spin'
,
class:
'hidden block-loading'
,
'aria-hidden'
:
'true'
)
=
icon
(
'spinner spin'
,
class:
'hidden block-loading'
,
'aria-hidden'
:
'true'
)
-
if
can_edit_issuable
-
if
can_edit_issuable
=
link_to
_
(
'Edit'
),
'#'
,
class:
'js-sidebar-dropdown-toggle edit-link pull-right'
=
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?
-
if
selected_labels
.
any?
-
selected_labels
.
each
do
|
label
|
-
selected_labels
.
each
do
|
label
|
=
link_to_label
(
label
,
subject:
issuable
.
project
,
type:
issuable
.
to_ability_name
)
=
link_to_label
(
label
,
subject:
issuable
.
project
,
type:
issuable
.
to_ability_name
)
...
...
changelogs/unreleased/34262-show-current-labels-when-editing.yml
0 → 100644
View file @
c352f695
---
title
:
Keep current labels visible when editing them in the sidebar
merge_request
:
author
:
type
:
changed
spec/features/boards/sidebar_spec.rb
View file @
c352f695
...
@@ -237,6 +237,22 @@ describe 'Issue Boards', :js do
...
@@ -237,6 +237,22 @@ describe 'Issue Boards', :js do
end
end
context
'labels'
do
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
it
'adds a single label'
do
click_card
(
card
)
click_card
(
card
)
...
@@ -296,7 +312,9 @@ describe 'Issue Boards', :js do
...
@@ -296,7 +312,9 @@ describe 'Issue Boards', :js do
wait_for_requests
wait_for_requests
click_link
stretch
.
title
within
(
'.dropdown-menu-labels'
)
do
click_link
stretch
.
title
end
wait_for_requests
wait_for_requests
...
...
spec/features/issues/issue_sidebar_spec.rb
View file @
c352f695
...
@@ -5,9 +5,9 @@ feature 'Issue Sidebar' do
...
@@ -5,9 +5,9 @@ feature 'Issue Sidebar' do
let
(
:group
)
{
create
(
:group
,
:nested
)
}
let
(
:group
)
{
create
(
:group
,
:nested
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
namespace:
group
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
namespace:
group
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let!
(
:user
)
{
create
(
:user
)}
let!
(
:user
)
{
create
(
:user
)}
let!
(
:label
)
{
create
(
:label
,
project:
project
,
title:
'bug'
)
}
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>'
)
}
let!
(
:xss_label
)
{
create
(
:label
,
project:
project
,
title:
'<script>alert("xss");</script>'
)
}
before
do
before
do
...
@@ -112,11 +112,18 @@ feature 'Issue Sidebar' do
...
@@ -112,11 +112,18 @@ feature 'Issue Sidebar' do
context
'editing issue labels'
,
:js
do
context
'editing issue labels'
,
:js
do
before
do
before
do
issue
.
update_attributes
(
labels:
[
label
])
page
.
within
(
'.block.labels'
)
do
page
.
within
(
'.block.labels'
)
do
find
(
'.edit-link'
).
click
find
(
'.edit-link'
).
click
end
end
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
it
'shows option to create a project label'
do
page
.
within
(
'.block.labels'
)
do
page
.
within
(
'.block.labels'
)
do
expect
(
page
).
to
have_content
'Create project'
expect
(
page
).
to
have_content
'Create project'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment