quby-compiler 0.5.36 → 0.5.37

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: 45c8bbec37f2c99aaf33cbb7eb1fd0d7ab0e652c9173bf65cd9e84495f7adf23
4
- data.tar.gz: 4a17cf5484dc9154e5c96b276a1c2f0cfa3358adb9ce0e1f0a37a51690493e18
3
+ metadata.gz: f99d7e4e00d6ab08172da731229ed790720f8131ca55a9919a8d6f4823da1bbe
4
+ data.tar.gz: a7855f35d16daded7a21e60564322576b7ea8f967052e72d8d4f8eb194b53f04
5
5
  SHA512:
6
- metadata.gz: 68acd5fbc780bd6b31fdc43aa1d2a266ab69416c16ba2475fed0ecce8de526b443c0d69b07a45076de2ffedb633222b60cf3eb3f8f3312ccca6042129acad80c
7
- data.tar.gz: 93b072eea61d9833505d08cd022ba9651a8f513bb006d881d04512d46211fdf2368ead687f2bf05bf85eb97c94b532b18e9ede1e9398a83c9f80e13f746050ad
6
+ metadata.gz: 4c0260b251395ef6fcf757ecc1ddaf120139716c6f0ae27a77450dea9719d76f103891b060b74146aee408d68febffd398436ce613d3c8031215e6f6b01035d6
7
+ data.tar.gz: e20c44b3fba04514aa601e52c9b7321e185bbea66d9e12e112efdd20023b91bfc52f30de3f4ebf0959426eb4aa351499abe2b7b4b5e5ac5ea2b6b04b5e4f5544
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # 0.5.37
2
+
3
+ * added support for indenting questions
4
+ * quby2: Added versionNumber.
5
+ * added validations for checkbox options to have a (context_free_)description
6
+ * removed bulkview logic
7
+
1
8
  # 0.5.36
2
9
 
3
10
  * Fix visibility_rules ordering.
@@ -151,8 +151,8 @@ module Quby
151
151
  @questionnaire.css_vars.merge!(value)
152
152
  end
153
153
 
154
+ # deprecated no-op
154
155
  def allow_switch_to_bulk(value=true)
155
- @questionnaire.allow_switch_to_bulk = value
156
156
  end
157
157
 
158
158
  def default_answer_value(value)
@@ -30,6 +30,9 @@ module Quby
30
30
 
31
31
  # extra styling options
32
32
  attr_accessor :css_vars
33
+ # indent the question, to make it belong to the previous one.
34
+ attr_accessor :indent
35
+ validates :indent, inclusion: {in: [nil, 0, 1], message: "must be 0 or 1"}
33
36
 
34
37
  # To hide old questions
35
38
  attr_accessor :hidden
@@ -169,6 +172,7 @@ module Quby
169
172
  @default_invisible = options[:default_invisible] || false
170
173
  @labels ||= []
171
174
  @css_vars = options[:css_vars]
175
+ @indent = options[:indent]
172
176
 
173
177
  @col_span = options[:col_span] || 1
174
178
  @row_span = options[:row_span] || 1
@@ -14,6 +14,8 @@ module Quby
14
14
  validates :value, numericality: {allow_nil: true} # nil for checkbox questions.
15
15
  attr_reader :label
16
16
  attr_reader :description, :context_free_description
17
+ validates :context_free_description, presence: {if: -> { question.type == :check_box && label.blank? && description.blank? && !inner_title }, message: "(context_free_)description must be present"}
18
+
17
19
  attr_reader :questions
18
20
  # for scale/radio/checbox questions, piece of of html that is rendered between the options
19
21
  attr_reader :inner_title
@@ -41,7 +41,6 @@ module Quby
41
41
  @layout_version = nil
42
42
  @extra_css = ""
43
43
  @css_vars = nil
44
- @allow_switch_to_bulk = false
45
44
  @panels = []
46
45
  @flags = {}.with_indifferent_access
47
46
  @textvars = {}.with_indifferent_access
@@ -82,7 +81,6 @@ module Quby
82
81
  attr_reader :fields
83
82
  attr_accessor :extra_css
84
83
  attr_accessor :css_vars
85
- attr_accessor :allow_switch_to_bulk
86
84
  attr_reader :license
87
85
  attr_accessor :licensor
88
86
  attr_accessor :language
@@ -136,6 +134,10 @@ module Quby
136
134
  @roqua_keys || [key]
137
135
  end
138
136
 
137
+ def version_number
138
+ versions.last&.number || 0
139
+ end
140
+
139
141
  def to_param
140
142
  key
141
143
  end
@@ -335,7 +335,6 @@ module Quby
335
335
  language: questionnaire.language,
336
336
  last_author: questionnaire.last_author,
337
337
  extra_css: questionnaire.extra_css,
338
- allow_switch_to_bulk: questionnaire.allow_switch_to_bulk,
339
338
 
340
339
  panels: panels,
341
340
  score_calculations: score_calculations,
@@ -27,6 +27,7 @@ module Quby
27
27
  visibilityRules: visibility_rules.as_json,
28
28
  sexpVariables: sexp_variables,
29
29
  cssVars: css_vars,
30
+ versionNumber: version_number,
30
31
  }.compact.tap do |json|
31
32
  validate_all_questions_in_a_panel_question_keys(json)
32
33
  end
@@ -202,6 +203,8 @@ module Quby
202
203
  contextDescription: handle_html(question.context_description, type: :prose, v1_markdown: false),
203
204
  type: question_type(question),
204
205
  cssVars: question.css_vars,
206
+ indent: question.indent,
207
+
205
208
  hidden: question.hidden?,
206
209
  displayModes: question.display_modes,
207
210
  viewSelector: question.view_selector,
@@ -1,5 +1,5 @@
1
1
  module Quby
2
2
  module Compiler
3
- VERSION = "0.5.36"
3
+ VERSION = "0.5.37"
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.36
4
+ version: 0.5.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marten Veldthuis
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-10-01 00:00:00.000000000 Z
10
+ date: 2025-10-16 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: activemodel