avo 3.0.1.beta8 → 3.0.1.beta9

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 (42) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/app/assets/builds/avo.base.css +39 -274
  4. data/app/components/avo/field_wrapper_component.html.erb +1 -1
  5. data/app/components/avo/fields/boolean_field/index_component.html.erb +1 -1
  6. data/app/components/avo/fields/common/badge_viewer_component.html.erb +1 -25
  7. data/app/components/avo/fields/common/badge_viewer_component.rb +24 -0
  8. data/app/components/avo/fields/common/boolean_check_component.html.erb +1 -12
  9. data/app/components/avo/fields/common/boolean_check_component.rb +2 -1
  10. data/app/components/avo/fields/common/gravatar_viewer_component.html.erb +1 -1
  11. data/app/components/avo/fields/common/gravatar_viewer_component.rb +2 -2
  12. data/app/components/avo/fields/common/heading_component.html.erb +3 -8
  13. data/app/components/avo/fields/common/heading_component.rb +1 -3
  14. data/app/components/avo/fields/external_image_field/index_component.html.erb +1 -1
  15. data/app/components/avo/fields/file_field/index_component.html.erb +2 -2
  16. data/app/components/avo/fields/gravatar_field/index_component.html.erb +1 -1
  17. data/app/components/avo/fields/heading_field/edit_component.html.erb +1 -1
  18. data/app/components/avo/fields/heading_field/show_component.html.erb +1 -1
  19. data/app/components/avo/fields/id_field/index_component.html.erb +1 -1
  20. data/app/components/avo/fields/text_field/index_component.html.erb +1 -1
  21. data/app/components/avo/index/resource_table_component.rb +2 -8
  22. data/app/components/avo/views/resource_edit_component.html.erb +9 -20
  23. data/app/controllers/avo/actions_controller.rb +8 -19
  24. data/app/controllers/avo/search_controller.rb +2 -2
  25. data/lib/avo/base_action.rb +18 -23
  26. data/lib/avo/base_resource.rb +1 -1
  27. data/lib/avo/concerns/filters_session_handler.rb +3 -3
  28. data/lib/avo/concerns/has_items.rb +0 -4
  29. data/lib/avo/fields/badge_field.rb +1 -1
  30. data/lib/avo/fields/base_field.rb +12 -8
  31. data/lib/avo/fields/external_image_field.rb +2 -2
  32. data/lib/avo/fields/file_field.rb +2 -2
  33. data/lib/avo/fields/gravatar_field.rb +2 -2
  34. data/lib/avo/fields/heading_field.rb +5 -13
  35. data/lib/avo/fields/id_field.rb +2 -2
  36. data/lib/avo/fields/text_field.rb +2 -2
  37. data/lib/avo/resources/items/holder.rb +0 -6
  38. data/lib/avo/version.rb +1 -1
  39. data/lib/generators/avo/js/install_generator.rb +2 -2
  40. data/lib/generators/avo/tailwindcss/install_generator.rb +1 -1
  41. data/public/avo-assets/avo.base.css +4 -9
  42. metadata +2 -2
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Avo::Fields::Common::GravatarViewerComponent < ViewComponent::Base
4
- def initialize(md5: nil, link: nil, default: nil, size: nil, rounded: false, link_to_resource: false, title: nil)
4
+ def initialize(md5: nil, link: nil, default: nil, size: nil, rounded: false, link_to_record: false, title: nil)
5
5
  @md5 = md5
6
6
  @link = link
7
7
  @default = default
8
8
  @size = size
9
9
  @rounded = rounded
10
- @link_to_resource = link_to_resource
10
+ @link_to_record = link_to_record
11
11
  @title = title
12
12
  end
13
13
  end
@@ -1,14 +1,9 @@
1
1
  <div class="flex items-start py-1 leading-tight bg-gray-100 text-gray-500 text-xs">
2
2
  <div class="py-2 px-6 h-full w-full">
