Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: minor tweaks #1825

Merged
merged 2 commits into from
Jul 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/components/avo/fields/belongs_to_field/edit_component.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# frozen_string_literal: true

class Avo::Fields::BelongsToField::EditComponent < Avo::Fields::EditComponent
def initialize(field: nil, resource: nil, index: 0, form: nil, compact: false)
super field: field, resource: resource, index: index, form: form, compact: compact
def initialize(**args)
super(**args)

@polymorphic_record = nil
end
Expand Down
4 changes: 2 additions & 2 deletions app/components/avo/sidebar/link_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<% if path.present? %>
<%= send link_method, path, class: classes, active: active, target: target, data: data do %>
<%= helpers.svg icon, class: "h-4" if icon.present? %>
<%= helpers.svg icon, class: "h-4 text-gray-700" if icon.present? %>
<%= label %>
<% if target == :_blank %>
<%= helpers.svg('heroicons/outline/external-link', class: 'self-center ml-auto h-3 mr-2') %>
<% end %>
<% end %>
<% else %>
<%= content_tag :div, class: classes, active: active, target: target, data: data do %>
<%= helpers.svg icon, class: "h-4" if icon.present? %>
<%= helpers.svg icon, class: "h-4 text-gray-700" if icon.present? %>
<%= label %>
<% end %>
<% end %>
2 changes: 1 addition & 1 deletion app/components/avo/views/resource_edit_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,6 @@ def form_url

# Render :show view for read only trix fields
def view_for(field)
(field.is_a? Avo::Fields::TrixField) && field.is_readonly? ? :show : view
(field.is_a?(Avo::Fields::TrixField) && field.is_readonly?) ? :show : view
end
end