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 +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/quby/compiler/dsl/questionnaire_builder.rb +1 -1
- data/lib/quby/compiler/entities/question.rb +4 -0
- data/lib/quby/compiler/entities/question_option.rb +2 -0
- data/lib/quby/compiler/entities/questionnaire.rb +4 -2
- data/lib/quby/compiler/outputs/quby_frontend_v1_serializer.rb +0 -1
- data/lib/quby/compiler/outputs/quby_frontend_v2_serializer.rb +3 -0
- data/lib/quby/compiler/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f99d7e4e00d6ab08172da731229ed790720f8131ca55a9919a8d6f4823da1bbe
|
4
|
+
data.tar.gz: a7855f35d16daded7a21e60564322576b7ea8f967052e72d8d4f8eb194b53f04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c0260b251395ef6fcf757ecc1ddaf120139716c6f0ae27a77450dea9719d76f103891b060b74146aee408d68febffd398436ce613d3c8031215e6f6b01035d6
|
7
|
+
data.tar.gz: e20c44b3fba04514aa601e52c9b7321e185bbea66d9e12e112efdd20023b91bfc52f30de3f4ebf0959426eb4aa351499abe2b7b4b5e5ac5ea2b6b04b5e4f5544
|
data/CHANGELOG.md
CHANGED
@@ -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,
|
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.
|
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-
|
10
|
+
date: 2025-10-16 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: activemodel
|