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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d9263986533b5d9aa8b6783bfa9a03e6fa3ac956ec2f54b4058737142c25df9a
4
- data.tar.gz: d177e098958fba6ed1160b310034c9c64f32876f2f45c0b5d0bcb86c9d7fc3ec
3
+ metadata.gz: d16bcd0fdfc494a9984625f39fad67bdc5603d8506e4865a91038d4b582609aa
4
+ data.tar.gz: a756611a7c1b1a0e02fbeb183cb6d2f2a7bf02ecfdc37b03d3a415ad582f774a
5
5
  SHA512:
6
- metadata.gz: 042e4f7d5e20ff661d4231f761d97d8fc260daf21c4c7927592e9056e2ddd6cb8c6ea92c28eba47125fe37ae9b9ca42a9920d8ebede846fbe4b756d96589ad1d
7
- data.tar.gz: c512a8cdb2256b4a1bd0c795cd4f1c2755e172974ca500cadac05331ad6cb791d2f51c4efddd86853f470760d0c1778deb7ee095a6c52a65c78651c3d5fc1a54
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 whole trmnl namespace is
21
- # re-applied after the transform so it survives even when the
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'] = namespace['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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TRMNLP
4
- VERSION = '0.8.6'
4
+ VERSION = '0.8.7'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trmnl_preview
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.6
4
+ version: 0.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rockwell Schrock