3
- <% if empty %>
4
- <% elsif value.present? %>
5
- <% if as_html %>
6
- <%= sanitize value %>
7
- <% else %>
8
- <div class="font-semibold uppercase"><%= value %></div>
9
- <% end %>
3
+ <% if as_html %>
4
+ <%= sanitize value %>
10
5
  <% else %>
11
-
6
+ <div class="font-semibold uppercase"><%= value %></div>
12
7
  <% end %>
13
8
  </div>
14
9
  </div>
@@ -3,11 +3,9 @@
3
3
  class Avo::Fields::Common::HeadingComponent < ViewComponent::Base
4
4
  attr_reader :value
5
5
  attr_reader :as_html
6
- attr_reader :empty
7
6
 
8
- def initialize(value:, as_html:, empty:)
7
+ def initialize(value:, as_html:)
9
8
  @value = value
10
9
  @as_html = as_html
11
- @empty = empty
12
10
  end
13
11
  end
@@ -1,6 +1,6 @@
1
1
  <%= index_field_wrapper **field_wrapper_args, flush: true do %>
2
2
  <% if @field.value.present? %>
3
- <%= link_to_if @field.link_to_resource.present?,
3
+ <%= link_to_if @field.link_to_record.present?,
4
4
  image_tag(@field.value,
5
5
  height: @field.height,
6
6
  style: "border-radius: #{@field.radius}px; max-height: #{@field.height}#{@field.height.to_s&.ends_with?('px') ? '' : 'px'};"),
@@ -1,9 +1,9 @@
1
1
  <%= index_field_wrapper **field_wrapper_args, flush: flush? do %>
2
2
  <% if @field.value.present? %>
3
3
  <% if @field.value.attached? && @field.value.representable? && @field.is_image %>
4
- <%= link_to_if @field.link_to_resource, image_tag(helpers.main_app.url_for(@field.value), class: 'h-10'), resource_view_path, class: 'block' %>
4
+ <%= link_to_if @field.link_to_record, image_tag(helpers.main_app.url_for(@field.value), class: 'h-10'), resource_view_path, class: 'block' %>
5
5
  <% elsif @field.value.attached? && @field.is_audio %>
6
- <%= link_to_if @field.link_to_resource, audio_tag(helpers.main_app.url_for(@field.value), controls: true, preload: false, class: 'max-h-full h-10'), resource_view_path, class: 'block h-8' %>
6
+ <%= link_to_if @field.link_to_record, audio_tag(helpers.main_app.url_for(@field.value), controls: true, preload: false, class: 'max-h-full h-10'), resource_view_path, class: 'block h-8' %>
7
7
  <% else %>
8
8
  <%= @field.value.filename %>
9
9
  <% end %>
@@ -4,7 +4,7 @@
4
4
  default: @field.default,
5
5
  size: @field.size,
6
6
  rounded: @field.rounded,
7
- link_to_resource: @field.link_to_resource,
7
+ link_to_record: @field.link_to_record,
8
8
  link: resource_view_path,
9
9
  title: t('avo.view_item', item: @resource.name).humanize
10
10
  )
@@ -1,3 +1,3 @@
1
1
  <div <% if @index == 0 %> class="overflow-hidden rounded-t" <% end %> data-field-id="<%= @field.id %>">
2
- <%= render Avo::Fields::Common::HeadingComponent.new value: @field.name, as_html: @field.as_html, empty: @field.empty %>
2
+ <%= render Avo::Fields::Common::HeadingComponent.new value: @field.value, as_html: @field.as_html %>
3
3
  </div>
@@ -1,3 +1,3 @@
1
1
  <div <% if @index == 0 %> class="overflow-hidden rounded-t" <% end %> data-field-id="<%= @field.id %>">
2
- <%= render Avo::Fields::Common::HeadingComponent.new value: @field.name, as_html: @field.as_html, empty: @field.empty %>
2
+ <%= render Avo::Fields::Common::HeadingComponent.new value: @field.value, as_html: @field.as_html %>
3
3
  </div>
@@ -1,3 +1,3 @@
1
1
  <%= index_field_wrapper **field_wrapper_args, class: 'whitespace-no-wrap w-[1%]' do %>
