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.

Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -3
  3. data/app/assets/images/avo/logo.png +0 -0
  4. data/app/assets/stylesheets/avo.css +1 -1
  5. data/app/assets/stylesheets/css/fonts.css +0 -53
  6. data/app/assets/stylesheets/css/pagination.css +9 -9
  7. data/app/assets/stylesheets/css/search.css +2 -3
  8. data/app/components/avo/fields/boolean_field/index_component.html.erb +1 -1
  9. data/app/components/avo/index/field_wrapper_component.html.erb +2 -8
  10. data/app/components/avo/index/field_wrapper_component.rb +1 -2
  11. data/app/components/avo/index/resource_table_component.html.erb +3 -3
  12. data/app/components/avo/index/table_row_component.html.erb +1 -1
  13. data/app/components/avo/navigation_heading_component.html.erb +2 -2
  14. data/app/components/avo/navigation_heading_component.rb +1 -5
  15. data/app/components/avo/navigation_link_component.html.erb +2 -2
  16. data/app/components/avo/navigation_link_component.rb +2 -6
  17. data/app/components/avo/panel_component.html.erb +3 -5
  18. data/app/components/avo/views/resource_index_component.html.erb +7 -8
  19. data/app/components/avo/views/resource_show_component.html.erb +0 -10
  20. data/app/controllers/avo/application_controller.rb +16 -14
  21. data/app/controllers/avo/base_controller.rb +1 -4
  22. data/app/helpers/avo/application_helper.rb +5 -7
  23. data/app/helpers/avo/resources_helper.rb +2 -2
  24. data/app/views/avo/base/_actions.html.erb +3 -4
  25. data/app/views/avo/base/_filters.html.erb +1 -3
  26. data/app/views/avo/partials/_global_search.html.erb +2 -2
  27. data/app/views/avo/partials/_logo.html.erb +1 -1
  28. data/app/views/avo/partials/_paginator.html.erb +3 -4
  29. data/app/views/avo/partials/_profile_dropdown.html.erb +25 -0
  30. data/app/views/avo/partials/_resource_search.html.erb +1 -1
  31. data/app/views/avo/partials/_table_header.html.erb +3 -3
  32. data/app/views/avo/partials/_view_toggle_button.html.erb +16 -22
  33. data/app/views/avo/{partials → sidebar}/_sidebar.html.erb +10 -14
  34. data/app/views/layouts/avo/application.html.erb +13 -3
  35. data/lib/avo/app.rb +3 -4
  36. data/lib/avo/fields/key_value_field.rb +28 -8
  37. data/lib/avo/version.rb +1 -1
  38. data/lib/generators/avo/templates/locales/avo.en.yml +1 -0
  39. data/lib/generators/avo/templates/locales/avo.nb-NO.yml +1 -0
  40. data/lib/generators/avo/templates/locales/avo.pt-BR.yml +1 -0
  41. data/lib/generators/avo/templates/locales/avo.ro.yml +1 -0
  42. data/public/avo-assets/avo.css +224 -405
  43. data/public/avo-assets/logo.png +0 -0
  44. metadata +7 -37
  45. data/app/assets/builds/avo.css +0 -8787
  46. data/app/assets/builds/avo.js +0 -87848
  47. data/app/assets/builds/avo.js.map +0 -7
  48. data/app/assets/svgs/dashboards-icon.svg +0 -6
  49. data/app/assets/svgs/resources-icon.svg +0 -13
  50. data/app/assets/svgs/three-dots.svg +0 -5
  51. data/app/assets/svgs/tools-icon.svg +0 -3
  52. data/app/components/avo/button_component.html.erb +0 -1
  53. data/app/components/avo/button_component.rb +0 -111
  54. data/app/components/avo/sidebar_profile_component.html.erb +0 -28
  55. data/app/components/avo/sidebar_profile_component.rb +0 -43
  56. data/app/views/avo/partials/_navbar.html.erb +0 -11
  57. data/public/avo-assets/fonts/inter-v7-latin-500.eot +0 -0
  58. data/public/avo-assets/fonts/inter-v7-latin-500.svg +0 -351
  59. data/public/avo-assets/fonts/inter-v7-latin-500.ttf +0 -0
  60. data/public/avo-assets/fonts/inter-v7-latin-500.woff +0 -0
  61. data/public/avo-assets/fonts/inter-v7-latin-500.woff2 +0 -0
  62. data/public/avo-assets/fonts/inter-v7-latin-600.eot +0 -0
  63. data/public/avo-assets/fonts/inter-v7-latin-600.svg +0 -351
  64. data/public/avo-assets/fonts/inter-v7-latin-600.ttf +0 -0
  65. data/public/avo-assets/fonts/inter-v7-latin-600.woff +0 -0
  66. data/public/avo-assets/fonts/inter-v7-latin-600.woff2 +0 -0
  67. data/public/avo-assets/fonts/inter-v7-latin-700.eot +0 -0
  68. data/public/avo-assets/fonts/inter-v7-latin-700.svg +0 -352
  69. data/public/avo-assets/fonts/inter-v7-latin-700.ttf +0 -0
  70. data/public/avo-assets/fonts/inter-v7-latin-700.woff +0 -0
  71. data/public/avo-assets/fonts/inter-v7-latin-700.woff2 +0 -0
  72. data/public/avo-assets/fonts/inter-v7-latin-regular.eot +0 -0
  73. data/public/avo-assets/fonts/inter-v7-latin-regular.svg +0 -351
  74. data/public/avo-assets/fonts/inter-v7-latin-regular.ttf +0 -0
  75. data/public/avo-assets/fonts/inter-v7-latin-regular.woff +0 -0
  76. data/public/avo-assets/fonts/inter-v7-latin-regular.woff2 +0 -0
