BigW Consortium Gitlab

Commit 5cca2d3b by Phil Hughes

Updated Ruby based on feedback

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