From 7cf0b5aaf723a695a750c377cdaf1858147892c4 Mon Sep 17 00:00:00 2001 From: Alex Turchyn Date: Tue, 15 Sep 2026 00:54:57 +0300 Subject: [PATCH] hide pro badge in the iOS app --- app/javascript/application.js | 3 +- app/javascript/template_builder/builder.vue | 6 +++ .../template_builder/field_context_menu.vue | 6 +-- .../template_builder/field_settings.vue | 6 +-- app/javascript/template_builder/fields.vue | 4 +- .../template_builder/payment_settings.vue | 5 +- .../selection_context_menu.vue | 4 +- .../_default_signature_row.html.erb | 50 ++++++++++--------- app/views/shared/_settings_nav.html.erb | 12 +++-- app/views/submissions/_send_sms.html.erb | 8 +-- app/views/submissions/new.html.erb | 12 +++-- app/views/templates/edit.html.erb | 2 +- 12 files changed, 68 insertions(+), 50 deletions(-) diff --git a/app/javascript/application.js b/app/javascript/application.js index 0ecf3be28..95911c0e5 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -233,7 +233,8 @@ safeRegisterElement('template-builder', class extends HTMLElement { currencies: (this.dataset.currencies || '').split(',').filter(Boolean), acceptFileTypes: this.dataset.acceptFileTypes, showTourStartForm: this.dataset.showTourStartForm === 'true', - nativeApp: this.dataset.nativeApp === 'true' + nativeApp: this.dataset.nativeApp === 'true', + nativeIos: this.dataset.nativeIos === 'true' }) this.component = this.app.mount(this.appElem) diff --git a/app/javascript/template_builder/builder.vue b/app/javascript/template_builder/builder.vue index 553a6d0b4..af3780022 100644 --- a/app/javascript/template_builder/builder.vue +++ b/app/javascript/template_builder/builder.vue @@ -886,6 +886,7 @@ export default { isPaypalConnected: this.isPaypalConnected, withFormula: this.withFormula, withConditions: this.withConditions, + nativeIos: this.nativeIos, withCustomFields: this.withCustomFields, isInlineSize: this.isInlineSize, defaultDrawFieldType: this.defaultDrawFieldType, @@ -1108,6 +1109,11 @@ export default { required: false, default: false }, + nativeIos: { + type: Boolean, + required: false, + default: false + }, withFieldsSearch: { type: Boolean, required: false, diff --git a/app/javascript/template_builder/field_context_menu.vue b/app/javascript/template_builder/field_context_menu.vue index 0ab8f1dde..91cea3968 100644 --- a/app/javascript/template_builder/field_context_menu.vue +++ b/app/javascript/template_builder/field_context_menu.vue @@ -515,7 +515,7 @@ export default { ContextSubmenu, ContextModal }, - inject: ['t', 'getFieldTypeIndex', 'template', 'withCustomFields', 'currencies', 'dateFormats', 'locale'], + inject: ['t', 'getFieldTypeIndex', 'template', 'withCustomFields', 'currencies', 'dateFormats', 'locale', 'withFormula', 'withConditions', 'nativeIos'], props: { contextMenu: { type: Object, @@ -608,10 +608,10 @@ export default { return !['stamp', 'heading', 'strikethrough'].includes(this.field.type) }, showCondition () { - return this.withCondition && !['stamp', 'heading'].includes(this.field.type) + return this.withCondition && (this.withConditions || !this.nativeIos) && !['stamp', 'heading'].includes(this.field.type) }, showFormula () { - return this.field.type === 'number' || this.field.type === 'payment' || !!this.field.preferences?.formula + return (this.field.type === 'number' || this.field.type === 'payment' || !!this.field.preferences?.formula) && (this.withFormula || !this.nativeIos) }, showRequired () { return this.withRequired && !['phone', 'stamp', 'verification', 'strikethrough', 'heading'].includes(this.field.type) diff --git a/app/javascript/template_builder/field_settings.vue b/app/javascript/template_builder/field_settings.vue index ef76d2b03..91c4ff093 100644 --- a/app/javascript/template_builder/field_settings.vue +++ b/app/javascript/template_builder/field_settings.vue @@ -484,7 +484,7 @@
  • <% end %> <% if !Docuseal.demo? && can?(:manage, EncryptedConfig) && (current_user == true_user || current_account.testing?) %> -
  • - <%= link_to Docuseal.multitenant? ? console_redirect_index_path(redir: "#{Docuseal::CONSOLE_URL}#{'/test' if current_account.testing?}/api") : "#{Docuseal::CONSOLE_URL}/on_premises", class: 'text-base hover:bg-base-300', data: { turbo: false } do %> - <% if Docuseal.multitenant? %> API <% else %> <%= t('console') %> <% end %> - <% end %> -
  • + <% if Docuseal.multitenant? || !turbo_native_ios? %> +
  • + <%= link_to Docuseal.multitenant? ? console_redirect_index_path(redir: "#{Docuseal::CONSOLE_URL}#{'/test' if current_account.testing?}/api") : "#{Docuseal::CONSOLE_URL}/on_premises", class: 'text-base hover:bg-base-300', data: { turbo: false } do %> + <% if Docuseal.multitenant? %> API <% else %> <%= t('console') %> <% end %> + <% end %> +
  • + <% end %> <% if Docuseal.multitenant? %>
  • <%= link_to console_redirect_index_path(redir: "#{Docuseal::CONSOLE_URL}#{'/test' if current_account.testing?}/embedding/form"), class: 'text-base hover:bg-base-300', data: { turbo: false } do %> diff --git a/app/views/submissions/_send_sms.html.erb b/app/views/submissions/_send_sms.html.erb index 4637e3ac3..92a8de542 100644 --- a/app/views/submissions/_send_sms.html.erb +++ b/app/views/submissions/_send_sms.html.erb @@ -1,3 +1,5 @@ -
    - <%= render 'sms_settings/placeholder' %> -
    +<% unless turbo_native_ios? %> +
    + <%= render 'sms_settings/placeholder' %> +
    +<% end %> diff --git a/app/views/submissions/new.html.erb b/app/views/submissions/new.html.erb index 82fcb9733..06aa9ebfd 100644 --- a/app/views/submissions/new.html.erb +++ b/app/views/submissions/new.html.erb @@ -7,9 +7,11 @@ <% 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_ios? || can?(:manage, :bulk_send)) %> +<% with_phone = !turbo_native_ios? || can?(:manage, :sms_verification) %> +<% default_tab = 'email' if default_tab == 'phone' && !with_phone %> <% 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 %> + <% options = [only_detailed ? nil : [t('via_email'), 'email'], only_detailed || !with_phone ? nil : [t('via_phone'), 'phone'], [t('detailed'), 'detailed'], with_list ? [t('upload_list'), 'list'] : nil].compact %> <% if options.size > 1 %>
    @@ -29,9 +31,11 @@
    <%= render 'email_form', template: @template, variables_form:, can_send_emails:, viewer_submitter_uuids: %>
    -
    - <%= render 'phone_form', template: @template, variables_form: %> -
    + <% if with_phone %> +
    + <%= render 'phone_form', template: @template, variables_form: %> +
    + <% end %> <% end %>
    <%= render 'detailed_form', template: @template, require_phone_2fa:, require_email_2fa:, prefillable_fields:, recipient_form_fields:, variables_form:, can_send_emails:, viewer_submitter_uuids: %> diff --git a/app/views/templates/edit.html.erb b/app/views/templates/edit.html.erb index 11697522b..ac881f21e 100644 --- a/app/views/templates/edit.html.erb +++ b/app/views/templates/edit.html.erb @@ -10,4 +10,4 @@ <% account_configs = current_account.account_configs.where(key: [AccountConfig::TEMPLATE_CUSTOM_FIELDS_KEY, AccountConfig::TEMPLATE_DATE_FORMATS_KEY]).to_a %> <% custom_fields = account_configs.find { |e| e.key == AccountConfig::TEMPLATE_CUSTOM_FIELDS_KEY }&.value || [] %> <% date_formats = account_configs.find { |e| e.key == AccountConfig::TEMPLATE_DATE_FORMATS_KEY }&.value || [] %> - +