avo 2.32.2 → 2.32.4
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/actions_component.rb +4 -2
- data/app/components/avo/index/resource_map_component.html.erb +1 -1
- data/app/components/avo/views/resource_index_component.html.erb +1 -1
- data/app/views/avo/actions/show.html.erb +2 -1
- data/config/routes.rb +2 -2
- data/lib/avo/app.rb +1 -1
- data/lib/avo/base_action.rb +1 -1
- data/lib/avo/concerns/fetches_things.rb +7 -7
- data/lib/avo/resources/controls/action.rb +4 -1
- data/lib/avo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca219e472c153396f4f8dd6d4cbe2e44a09d3af4e497585c6dd1d736b25316ba
|
4
|
+
data.tar.gz: 261b1d9f24a6ae175b1941163dbe99194f2af8ac21fed1b73efacdb73d7892c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c02d665d1bafa6776c3b7066c6d47e78b36ed788b4c89b2908563ce920cbafe60431deeb142394fc446abc38cbb2f8405ff0026d290cba824335a466cd6cd9c6
|
7
|
+
data.tar.gz: 2816d0af24529faaae699eb1fbc0f1f62b7c37fddf4edd59f9fb0bbb86e201d4d665e23be3e469576b7df03664659b124ff87a3af434f058c8b5e37fbeecfe19
|
data/Gemfile.lock
CHANGED
@@ -53,13 +53,15 @@ class Avo::ActionsComponent < ViewComponent::Base
|
|
53
53
|
|
54
54
|
def single_record_path(id)
|
55
55
|
Avo::Services::URIService.parse(@resource.record_path)
|
56
|
-
.append_paths("actions"
|
56
|
+
.append_paths("actions")
|
57
|
+
.append_query("action_id": id)
|
57
58
|
.to_s
|
58
59
|
end
|
59
60
|
|
60
61
|
def many_records_path(id)
|
61
62
|
Avo::Services::URIService.parse(@resource.records_path)
|
62
|
-
.append_paths("actions"
|
63
|
+
.append_paths("actions")
|
64
|
+
.append_query("action_id": id)
|
63
65
|
.to_s
|
64
66
|
end
|
65
67
|
end
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<%= js_map(resource_location_markers, **resource_mapkick_options) %>
|
5
5
|
</div>
|
6
6
|
<% if render_table? %>
|
7
|
-
<div class="overflow-auto<%= table_component_order_class %>">
|
7
|
+
<div class="overflow-auto <%= table_component_order_class %>">
|
8
8
|
<%= render(Avo::Index::ResourceTableComponent.new(resources: @resources, resource: @resource, reflection: @reflection, parent_model: @parent_model, parent_resource: @parent_resource, pagy: @pagy, query: @query)) %>
|
9
9
|
</div>
|
10
10
|
<% end %>
|
@@ -66,7 +66,7 @@
|
|
66
66
|
<% end %>
|
67
67
|
<% end %>
|
68
68
|
<% c.with_bare_content do %>
|
69
|
-
<% if view_type.to_sym == :table %>
|
69
|
+
<% if view_type.to_sym == :table || view_type.to_sym == :map %>
|
70
70
|
<% if @models.present? %>
|
71
71
|
<div class="mt-4">
|
72
72
|
<%= render Avo::PaginatorComponent.new pagy: @pagy, turbo_frame: @turbo_frame || 'none', index_params: @index_params, resource: @resource, parent_model: @parent_model, discreet_pagination: field&.discreet_pagination %>
|
@@ -9,7 +9,7 @@
|
|
9
9
|
>
|
10
10
|
<%= form_with model: @model,
|
11
11
|
scope: 'fields',
|
12
|
-
url: "#{@resource.records_path}/actions
|
12
|
+
url: "#{@resource.records_path}/actions",
|
13
13
|
local: true,
|
14
14
|
data: @action.class.form_data_attributes do |form|
|
15
15
|
%>
|
@@ -20,6 +20,7 @@
|
|
20
20
|
<div class="flex-1 flex">
|
21
21
|
<%= @action.get_message %>
|
22
22
|
</div>
|
23
|
+
<%= hidden_field_tag :action_id, @action.param_id %>
|
23
24
|
<%= form.hidden_field :avo_resource_ids, value: params[:resource_ids], 'data-action-target': 'resourceIds' %>
|
24
25
|
<%= form.hidden_field :avo_selected_query, 'data-action-target': 'selectedAllQuery' %>
|
25
26
|
<% if @action.get_fields.present? %>
|
data/config/routes.rb
CHANGED
@@ -28,8 +28,8 @@ Avo::Engine.routes.draw do
|
|
28
28
|
delete "/:resource_name/:id/active_storage_attachments/:attachment_name/:attachment_id", to: "attachments#destroy"
|
29
29
|
|
30
30
|
# Actions
|
31
|
-
get "/:resource_name(/:id)/actions
|
32
|
-
post "/:resource_name(/:id)/actions
|
31
|
+
get "/:resource_name(/:id)/actions/(:action_id)", to: "actions#show"
|
32
|
+
post "/:resource_name(/:id)/actions/(:action_id)", to: "actions#handle"
|
33
33
|
|
34
34
|
# Generate resource routes as below:
|
35
35
|
# resources :posts
|
data/lib/avo/app.rb
CHANGED
data/lib/avo/base_action.rb
CHANGED
@@ -15,7 +15,7 @@ module Avo
|
|
15
15
|
|
16
16
|
# Returns the Avo dashboard by name
|
17
17
|
#
|
18
|
-
# get_dashboard_by_name(:dashy) -> Dashy
|
18
|
+
# get_dashboard_by_name(:dashy) -> instance of Dashy
|
19
19
|
def get_dashboard_by_name(name)
|
20
20
|
dashboards.find do |dashboard|
|
21
21
|
dashboard.name == name
|
@@ -29,7 +29,7 @@ module Avo
|
|
29
29
|
|
30
30
|
# Returns the Avo resource by camelized name
|
31
31
|
#
|
32
|
-
# get_resource_by_name('User') => UserResource
|
32
|
+
# get_resource_by_name('User') => instance of UserResource
|
33
33
|
def get_resource(resource)
|
34
34
|
possible_resource = "#{resource}Resource".gsub "ResourceResource", "Resource"
|
35
35
|
|
@@ -40,7 +40,7 @@ module Avo
|
|
40
40
|
|
41
41
|
# Returns the Avo resource by singular snake_cased name
|
42
42
|
#
|
43
|
-
# get_resource_by_name('user') => UserResource
|
43
|
+
# get_resource_by_name('user') => instance of UserResource
|
44
44
|
def get_resource_by_name(name)
|
45
45
|
get_resource name.singularize.camelize
|
46
46
|
end
|
@@ -48,8 +48,8 @@ module Avo
|
|
48
48
|
# Returns the Avo resource by singular snake_cased name
|
49
49
|
# From all the resources that use the same model_class, it will fetch the first one in alphabetical order
|
50
50
|
#
|
51
|
-
# get_resource_by_name('User') => UserResource
|
52
|
-
# get_resource_by_name(User) => UserResource
|
51
|
+
# get_resource_by_name('User') => instance of UserResource
|
52
|
+
# get_resource_by_name(User) => instance of UserResource
|
53
53
|
|
54
54
|
def get_resource_by_model_name(klass)
|
55
55
|
# Fetch the mappings imposed by the user.
|
@@ -65,8 +65,8 @@ module Avo
|
|
65
65
|
|
66
66
|
# Returns the Avo resource by singular snake_cased name
|
67
67
|
#
|
68
|
-
# get_resource_by_controller_name('delayed_backend_active_record_jobs') => DelayedJobResource
|
69
|
-
# get_resource_by_controller_name('users') => UserResource
|
68
|
+
# get_resource_by_controller_name('delayed_backend_active_record_jobs') => instance of DelayedJobResource
|
69
|
+
# get_resource_by_controller_name('users') => instance of UserResource
|
70
70
|
def get_resource_by_controller_name(name)
|
71
71
|
valid_resources
|
72
72
|
.find do |resource|
|
@@ -18,7 +18,10 @@ module Avo
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def path
|
21
|
-
Avo::Services::URIService.parse(@resource.record_path)
|
21
|
+
Avo::Services::URIService.parse(@resource.record_path)
|
22
|
+
.append_paths("actions")
|
23
|
+
.append_query(action_id: action.param_id)
|
24
|
+
.to_s
|
22
25
|
end
|
23
26
|
|
24
27
|
def label
|
data/lib/avo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.32.
|
4
|
+
version: 2.32.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrian Marin
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-05-
|
12
|
+
date: 2023-05-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|