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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
1cc6d786
Commit
1cc6d786
authored
Mar 25, 2016
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix minor code style issues
Fix underscore template error. Fix `=` spacing
parent
53a83112
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
29 deletions
+21
-29
app/assets/javascripts/labels_select.js.coffee
app/assets/javascripts/labels_select.js.coffee
+3
-4
app/helpers/issuables_helper.rb
app/helpers/issuables_helper.rb
+10
-0
app/views/shared/issuable/_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+7
-11
config/environments/development.rb
config/environments/development.rb
+1
-1
spec/features/issues_spec.rb
spec/features/issues_spec.rb
+0
-13
No files found.
app/assets/javascripts/labels_select.js.coffee
View file @
1cc6d786
...
...
@@ -32,10 +32,8 @@ class @LabelsSelect
if
issueUpdateURL
labelHTMLTemplate
=
_
.
template
(
'<% _.each(labels, function(label){ %>
<a href="
#{["",issueURLSplit[1], issueURLSplit[2],""].join("/")}
issues?label_name=<%= label.title %>">
<span class="label color-label" style="background-color: <%= label.color %>; color: #FFFFFF">
<a href="<%= ["",issueURLSplit[1], issueURLSplit[2],""].join("/") %>issues?label_name=<%= label.title %>">
<span class="label color-label" style="background-color: <%= label.color %>;">
<%= label.title %>
</span>
</a>
...
...
@@ -152,6 +150,7 @@ class @LabelsSelect
).
done
(
data
)
->
$loading
.
fadeOut
()
$selectbox
.
hide
()
data
.
issueURLSplit
=
issueURLSplit
if
not
data
.
labels
.
length
template
=
labelNoneHTMLTemplate
()
else
...
...
app/helpers/issuables_helper.rb
View file @
1cc6d786
...
...
@@ -16,6 +16,16 @@ module IssuablesHelper
base_issuable_scope
(
issuable
).
where
(
'iid > ?'
,
issuable
.
iid
).
last
end
def
issuable_json_path
(
issuable
)
project
=
issuable
.
project
if
issuable
.
kind_of?
(
MergeRequest
)
namespace_project_merge_request_path
(
project
.
namespace
,
project
,
issuable
.
iid
,
:json
)
else
namespace_project_issue_path
(
project
.
namespace
,
project
,
issuable
.
iid
,
:json
)
end
end
def
prev_issuable_for
(
issuable
)
base_issuable_scope
(
issuable
).
where
(
'iid < ?'
,
issuable
.
iid
).
first
end
...
...
app/views/shared/issuable/_sidebar.html.haml
View file @
1cc6d786
%aside
.right-sidebar
{
class:
sidebar_gutter_collapsed_class
}
.issuable-sidebar
.block.issuable-sidebar-header
-
if
issuable
.
to_ability_name
==
'merge_request'
-
issuable_url
=
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
issuable
.
iid
,
:json
)
-
else
-
issuable_url
=
namespace_project_issue_path
(
@project
.
namespace
,
@project
,
issuable
.
iid
,
:json
)
%span
.issuable-count.hide-collapsed.pull-left
=
issuable
.
iid
of
...
...
@@ -32,7 +28,7 @@
=
icon
(
'user'
)
.title.hide-collapsed
Assignee
=
icon
(
'spinner spin'
,
class:
'block-loading'
)
=
icon
(
'spinner spin'
,
class:
'block-loading'
)
-
if
can?
(
current_user
,
:"admin_
#{
issuable
.
to_ability_name
}
"
,
@project
)
=
link_to
'Edit'
,
'#'
,
class:
'edit-link pull-right'
.value.bold.hide-collapsed
...
...
@@ -46,12 +42,12 @@
-
else
%span
.assign-yourself
No assignee -
%a
.js-assign-yourself
{
href
:'#'
}
%a
.js-assign-yourself
{
href:
'#'
}
assign yourself
.selectbox.hide-collapsed
=
f
.
hidden_field
'assignee_id'
,
value:
issuable
.
assignee_id
,
id:
'issue_assignee_id'
=
dropdown_tag
(
'Select assignee'
,
options:
{
toggle_class:
'js-user-search js-author-search'
,
title:
'Assign user'
,
filter:
true
,
dropdown_class:
'dropdown-menu-user dropdown-menu-selectable dropdown-menu-author'
,
placeholder:
'Search users'
,
data:
{
first_user:
(
current_user
.
username
if
current_user
),
current_user:
true
,
project_id:
(
@project
.
id
if
@project
),
field_name:
"
#{
issuable
.
to_ability_name
}
[assignee_id]"
,
issue_update:
issuable_
url
,
ability_name:
issuable
.
to_ability_name
,
null_user:
true
}
})
=
dropdown_tag
(
'Select assignee'
,
options:
{
toggle_class:
'js-user-search js-author-search'
,
title:
'Assign user'
,
filter:
true
,
dropdown_class:
'dropdown-menu-user dropdown-menu-selectable dropdown-menu-author'
,
placeholder:
'Search users'
,
data:
{
first_user:
(
current_user
.
username
if
current_user
),
current_user:
true
,
project_id:
(
@project
.
id
if
@project
),
field_name:
"
#{
issuable
.
to_ability_name
}
[assignee_id]"
,
issue_update:
issuable_
json_path
(
issuable
)
,
ability_name:
issuable
.
to_ability_name
,
null_user:
true
}
})
.block.milestone
.sidebar-collapsed-icon
...
...
@@ -63,7 +59,7 @@
No
.title.hide-collapsed
Milestone
=
icon
(
'spinner spin'
,
class:
'block-loading'
)
=
icon
(
'spinner spin'
,
class:
'block-loading'
)
-
if
can?
(
current_user
,
:"admin_
#{
issuable
.
to_ability_name
}
"
,
@project
)
=
link_to
'Edit'
,
'#'
,
class:
'edit-link pull-right'
.value.bold.hide-collapsed
...
...
@@ -75,7 +71,7 @@
.selectbox.hide-collapsed
=
f
.
hidden_field
'milestone_id'
,
value:
issuable
.
milestone_id
,
id:
nil
=
dropdown_tag
(
'Milestone'
,
options:
{
title:
'Assign milestone'
,
toggle_class:
'js-milestone-select js-extra-options'
,
filter:
true
,
dropdown_class:
'dropdown-menu-selectable'
,
placeholder:
'Search milestones'
,
data:
{
show_no:
true
,
field_name:
"
#{
issuable
.
to_ability_name
}
[milestone_id]"
,
project_id:
@project
.
id
,
issuable_id:
issuable
.
id
,
milestones:
namespace_project_milestones_path
(
@project
.
namespace
,
@project
,
:json
),
ability_name:
issuable
.
to_ability_name
,
issue_update:
issuable_
url
,
use_id:
true
}})
=
dropdown_tag
(
'Milestone'
,
options:
{
title:
'Assign milestone'
,
toggle_class:
'js-milestone-select js-extra-options'
,
filter:
true
,
dropdown_class:
'dropdown-menu-selectable'
,
placeholder:
'Search milestones'
,
data:
{
show_no:
true
,
field_name:
"
#{
issuable
.
to_ability_name
}
[milestone_id]"
,
project_id:
@project
.
id
,
issuable_id:
issuable
.
id
,
milestones:
namespace_project_milestones_path
(
@project
.
namespace
,
@project
,
:json
),
ability_name:
issuable
.
to_ability_name
,
issue_update:
issuable_
json_path
(
issuable
)
,
use_id:
true
}})
-
if
issuable
.
project
.
labels
.
any?
.block.labels
...
...
@@ -85,7 +81,7 @@
=
issuable
.
labels
.
count
.title.hide-collapsed
Labels
=
icon
(
'spinner spin'
,
class:
'block-loading'
)
=
icon
(
'spinner spin'
,
class:
'block-loading'
)
-
if
can?
(
current_user
,
:"admin_
#{
issuable
.
to_ability_name
}
"
,
@project
)
=
link_to
'Edit'
,
'#'
,
class:
'edit-link pull-right'
.value.bold.issuable-show-labels.hide-collapsed
{
class:
(
"has-labels"
if
issuable
.
labels
.
any?
)
}
...
...
@@ -98,7 +94,7 @@
-
issuable
.
labels
.
each
do
|
label
|
=
hidden_field_tag
"
#{
issuable
.
to_ability_name
}
[label_names][]"
,
label
.
id
,
id:
nil
.dropdown
%button
.dropdown-menu-toggle.js-label-select.js-multiselect
{
type:
"button"
,
data:
{
toggle:
"dropdown"
,
field_name:
"#{issuable.to_ability_name}[label_names][]"
,
ability_name:
issuable
.
to_ability_name
,
show_no:
"true"
,
show_any:
"true"
,
selected:
issuable
.
label_names
.
join
(
","
),
project_id:
(
@project
.
id
if
@project
),
issue_update:
issuable_
url
,
labels:
(
namespace_project_labels_path
(
@project
.
namespace
,
@project
,
:json
)
if
@project
)}}
%button
.dropdown-menu-toggle.js-label-select.js-multiselect
{
type:
"button"
,
data:
{
toggle:
"dropdown"
,
field_name:
"#{issuable.to_ability_name}[label_names][]"
,
ability_name:
issuable
.
to_ability_name
,
show_no:
"true"
,
show_any:
"true"
,
selected:
issuable
.
label_names
.
join
(
","
),
project_id:
(
@project
.
id
if
@project
),
issue_update:
issuable_
json_path
(
issuable
)
,
labels:
(
namespace_project_labels_path
(
@project
.
namespace
,
@project
,
:json
)
if
@project
)}}
%span
.dropdown-toggle-text
Label
=
icon
(
'chevron-down'
)
...
...
config/environments/development.rb
View file @
1cc6d786
...
...
@@ -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
=
:
test
config
.
action_mailer
.
delivery_method
=
:
letter_opener
# Don't make a mess when bootstrapping a development environment
config
.
action_mailer
.
perform_deliveries
=
(
ENV
[
'BOOTSTRAP'
]
!=
'1'
)
...
...
spec/features/issues_spec.rb
View file @
1cc6d786
...
...
@@ -34,20 +34,7 @@ describe 'Issues', feature: true do
fill_in
'issue_title'
,
with:
'bug 345'
fill_in
'issue_description'
,
with:
'bug description'
end
# it 'does not change issue count' do
# expect { click_button 'Save changes' }.to_not change { Issue.count }
# end
# it 'should update issue fields' do
# click_button 'Save changes'
# expect(page).to have_content @user.name
# expect(page).to have_content 'bug 345'
# expect(page).to have_content project.name
# end
end
end
describe
'Editing issue assignee'
do
...
...
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