ultra_settings 2.4.0 → 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/VERSION +1 -1
- data/app/application.css +1 -1
- data/app/application_vars.css.erb +2 -2
- data/app/index.html.erb +21 -15
- data/lib/ultra_settings/configuration.rb +6 -3
- data/lib/ultra_settings/configuration_view.rb +1 -1
- data/lib/ultra_settings/railtie.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2675de07815b6ed0bdf20e8a94c6eef6cb9a8a54e98940a27a2b2997537e6e9e
|
4
|
+
data.tar.gz: b51695a82e8eb135da697e12271d81d705f7a915cc56c279ceb420de542b0234
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7755825b6e17372447237c99063eb87084c79e15317e80a76f0d6ec55d88931284c51143095bf3a87b2e3b4fc7b4d7e271223329ef19a6618f91033d7da67065
|
7
|
+
data.tar.gz: d660fec7954015f97433b2ff8446d3688381311b5f927c827c9dab7d0ec8c6311578ab0fec53f2794b09014d6b5659d0332dc684155541c3ac25702d4dda0124
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,20 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## 2.4.2
|
8
|
+
|
9
|
+
### Changed
|
10
|
+
|
11
|
+
- Configuration setup set prior to loading the railtie will no longer be overridden by the railtie default setup.
|
12
|
+
|
13
|
+
## 2.4.1
|
14
|
+
|
15
|
+
### Changed
|
16
|
+
|
17
|
+
- Ignore base configuration classes that don't have any fields defined in the web UI.
|
18
|
+
- Allow overriding values on static fields in tests.
|
19
|
+
- Changed Web UI CSS variable scope to apply to all application elements.
|
20
|
+
|
7
21
|
## 2.4.0
|
8
22
|
|
9
23
|
### Added
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.4.
|
1
|
+
2.4.2
|
data/app/application.css
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
<% unless color_scheme == :dark %>
|
2
|
-
.ultra-settings
|
2
|
+
.ultra-settings {
|
3
3
|
--table-header-bg-color: #fff;
|
4
4
|
--table-border-color: #dee2e6;
|
5
5
|
--alt-row-color: rgba(0, 0, 0, .05);
|
@@ -15,7 +15,7 @@
|
|
15
15
|
@media (prefers-color-scheme: dark) {
|
16
16
|
<% end %>
|
17
17
|
<% if color_scheme == :system || color_scheme == :dark %>
|
18
|
-
.ultra-settings
|
18
|
+
.ultra-settings {
|
19
19
|
--table-header-bg-color: #333;
|
20
20
|
--table-border-color: #555;
|
21
21
|
--alt-row-color: rgba(0, 0, 0, .30);
|
data/app/index.html.erb
CHANGED
@@ -1,20 +1,26 @@
|
|
1
|
-
<div class="ultra-settings
|
2
|
-
<
|
3
|
-
<
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
</form>
|
9
|
-
</div>
|
10
|
-
|
11
|
-
<% UltraSettings.__configuration_names__.sort.each do |name| %>
|
12
|
-
<% configuration = UltraSettings.send(name) %>
|
1
|
+
<div class="ultra-settings">
|
2
|
+
<div class="ultra-settings-nav">
|
3
|
+
<form onsubmit="return false" style="margin-bottom: 0.5rem;">
|
4
|
+
<select class="<%= html_escape(select_class) %>" size="1" id="config-selector">
|
5
|
+
<% UltraSettings.__configuration_names__.sort.each do |name| %>
|
6
|
+
<% configuration = UltraSettings.send(name) %>
|
7
|
+
<% next if configuration.class.fields.empty? %>
|
13
8
|
|
14
|
-
|
15
|
-
|
9
|
+
<option value="config-<%= html_escape(name) %>"><%= html_escape(UltraSettings.send(name).class.name) %></option>
|
10
|
+
<% end %>
|
11
|
+
</select>
|
12
|
+
</form>
|
16
13
|
</div>
|
17
|
-
|
14
|
+
|
15
|
+
<% UltraSettings.__configuration_names__.sort.each do |name| %>
|
16
|
+
<% configuration = UltraSettings.send(name) %>
|
17
|
+
<% next if configuration.class.fields.empty? %>
|
18
|
+
|
19
|
+
<div class="ultra-settings-configuration" id="config-<%= html_escape(name) %>" style="display:none;">
|
20
|
+
<%= UltraSettings::ConfigurationView.new(configuration).render(table_class: table_class) %>
|
21
|
+
</div>
|
22
|
+
<% end %>
|
23
|
+
</div>
|
18
24
|
|
19
25
|
<script>
|
20
26
|
<%= javascript %>
|
@@ -533,11 +533,14 @@ module UltraSettings
|
|
533
533
|
field = self.class.send(:defined_fields)[name]
|
534
534
|
return nil unless field
|
535
535
|
|
536
|
-
|
536
|
+
use_override = @ultra_settings_override_values[Thread.current.object_id]&.include?(name)
|
537
|
+
|
538
|
+
if field.static? && !use_override && @ultra_settings_memoized_values.include?(name)
|
537
539
|
return @ultra_settings_memoized_values[name]
|
538
540
|
end
|
539
541
|
|
540
|
-
|
542
|
+
value = nil
|
543
|
+
if use_override
|
541
544
|
value = field.coerce(@ultra_settings_override_values[Thread.current.object_id][name])
|
542
545
|
else
|
543
546
|
env = ENV if field.env_var
|
@@ -551,7 +554,7 @@ module UltraSettings
|
|
551
554
|
value = field.default
|
552
555
|
end
|
553
556
|
|
554
|
-
if field.static?
|
557
|
+
if field.static? && !use_override
|
555
558
|
@ultra_settings_mutex.synchronize do
|
556
559
|
if @ultra_settings_memoized_values.include?(name)
|
557
560
|
value = @ultra_settings_memoized_values[name]
|
@@ -68,7 +68,7 @@ module UltraSettings
|
|
68
68
|
else
|
69
69
|
"Value: #{display_value(value)}"
|
70
70
|
end
|
71
|
-
"<dfn title=\"#{html_escape(title)}\">#{html_escape(label)}</dfn>"
|
71
|
+
"<dfn style=\"text-decoration: underline dotted;\" title=\"#{html_escape(title)}\">#{html_escape(label)}</dfn>"
|
72
72
|
end
|
73
73
|
|
74
74
|
def secret_value(value)
|
@@ -7,11 +7,11 @@ module UltraSettings
|
|
7
7
|
# `config.ultra_settings.auto_load_directories` option.
|
8
8
|
class Railtie < Rails::Railtie
|
9
9
|
config.ultra_settings = ActiveSupport::OrderedOptions.new
|
10
|
-
config.ultra_settings.auto_load_directories
|
10
|
+
config.ultra_settings.auto_load_directories ||= [File.join("app", "configurations")]
|
11
11
|
|
12
12
|
config.before_configuration do
|
13
|
-
UltraSettings.yaml_config_env
|
14
|
-
UltraSettings.yaml_config_path
|
13
|
+
UltraSettings::Configuration.yaml_config_env ||= Rails.env
|
14
|
+
UltraSettings::Configuration.yaml_config_path ||= Rails.root.join("config")
|
15
15
|
end
|
16
16
|
|
17
17
|
# Automatically register any configuration classes in the app/configurations
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ultra_settings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Durand
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|