Skip to content

Commit

Permalink
Merge pull request #1328 from stanleylhs/fix-opportunities-campaign-a…
Browse files Browse the repository at this point in the history
…utocomplete

Fix Opportunities Campaign selection auto complete
  • Loading branch information
steveyken authored Aug 23, 2024
2 parents d28e1fd + 868e442 commit 5d198d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions app/helpers/opportunities_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ def opportunity_campaign_select(options = {})
selected_campaign = Campaign.find_by_id(options[:selected])
campaigns = ([selected_campaign] + Campaign.my(current_user).order(:name).limit(25)).compact.uniq
collection_select :opportunity, :campaign_id, campaigns, :id, :name,
{ selected: options[:selected], prompt: t(:select_a_campaign) },
style: 'width:330px;', class: 'select2'
{ selected: options[:selected], prompt: t(:select_a_campaign), include_blank: true },
style: 'width:330px;', class: 'select2',
placeholder: t(:select_a_campaign),
"data-url": auto_complete_campaigns_path(format: 'json')
end

# Generates the inline revenue message for the opportunity list table.
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/users_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def user_select(asset, users, myself)
user_options = user_options_for_select(users, myself)
select(asset, :assigned_to, user_options,
{ include_blank: t(:unassigned) },
style: 'width: 160px;',
style: 'width: 160px;', "data-allow-clear" => false,
class: 'select2')
end

Expand Down

0 comments on commit 5d198d9

Please sign in to comment.