ultra_settings 2.9.0 → 2.9.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7b197136c21486ad05e4477bba4f7c0b9765dd3e073421ecfc327b3ed16f8bb
4
- data.tar.gz: af08178f5b3b47ccab7f7b7aaafba64bbf606759774fe8fdf4054d91be72b52e
3
+ metadata.gz: 802faa3f09b5b24f1d0cad36e7014bf84f092b48e7b81fa0b6f73798fbd071ff
4
+ data.tar.gz: 3dd890b1e59e1ae946edd1eda0a3b509386d6d50a30d269a437ae982b73bb7ba
5
5
  SHA512:
6
- metadata.gz: dde91f729527a598d414a162011b4d296884d9253d1616d7b38d0aa3f419f93666a7852ac7e9422ecd453e3e2629dc376584e1fa4e46955a33b36927d7567028
7
- data.tar.gz: db199c5cdb6945b13557641dee89d3ee9ae154632a38b3719d6fcd6c0614ad4b7c07a87e24144567c3363515febb7249b08786acfc76fe9dbf2338757573e381
6
+ metadata.gz: 0a1dd9d6c83b3999f8559a7b52c9c7195d106dfb5073e1f6366376a27c04a1e9bd27ef846e207b8041b7ad6b1863283959bf8c07d8cc8a90f1ef0178641e0948
7
+ data.tar.gz: ddef9a41588c9aa97c4d8ad0da56e4e55089ea3a9e45d8edd3dcc8e9710fda83a156fcee36d9592a096497e0e24a2c32e255c0dafb52cf6d9771258abaef4b10
data/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ 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.9.1
8
+
9
+ ### Fixed
10
+
11
+ - Fixed a bug where the web UI showed runtime settings as valid data sources for secret fields even when `UltraSettings.runtime_settings_secure` was set to `false`.
12
+ - Back button now works correctly in the web UI when navigating between list of configuations and individual configuration pages.
13
+
7
14
  ## 2.9.0
8
15
 
9
16
  ### Added
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.9.0
1
+ 2.9.1
data/app/application.js CHANGED
@@ -64,7 +64,7 @@ document.addEventListener("DOMContentLoaded", () => {
64
64
  };
65
65
 
66
66
  // ── Config Selection ──
67
- const selectConfig = (configId) => {
67
+ const selectConfig = (configId, pushState) => {
68
68
  selectedConfigId = configId;
69
69
 
70
70
  // Show only the selected section
@@ -83,7 +83,11 @@ document.addEventListener("DOMContentLoaded", () => {
83
83
  // Update hash
84
84
  const configName = configId.replace(/^section-/, "");
85
85
  if (window.location.hash !== "#" + configName) {
86
- history.replaceState(null, "", "#" + configName);
86
+ if (pushState === false) {
87
+ history.replaceState(null, "", "#" + configName);
88
+ } else {
89
+ history.pushState(null, "", "#" + configName);
90
+ }
87
91
  }
88
92
 
89
93
  // Scroll to top
@@ -104,7 +108,7 @@ document.addEventListener("DOMContentLoaded", () => {
104
108
  }
105
109
  };
106
110
 
107
- const clearSelection = () => {
111
+ const clearSelection = (pushState) => {
108
112
  selectedConfigId = null;
109
113
 
110
114
  // Hide all sections
@@ -121,7 +125,11 @@ document.addEventListener("DOMContentLoaded", () => {
121
125
  configListItems.forEach(item => item.classList.remove("hidden"));
122
126
 
123
127
  // Clear hash
124
- history.replaceState(null, "", window.location.pathname + window.location.search);
128
+ if (pushState === false) {
129
+ history.replaceState(null, "", window.location.pathname + window.location.search);
130
+ } else {
131
+ history.pushState(null, "", window.location.pathname + window.location.search);
132
+ }
125
133
 
126
134
  // Animate detail → list
127
135
  if (configDetail && configList) {
@@ -165,23 +173,23 @@ document.addEventListener("DOMContentLoaded", () => {
165
173
  }
166
174
 
167
175
  // ── Hash-based Navigation ──
168
- const handleHash = () => {
176
+ const handleHash = (pushState) => {
169
177
  const hash = window.location.hash.replace(/^#/, "");
170
178
  if (hash) {
171
179
  const configId = "section-" + hash;
172
180
  const exists = Array.from(sections).some(s => s.dataset.configId === configId);
173
181
  if (exists) {
174
- selectConfig(configId);
182
+ selectConfig(configId, pushState);
175
183
  return;
176
184
  }
177
185
  }
178
186
  // No valid hash — if not single config, show list
179
187
  if (!singleConfig && selectedConfigId) {
180
- clearSelection();
188
+ clearSelection(pushState);
181
189
  }
182
190
  };
183
191
 
184
- window.addEventListener("hashchange", handleHash);
192
+ window.addEventListener("popstate", () => handleHash(false));
185
193
 
186
194
  // ── Single Config Auto-Select ──
187
195
  if (singleConfig) {
@@ -196,7 +204,7 @@ document.addEventListener("DOMContentLoaded", () => {
196
204
  selectConfig(storedConfig);
197
205
  }
198
206
  } else {
199
- handleHash();
207
+ handleHash(false);
200
208
  }
201
209
  }
202
210
 
@@ -560,7 +560,7 @@ module UltraSettings
560
560
 
561
561
  sources = []
562
562
  sources << :env if field.env_var
563
- sources << :settings if !field.static? && field.runtime_setting && UltraSettings.__runtime_settings__
563
+ sources << :settings if __runtime_setting_allowed?(field)
564
564
  sources << :yaml if field.yaml_key && self.class.configuration_file
565
565
  sources << :default unless field.default.nil?
566
566
  sources
@@ -646,5 +646,14 @@ module UltraSettings
646
646
  def __yaml_config__
647
647
  @ultra_settings_yaml_config ||= self.class.load_yaml_config || {}
648
648
  end
649
+
650
+ def __runtime_setting_allowed?(field)
651
+ return false unless UltraSettings.__runtime_settings__
652
+ return false if field.static?
653
+ return false unless field.runtime_setting
654
+ return false if field.secret? && !UltraSettings.runtime_settings_secure?
655
+
656
+ true
657
+ end
649
658
  end
650
659
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ultra_settings
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.0
4
+ version: 2.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Durand