Skip to content

Commit

Permalink
JM - (SPARCDashboard) Tie Search field Option with RMID configuration…
Browse files Browse the repository at this point in the history
… [#151658427]
  • Loading branch information
jwiel86 committed Oct 27, 2017
1 parent be8f0a6 commit 2df5cf6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
8 changes: 8 additions & 0 deletions app/models/protocol_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,12 @@ def href
}
)
end

def self.search_filters
if Setting.find_by_key("research_master_enabled").value
['Authorized User', 'HR#', 'PI', 'Protocol ID', 'PRO#', 'RMID', 'Short/Long Title']
else
['Authorized User', 'HR#', 'PI', 'Protocol ID', 'PRO#', 'Short/Long Title']
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
= form.fields_for :search_query do |search|
.input-group-btn
.dd_select
= search.select :search_drop, options_for_select(t(:dashboard)[:protocol_filters][:search_by_options], filterrific.search_query.try(:search_drop)), { prompt: t(:dashboard)[:protocol_filters][:search_by] }, class: "form-control selectpicker ", data: { style: 'dropdown_filter' }
= search.select :search_drop, options_for_select(ProtocolFilter.search_filters, filterrific.search_query.try(:search_drop)), { prompt: t(:dashboard)[:protocol_filters][:search_by] }, class: "form-control selectpicker ", data: { style: 'dropdown_filter' }
= search.text_field :search_text, value: filterrific.search_query.try(:search_text), class: 'form-control'

.form-group.row
Expand Down
1 change: 0 additions & 1 deletion config/locales/dashboard.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ en:
protocol_filters:
header: "Filter Protocols"
search_by: "Search All"
search_by_options: ['Authorized User', 'HR#', 'PI', 'Protocol ID', 'PRO#', 'RMID', 'Short/Long Title']
archived: "Archived"
inactive: "(inactive)"
status: "Status"
Expand Down

0 comments on commit 2df5cf6

Please sign in to comment.