trmnl_preview 0.8.5 → 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: a17153f7c4006dac8aaf9c0bd64e98c4c9a088ca454e10833bf2c7900e0b86cd
4
- data.tar.gz: 39d9949a8be9e303360520b2020b7fa049ebd14def1a04fa9c4c9ecfa7b6c547
3
+ metadata.gz: d16bcd0fdfc494a9984625f39fad67bdc5603d8506e4865a91038d4b582609aa
4
+ data.tar.gz: a756611a7c1b1a0e02fbeb183cb6d2f2a7bf02ecfdc37b03d3a415ad582f774a
5
5
  SHA512:
6
- metadata.gz: a564054b286184663e21f9f60c3757e0207ca6f8be9a571e45150a32bd4546f4707f4e129aaa5bfe4403184fa7467031d3fa53bee41fad09232cfb37ca32fdb1
7
- data.tar.gz: 19f8fab4f4bed1397592645a61b73fea89947887dff1e87f813d88c37db671d0a8a2e04fdd3e382726331a41fd30bd5ca0ab5519144ea63904bf370d21aeb6cc
6
+ metadata.gz: da3d1e0a4df32aa1c0c1a2dc6a6e189c0910f7f1199105502fa41fabce014818320136a63ec25541fb3133cd10e27e26bb3afbc43ec940d4a0aebb5bf8997689
7
+ data.tar.gz: f20e88c4acfe689d02a18daa36f696bd612682f7da1b2c5fe8b2fa85301f835870ec209b0457de5a9a61c9d053adf851911aac95576608f777b68b8fba1caff4
data/CHANGELOG.md CHANGED
@@ -1,6 +1,16 @@
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
+
10
+ ## 0.8.6
11
+
12
+ - Fix missing form fields `db/data/form_fields.yml`.
13
+
4
14
  ## 0.8.5
5
15
 
6
16
  - Fixed `pluralize`, `number_with_delimiter`, and `number_to_currency` Liquid filters raising `Liquid error: internal`. `trmnl-liquid` 0.7 moved `RailsHelpers` behind an opt-in `load(:rails)`, but the filters still probed `RailsHelpers.respond_to?` against the now-undefined constant. Stubbing an empty module makes the probe return false so the bundled fallback implementations run. (#105)
@@ -12,13 +12,23 @@ required_keys:
12
12
  - field_type
13
13
  - name
14
14
  field_types:
15
- - text
16
- - string
15
+ - author_bio
16
+ - boolean
17
+ - code
18
+ - copyable
19
+ - copyable_webhook_url
20
+ - date
21
+ - multi_string
17
22
  - number
18
23
  - password
19
- - boolean
20
- - xhrString
21
- - xhrSelect
22
- - xhrFunction
24
+ - plugin_instance_select
23
25
  - select
24
- - author_bio
26
+ - string
27
+ - text
28
+ - time
29
+ - time_zone
30
+ - url
31
+ - xhrFunction
32
+ - xhrSelect
33
+ - xhrSelectSearch
34
+ - xhrString
@@ -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.5'
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.5
4
+ version: 0.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rockwell Schrock