avo 1.15.0.pre.1 → 1.16.2
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 +2 -4
- data/app/components/avo/index/resource_controls_component.rb +2 -2
- data/app/components/avo/views/resource_show_component.html.erb +5 -0
- data/app/packs/js/controllers/text_filter_controller.js +23 -0
- data/app/views/avo/base/_text_filter.html.erb +23 -0
- data/lib/avo/app.rb +1 -3
- data/lib/avo/filters/text_filter.rb +9 -0
- data/lib/avo/version.rb +1 -1
- data/public/avo-packs/css/application-2b4685ca.css.map +1 -1
- data/public/avo-packs/css/application-2b4685ca.css.map.br +0 -0
- data/public/avo-packs/css/application-2b4685ca.css.map.gz +0 -0
- data/public/avo-packs/js/application-124d087ff9491dbf3511.js +26 -0
- data/public/avo-packs/js/{application-6dbb940fca2e811fb7d5.js.LICENSE.txt → application-124d087ff9491dbf3511.js.LICENSE.txt} +0 -0
- data/public/avo-packs/js/application-124d087ff9491dbf3511.js.br +0 -0
- data/public/avo-packs/js/application-124d087ff9491dbf3511.js.gz +0 -0
- data/public/avo-packs/js/application-124d087ff9491dbf3511.js.map +1 -0
- data/public/avo-packs/js/application-124d087ff9491dbf3511.js.map.br +0 -0
- data/public/avo-packs/js/application-124d087ff9491dbf3511.js.map.gz +0 -0
- data/public/avo-packs/manifest.json +8 -8
- metadata +14 -11
- data/public/avo-packs/js/application-6dbb940fca2e811fb7d5.js +0 -26
- data/public/avo-packs/js/application-6dbb940fca2e811fb7d5.js.br +0 -0
- data/public/avo-packs/js/application-6dbb940fca2e811fb7d5.js.gz +0 -0
- data/public/avo-packs/js/application-6dbb940fca2e811fb7d5.js.map +0 -1
- data/public/avo-packs/js/application-6dbb940fca2e811fb7d5.js.map.br +0 -0
- data/public/avo-packs/js/application-6dbb940fca2e811fb7d5.js.map.gz +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 391b29088645004eb4d4f3c2f6bc01ab86695aaf85f4d076004b08730ab2f8ff
|
4
|
+
data.tar.gz: d062bfc791119e31a8c3868cfe2842b3835a4bfc52668a6252e5f7c85fe064e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8c30ba4c563d73564be81cdc2391f0a1f88cb435aff55ba1e01ac196c835d9e77ffbf265a7ef1a9721dc91569dbb5744af3d3c72688ebf2e5453b12b4edf644
|
7
|
+
data.tar.gz: 1525ced018fb96312cd7317e424124e31021dbf37b42c505aecce07ac151a1a27a932fdc9553ceb882ba434db877fa3f2f3dd0f6dd6ca92094304eee986649bc
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
avo (1.
|
4
|
+
avo (1.16.2)
|
5
5
|
active_link_to
|
6
6
|
addressable
|
7
7
|
breadcrumbs_on_rails
|
@@ -209,8 +209,6 @@ GEM
|
|
209
209
|
nokogiri (1.12.5)
|
210
210
|
mini_portile2 (~> 2.6.1)
|
211
211
|
racc (~> 1.4)
|
212
|
-
nokogiri (1.12.5-x86_64-linux)
|
213
|
-
racc (~> 1.4)
|
214
212
|
orm_adapter (0.5.0)
|
215
213
|
pagy (4.11.0)
|
216
214
|
parallel (1.20.1)
|
@@ -441,4 +439,4 @@ DEPENDENCIES
|
|
441
439
|
zeitwerk (~> 2.3)
|
442
440
|
|
443
441
|
BUNDLED WITH
|
444
|
-
2.2.
|
442
|
+
2.2.29
|
@@ -24,7 +24,7 @@ class Avo::Index::ResourceControlsComponent < Avo::ResourceComponent
|
|
24
24
|
|
25
25
|
def show_path
|
26
26
|
if @parent_model.present?
|
27
|
-
helpers.resource_path(@resource.model, via_resource_class: @parent_model.class, via_resource_id: @parent_model.id)
|
27
|
+
helpers.resource_path(@resource.model, via_resource_class: @parent_model.class.base_class, via_resource_id: @parent_model.id)
|
28
28
|
else
|
29
29
|
helpers.resource_path(@resource.model)
|
30
30
|
end
|
@@ -32,7 +32,7 @@ class Avo::Index::ResourceControlsComponent < Avo::ResourceComponent
|
|
32
32
|
|
33
33
|
def edit_path
|
34
34
|
if @parent_model.present?
|
35
|
-
helpers.edit_resource_path(@resource.model, via_resource_class: @parent_model.class, via_resource_id: @parent_model.id)
|
35
|
+
helpers.edit_resource_path(@resource.model, via_resource_class: @parent_model.class.base_class, via_resource_id: @parent_model.id)
|
36
36
|
else
|
37
37
|
helpers.edit_resource_path(@resource.model)
|
38
38
|
end
|
@@ -14,6 +14,11 @@
|
|
14
14
|
<%= svg 'trash' %> <%= t('avo.detach_item', item: @reflection.name.to_s).capitalize %>
|
15
15
|
<% end %>
|
16
16
|
<% end %>
|
17
|
+
<% if @resource.authorization.authorize_action(:edit, raise_exception: false) %>
|
18
|
+
<%= a_link edit_path, color: 'indigo' do %>
|
19
|
+
<%= svg 'edit' %> <%= t('avo.edit').capitalize %>
|
20
|
+
<% end %>
|
21
|
+
<% end %>
|
17
22
|
<% else %>
|
18
23
|
<%= a_link back_path do %>
|
19
24
|
<%= svg 'arrow-left' %> <%= t('avo.go_back') %>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import BaseFilterController from './filter_controller'
|
2
|
+
|
3
|
+
export default class extends BaseFilterController {
|
4
|
+
static targets = ['text']
|
5
|
+
|
6
|
+
getFilterValue() {
|
7
|
+
return this.textTarget.value
|
8
|
+
}
|
9
|
+
|
10
|
+
tryToSubmit(e) {
|
11
|
+
if (e.keyCode === 13) {
|
12
|
+
return this.changeFilter()
|
13
|
+
}
|
14
|
+
|
15
|
+
return undefined
|
16
|
+
}
|
17
|
+
|
18
|
+
getFilterClass() {
|
19
|
+
const { filterClass } = this.textTarget.dataset
|
20
|
+
|
21
|
+
return filterClass
|
22
|
+
}
|
23
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<%
|
2
|
+
begin
|
3
|
+
decoded_filters_param = JSON.parse(Base64.decode64(params[:filters]))
|
4
|
+
set_value = decoded_filters_param[filter.class.to_s]
|
5
|
+
rescue => exception
|
6
|
+
set_value = filter.default
|
7
|
+
end
|
8
|
+
%>
|
9
|
+
<div data-controller="text-filter">
|
10
|
+
<%= filter_wrapper name: filter.name do %>
|
11
|
+
<%= text_field_tag filter.id, set_value,
|
12
|
+
class: input_classes('w-full mb-0'),
|
13
|
+
id: "avo_filters_#{filter.id.parameterize.underscore}",
|
14
|
+
'data-filter-class': filter.class.to_s,
|
15
|
+
'data-text-filter-target': 'text',
|
16
|
+
'data-action': 'keypress->text-filter#tryToSubmit'
|
17
|
+
%>
|
18
|
+
<div class="flex justify-end">
|
19
|
+
<%= a_button filter.button_label || "Filter by #{filter.name}", class: 'mt-4', color: 'blue', data: { action: "text-filter#changeFilter" }, size: :sm %>
|
20
|
+
</div>
|
21
|
+
<%= link_to 'url_redirect', request.url, data: { 'text-filter-target': 'urlRedirect', 'turbo-frame': params[:turbo_frame] }, style: 'hidden', class: 'hidden' %>
|
22
|
+
<% end %>
|
23
|
+
</div>
|
data/lib/avo/app.rb
CHANGED
@@ -164,13 +164,11 @@ module Avo
|
|
164
164
|
end
|
165
165
|
.map do |resource|
|
166
166
|
route_key = if resource.model_class.present?
|
167
|
-
resource.model_class.model_name.
|
167
|
+
resource.model_class.model_name.plural.to_sym
|
168
168
|
else
|
169
169
|
resource.to_s.underscore.gsub("_resource", "").downcase.pluralize.to_sym
|
170
170
|
end
|
171
171
|
|
172
|
-
# Handle uncountable routes
|
173
|
-
route_key = route_key.to_sym
|
174
172
|
resources route_key
|
175
173
|
end
|
176
174
|
end
|
data/lib/avo/version.rb
CHANGED