panda-core 0.8.2 ā 0.8.3
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c2c7f949ef7ad87f9b6aa0ec54ccd8c1dc1574ee09f9ef3651af635930ae65e4
|
|
4
|
+
data.tar.gz: 80e06efeb33c7092e93e1b2a06997e23c0951578f08524bdd6ef6483f7b07766
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 482bf161016f2fc352083a22c9f85e5da7d01f72ca9be8c8755cfb0939f0bb7e48abd12b5e324e542047c164a193586ca9d083f80aaeec9d7e3179cccbae7397
|
|
7
|
+
data.tar.gz: c74f6e9909a28464f636c0edd0fbb7a2086484bd2d1d3e58adffb9e85c93552d630109d8c944ac886f6d9c92825e5e447914506bf0ce2062a7e890f5afe58e91
|
|
@@ -40,14 +40,20 @@ module Panda
|
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
def email_field(method, options = {})
|
|
43
|
+
# Extract custom label if provided
|
|
44
|
+
custom_label = options.delete(:label)
|
|
45
|
+
|
|
43
46
|
content_tag :div, class: container_styles do
|
|
44
|
-
label(method) + meta_text(options) + super(method, options.reverse_merge(class: input_styles)) + error_message(method)
|
|
47
|
+
label(method, custom_label) + meta_text(options) + super(method, options.reverse_merge(class: input_styles)) + error_message(method)
|
|
45
48
|
end
|
|
46
49
|
end
|
|
47
50
|
|
|
48
51
|
def datetime_field(method, options = {})
|
|
52
|
+
# Extract custom label if provided
|
|
53
|
+
custom_label = options.delete(:label)
|
|
54
|
+
|
|
49
55
|
content_tag :div, class: container_styles do
|
|
50
|
-
label(method) + meta_text(options) + super(method, options.reverse_merge(class: input_styles)) + error_message(method)
|
|
56
|
+
label(method, custom_label) + meta_text(options) + super(method, options.reverse_merge(class: input_styles)) + error_message(method)
|
|
51
57
|
end
|
|
52
58
|
end
|
|
53
59
|
|
|
@@ -61,8 +67,11 @@ module Panda
|
|
|
61
67
|
end
|
|
62
68
|
|
|
63
69
|
def password_field(attribute, options = {})
|
|
70
|
+
# Extract custom label if provided
|
|
71
|
+
custom_label = options.delete(:label)
|
|
72
|
+
|
|
64
73
|
content_tag :div, class: container_styles do
|
|
65
|
-
label(attribute) + meta_text(options) + super(attribute, options.reverse_merge(class: input_styles)) + error_message(attribute)
|
|
74
|
+
label(attribute, custom_label) + meta_text(options) + super(attribute, options.reverse_merge(class: input_styles)) + error_message(attribute)
|
|
66
75
|
end
|
|
67
76
|
end
|
|
68
77
|
|
|
@@ -76,8 +85,11 @@ module Panda
|
|
|
76
85
|
end
|
|
77
86
|
|
|
78
87
|
def collection_select(method, collection, value_method, text_method, options = {}, html_options = {})
|
|
88
|
+
# Extract custom label if provided
|
|
89
|
+
custom_label = options.delete(:label)
|
|
90
|
+
|
|
79
91
|
content_tag :div, class: container_styles do
|
|
80
|
-
label(method) + meta_text(options) + super(method, collection, value_method, text_method, options, html_options.reverse_merge(class: input_styles)) + error_message(method)
|
|
92
|
+
label(method, custom_label) + meta_text(options) + super(method, collection, value_method, text_method, options, html_options.reverse_merge(class: input_styles)) + error_message(method)
|
|
81
93
|
end
|
|
82
94
|
end
|
|
83
95
|
|
|
@@ -271,22 +283,31 @@ module Panda
|
|
|
271
283
|
end
|
|
272
284
|
|
|
273
285
|
def check_box(method, options = {}, checked_value = "1", unchecked_value = "0")
|
|
286
|
+
# Extract custom label if provided
|
|
287
|
+
custom_label = options.delete(:label)
|
|
288
|
+
|
|
274
289
|
content_tag :div, class: container_styles do
|
|
275
|
-
label(method) + meta_text(options) + super(method, options.reverse_merge(class: "border-gray-300 ml-2"), checked_value, unchecked_value)
|
|
290
|
+
label(method, custom_label) + meta_text(options) + super(method, options.reverse_merge(class: "border-gray-300 ml-2"), checked_value, unchecked_value)
|
|
276
291
|
end
|
|
277
292
|
end
|
|
278
293
|
|
|
279
294
|
def date_field(method, options = {})
|
|
295
|
+
# Extract custom label if provided
|
|
296
|
+
custom_label = options.delete(:label)
|
|
297
|
+
|
|
280
298
|
content_tag :div, class: container_styles do
|
|
281
|
-
label(method) + meta_text(options) + super(method, options.reverse_merge(class: input_styles))
|
|
299
|
+
label(method, custom_label) + meta_text(options) + super(method, options.reverse_merge(class: input_styles))
|
|
282
300
|
end
|
|
283
301
|
end
|
|
284
302
|
|
|
285
303
|
def radio_button_group(method, choices, options = {})
|
|
304
|
+
# Extract custom label if provided
|
|
305
|
+
custom_label = options.delete(:label)
|
|
306
|
+
|
|
286
307
|
current_value = object.send(method)
|
|
287
308
|
|
|
288
309
|
content_tag :div, class: container_styles do
|
|
289
|
-
label(method) +
|
|
310
|
+
label(method, custom_label) +
|
|
290
311
|
meta_text(options) +
|
|
291
312
|
content_tag(:div, class: "mt-2 space-y-2") do
|
|
292
313
|
choices.map do |choice|
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
# Shared Capybara configuration for all Panda gems
|
|
4
4
|
# This provides standard Capybara setup with sensible defaults
|
|
5
5
|
|
|
6
|
-
#
|
|
7
|
-
Capybara.default_max_wait_time = ENV["
|
|
6
|
+
# We don't want to hang around for too long for processes at the moment
|
|
7
|
+
Capybara.default_max_wait_time = ENV["CAPYBARA_MAX_WAIT_TIME"].present? ? ENV["CAPYBARA_MAX_WAIT_TIME"].to_i : 2
|
|
8
8
|
|
|
9
9
|
# Normalize whitespaces when using `has_text?` and similar matchers,
|
|
10
10
|
# i.e., ignore newlines, trailing spaces, etc.
|
|
@@ -24,10 +24,10 @@ module Panda
|
|
|
24
24
|
inspector: ENV["INSPECTOR"].in?(%w[y 1 yes true]),
|
|
25
25
|
headless: !ENV["HEADLESS"].in?(%w[n 0 no false]),
|
|
26
26
|
slowmo: ENV["SLOWMO"]&.to_f || 0,
|
|
27
|
-
timeout:
|
|
27
|
+
timeout: 10,
|
|
28
28
|
js_errors: true, # IMPORTANT: Report JavaScript errors as test failures
|
|
29
29
|
ignore_default_browser_options: false,
|
|
30
|
-
process_timeout:
|
|
30
|
+
process_timeout: 2,
|
|
31
31
|
wait_for_network_idle: false, # Don't wait for all network requests
|
|
32
32
|
pending_connection_errors: false, # Don't fail on pending external connections
|
|
33
33
|
browser_options: {
|
|
@@ -64,13 +64,6 @@ module Panda
|
|
|
64
64
|
# Add CI-specific options
|
|
65
65
|
if ENV["GITHUB_ACTIONS"] == "true"
|
|
66
66
|
options[:browser_options].merge!(ci_browser_options)
|
|
67
|
-
|
|
68
|
-
puts "\nš Cuprite Configuration (Desktop):"
|
|
69
|
-
puts " Debug mode: #{ENV["DEBUG"]}"
|
|
70
|
-
puts " Headless: #{options[:headless]}"
|
|
71
|
-
puts " JS Errors: #{options[:js_errors]}"
|
|
72
|
-
puts " Browser options: #{options[:browser_options].keys.join(", ")}"
|
|
73
|
-
puts ""
|
|
74
67
|
end
|
|
75
68
|
|
|
76
69
|
Capybara.register_driver :cuprite do |app|
|
|
@@ -85,11 +78,6 @@ module Panda
|
|
|
85
78
|
|
|
86
79
|
if ENV["GITHUB_ACTIONS"] == "true"
|
|
87
80
|
options[:browser_options].merge!(ci_browser_options)
|
|
88
|
-
|
|
89
|
-
puts "\nš Cuprite Configuration (Mobile):"
|
|
90
|
-
puts " Window size: #{options[:window_size]}"
|
|
91
|
-
puts " JS Errors: #{options[:js_errors]}"
|
|
92
|
-
puts ""
|
|
93
81
|
end
|
|
94
82
|
|
|
95
83
|
Capybara.register_driver :cuprite_mobile do |app|
|
data/lib/panda/core/version.rb
CHANGED