2
- <% link_to_if (@field.link_to_resource or Avo.configuration.id_links_to_resource), @field.value, resource_view_path, title: t('avo.view_item', item: @resource.name).humanize %>
2
+ <% link_to_if (@field.link_to_record or Avo.configuration.id_links_to_resource), @field.value, resource_view_path, title: t('avo.view_item', item: @resource.name).humanize %>
3
3
  <% end %>
@@ -4,6 +4,6 @@
4
4
  <% elsif @field.protocol.present? %>
5
5
  <%= link_to @field.value, "#{@field.protocol}:#{@field.value}" %>
6
6
  <% else %>
7
- <%= link_to_if @field.link_to_resource, @field.value, resource_view_path %>
7
+ <%= link_to_if @field.link_to_record, @field.value, resource_view_path %>
8
8
  <% end %>
9
9
  <% end %>
@@ -18,17 +18,11 @@ class Avo::Index::ResourceTableComponent < ViewComponent::Base
18
18
  def encrypted_query
19
19
  # TODO: move this to the resource where we can apply the adapter pattern
20
20
  if Module.const_defined?("Ransack::Search") && query.instance_of?(Ransack::Search)
21
- @query = query.result
21
+ @query = @query.result
22
22
  end
23
23
 
24
- return :select_all_disabled if query.nil? || !query.respond_to?(:all) || !query.all.respond_to?(:to_sql)
25
-
26
- serialized_query = query.all.to_sql
27
-
28
- return if serialized_query.nil?
29
-
30
24
  Avo::Services::EncryptionService.encrypt(
31
- message: serialized_query,
25
+ message: Marshal.dump(@query),
32
26
  purpose: :select_all
33
27
  )
34
28
  end
@@ -44,26 +44,6 @@
44
44
  <%= render sidebar_component form: form %>
45
45
  <% end %>
46
46
  <% end %>
47
- <% if Avo.configuration.buttons_on_form_footers %>
48
- <% c.with_footer_tools do %>
49
- <div class="mt-4">
50
- <%= a_link back_path,
51
- style: :text,
52
- icon: 'arrow-left' do %>
53
- <%= t('avo.cancel').capitalize %>
54
- <% end %>
55
- <% if can_see_the_save_button? %>
56
- <%= a_button color: :primary,
57
- style: :primary,
58
- loading: true,
59
- type: :submit,
60
- icon: 'save' do %>
61
- <%= t('avo.save').capitalize %>
62
- <% end %>
63
- <% end %>
64
- </div>
65
- <% end %>
66
- <% end %>
67
47
  <% end %>
68
48
  <%= content_tag :div, class: 'space-y-12' do %>
69
49
  <% @resource.get_items.each_with_index do |item, index| %>
@@ -71,6 +51,15 @@
71
51
  <%= render Avo::ItemSwitcherComponent.new resource: @resource, item: item, index: index + 1, view: view, form: form %>
72
52
  <% end %>
73
53
  <% end %>
54
+ <% if Avo.configuration.buttons_on_form_footers %>
55
+ <%= render Avo::PanelComponent.new do |c| %>
56
+ <% c.with_footer_tools do %>
57
+ <% @resource.render_edit_controls.each do |control| %>
58
+ <%= render_control control %>
59
+ <% end %>
60
+ <% end %>
61
+ <% end %>
62
+ <% end %>
74
63
  <% end %>
75
64
  <% end %>
76
65
  <% end %>
@@ -21,23 +21,13 @@ module Avo
21
21
 
22
22
  def handle
23
23
  resource_ids = action_params[:fields][:avo_resource_ids].split(",")
24
- @selected_query = action_params[:fields][:avo_selected_query]
25
24
 
26
- fields = action_params[:fields].except(:avo_resource_ids, :avo_selected_query)
27
-
28
- args = {
29
- fields: fields,
25
+ performed_action = @action.handle_action(
26
+ fields: action_params[:fields].except(:avo_resource_ids, :avo_selected_query),
30
27
  current_user: _current_user,
31
- resource: resource
32
- }
33
-
34
- args[:records] = if @selected_query.present?
35
- @resource.model_class.find_by_sql decrypted_query
36
- else
37
- @resource.find_record resource_ids, params: params
38
- end
39
-
40
- performed_action = @action.handle_action(**args)
28
+ resource: resource,
29
+ query: decrypted_query || @resource.find_record(resource_ids, params: params)
30
+ )
41
31
 
