From: Anton Khorev Date: Sun, 20 Apr 2025 13:25:43 +0000 (+0300) Subject: Rename "OSM Nominatim" to "Nominatim" in search headings X-Git-Tag: live~29^2 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/8bb894f3beb9acce6739a4f9efa8997860b6b54a?ds=inline Rename "OSM Nominatim" to "Nominatim" in search headings --- diff --git a/app/controllers/searches_controller.rb b/app/controllers/searches_controller.rb index 0381d542d..0176f7508 100644 --- a/app/controllers/searches_controller.rb +++ b/app/controllers/searches_controller.rb @@ -15,10 +15,10 @@ class SearchesController < ApplicationController if params[:lat] && params[:lon] @sources.push(:name => "latlon", :url => root_path, :fetch_url => search_latlon_query_path(params.permit(:lat, :lon, :latlon_digits, :zoom))) - @sources.push(:name => "osm_nominatim_reverse", :url => nominatim_reverse_query_url(:format => "html"), + @sources.push(:name => "nominatim_reverse", :url => nominatim_reverse_query_url(:format => "html"), :fetch_url => search_nominatim_reverse_query_path(params.permit(:lat, :lon, :zoom))) elsif params[:query] - @sources.push(:name => "osm_nominatim", :url => nominatim_query_url(:format => "html"), + @sources.push(:name => "nominatim", :url => nominatim_query_url(:format => "html"), :fetch_url => search_nominatim_query_path(params.permit(:query, :minlat, :minlon, :maxlat, :maxlon))) end diff --git a/config/locales/en.yml b/config/locales/en.yml index d1eaa6b9a..a97925be6 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1535,8 +1535,8 @@ en: show: title: latlon: Internal - osm_nominatim: OpenStreetMap Nominatim - osm_nominatim_reverse: OpenStreetMap Nominatim + nominatim: Nominatim + nominatim_reverse: Nominatim queries: create: no_results: "No results found" diff --git a/test/controllers/searches_controller_test.rb b/test/controllers/searches_controller_test.rb index 51022bb4b..bb625c521 100644 --- a/test/controllers/searches_controller_test.rb +++ b/test/controllers/searches_controller_test.rb @@ -245,7 +245,7 @@ class SearchesControllerTest < ActionDispatch::IntegrationTest assert_response :success assert_template :show assert_template :layout => "map" - assert_equal %w[osm_nominatim], assigns(:sources).pluck(:name) + assert_equal %w[nominatim], assigns(:sources).pluck(:name) end end @@ -279,7 +279,7 @@ class SearchesControllerTest < ActionDispatch::IntegrationTest 12345 12345-6789 ].each do |code| - search_check code, %w[osm_nominatim] + search_check code, %w[nominatim] end end @@ -295,20 +295,20 @@ class SearchesControllerTest < ActionDispatch::IntegrationTest "CR2 6XH", "DN55 1PT" ].each do |code| - search_check code, %w[osm_nominatim] + search_check code, %w[nominatim] end end ## # Test identification of Canadian postcodes def test_identify_ca_postcode - search_check "A1B 2C3", %w[osm_nominatim] + search_check "A1B 2C3", %w[nominatim] end ## # Test identification fall through to the default case def test_identify_default - search_check "foo bar baz", %w[osm_nominatim] + search_check "foo bar baz", %w[nominatim] end private @@ -318,7 +318,7 @@ class SearchesControllerTest < ActionDispatch::IntegrationTest assert_response :success assert_template :show assert_template :layout => "map" - assert_equal %w[latlon osm_nominatim_reverse], assigns(:sources).pluck(:name) + assert_equal %w[latlon nominatim_reverse], assigns(:sources).pluck(:name) assert_nil @controller.params[:query] assert_match(/^[+-]?\d+(?:\.\d+)?$/, @controller.params[:lat]) assert_match(/^[+-]?\d+(?:\.\d+)?$/, @controller.params[:lon]) @@ -329,7 +329,7 @@ class SearchesControllerTest < ActionDispatch::IntegrationTest assert_response :success assert_template :show assert_template :layout => "xhr" - assert_equal %w[latlon osm_nominatim_reverse], assigns(:sources).pluck(:name) + assert_equal %w[latlon nominatim_reverse], assigns(:sources).pluck(:name) assert_nil @controller.params[:query] assert_match(/^[+-]?\d+(?:\.\d+)?$/, @controller.params[:lat]) assert_match(/^[+-]?\d+(?:\.\d+)?$/, @controller.params[:lon]) diff --git a/test/system/search_test.rb b/test/system/search_test.rb index 0292e67f0..de3c3d1d1 100644 --- a/test/system/search_test.rb +++ b/test/system/search_test.rb @@ -72,7 +72,9 @@ class SearchTest < ApplicationSystemTestCase fill_in "query", :with => "paris" click_on "Go" - assert_link "OpenStreetMap Nominatim", :href => /&viewbox=/ + within_sidebar do + assert_link "Nominatim", :href => /&viewbox=/ + end end test "search adds zoom param to reverse Nominatim link" do @@ -81,6 +83,8 @@ class SearchTest < ApplicationSystemTestCase fill_in "query", :with => "60 30" click_on "Go" - assert_link "OpenStreetMap Nominatim", :href => /&zoom=7/ + within_sidebar do + assert_link "Nominatim", :href => /&zoom=7/ + end end end