avo 2.13.2.pre.2 → 2.13.3.pre.3

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 (110) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +5 -3
  3. data/app/assets/stylesheets/avo.css +1 -1
  4. data/app/assets/stylesheets/css/fields/progress.css +3 -3
  5. data/app/assets/stylesheets/css/pagination.css +4 -0
  6. data/app/assets/stylesheets/css/search.css +1 -1
  7. data/app/assets/stylesheets/css/sidebar.css +1 -1
  8. data/app/assets/stylesheets/css/tags.css +0 -7
  9. data/app/assets/svgs/arrow-circle-right.svg +1 -1
  10. data/app/assets/svgs/arrow-down.svg +1 -1
  11. data/app/assets/svgs/arrow-up.svg +1 -1
  12. data/app/assets/svgs/bell.svg +1 -1
  13. data/app/assets/svgs/chevron-right.svg +1 -1
  14. data/app/assets/svgs/exclamation.svg +1 -1
  15. data/app/assets/svgs/failed_to_load.svg +5 -4
  16. data/app/assets/svgs/grid-empty-state.svg +11 -10
  17. data/app/assets/svgs/information-circle.svg +1 -1
  18. data/app/assets/svgs/logout.svg +1 -1
  19. data/app/assets/svgs/menu.svg +1 -1
  20. data/app/assets/svgs/play.svg +1 -1
  21. data/app/assets/svgs/switch-vertical.svg +1 -1
  22. data/app/assets/svgs/table-empty-state.svg +12 -11
  23. data/app/assets/svgs/user-circle.svg +1 -1
  24. data/app/assets/svgs/x.svg +1 -1
  25. data/app/components/avo/actions_component.html.erb +2 -2
  26. data/app/components/avo/actions_component.rb +1 -1
  27. data/app/components/avo/button_component.html.erb +1 -0
  28. data/app/components/avo/button_component.rb +3 -3
  29. data/app/components/avo/card_component.html.erb +12 -11
  30. data/app/components/avo/common_field_wrapper_component.html.erb +1 -1
  31. data/app/components/avo/fields/belongs_to_field/edit_component.rb +1 -1
  32. data/app/components/avo/fields/boolean_field/edit_component.html.erb +2 -2
  33. data/app/components/avo/fields/boolean_group_field/edit_component.html.erb +1 -1
  34. data/app/components/avo/fields/code_field/edit_component.html.erb +2 -2
  35. data/app/components/avo/fields/country_field/edit_component.html.erb +1 -1
  36. data/app/components/avo/fields/date_field/edit_component.html.erb +2 -2
  37. data/app/components/avo/fields/date_time_field/edit_component.html.erb +2 -2
  38. data/app/components/avo/fields/external_image_field/edit_component.html.erb +1 -1
  39. data/app/components/avo/fields/file_field/edit_component.html.erb +1 -1
  40. data/app/components/avo/fields/files_field/edit_component.html.erb +1 -1
  41. data/app/components/avo/fields/has_one_field/show_component.html.erb +1 -1
  42. data/app/components/avo/fields/markdown_field/edit_component.html.erb +1 -1
  43. data/app/components/avo/fields/markdown_field/show_component.html.erb +1 -1
  44. data/app/components/avo/fields/number_field/edit_component.html.erb +1 -1
  45. data/app/components/avo/fields/password_field/edit_component.html.erb +1 -1
  46. data/app/components/avo/fields/progress_bar_field/edit_component.html.erb +1 -1
  47. data/app/components/avo/fields/progress_bar_field/index_component.html.erb +1 -1
  48. data/app/components/avo/fields/progress_bar_field/show_component.html.erb +1 -1
  49. data/app/components/avo/fields/select_field/edit_component.html.erb +1 -1
  50. data/app/components/avo/fields/status_field/edit_component.html.erb +1 -1
  51. data/app/components/avo/fields/tags_field/edit_component.html.erb +3 -3
  52. data/app/components/avo/fields/tags_field/show_component.rb +0 -2
  53. data/app/components/avo/fields/text_field/edit_component.html.erb +1 -1
  54. data/app/components/avo/fields/textarea_field/edit_component.html.erb +1 -1
  55. data/app/components/avo/fields/trix_field/edit_component.html.erb +1 -1
  56. data/app/components/avo/profile_item_component.html.erb +1 -1
  57. data/app/components/avo/resource_component.rb +23 -0
  58. data/app/components/avo/tab_group_component.html.erb +1 -1
  59. data/app/components/avo/tab_switcher_component.rb +2 -2
  60. data/app/components/avo/views/resource_edit_component.html.erb +3 -1
  61. data/app/components/avo/views/resource_edit_component.rb +1 -1
  62. data/app/components/avo/views/resource_index_component.html.erb +2 -2
  63. data/app/components/avo/views/resource_index_component.rb +17 -23
  64. data/app/components/avo/views/resource_show_component.html.erb +7 -4
  65. data/app/components/avo/views/resource_show_component.rb +8 -0
  66. data/app/controllers/avo/base_controller.rb +87 -33
  67. data/app/controllers/avo/search_controller.rb +57 -20
  68. data/app/helpers/avo/actions_helper.rb +4 -0
  69. data/app/helpers/avo/application_helper.rb +36 -44
  70. data/app/helpers/avo/attachments_helper.rb +4 -0
  71. data/app/helpers/avo/resources_helper.rb +2 -2
  72. data/app/javascript/avo.js +1 -0
  73. data/app/javascript/js/controllers/fields/trix_field_controller.js +3 -4
  74. data/app/javascript/js/controllers/item_selector_controller.js +1 -1
  75. data/app/javascript/js/controllers/menu_controller.js +2 -2
  76. data/app/javascript/js/controllers/search_controller.js +42 -15
  77. data/app/views/avo/associations/new.html.erb +3 -2
  78. data/app/views/avo/base/_multiple_select_filter.html.erb +1 -1
  79. data/app/views/avo/base/_text_filter.html.erb +1 -1
  80. data/app/views/avo/partials/_header.html.erb +1 -1
  81. data/app/views/avo/partials/_logo.html.erb +2 -2
  82. data/app/views/avo/partials/_resource_search.html.erb +6 -0
  83. data/app/views/avo/private/_links_and_buttons.html.erb +1 -1
  84. data/app/views/avo/private/design.html.erb +3 -3
  85. data/app/views/kaminari/_first_page.html.erb +3 -0
  86. data/app/views/kaminari/_last_page.html.erb +3 -0
  87. data/app/views/kaminari/_next_page.html.erb +9 -0
  88. data/app/views/kaminari/_page.html.erb +12 -0
  89. data/app/views/kaminari/_prev_page.html.erb +9 -0
  90. data/app/views/layouts/avo/application.html.erb +1 -1
  91. data/avo.gemspec +1 -0
  92. data/lib/avo/concerns/has_editable_controls.rb +1 -1
  93. data/lib/avo/configuration.rb +0 -5
  94. data/lib/avo/dashboards/chartkick_card.rb +1 -1
  95. data/lib/avo/engine.rb +3 -0
  96. data/lib/avo/fields/base_field.rb +2 -1
  97. data/lib/avo/fields/concerns/is_readonly.rb +17 -0
  98. data/lib/avo/fields/has_base_field.rb +2 -0
  99. data/lib/avo/hosts/search_scope_host.rb +7 -0
  100. data/lib/avo/licensing/pro_license.rb +0 -1
  101. data/lib/avo/version.rb +1 -1
  102. data/lib/generators/avo/templates/field/components/edit_component.html.erb.tt +1 -1
  103. data/lib/generators/avo/templates/initializer/avo.tt +1 -15
  104. data/lib/generators/avo/templates/resource/resource.tt +1 -1
  105. data/public/avo-assets/avo.css +248 -286
  106. data/public/avo-assets/avo.js +47 -47
  107. data/public/avo-assets/avo.js.map +2 -2
  108. metadata +25 -3
  109. data/app/views/avo/partials/_branding.html.erb +0 -5
  110. data/lib/avo/configuration/branding.rb +0 -65
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.13.2.pre.2
4
+ version: 2.13.3.pre.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Marin
@@ -235,6 +235,20 @@ dependencies:
235
235
  - - ">="
