quby-compiler 0.5.17 → 0.5.19

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: 4be07e6f3fabe1a0b02fbc36ea63c5ccd964519aedb08d0adaf9b6196f4f9830
4
- data.tar.gz: 382ea4dc3bd640a7d2e92b9bb27ad1bd5b1176129eb93e84fc71ad954bb691f9
3
+ metadata.gz: 17f81efe58813638140bea17b261bfd5145556b8641ed56792058e6e5cfe2e9c
4
+ data.tar.gz: b28acaf67f88390312252210a18a2c2bb878dae86887fb4ce0bfad433bcb98a1
5
5
  SHA512:
6
- metadata.gz: 1e699567c3318dcc2b4cf9d7b2b44e7c05cacab8783f17e5631bfcee12d1de690aba8ab8ae3e9da93bab07be680a26f4fe9ca735af8c27ea7bbd72b79146aad9
7
- data.tar.gz: 8ffbc7c1374528de5edefd0e35cab356c07e98b0e2f6436b0291510be9d0751971261846c7b98300290fc12689dd6a961816de16b1cebf0ff90bf6f0bce70d29
6
+ metadata.gz: df24763f87fec0e7dc98d7c14aeb1b21923574684b1c7dba9da22ca6c9ab58f410625094fc6bb934e182e7733072b296f1c32298ab08c32a0963397ab66f7450
7
+ data.tar.gz: 55adee69bb962303f1a12415037845b5a4a1675cd8b9d88b0a701258bcf8513ea4b528add011fe8c96f16fc71d6032481b82567b13b6a4717ee20688638e6c32
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ # 0.5.19
2
+
3
+ * quby2: Make the key for inner title predictable, so the json doesn't change each time, making Roqua think the questionnaire has changed.
4
+
5
+ # 0.5.18
6
+
7
+ * add footer (quby2 only)
8
+ * fix sexp_variable, op needs to be number for float/integer scalars
9
+
1
10
  # 0.5.17
2
11
 
3
12
  * Add option#label.
@@ -71,6 +71,10 @@ module Quby
71
71
  @questionnaire.short_description = description
72
72
  end
73
73
 
74
+ def footer(footer)
75
+ @questionnaire.footer = footer
76
+ end
77
+
74
78
  def sbg_key(sbg_key)
75
79
  @questionnaire.sbg_key = sbg_key
76
80
  end
@@ -65,6 +65,7 @@ module Quby
65
65
  attr_accessor :description
66
66
  attr_accessor :outcome_description
67
67
  attr_accessor :short_description
68
+ attr_accessor :footer
68
69
  attr_writer :roqua_keys
69
70
  attr_accessor :sbg_key # not required to be unique
70
71
  attr_accessor :sbg_domains
@@ -22,7 +22,7 @@ module Quby::Compiler::Entities
22
22
  end
23
23
 
24
24
  class Number
25
- attribute :op, Quby::Types::Symbol.enum(:value)
25
+ attribute :op, Quby::Types::Symbol.enum(:number)
26
26
  attribute :value, Quby::Types::Integer | Quby::Types::Float
27
27
  end
28
28
 
@@ -18,6 +18,7 @@ module Quby
18
18
  language: language || "nl",
19
19
  description: description,
20
20
  shortDescription: short_description,
21
+ footer: footer,
21
22
  defaultAnswerValue: Services::TransformQuby1ValuesIntoQuby2Values.run!(@questionnaire, default_answer_value),
22
23
  panels: panels.map { panel(_1) },
23
24
  questions: questions,
@@ -26,7 +27,7 @@ module Quby
26
27
  visibilityRules: visibility_rules.as_json,
27
28
  sexpVariables: sexp_variables,
28
29
  cssVars: css_vars,
29
- }
30
+ }.compact
30
31
  end
31
32
 
32
33
  def panel(panel)
@@ -193,9 +194,9 @@ module Quby
193
194
  end
194
195
 
195
196
  def children(question)
196
- question.options.map { |child|
197
+ question.options.map.with_index { |child, idx|
197
198
  if child.inner_title
198
- inner_title_as_json(child)
199
+ inner_title_as_json(child, idx)
199
200
  elsif child.placeholder
200
201
  nil # placeholder attr on question.
201
202
  else
@@ -204,10 +205,10 @@ module Quby
204
205
  }.compact
205
206
  end
206
207
 
207
- def inner_title_as_json(option)
208
+ def inner_title_as_json(option, idx)
208
209
  {
209
210
  type: 'html',
210
- key: SecureRandom.uuid,
211
+ key: "i-t-#{idx}",
211
212
  html: handle_html(option.description)
212
213
  }
213
214
  end
@@ -1,5 +1,5 @@
1
1
  module Quby
2
2
  module Compiler
3
- VERSION = "0.5.17"
3
+ VERSION = "0.5.19"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quby-compiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.17
4
+ version: 0.5.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marten Veldthuis
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-04-16 00:00:00.000000000 Z
10
+ date: 2025-05-06 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: activemodel
@@ -150,7 +150,6 @@ files:
150
150
  - lib/quby/compiler/dsl/charting/overview_chart_builder.rb
151
151
  - lib/quby/compiler/dsl/charting/radar_chart_builder.rb
152
152
  - lib/quby/compiler/dsl/helpers.rb
153
- - lib/quby/compiler/dsl/merge(values(:v_1, :v_2), values(v_4).rb
154
153
  - lib/quby/compiler/dsl/panel_builder.rb
155
154
  - lib/quby/compiler/dsl/question_builder.rb
156
155
  - lib/quby/compiler/dsl/questionnaire_builder.rb
@@ -1,16 +0,0 @@
1
- merge(values(:v_1, :v_2), values(v_4).recode(1 => 3)).sum
2
-
3
-
4
-
5
- divide(value(:v_2), multiply(value(:v_1), value(:v_1)))
6
-
7
- w / l * l
8
-
9
-
10
- sexp_variable :key1 do
11
- foo = values(:v_1, :v_2)
12
- bar = recode(foo, 1 => 3)
13
- bla = merge(foo, bar)
14
- sum(bla)
15
-
16
- end