easy-admin-rails 0.2.8 → 0.2.9
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: 74e3a17e7d1c33152242a68ca0b0211d72b37d5b206307721e006d09a6c07ef1
|
4
|
+
data.tar.gz: b8c3645a8c1d27de9b5c7ee20b718b9a4cc10d16b2d2a87d285d24c7228a9c62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19405da82b73193c8009360e481c9bac007623dbd4c36e3bea6c09f0d248547689d8eb74d4e84f2affd7da4c6f83b6ce30c9295814bb2aacb4f6f4659ef01960
|
7
|
+
data.tar.gz: fb822864ee9ac13b116385492d8c34617ab12e25660df46ac90fcd3f281768a612c99bd16ec7addf9c53b5556325e4956996681f95ad4a4ee5aacd693bb8bbee
|
@@ -71,9 +71,9 @@ module EasyAdmin
|
|
71
71
|
else
|
72
72
|
# For static mode, render all options
|
73
73
|
render_option("", "All")
|
74
|
-
|
75
|
-
if
|
76
|
-
|
74
|
+
|
75
|
+
if resolved_options
|
76
|
+
resolved_options.each do |option_value, option_label|
|
77
77
|
render_option(option_value, option_label)
|
78
78
|
end
|
79
79
|
end
|
@@ -108,16 +108,33 @@ module EasyAdmin
|
|
108
108
|
|
109
109
|
def current_display_value
|
110
110
|
return "All" if @search_params["#{filter_field_name}_eq"].blank?
|
111
|
-
|
112
|
-
if
|
113
|
-
|
111
|
+
|
112
|
+
if resolved_options
|
113
|
+
resolved_options.each do |option_value, option_label|
|
114
114
|
return option_label.to_s if option_value.to_s == @search_params["#{filter_field_name}_eq"].to_s
|
115
115
|
end
|
116
116
|
end
|
117
|
-
|
117
|
+
|
118
118
|
@search_params["#{filter_field_name}_eq"].to_s
|
119
119
|
end
|
120
120
|
|
121
|
+
def resolved_options
|
122
|
+
return nil unless @field[:options]
|
123
|
+
|
124
|
+
if @field[:options].is_a?(Proc)
|
125
|
+
# For filters, call the Proc without parameters
|
126
|
+
# (filters don't have a specific record context like forms do)
|
127
|
+
if @field[:options].arity == 0 || @field[:options].arity == -1
|
128
|
+
@field[:options].call
|
129
|
+
else
|
130
|
+
# If Proc expects parameters, call it with nil
|
131
|
+
@field[:options].call(nil)
|
132
|
+
end
|
133
|
+
else
|
134
|
+
@field[:options]
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
121
138
|
def render_no_results_message
|
122
139
|
div(
|
123
140
|
class: "select-no-results px-3 py-2 text-sm text-gray-500 text-center",
|
data/lib/easy_admin/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy-admin-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Slaurmagan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|