Skip to content

Commit

Permalink
remove elasticsearch from settings UI
Browse files Browse the repository at this point in the history
  • Loading branch information
amtuannguyen committed Jan 8, 2025
1 parent e76e98b commit a1fd667
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ PORT=3006
MAILCATCHER_HTTP=3086
SECRET_KEY_BASE=don't forget to set this to some thing strong in production
NODE_OPTIONS=--openssl-legacy-provider
ELASTIC_SEARCH_URL=http://elasticsearch:9200
ELASTICSEARCH_URL=http://elasticsearch:9200
1 change: 0 additions & 1 deletion app/views/layouts/navbar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
<li><%= link_to "Course Subjects", settings_subjects_path %></li>
<li><%= link_to "Course Faculties", settings_faculties_path %></li>
<li><%= link_to "Acquisition Requests", acquisition_requests_settings_path %></li>
<li><%= link_to "Elastic Search", elastic_search_settings_path %></li>
<li><%= link_to "Primo and Alma", primo_alma_settings_path %></li>
</ul>
</li>
Expand Down
6 changes: 3 additions & 3 deletions app/views/settings/elastic_search.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">Elastic Search Settings Settings</h3>
<h3 class="panel-title">Elastic Search Settings</h3>
</div>
<div class="panel-body">
<%= f.input :search_elastic_enabled, as: :radio_buttons, label: "Use Elastic Search to search requests" %>
<%= f.input :search_elastic_enabled, as: :radio_buttons, label: "Use Elastic Search" %>
<%= f.input :search_elastic_server %>
<%= f.input :search_elastic_index_prefix %>
</div>
</div>

<input type="hidden" name="return_to" value="elastic_search"/>
<%= f.submit "Save Catalog Search Settings", class: "btn btn-success" %>
<%= f.submit "Save Settings", class: "btn btn-success" %>
<% end %>
6 changes: 2 additions & 4 deletions app/views/settings/primo_alma.html.erb
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<% title "Update Primo and Alama Settings" %>
<% title "Update Primo and Alma Settings" %>

<%= simple_form_for Setting.new, url: settings_path, method: :patch do |f| %>


<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">Elastic Search Settings Settings</h3>
<h3 class="panel-title">Primo and Alma Settings</h3>
</div>
<div class="panel-body">

Expand Down
5 changes: 0 additions & 5 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ class Application < Rails::Application
# config.eager_load_paths << Rails.root.join("extras")

config.after_initialize do
if ENV['ELASTIC_SEARCH_URL']
Searchkick.client = Elasticsearch::Client.new(url: ENV['ELASTIC_SEARCH_URL'])
elsif defined?(Setting) && Setting.search_elastic_server && Setting.search_elastic_enabled.to_s == 'true'
Searchkick.client = Elasticsearch::Client.new(url: Setting.search_elastic_server)
end
end
end
end
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ services:
- RAILS_SERVE_STATIC_FILES=true
- NODE_OPTIONS=${NODE_OPTIONS}
- SELENIUM_REMOTE_URL=http://chrome:4444
- ELASTIC_SEARCH_URL=http://elasticsearch:9200
- ELASTICSEARCH_URL=http://elasticsearch:9200
env_file:
- path: ./override.env
required: false
Expand Down

0 comments on commit a1fd667

Please sign in to comment.