42
32
  respond performed_action.response
43
33
  end
@@ -106,10 +96,9 @@ module Avo
106
96
  end
107
97
 
108
98
  def decrypted_query
109
- Avo::Services::EncryptionService.decrypt(
110
- message: @selected_query,
111
- purpose: :select_all
112
- )
99
+ return if (encrypted_query = action_params[:fields][:avo_selected_query]).blank?
100
+
101
+ Marshal.load(Avo::Services::EncryptionService.decrypt(message: encrypted_query, purpose: :select_all))
113
102
  end
114
103
 
115
104
  def decrypted_arguments
@@ -42,14 +42,14 @@ module Avo
42
42
  query: resource.query_scope
43
43
  ).handle
44
44
 
45
+ query = apply_scope(query) if should_apply_any_scope?
46
+
45
47
  # Get the count
46
48
  results_count = query.reselect(resource.model_class.primary_key).count
47
49
 
48
50
  # Get the results
49
51
  query = query.limit(8)
50
52
 
51
- query = apply_scope(query) if should_apply_any_scope?
52
-
53
53
  results = apply_search_metadata(query, resource)
54
54
 
55
55
  header = resource.plural_name
@@ -101,39 +101,34 @@ module Avo
101
101
  end
102
102
 
103
103
  def handle_action(**args)
104
- records, fields, current_user, resource = args.values_at(:records, :fields, :current_user, :resource)
105
- # Fetching the field definitions and not the actual fields (get_fields) because they will break if the user uses a `visible` block and adds a condition using the `params` variable. The params are different in the show method and the handle method.
106
- action_fields = get_field_definitions.map { |field| [field.id, field] }.to_h
107
-
108
- # For some fields, like belongs_to, the id and database_id differ (user vs user_id).
109
- # That's why we need to fetch the database_id for when we process the action.
110
- action_fields_by_database_id = action_fields.map do |id, value|
111
- [value.database_id.to_sym, value]
112
- end.to_h
104
+ processed_fields = if args[:fields].present?
105
+ # Fetching the field definitions and not the actual fields (get_fields) because they will break if the user uses a `visible` block and adds a condition using the `params` variable. The params are different in the show method and the handle method.
106
+ action_fields = get_field_definitions.map { |field| [field.id, field] }.to_h
107
+
108
+ # For some fields, like belongs_to, the id and database_id differ (user vs user_id).
109
+ # That's why we need to fetch the database_id for when we process the action.
110
+ action_fields_by_database_id = action_fields.map do |id, value|
111
+ [value.database_id.to_sym, value]
112
+ end.to_h
113
113
 
114
- if fields.present?
115
- processed_fields = fields.to_unsafe_h.map do |name, value|
114
+ args[:fields].to_unsafe_h.map do |name, value|
116
115
  field = action_fields_by_database_id[name.to_sym]
117
116
 
118
117
  next if field.blank?
119
118
 
120
119
  [name, field.resolve_attribute(value)]
121
- end
122
-
123
- processed_fields = processed_fields.reject(&:blank?).to_h
120
+ end.reject(&:blank?).to_h
124
121
  else
125
- processed_fields = {}
122
+ {}
126
123
  end
127
124
 
128
- args = {
125
+ handle(
129
126
  fields: processed_fields.with_indifferent_access,
130
- current_user: current_user,
131
- resource: resource
132
- }
133
-
134
- args[:records] = records
135
-
136
- handle(**args)
127
+ current_user: args[:current_user],
128
+ resource: args[:resource],
129
+ records: args[:query],
130
+ query: args[:query]
131
+ )
137
132
 
138
133
  self
139
134
  end
@@ -446,7 +446,7 @@ module Avo
446
446
  def hydrate_model_with_default_values
