Skip to content

Commit

Permalink
enhancement: exclude_from_status configuration (#3499)
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob authored Dec 9, 2024
1 parent 375fa79 commit 3edc7ca
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/views/avo/debug/status.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
'port',
'ip',
'app_name',
]
].excluding(Avo.configuration.exclude_from_status)

hq_payload = Avo::Licensing::HQ.new(request).payload
%>
<div class="flex flex-col">
Expand Down
6 changes: 6 additions & 0 deletions lib/avo/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Configuration
attr_writer :turbo
attr_writer :pagination
attr_writer :explicit_authorization
attr_writer :exclude_from_status
attr_accessor :timezone
attr_accessor :per_page
attr_accessor :per_page_steps
Expand Down Expand Up @@ -121,6 +122,7 @@ def initialize
@search_results_count = 8
@first_sorting_option = :desc # :desc or :asc
@associations_lookup_list_limit = 1000
@exclude_from_status = []
end

# Authorization is enabled when:
Expand Down Expand Up @@ -251,6 +253,10 @@ def turbo
Avo::ExecutionContext.new(target: @turbo).handle
end

def exclude_from_status
Avo::ExecutionContext.new(target: @exclude_from_status).handle
end

def default_turbo
-> do
{
Expand Down
1 change: 1 addition & 0 deletions lib/generators/avo/templates/initializer/avo.tt
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ Avo.configure do |config|
# config.field_wrapper_layout = true
# config.resource_parent_controller = "Avo::ResourcesController"
# config.first_sorting_option = :desc # :desc or :asc
# config.exclude_from_status = []

## == Branding ==
# config.branding = {
Expand Down
1 change: 1 addition & 0 deletions spec/dummy/config/initializers/avo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

## == Licensing ==
config.license_key = ENV["AVO_LICENSE_KEY"]
config.exclude_from_status = ["license_key"]

## == App context ==
config.current_user_method = :current_user
Expand Down

0 comments on commit 3edc7ca

Please sign in to comment.