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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
af87e40a
Commit
af87e40a
authored
Nov 01, 2018
by
Chantal Rollison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed label removal from issue
parent
74b5dce4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
5 deletions
+8
-5
app/models/label.rb
app/models/label.rb
+1
-1
app/services/boards/issues/move_service.rb
app/services/boards/issues/move_service.rb
+1
-3
changelogs/unreleased/ccr-51052_keep_labels_on_issue.yml
changelogs/unreleased/ccr-51052_keep_labels_on_issue.yml
+5
-0
spec/support/shared_examples/services/boards/issues_move_service.rb
...rt/shared_examples/services/boards/issues_move_service.rb
+1
-1
No files found.
app/models/label.rb
View file @
af87e40a
...
@@ -41,8 +41,8 @@ class Label < ActiveRecord::Base
...
@@ -41,8 +41,8 @@ class Label < ActiveRecord::Base
scope
:templates
,
->
{
where
(
template:
true
)
}
scope
:templates
,
->
{
where
(
template:
true
)
}
scope
:with_title
,
->
(
title
)
{
where
(
title:
title
)
}
scope
:with_title
,
->
(
title
)
{
where
(
title:
title
)
}
scope
:with_lists_and_board
,
->
{
joins
(
lists: :board
).
merge
(
List
.
movable
)
}
scope
:with_lists_and_board
,
->
{
joins
(
lists: :board
).
merge
(
List
.
movable
)
}
scope
:on_group_boards
,
->
(
group_id
)
{
with_lists_and_board
.
where
(
boards:
{
group_id:
group_id
})
}
scope
:on_project_boards
,
->
(
project_id
)
{
with_lists_and_board
.
where
(
boards:
{
project_id:
project_id
})
}
scope
:on_project_boards
,
->
(
project_id
)
{
with_lists_and_board
.
where
(
boards:
{
project_id:
project_id
})
}
scope
:on_board
,
->
(
board_id
)
{
with_lists_and_board
.
where
(
boards:
{
id:
board_id
})
}
scope
:order_name_asc
,
->
{
reorder
(
title: :asc
)
}
scope
:order_name_asc
,
->
{
reorder
(
title: :asc
)
}
scope
:order_name_desc
,
->
{
reorder
(
title: :desc
)
}
scope
:order_name_desc
,
->
{
reorder
(
title: :desc
)
}
scope
:subscribed_by
,
->
(
user_id
)
{
joins
(
:subscriptions
).
where
(
subscriptions:
{
user_id:
user_id
,
subscribed:
true
})
}
scope
:subscribed_by
,
->
(
user_id
)
{
joins
(
:subscriptions
).
where
(
subscriptions:
{
user_id:
user_id
,
subscribed:
true
})
}
...
...
app/services/boards/issues/move_service.rb
View file @
af87e40a
...
@@ -70,10 +70,8 @@ module Boards
...
@@ -70,10 +70,8 @@ module Boards
label_ids
=
label_ids
=
if
moving_to_list
.
movable?
if
moving_to_list
.
movable?
moving_from_list
.
label_id
moving_from_list
.
label_id
elsif
board
.
group_board?
::
Label
.
on_group_boards
(
parent
.
id
).
pluck
(
:label_id
)
else
else
::
Label
.
on_
project_boards
(
parent
.
id
).
pluck
(
:label_id
)
::
Label
.
on_
board
(
board
.
id
).
pluck
(
:label_id
)
end
end
Array
(
label_ids
).
compact
Array
(
label_ids
).
compact
...
...
changelogs/unreleased/ccr-51052_keep_labels_on_issue.yml
0 → 100644
View file @
af87e40a
---
title
:
Fixed label removal from issue
merge_request
:
22762
author
:
type
:
fixed
spec/support/shared_examples/services/boards/issues_move_service.rb
View file @
af87e40a
...
@@ -34,7 +34,7 @@ shared_examples 'issues move service' do |group|
...
@@ -34,7 +34,7 @@ shared_examples 'issues move service' do |group|
described_class
.
new
(
parent
,
user
,
params
).
execute
(
issue
)
described_class
.
new
(
parent
,
user
,
params
).
execute
(
issue
)
issue
.
reload
issue
.
reload
expect
(
issue
.
labels
).
to
contain_exactly
(
bug
)
expect
(
issue
.
labels
).
to
contain_exactly
(
bug
,
regression
)
expect
(
issue
).
to
be_closed
expect
(
issue
).
to
be_closed
end
end
end
end
...
...
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