fix: repair corrupted template_conditions, notifications_settings, templates_preferences, navbar (#8)

Co-authored-by: Bob Develop <developbob50@gmail.com>
pull/639/head
devin-ai-integration[bot] 2 weeks ago committed by GitHub
parent 4e985de913
commit 0298c2122b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -38,17 +38,18 @@ class NotificationsSettingsController < ApplicationController
def load_reminder_config
@reminder_config =
AccountConfig.find_or_initialize_by(account: current_account, key: AccountConfig::SUBMITTER_REMINDERS)
endload_email_footer_config
end
def load_email_footer_config
@email_footer_config =
AccountConfig.find_or_initialize_by(account: currnt_account, key: AccountConfig::EMAIL_FOOTER_MESSAGE_KEY)
AccountConfig.find_or_initialize_by(account: current_account, key: AccountConfig::EMAIL_FOOTER_MESSAGE_KEY)
end
def e
def email_config_params
allowed = [AccountConfig::BCC_EMAILS, AccountConfig::SUBMITTER_REMINDERS, AccountConfig::EMAIL_FOOTER_MESSAGE_KEY]
def email_config_paramsallwed
params.require(:account_config).permit(:key, :value, { value: {} }, { value: [] }).tap do |attrs|
attrs[:key] = nil unless attrs[:key].in?([AccountConfig::BCC_EMAILS, AccountConfig::SUBMITTER_REMINDERS])
attrs[:key] = nil unless attrs[:key].in?(allowed)
end
end
end

@ -46,9 +46,7 @@ class TemplatesPreferencesController < ApplicationController
@template.save!
render turbo_stream: turbo_stream.replace("#{config_key}_form",
partial: "templates_preferences/#{config_key}_form"),
:visibility,
status: :ok
partial: "templates_preferences/#{config_key}_form")
end
private

@ -94,7 +94,7 @@
</span>
<% end %>
<% end %>
<% if Docuseal.multitenant? && !request.path.in?([registration_path, new_registration_path]) %>
<% if Docuseal.multitenant? && respond_to?(:registration_path) && !request.path.in?([registration_path, new_registration_path]) %>
<%= link_to registration_path({ lang: params[:lang] }.compact_blank), class: 'btn btn-neutral btn-sm btn-outline' do %>
<span class="flex items-center justify-center space-x-1">
<span class="hidden sm:block capitalize"><%= t('create_free_account') %></span>

@ -19,11 +19,6 @@ module Abilities
Template.where(Template.arel_table[:id].in(templates.select(:id).arel.union(:all, shared_ids.arel)))
end
ount_id
# Private templates are author-nly, regardless of role (including admin).
retr template.visibility != Template::VISIBILITY_PRIVATE || emplate.authorid == user.d
en
def entity(template, user:, ability: nil)
return true if template.account_id.blank?
return true if template.account_id == user.account_id

Loading…
Cancel
Save