quby-compiler 0.6.2 → 0.6.4

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: fdf056bcbbea1730c248d8cfb73d3fc7b51ff2f4ead55bd02781d6c81d1e5505
4
- data.tar.gz: c974d4e4c67f8582325eaaf630ad71f4d7859a7835a15e125fb5407ad87e3b10
3
+ metadata.gz: 4b37685d77944279d81caccc69c96eaddd83f72124539bc76e90c416666e1d20
4
+ data.tar.gz: 0bf896a36737a35995f550a9834c0f95f83297dcc32df9b10d8a9dfa1dc8ce8f
5
5
  SHA512:
6
- metadata.gz: 107f7a4d9cc66dd69c8acde899737d1111c82e1e4e520916a9325372d2f181e64795448b192ecd7d6073641d4bead30ec6d3bfcfd56d01b72fd4d1179f9e8568
7
- data.tar.gz: 614dd011da028989a99c8c43fafce188c9662b205c15241e8df5489479afe1a433287eb984a2ed3a192716bc15ffe5fb29c8e84dfa6127b1f7a51544c550575e
6
+ metadata.gz: 6e1c0c9179ff093046c488a289f752945c94bae2341c797b4c5962cb522cf848c41bf3e982814745e07d4b702ab676d50963fa47630393fed8e022618ac106d1
7
+ data.tar.gz: 9b6c051c7ce03721392d62b41feec077034ba281b54746393d2bf5bd0fdc1634eb6fec40c0ba53c41b701ea0715d69780c8ea6a557bd3e7b62de743d1c6ef77c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 0.6.4
2
+
3
+ * Add panel titles to translations.
4
+
5
+ # 0.6.3
6
+
7
+ * dsl + quby2.json: Add subtype to info_blocks.
8
+
1
9
  # 0.6.2
2
10
 
3
11
  * dsl:
@@ -11,8 +11,8 @@ module Quby
11
11
  delegate :panel, to: :info_block
12
12
  delegate :questionnaire, to: :panel
13
13
 
14
- def initialize(key, start_open: true, panel:, default_question_options:, custom_methods:)
15
- @info_block = Entities::InfoBlock.new(key: , panel:, start_open:)
14
+ def initialize(key, panel:, default_question_options:, custom_methods:, **options)
15
+ @info_block = Entities::InfoBlock.new(key: , panel:, **options)
16
16
  @default_question_options = default_question_options
17
17
  @custom_methods = custom_methods
18
18
  check_key_uniqueness(key, questionnaire:)
@@ -2,16 +2,18 @@ module Quby
2
2
  module Compiler
3
3
  module Entities
4
4
  class InfoBlock < Item
5
- attr_reader :key, :items, :start_open, :panel
5
+ attr_reader :key, :items, :start_open, :subtype, :panel
6
6
  attr_accessor :html
7
7
 
8
8
  validates :key, presence: true, 'quby/compiler/type': {is_a: Symbol}
9
9
  validates :html, presence: true
10
+ validates :subtype, presence: true, inclusion: {in: ["info", "question-bar"]}
10
11
 
11
- def initialize(key:, panel:, start_open: true)
12
+ def initialize(key:, panel:, start_open: true, subtype: "info")
12
13
  @panel = panel
13
14
  @key = key
14
15
  @start_open = start_open
16
+ @subtype = subtype
15
17
  @items = []
16
18
  end
17
19
 
@@ -23,7 +23,10 @@ module Quby
23
23
 
24
24
  def panel_locale_values
25
25
  @questionnaire.panels.flat_map { |panel|
26
- items_locale_values(panel.items, panel: panel)
26
+ {
27
+ "#{panel.key}.title" => panel.title,
28
+ **items_locale_values(panel.items, panel: panel)
29
+ }.compact
27
30
  }.reduce(:merge)
28
31
  end
29
32
 
@@ -97,6 +97,7 @@ module Quby
97
97
  def info_block_item(info_block)
98
98
  {
99
99
  type: 'info',
100
+ subtype: info_block.subtype,
100
101
  key: info_block.key,
101
102
  html: handle_html(info_block.html, type: :prose, v1_markdown: false),
102
103
  startOpen: info_block.start_open,
@@ -1,5 +1,5 @@
1
1
  module Quby
2
2
  module Compiler
3
- VERSION = "0.6.2"
3
+ VERSION = "0.6.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quby-compiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marten Veldthuis