avo 1.20.2.pre.2 → 1.22.0.pre.1
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 +57 -57
- data/README.md +1 -1
- data/app/assets/builds/avo.css +405 -224
- data/app/assets/builds/avo.js +16 -6
- data/app/assets/builds/avo.js.map +2 -2
- data/app/assets/stylesheets/avo.css +1 -1
- data/app/assets/stylesheets/css/fonts.css +53 -0
- data/app/assets/stylesheets/css/pagination.css +9 -9
- data/app/assets/stylesheets/css/search.css +3 -2
- data/app/assets/svgs/dashboards-icon.svg +6 -0
- data/app/assets/svgs/resources-icon.svg +13 -0
- data/app/assets/svgs/three-dots.svg +5 -0
- data/app/assets/svgs/tools-icon.svg +3 -0
- data/app/components/avo/button_component.html.erb +1 -0
- data/app/components/avo/button_component.rb +111 -0
- data/app/components/avo/fields/belongs_to_field/autocomplete_component.html.erb +14 -7
- data/app/components/avo/fields/belongs_to_field/autocomplete_component.rb +47 -3
- data/app/components/avo/fields/belongs_to_field/edit_component.html.erb +59 -38
- data/app/components/avo/fields/belongs_to_field/edit_component.rb +37 -0
- data/app/components/avo/fields/boolean_field/index_component.html.erb +1 -1
- data/app/components/avo/index/field_wrapper_component.html.erb +8 -2
- data/app/components/avo/index/field_wrapper_component.rb +2 -1
- data/app/components/avo/index/resource_table_component.html.erb +3 -3
- data/app/components/avo/index/table_row_component.html.erb +1 -1
- data/app/components/avo/navigation_heading_component.html.erb +2 -2
- data/app/components/avo/navigation_heading_component.rb +5 -1
- data/app/components/avo/navigation_link_component.html.erb +2 -2
- data/app/components/avo/navigation_link_component.rb +5 -0
- data/app/components/avo/panel_component.html.erb +5 -3
- data/app/components/avo/sidebar_profile_component.html.erb +28 -0
- data/app/components/avo/sidebar_profile_component.rb +43 -0
- data/app/components/avo/views/resource_index_component.html.erb +8 -7
- data/app/components/avo/views/resource_show_component.html.erb +10 -0
- data/app/controllers/avo/application_controller.rb +14 -12
- data/app/controllers/avo/base_controller.rb +4 -1
- data/app/helpers/avo/application_helper.rb +7 -5
- data/app/helpers/avo/resources_helper.rb +2 -2
- data/app/javascript/js/controllers/fields/date_field_controller.js +10 -2
- data/app/javascript/js/controllers/item_selector_controller.js +29 -19
- data/app/javascript/js/controllers/search_controller.js +8 -3
- data/app/views/avo/base/_actions.html.erb +4 -3
- data/app/views/avo/base/_filters.html.erb +3 -1
- data/app/views/avo/partials/_global_search.html.erb +2 -2
- data/app/views/avo/partials/_logo.html.erb +3 -1
- data/app/views/avo/partials/_navbar.html.erb +11 -0
- data/app/views/avo/partials/_paginator.html.erb +4 -3
- data/app/views/avo/partials/_resource_search.html.erb +1 -1
- data/app/views/avo/partials/_sidebar.html.erb +35 -0
- data/app/views/avo/partials/_table_header.html.erb +3 -3
- data/app/views/avo/partials/_turbo_frame_wrap.html.erb +7 -1
- data/app/views/avo/partials/_view_toggle_button.html.erb +22 -16
- data/app/views/layouts/avo/application.html.erb +3 -13
- data/db/factories.rb +7 -3
- data/lib/avo/app.rb +4 -3
- data/lib/avo/base_resource.rb +16 -14
- data/lib/avo/version.rb +1 -1
- data/public/avo-assets/avo.css +405 -224
- data/public/avo-assets/avo.js +16 -6
- data/public/avo-assets/avo.js.map +2 -2
- data/public/avo-assets/fonts/inter-v7-latin-500.eot +0 -0
- data/public/avo-assets/fonts/inter-v7-latin-500.svg +351 -0
- data/public/avo-assets/fonts/inter-v7-latin-500.ttf +0 -0
- data/public/avo-assets/fonts/inter-v7-latin-500.woff +0 -0
- data/public/avo-assets/fonts/inter-v7-latin-500.woff2 +0 -0
- data/public/avo-assets/fonts/inter-v7-latin-600.eot +0 -0
- data/public/avo-assets/fonts/inter-v7-latin-600.svg +351 -0
- data/public/avo-assets/fonts/inter-v7-latin-600.ttf +0 -0
- data/public/avo-assets/fonts/inter-v7-latin-600.woff +0 -0
- data/public/avo-assets/fonts/inter-v7-latin-600.woff2 +0 -0
- data/public/avo-assets/fonts/inter-v7-latin-700.eot +0 -0
- data/public/avo-assets/fonts/inter-v7-latin-700.svg +352 -0
- data/public/avo-assets/fonts/inter-v7-latin-700.ttf +0 -0
- data/public/avo-assets/fonts/inter-v7-latin-700.woff +0 -0
- data/public/avo-assets/fonts/inter-v7-latin-700.woff2 +0 -0
- data/public/avo-assets/fonts/inter-v7-latin-regular.eot +0 -0
- data/public/avo-assets/fonts/inter-v7-latin-regular.svg +351 -0
- data/public/avo-assets/fonts/inter-v7-latin-regular.ttf +0 -0
- data/public/avo-assets/fonts/inter-v7-latin-regular.woff +0 -0
- data/public/avo-assets/fonts/inter-v7-latin-regular.woff2 +0 -0
- data/public/avo-assets/logo.png +0 -0
- metadata +32 -5
- data/app/assets/images/avo/logo.png +0 -0
- data/app/views/avo/partials/_profile_dropdown.html.erb +0 -25
- data/app/views/avo/sidebar/_sidebar.html.erb +0 -33
@@ -1,17 +1,23 @@
|
|
1
|
-
<%
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
1
|
+
<% if available_view_types.count > 1 %>
|
2
|
+
<%
|
3
|
+
info = {
|
4
|
+
table: {
|
5
|
+
new_view_type: 'grid',
|
6
|
+
new_icon: 'view-grid',
|
7
|
+
translation_key: 'avo.grid_view',
|
8
|
+
},
|
9
|
+
grid: {
|
10
|
+
new_view_type: 'table',
|
11
|
+
new_icon: 'view-list',
|
12
|
+
translation_key: 'avo.table_view',
|
13
|
+
},
|
14
|
+
}
|
15
|
+
%>
|
16
|
+
<div class="flex">
|
17
|
+
<% available_view_types.each do |type| %>
|
18
|
+
<%= a_link params.permit!.merge(view_type: type), color: :secondary, variant: :outlined, class: view_type.to_s == type.to_s ? 'bg-gray-200' : '', 'data-turbo-frame': turbo_frame, title: t('avo.switch_to_view', view_type: type), 'data-tippy': 'tooltip' do %>
|
19
|
+
<%= svg info[type][:new_icon] %>
|
20
|
+
<% end %>
|
21
|
+
<% end %>
|
22
|
+
</div>
|
17
23
|
<% end %>
|
@@ -17,24 +17,14 @@
|
|
17
17
|
<%= stylesheet_link_tag "avo", "data-turbo-track": "reload", defer: true %>
|
18
18
|
<% end %>
|
19
19
|
</head>
|
20
|
-
<body class="bg-
|
20
|
+
<body class="bg-gray-100 os-mac">
|
21
21
|
|
22
22
|
<div id="app" class="flex min-h-screen flex-row h-full">
|
23
23
|
<div class="flex flex-1 w-full">
|
24
|
-
<%= render partial: 'avo/
|
24
|
+
<%= render partial: 'avo/partials/sidebar' %>
|
25
25
|
|
26
26
|
<div class="flex-1 flex flex-col h-full overflow-auto">
|
27
|
-
|
28
|
-
<div>
|
29
|
-
<%= render partial: "avo/partials/header" %>
|
30
|
-
</div>
|
31
|
-
<div class="flex-1 flex ml-4 pl-4">
|
32
|
-
<%= render partial: "avo/partials/global_search" if ::Avo::App.license.has_with_trial(:global_search) && ::Avo.configuration.feature_enabled?(:global_search) %>
|
33
|
-
</div>
|
34
|
-
<div class="align-end">
|
35
|
-
<%= render partial: "avo/partials/profile_dropdown" %>
|
36
|
-
</div>
|
37
|
-
</div>
|
27
|
+
<%= render partial: "avo/partials/navbar" %>
|
38
28
|
|
39
29
|
<div class="content p-8 flex-1 flex flex-col justify-between items-stretch <%= @container_classes %>">
|
40
30
|
<%= render partial: "avo/partials/custom_tools_alert" if @custom_tools_alert_visible %>
|
data/db/factories.rb
CHANGED
@@ -58,11 +58,15 @@ FactoryBot.define do
|
|
58
58
|
type { "Spouse" }
|
59
59
|
end
|
60
60
|
|
61
|
+
factory :fish do
|
62
|
+
name { %w[Tilapia Salmon Trout Catfish Pangasius Carp].sample }
|
63
|
+
end
|
64
|
+
|
61
65
|
factory :course do
|
62
|
-
name { Faker::
|
66
|
+
name { Faker::Educator.unique.course_name }
|
63
67
|
end
|
64
68
|
|
65
|
-
factory :
|
66
|
-
|
69
|
+
factory :course_link, class: "Course::Link" do
|
70
|
+
link { Faker::Internet.url }
|
67
71
|
end
|
68
72
|
end
|
data/lib/avo/app.rb
CHANGED
@@ -133,9 +133,10 @@ module Avo
|
|
133
133
|
end
|
134
134
|
|
135
135
|
def resources_navigation(user = nil)
|
136
|
-
get_available_resources(user)
|
137
|
-
resource
|
138
|
-
|
136
|
+
get_available_resources(user)
|
137
|
+
.select do |resource|
|
138
|
+
resource.model_class.present?
|
139
|
+
end
|
139
140
|
.select do |resource|
|
140
141
|
resource.visible_on_sidebar
|
141
142
|
end
|
data/lib/avo/base_resource.rb
CHANGED
@@ -6,7 +6,7 @@ module Avo
|
|
6
6
|
|
7
7
|
include ActionView::Helpers::UrlHelper
|
8
8
|
|
9
|
-
delegate :view_context, to:
|
9
|
+
delegate :view_context, to: "Avo::App"
|
10
10
|
delegate :main_app, to: :view_context
|
11
11
|
delegate :avo, to: :view_context
|
12
12
|
delegate :resource_path, to: :view_context
|
@@ -21,7 +21,7 @@ module Avo
|
|
21
21
|
class_attribute :title, default: :id
|
22
22
|
class_attribute :description, default: :id
|
23
23
|
class_attribute :search_query, default: nil
|
24
|
-
class_attribute :search_query_help, default:
|
24
|
+
class_attribute :search_query_help, default: ""
|
25
25
|
class_attribute :includes, default: []
|
26
26
|
class_attribute :model_class
|
27
27
|
class_attribute :translation_key
|
@@ -60,7 +60,7 @@ module Avo
|
|
60
60
|
# This is the search_query scope
|
61
61
|
# This should be removed and passed to the search block
|
62
62
|
def scope
|
63
|
-
|
63
|
+
query_scope
|
64
64
|
end
|
65
65
|
|
66
66
|
# This resolves the scope when doing "where" queries (not find queries)
|
@@ -128,17 +128,19 @@ module Avo
|
|
128
128
|
end
|
129
129
|
.select do |field|
|
130
130
|
# Strip out the reflection field in index queries with a parent association.
|
131
|
-
if reflection.present?
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
131
|
+
if reflection.present?
|
132
|
+
if reflection.options.present? &&
|
133
|
+
field.respond_to?(:polymorphic_as) &&
|
134
|
+
field.polymorphic_as.to_s == reflection.options[:as].to_s
|
135
|
+
next
|
136
|
+
end
|
137
|
+
|
138
|
+
if field.respond_to?(:foreign_key) &&
|
139
|
+
reflection.respond_to?(:foreign_key) &&
|
140
|
+
reflection.foreign_key != field.foreign_key &&
|
141
|
+
@params[:resource_name] == field.resource.model_key
|
142
|
+
next
|
143
|
+
end
|
142
144
|
end
|
143
145
|
|
144
146
|
true
|
data/lib/avo/version.rb
CHANGED