]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/5203'
authorTom Hughes <tom@compton.nu>
Sun, 15 Sep 2024 18:30:22 +0000 (19:30 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 15 Sep 2024 18:30:22 +0000 (19:30 +0100)
16 files changed:
app/helpers/browse_helper.rb
app/views/changesets/_paging_nav.html.erb
app/views/nodes/timeout.html.erb [new file with mode: 0644]
app/views/old_nodes/timeout.html.erb [new file with mode: 0644]
app/views/old_relations/timeout.html.erb [new file with mode: 0644]
app/views/old_ways/timeout.html.erb [new file with mode: 0644]
app/views/relations/timeout.html.erb [new file with mode: 0644]
app/views/ways/timeout.html.erb [new file with mode: 0644]
config/i18n-tasks.yml
config/locales/en.yml
test/controllers/nodes_controller_test.rb
test/controllers/old_nodes_controller_test.rb
test/controllers/old_relations_controller_test.rb
test/controllers/old_ways_controller_test.rb
test/controllers/relations_controller_test.rb
test/controllers/ways_controller_test.rb

index 5aef4e7ca72d4a8212662fabad966a62da1e6d3c..9ea38481137d77afeb46ccfe615860e4b2cecf24 100644 (file)
@@ -92,7 +92,7 @@ module BrowseHelper
     end
     link_classes = ["page-link", { "px-1" => width > max_width_for_default_padding }]
 
-    tag.ul :class => "pagination pagination-sm mb-1 ms-auto" do
+    tag.ul :class => "pagination pagination-sm mb-2" do
       pagination_items(pages, {}).each do |body, page_or_class|
         linked = !(page_or_class.is_a? String)
         link = if linked
index fbdf1d50773c1e1d728e1877c982efe3f5a8801c..0587382222de27d64af44dc64dbc04ffff8c1a03 100644 (file)
@@ -1,11 +1,9 @@
-<div class="d-flex flex-wrap gap-2">
-  <h4 class="fs-5 mb-0"><%= type_and_paginated_count(type, pages) %></h4>
-  <% if pages.page_count > 1 %>
-    <%= sidebar_classic_pagination(pages, "#{type}_page") do |page|
-          {
-            :title => type_and_paginated_count(type, pages, page),
-            :data => { :turbo => "true" }
-          }
-        end %>
-  <% end %>
-</div>
+<h4 class="fs-5"><%= type_and_paginated_count(type, pages) %></h4>
+<% if pages.page_count > 1 %>
+  <%= sidebar_classic_pagination(pages, "#{type}_page") do |page|
+        {
+          :title => type_and_paginated_count(type, pages, page),
+          :data => { :turbo => "true" }
+        }
+      end %>
+<% end %>
diff --git a/app/views/nodes/timeout.html.erb b/app/views/nodes/timeout.html.erb
new file mode 100644 (file)
index 0000000..61415c6
--- /dev/null
@@ -0,0 +1,5 @@
+<% set_title(t("browse.timeout.title")) %>
+
+<%= render "sidebar_header", :title => t("browse.timeout.title") %>
+
+<p><%= t ".sorry", :id => params[:id] %></p>
diff --git a/app/views/old_nodes/timeout.html.erb b/app/views/old_nodes/timeout.html.erb
new file mode 100644 (file)
index 0000000..61415c6
--- /dev/null
@@ -0,0 +1,5 @@
+<% set_title(t("browse.timeout.title")) %>
+
+<%= render "sidebar_header", :title => t("browse.timeout.title") %>
+
+<p><%= t ".sorry", :id => params[:id] %></p>
diff --git a/app/views/old_relations/timeout.html.erb b/app/views/old_relations/timeout.html.erb
new file mode 100644 (file)
index 0000000..61415c6
--- /dev/null
@@ -0,0 +1,5 @@
+<% set_title(t("browse.timeout.title")) %>
+
+<%= render "sidebar_header", :title => t("browse.timeout.title") %>
+
+<p><%= t ".sorry", :id => params[:id] %></p>
diff --git a/app/views/old_ways/timeout.html.erb b/app/views/old_ways/timeout.html.erb
new file mode 100644 (file)
index 0000000..61415c6
--- /dev/null
@@ -0,0 +1,5 @@
+<% set_title(t("browse.timeout.title")) %>
+
+<%= render "sidebar_header", :title => t("browse.timeout.title") %>
+
+<p><%= t ".sorry", :id => params[:id] %></p>
diff --git a/app/views/relations/timeout.html.erb b/app/views/relations/timeout.html.erb
new file mode 100644 (file)
index 0000000..61415c6
--- /dev/null
@@ -0,0 +1,5 @@
+<% set_title(t("browse.timeout.title")) %>
+
+<%= render "sidebar_header", :title => t("browse.timeout.title") %>
+
+<p><%= t ".sorry", :id => params[:id] %></p>
diff --git a/app/views/ways/timeout.html.erb b/app/views/ways/timeout.html.erb
new file mode 100644 (file)
index 0000000..61415c6
--- /dev/null
@@ -0,0 +1,5 @@
+<% set_title(t("browse.timeout.title")) %>
+
+<%= render "sidebar_header", :title => t("browse.timeout.title") %>
+
+<p><%= t ".sorry", :id => params[:id] %></p>
index 225078a515e380b5a7ddf48f2f14ef809277f015..2ed3b2e91d41919de31ccddd9a5a2b132565e2a9 100644 (file)
@@ -123,6 +123,7 @@ ignore_unused:
   - 'geocoder.search_osm_nominatim.prefix.*'
   - 'javascripts.*'
   - 'doorkeeper.*'
+  - 'users.auth_failure.*'   # OmniAuth provider callback error messages
   - 'activerecord.attributes.*'
   - 'activerecord.models.*'
   - 'activerecord.help.*'
index faf9a89852325c8643c866371f36327501338e9e..d114e0a88865e5783979454282b676b782468399 100644 (file)
@@ -403,15 +403,30 @@ en:
       introduction: "Click on the map to find nearby features."
       nearby: "Nearby features"
       enclosing: "Enclosing features"
+  nodes:
+    timeout:
+      sorry: "Sorry, the data for the node with the id %{id}, took too long to retrieve."
   old_nodes:
     not_found:
       sorry: "Sorry, node #%{id} version %{version} could not be found."
+    timeout:
+      sorry: "Sorry, the history of the node with the id %{id}, took too long to retrieve."
+  ways:
+    timeout:
+      sorry: "Sorry, the data for the way with the id %{id}, took too long to retrieve."
   old_ways:
     not_found:
       sorry: "Sorry, way #%{id} version %{version} could not be found."
+    timeout:
+      sorry: "Sorry, the history of the way with the id %{id}, took too long to retrieve."
+  relations:
+    timeout:
+      sorry: "Sorry, the data for the relation with the id %{id}, took too long to retrieve."
   old_relations:
     not_found:
       sorry: "Sorry, relation #%{id} version %{version} could not be found."
+    timeout:
+      sorry: "Sorry, the history of the relation with the id %{id}, took too long to retrieve."
   changeset_comments:
     feeds:
       comment:
@@ -1434,10 +1449,6 @@ en:
         level9: "Village Boundary"
         level10: "Suburb Boundary"
         level11: "Neighbourhood Boundary"
-      types:
-        cities: Cities
-        towns: Towns
-        places: Places
     results:
       no_results: "No results found"
       more_results: "More results"
@@ -1672,7 +1683,6 @@ en:
     changeset_comment_notification:
       description: "OpenStreetMap Changeset #%{id}"
       hi: "Hi %{to_user},"
-      greeting: "Hi,"
       commented:
         subject_own: "[OpenStreetMap] %{commenter} has commented on one of your changesets"
         subject_other: "[OpenStreetMap] %{commenter} has commented on a changeset you are interested in"
@@ -2684,7 +2694,6 @@ en:
         contributor_terms_url: "https://wiki.osmfoundation.org/wiki/Licence/Contributor_Terms"
         contributor_terms: "contributor terms"
       tou: "terms of use"
-      external auth: "Third Party Authentication:"
       continue: Sign Up
       terms accepted: "Thanks for accepting the new contributor terms!"
       email_help:
index 5bb08ea7104ba3ad21e531e1a9901ccb8a47a2ed..a294327231d78ca0b54b5e5f338ae305f27221d6 100644 (file)
@@ -90,4 +90,15 @@ class NodesControllerTest < ActionDispatch::IntegrationTest
     assert_select ".secondary-actions a", :text => "View History", :count => 1
     assert_select ".secondary-actions a", :text => "View Unredacted History", :count => 1
   end
+
+  def test_show_timeout
+    node = create(:node)
+    with_settings(:web_timeout => -1) do
+      get node_path(node)
+    end
+    assert_response :error
+    assert_template :layout => "map"
+    assert_dom "h2", "Timeout Error"
+    assert_dom "p", /#{Regexp.quote("the node with the id #{node.id}")}/
+  end
 end
index bb4dffdc6e74636fd8c118e9bcc8207ceb7c775a..abaf30d62e68563e5f694e0a015b7e57668f77b4 100644 (file)
@@ -218,6 +218,17 @@ class OldNodesControllerTest < ActionDispatch::IntegrationTest
     assert_select "#sidebar_content", /node #0 version 0 could not be found/
   end
 
+  def test_show_timeout
+    node = create(:node, :with_history)
+    with_settings(:web_timeout => -1) do
+      get old_node_path(node, 1)
+    end
+    assert_response :error
+    assert_template :layout => "map"
+    assert_dom "h2", "Timeout Error"
+    assert_dom "p", /#{Regexp.quote("the node with the id #{node.id}")}/
+  end
+
   private
 
   def create_redacted_node
index a766f8b8db113178edf13a4504c8f8a622d6f646..f5de706cf59e92220e4ec5c2348e6dd9e06c7a9c 100644 (file)
@@ -177,6 +177,17 @@ class OldRelationsControllerTest < ActionDispatch::IntegrationTest
     assert_select "#sidebar_content", /relation #0 version 0 could not be found/
   end
 
+  def test_show_timeout
+    relation = create(:relation, :with_history)
+    with_settings(:web_timeout => -1) do
+      get old_relation_path(relation, 1)
+    end
+    assert_response :error
+    assert_template :layout => "map"
+    assert_dom "h2", "Timeout Error"
+    assert_dom "p", /#{Regexp.quote("the relation with the id #{relation.id}")}/
+  end
+
   private
 
   def create_redacted_relation
index 6455343cfa63af9b1e4c43cb28bab6b9bbb021a6..fcc2281b85753cec329c579cf81366a76a171fd2 100644 (file)
@@ -182,6 +182,17 @@ class OldWaysControllerTest < ActionDispatch::IntegrationTest
     assert_select "#sidebar_content", /way #0 version 0 could not be found/
   end
 
+  def test_show_timeout
+    way = create(:way, :with_history)
+    with_settings(:web_timeout => -1) do
+      get old_way_path(way, 1)
+    end
+    assert_response :error
+    assert_template :layout => "map"
+    assert_dom "h2", "Timeout Error"
+    assert_dom "p", /#{Regexp.quote("the way with the id #{way.id}")}/
+  end
+
   private
 
   def create_redacted_way
index 926d9502638c1650b46ae44182e6e723b045e933..bdcbd2fd7bf386df6d0e49887761394808fbff1f 100644 (file)
@@ -36,4 +36,15 @@ class RelationsControllerTest < ActionDispatch::IntegrationTest
     sidebar_browse_check :relation_path, member.id, "browse/feature"
     assert_select "a[href='#{relation_path relation}']", :count => 1
   end
+
+  def test_show_timeout
+    relation = create(:relation)
+    with_settings(:web_timeout => -1) do
+      get relation_path(relation)
+    end
+    assert_response :error
+    assert_template :layout => "map"
+    assert_dom "h2", "Timeout Error"
+    assert_dom "p", /#{Regexp.quote("the relation with the id #{relation.id}")}/
+  end
 end
index e198f7cf6091f08af424b110955c86e6420d1739..995004cb4179236a95c8998263b90e872ae9366b 100644 (file)
@@ -36,4 +36,15 @@ class WaysControllerTest < ActionDispatch::IntegrationTest
     sidebar_browse_check :way_path, member.id, "browse/feature"
     assert_select "a[href='#{relation_path relation}']", :count => 1
   end
+
+  def test_show_timeout
+    way = create(:way)
+    with_settings(:web_timeout => -1) do
+      get way_path(way)
+    end
+    assert_response :error
+    assert_template :layout => "map"
+    assert_dom "h2", "Timeout Error"
+    assert_dom "p", /#{Regexp.quote("the way with the id #{way.id}")}/
+  end
 end