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

OEL-1912: Revamp carousel pattern. #265

Merged
merged 29 commits into from
Sep 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5396977
OEL-1912: Refactor carousel pattern.
drishu Aug 18, 2022
e6d9cd7
OEL-1912: Use CarouselPatternAssert in rendering test.
drishu Aug 18, 2022
7351a20
OEL-1912: Add CarouselPatternAssert.
drishu Aug 18, 2022
a62dcda
OEL-1912: Fix items description.
drishu Aug 19, 2022
eb36901
OEL-1912: Map item title to bcl variable.
drishu Aug 19, 2022
28a5f38
OEL-1912: Add healthy carousel defaults.
drishu Aug 19, 2022
acd2a3c
OEL-1912: Add assertElementTextContains helper in pattern assert base.
drishu Aug 19, 2022
cc5bde3
OEL-1912: Assert carousel base elements.
drishu Aug 19, 2022
55463e7
OEL-1912: Assert carousel items.
drishu Aug 19, 2022
e82fc8a
OEL-1912: Use ImageValueObject instead of image tag.
drishu Aug 19, 2022
d9fa5f8
OEL-1912: Fix massager docblock.
drishu Aug 19, 2022
053d371
OEL-1912: Revert carousel pattern.
drishu Aug 24, 2022
c4d7b54
OEL-1912: Revert carousel related ImageValueObject development.
drishu Aug 24, 2022
d2652d5
OEL-1912: Improve count assert.
drishu Aug 24, 2022
71c13b3
OEL-1912: Cover all carousel configurations.
drishu Aug 24, 2022
0ec0fd2
OEL-1912: Improve attribute assertion in base class.
drishu Aug 24, 2022
4300366
OEL-1912: Assert carousel settings.
drishu Aug 24, 2022
29e5d40
OEL-1912: Rework from title to caption_title assert.
drishu Aug 24, 2022
4df92ba
OEL-1912: Remove redundant comments.
drishu Aug 25, 2022
d598a3b
OEL-1912: Test all item options.
drishu Aug 25, 2022
737a05d
OEL-1912: Inject icon into carousel item link.
drishu Aug 26, 2022
7c27afb
OEL-1912: Add links to carousel pattern preview.
drishu Aug 26, 2022
126aee9
OEL-1912: Account for links in carousel test.
drishu Aug 26, 2022
ce113f0
OEL-1912: Account for caption_title presence conditions.
drishu Aug 29, 2022
c14a938
OEL-1912: Improve method calls in carousel pattern assert.
drishu Aug 30, 2022
d897335
OEL-1912: Add setting defaults to consolidate behaviour.
drishu Aug 30, 2022
f191a18
OEL-1912: Fix misleading test case key.
drishu Aug 30, 2022
05261de
OEL-1912: Allways assert settings are correct.
drishu Aug 30, 2022
11f09a4
OEL-1912: Patch carousel to show title when caption and link not set.
drishu Sep 2, 2022
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
13 changes: 0 additions & 13 deletions patches/npm/@openeuropa+bcl-theme-default+0.24.0.patch

This file was deleted.

26 changes: 26 additions & 0 deletions patches/npm/@openeuropa+bcl-theme-default+0.24.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/node_modules/@openeuropa/bcl-theme-default/templates/bcl-carousel/carousel.html.twig b/node_modules/@openeuropa/bcl-theme-default/templates/bcl-carousel/carousel.html.twig
index 6e08be9..ddc41ad 100644
--- a/node_modules/@openeuropa/bcl-theme-default/templates/bcl-carousel/carousel.html.twig
+++ b/node_modules/@openeuropa/bcl-theme-default/templates/bcl-carousel/carousel.html.twig
@@ -111,7 +111,7 @@
{% if _item.image is defined and _item.image is not empty %}
{{ _item.image }}
{% endif %}
- {% if (_item.caption is defined and _item.caption is not empty) or (_item.link is defined and _item.link is not empty) %}
+ {% if (_item.caption is defined and _item.caption is not empty) or (_item.link is defined and _item.link is not empty) or (_item.caption_title is defined and _item.caption_title is not empty) %}
{% set _caption_classes = 'carousel-caption' %}
{% if _item.caption is not empty and _item.link is empty %}
{% set _caption_classes = _caption_classes ~ ' d-none d-md-block' %}
diff --git a/node_modules/@openeuropa/bcl-theme-default/templates/bcl-pagination/pagination.html.twig b/node_modules/@openeuropa/bcl-theme-default/templates/bcl-pagination/pagination.html.twig
index d33f381..ed77687 100644
--- a/node_modules/@openeuropa/bcl-theme-default/templates/bcl-pagination/pagination.html.twig
+++ b/node_modules/@openeuropa/bcl-theme-default/templates/bcl-pagination/pagination.html.twig
@@ -57,7 +57,7 @@
{% set _alignment = alignment|default('') %}
{% set _aria_label = aria_label|default('') %}
{% set _enable_prev_next_icon = enable_prev_next_icon|default(false) %}
-{% set _enable_first_last_icon = enable_first_last_icon|default(true) %}
+{% set _enable_first_last_icon = enable_first_last_icon ?? true %}
{% set _items = items|default([]) %}
{% set _first = first|default({}) %}
{% set _next = next|default({}) %}
12 changes: 10 additions & 2 deletions templates/patterns/carousel/carousel.ui_patterns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,21 @@ carousel:
label: 'Slides'
description: 'Each slide is an image, a caption and interval of slide movement.'
preview:
- caption: 'First slide label'
- caption: 'First slide caption'
caption_title: 'First slide title'
interval: 0
image:
src: 'https://placeimg.com/1000/500/arch'
alt: 'alt image 1'
- caption: 'Second slide label'
link:
label: First link
path: https://link.one
- caption: 'Second slide caption'
caption_title: 'Second slide title'
interval: 0
image:
src: 'https://placeimg.com/1000/500/people'
alt: 'alt image 1'
link:
label: Second link
path: https://link.two
25 changes: 18 additions & 7 deletions templates/patterns/carousel/pattern-carousel.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,33 @@
{% endblock %}
{% endset %}
{% set _item = slide|merge({
'image': _image
'image': _image,
}) %}
{% if slide.link %}
{% set _item = _item|merge({
'link': slide.link|merge({
'icon_position': 'before',
'icon': {
'name': 'link',
'path': bcl_icon_path,
},
}),
}) %}
{% endif %}
{% set _slides = _slides|merge([_item]) %}
{% endfor %}
{% include '@oe-bcl/carousel' with {
'id': carousel_id,
'autoplay': autoplay,
'autoinit': autoinit,
'autoplay': autoplay ?? true,
'autoinit': autoinit ?? true,
'dark': dark_mode,
'active_item': active_item,
'items': _slides,
'fade': fade,
'with_controls': show_controls,
'fade': fade ?? false,
'with_controls': show_controls ?? true,
'prev_label': 'Previous'|t,
'next_label': 'Next'|t,
'with_indicators': show_indicators,
'disable_touch': disable_touch,
'with_indicators': show_indicators ?? false,
'disable_touch': disable_touch ?? false,
'attributes': attributes,
} only %}
Loading