447
447
  default_values = get_fields
448
448
  .select do |field|
449
- !field.computed
449
+ !field.computed && !field.is_a?(Avo::Fields::HeadingField)
450
450
  end
451
451
  .map do |field|
452
452
  value = field.value
@@ -26,16 +26,16 @@ module Avo
26
26
  end
27
27
 
28
28
  def filters_session_key
29
- @filters_session_key ||= '/filters/' << %w[
29
+ @filters_session_key ||= "/filters/" << %w[
30
30
  turbo_frame controller resource_name related_name
31
31
  action id
32
- ].map { |key| params[key] }.compact.join('/')
32
+ ].map { |key| params[key] }.compact.join("/")
33
33
  end
34
34
 
35
35
  def cache_resource_filters?
36
36
  Avo::ExecutionContext.new(
37
37
  target: Avo.configuration.cache_resource_filters,
38
- current_user: current_user,
38
+ current_user: _current_user,
39
39
  resource: @resource
40
40
  ).handle
41
41
  end
@@ -30,10 +30,6 @@ module Avo
30
30
  deprecated_dsl_api __method__, "fields"
31
31
  end
32
32
 
33
- def heading(body, **args)
34
- deprecated_dsl_api __method__, "fields"
35
- end
36
-
37
33
  def sidebar(**args, &block)
38
34
  deprecated_dsl_api __method__, "fields"
39
35
  end
@@ -8,7 +8,7 @@ module Avo
8
8
 
9
9
  hide_on [:edit, :new]
10
10
 
11
- default_options = {info: :info, success: :success, danger: :danger, warning: :warning, secondary: :secondary}
11
+ default_options = {info: :info, success: :success, danger: :danger, warning: :warning, neutral: :neutral}
12
12
  @options = args[:options].present? ? default_options.merge(args[:options]) : default_options
13
13
  end
14
14
  end
@@ -158,14 +158,7 @@ module Avo
158
158
 
159
159
  # Run computable callback block if present
160
160
  if computable && block.present?
161
- final_value = Avo::ExecutionContext.new(
162
- target: block,
163
- record: record,
164
- resource: @resource,
165
- view: @view,
166
- field: self,
167
- include: self.class.included_modules
168
- ).handle
161
+ final_value = execute_block
169
162
  end
170
163
 
171
164
  # Run the value through resolver if present
@@ -184,6 +177,17 @@ module Avo
184
177
  final_value
185
178
  end
186
179
 
180
+ def execute_block
181
+ Avo::ExecutionContext.new(
182
+ target: block,
183
+ record: record,
184
+ resource: resource,
185
+ view: view,
186
+ field: self,
187
+ include: self.class.included_modules
188
+ ).handle
189
+ end
190
+
187
191
  # Fills the record with the received value on create and update actions.
188
192
  def fill_field(record, key, value, params)
189
193
  return record unless record.methods.include? key.to_sym
@@ -4,12 +4,12 @@ module Avo
4
4
  attr_reader :width
5
5
  attr_reader :height
6
6
  attr_reader :radius
7
- attr_reader :link_to_resource
7
+ attr_reader :link_to_record
8
8
 
9
9
  def initialize(id, **args, &block)
10
10
  super(id, **args, &block)
11
11
 
12
- @link_to_resource = args[:link_to_resource].present? ? args[:link_to_resource] : false
12
+ @link_to_record = args[:link_to_record].present? ? args[:link_to_record] : false
13
13
 
14
14
  @width = args[:width].present? ? args[:width] : 40
15
15
  @height = args[:height].present? ? args[:height] : 40
@@ -1,7 +1,7 @@
1
1
  module Avo
2
2
  module Fields
3
3
  class FileField < BaseField
4
- attr_accessor :link_to_resource
4
+ attr_accessor :link_to_record
5
5
  attr_accessor :is_avatar
6
6
  attr_accessor :is_image
7
7
  attr_accessor :is_audio
@@ -12,7 +12,7 @@ module Avo
12
12
  def initialize(id, **args, &block)
13
13
  super(id, **args, &block)
