Skip to content

Commit

Permalink
Suggesting some changes to the bot protections forms (#2)
Browse files Browse the repository at this point in the history
Co-authored-by: Joan Lledó <jlledo@redhat.com>
  • Loading branch information
mayorova and jlledom authored Aug 5, 2024
1 parent dd9a814 commit 50a917f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/lib/three_scale/bot_protection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module ThreeScale
module BotProtection
LEVELS = [['None', :none], ['reCAPTCHA', :captcha]].freeze
LEVELS = [['None', :none], ['reCAPTCHA v3', :captcha]].freeze
end
end

2 changes: 1 addition & 1 deletion app/views/provider/admin/bot_protections/_form.html.slim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
= semantic_form_for settings, url: url, html: {:id => 'bot-protection-settings' } do |form|
= form.inputs t('.title', portal: portal) do
= form.inputs selector_label do
= form.input field,
label: false,
hint: t("sites.spam_protections.edit.captcha_hint_#{Recaptcha.captcha_configured?.to_s}"),
Expand Down
2 changes: 1 addition & 1 deletion app/views/provider/admin/bot_protections/edit.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
- content_for :page_header_title, 'Bot Protection'
- content_for :page_header_body, t('.description')

= render partial: 'form', locals: { url: provider_admin_bot_protection_path, settings: @settings, field: :admin_bot_protection_level, portal: 'Admin' }
= render partial: 'form', locals: { url: provider_admin_bot_protection_path, settings: @settings, field: :admin_bot_protection_level, selector_label: t('.selector_label') }
2 changes: 1 addition & 1 deletion app/views/sites/spam_protections/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
<% content_for :page_header_title, 'Bot Protection' %>
<% content_for :page_header_body, t('.description') %>

<%= render partial: 'provider/admin/bot_protections/form', locals: { url: admin_site_spam_protection_path, settings: @settings, field: :spam_protection_level, portal: 'Development' } %>
<%= render partial: 'provider/admin/bot_protections/form', locals: { url: admin_site_spam_protection_path, settings: @settings, field: :spam_protection_level, selector_label: t('.selector_label') } %>
6 changes: 4 additions & 2 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,8 @@ en:
form:
title: Protection against bots on %{portal} portal
edit:
description: Bot protection helps authenticate and block malicious clients, and enables you to avoid account brute force when logging in 3scale management admin portal.
selector_label: Protection against bots on the admin portal
description: Bot protection uses Google reCAPTCHA to detect bots and prevent malicious attacks on the admin portal.
keys:
create:
success: A new key has been added.
Expand Down Expand Up @@ -614,7 +615,8 @@ en:
sites:
spam_protections:
edit:
description: Bot protection helps authenticate and block malicious clients, and enables you to avoid account brute force when logging in 3scale management developer portal.
selector_label: Protection against bots on the developer portal
description: Bot protection uses Google reCAPTCHA to detect bots and prevent malicious attacks on the developer portal.
captcha_hint_false: 'reCAPTCHA has not been configured correctly, bot protection cannot be enabled.'
captcha_hint_true: "reCAPTCHA v3 will invisibly verify interactions to detect bots."
usage_rules:
Expand Down

0 comments on commit 50a917f

Please sign in to comment.