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

fix: break-words on show content #3542

Merged
merged 1 commit into from
Dec 18, 2024
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/field_wrapper_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
<% end %>
<% if on_edit? && @field.is_required? %> <span class="text-red-600 ml-1">*</span> <% end %>
<% end %>
<%= content_tag :div, class: class_names("flex-1 flex flex-row md:min-h-inherit px-6",
<%= content_tag :div, class: class_names("flex-1 flex flex-row md:min-h-inherit px-6 overflow-x-auto",
@field.get_html(:classes, view: @view, element: :content),
{
"pb-4": stacked?,
"py-2": !compact?,
"py-1": compact?,
}), data: {slot: "value"} do %>
<div class="self-center w-full <% unless full_width? || compact? || stacked? %> md:w-8/12 has-sidebar:w-full <% end %>">
<div class="self-center w-full break-words <% unless full_width? || compact? || stacked? %> md:w-8/12 has-sidebar:w-full <% end %>">
<% if on_show? %>
<% if render_dash? %>
Expand Down
3 changes: 3 additions & 0 deletions spec/dummy/app/avo/resources/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ def main_panel_fields
required: true,
only_on: [:index]

field :some_token, only_on: :show

field :is_writer, as: :text,
sortable: -> {
# Order by something else completely, just to make a test case that clearly and reliably does what we want.
Expand Down Expand Up @@ -154,6 +156,7 @@ def test_sidebar

def main_panel_sidebar
sidebar do
field :some_token, only_on: :show
test_field("Inside main_panel_sidebar")
with_options only_on: :show do
field :email, as: :gravatar, link_to_record: true, as_avatar: :circle
Expand Down
2 changes: 2 additions & 0 deletions spec/dummy/app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@ def permissions
delete: true,
}
end

def some_token = @some_token ||= SecureRandom.hex(64)
end
Loading