avo 1.22.0.pre.1 → 1.22.0
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 -3
- data/app/assets/images/avo/logo.png +0 -0
- data/app/assets/stylesheets/avo.css +1 -1
- data/app/assets/stylesheets/css/fonts.css +0 -53
- data/app/assets/stylesheets/css/pagination.css +9 -9
- data/app/assets/stylesheets/css/search.css +2 -3
- data/app/components/avo/fields/boolean_field/index_component.html.erb +1 -1
- data/app/components/avo/index/field_wrapper_component.html.erb +2 -8
- data/app/components/avo/index/field_wrapper_component.rb +1 -2
- 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 +1 -5
- data/app/components/avo/navigation_link_component.html.erb +2 -2
- data/app/components/avo/navigation_link_component.rb +2 -6
- data/app/components/avo/panel_component.html.erb +3 -5
- data/app/components/avo/views/resource_index_component.html.erb +7 -8
- data/app/components/avo/views/resource_show_component.html.erb +0 -10
- data/app/controllers/avo/application_controller.rb +16 -14
- data/app/controllers/avo/base_controller.rb +1 -4
- data/app/helpers/avo/application_helper.rb +5 -7
- data/app/helpers/avo/resources_helper.rb +2 -2
- data/app/views/avo/base/_actions.html.erb +3 -4
- data/app/views/avo/base/_filters.html.erb +1 -3
- data/app/views/avo/partials/_global_search.html.erb +2 -2
- data/app/views/avo/partials/_logo.html.erb +1 -1
- data/app/views/avo/partials/_paginator.html.erb +3 -4
- data/app/views/avo/partials/_profile_dropdown.html.erb +25 -0
- data/app/views/avo/partials/_resource_search.html.erb +1 -1
- data/app/views/avo/partials/_table_header.html.erb +3 -3
- data/app/views/avo/partials/_view_toggle_button.html.erb +16 -22
- data/app/views/avo/{partials → sidebar}/_sidebar.html.erb +10 -14
- data/app/views/layouts/avo/application.html.erb +13 -3
- data/lib/avo/app.rb +3 -4
- data/lib/avo/fields/key_value_field.rb +28 -8
- 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-assets/avo.css +224 -405
- data/public/avo-assets/logo.png +0 -0
- metadata +7 -37
- data/app/assets/builds/avo.css +0 -8787
- data/app/assets/builds/avo.js +0 -87848
- data/app/assets/builds/avo.js.map +0 -7
- data/app/assets/svgs/dashboards-icon.svg +0 -6
- data/app/assets/svgs/resources-icon.svg +0 -13
- data/app/assets/svgs/three-dots.svg +0 -5
- data/app/assets/svgs/tools-icon.svg +0 -3
- data/app/components/avo/button_component.html.erb +0 -1
- data/app/components/avo/button_component.rb +0 -111
- data/app/components/avo/sidebar_profile_component.html.erb +0 -28
- data/app/components/avo/sidebar_profile_component.rb +0 -43
- data/app/views/avo/partials/_navbar.html.erb +0 -11
- data/public/avo-assets/fonts/inter-v7-latin-500.eot +0 -0
- data/public/avo-assets/fonts/inter-v7-latin-500.svg +0 -351
- 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 +0 -351
- 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 +0 -352
- 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 +0 -351
- 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
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
<thead class="bg-
|
2
|
+
<thead class="bg-slate-100 border-t border-b border-gray-300 pb-1">
|
3
3
|
<th>
|
4
4
|
<%== item_select_all_input %>
|
5
5
|
</th>
|
@@ -28,9 +28,9 @@
|
|
28
28
|
sort_by = field.id
|
29
29
|
sort_direction = 'desc'
|
30
30
|
end
|
31
|
-
classes = "text-
|
31
|
+
classes = "text-slate-600 tracking-tight leading-tight text-xs font-semibold"
|
32
32
|
%>
|
33
|
-
<th class="text-left uppercase px-3 py-
|
33
|
+
<th class="text-left uppercase px-3 py-2 whitespace-nowrap">
|
34
34
|
<% if field.sortable %>
|
35
35
|
<%= link_to params.permit!.merge(sort_by: sort_by, sort_direction: sort_direction), class: "flex items-center #{classes} #{'cursor-pointer' if field.sortable}", 'data-turbo-frame': params[:turbo_frame] do %>
|
36
36
|
<%= field.name %>
|
@@ -1,23 +1,17 @@
|
|
1
|
-
<%
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
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>
|
1
|
+
<%
|
2
|
+
if available_view_types.count > 1
|
3
|
+
case view_type.to_sym
|
4
|
+
when :table
|
5
|
+
new_view_type = 'grid'
|
6
|
+
new_icon = 'view-grid'
|
7
|
+
translation_key = 'avo.grid_view'
|
8
|
+
when :grid
|
9
|
+
new_view_type = 'table'
|
10
|
+
new_icon = 'view-list'
|
11
|
+
translation_key = 'avo.table_view'
|
12
|
+
end
|
13
|
+
%>
|
14
|
+
<%= a_link params.permit!.merge(view_type: new_view_type), color: :blue, 'data-turbo-frame': turbo_frame, title: t('avo.switch_to_view', view_type: new_view_type), 'data-tippy': 'tooltip' do %>
|
15
|
+
<%= svg new_icon %> <%= t translation_key, item: @resource.model_class.model_name.human.downcase %>
|
16
|
+
<% end %>
|
23
17
|
<% end %>
|
@@ -1,35 +1,31 @@
|
|
1
|
-
<div class="application-sidebar flex h-full bg-white text-white w-
|
1
|
+
<div class="application-sidebar flex h-full bg-white text-white w-56 z-50 border-r border-gray-300">
|
2
2
|
<div class="flex flex-col w-full">
|
3
3
|
<%= render partial: "avo/partials/logo" %>
|
4
4
|
|
5
5
|
<div class="flex-1 flex flex-col justify-between">
|
6
|
-
<div class="
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
<div class="tools py-4">
|
7
|
+
<%= render Avo::NavigationLinkComponent.new label: 'Get started', path: avo.root_path, active: :exclusive if Rails.env.development? && Avo.configuration.home_path.nil? %>
|
8
|
+
|
9
|
+
<%= render Avo::NavigationHeadingComponent.new label: t('avo.resources') %>
|
10
10
|
|
11
11
|
<div class="w-full">
|
12
|
-
<%= render Avo::NavigationHeadingComponent.new label: t('avo.resources'), icon: svg('resources-icon') %>
|
13
12
|
<% Avo::App.resources_navigation(_current_user).sort_by { |r| r.navigation_label }.each do |resource| %>
|
14
13
|
<%= render Avo::NavigationLinkComponent.new label: resource.navigation_label, path: resources_path(resource: resource) %>
|
15
14
|
<% end %>
|
16
|
-
</div>
|
17
15
|
|
18
|
-
|
19
|
-
<%
|
20
|
-
|
21
|
-
<% if tools.present? %>
|
22
|
-
<%= render Avo::NavigationHeadingComponent.new label: t('avo.tools'), icon: svg('tools-icon') %>
|
16
|
+
<% sidebar_partials = Avo::App.get_sidebar_partials %>
|
17
|
+
<% if sidebar_partials.present? %>
|
18
|
+
<%= render Avo::NavigationHeadingComponent.new label: t('avo.tools') %>
|
23
19
|
|
24
|
-
<%
|
20
|
+
<% sidebar_partials.each do |partial| %>
|
25
21
|
<%= render partial: "/avo/sidebar/items/#{partial}" %>
|
26
22
|
<% end %>
|
27
23
|
<% end %>
|
28
24
|
</div>
|
25
|
+
|
29
26
|
</div>
|
30
27
|
|
31
28
|
<%= render_license_warnings %>
|
32
|
-
<%= render Avo::SidebarProfileComponent.new user: _current_user %>
|
33
29
|
</div>
|
34
30
|
</div>
|
35
31
|
</div>
|
@@ -17,14 +17,24 @@
|
|
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-slate-200 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/sidebar/sidebar' %>
|
25
25
|
|
26
26
|
<div class="flex-1 flex flex-col h-full overflow-auto">
|
27
|
-
|
27
|
+
<div class="relative bg-white p-2 shadow-md h-16 w-full flex flex-shrink-0 items-center z-50 px-6" v-if="layout !== 'blank'">
|
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>
|
28
38
|
|
29
39
|
<div class="content p-8 flex-1 flex flex-col justify-between items-stretch <%= @container_classes %>">
|
30
40
|
<%= render partial: "avo/partials/custom_tools_alert" if @custom_tools_alert_visible %>
|
data/lib/avo/app.rb
CHANGED
@@ -133,10 +133,9 @@ module Avo
|
|
133
133
|
end
|
134
134
|
|
135
135
|
def resources_navigation(user = nil)
|
136
|
-
get_available_resources(user)
|
137
|
-
.
|
138
|
-
|
139
|
-
end
|
136
|
+
get_available_resources(user).select do |resource|
|
137
|
+
resource.model_class.present?
|
138
|
+
end
|
140
139
|
.select do |resource|
|
141
140
|
resource.visible_on_sidebar
|
142
141
|
end
|
@@ -3,10 +3,6 @@ require "json"
|
|
3
3
|
module Avo
|
4
4
|
module Fields
|
5
5
|
class KeyValueField < BaseField
|
6
|
-
attr_reader :key_label
|
7
|
-
attr_reader :value_label
|
8
|
-
attr_reader :action_text
|
9
|
-
attr_reader :delete_text
|
10
6
|
attr_reader :disable_editing_keys
|
11
7
|
attr_reader :disable_adding_rows
|
12
8
|
|
@@ -15,10 +11,10 @@ module Avo
|
|
15
11
|
|
16
12
|
hide_on :index
|
17
13
|
|
18
|
-
@key_label = args[:key_label]
|
19
|
-
@value_label = args[:value_label]
|
20
|
-
@action_text = args[:action_text]
|
21
|
-
@delete_text = args[:delete_text]
|
14
|
+
@key_label = args[:key_label] if args[:key_label].present?
|
15
|
+
@value_label = args[:value_label]if args[:value_label].present?
|
16
|
+
@action_text = args[:action_text] if args[:action_text].present?
|
17
|
+
@delete_text = args[:delete_text] if args[:delete_text].present?
|
22
18
|
|
23
19
|
@disable_editing_keys = args[:disable_editing_keys].present? ? args[:disable_editing_keys] : false
|
24
20
|
# disabling editing keys also disables adding rows (doesn't take into account the value of disable_adding_rows)
|
@@ -32,6 +28,30 @@ module Avo
|
|
32
28
|
@disable_deleting_rows = args[:disable_deleting_rows].present? ? args[:disable_deleting_rows] : false
|
33
29
|
end
|
34
30
|
|
31
|
+
def key_label
|
32
|
+
return @key_label if @key_label.present?
|
33
|
+
|
34
|
+
I18n.translate('avo.key_value_field.key')
|
35
|
+
end
|
36
|
+
|
37
|
+
def value_label
|
38
|
+
return @value_label if @value_label.present?
|
39
|
+
|
40
|
+
I18n.translate('avo.key_value_field.value')
|
41
|
+
end
|
42
|
+
|
43
|
+
def action_text
|
44
|
+
return @action_text if @action_text.present?
|
45
|
+
|
46
|
+
I18n.translate('avo.key_value_field.add_row')
|
47
|
+
end
|
48
|
+
|
49
|
+
def delete_text
|
50
|
+
return @delete_text if @delete_text.present?
|
51
|
+
|
52
|
+
I18n.translate('avo.key_value_field.delete_row')
|
53
|
+
end
|
54
|
+
|
35
55
|
def to_permitted_param
|
36
56
|
[:"#{id}", "#{id}": {}]
|
37
57
|
end
|
data/lib/avo/version.rb
CHANGED