quby-compiler 0.6.1 → 0.6.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 +9 -0
- data/lib/quby/compiler/dsl/info_block_builder.rb +5 -1
- data/lib/quby/compiler/dsl/panel_builder.rb +1 -1
- data/lib/quby/compiler/outputs/locale_serializer.rb +1 -1
- data/lib/quby/compiler/outputs/quby_frontend_v2_serializer.rb +3 -3
- data/lib/quby/compiler/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: fdf056bcbbea1730c248d8cfb73d3fc7b51ff2f4ead55bd02781d6c81d1e5505
|
|
4
|
+
data.tar.gz: c974d4e4c67f8582325eaaf630ad71f4d7859a7835a15e125fb5407ad87e3b10
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 107f7a4d9cc66dd69c8acde899737d1111c82e1e4e520916a9325372d2f181e64795448b192ecd7d6073641d4bead30ec6d3bfcfd56d01b72fd4d1179f9e8568
|
|
7
|
+
data.tar.gz: 614dd011da028989a99c8c43fafce188c9662b205c15241e8df5489479afe1a433287eb984a2ed3a192716bc15ffe5fb29c8e84dfa6127b1f7a51544c550575e
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
# 0.6.2
|
|
2
|
+
|
|
3
|
+
* dsl:
|
|
4
|
+
* Add text option to info_blocks, so you can start with the key.
|
|
5
|
+
* Allow label for placeholder option.
|
|
6
|
+
* quby2.json
|
|
7
|
+
* Use . between panel/info_block key and default key for items, for more consistency. Remove double panel key for items with default key.
|
|
8
|
+
* Don't camelcase translation keys for quby2, no real benefit and was wrongly camelcasing html keys.
|
|
9
|
+
|
|
1
10
|
# 0.6.1
|
|
2
11
|
|
|
3
12
|
* Switch to oj for serializing, since JSON.serialize is dumb as ^%#$& (not serializing inner object)
|
|
@@ -29,6 +29,10 @@ module Quby
|
|
|
29
29
|
info_block.items << Entities::Text.new('', html_content: value.to_s, key:)
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
+
def text(key:, html: nil, md: nil, **options)
|
|
33
|
+
info_block.items << Entities::Text.new(key:, md:, html_content: html, **options)
|
|
34
|
+
end
|
|
35
|
+
|
|
32
36
|
def question(key, **options, &block)
|
|
33
37
|
options = default_question_options.merge(options).merge(questionnaire:)
|
|
34
38
|
|
|
@@ -53,7 +57,7 @@ module Quby
|
|
|
53
57
|
def fallback_key
|
|
54
58
|
raise "Item without key in #{info_block.key}" if questionnaire.translatable?
|
|
55
59
|
|
|
56
|
-
"#{info_block.key}
|
|
60
|
+
"#{info_block.key}.item_#{info_block.items.size}"
|
|
57
61
|
end
|
|
58
62
|
end
|
|
59
63
|
end
|
|
@@ -31,7 +31,7 @@ module Quby
|
|
|
31
31
|
items.flat_map { |item|
|
|
32
32
|
case item
|
|
33
33
|
when Quby::Compiler::Entities::Text
|
|
34
|
-
{ "#{
|
|
34
|
+
{ "#{item.key}" => item.html }
|
|
35
35
|
when Quby::Compiler::Entities::Question
|
|
36
36
|
questions_for_question(item).flat_map { |question|
|
|
37
37
|
question_locale_values(question, panel:)
|
|
@@ -178,10 +178,11 @@ module Quby
|
|
|
178
178
|
end
|
|
179
179
|
|
|
180
180
|
def select_question(question)
|
|
181
|
+
placeholder = question.all_options.find(&:placeholder)
|
|
181
182
|
{
|
|
182
183
|
**base_question(question),
|
|
183
184
|
children: children(question),
|
|
184
|
-
placeholder:
|
|
185
|
+
placeholder: placeholder&.label || placeholder&.description,
|
|
185
186
|
}.compact
|
|
186
187
|
end
|
|
187
188
|
|
|
@@ -330,8 +331,7 @@ module Quby
|
|
|
330
331
|
key.ends_with?("context_free_title") \
|
|
331
332
|
|| key.ends_with?("context_free_description") \
|
|
332
333
|
|| key == "short_description"
|
|
333
|
-
}
|
|
334
|
-
.transform_keys! { |k| k.to_s.split('.').tap{ _1[-1] = _1[-1].camelize(:lower) }.join('.') }
|
|
334
|
+
}
|
|
335
335
|
}
|
|
336
336
|
end
|
|
337
337
|
|