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
23d9d9bb
Commit
23d9d9bb
authored
Aug 02, 2017
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue creation, issue card link, issue sidebar assignee for group boards
parent
514a5b25
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
70 additions
and
17 deletions
+70
-17
app/assets/javascripts/boards/boards_bundle.js
app/assets/javascripts/boards/boards_bundle.js
+1
-0
app/assets/javascripts/boards/components/board_card.js
app/assets/javascripts/boards/components/board_card.js
+2
-0
app/assets/javascripts/boards/components/board_list.js
app/assets/javascripts/boards/components/board_list.js
+1
-0
app/assets/javascripts/boards/components/board_sidebar.js
app/assets/javascripts/boards/components/board_sidebar.js
+5
-1
app/assets/javascripts/boards/components/issue_card_inner.js
app/assets/javascripts/boards/components/issue_card_inner.js
+11
-1
app/assets/javascripts/boards/models/issue.js
app/assets/javascripts/boards/models/issue.js
+9
-1
app/assets/javascripts/boards/models/project.js
app/assets/javascripts/boards/models/project.js
+10
-0
app/controllers/boards/issues_controller.rb
app/controllers/boards/issues_controller.rb
+7
-4
app/controllers/groups/boards_controller.rb
app/controllers/groups/boards_controller.rb
+0
-1
app/controllers/projects/boards_controller.rb
app/controllers/projects/boards_controller.rb
+0
-1
app/helpers/boards_helper.rb
app/helpers/boards_helper.rb
+11
-3
app/services/boards/issues/create_service.rb
app/services/boards/issues/create_service.rb
+9
-1
app/views/shared/boards/components/sidebar/_assignee.html.haml
...iews/shared/boards/components/sidebar/_assignee.html.haml
+1
-1
app/views/shared/boards/components/sidebar/_due_date.html.haml
...iews/shared/boards/components/sidebar/_due_date.html.haml
+1
-1
app/views/shared/boards/components/sidebar/_labels.html.haml
app/views/shared/boards/components/sidebar/_labels.html.haml
+1
-1
app/views/shared/boards/components/sidebar/_milestone.html.haml
...ews/shared/boards/components/sidebar/_milestone.html.haml
+1
-1
No files found.
app/assets/javascripts/boards/boards_bundle.js
View file @
23d9d9bb
...
@@ -10,6 +10,7 @@ import './models/issue';
...
@@ -10,6 +10,7 @@ import './models/issue';
import
'
./models/label
'
;
import
'
./models/label
'
;
import
'
./models/list
'
;
import
'
./models/list
'
;
import
'
./models/milestone
'
;
import
'
./models/milestone
'
;
import
'
./models/project
'
;
import
'
./models/assignee
'
;
import
'
./models/assignee
'
;
import
'
./stores/boards_store
'
;
import
'
./stores/boards_store
'
;
import
'
./stores/modal_store
'
;
import
'
./stores/modal_store
'
;
...
...
app/assets/javascripts/boards/components/board_card.js
View file @
23d9d9bb
...
@@ -16,6 +16,7 @@ export default {
...
@@ -16,6 +16,7 @@ export default {
:list="list"
:list="list"
:issue="issue"
:issue="issue"
:issue-link-base="issueLinkBase"
:issue-link-base="issueLinkBase"
:group-id="groupId"
:root-path="rootPath"
:root-path="rootPath"
:update-filters="true" />
:update-filters="true" />
</li>
</li>
...
@@ -30,6 +31,7 @@ export default {
...
@@ -30,6 +31,7 @@ export default {
disabled
:
Boolean
,
disabled
:
Boolean
,
index
:
Number
,
index
:
Number
,
rootPath
:
String
,
rootPath
:
String
,
groupId
:
Number
,
},
},
data
()
{
data
()
{
return
{
return
{
...
...
app/assets/javascripts/boards/components/board_list.js
View file @
23d9d9bb
...
@@ -188,6 +188,7 @@ export default {
...
@@ -188,6 +188,7 @@ export default {
:list="list"
:list="list"
:issue="issue"
:issue="issue"
:issue-link-base="issueLinkBase"
:issue-link-base="issueLinkBase"
:group-id="groupId"
:root-path="rootPath"
:root-path="rootPath"
:disabled="disabled"
:disabled="disabled"
:key="issue.id" />
:key="issue.id" />
...
...
app/assets/javascripts/boards/components/board_sidebar.js
View file @
23d9d9bb
...
@@ -59,7 +59,11 @@ gl.issueBoards.BoardSidebar = Vue.extend({
...
@@ -59,7 +59,11 @@ gl.issueBoards.BoardSidebar = Vue.extend({
this
.
list
=
this
.
detail
.
list
;
this
.
list
=
this
.
detail
.
list
;
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
endpoint
=
this
.
$refs
.
assigneeDropdown
.
dataset
.
issueUpdate
;
var
issueUrl
=
this
.
$refs
.
assigneeDropdown
.
dataset
.
issueUpdate
issueUrl
=
issueUrl
.
replace
(
"
:project_path
"
,
this
.
issue
.
project
.
path
);
this
.
endpoint
=
issueUrl
;
});
});
},
},
deep
:
true
deep
:
true
...
...
app/assets/javascripts/boards/components/issue_card_inner.js
View file @
23d9d9bb
...
@@ -31,6 +31,10 @@ gl.issueBoards.IssueCardInner = Vue.extend({
...
@@ -31,6 +31,10 @@ gl.issueBoards.IssueCardInner = Vue.extend({
required
:
false
,
required
:
false
,
default
:
false
,
default
:
false
,
},
},
groupId
:
{
type
:
Number
,
required
:
false
,
},
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -64,7 +68,13 @@ gl.issueBoards.IssueCardInner = Vue.extend({
...
@@ -64,7 +68,13 @@ gl.issueBoards.IssueCardInner = Vue.extend({
return
this
.
issue
.
assignees
.
length
>
this
.
numberOverLimit
;
return
this
.
issue
.
assignees
.
length
>
this
.
numberOverLimit
;
},
},
cardUrl
()
{
cardUrl
()
{
return
`
${
this
.
issueLinkBase
}
/
${
this
.
issue
.
id
}
`
;
var
baseUrl
=
this
.
issueLinkBase
;
if
(
this
.
groupId
)
{
baseUrl
=
this
.
issueLinkBase
.
replace
(
"
:project_path
"
,
this
.
issue
.
project
.
path
);
}
return
`
${
baseUrl
}
/
${
this
.
issue
.
id
}
`
;
},
},
issueId
()
{
issueId
()
{
return
`#
${
this
.
issue
.
id
}
`
;
return
`#
${
this
.
issue
.
id
}
`
;
...
...
app/assets/javascripts/boards/models/issue.js
View file @
23d9d9bb
/* eslint-disable no-unused-vars, space-before-function-paren, arrow-body-style, arrow-parens, comma-dangle, max-len */
/* eslint-disable no-unused-vars, space-before-function-paren, arrow-body-style, arrow-parens, comma-dangle, max-len */
/* global ListLabel */
/* global ListLabel */
/* global ListMilestone */
/* global ListMilestone */
/* global IssueProject */
/* global ListAssignee */
/* global ListAssignee */
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
...
@@ -19,7 +20,10 @@ class ListIssue {
...
@@ -19,7 +20,10 @@ class ListIssue {
this
.
position
=
obj
.
relative_position
||
Infinity
;
this
.
position
=
obj
.
relative_position
||
Infinity
;
this
.
milestone_id
=
obj
.
milestone_id
;
this
.
milestone_id
=
obj
.
milestone_id
;
this
.
updateUrl
=
obj
.
update_url
;
this
.
updateUrl
=
obj
.
update_url
;
this
.
project_id
=
obj
.
project_id
;
if
(
obj
.
project
)
{
this
.
project
=
new
IssueProject
(
obj
.
project
);
}
if
(
obj
.
milestone
)
{
if
(
obj
.
milestone
)
{
this
.
milestone
=
new
ListMilestone
(
obj
.
milestone
);
this
.
milestone
=
new
ListMilestone
(
obj
.
milestone
);
...
@@ -32,6 +36,10 @@ class ListIssue {
...
@@ -32,6 +36,10 @@ class ListIssue {
this
.
assignees
=
obj
.
assignees
.
map
(
a
=>
new
ListAssignee
(
a
,
defaultAvatar
));
this
.
assignees
=
obj
.
assignees
.
map
(
a
=>
new
ListAssignee
(
a
,
defaultAvatar
));
}
}
updateUrl
()
{
"
vsf
"
}
addLabel
(
label
)
{
addLabel
(
label
)
{
if
(
!
this
.
findLabel
(
label
))
{
if
(
!
this
.
findLabel
(
label
))
{
this
.
labels
.
push
(
new
ListLabel
(
label
));
this
.
labels
.
push
(
new
ListLabel
(
label
));
...
...
app/assets/javascripts/boards/models/project.js
0 → 100644
View file @
23d9d9bb
/* eslint-disable no-unused-vars */
class
IssueProject
{
constructor
(
obj
)
{
this
.
id
=
obj
.
id
;
this
.
path
=
obj
.
path
;
}
}
window
.
IssueProject
=
IssueProject
;
app/controllers/boards/issues_controller.rb
View file @
23d9d9bb
...
@@ -18,7 +18,7 @@ module Boards
...
@@ -18,7 +18,7 @@ module Boards
end
end
def
create
def
create
service
=
Boards
::
Issues
::
CreateService
.
new
(
project
,
current_user
,
issue_params
)
service
=
Boards
::
Issues
::
CreateService
.
new
(
board_parent
,
project
,
current_user
,
issue_params
)
issue
=
service
.
execute
issue
=
service
.
execute
if
issue
.
valid?
if
issue
.
valid?
...
@@ -64,7 +64,7 @@ module Boards
...
@@ -64,7 +64,7 @@ module Boards
def
project
def
project
@project
||=
@project
||=
board
.
is_group_board?
?
Project
.
find
(
params
[
:project_id
])
:
board
.
parent
board
.
is_group_board?
?
Project
.
find
(
issue_
params
[
:project_id
])
:
board
.
parent
end
end
def
move_params
def
move_params
...
@@ -72,14 +72,17 @@ module Boards
...
@@ -72,14 +72,17 @@ module Boards
end
end
def
issue_params
def
issue_params
params
.
require
(
:issue
).
permit
(
:title
,
:milestone_id
).
merge
(
board_id:
params
[
:board_id
],
list_id:
params
[
:list_id
],
request:
request
)
params
.
require
(
:issue
).
permit
(
:title
,
:milestone_id
,
:project_id
).
merge
(
board_id:
params
[
:board_id
],
list_id:
params
[
:list_id
],
request:
request
)
end
end
def
serialize_as_json
(
resource
)
def
serialize_as_json
(
resource
)
resource
.
as_json
(
resource
.
preload
(
:project
).
as_json
(
labels:
true
,
labels:
true
,
only:
[
:id
,
:iid
,
:title
,
:confidential
,
:due_date
,
:relative_position
],
only:
[
:id
,
:iid
,
:title
,
:confidential
,
:due_date
,
:relative_position
],
include:
{
include:
{
project:
{
only:
[
:id
,
:path
]
},
assignees:
{
only:
[
:id
,
:name
,
:username
],
methods:
[
:avatar_url
]
},
assignees:
{
only:
[
:id
,
:name
,
:username
],
methods:
[
:avatar_url
]
},
milestone:
{
only:
[
:id
,
:title
]
}
milestone:
{
only:
[
:id
,
:title
]
}
},
},
...
...
app/controllers/groups/boards_controller.rb
View file @
23d9d9bb
...
@@ -19,7 +19,6 @@ class Groups::BoardsController < Groups::ApplicationController
...
@@ -19,7 +19,6 @@ class Groups::BoardsController < Groups::ApplicationController
def
assign_endpoint_vars
def
assign_endpoint_vars
@boards_endpoint
=
group_boards_path
(
group
)
@boards_endpoint
=
group_boards_path
(
group
)
@issues_path
=
issues_group_path
(
group
)
@namespace_path
=
group
.
path
@namespace_path
=
group
.
path
@labels_endpoint
=
group_labels_path
(
group
)
@labels_endpoint
=
group_labels_path
(
group
)
end
end
...
...
app/controllers/projects/boards_controller.rb
View file @
23d9d9bb
...
@@ -22,7 +22,6 @@ class Projects::BoardsController < Projects::ApplicationController
...
@@ -22,7 +22,6 @@ class Projects::BoardsController < Projects::ApplicationController
def
assign_endpoint_vars
def
assign_endpoint_vars
@boards_endpoint
=
project_boards_path
(
project
)
@boards_endpoint
=
project_boards_path
(
project
)
@issues_path
=
project_issues_path
(
project
)
@bulk_issues_path
=
bulk_update_project_issues_path
(
project
)
@bulk_issues_path
=
bulk_update_project_issues_path
(
project
)
@namespace_path
=
project
.
namespace
.
path
@namespace_path
=
project
.
namespace
.
path
@labels_endpoint
=
project_labels_path
(
project
)
@labels_endpoint
=
project_labels_path
(
project
)
...
...
app/helpers/boards_helper.rb
View file @
23d9d9bb
module
BoardsHelper
module
BoardsHelper
prepend
EE
::
BoardsHelper
prepend
EE
::
BoardsHelper
def
board_data
def
board
board
=
@board
||
@boards
.
first
@board
||=
@board
||
@boards
.
first
end
def
board_data
{
{
boards_endpoint:
@boards_endpoint
,
boards_endpoint:
@boards_endpoint
,
lists_endpoint:
board_lists_path
(
board
),
lists_endpoint:
board_lists_path
(
board
),
board_id:
board
.
id
,
board_id:
board
.
id
,
board_milestone_title:
board
&
.
milestone
&
.
title
,
board_milestone_title:
board
&
.
milestone
&
.
title
,
disabled:
"
#{
!
can?
(
current_user
,
:admin_list
,
current_board_parent
)
}
"
,
disabled:
"
#{
!
can?
(
current_user
,
:admin_list
,
current_board_parent
)
}
"
,
issue_link_base:
@issues_path
,
issue_link_base:
build_issue_link_base
,
root_path:
root_path
,
root_path:
root_path
,
bulk_update_path:
@bulk_issues_path
,
bulk_update_path:
@bulk_issues_path
,
default_avatar:
image_path
(
default_avatar
)
default_avatar:
image_path
(
default_avatar
)
}
}
end
end
def
build_issue_link_base
return
project_issues_path
(
@project
)
unless
@board
.
is_group_board?
"/
#{
@board
.
group
.
path
}
/:project_path/issues"
end
def
current_board_json
def
current_board_json
board
=
@board
||
@boards
.
first
board
=
@board
||
@boards
.
first
...
...
app/services/boards/issues/create_service.rb
View file @
23d9d9bb
module
Boards
module
Boards
module
Issues
module
Issues
class
CreateService
<
BaseService
class
CreateService
<
BaseService
attr_accessor
:project
def
initialize
(
parent
,
project
,
user
,
params
=
{})
@project
=
project
super
(
parent
,
user
,
params
)
end
def
execute
def
execute
create_issue
(
params
.
merge
(
label_ids:
[
list
.
label_id
]))
create_issue
(
params
.
merge
(
label_ids:
[
list
.
label_id
]))
end
end
...
@@ -16,7 +24,7 @@ module Boards
...
@@ -16,7 +24,7 @@ module Boards
end
end
def
create_issue
(
params
)
def
create_issue
(
params
)
::
Issues
::
CreateService
.
new
(
p
aren
t
,
current_user
,
params
).
execute
::
Issues
::
CreateService
.
new
(
p
rojec
t
,
current_user
,
params
).
execute
end
end
end
end
end
end
...
...
app/views/shared/boards/components/sidebar/_assignee.html.haml
View file @
23d9d9bb
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
-
dropdown_options
=
issue_assignees_dropdown_options
-
dropdown_options
=
issue_assignees_dropdown_options
%button
.dropdown-menu-toggle.js-user-search.js-author-search.js-multiselect.js-save-user-data.js-issue-board-sidebar
{
type:
'button'
,
ref:
'assigneeDropdown'
,
data:
board_sidebar_user_data
,
%button
.dropdown-menu-toggle.js-user-search.js-author-search.js-multiselect.js-save-user-data.js-issue-board-sidebar
{
type:
'button'
,
ref:
'assigneeDropdown'
,
data:
board_sidebar_user_data
,
":data-issuable-id"
=>
"issue.id"
,
":data-issuable-id"
=>
"issue.id"
,
":data-issue-update"
=>
"'#{
@issues_path
}/' + issue.id + '.json'"
}
":data-issue-update"
=>
"'#{
build_issue_link_base
}/' + issue.id + '.json'"
}
=
dropdown_options
[
:title
]
=
dropdown_options
[
:title
]
=
icon
(
"chevron-down"
)
=
icon
(
"chevron-down"
)
.dropdown-menu.dropdown-select.dropdown-menu-user.dropdown-menu-selectable.dropdown-menu-author
.dropdown-menu.dropdown-select.dropdown-menu-user.dropdown-menu-selectable.dropdown-menu-author
...
...
app/views/shared/boards/components/sidebar/_due_date.html.haml
View file @
23d9d9bb
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
.dropdown
.dropdown
%button
.dropdown-menu-toggle.js-due-date-select.js-issue-boards-due-date
{
type:
'button'
,
%button
.dropdown-menu-toggle.js-due-date-select.js-issue-boards-due-date
{
type:
'button'
,
data:
{
toggle:
'dropdown'
,
field_name:
"issue[due_date]"
,
ability_name:
"issue"
},
data:
{
toggle:
'dropdown'
,
field_name:
"issue[due_date]"
,
ability_name:
"issue"
},
":data-issue-update"
=>
"'#{
@issues_path
}/' + issue.id + '.json'"
}
":data-issue-update"
=>
"'#{
build_issue_link_base
}/' + issue.id + '.json'"
}
%span
.dropdown-toggle-text
Due date
%span
.dropdown-toggle-text
Due date
=
icon
(
'chevron-down'
)
=
icon
(
'chevron-down'
)
.dropdown-menu.dropdown-menu-due-date
.dropdown-menu.dropdown-menu-due-date
...
...
app/views/shared/boards/components/sidebar/_labels.html.haml
View file @
23d9d9bb
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
labels:
labels_filter_path
(
true
),
labels:
labels_filter_path
(
true
),
namespace_path:
@project
.
try
(
:namespace
).
try
(
:full_path
),
namespace_path:
@project
.
try
(
:namespace
).
try
(
:full_path
),
project_path:
@project
.
try
(
:path
)
},
project_path:
@project
.
try
(
:path
)
},
":data-issue-update"
=>
"'#{
@issues_path
}/' + issue.id + '.json'"
}
":data-issue-update"
=>
"'#{
build_issue_link_base
}/' + issue.id + '.json'"
}
%span
.dropdown-toggle-text
%span
.dropdown-toggle-text
Label
Label
=
icon
(
'chevron-down'
)
=
icon
(
'chevron-down'
)
...
...
app/views/shared/boards/components/sidebar/_milestone.html.haml
View file @
23d9d9bb
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
%button
.dropdown-menu-toggle.js-milestone-select.js-issue-board-sidebar
{
type:
"button"
,
data:
{
toggle:
"dropdown"
,
show_no:
"true"
,
field_name:
"issue[milestone_id]"
,
milestones:
milestones_filter_path
(
:json
),
ability_name:
"issue"
,
use_id:
"true"
,
default_no:
"true"
},
%button
.dropdown-menu-toggle.js-milestone-select.js-issue-board-sidebar
{
type:
"button"
,
data:
{
toggle:
"dropdown"
,
show_no:
"true"
,
field_name:
"issue[milestone_id]"
,
milestones:
milestones_filter_path
(
:json
),
ability_name:
"issue"
,
use_id:
"true"
,
default_no:
"true"
},
":data-selected"
=>
"milestoneTitle"
,
":data-selected"
=>
"milestoneTitle"
,
":data-issuable-id"
=>
"issue.id"
,
":data-issuable-id"
=>
"issue.id"
,
":data-issue-update"
=>
"'#{
milestones_label_path
}/' + issue.id + '.json'"
}
":data-issue-update"
=>
"'#{
build_issue_link_base
}/' + issue.id + '.json'"
}
Milestone
Milestone
=
icon
(
"chevron-down"
)
=
icon
(
"chevron-down"
)
.dropdown-menu.dropdown-select.dropdown-menu-selectable
.dropdown-menu.dropdown-select.dropdown-menu-selectable
...
...
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