14
14
 
15
- @link_to_resource = args[:link_to_resource].present? ? args[:link_to_resource] : false
15
+ @link_to_record = args[:link_to_record].present? ? args[:link_to_record] : false
16
16
  @is_avatar = args[:is_avatar].present? ? args[:is_avatar] : false
17
17
  @is_image = args[:is_image].present? ? args[:is_image] : @is_avatar
18
18
  @is_audio = args[:is_audio].present? ? args[:is_audio] : false
@@ -4,7 +4,7 @@ require "erb"
4
4
  module Avo
5
5
  module Fields
6
6
  class GravatarField < BaseField
7
- attr_reader :link_to_resource
7
+ attr_reader :link_to_record
8
8
  attr_reader :rounded
9
9
  attr_reader :size
10
10
  attr_reader :default
@@ -16,7 +16,7 @@ module Avo
16
16
 
17
17
  hide_on [:edit, :new]
18
18
 
19
- @link_to_resource = args[:link_to_resource].present? ? args[:link_to_resource] : false
19
+ @link_to_record = args[:link_to_record].present? ? args[:link_to_record] : false
20
20
  @rounded = args[:rounded].nil? ? true : args[:rounded]
21
21
  @size = args[:size].present? ? args[:size].to_i : 32
22
22
  @default = args[:default].present? ? ERB::Util.url_encode(args[:default]).to_s : ""
@@ -4,35 +4,27 @@ module Avo
4
4
  module Fields
5
5
  class HeadingField < BaseField
6
6
  attr_reader :as_html
7
- attr_reader :empty
8
-
9
- def initialize(content, **args, &block)
10
- # Mark the field as empty if there's no content passed
11
- @empty = content.blank?
12
- # Add dummy content
13
- content ||= SecureRandom.hex
14
7
 
8
+ def initialize(id, **args, &block)
15
9
  args[:updatable] = false
10
+ @label = args[:label] || id.to_s.humanize
16
11
 
17
- super(content, **args, &block)
12
+ super(id, **args, &block)
18
13
 
19
14
  # this field is not used to update anything
20
15
  @for_presentation_only = true
21
16
 
22
17
  hide_on :index
23
18
 
24
- @as_html = args[:as_html].present? ? args[:as_html] : false
19
+ @as_html = args[:as_html].presence || false
25
20
  end
26
21
 
27
22
  def id
28
23
  "heading_#{name.to_s.parameterize.underscore}"
29
24
  end
30
25
 
31
- # Override the value method if the field is empty
32
26
  def value
33
- return nil if empty
34
-
35
- super
27
+ block.present? ? execute_block : @label
36
28
  end
37
29
  end
38
30
  end
@@ -1,7 +1,7 @@
1
1
  module Avo
2
2
  module Fields
3
3
  class IdField < BaseField
4
- attr_reader :link_to_resource
4
+ attr_reader :link_to_record
5
5
 
6
6
  def initialize(id, **args, &block)
7
7
  args[:readonly] = true
@@ -12,7 +12,7 @@ module Avo
12
12
 
13
13
  add_boolean_prop args, :sortable, true
14
14
 
15
- @link_to_resource = args[:link_to_resource].present? ? args[:link_to_resource] : false
15
+ @link_to_record = args[:link_to_record].present? ? args[:link_to_record] : false
16
16
  end
17
17
  end
18
18
  end
@@ -1,14 +1,14 @@
1
1
  module Avo
2
2
  module Fields
3
3
  class TextField < BaseField
4
- attr_reader :link_to_resource
4
+ attr_reader :link_to_record
5
5
  attr_reader :as_html
6
6
  attr_reader :protocol
7
7
 
8
8
  def initialize(id, **args, &block)
9
9
  super(id, **args, &block)
10
10
 
11
- add_boolean_prop args, :link_to_resource
11
+ add_boolean_prop args, :link_to_record
12
12
  add_boolean_prop args, :as_html
13
13
  add_string_prop args, :protocol
14
14
  end
@@ -56,12 +56,6 @@ class Avo::Resources::Items::Holder
56
56
  add_item panel
