From c0dd4b85ed5a8ef0a29dfd9b7fe3b44bca23f687 Mon Sep 17 00:00:00 2001 From: Alex Turchyn Date: Fri, 11 Sep 2026 23:42:37 +0300 Subject: [PATCH] hide pro badges only in iOS app --- app/controllers/application_controller.rb | 7 ++++++- app/javascript/elements/emails_textarea.js | 2 +- app/views/accounts/show.html.erb | 4 ++-- app/views/notifications_settings/index.html.erb | 2 +- app/views/personalization_settings/show.html.erb | 2 +- app/views/shared/_settings_nav.html.erb | 6 +++--- app/views/submissions/_send_sms_button.html.erb | 2 +- app/views/submissions/new.html.erb | 2 +- app/views/templates_code_modal/_placeholder.html.erb | 2 +- app/views/users/_role_select.html.erb | 2 +- 10 files changed, 18 insertions(+), 13 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 12bc306fa..58992a4e5 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -19,7 +19,8 @@ class ApplicationController < ActionController::Base :current_account, :true_ability, :form_link_host, - :svg_icon + :svg_icon, + :turbo_native_ios? impersonates :user, with: ->(uuid) { User.find_by(uuid:) } @@ -64,6 +65,10 @@ class ApplicationController < ActionController::Base private + def turbo_native_ios? + request.user_agent.to_s.include?('Hotwire Native iOS') + end + def with_locale(&) return yield unless current_account diff --git a/app/javascript/elements/emails_textarea.js b/app/javascript/elements/emails_textarea.js index 9c0aa7f46..ea5e94460 100644 --- a/app/javascript/elements/emails_textarea.js +++ b/app/javascript/elements/emails_textarea.js @@ -35,7 +35,7 @@ export default class extends HTMLElement { counter.innerText = `${count} / ${this.dataset.limit}` } - if (this.dataset.bulkEnabled !== 'true' && !/Hotwire Native/.test(navigator.userAgent)) { + if (this.dataset.bulkEnabled !== 'true' && !/Hotwire Native iOS/.test(navigator.userAgent)) { if (!bulkMessage) { bulkMessage = document.createElement('span') diff --git a/app/views/accounts/show.html.erb b/app/views/accounts/show.html.erb index a6241cb1b..b9ef9192c 100644 --- a/app/views/accounts/show.html.erb +++ b/app/views/accounts/show.html.erb @@ -133,7 +133,7 @@ <% end %> <% end %> <% account_config = AccountConfig.find_or_initialize_by(account: current_account, key: AccountConfig::ALLOW_TO_DECLINE_KEY) %> - <% if can?(:manage, account_config) && (!turbo_native_app? || !Docuseal.multitenant? || can?(:manage, :disable_decline)) %> + <% if can?(:manage, account_config) && (!turbo_native_ios? || !Docuseal.multitenant? || can?(:manage, :disable_decline)) %> <%= form_for account_config, url: account_configs_path, method: :post do |f| %> <%= f.hidden_field :key %>
@@ -156,7 +156,7 @@ <% end %> <% end %> <% account_config = AccountConfig.find_or_initialize_by(account: current_account, key: AccountConfig::ALLOW_TO_DELEGATE_KEY) %> - <% if can?(:manage, account_config) && (!turbo_native_app? || !Docuseal.multitenant? || can?(:manage, :delegate_form)) %> + <% if can?(:manage, account_config) && (!turbo_native_ios? || !Docuseal.multitenant? || can?(:manage, :delegate_form)) %> <%= form_for account_config, url: account_configs_path, method: :post do |f| %> <%= f.hidden_field :key %>
diff --git a/app/views/notifications_settings/index.html.erb b/app/views/notifications_settings/index.html.erb index 3a65a20f3..41bc2cdf6 100644 --- a/app/views/notifications_settings/index.html.erb +++ b/app/views/notifications_settings/index.html.erb @@ -22,7 +22,7 @@ <% end %>
<%= render 'bcc_form', config: @bcc_config %> - <% unless can?(:manage, :personalization_restricted) || (turbo_native_app? && !can?(:manage, :email_reminders)) %> + <% unless can?(:manage, :personalization_restricted) || (turbo_native_ios? && !can?(:manage, :email_reminders)) %>

<%= t('sign_request_email_reminders') %> diff --git a/app/views/personalization_settings/show.html.erb b/app/views/personalization_settings/show.html.erb index a78b06e6e..f039d4503 100644 --- a/app/views/personalization_settings/show.html.erb +++ b/app/views/personalization_settings/show.html.erb @@ -10,7 +10,7 @@ <%= render 'documents_copy_email_form' %> <%= render 'submitter_completed_email_form' %>

- <% if !turbo_native_app? || can?(:manage, :custom_logo) %> + <% if !turbo_native_ios? || can?(:manage, :custom_logo) %>

<%= t('company_logo') %>

diff --git a/app/views/shared/_settings_nav.html.erb b/app/views/shared/_settings_nav.html.erb index 2e43b1300..3a1007296 100644 --- a/app/views/shared/_settings_nav.html.erb +++ b/app/views/shared/_settings_nav.html.erb @@ -42,7 +42,7 @@ <%= link_to t('storage'), settings_storage_index_path, class: 'text-base hover:bg-base-300' %> <% end %> - <% if can?(:read, EncryptedConfig.new(key: 'submitter_invitation_sms', account: current_account)) && true_user == current_user && (!turbo_native_app? || can?(:manage, :sms_verification)) %> + <% if can?(:read, EncryptedConfig.new(key: 'submitter_invitation_sms', account: current_account)) && true_user == current_user && (!turbo_native_ios? || can?(:manage, :sms_verification)) %>
  • <%= link_to 'SMS', settings_sms_path, class: 'text-base hover:bg-base-300' %>
  • @@ -83,7 +83,7 @@ <% end %> <% end %> - <% if !Docuseal.demo? && !turbo_native_app? && can?(:manage, EncryptedConfig) && (current_user != true_user || !current_account.linked_account_account) %> + <% if !Docuseal.demo? && !turbo_native_ios? && can?(:manage, EncryptedConfig) && (current_user != true_user || !current_account.linked_account_account) %>
  • <%= content_for(:pro_link) || link_to(Docuseal.multitenant? ? console_redirect_index_path(redir: "#{Docuseal::CONSOLE_URL}/plans") : "#{Docuseal::CLOUD_URL}/sign_up?#{{ redir: "#{Docuseal::CONSOLE_URL}/on_premises" }.to_query}", class: 'text-base hover:bg-base-300', data: { turbo: false }) do %> <%= t('plans') %> @@ -104,7 +104,7 @@ <% end %>
  • <% end %> - <% if (!Docuseal.multitenant? || can?(:manage, :saml_sso)) && can?(:read, EncryptedConfig.new(key: 'saml_configs', account: current_account)) && true_user == current_user && (!turbo_native_app? || can?(:manage, :saml_sso)) %> + <% if (!Docuseal.multitenant? || can?(:manage, :saml_sso)) && can?(:read, EncryptedConfig.new(key: 'saml_configs', account: current_account)) && true_user == current_user && (!turbo_native_ios? || can?(:manage, :saml_sso)) %>
  • <%= link_to 'SSO', settings_sso_index_path, class: 'text-base hover:bg-base-300' %>
  • diff --git a/app/views/submissions/_send_sms_button.html.erb b/app/views/submissions/_send_sms_button.html.erb index 7e18fed02..26d90f80b 100644 --- a/app/views/submissions/_send_sms_button.html.erb +++ b/app/views/submissions/_send_sms_button.html.erb @@ -1,4 +1,4 @@ -<% unless turbo_native_app? %> +<% unless turbo_native_ios? %>
    <%= link_to submitter.sent_at? ? t('re_send_sms') : t('send_sms'), Docuseal.multitenant? ? console_redirect_index_path(redir: "#{Docuseal::CONSOLE_URL}/plans") : "#{Docuseal::CLOUD_URL}/sign_up?#{{ redir: "#{Docuseal::CONSOLE_URL}/on_premises" }.to_query}", class: 'btn btn-sm btn-primary text-gray-400 w-full' %> diff --git a/app/views/submissions/new.html.erb b/app/views/submissions/new.html.erb index e8052898b..82fcb9733 100644 --- a/app/views/submissions/new.html.erb +++ b/app/views/submissions/new.html.erb @@ -6,7 +6,7 @@ <% recipient_form_fields = Accounts.load_recipient_form_fields(current_account) if prefillable_fields.blank? %> <% can_send_emails = Accounts.can_send_emails?(current_account) %> <% only_detailed = require_phone_2fa || require_email_2fa || prefillable_fields.present? || recipient_form_fields.present? %> -<% with_list = @template.variables_schema.blank? && (!turbo_native_app? || can?(:manage, :bulk_send)) %> +<% with_list = @template.variables_schema.blank? && (!turbo_native_ios? || can?(:manage, :bulk_send)) %> <% variables_form = render 'variables_form', schema: @template.variables_schema if @template.variables_schema.present? && @template.variables_schema.any? { |_, v| !v['disabled'] } %> <%= render 'shared/turbo_modal_large', title: params[:selfsign] ? t('add_recipients') : t('add_new_recipients') do %> <% options = [only_detailed ? nil : [t('via_email'), 'email'], only_detailed ? nil : [t('via_phone'), 'phone'], [t('detailed'), 'detailed'], with_list ? [t('upload_list'), 'list'] : nil].compact %> diff --git a/app/views/templates_code_modal/_placeholder.html.erb b/app/views/templates_code_modal/_placeholder.html.erb index 9e24d2a93..b5c69ac27 100644 --- a/app/views/templates_code_modal/_placeholder.html.erb +++ b/app/views/templates_code_modal/_placeholder.html.erb @@ -1,4 +1,4 @@ -<% unless turbo_native_app? %> +<% unless turbo_native_ios? %>
    <%= svg_icon('info_circle', class: 'w-6 h-6') %>
    diff --git a/app/views/users/_role_select.html.erb b/app/views/users/_role_select.html.erb index d3fa10290..dde2cacca 100644 --- a/app/views/users/_role_select.html.erb +++ b/app/views/users/_role_select.html.erb @@ -12,7 +12,7 @@ <% end %> - <% unless turbo_native_app? %> + <% unless turbo_native_ios? %> "> <%= svg_icon('info_circle', class: 'w-4 h-4 inline align-text-bottom') %> <%= t('unlock_more_user_roles_with_docuseal_pro') %>