236
236
  - !ruby/object:Gem::Version
237
237
  version: '0'
238
+ - !ruby/object:Gem::Dependency
239
+ name: inline_svg
240
+ requirement: !ruby/object:Gem::Requirement
241
+ requirements:
242
+ - - ">="
243
+ - !ruby/object:Gem::Version
244
+ version: '0'
245
+ type: :runtime
246
+ prerelease: false
247
+ version_requirements: !ruby/object:Gem::Requirement
248
+ requirements:
249
+ - - ">="
250
+ - !ruby/object:Gem::Version
251
+ version: '0'
238
252
  description: Avo abstracts away the common parts of building apps, letting your engineers
239
253
  work on your app's essential components. The result is a full-featured admin panel
240
254
  that works out of the box, ready to give to your end-users.
@@ -801,6 +815,7 @@ files:
801
815
  - app/components/avo/base_component.rb
802
816
  - app/components/avo/blank_field_component.html.erb
803
817
  - app/components/avo/blank_field_component.rb
818
+ - app/components/avo/button_component.html.erb
804
819
  - app/components/avo/button_component.rb
805
820
  - app/components/avo/card_component.html.erb
806
821
  - app/components/avo/card_component.rb
@@ -1056,7 +1071,9 @@ files:
1056
1071
  - app/controllers/avo/reorder_controller.rb
1057
1072
  - app/controllers/avo/resources_controller.rb
1058
1073
  - app/controllers/avo/search_controller.rb
1074
+ - app/helpers/avo/actions_helper.rb
1059
1075
  - app/helpers/avo/application_helper.rb
1076
+ - app/helpers/avo/attachments_helper.rb
1060
1077
  - app/helpers/avo/resources_helper.rb
1061
1078
  - app/helpers/avo/url_helpers.rb
1062
1079
  - app/javascript/avo.js
