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
Boxiang Sun
gitlab-ce
Commits
16ba5eb4
Commit
16ba5eb4
authored
Mar 11, 2016
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates sidebar milestone to use new dropdowns
parent
63c8a05b
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
44 additions
and
16 deletions
+44
-16
app/assets/javascripts/api.js.coffee
app/assets/javascripts/api.js.coffee
+21
-0
app/assets/javascripts/gl_dropdown.js.coffee
app/assets/javascripts/gl_dropdown.js.coffee
+2
-1
app/assets/javascripts/milestone_select.js.coffee
app/assets/javascripts/milestone_select.js.coffee
+12
-9
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+1
-0
app/views/projects/merge_requests/_show.html.haml
app/views/projects/merge_requests/_show.html.haml
+1
-1
app/views/shared/issuable/_filter.html.haml
app/views/shared/issuable/_filter.html.haml
+3
-1
app/views/shared/issuable/_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+3
-3
config/environments/development.rb
config/environments/development.rb
+1
-1
No files found.
app/assets/javascripts/api.js.coffee
View file @
16ba5eb4
...
...
@@ -5,6 +5,27 @@
group_projects_path
:
"/api/:version/groups/:id/projects.json"
projects_path
:
"/api/:version/projects.json"
labels_path
:
"/api/:version/projects/:id/labels"
issues_paths
:
update
:
"/api/:version/projects/:id/issues/:issue_id"
merge_request_path
:
"/api/:version/issues/:id.json"
issues
:
update
:
(
project_id
,
issue_id
,
data
,
callback
)
->
url
=
Api
.
buildUrl
(
Api
.
issues_paths
.
update
)
url
=
url
.
replace
(
":id"
,
project_id
)
.
replace
(
":issue_id"
,
issue_id
)
if
not
data
?
data
=
{}
data
.
private_token
=
gon
.
api_token
$
.
ajax
(
url
:
url
type
:
"PUT"
data
:
data
dataType
:
"json"
).
done
(
issue
)
->
if
callback
?
callback
(
issue
)
group
:
(
group_id
,
callback
)
->
url
=
Api
.
buildUrl
(
Api
.
group_path
)
...
...
app/assets/javascripts/gl_dropdown.js.coffee
View file @
16ba5eb4
...
...
@@ -143,10 +143,11 @@ class GitLabDropdown
selector
=
".dropdown-page-one .dropdown-content a"
@
dropdown
.
on
"click"
,
selector
,
(
e
)
->
e
.
preventDefault
()
self
.
rowClicked
$
(
@
)
if
self
.
options
.
clicked
self
.
options
.
clicked
(
)
self
.
options
.
clicked
.
call
(
@
,
e
)
toggleLoading
:
->
$
(
'.dropdown-menu'
,
@
dropdown
).
toggleClass
LOADING_CLASS
...
...
app/assets/javascripts/milestone_select.js.coffee
View file @
16ba5eb4
class
@
MilestoneSelect
constructor
:
->
constructor
:
(
@
opts
)
->
opts
=
@
opts
$
(
'.js-milestone-select'
).
each
(
i
,
dropdown
)
->
$dropdown
=
$
(
dropdown
)
projectId
=
$dropdown
.
data
(
'project-id'
)
...
...
@@ -9,6 +10,7 @@ class @MilestoneSelect
showAny
=
$dropdown
.
data
(
'show-any'
)
useId
=
$dropdown
.
data
(
'use-id'
)
defaultLabel
=
$dropdown
.
data
(
'default-label'
)
issuableId
=
$dropdown
.
data
(
'issuable-id'
)
$dropdown
.
glDropdown
(
data
:
(
term
,
callback
)
->
...
...
@@ -53,13 +55,14 @@ class @MilestoneSelect
milestone
.
id
isSelected
:
(
milestone
)
->
milestone
.
title
is
selectedMilestone
clicked
:
->
page
=
$
(
'body'
).
data
'page'
isIssueIndex
=
page
is
'projects:issues:index'
isMRIndex
=
page
is
page
is
'projects:merge_requests:index'
if
$dropdown
.
hasClass
(
'js-filter-submit'
)
and
(
isIssueIndex
or
isMRIndex
)
Issues
.
filterResults
$dropdown
.
closest
(
'form'
)
else
if
$dropdown
.
hasClass
'js-filter-submit'
$dropdown
.
closest
(
'form'
).
submit
()
clicked
:
(
e
)
->
if
$
(
dropdown
).
hasClass
"js-filter-submit"
&&
opts
.
submitForm
$
(
dropdown
).
parents
(
'form'
).
submit
()
else
milestoneVal
=
$
(
@
)
.
closest
(
'.selectbox'
)
.
find
(
'input[type="hidden"]'
)
.
val
()
Api
.
issues
.
update
(
projectId
,
issuableId
,
milestone_id
:
milestoneVal
,
(
data
)
=>
console
.
log
'data'
,
data
)
)
app/controllers/projects/issues_controller.rb
View file @
16ba5eb4
...
...
@@ -58,6 +58,7 @@ class Projects::IssuesController < Projects::ApplicationController
end
def
edit
puts
params
respond_with
(
@issue
)
end
...
...
app/views/projects/merge_requests/_show.html.haml
View file @
16ba5eb4
...
...
@@ -10,7 +10,7 @@
.merge-request
{
'data-url'
=>
merge_request_path
(
@merge_request
)}
=
render
"projects/merge_requests/show/mr_title"
.merge-request-details.issuable-details
.merge-request-details.issuable-details
{
data:
{
id:
@merge_request
.
project
.
id
}}
=
render
"projects/merge_requests/show/mr_box"
.append-bottom-default.mr-source-target.prepend-top-default
-
if
@merge_request
.
open?
...
...
app/views/shared/issuable/_filter.html.haml
View file @
16ba5eb4
...
...
@@ -55,7 +55,9 @@
:javascript
new
UsersSelect
();
new
LabelsSelect
();
new
MilestoneSelect
();
new
MilestoneSelect
({
submitForm
:
true
});
new
IssueStatusSelect
();
$
(
'
form.filter-form
'
).
on
(
'
submit
'
,
function
(
event
)
{
event
.
preventDefault
();
...
...
app/views/shared/issuable/_sidebar.html.haml
View file @
16ba5eb4
...
...
@@ -62,10 +62,9 @@
=
issuable
.
milestone
.
title
-
else
.light
None
.selectbox.hide-collapsed
=
f
.
select
(
:milestone_id
,
milestone_options
(
issuable
),
{
include_blank:
true
},
{
class:
'select2 select2-compact js-select2 js-milestone'
,
data:
{
placeholder:
'Select milestone'
}})
=
hidden_field_tag
:issuable_context
=
f
.
submit
class:
'btn hide'
=
dropdown_tag
(
"Milestone"
,
options:
{
title:
"Assign milestone"
,
toggle_class:
'js-milestone-select'
,
filter:
true
,
dropdown_class:
"dropdown-menu-selectable"
,
placeholder:
"Search milestones"
,
data:
{
show_no:
true
,
field_name:
"milestone_id"
,
project_id:
@project
.
id
,
issuable_id:
issuable
.
id
,
milestones:
namespace_project_milestones_path
(
@project
.
namespace
,
@project
,
:js
),
use_id:
true
}})
-
if
issuable
.
project
.
labels
.
any?
.block.labels
...
...
@@ -117,4 +116,5 @@
:javascript
new
Subscription
(
'
.subscription
'
);
new
MilestoneSelect
();
new
IssuableContext
();
config/environments/development.rb
View file @
16ba5eb4
...
...
@@ -36,7 +36,7 @@ Rails.application.configure do
# For having correct urls in mails
config
.
action_mailer
.
default_url_options
=
{
host:
'localhost'
,
port:
3000
}
# Open sent mails in browser
config
.
action_mailer
.
delivery_method
=
:
letter_opener
config
.
action_mailer
.
delivery_method
=
:
test
# Don't make a mess when bootstrapping a development environment
config
.
action_mailer
.
perform_deliveries
=
(
ENV
[
'BOOTSTRAP'
]
!=
'1'
)
...
...
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