trmnl_preview 0.8.6 → 0.8.7
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 +6 -0
- data/lib/trmnlp/user_data_assembler.rb +13 -5
- data/lib/trmnlp/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d16bcd0fdfc494a9984625f39fad67bdc5603d8506e4865a91038d4b582609aa
|
|
4
|
+
data.tar.gz: a756611a7c1b1a0e02fbeb183cb6d2f2a7bf02ecfdc37b03d3a415ad582f774a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: da3d1e0a4df32aa1c0c1a2dc6a6e189c0910f7f1199105502fa41fabce014818320136a63ec25541fb3133cd10e27e26bb3afbc43ec940d4a0aebb5bf8997689
|
|
7
|
+
data.tar.gz: f20e88c4acfe689d02a18daa36f696bd612682f7da1b2c5fe8b2fa85301f835870ec209b0457de5a9a61c9d053adf851911aac95576608f777b68b8fba1caff4
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
# Changelog
|
|
3
3
|
|
|
4
|
+
## 0.8.7
|
|
5
|
+
|
|
6
|
+
- Fixed `.trmnlp.yml` `variables` overrides under the `trmnl` namespace being dropped. The assembler re-applied the pre-override namespace after the transform, clobbering user overrides like `trmnl.user.time_zone`. (#110)
|
|
7
|
+
- Fixed the transform receiving the `trmnl.system` namespace, which the hosted service withholds. Transforms now see only `trmnl.user`, `trmnl.device`, and `trmnl.plugin_settings`, matching production.
|
|
8
|
+
- Added `trmnl.user.id` to the user namespace so its shape matches the hosted service.
|
|
9
|
+
|
|
4
10
|
## 0.8.6
|
|
5
11
|
|
|
6
12
|
- Fix missing form fields `db/data/form_fields.yml`.
|
|
@@ -17,14 +17,14 @@ module TRMNLP
|
|
|
17
17
|
|
|
18
18
|
# Assembles the merged data hash. The trmnl namespace is built first,
|
|
19
19
|
# layered with static_data / cached polled data / user_data_overrides,
|
|
20
|
-
# then piped through the transform. The
|
|
21
|
-
# re-applied after the transform so it
|
|
22
|
-
# transform doesn't pass it through.
|
|
20
|
+
# then piped through the transform. The assembled trmnl namespace
|
|
21
|
+
# (overrides included) is re-applied after the transform so it
|
|
22
|
+
# survives even when the transform doesn't pass it through.
|
|
23
23
|
def call(device: {})
|
|
24
24
|
namespace = base_trmnl_data(device:)
|
|
25
25
|
merged = assemble(namespace)
|
|
26
|
-
result = transform_pipeline.call(merged)
|
|
27
|
-
result['trmnl'] =
|
|
26
|
+
result = transform_pipeline.call(transform_input(merged))
|
|
27
|
+
result['trmnl'] = merged['trmnl']
|
|
28
28
|
result
|
|
29
29
|
end
|
|
30
30
|
|
|
@@ -43,6 +43,13 @@ module TRMNLP
|
|
|
43
43
|
data
|
|
44
44
|
end
|
|
45
45
|
|
|
46
|
+
# The hosted service exposes only user/device/plugin_settings to the
|
|
47
|
+
# transform; the system namespace is added afterward. Mirror that slice
|
|
48
|
+
# so transforms behave the same locally as in production.
|
|
49
|
+
def transform_input(merged)
|
|
50
|
+
merged.merge('trmnl' => merged['trmnl'].slice('user', 'device', 'plugin_settings'))
|
|
51
|
+
end
|
|
52
|
+
|
|
46
53
|
def merge_source_data!(data)
|
|
47
54
|
if config.plugin.static?
|
|
48
55
|
data.merge!(config.plugin.static_data)
|
|
@@ -68,6 +75,7 @@ module TRMNLP
|
|
|
68
75
|
tz = ActiveSupport::TimeZone.find_tzinfo(config.project.time_zone)
|
|
69
76
|
iana = tz.name
|
|
70
77
|
{
|
|
78
|
+
'id' => 1,
|
|
71
79
|
'name' => 'name', 'first_name' => 'first_name', 'last_name' => 'last_name',
|
|
72
80
|
'locale' => 'en', 'time_zone' => ActiveSupport::TimeZone::MAPPING.invert[iana] || iana,
|
|
73
81
|
'time_zone_iana' => iana, 'utc_offset' => tz.utc_offset
|
data/lib/trmnlp/version.rb
CHANGED