diff --git a/app/controllers/sms_settings_controller.rb b/app/controllers/sms_settings_controller.rb index ff65e794..3406e617 100644 --- a/app/controllers/sms_settings_controller.rb +++ b/app/controllers/sms_settings_controller.rb @@ -42,7 +42,7 @@ class SmsSettingsController < ApplicationController def load_encrypted_config @encrypted_config = - EncryptedConfig.find_or_initialize_by(account: current_account, key: 'sms_configs') + EncryptedConfig.find_or_initialize_by(account: current_account, key: EncryptedConfig::SMS_CONFIGS_KEY) end def build_sms_value diff --git a/app/models/encrypted_config.rb b/app/models/encrypted_config.rb index 7796eada..b5637e50 100644 --- a/app/models/encrypted_config.rb +++ b/app/models/encrypted_config.rb @@ -27,7 +27,8 @@ class EncryptedConfig < ApplicationRecord ESIGN_CERTS_KEY = 'esign_certs', TIMESTAMP_SERVER_URL_KEY = 'timestamp_server_url', APP_URL_KEY = 'app_url', - GOOGLE_SSO_KEY = 'google_sso' + GOOGLE_SSO_KEY = 'google_sso', + SMS_CONFIGS_KEY = 'sms_configs' ].freeze belongs_to :account diff --git a/app/views/personalization_settings/_logo_placeholder.html.erb b/app/views/personalization_settings/_logo_placeholder.html.erb index a44316c6..12473024 100644 --- a/app/views/personalization_settings/_logo_placeholder.html.erb +++ b/app/views/personalization_settings/_logo_placeholder.html.erb @@ -4,11 +4,11 @@ <%= image_tag current_account.logo, class: 'w-16 h-16 object-contain rounded-lg', alt: 'Company logo' %>

<%= current_account.logo.filename %>

- <%= button_to t('remove'), account_logo_path, method: :delete, class: 'btn btn-sm btn-outline btn-error mt-1', data: { turbo: false } %> + <%= button_to t('remove'), settings_account_logo_path, method: :delete, class: 'btn btn-sm btn-outline btn-error mt-1', data: { turbo: false } %>
<% end %> - <%= form_with url: account_logo_path, local: true, class: 'space-y-3' do |f| %> + <%= form_with url: settings_account_logo_path, local: true, class: 'space-y-3' do |f| %>
<%= f.label :logo, 'Upload logo', class: 'label' %> <%= f.file_field :logo, accept: 'image/png,image/jpeg,image/svg+xml', class: 'file-input file-input-bordered w-full' %> diff --git a/app/views/shared/_settings_nav.html.erb b/app/views/shared/_settings_nav.html.erb index 4aaf9732..0414e095 100644 --- a/app/views/shared/_settings_nav.html.erb +++ b/app/views/shared/_settings_nav.html.erb @@ -23,7 +23,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 %> + <% if can?(:read, EncryptedConfig.new(key: EncryptedConfig::SMS_CONFIGS_KEY, account: current_account)) && true_user == current_user %>
  • <%= link_to 'SMS', settings_sms_path, class: 'text-base hover:bg-base-300' %>
  • diff --git a/spec/system/account_logo_spec.rb b/spec/system/account_logo_spec.rb index 076a1f80..8d61514b 100644 --- a/spec/system/account_logo_spec.rb +++ b/spec/system/account_logo_spec.rb @@ -14,10 +14,11 @@ RSpec.describe 'Account Logo' do expect(page).to have_content(I18n.t('company_logo')) end - it 'shows a placeholder message in single-tenant mode' do + it 'shows the logo upload form' do visit settings_personalization_path - expect(page).to have_content(I18n.t('unlock_with_docuseal_pro')) + expect(page).to have_content('Upload logo') + expect(page).to have_css('input[type="file"]') end context 'when a logo is attached' do diff --git a/spec/system/sms_settings_spec.rb b/spec/system/sms_settings_spec.rb index ad862525..d2b0c82c 100644 --- a/spec/system/sms_settings_spec.rb +++ b/spec/system/sms_settings_spec.rb @@ -8,10 +8,11 @@ RSpec.describe 'SMS Settings' do sign_in(user) end - it 'shows the SMS settings page with a placeholder in non-multitenant mode' do + it 'shows the SMS settings page with provider form' do visit settings_sms_path expect(page).to have_content('SMS') - expect(page).to have_content(I18n.t('unlock_with_docuseal_pro')) + expect(page).to have_content('Provider') + expect(page).to have_select('Provider') end end diff --git a/spec/system/sso_settings_spec.rb b/spec/system/sso_settings_spec.rb index d0da7303..a5b2dd16 100644 --- a/spec/system/sso_settings_spec.rb +++ b/spec/system/sso_settings_spec.rb @@ -8,9 +8,10 @@ RSpec.describe 'SSO Settings' do sign_in(user) end - it 'shows a placeholder in single-tenant mode' do + it 'shows SSO settings page' do visit settings_sso_index_path - expect(page).to have_content(I18n.t('unlock_with_docuseal_pro')) + expect(page).to have_content('SSO') + expect(page).to have_content('SAML_CONFIGS') end end