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

Fermée

#2 407 ouverte le 24 janv. 2024

 (4 commentaires) (0 réaction) (0 personne assignée)Ruby (308 forks)user submission
EnhancementGood first issueHelp wanted

Métriques du dépôt

Stars
 (1 778 étoiles)
Métriques de merge PR
 (Merge moyen 1j 6h) (67 PRs mergées en 30 j)

Description

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.)

Guide contributeur