]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/4996'
authorTom Hughes <tom@compton.nu>
Tue, 16 Jul 2024 16:15:47 +0000 (17:15 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 16 Jul 2024 16:15:47 +0000 (17:15 +0100)
Gemfile.lock
app/helpers/user_helper.rb
app/views/application/_auth_providers.html.erb
test/helpers/user_helper_test.rb

index 284e97adc9fa92bf307cada90a90c0e85128a29f..412ef4820a8e63330c8501f1e840b1e1bf5ca318 100644 (file)
@@ -95,7 +95,7 @@ GEM
     autoprefixer-rails (10.4.16.0)
       execjs (~> 2)
     aws-eventstream (1.3.0)
-    aws-partitions (1.954.0)
+    aws-partitions (1.956.0)
     aws-sdk-core (3.201.1)
       aws-eventstream (~> 1, >= 1.3.0)
       aws-partitions (~> 1, >= 1.651.0)
@@ -256,7 +256,8 @@ GEM
     google-protobuf (3.25.3)
     hashdiff (1.1.0)
     hashie (5.0.0)
-    highline (3.0.1)
+    highline (3.1.0)
+      reline
     htmlentities (4.3.4)
     http_accept_language (2.1.1)
     i18n (1.14.5)
@@ -484,7 +485,7 @@ GEM
       io-console (~> 0.5)
     request_store (1.7.0)
       rack (>= 1.4)
-    rexml (3.3.1)
+    rexml (3.3.2)
       strscan
     rinku (2.0.6)
     rotp (6.3.0)
@@ -508,7 +509,7 @@ GEM
       rubocop (~> 1.41)
     rubocop-factory_bot (2.26.1)
       rubocop (~> 1.61)
-    rubocop-minitest (0.35.0)
+    rubocop-minitest (0.35.1)
       rubocop (>= 1.61, < 2.0)
       rubocop-ast (>= 1.31.1, < 2.0)
     rubocop-performance (1.21.1)
index 734a266db0bcaee9e9061f4d0ce2f4454d04a37b..5863a9403820b7e6bfa622d5c07aa21d587f0418 100644 (file)
@@ -52,29 +52,29 @@ module UserHelper
 
   # External authentication support
 
-  def auth_button(name, provider, options = {})
+  def auth_button(provider, options = {})
     link_to(
-      image_tag("#{name}.svg",
-                :alt => t("application.auth_providers.#{name}.alt"),
+      image_tag("#{provider}.svg",
+                :alt => t("application.auth_providers.#{provider}.alt"),
                 :class => "rounded-1",
                 :size => "36"),
       auth_path(options.merge(:provider => provider)),
       :method => :post,
       :class => "auth_button btn btn-light p-2",
-      :title => t("application.auth_providers.#{name}.title")
+      :title => t("application.auth_providers.#{provider}.title")
     )
   end
 
-  def auth_button_preferred(name, provider, options = {})
+  def auth_button_preferred(provider, options = {})
     link_to(
-      image_tag("#{name}.svg",
-                :alt => t("application.auth_providers.#{name}.alt"),
+      image_tag("#{provider}.svg",
+                :alt => t("application.auth_providers.#{provider}.alt"),
                 :class => "rounded-1 me-3",
-                :size => "36") + t("application.auth_providers.#{name}.title"),
+                :size => "36") + t("application.auth_providers.#{provider}.title"),
       auth_path(options.merge(:provider => provider)),
       :method => :post,
       :class => "auth_button btn btn-outline-secondary border py-2 px-4 d-flex justify-content-center align-items-center",
-      :title => t("application.auth_providers.#{name}.title")
+      :title => t("application.auth_providers.#{provider}.title")
     )
   end
 
index 4577da66845108eca2b9860df2c43a7a8a9dac7c..89de3b4ffbf63a19f01ae08f9ce3d523d1d90911 100644 (file)
@@ -16,7 +16,7 @@
         <% %w[google facebook microsoft github wikipedia].each do |provider| %>
           <% if Settings.key?("#{provider}_auth_id".to_sym) -%>
             <% if @preferred_auth_provider == provider %>
-              <%= auth_button_preferred provider, provider %>
+              <%= auth_button_preferred provider %>
             <% end %>
           <% end -%>
         <% end -%>
@@ -35,7 +35,7 @@
       <% %w[google facebook microsoft github wikipedia].each do |provider| %>
         <% unless @preferred_auth_provider == provider %>
           <% if Settings.key?("#{provider}_auth_id".to_sym) -%>
-            <%= auth_button provider, provider %>
+            <%= auth_button provider %>
           <% end -%>
         <% end %>
       <% end -%>
index 53b9a823bc6476804b53b2736c39e112d83b3fe7..c4020dd7f489dae05d157646e25e735110402627 100644 (file)
@@ -110,7 +110,7 @@ class UserHelperTest < ActionView::TestCase
   end
 
   def test_auth_button
-    button = auth_button("google", "google")
+    button = auth_button("google")
     img_tag = "<img alt=\"Google logo\" class=\"rounded-1\" src=\"/images/google.svg\" width=\"36\" height=\"36\" />"
     assert_equal("<a class=\"auth_button btn btn-light p-2\" title=\"Log in with Google\" rel=\"nofollow\" data-method=\"post\" href=\"/auth/google\">#{img_tag}</a>", button)
   end