@@ -1,5 +1,5 @@
1
1
 
2
- <thead class="bg-white border-b border-gray-200 pb-1">
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-gray-500 tracking-tight leading-tight text-sm font-semibold"
31
+ classes = "text-slate-600 tracking-tight leading-tight text-xs font-semibold"
32
32
  %>
33
- <th class="text-left uppercase px-3 py-6 whitespace-nowrap">
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
- <% 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>
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-72 z-50 border-r">
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="space-y-2">
7
- <div class="w-full">
8
- <%= render Avo::NavigationLinkComponent.new label: 'Get started', path: avo.root_path, active: :exclusive if Rails.env.development? && Avo.configuration.home_path.nil? %>
9
- </div>
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
- <div class="w-full">
19
- <% tools = Avo::App.get_sidebar_partials %>
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
- <% tools.each do |partial| %>
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-gray-100 os-mac">
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/partials/sidebar' %>
24
+ <%= render partial: 'avo/sidebar/sidebar' %>
25
25
 
26
26
  <div class="flex-1 flex flex-col h-full overflow-auto">
27
- <%= render partial: "avo/partials/navbar" %>
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
- .select do |resource|
138
- resource.model_class.present?
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].present? ? args[:key_label].to_s : I18n.translate('avo.key_value_field.key')
19
- @value_label = args[:value_label].present? ? args[:value_label].to_s : I18n.translate('avo.key_value_field.value')
20
- @action_text = args[:action_text].present? ? args[:action_text].to_s : I18n.translate('avo.key_value_field.add_row')
21
- @delete_text = args[:delete_text].present? ? args[:delete_text].to_s : I18n.translate('avo.key_value_field.delete_row')
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
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "1.22.0.pre.1"
2
+ VERSION = "1.22.0"
3
3
  end
@@ -94,3 +94,4 @@ en:
94
94
  was_successfully_created: 'was successfully created'
95
95
  was_successfully_updated: 'was successfully updated'
96
96
  clear_value: "Clear value"
97
+ tools: Tools
@@ -81,3 +81,4 @@ nb-NO:
81
81
  search_placeholder: 'Søk'
82
82
  search_cancel_button: 'Avbryt'
83
83
  sign_out: 'Logg ut'
84
+ tools: Redskapene
@@ -83,3 +83,4 @@ pt-BR:
83
83
  placeholder: 'Procurar'
84
84
  cancel_button: 'Cancelar'
85
85
  sign_out: 'sair'
86
+ tools: Ferramentas
@@ -78,3 +78,4 @@ ro:
78
78
  delete_row: 'Sterge rand'
79
79
  was_successfully_created: 'a fost creat'
80
80
  was_successfully_updated: 'a fost actualizat'
81
+ tools: Instrumente