57
57
  end
58
58
 
59
- def heading(body = nil, **args, &block)
60
- field = Avo::Fields::HeadingField.new(body, **args)
61
-
62
- add_item field
63
- end
64
-
65
59
  def sidebar(**args, &block)
66
60
  add_item Avo::Resources::Items::Sidebar::Builder.parse_block(**args, &block)
67
61
  end
data/lib/avo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "3.0.1.beta8" unless const_defined?(:VERSION)
2
+ VERSION = "3.0.1.beta9" unless const_defined?(:VERSION)
3
3
  end
@@ -31,7 +31,7 @@ module Generators
31
31
  end
32
32
 
33
33
  say "Ejecting the _head.html.erb partial"
34
- Rails::Generators.invoke("avo:eject", [":head", "--skip-avo-version"], {destination_root: Rails.root})
34
+ Rails::Generators.invoke("avo:eject", ["--partial", ":head", "--skip-avo-version"], {destination_root: Rails.root})
35
35
 
36
36
  say "Adding the JS asset to the partial"
37
37
  append_to_file Rails.root.join("app", "views", "avo", "partials", "_head.html.erb"), "<%= javascript_importmap_tags \"avo.custom\" %>"
@@ -48,7 +48,7 @@ module Generators
48
48
  end
49
49
 
50
50
  say "Ejecting the _head.html.erb partial"
51
- Rails::Generators.invoke("avo:eject", [":head", "--skip-avo-version"], {destination_root: Rails.root})
51
+ Rails::Generators.invoke("avo:eject", ["--partial", ":head", "--skip-avo-version"], {destination_root: Rails.root})
52
52
 
53
53
  say "Adding the JS asset to the partial"
54
54
  append_to_file Rails.root.join("app", "views", "avo", "partials", "_head.html.erb"), "<%= javascript_include_tag \"avo.custom\", \"data-turbo-track\": \"reload\", defer: true %>"
@@ -33,7 +33,7 @@ module Generators
33
33
  # Ensure that the _pre_head.html.erb template is available
34
34
  unless Rails.root.join("app", "views", "avo", "partials", "_pre_head.html.erb").exist?
35
35
  say "Ejecting the _pre_head.html.erb partial"
36
- Rails::Generators.invoke("avo:eject", [":pre_head", "--skip-avo-version"], {destination_root: Rails.root})
36
+ Rails::Generators.invoke("avo:eject", ["--partial", ":pre_head", "--skip-avo-version"], {destination_root: Rails.root})
37
37
  end
38
38
 
39
39
  say "Adding the CSS asset to the partial"
@@ -6665,10 +6665,6 @@ tag.tagify__tag{
6665
6665
  float:right
6666
6666
  }
6667
6667
 
6668
- .float-left{
6669
- float:left
6670
- }
6671
-
6672
6668
  .m-0{
6673
6669
  margin:0px
6674
6670
  }
@@ -7817,11 +7813,6 @@ tag.tagify__tag{
7817
7813
  background-color:rgb(57 158 229 / var(--tw-bg-opacity))
7818
7814
  }
7819
7815
 
7820
- .bg-blue-50{
7821
- --tw-bg-opacity:1;
7822
- background-color:rgb(230 243 252 / var(--tw-bg-opacity))
7823
- }
7824
-
7825
7816
  .bg-blue-500{
7826
7817
  --tw-bg-opacity:1;
7827
7818
  background-color:rgb(8 134 222 / var(--tw-bg-opacity))
@@ -10238,6 +10229,10 @@ trix-editor {
10238
10229
  width:66.666667%
10239
10230
  }
10240
10231
 
10232
+ .md\:w-full{
10233
+ width:100%
10234
+ }
10235
+
10241
10236
  .md\:grid-cols-3{
10242
10237
  grid-template-columns:repeat(3, minmax(0, 1fr))
10243
10238
  }
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: 3.0.1.beta8
4
+ version: 3.0.1.beta9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Marin
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-08-29 00:00:00.000000000 Z
12
+ date: 2023-09-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord