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
6ff83017
Commit
6ff83017
authored
Oct 02, 2017
by
Simon Knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update labels
parent
2dbc6b05
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
18 deletions
+46
-18
app/assets/javascripts/boards/boards_bundle.js
app/assets/javascripts/boards/boards_bundle.js
+7
-9
app/assets/javascripts/boards/components/board_form.vue
app/assets/javascripts/boards/components/board_form.vue
+1
-0
app/assets/javascripts/boards/components/labels_select.vue
app/assets/javascripts/boards/components/labels_select.vue
+18
-1
app/assets/javascripts/boards/services/board_service.js
app/assets/javascripts/boards/services/board_service.js
+3
-1
app/helpers/boards_helper.rb
app/helpers/boards_helper.rb
+1
-6
ee/app/helpers/ee/boards_helper.rb
ee/app/helpers/ee/boards_helper.rb
+16
-1
No files found.
app/assets/javascripts/boards/boards_bundle.js
View file @
6ff83017
...
@@ -73,6 +73,7 @@ $(() => {
...
@@ -73,6 +73,7 @@ $(() => {
authorUsername
:
$boardApp
.
dataset
.
boardAuthorUsername
,
authorUsername
:
$boardApp
.
dataset
.
boardAuthorUsername
,
assigneeUsername
:
$boardApp
.
dataset
.
boardAssigneeUsername
,
assigneeUsername
:
$boardApp
.
dataset
.
boardAssigneeUsername
,
labelIds
:
$boardApp
.
dataset
.
label_ids
||
[],
labelIds
:
$boardApp
.
dataset
.
label_ids
||
[],
labels
:
JSON
.
parse
(
$boardApp
.
dataset
.
labels
||
[]),
defaultAvatar
:
$boardApp
.
dataset
.
defaultAvatar
,
defaultAvatar
:
$boardApp
.
dataset
.
defaultAvatar
,
cantEdit
:
[],
cantEdit
:
[],
},
},
...
@@ -95,15 +96,12 @@ $(() => {
...
@@ -95,15 +96,12 @@ $(() => {
updateFilterPath
(
'
weight
'
,
this
.
weight
,
'
weight
'
);
updateFilterPath
(
'
weight
'
,
this
.
weight
,
'
weight
'
);
updateFilterPath
(
'
author_username
'
,
this
.
authorUsername
,
'
author
'
);
updateFilterPath
(
'
author_username
'
,
this
.
authorUsername
,
'
author
'
);
updateFilterPath
(
'
assignee_username
'
,
this
.
assigneeUsername
,
'
assignee
'
);
updateFilterPath
(
'
assignee_username
'
,
this
.
assigneeUsername
,
'
assignee
'
);
this
.
labels
.
forEach
((
label
)
=>
{
if
(
this
.
labelIds
.
length
>
0
)
{
const
querystring
=
`label_id[]=
${
label
.
title
}
`
;
this
.
labelsIds
.
forEach
((
labelId
)
=>
{
const
querystring
=
`label_id[]=
${
labelId
}
`
;
Store
.
filter
.
path
=
[
querystring
].
concat
(
Store
.
filter
.
path
=
[
querystring
].
concat
(
Store
.
filter
.
path
.
split
(
'
&
'
).
filter
(
param
=>
param
.
match
(
new
RegExp
(
`^
${
querystring
}
$`
,
'
g
'
))
===
null
)
Store
.
filter
.
path
.
split
(
'
&
'
).
filter
(
param
=>
param
.
match
(
new
RegExp
(
`^
${
querystring
}
$`
,
'
g
'
))
===
null
)
).
join
(
'
&
'
);
).
join
(
'
&
'
);
});
});
}
Store
.
updateFiltersUrl
(
true
);
Store
.
updateFiltersUrl
(
true
);
...
...
app/assets/javascripts/boards/components/board_form.vue
View file @
6ff83017
...
@@ -73,6 +73,7 @@
...
@@ -73,6 +73,7 @@
<form-block>
<form-block>
<board-labels-select
<board-labels-select
:board=
"board"
:board=
"board"
:selected=
"board.labels"
title=
"Labels"
title=
"Labels"
default-text=
"Any label"
default-text=
"Any label"
:can-edit=
"canAdminBoard"
:can-edit=
"canAdminBoard"
...
...
app/assets/javascripts/boards/components/labels_select.vue
View file @
6ff83017
...
@@ -31,10 +31,18 @@
...
@@ -31,10 +31,18 @@
</div>
</div>
<div
class=
"selectbox"
style=
"display: none"
>
<div
class=
"selectbox"
style=
"display: none"
>
<input
type=
"hidden"
name=
"label_id[]"
v-for=
"labelId in labelIds"
:key=
"labelId"
:value=
"labelId"
>
<div
class=
"dropdown"
>
<div
class=
"dropdown"
>
<button
<button
class=
"dropdown-menu-toggle wide js-label-select js-multiselect js-board-config-modal"
class=
"dropdown-menu-toggle wide js-label-select js-multiselect js-board-config-modal"
data-field-name=
"
issue[label_names]
[]"
data-field-name=
"
label_id
[]"
v-bind:data-labels=
"labelsPath"
v-bind:data-labels=
"labelsPath"
data-toggle=
"dropdown"
data-toggle=
"dropdown"
type=
"button"
type=
"button"
...
@@ -98,6 +106,10 @@ export default {
...
@@ -98,6 +106,10 @@ export default {
required
:
false
,
required
:
false
,
default
:
false
,
default
:
false
,
},
},
selected
:
{
type
:
Array
,
required
:
true
,
},
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -108,6 +120,11 @@ export default {
...
@@ -108,6 +120,11 @@ export default {
components
:
{
components
:
{
loadingIcon
,
loadingIcon
,
},
},
computed
:
{
labelIds
()
{
return
this
.
selected
.
map
(
label
=>
label
.
id
).
join
(
'
,
'
);
},
},
methods
:
{
methods
:
{
open
()
{
open
()
{
this
.
isOpen
=
true
;
this
.
isOpen
=
true
;
...
...
app/assets/javascripts/boards/services/board_service.js
View file @
6ff83017
...
@@ -31,7 +31,9 @@ class BoardService {
...
@@ -31,7 +31,9 @@ class BoardService {
createBoard
(
board
)
{
createBoard
(
board
)
{
if
(
board
.
labels
&&
board
.
labels
.
length
>
0
)
{
if
(
board
.
labels
&&
board
.
labels
.
length
>
0
)
{
board
.
label_ids
=
board
.
labels
.
map
(
b
=>
b
.
id
);
board
.
board
=
board
.
board
||
{};
board
.
board
.
label_ids
=
board
.
labels
.
map
(
b
=>
b
.
id
);
board
.
board
.
milestone_id
=
board
.
milestone_id
;
}
}
if
(
board
.
assignee
)
{
if
(
board
.
assignee
)
{
board
.
assignee_id
=
board
.
assignee
.
id
;
board
.
assignee_id
=
board
.
assignee
.
id
;
...
...
app/helpers/boards_helper.rb
View file @
6ff83017
...
@@ -26,12 +26,7 @@ module BoardsHelper
...
@@ -26,12 +26,7 @@ module BoardsHelper
board
=
@board
||
@boards
.
first
board
=
@board
||
@boards
.
first
board
.
to_json
(
board
.
to_json
(
only:
[
:id
,
:name
,
:milestone_id
,
:author_id
,
:assignee_id
,
:weight
],
only:
[
:id
,
:name
,
:milestone_id
],
include:
{
milestone:
{
only:
[
:title
]
},
author:
{
only:
[
:name
,
:username
],
methods:
[
:avatar_url
]
},
assignee:
{
only:
[
:name
,
:username
],
methods:
[
:avatar_url
]
}
}
)
)
end
end
...
...
ee/app/helpers/ee/boards_helper.rb
View file @
6ff83017
...
@@ -9,10 +9,11 @@ module EE
...
@@ -9,10 +9,11 @@ module EE
board_milestone_title:
board
&
.
milestone
&
.
title
,
board_milestone_title:
board
&
.
milestone
&
.
title
,
board_author_username:
board
&
.
author
&
.
username
,
board_author_username:
board
&
.
author
&
.
username
,
board_assignee_username:
board
&
.
assignee
&
.
username
,
board_assignee_username:
board
&
.
assignee
&
.
username
,
label_ids:
board
&
.
label_ids
,
labels:
board
&
.
labels
.
to_json
(
only:
[
:id
,
:title
,
:color
]
),
board_weight:
board
&
.
weight
,
board_weight:
board
&
.
weight
,
focus_mode_available:
parent
.
feature_available?
(
:issue_board_focus_mode
).
to_s
,
focus_mode_available:
parent
.
feature_available?
(
:issue_board_focus_mode
).
to_s
,
show_promotion:
(
@project
&&
show_promotions?
&&
(
!
@project
.
feature_available?
(
:multiple_issue_boards
)
||
!
@project
.
feature_available?
(
:scoped_issue_board
)
||
!
@project
.
feature_available?
(
:issue_board_focus_mode
))).
to_s
show_promotion:
(
@project
&&
show_promotions?
&&
(
!
@project
.
feature_available?
(
:multiple_issue_boards
)
||
!
@project
.
feature_available?
(
:scoped_issue_board
)
||
!
@project
.
feature_available?
(
:issue_board_focus_mode
))).
to_s
}
}
super
.
merge
(
data
)
super
.
merge
(
data
)
...
@@ -24,6 +25,20 @@ module EE
...
@@ -24,6 +25,20 @@ module EE
"/
#{
@board
.
group
.
path
}
/:project_path/issues"
"/
#{
@board
.
group
.
path
}
/:project_path/issues"
end
end
def
current_board_json
board
=
@board
||
@boards
.
first
board
.
to_json
(
only:
[
:id
,
:name
,
:milestone_id
,
:author_id
,
:assignee_id
,
:weight
,
:label_ids
],
include:
{
milestone:
{
only:
[
:title
]
},
author:
{
only:
[
:id
,
:name
,
:username
],
methods:
[
:avatar_url
]
},
assignee:
{
only:
[
:id
,
:name
,
:username
],
methods:
[
:avatar_url
]
},
labels:
{
only:
[
:title
,
:color
,
:id
]
}
}
)
end
def
board_base_url
def
board_base_url
if
board
.
group_board?
if
board
.
group_board?
group_boards_url
(
@group
)
group_boards_url
(
@group
)
...
...
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