Commit 1cc6d786 authored by Jacob Schatz's avatar Jacob Schatz

Fix minor code style issues

Fix underscore template error.
Fix `=` spacing
parent 53a83112
...@@ -32,10 +32,8 @@ class @LabelsSelect ...@@ -32,10 +32,8 @@ class @LabelsSelect
if issueUpdateURL if issueUpdateURL
labelHTMLTemplate = _.template( labelHTMLTemplate = _.template(
'<% _.each(labels, function(label){ %> '<% _.each(labels, function(label){ %>
<a href=" <a href="<%= ["",issueURLSplit[1], issueURLSplit[2],""].join("/") %>issues?label_name=<%= label.title %>">
#{["",issueURLSplit[1], issueURLSplit[2],""].join("/")} <span class="label color-label" style="background-color: <%= label.color %>;">
issues?label_name=<%= label.title %>">
<span class="label color-label" style="background-color: <%= label.color %>; color: #FFFFFF">
<%= label.title %> <%= label.title %>
</span> </span>
</a> </a>
...@@ -152,6 +150,7 @@ class @LabelsSelect ...@@ -152,6 +150,7 @@ class @LabelsSelect
).done (data) -> ).done (data) ->
$loading.fadeOut() $loading.fadeOut()
$selectbox.hide() $selectbox.hide()
data.issueURLSplit = issueURLSplit
if not data.labels.length if not data.labels.length
template = labelNoneHTMLTemplate() template = labelNoneHTMLTemplate()
else else
......
...@@ -16,6 +16,16 @@ module IssuablesHelper ...@@ -16,6 +16,16 @@ module IssuablesHelper
base_issuable_scope(issuable).where('iid > ?', issuable.iid).last base_issuable_scope(issuable).where('iid > ?', issuable.iid).last
end 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) def prev_issuable_for(issuable)
base_issuable_scope(issuable).where('iid < ?', issuable.iid).first base_issuable_scope(issuable).where('iid < ?', issuable.iid).first
end end
......
%aside.right-sidebar{ class: sidebar_gutter_collapsed_class } %aside.right-sidebar{ class: sidebar_gutter_collapsed_class }
.issuable-sidebar .issuable-sidebar
.block.issuable-sidebar-header .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 %span.issuable-count.hide-collapsed.pull-left
= issuable.iid = issuable.iid
of of
...@@ -32,7 +28,7 @@ ...@@ -32,7 +28,7 @@
= icon('user') = icon('user')
.title.hide-collapsed .title.hide-collapsed
Assignee Assignee
=icon('spinner spin', class: 'block-loading') = icon('spinner spin', class: 'block-loading')
- if can?(current_user, :"admin_#{issuable.to_ability_name}", @project) - if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
= link_to 'Edit', '#', class: 'edit-link pull-right' = link_to 'Edit', '#', class: 'edit-link pull-right'
.value.bold.hide-collapsed .value.bold.hide-collapsed
...@@ -46,12 +42,12 @@ ...@@ -46,12 +42,12 @@
- else - else
%span.assign-yourself %span.assign-yourself
No assignee - No assignee -
%a.js-assign-yourself{href:'#'} %a.js-assign-yourself{ href: '#' }
assign yourself assign yourself
.selectbox.hide-collapsed .selectbox.hide-collapsed
= f.hidden_field 'assignee_id', value: issuable.assignee_id, id: 'issue_assignee_id' = 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 .block.milestone
.sidebar-collapsed-icon .sidebar-collapsed-icon
...@@ -63,7 +59,7 @@ ...@@ -63,7 +59,7 @@
No No
.title.hide-collapsed .title.hide-collapsed
Milestone Milestone
=icon('spinner spin', class: 'block-loading') = icon('spinner spin', class: 'block-loading')
- if can?(current_user, :"admin_#{issuable.to_ability_name}", @project) - if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
= link_to 'Edit', '#', class: 'edit-link pull-right' = link_to 'Edit', '#', class: 'edit-link pull-right'
.value.bold.hide-collapsed .value.bold.hide-collapsed
...@@ -75,7 +71,7 @@ ...@@ -75,7 +71,7 @@
.selectbox.hide-collapsed .selectbox.hide-collapsed
= f.hidden_field 'milestone_id', value: issuable.milestone_id, id: nil = 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? - if issuable.project.labels.any?
.block.labels .block.labels
...@@ -85,7 +81,7 @@ ...@@ -85,7 +81,7 @@
= issuable.labels.count = issuable.labels.count
.title.hide-collapsed .title.hide-collapsed
Labels Labels
=icon('spinner spin', class: 'block-loading') = icon('spinner spin', class: 'block-loading')
- if can?(current_user, :"admin_#{issuable.to_ability_name}", @project) - if can?(current_user, :"admin_#{issuable.to_ability_name}", @project)
= link_to 'Edit', '#', class: 'edit-link pull-right' = link_to 'Edit', '#', class: 'edit-link pull-right'
.value.bold.issuable-show-labels.hide-collapsed{ class: ("has-labels" if issuable.labels.any?) } .value.bold.issuable-show-labels.hide-collapsed{ class: ("has-labels" if issuable.labels.any?) }
...@@ -98,7 +94,7 @@ ...@@ -98,7 +94,7 @@
- issuable.labels.each do |label| - issuable.labels.each do |label|
= hidden_field_tag "#{issuable.to_ability_name}[label_names][]", label.id, id: nil = hidden_field_tag "#{issuable.to_ability_name}[label_names][]", label.id, id: nil
.dropdown .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 %span.dropdown-toggle-text
Label Label
= icon('chevron-down') = icon('chevron-down')
......
...@@ -36,7 +36,7 @@ Rails.application.configure do ...@@ -36,7 +36,7 @@ Rails.application.configure do
# For having correct urls in mails # For having correct urls in mails
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
# Open sent mails in browser # 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 # Don't make a mess when bootstrapping a development environment
config.action_mailer.perform_deliveries = (ENV['BOOTSTRAP'] != '1') config.action_mailer.perform_deliveries = (ENV['BOOTSTRAP'] != '1')
......
...@@ -34,20 +34,7 @@ describe 'Issues', feature: true do ...@@ -34,20 +34,7 @@ describe 'Issues', feature: true do
fill_in 'issue_title', with: 'bug 345' fill_in 'issue_title', with: 'bug 345'
fill_in 'issue_description', with: 'bug description' fill_in 'issue_description', with: 'bug description'
end 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
end end
describe 'Editing issue assignee' do describe 'Editing issue assignee' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment