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
0b3ff726
Commit
0b3ff726
authored
Aug 07, 2018
by
Constance Okoghenun
Committed by
Mike Greiling
Aug 07, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve "Board label edit drop down is showing incorrect selected labels summary"
parent
821f1a64
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
6 deletions
+34
-6
app/assets/javascripts/boards/components/board_sidebar.js
app/assets/javascripts/boards/components/board_sidebar.js
+10
-0
app/assets/javascripts/gl_dropdown.js
app/assets/javascripts/gl_dropdown.js
+5
-1
app/assets/javascripts/labels_select.js
app/assets/javascripts/labels_select.js
+12
-4
app/views/shared/boards/components/sidebar/_labels.html.haml
app/views/shared/boards/components/sidebar/_labels.html.haml
+2
-1
changelogs/unreleased/44127-board-label-edit-drop-down-is-showing-incorrect-selected-labels-summary.yml
...rop-down-is-showing-incorrect-selected-labels-summary.yml
+5
-0
No files found.
app/assets/javascripts/boards/components/board_sidebar.js
View file @
0b3ff726
...
...
@@ -51,6 +51,16 @@ gl.issueBoards.BoardSidebar = Vue.extend({
canRemove
()
{
return
!
this
.
list
.
preset
;
},
hasLabels
()
{
return
this
.
issue
.
labels
&&
this
.
issue
.
labels
.
length
;
},
labelDropdownTitle
()
{
return
this
.
hasLabels
?
`
${
this
.
issue
.
labels
[
0
].
title
}
${
this
.
issue
.
labels
.
length
-
1
}
+ more`
:
'
Label
'
;
},
selectedLabels
()
{
return
this
.
hasLabels
?
this
.
issue
.
labels
.
map
(
l
=>
l
.
title
).
join
(
'
,
'
)
:
''
;
}
},
watch
:
{
detail
:
{
...
...
app/assets/javascripts/gl_dropdown.js
View file @
0b3ff726
...
...
@@ -616,8 +616,12 @@ GitLabDropdown = (function() {
}
if
(
this
.
options
.
opened
)
{
if
(
this
.
options
.
preserveContext
)
{
this
.
options
.
opened
(
e
);
}
else
{
this
.
options
.
opened
.
call
(
this
,
e
);
}
}
return
this
.
dropdown
.
trigger
(
'
shown.gl.dropdown
'
);
};
...
...
app/assets/javascripts/labels_select.js
View file @
0b3ff726
...
...
@@ -39,7 +39,7 @@ export default class LabelsSelect {
showNo
=
$dropdown
.
data
(
'
showNo
'
);
showAny
=
$dropdown
.
data
(
'
showAny
'
);
showMenuAbove
=
$dropdown
.
data
(
'
showMenuAbove
'
);
defaultLabel
=
$dropdown
.
data
(
'
defaultLabel
'
);
defaultLabel
=
$dropdown
.
data
(
'
defaultLabel
'
)
||
'
Label
'
;
abilityName
=
$dropdown
.
data
(
'
abilityName
'
);
$selectbox
=
$dropdown
.
closest
(
'
.selectbox
'
);
$block
=
$selectbox
.
closest
(
'
.block
'
);
...
...
@@ -244,21 +244,21 @@ export default class LabelsSelect {
var
$dropdownInputField
=
$dropdownParent
.
find
(
'
.dropdown-input-field
'
);
var
isSelected
=
el
!==
null
?
el
.
hasClass
(
'
is-active
'
)
:
false
;
var
{
title
}
=
selected
;
var
title
=
selected
?
selected
.
title
:
null
;
var
selectedLabels
=
this
.
selected
;
if
(
$dropdownInputField
.
length
&&
$dropdownInputField
.
val
().
length
)
{
$dropdownParent
.
find
(
'
.dropdown-input-clear
'
).
trigger
(
'
click
'
);
}
if
(
selected
.
id
===
0
)
{
if
(
selected
&&
selected
.
id
===
0
)
{
this
.
selected
=
[];
return
'
No Label
'
;
}
else
if
(
isSelected
)
{
this
.
selected
.
push
(
title
);
}
else
{
else
if
(
!
isSelected
&&
title
)
{
var
index
=
this
.
selected
.
indexOf
(
title
);
this
.
selected
.
splice
(
index
,
1
);
}
...
...
@@ -409,6 +409,14 @@ export default class LabelsSelect {
}
}
},
opened
:
function
(
e
)
{
if
(
$dropdown
.
hasClass
(
'
js-issue-board-sidebar
'
))
{
const
previousSelection
=
$dropdown
.
attr
(
'
data-selected
'
);
this
.
selected
=
previousSelection
?
previousSelection
.
split
(
'
,
'
)
:
[];
$dropdown
.
data
(
'
glDropdown
'
).
updateLabel
();
}
},
preserveContext
:
true
,
});
// Set dropdown data
...
...
app/views/shared/boards/components/sidebar/_labels.html.haml
View file @
0b3ff726
...
...
@@ -19,6 +19,7 @@
":value"
=>
"label.id"
}
.dropdown
%button
.dropdown-menu-toggle.js-label-select.js-multiselect.js-issue-board-sidebar
{
type:
"button"
,
"v-bind:data-selected"
=>
"selectedLabels"
,
data:
{
toggle:
"dropdown"
,
field_name:
"issue[label_names][]"
,
show_no:
"true"
,
...
...
@@ -28,7 +29,7 @@
namespace_path:
@namespace_path
,
project_path:
@project
.
try
(
:path
)
}
}
%span
.dropdown-toggle-text
=
_
(
"Label"
)
{{ labelDropdownTitle }}
=
icon
(
'chevron-down'
)
.dropdown-menu.dropdown-select.dropdown-menu-paging.dropdown-menu-labels.dropdown-menu-selectable
=
render
partial:
"shared/issuable/label_page_default"
...
...
changelogs/unreleased/44127-board-label-edit-drop-down-is-showing-incorrect-selected-labels-summary.yml
0 → 100644
View file @
0b3ff726
---
title
:
Board label edit dropdown shows incorrect selected labels summary
merge_request
:
20673
author
:
type
:
fixed
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