avo-hq/avo

Adding html data attributes to the content part of a native field component within a resource tool on a show page doesn't work

Geschlossen

#2.407 geöffnet am 24.01.2024

 (4 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Ruby (308 Forks)user submission
EnhancementGood first issueHelp wanted

Repository-Metriken

Stars
 (1.778 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 1T 6h) (67 gemergte PRs in 30 T)

Beschreibung

Describe the bug

If I'm understand the docs then the code:

            <%= avo_show_field(
              :id, 
              as: :text, 
              html: {
                show: {
                  content: {
                    data: { foo_bar: "baz" }
                  }
                }
              }
            )
            %>

Should result in an HTML element with the attribute "data-foo-bar"="baz". But although the show field is rendered, the attribute is missing. Changing content to wrapper does render the attribute but on the wrong element.

Steps to Reproduce

  • Create a Resource Tool
  • Add the above field to it
  • Add the tool to the show page of a resource
  • Load that page in the browser

Expected behavior & Actual behavior

Somewhere in the HTML "data-foo-bar"="baz" should occur. but it doesn't.

Models and resource files

System configuration

Avo version: 3.0.2

Rails version: 7.1.3

Ruby version: 3.3.0

License type:

  • Community
  • Pro
  • Advanced

Are you using Avo monkey patches, overriding views or view components?

  • Yes. If so, please post code samples.
  • No

Screenshots or screen recordings

Additional context

Impact

  • High impact (It makes my app un-usable.)
  • Medium impact (I'm annoyed, but I'll live.)
  • Low impact (It's really a tiny thing that I could live with.)

Urgency

  • High urgency (I can't continue development without it.)
  • Medium urgency (I found a workaround, but I'd love to have it fixed.)
  • Low urgency (It can wait. I just wanted you to know about it.)

Contributor Guide