@@ -1124,7 +1141,6 @@ files:
1124
1141
  - app/views/avo/home/failed_to_load.html copy.erb
1125
1142
  - app/views/avo/home/failed_to_load.html.erb
1126
1143
  - app/views/avo/home/index.html.erb
1127
- - app/views/avo/partials/_branding.html.erb
1128
1144
  - app/views/avo/partials/_custom_tools_alert.html.erb
1129
1145
  - app/views/avo/partials/_footer.html.erb
1130
1146
  - app/views/avo/partials/_global_search.html.erb
@@ -1144,6 +1160,11 @@ files:
1144
1160
  - app/views/avo/private/design.html.erb
1145
1161
  - app/views/avo/sidebar/_license_warning.html.erb
1146
1162
  - app/views/avo/sidebar/_license_warnings.html.erb
1163
+ - app/views/kaminari/_first_page.html.erb
1164
+ - app/views/kaminari/_last_page.html.erb
1165
+ - app/views/kaminari/_next_page.html.erb
1166
+ - app/views/kaminari/_page.html.erb
1167
+ - app/views/kaminari/_prev_page.html.erb
1147
1168
  - app/views/layouts/avo/_filter_wrapper.html.erb
1148
1169
  - app/views/layouts/avo/application.html.erb
1149
1170
  - avo.gemspec
@@ -1176,7 +1197,6 @@ files:
1176
1197
  - lib/avo/concerns/is_resource_item.rb
1177
1198
  - lib/avo/concerns/model_class_constantized.rb
1178
1199
  - lib/avo/configuration.rb
1179
- - lib/avo/configuration/branding.rb
1180
1200
  - lib/avo/configuration/resource_configuration.rb
1181
1201
  - lib/avo/dashboards/base_dashboard.rb
1182
1202
  - lib/avo/dashboards/base_divider.rb
@@ -1193,6 +1213,7 @@ files:
1193
1213
  - lib/avo/fields/boolean_field.rb
1194
1214
  - lib/avo/fields/boolean_group_field.rb
1195
1215
  - lib/avo/fields/code_field.rb
1216
+ - lib/avo/fields/concerns/is_readonly.rb
1196
1217
  - lib/avo/fields/concerns/is_required.rb
1197
1218
  - lib/avo/fields/country_field.rb
1198
1219
  - lib/avo/fields/date_field.rb
@@ -1238,6 +1259,7 @@ files:
1238
1259
  - lib/avo/hosts/dashboard_visibility.rb
1239
1260
  - lib/avo/hosts/ordering.rb
1240
1261
  - lib/avo/hosts/record_host.rb
1262
+ - lib/avo/hosts/search_scope_host.rb
1241
1263
  - lib/avo/hosts/view_record_host.rb
1242
1264
  - lib/avo/html/builder.rb
1243
1265
  - lib/avo/items_holder.rb
@@ -1,5 +0,0 @@
1
- <style>
2
- :root {
3
- <%= Avo.configuration.branding.css_colors %>
4
- }
5
- </style>
@@ -1,65 +0,0 @@
1
- class Avo::Configuration::Branding
2
- def initialize(colors: nil, chart_colors: nil, logo: nil, logomark: nil)
3
- @colors = colors
4
- @chart_colors = chart_colors
5
- @logo = logo
6
- @logomark = logomark
7
-
8
- @default_colors = {
9
- 100 => "206 231 248",
10
- 400 => "57 158 229",
11
- 500 => "8 134 222",
12
- 600 => "6 107 178"
13
- }
14
- @default_chart_colors = ["#0B8AE2", "#34C683", "#2AB1EE", "#34C6A8"]
15
- @default_logo = "/avo-assets/logo.png"
16
- @default_logomark = "/avo-assets/logomark.png"
17
- end
18
-
19
- def css_colors
20
- rgb_colors.map do |color, value|
21
- "--color-primary-#{color}: #{value};"
22
- end.join("\n")
23
- end
24
-
25
- def logo
26
- return @default_logo if Avo::App.license.lacks_with_trial(:branding)
27
-
28
- @logo || @default_logo
29
- end
30
-
31
- def logomark
32
- return @default_logomark if Avo::App.license.lacks_with_trial(:branding)
33
-
34
- @logomark || @default_logomark
35
- end
36
-
37
- def chart_colors
38
- return @default_chart_colors if Avo::App.license.lacks_with_trial(:branding)
39
-
40
- @chart_colors || @default_chart_colors
41
- end
42
-
43
- private
44
-
45
- def colors
46
- return @default_colors if Avo::App.license.lacks_with_trial(:branding)
47
-
48
- @colors || @default_colors
49
- end
50
-
51
- def rgb_colors
52
- colors.map do |key, value|
53
- rgb_value = is_hex?(value) ? hex_to_rgb(value) : value
54
- [key, rgb_value]
55
- end.to_h
56
- end
57
-
58
- def is_hex?(value)
59
- value.include? "#"
60
- end
61
-
62
- def hex_to_rgb(value)
63
- value.to_s.match(/^#(..)(..)(..)$/).captures.map(&:hex).join(" ")
64
- end
65
- end