chore: Add display manifest to whitelabel settings (#8708)
- Adds display manifest to white label settings - Improve the app config rendering with options for display name and description
This commit is contained in:
@@ -12,6 +12,7 @@ class GlobalConfig
|
||||
config[config_key] = load_from_cache(config_key)
|
||||
end
|
||||
|
||||
typecast_config(config)
|
||||
config.with_indifferent_access
|
||||
end
|
||||
|
||||
@@ -28,6 +29,14 @@ class GlobalConfig
|
||||
|
||||
private
|
||||
|
||||
def typecast_config(config)
|
||||
general_configs = ConfigLoader.new.general_configs
|
||||
config.each do |config_key, config_value|
|
||||
config_type = general_configs.find { |c| c['name'] == config_key }&.dig('type')
|
||||
config[config_key] = ActiveRecord::Type::Boolean.new.cast(config_value) if config_type == 'boolean'
|
||||
end
|
||||
end
|
||||
|
||||
def load_from_cache(config_key)
|
||||
cache_key = "#{VERSION}:#{KEY_PREFIX}:#{config_key}"
|
||||
cached_value = $alfred.with { |conn| conn.get(cache_key) }
|
||||
|
||||
Reference in New Issue
Block a user