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

EWPP-4593: Allow Facts and figures content to be centered. #1491

Merged
merged 1 commit into from
Sep 10, 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
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,8 @@ facts_figures:
label: "External link"
description: "Whether the view all URL is external or not."
preview: true
centered:
type: "boolean"
label: "Centered"
description: "Whether the items' content should be centered."
preview: true
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

{% include '@ecl-twig/fact-figures' with {
'column': _column|default(null),
'centered': centered|default(false),
'items': _items,
"view_all":{
"link": _link,
Expand Down
4 changes: 3 additions & 1 deletion tests/src/Kernel/fixtures/rendering.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4000,9 +4000,10 @@
label: 'View all metrics'
path: 'https://example.com'
external_link: true
centered: true
assertions:
count:
'div.ecl-fact-figures.ecl-fact-figures--col-2 div.ecl-fact-figures__items': 1
'div.ecl-fact-figures.ecl-fact-figures--col-2.ecl-fact-figures--centered div.ecl-fact-figures__items': 1
'div.ecl-fact-figures__item:nth-child(1) svg.ecl-icon.ecl-icon--l.ecl-fact-figures__icon': 1
'div.ecl-fact-figures__item:nth-child(2) svg.ecl-icon.ecl-icon--l.ecl-fact-figures__icon': 1
'div.ecl-fact-figures__view-all': 1
Expand Down Expand Up @@ -4037,6 +4038,7 @@
assertions:
count:
'div.ecl-fact-figures.ecl-fact-figures--col-3 div.ecl-fact-figures__items': 1
'div.ecl-fact-figures.ecl-fact-figures--col-3.ecl-fact-figures--centered': 0
'div.ecl-fact-figures__view-all': 0
- array:
'#type': 'pattern'
Expand Down