BigW Consortium Gitlab

Commit 5cca2d3b by Phil Hughes

Updated Ruby based on feedback

parent fac08c3b
issuable_created = false issuable_created = false
@Issuable = @Issuable =
init: -> init: ->
if not issuable_created unless issuable_created
issuable_created = true issuable_created = true
Issuable.initTemplates() Issuable.initTemplates()
Issuable.initSearch() Issuable.initSearch()
...@@ -28,7 +28,7 @@ issuable_created = false ...@@ -28,7 +28,7 @@ issuable_created = false
$input = $("input[name='#{$search.attr('name')}']", $form) $input = $("input[name='#{$search.attr('name')}']", $form)
if $input.length is 0 if $input.length is 0
$form.append "<input type='hidden' name='#{$search.attr('name')}' value='#{$search.val()}'/>" $form.append "<input type='hidden' name='#{$search.attr('name')}' value='#{_.escape($search.val())}'/>"
else else
$input.val $search.val() $input.val $search.val()
......
...@@ -263,7 +263,8 @@ module ApplicationHelper ...@@ -263,7 +263,8 @@ module ApplicationHelper
assignee_id: params[:assignee_id], assignee_id: params[:assignee_id],
author_id: params[:author_id], author_id: params[:author_id],
sort: params[:sort], sort: params[:sort],
issue_search: params[:issue_search] issue_search: params[:issue_search],
label_name: params[:label_name]
} }
options = exist_opts.merge(options) options = exist_opts.merge(options)
...@@ -276,19 +277,9 @@ module ApplicationHelper ...@@ -276,19 +277,9 @@ module ApplicationHelper
params = options.compact params = options.compact
path = request.path params.delete(:label_name) unless add_label
if !params.nil? "#{request.path}?#{params.to_param}"
path << "?#{params.to_param}"
if add_label
if params[:label_name].present? and params[:label_name].respond_to?('any?')
params[:label_name].each do |label|
path << "&label_name[]=#{label}"
end
end
end
end
path
end end
def outdated_browser? def outdated_browser?
......
...@@ -159,7 +159,7 @@ describe 'Filter issues', feature: true do ...@@ -159,7 +159,7 @@ describe 'Filter issues', feature: true do
before do before do
create(:issue, title: "Bug", project: project) create(:issue, title: "Bug", project: project)
create(:label, project: project, title: 'bug') bug_label = create(:label, project: project, title: 'bug')
milestone = create(:milestone, title: "8", project: project) milestone = create(:milestone, title: "8", project: project)
issue = create(:issue, issue = create(:issue,
...@@ -168,7 +168,7 @@ describe 'Filter issues', feature: true do ...@@ -168,7 +168,7 @@ describe 'Filter issues', feature: true do
milestone: milestone, milestone: milestone,
author: user, author: user,
assignee: user) assignee: user)
issue.labels << project.labels.find_by(title: 'bug') issue.labels << bug_label
visit namespace_project_issues_path(project.namespace, project) visit namespace_project_issues_path(project.namespace, project)
end end
...@@ -264,12 +264,12 @@ describe 'Filter issues', feature: true do ...@@ -264,12 +264,12 @@ describe 'Filter issues', feature: true do
describe 'filter issues and sort', js: true do describe 'filter issues and sort', js: true do
before do before do
create(:label, project: project, title: 'bug') bug_label = create(:label, project: project, title: 'bug')
bug_one = create(:issue, title: "Frontend", project: project) bug_one = create(:issue, title: "Frontend", project: project)
bug_two = create(:issue, title: "Bug 2", project: project) bug_two = create(:issue, title: "Bug 2", project: project)
bug_one.labels << project.labels.find_by(title: 'bug') bug_one.labels << bug_label
bug_two.labels << project.labels.find_by(title: 'bug') bug_two.labels << bug_label
visit namespace_project_issues_path(project.namespace, project) visit namespace_project_issues_path(project.namespace, project)
end end
......
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