easol-canvas 4.9.0 → 4.12.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c045a4c9422791186853fbe0fef45a34ed99a0d95e9dc4ab36e25e36bcbf935
|
4
|
+
data.tar.gz: 54dac9fa1f74f703d79e8025ff1d10c32769b95e7bc6c818b9e999b7ac4fbb78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a738edc0cce8108b9aa6aad452695b52a93ad1545c5d7ef193370b7e47d9f7235d066990baf6a14553bc929ca87d5ede7d0f409e7b357c3c74aabff9fbd980b9
|
7
|
+
data.tar.gz: 5dfe65957a4521bc12315f02a9bd94e82fbd21b3ec1f07f546e9643a72b0153fe6838d6624bdb2c153e202478bddeaaf1e424a8fd3fb35f33e728b79f8e9849f
|
@@ -37,7 +37,7 @@ module Canvas
|
|
37
37
|
"date" => SchemaAttribute::Date,
|
38
38
|
"experience_date" => SchemaAttribute::ExperienceDate,
|
39
39
|
"experience_slot" => SchemaAttribute::ExperienceSlot,
|
40
|
-
"enquiry_form" => SchemaAttribute::
|
40
|
+
"enquiry_form" => SchemaAttribute::EnquiryForm,
|
41
41
|
}.freeze
|
42
42
|
RESERVED_NAMES = %w[
|
43
43
|
page
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Canvas
|
4
|
+
module Validator
|
5
|
+
class SchemaAttribute
|
6
|
+
# :documented:
|
7
|
+
# Attribute validations specific to enquiry form-type variables.
|
8
|
+
class EnquiryForm < Base
|
9
|
+
ALLOWED_DEFAULT_VALUES = %w[random].freeze
|
10
|
+
|
11
|
+
def validate
|
12
|
+
super &&
|
13
|
+
ensure_default_values_are_valid
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def permitted_values_for_default_key
|
19
|
+
if attribute["array"]
|
20
|
+
Array
|
21
|
+
else
|
22
|
+
String
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
def ensure_default_values_are_valid
|
27
|
+
return true unless attribute.key?("default")
|
28
|
+
|
29
|
+
if attribute["array"]
|
30
|
+
attribute["default"].all? { |value| default_value_is_valid?(value) }
|
31
|
+
else
|
32
|
+
default_value_is_valid?(attribute["default"])
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def default_value_is_valid?(value)
|
37
|
+
value = value.downcase
|
38
|
+
if !ALLOWED_DEFAULT_VALUES.include?(value)
|
39
|
+
@errors << "\"default\" for enquiry form-type variables must be "\
|
40
|
+
"one of: #{ALLOWED_DEFAULT_VALUES.join(', ')}"
|
41
|
+
false
|
42
|
+
else
|
43
|
+
true
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
data/lib/canvas/version.rb
CHANGED
@@ -46,7 +46,11 @@
|
|
46
46
|
"elements": {
|
47
47
|
"type": "array",
|
48
48
|
"items": {
|
49
|
-
"oneOf": [
|
49
|
+
"oneOf": [
|
50
|
+
{ "type": "string" },
|
51
|
+
{ "$ref": "#/$defs/accordion_toggle" },
|
52
|
+
{ "$ref": "#/$defs/attribute" }
|
53
|
+
]
|
50
54
|
}
|
51
55
|
}
|
52
56
|
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easol-canvas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Byrne
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-11-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -140,6 +140,7 @@ files:
|
|
140
140
|
- lib/canvas/validators/schema_attributes/base.rb
|
141
141
|
- lib/canvas/validators/schema_attributes/color.rb
|
142
142
|
- lib/canvas/validators/schema_attributes/date.rb
|
143
|
+
- lib/canvas/validators/schema_attributes/enquiry_form.rb
|
143
144
|
- lib/canvas/validators/schema_attributes/experience_date.rb
|
144
145
|
- lib/canvas/validators/schema_attributes/experience_slot.rb
|
145
146
|
- lib/canvas/validators/schema_attributes/image.rb
|
@@ -175,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
176
|
- !ruby/object:Gem::Version
|
176
177
|
version: '0'
|
177
178
|
requirements: []
|
178
|
-
rubygems_version: 3.
|
179
|
+
rubygems_version: 3.4.19
|
179
180
|
signing_key:
|
180
181
|
specification_version: 4
|
181
182
|
summary: CLI to help with building themes for Easol
|