Skip to content

Commit

Permalink
EWPP-4750: Add extra_attributes to file_teaser pattern.
Browse files Browse the repository at this point in the history
  • Loading branch information
22Alexandra committed Oct 10, 2024
1 parent ed4e648 commit e3b0817
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions templates/patterns/file_teaser/file_teaser.ui_patterns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,10 @@ file_teaser:
label: "Contextual links"
description: "Render array of contextual links"
preview: ~
extra_attributes:
type: "array"
label: "Extra attributes"
description: "List of extra attributes"
preview:
- name: "extra-attr"
value: "extra value"
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,5 @@
'variant': 'thumbnail',
'lists': _lists,
'label': _label,
'extra_attributes': extra_attributes|default([]),
} only %}
5 changes: 4 additions & 1 deletion tests/src/Kernel/fixtures/rendering.yml
Original file line number Diff line number Diff line change
Expand Up @@ -953,12 +953,15 @@
badges:
- label: "Highlighted"
variant: "highlight"
extra_attributes:
- name: "extra-attr"
value: "extra value"
assertions:
count:
'img.ecl-file__image[src="https://inno-ecl.s3.amazonaws.com/media/examples/example-image.jpg"]': 1
'img.ecl-file__image[alt="thumbnail alt"]': 1
'a.ecl-file__download[href="http://example.com"]': 1
'div.ecl-file.ecl-file--thumbnail': 1
'div.ecl-file.ecl-file--thumbnail[extra-attr="extra value"]': 1
'div.ecl-file__container div.ecl-file__info ul.ecl-file__detail-meta': 1
'div.ecl-file__container div.ecl-file__info': 1
'div.ecl-file__translation-container': 1
Expand Down

0 comments on commit e3b0817

Please sign in to comment.