avo 1.15.0 → 1.16.3
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 +1 -1
- 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/app/views/avo/partials/_profile_dropdown.html.erb +1 -1
- data/app/views/avo/sidebar/_sidebar.html.erb +2 -2
- data/lib/avo/app.rb +1 -3
- data/lib/avo/base_resource.rb +4 -0
- data/lib/avo/fields/base_field.rb +1 -1
- data/lib/avo/filters/text_filter.rb +9 -0
- data/lib/avo/version.rb +1 -1
- data/lib/generators/avo/templates/locales/avo.en.yml +1 -0
- data/lib/generators/avo/templates/locales/avo.nb-NO.yml +1 -0
- data/lib/generators/avo/templates/locales/avo.pt-BR.yml +1 -0
- data/lib/generators/avo/templates/locales/avo.ro.yml +1 -0
- 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 +12 -9
- 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: 24fb847d8c6ebd7ba3c45926bc5431d7d100b3baf56391e316d4f30cebbae4f7
|
4
|
+
data.tar.gz: 7eb97752916fd9159f0210e5f500a9b4c563c9d250ffa53b59dd1ad54b5ff770
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99780816253684b5de953532a0da805fecf38ab55115475438d94553ebe24989912e45172f7028d4c468482427f3da1686ea78d5c698ad3f24ff771fc0be72dc
|
7
|
+
data.tar.gz: 54104ca33a97fb1508133b6f1db18772cf94db9404d2c4dde5b507bc64b2c80fba54c00501bad998f6998a83f533902c18dd6425b541c451c9d55c917b11699f
|
data/Gemfile.lock
CHANGED
@@ -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>
|
@@ -17,7 +17,7 @@
|
|
17
17
|
|
18
18
|
<% if main_app.respond_to?(:destroy_user_session_path) %>
|
19
19
|
<div class="hidden absolute inset-auto inset-auto right-0 mr-6 mt-0 py-4 bg-white rounded-xl min-w-[200px] shadow-context" data-toggle-panel-target="panel">
|
20
|
-
<%= button_to
|
20
|
+
<%= button_to t('avo.sign_out'), main_app.destroy_user_session_path, method: :delete, form: { "data-turbo" => "false" }, class: "appearance-none bg-white text-left cursor-pointer text-green-600 font-semibold hover:text-white hover:bg-green-500 block px-4 py-1 w-full" %>
|
21
21
|
</div>
|
22
22
|
<% end %>
|
23
23
|
</div>
|
@@ -11,8 +11,8 @@
|
|
11
11
|
<%= render Avo::NavigationHeadingComponent.new label: t('avo.resources') %>
|
12
12
|
|
13
13
|
<div class="w-full">
|
14
|
-
<% Avo::App.resources_navigation(_current_user).each do |resource| %>
|
15
|
-
<%= render Avo::NavigationLinkComponent.new label: resource.
|
14
|
+
<% Avo::App.resources_navigation(_current_user).sort_by { |r| r.navigation_label }.each do |resource| %>
|
15
|
+
<%= render Avo::NavigationLinkComponent.new label: resource.navigation_label, path: resources_path(resource.model_class) %>
|
16
16
|
<% end %>
|
17
17
|
|
18
18
|
<% sidebar_partials = Avo::App.get_sidebar_partials %>
|
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/base_resource.rb
CHANGED
data/lib/avo/version.rb
CHANGED