avo 1.21.1.pre.1 → 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.

Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +57 -57
  3. data/README.md +1 -1
  4. data/app/assets/builds/avo.css +405 -224
  5. data/app/assets/builds/avo.js +16 -6
  6. data/app/assets/builds/avo.js.map +2 -2
  7. data/app/assets/stylesheets/avo.css +1 -1
  8. data/app/assets/stylesheets/css/fonts.css +53 -0
  9. data/app/assets/stylesheets/css/pagination.css +9 -9
  10. data/app/assets/stylesheets/css/search.css +3 -2
  11. data/app/assets/svgs/dashboards-icon.svg +6 -0
  12. data/app/assets/svgs/resources-icon.svg +13 -0
  13. data/app/assets/svgs/three-dots.svg +5 -0
  14. data/app/assets/svgs/tools-icon.svg +3 -0
  15. data/app/components/avo/button_component.html.erb +1 -0
  16. data/app/components/avo/button_component.rb +111 -0
  17. data/app/components/avo/fields/belongs_to_field/autocomplete_component.html.erb +14 -7
  18. data/app/components/avo/fields/belongs_to_field/autocomplete_component.rb +47 -3
  19. data/app/components/avo/fields/belongs_to_field/edit_component.html.erb +19 -4
  20. data/app/components/avo/fields/belongs_to_field/edit_component.rb +37 -0
  21. data/app/components/avo/fields/boolean_field/index_component.html.erb +1 -1
  22. data/app/components/avo/index/field_wrapper_component.html.erb +8 -2
  23. data/app/components/avo/index/field_wrapper_component.rb +2 -1
  24. data/app/components/avo/index/resource_table_component.html.erb +3 -3
  25. data/app/components/avo/index/table_row_component.html.erb +1 -1
  26. data/app/components/avo/navigation_heading_component.html.erb +2 -2
  27. data/app/components/avo/navigation_heading_component.rb +5 -1
  28. data/app/components/avo/navigation_link_component.html.erb +2 -2
  29. data/app/components/avo/navigation_link_component.rb +5 -0
  30. data/app/components/avo/panel_component.html.erb +5 -3
  31. data/app/components/avo/sidebar_profile_component.html.erb +28 -0
  32. data/app/components/avo/sidebar_profile_component.rb +43 -0
  33. data/app/components/avo/views/resource_index_component.html.erb +8 -7
  34. data/app/components/avo/views/resource_show_component.html.erb +10 -0
  35. data/app/controllers/avo/application_controller.rb +1 -1
  36. data/app/helpers/avo/application_helper.rb +7 -5
  37. data/app/helpers/avo/resources_helper.rb +2 -2
  38. data/app/javascript/js/controllers/fields/date_field_controller.js +10 -2
  39. data/app/javascript/js/controllers/item_selector_controller.js +29 -19
  40. data/app/javascript/js/controllers/search_controller.js +8 -3
  41. data/app/views/avo/base/_actions.html.erb +4 -3
  42. data/app/views/avo/base/_filters.html.erb +3 -1
  43. data/app/views/avo/partials/_global_search.html.erb +2 -2
  44. data/app/views/avo/partials/_logo.html.erb +3 -1
  45. data/app/views/avo/partials/_navbar.html.erb +11 -0
  46. data/app/views/avo/partials/_paginator.html.erb +4 -3
  47. data/app/views/avo/partials/_resource_search.html.erb +1 -1
  48. data/app/views/avo/partials/_sidebar.html.erb +35 -0
  49. data/app/views/avo/partials/_table_header.html.erb +3 -3
  50. data/app/views/avo/partials/_turbo_frame_wrap.html.erb +7 -1
  51. data/app/views/avo/partials/_view_toggle_button.html.erb +22 -16
  52. data/app/views/layouts/avo/application.html.erb +3 -13
  53. data/db/factories.rb +7 -3
  54. data/lib/avo/app.rb +4 -3
  55. data/lib/avo/base_resource.rb +16 -14
  56. data/lib/avo/version.rb +1 -1
  57. data/public/avo-assets/avo.css +405 -224
  58. data/public/avo-assets/avo.js +16 -6
  59. data/public/avo-assets/avo.js.map +2 -2
  60. data/public/avo-assets/fonts/inter-v7-latin-500.eot +0 -0
  61. data/public/avo-assets/fonts/inter-v7-latin-500.svg +351 -0
  62. data/public/avo-assets/fonts/inter-v7-latin-500.ttf +0 -0
  63. data/public/avo-assets/fonts/inter-v7-latin-500.woff +0 -0
  64. data/public/avo-assets/fonts/inter-v7-latin-500.woff2 +0 -0
  65. data/public/avo-assets/fonts/inter-v7-latin-600.eot +0 -0
  66. data/public/avo-assets/fonts/inter-v7-latin-600.svg +351 -0
  67. data/public/avo-assets/fonts/inter-v7-latin-600.ttf +0 -0
  68. data/public/avo-assets/fonts/inter-v7-latin-600.woff +0 -0
  69. data/public/avo-assets/fonts/inter-v7-latin-600.woff2 +0 -0
  70. data/public/avo-assets/fonts/inter-v7-latin-700.eot +0 -0
  71. data/public/avo-assets/fonts/inter-v7-latin-700.svg +352 -0
  72. data/public/avo-assets/fonts/inter-v7-latin-700.ttf +0 -0
  73. data/public/avo-assets/fonts/inter-v7-latin-700.woff +0 -0
  74. data/public/avo-assets/fonts/inter-v7-latin-700.woff2 +0 -0
  75. data/public/avo-assets/fonts/inter-v7-latin-regular.eot +0 -0
  76. data/public/avo-assets/fonts/inter-v7-latin-regular.svg +351 -0
  77. data/public/avo-assets/fonts/inter-v7-latin-regular.ttf +0 -0
  78. data/public/avo-assets/fonts/inter-v7-latin-regular.woff +0 -0
  79. data/public/avo-assets/fonts/inter-v7-latin-regular.woff2 +0 -0
  80. data/public/avo-assets/logo.png +0 -0
  81. metadata +32 -5
  82. data/app/assets/images/avo/logo.png +0 -0
  83. data/app/views/avo/partials/_profile_dropdown.html.erb +0 -25
  84. data/app/views/avo/sidebar/_sidebar.html.erb +0 -33
@@ -6,7 +6,7 @@ module Avo
6
6
 
7
7
  include ActionView::Helpers::UrlHelper
8
8
 
9
- delegate :view_context, to: 'Avo::App'
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
- self.query_scope
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
- 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
- if field.respond_to?(:foreign_key) &&
138
- reflection.present? &&
139
- reflection.respond_to?(:foreign_key) &&
140
- reflection.foreign_key != field.foreign_key
141
- next
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
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "1.21.1.pre.1"
2
+ VERSION = "1.22.0.pre.1"
3
3
  end