-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Trix horizontal rule disappears in edit view #2627
Comments
@sedubois, a reproduction repo would be a bit more helpful to us to run quickly. |
@adrianthedev see reproduction here: First, in the main app: I could create an article at http://localhost:5000/articles. I could insert a horizontal rule, it showed up fine. It also rendered fine when re-editing the article. Then I wanted to start configuring things on the Avo side, but I got an error 🐛 This looks like a bug in Avo? As a workaround, I created the view (copied from the 🐛 Then the Avo index and show views can render the article. For the edit view however, I had to manually change the body field type from At this point I then added the custom Trix config so that the toolbar buttons showed up fine. Then you can observe the issue described here: the horizontal rule, which shows up fine in the editor of the main app (at http://localhost:5000/articles/1/edit) does not show up in the Avo editor (at http://localhost:5000/avo/resources/articles/1/edit). |
@Paul-Bob as you are working on a Trix PR, FYI there is this issue too, don't know if related |
@sedubois I wasn’t able to reproduce it: Screen.Recording.2024-03-27.at.11.59.17.mov |
Sorry Paul it's because the Avo Trix customization was commented out when applying the changes you asked in the other issue. So the HR button was not available any more in the Avo Trix toolbar. You can re-test as follows:
|
This issue has been marked as stale because there was no activity for the past 15 days. |
Let's try to fix this as well if it's fixable without any hacks. |
This issue has been marked as stale because there was no activity for the past 15 days. |
This issue persists in our application after upgrading to Avo 3.7.3: the hr disappears when re-editing then saving the resource. So again I tried to isolate the issue in a standalone, shareable repo: But I can't check if the hr button feature works, as the first issue is that I'm probably setting up the customization the wrong way because there are JS errors below when visiting the Avo article index and when trying to save an article after edit. Any idea what might be misconfigured? |
I didn't get the chance to look into it @sedubois. Thanks for the reproduction repository that should help! |
This issue has been marked as stale because there was no activity for the past 15 days. |
We spoke about this on so many issues. The status is that it's an edge-case that happens only with |
Describe the bug
Trix horizontal rule disappears in edit view.
Steps to Reproduce
<div><action-text-attachment content-type="vnd.rubyonrails.horizontal-rule.html"></action-text-attachment></div>
as intendedExpected behavior & Actual behavior
The hr should be visible on the edit view and should stay persisted to the DB when saving again.
Models and resource files
See gist link above
System configuration
Avo version: 3.5.4
Rails version: 7.0.8.1
Ruby version: 3.3.0
License type: Community
Are you using Avo monkey patches, overriding views or view components?
No
Screenshots or screen recordings
Edit (first pass) - works OK:
Show - works OK:
Edit (second pass) - KO (hr disappears):
Additional context
Trix support for horizontal rule was added as documented in this issue. This system works fine in our legacy Administrate dashboards and the hr renders fine in our front-end. The only issue is when re-editing the resource in Avo.
Impact
Med/high: this prevents us from going live with the Avo dashboards because editing our articles will result in the horizontal rules to disappear.
Urgency
Medium
The text was updated successfully, but these errors were encountered: