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
4a3e1fb7
Commit
4a3e1fb7
authored
Aug 02, 2017
by
Simon Knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix sidebar dropdown values
parent
a62a1a47
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
42 additions
and
16 deletions
+42
-16
app/assets/javascripts/boards/models/issue.js
app/assets/javascripts/boards/models/issue.js
+0
-1
app/assets/javascripts/filtered_search/dropdown_user.js
app/assets/javascripts/filtered_search/dropdown_user.js
+18
-1
app/helpers/boards_helper.rb
app/helpers/boards_helper.rb
+9
-0
app/helpers/search_helper.rb
app/helpers/search_helper.rb
+2
-1
app/views/shared/boards/components/_board.html.haml
app/views/shared/boards/components/_board.html.haml
+1
-1
app/views/shared/boards/components/sidebar/_assignee.html.haml
...iews/shared/boards/components/sidebar/_assignee.html.haml
+3
-3
app/views/shared/boards/components/sidebar/_due_date.html.haml
...iews/shared/boards/components/sidebar/_due_date.html.haml
+2
-2
app/views/shared/boards/components/sidebar/_labels.html.haml
app/views/shared/boards/components/sidebar/_labels.html.haml
+3
-3
app/views/shared/boards/components/sidebar/_milestone.html.haml
...ews/shared/boards/components/sidebar/_milestone.html.haml
+4
-4
No files found.
app/assets/javascripts/boards/models/issue.js
View file @
4a3e1fb7
...
...
@@ -19,7 +19,6 @@ class ListIssue {
this
.
position
=
obj
.
relative_position
||
Infinity
;
this
.
milestone_id
=
obj
.
milestone_id
;
this
.
updateUrl
=
obj
.
update_url
;
this
.
canEdit
=
true
;
//obj.can_edit;
this
.
project_id
=
obj
.
project_id
;
if
(
obj
.
milestone
)
{
...
...
app/assets/javascripts/filtered_search/dropdown_user.js
View file @
4a3e1fb7
...
...
@@ -14,8 +14,8 @@ class DropdownUser extends gl.FilteredSearchDropdown {
params
:
{
per_page
:
20
,
active
:
true
,
project_id
:
this
.
getProjectId
(),
current_user
:
true
,
...
this
.
projectOrGroupId
(),
},
searchValueFunction
:
this
.
getSearchInput
.
bind
(
this
),
loadingTemplate
:
this
.
loadingTemplate
,
...
...
@@ -46,10 +46,27 @@ class DropdownUser extends gl.FilteredSearchDropdown {
super
.
renderContent
(
forceShowList
);
}
getGroupId
()
{
return
this
.
input
.
getAttribute
(
'
data-group-id
'
);
}
getProjectId
()
{
return
this
.
input
.
getAttribute
(
'
data-project-id
'
);
}
projectOrGroupId
()
{
const
projectId
=
this
.
getProjectId
();
const
groupId
=
this
.
getGroupId
();
if
(
groupId
)
{
return
{
group_id
:
groupId
,
};
}
return
{
project_id
:
projectId
,
};
}
getSearchInput
()
{
const
query
=
gl
.
DropdownUtils
.
getSearchInput
(
this
.
input
);
const
{
lastToken
}
=
gl
.
FilteredSearchTokenizer
.
processTokens
(
query
,
this
.
tokenKeys
.
get
());
...
...
app/helpers/boards_helper.rb
View file @
4a3e1fb7
...
...
@@ -54,6 +54,14 @@ module BoardsHelper
@current_board_parent
||=
@project
||
@group
end
def
can_admin_issue
if
@project
can?
(
current_user
,
:admin_issue
,
@project
)
elsif
@group
can?
(
current_user
,
:admin_board
,
@group
)
end
end
def
board_list_data
{
toggle:
"dropdown"
,
...
...
@@ -74,6 +82,7 @@ module BoardsHelper
first_user:
current_user
&
.
username
,
current_user:
'true'
,
project_id:
@project
&
.
try
(
:id
),
group_id:
@group
&
.
try
(
:id
),
null_user:
'true'
,
multi_select:
'true'
,
'dropdown-header'
:
dropdown_options
[
:data
][
:'dropdown-header'
],
...
...
app/helpers/search_helper.rb
View file @
4a3e1fb7
...
...
@@ -143,7 +143,8 @@ module SearchHelper
id:
"filtered-search-
#{
type
}
"
,
placeholder:
'Search or filter results...'
,
data:
{
'project-id'
=>
(
@group
||
@project
).
id
,
'project-id'
=>
@project
&
.
try
(
:id
),
'group-id'
=>
@group
&
.
try
(
:id
),
'username-params'
=>
@users
.
to_json
(
only:
[
:id
,
:username
]),
'base-endpoint'
=>
base_endpoint
}
...
...
app/views/shared/boards/components/_board.html.haml
View file @
4a3e1fb7
...
...
@@ -33,7 +33,7 @@
":disabled"
=>
"disabled"
,
":issue-link-base"
=>
"issueLinkBase"
,
":root-path"
=>
"rootPath"
,
":groupId"
=>
(
current_board_parent
.
id
if
@group
),
":groupId"
=>
(
(
current_board_parent
.
id
if
@group
)
||
'null'
),
"ref"
=>
"board-list"
}
-
if
can?
(
current_user
,
:admin_list
,
current_board_parent
)
%board-blank-state
{
"v-if"
=>
'list.id == "blank"'
}
app/views/shared/boards/components/sidebar/_assignee.html.haml
View file @
4a3e1fb7
...
...
@@ -2,13 +2,13 @@
%template
{
"v-if"
=>
"issue.assignees"
}
%assignee-title
{
":number-of-assignees"
=>
"issue.assignees.length"
,
":loading"
=>
"loadingAssignees"
,
":editable"
=>
"issue.canEdit"
}
":editable"
=>
can_admin_issue
}
%assignees
.value
{
"root-path"
=>
"#{root_url}"
,
":users"
=>
"issue.assignees"
,
":editable"
=>
"issue.canEdit"
,
":editable"
=>
can_admin_issue
,
"@assign-self"
=>
"assignSelf"
}
%template
{
"v-if"
=>
"issue.canEdit"
}
-
if
can_admin_issue
.selectbox.hide-collapsed
%input
.js-vue
{
type:
"hidden"
,
name:
"issue[assignee_ids][]"
,
...
...
app/views/shared/boards/components/sidebar/_due_date.html.haml
View file @
4a3e1fb7
.block.due_date
.title
Due date
%template
{
"v-if"
=>
"issue.canEdit"
}
-
if
can_admin_issue
=
icon
(
"spinner spin"
,
class:
"block-loading"
)
=
link_to
"Edit"
,
"#"
,
class:
"edit-link pull-right"
.value
...
...
@@ -15,7 +15,7 @@
\-
%a
.js-remove-due-date
{
href:
"#"
,
role:
"button"
}
remove due date
%template
{
"v-if"
=>
"issue.canEdit"
}
-
if
can_admin_issue
.selectbox
%input
{
type:
"hidden"
,
name:
"issue[due_date]"
,
...
...
app/views/shared/boards/components/sidebar/_labels.html.haml
View file @
4a3e1fb7
.block.labels
.title
Labels
%template
{
"v-if"
=>
"issue.canEdit"
}
-
if
can_admin_issue
=
icon
(
"spinner spin"
,
class:
"block-loading"
)
=
link_to
"Edit"
,
"#"
,
class:
"edit-link pull-right"
.value.issuable-show-labels
...
...
@@ -11,7 +11,7 @@
"v-for"
=>
"label in issue.labels"
}
%span
.label.color-label.has-tooltip
{
":style"
=>
"{ backgroundColor: label.color, color: label.textColor }"
}
{{ label.title }}
%template
{
"v-if"
=>
"issue.canEdit"
}
-
if
can_admin_issue
.selectbox
%input
{
type:
"hidden"
,
name:
"issue[label_names][]"
,
...
...
@@ -24,7 +24,7 @@
show_no:
"true"
,
show_any:
"true"
,
project_id:
@project
&
.
try
(
:id
),
labels:
(
project_labels_path
(
@project
,
:json
)
if
@project
),
labels:
labels_filter_path
(
true
),
namespace_path:
@project
.
try
(
:namespace
).
try
(
:full_path
),
project_path:
@project
.
try
(
:path
)
},
":data-issue-update"
=>
"'#{@issues_path}/' + issue.id + '.json'"
}
...
...
app/views/shared/boards/components/sidebar/_milestone.html.haml
View file @
4a3e1fb7
.block.milestone
.title
Milestone
-
if
can
?
(
current_user
,
:admin_issue
,
@project
)
-
if
can
_admin_issue
=
icon
(
"spinner spin"
,
class:
"block-loading"
)
=
link_to
"Edit"
,
"#"
,
class:
"edit-link pull-right"
.value
...
...
@@ -9,17 +9,17 @@
None
%span
.bold.has-tooltip
{
"v-if"
=>
"issue.milestone"
}
{{ issue.milestone.title }}
-
if
can
?
(
current_user
,
:admin_issue
,
@project
)
-
if
can
_admin_issue
.selectbox
%input
{
type:
"hidden"
,
":value"
=>
"issue.milestone.id"
,
name:
"issue[milestone_id]"
,
"v-if"
=>
"issue.milestone"
}
.dropdown
%button
.dropdown-menu-toggle.js-milestone-select.js-issue-board-sidebar
{
type:
"button"
,
data:
{
toggle:
"dropdown"
,
show_no:
"true"
,
field_name:
"issue[milestone_id]"
,
project_id:
@project
.
id
,
milestones:
project_milestones_path
(
@project
,
: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-issuable-id"
=>
"issue.id"
,
":data-issue-update"
=>
"'#{
project_issues_path(@project)
}/' + issue.id + '.json'"
}
":data-issue-update"
=>
"'#{
milestones_label_path
}/' + issue.id + '.json'"
}
Milestone
=
icon
(
"chevron-down"
)
.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