avo 2.23.1 → 2.23.3.pre.1.pr1529
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of avo might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile.lock +43 -45
- data/app/components/avo/fields/belongs_to_field/edit_component.html.erb +2 -2
- data/app/components/avo/fields/belongs_to_field/edit_component.rb +1 -1
- data/app/components/avo/fields/progress_bar_field/edit_component.html.erb +19 -26
- data/app/controllers/avo/search_controller.rb +1 -1
- data/app/helpers/avo/application_helper.rb +1 -1
- data/app/javascript/js/controllers/fields/progress_bar_field_controller.js +9 -0
- data/app/javascript/js/controllers.js +2 -0
- data/config/master.key +1 -0
- data/lib/avo/fields/base_field.rb +1 -0
- data/lib/avo/fields/belongs_to_field.rb +1 -2
- data/lib/avo/version.rb +1 -1
- data/public/avo-assets/avo.base.js +68 -68
- data/public/avo-assets/avo.base.js.map +3 -3
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de77547d8082b94984a6b224a19834113f65d52f9c0afd1d169d83026ecbc3fe
|
4
|
+
data.tar.gz: a0eed9b9260291aea7951067164d2dafc0d36dead3b57d189e0263434c5eb831
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d478cf9410b3437f0ef998857b5f71e27c43b245030dbe5f21acc81ae9d751123bd5c3a6131dd7618fdeb9c12de23c0c6fca7bf36e2d285dd7793144946e40f9
|
7
|
+
data.tar.gz: e9426307d3d13a23aea64ca185c211821f29460cd85ee2b74d876eb538d91d41ee8802d5a2961ede266d0bbe2922d9b8206ac68fc8982002b57cc311df15cbb8
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
avo (2.23.1)
|
4
|
+
avo (2.23.3.pre.1.pr1529)
|
5
5
|
actionview (>= 6.0)
|
6
6
|
active_link_to
|
7
7
|
activerecord (>= 6.0)
|
@@ -108,24 +108,25 @@ GEM
|
|
108
108
|
aws-sdk-kms (1.58.0)
|
109
109
|
aws-sdk-core (~> 3, >= 3.127.0)
|
110
110
|
aws-sigv4 (~> 1.1)
|
111
|
-
aws-sdk-s3 (1.
|
111
|
+
aws-sdk-s3 (1.116.0)
|
112
112
|
aws-sdk-core (~> 3, >= 3.127.0)
|
113
113
|
aws-sdk-kms (~> 1)
|
114
114
|
aws-sigv4 (~> 1.4)
|
115
115
|
aws-sigv4 (1.5.1)
|
116
116
|
aws-eventstream (~> 1, >= 1.0.2)
|
117
117
|
bcrypt (3.1.18)
|
118
|
-
better_html (
|
119
|
-
actionview (>=
|
120
|
-
activesupport (>=
|
118
|
+
better_html (1.0.16)
|
119
|
+
actionview (>= 4.0)
|
120
|
+
activesupport (>= 4.0)
|
121
121
|
ast (~> 2.0)
|
122
122
|
erubi (~> 1.4)
|
123
|
+
html_tokenizer (~> 0.0.6)
|
123
124
|
parser (>= 2.4)
|
124
125
|
smart_properties
|
125
126
|
bindex (0.8.1)
|
126
|
-
bootsnap (1.
|
127
|
+
bootsnap (1.15.0)
|
127
128
|
msgpack (~> 1.2)
|
128
|
-
brakeman (5.
|
129
|
+
brakeman (5.4.0)
|
129
130
|
builder (3.2.4)
|
130
131
|
bump (0.10.0)
|
131
132
|
bundler-integrity (1.0.9)
|
@@ -142,7 +143,8 @@ GEM
|
|
142
143
|
chartkick (4.2.1)
|
143
144
|
childprocess (4.1.0)
|
144
145
|
concurrent-ruby (1.1.10)
|
145
|
-
countries (
|
146
|
+
countries (4.2.3)
|
147
|
+
i18n_data (~> 0.16.0)
|
146
148
|
sixarm_ruby_unaccent (~> 1.1)
|
147
149
|
crack (0.4.5)
|
148
150
|
rexml
|
@@ -162,7 +164,6 @@ GEM
|
|
162
164
|
responders
|
163
165
|
warden (~> 1.2.3)
|
164
166
|
diff-lcs (1.5.0)
|
165
|
-
digest (3.1.0)
|
166
167
|
docile (1.4.0)
|
167
168
|
dotenv (2.8.1)
|
168
169
|
dotenv-rails (2.8.1)
|
@@ -190,15 +191,16 @@ GEM
|
|
190
191
|
groupdate (6.1.0)
|
191
192
|
activesupport (>= 5.2)
|
192
193
|
hashdiff (1.0.1)
|
193
|
-
highline (2.0
|
194
|
+
highline (2.1.0)
|
194
195
|
hightop (0.3.0)
|
195
196
|
activesupport (>= 5.2)
|
196
197
|
hotwire-livereload (1.2.2)
|
197
198
|
listen (>= 3.0.0)
|
198
199
|
rails (>= 6.0.0)
|
200
|
+
html_tokenizer (0.0.7)
|
199
201
|
htmlbeautifier (1.4.2)
|
200
|
-
httparty (0.
|
201
|
-
|
202
|
+
httparty (0.21.0)
|
203
|
+
mini_mime (>= 1.0.0)
|
202
204
|
multi_xml (>= 0.5.2)
|
203
205
|
i18n (1.12.0)
|
204
206
|
concurrent-ruby (~> 1.0)
|
@@ -213,6 +215,8 @@ GEM
|
|
213
215
|
rails-i18n
|
214
216
|
rainbow (>= 2.2.2, < 4.0)
|
215
217
|
terminal-table (>= 1.5.1)
|
218
|
+
i18n_data (0.16.0)
|
219
|
+
simple_po_parser (~> 1.1)
|
216
220
|
image_processing (1.12.2)
|
217
221
|
mini_magick (>= 4.9.5, < 5)
|
218
222
|
ruby-vips (>= 2.0.17, < 3)
|
@@ -225,8 +229,8 @@ GEM
|
|
225
229
|
jsbundling-rails (1.0.3)
|
226
230
|
railties (>= 6.0.0)
|
227
231
|
json (2.6.2)
|
228
|
-
launchy (2.5.
|
229
|
-
addressable (~> 2.
|
232
|
+
launchy (2.5.2)
|
233
|
+
addressable (~> 2.8)
|
230
234
|
listen (3.7.1)
|
231
235
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
232
236
|
rb-inotify (~> 0.9, >= 0.9.10)
|
@@ -240,24 +244,19 @@ GEM
|
|
240
244
|
zeitwerk
|
241
245
|
marcel (1.0.2)
|
242
246
|
matrix (0.4.2)
|
243
|
-
meta-tags (2.
|
247
|
+
meta-tags (2.18.0)
|
244
248
|
actionpack (>= 3.2.0, < 7.1)
|
245
249
|
method_source (1.0.0)
|
246
|
-
|
247
|
-
mime-types-data (~> 3.2015)
|
248
|
-
mime-types-data (3.2022.0105)
|
249
|
-
mini_magick (4.11.0)
|
250
|
+
mini_magick (4.12.0)
|
250
251
|
mini_mime (1.1.2)
|
251
252
|
mini_portile2 (2.8.0)
|
252
|
-
minitest (5.
|
253
|
+
minitest (5.17.0)
|
253
254
|
msgpack (1.5.6)
|
254
255
|
multi_xml (0.6.0)
|
255
256
|
net-protocol (0.1.3)
|
256
257
|
timeout
|
257
|
-
net-smtp (0.3.
|
258
|
-
digest
|
258
|
+
net-smtp (0.3.3)
|
259
259
|
net-protocol
|
260
|
-
timeout
|
261
260
|
nio4r (2.5.8)
|
262
261
|
nokogiri (1.13.10)
|
263
262
|
mini_portile2 (~> 2.8.0)
|
@@ -267,16 +266,16 @@ GEM
|
|
267
266
|
orm_adapter (0.5.0)
|
268
267
|
pagy (6.0.0)
|
269
268
|
parallel (1.22.1)
|
270
|
-
parser (3.
|
269
|
+
parser (3.2.0.0)
|
271
270
|
ast (~> 2.4.1)
|
272
|
-
pg (1.4.
|
271
|
+
pg (1.4.5)
|
273
272
|
public_suffix (5.0.0)
|
274
273
|
puma (5.6.5)
|
275
274
|
nio4r (~> 2.0)
|
276
275
|
pundit (2.2.0)
|
277
276
|
activesupport (>= 3.0.0)
|
278
277
|
racc (1.6.1)
|
279
|
-
rack (2.2.
|
278
|
+
rack (2.2.5)
|
280
279
|
rack-test (2.0.2)
|
281
280
|
rack (>= 1.3)
|
282
281
|
rails (6.1.6.1)
|
@@ -314,9 +313,9 @@ GEM
|
|
314
313
|
thor (~> 1.0)
|
315
314
|
rainbow (3.1.1)
|
316
315
|
rake (13.0.6)
|
317
|
-
ransack (3.
|
318
|
-
activerecord (>= 6.
|
319
|
-
activesupport (>= 6.
|
316
|
+
ransack (3.0.1)
|
317
|
+
activerecord (>= 6.0.4)
|
318
|
+
activesupport (>= 6.0.4)
|
320
319
|
i18n
|
321
320
|
rb-fsevent (0.11.1)
|
322
321
|
rb-inotify (0.10.1)
|
@@ -329,7 +328,7 @@ GEM
|
|
329
328
|
rexml (3.2.5)
|
330
329
|
rspec-core (3.11.0)
|
331
330
|
rspec-support (~> 3.11.0)
|
332
|
-
rspec-expectations (3.11.
|
331
|
+
rspec-expectations (3.11.1)
|
333
332
|
diff-lcs (>= 1.2.0, < 2.0)
|
334
333
|
rspec-support (~> 3.11.0)
|
335
334
|
rspec-mocks (3.11.1)
|
@@ -344,7 +343,7 @@ GEM
|
|
344
343
|
rspec-mocks (~> 3.10)
|
345
344
|
rspec-support (~> 3.10)
|
346
345
|
rspec-support (3.11.0)
|
347
|
-
rubocop (1.35.
|
346
|
+
rubocop (1.35.1)
|
348
347
|
json (~> 2.3)
|
349
348
|
parallel (~> 1.10)
|
350
349
|
parser (>= 3.1.2.1)
|
@@ -359,20 +358,20 @@ GEM
|
|
359
358
|
rubocop-performance (1.14.3)
|
360
359
|
rubocop (>= 1.7.0, < 2.0)
|
361
360
|
rubocop-ast (>= 0.4.0)
|
362
|
-
rubocop-shopify (2.
|
363
|
-
rubocop (~> 1.
|
361
|
+
rubocop-shopify (2.5.0)
|
362
|
+
rubocop (~> 1.25)
|
364
363
|
ruby-debug-ide (0.7.3)
|
365
364
|
rake (>= 0.8.1)
|
366
365
|
ruby-progressbar (1.11.0)
|
367
366
|
ruby-vips (2.1.4)
|
368
367
|
ffi (~> 1.12)
|
369
368
|
rubyzip (2.3.2)
|
370
|
-
selenium-webdriver (4.
|
369
|
+
selenium-webdriver (4.1.0)
|
371
370
|
childprocess (>= 0.5, < 5.0)
|
372
371
|
rexml (~> 3.2, >= 3.2.5)
|
373
|
-
rubyzip (>= 1.2.2
|
374
|
-
|
375
|
-
simplecov (0.
|
372
|
+
rubyzip (>= 1.2.2)
|
373
|
+
simple_po_parser (1.1.6)
|
374
|
+
simplecov (0.22.0)
|
376
375
|
docile (~> 1.1)
|
377
376
|
simplecov-html (~> 0.11)
|
378
377
|
simplecov_json_formatter (~> 0.1)
|
@@ -383,18 +382,18 @@ GEM
|
|
383
382
|
simplecov_json_formatter (0.1.4)
|
384
383
|
sixarm_ruby_unaccent (1.2.0)
|
385
384
|
smart_properties (1.17.0)
|
386
|
-
spring (
|
385
|
+
spring (3.1.1)
|
387
386
|
spring-commands-rspec (1.0.4)
|
388
387
|
spring (>= 0.9.1)
|
389
|
-
sprockets (4.
|
388
|
+
sprockets (4.2.0)
|
390
389
|
concurrent-ruby (~> 1.0)
|
391
|
-
rack (
|
390
|
+
rack (>= 2.2.4, < 4)
|
392
391
|
sprockets-rails (3.4.2)
|
393
392
|
actionpack (>= 5.2)
|
394
393
|
activesupport (>= 5.2)
|
395
394
|
sprockets (>= 3.0.0)
|
396
|
-
standard (1.16.
|
397
|
-
rubocop (= 1.35.
|
395
|
+
standard (1.16.1)
|
396
|
+
rubocop (= 1.35.1)
|
398
397
|
rubocop-performance (= 1.14.3)
|
399
398
|
terminal-table (3.0.2)
|
400
399
|
unicode-display_width (>= 1.1.1, < 3)
|
@@ -407,8 +406,8 @@ GEM
|
|
407
406
|
railties (>= 6.0.0)
|
408
407
|
tzinfo (2.0.5)
|
409
408
|
concurrent-ruby (~> 1.0)
|
410
|
-
unicode-display_width (2.
|
411
|
-
view_component (2.
|
409
|
+
unicode-display_width (2.4.0)
|
410
|
+
view_component (2.81.0)
|
412
411
|
activesupport (>= 5.2.0, < 8.0)
|
413
412
|
concurrent-ruby (~> 1.0)
|
414
413
|
method_source (~> 1.0)
|
@@ -427,7 +426,6 @@ GEM
|
|
427
426
|
addressable (>= 2.8.0)
|
428
427
|
crack (>= 0.3.2)
|
429
428
|
hashdiff (>= 0.4.0, < 2.0.0)
|
430
|
-
websocket (1.2.9)
|
431
429
|
websocket-driver (0.7.5)
|
432
430
|
websocket-extensions (>= 0.1.0)
|
433
431
|
websocket-extensions (0.1.5)
|
@@ -52,7 +52,7 @@
|
|
52
52
|
style: @field.get_html(:style, view: view, element: :input),
|
53
53
|
type: type,
|
54
54
|
classes: classes("w-full"),
|
55
|
-
view:
|
55
|
+
view: view
|
56
56
|
%>
|
57
57
|
<% else %>
|
58
58
|
<%= @form.select @field.id_input_foreign_key,
|
@@ -88,7 +88,7 @@
|
|
88
88
|
resource: @resource,
|
89
89
|
disabled: disabled,
|
90
90
|
classes: classes("w-full"),
|
91
|
-
view:
|
91
|
+
view: view,
|
92
92
|
style: @field.get_html(:style, view: view, element: :input)
|
93
93
|
%>
|
94
94
|
<% else %>
|
@@ -50,7 +50,7 @@ class Avo::Fields::BelongsToField::EditComponent < Avo::Fields::EditComponent
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def field_html_action
|
53
|
-
@field.get_html(:data, view:
|
53
|
+
@field.get_html(:data, view: view, element: :input).fetch(:action, nil)
|
54
54
|
end
|
55
55
|
|
56
56
|
private
|
@@ -1,29 +1,22 @@
|
|
1
1
|
<%= field_wrapper **field_wrapper_args do %>
|
2
|
-
|
3
|
-
|
4
|
-
<
|
5
|
-
|
2
|
+
<%= content_tag :div, data: {controller: "progress-bar-field"} do %>
|
3
|
+
<% if @field.display_value %>
|
4
|
+
<div class="text-center text-sm font-semibold w-full leading-none mb-1">
|
5
|
+
<span data-progress-bar-field-target="label"><%= @field.value %></span><%= @field.value_suffix if @field.value_suffix.present? %>
|
6
|
+
</div>
|
7
|
+
<% end %>
|
8
|
+
<%= @form.range_field @field.id,
|
9
|
+
class: "w-full #{@field.get_html(:classes, view: view, element: :input)}",
|
10
|
+
data: {
|
11
|
+
action: "input->progress-bar-field#update",
|
12
|
+
**@field.get_html(:data, view: view, element: :input)
|
13
|
+
},
|
14
|
+
disabled: disabled?,
|
15
|
+
max: @field.max,
|
16
|
+
min: 0,
|
17
|
+
placeholder: @field.placeholder,
|
18
|
+
step: @field.step,
|
19
|
+
style: @field.get_html(:style, view: view, element: :input)
|
20
|
+
%>
|
6
21
|
<% end %>
|
7
|
-
<%= @form.range_field @field.id,
|
8
|
-
class: "w-full #{@field.get_html(:classes, view: view, element: :input)}",
|
9
|
-
data: @field.get_html(:data, view: view, element: :input),
|
10
|
-
disabled: disabled?,
|
11
|
-
max: @field.max,
|
12
|
-
min: 0,
|
13
|
-
placeholder: @field.placeholder,
|
14
|
-
step: @field.step,
|
15
|
-
style: @field.get_html(:style, view: view, element: :input)
|
16
|
-
%>
|
17
22
|
<% end %>
|
18
|
-
|
19
|
-
|
20
|
-
<script>
|
21
|
-
var input = document.getElementById('project_progress');
|
22
|
-
var log = document.querySelector('.js-progress-bar-value-<%= @field.id %>');
|
23
|
-
|
24
|
-
input.addEventListener('input', updateValue);
|
25
|
-
|
26
|
-
function updateValue(e) {
|
27
|
-
log.textContent = e.target.value;
|
28
|
-
}
|
29
|
-
</script>
|
@@ -133,7 +133,7 @@ module Avo
|
|
133
133
|
field = field_klass.new id, form: form, view: view, **args, &block
|
134
134
|
|
135
135
|
# Add the form record to the field so all fields have access to it.
|
136
|
-
field.hydrate(model: form.object)
|
136
|
+
field.hydrate(model: form.object) if form.present?
|
137
137
|
|
138
138
|
render field.component_for_view(view).new field: field, form: form, **component_options
|
139
139
|
end
|
@@ -19,6 +19,7 @@ import MenuController from './controllers/menu_controller'
|
|
19
19
|
import ModalController from './controllers/modal_controller'
|
20
20
|
import MultipleSelectFilterController from './controllers/multiple_select_filter_controller'
|
21
21
|
import PerPageController from './controllers/per_page_controller'
|
22
|
+
import ProgressBarFieldController from './controllers/fields/progress_bar_field_controller'
|
22
23
|
import ResourceEditController from './controllers/resource_edit_controller'
|
23
24
|
import ResourceIndexController from './controllers/resource_index_controller'
|
24
25
|
import ResourceShowController from './controllers/resource_show_controller'
|
@@ -67,6 +68,7 @@ application.register('belongs-to-field', BelongsToFieldController)
|
|
67
68
|
application.register('code-field', CodeFieldController)
|
68
69
|
application.register('date-field', DateFieldController)
|
69
70
|
application.register('key-value', KeyValueController)
|
71
|
+
application.register('progress-bar-field', ProgressBarFieldController)
|
70
72
|
application.register('simple-mde', SimpleMdeController)
|
71
73
|
application.register('trix-field', TrixFieldController)
|
72
74
|
|
data/config/master.key
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2aeb23d82b909d9c6b5abb62f7058c2a
|
@@ -1,6 +1,5 @@
|
|
1
1
|
module Avo
|
2
2
|
module Fields
|
3
|
-
|
4
3
|
# The field can be in multiple scenarios where it needs different types of data and displays the state differently.
|
5
4
|
# For example the non-polymorphic, non-searchable variant is the easiest to support. You only need to populate a simple select with the ID of the associated record and the list of records.
|
6
5
|
# For the searchable polymorphic variant you need to provide the type of the association (Post, Project, Team), the label of the associated record ("Cool post title") and the ID of that record.
|
@@ -118,7 +117,7 @@ module Avo
|
|
118
117
|
resource = target_resource
|
119
118
|
resource = App.get_resource_by_model_name model if model.present?
|
120
119
|
|
121
|
-
query =
|
120
|
+
query = resource.class.query_scope
|
122
121
|
|
123
122
|
if attach_scope.present?
|
124
123
|
query = Avo::Hosts::AssociationScopeHost.new(block: attach_scope, query: query, parent: get_model).handle
|
data/lib/avo/version.rb
CHANGED