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

feat(media-container): add expandable - FRONT-4017 #2943

Merged
merged 12 commits into from
Jul 11, 2023
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
8 changes: 6 additions & 2 deletions src/implementations/twig/components/banner/banner.story.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ const prepareData = (data, args) => {
data.title = args.title;
data.description = args.description;
data.centered = args.centered;
data.full_width = args.width === 'inside';
data.full_width =
args.width === 'inside the grid container, with fullwidth class';

if (data.image) {
data.image = args.image;
Expand All @@ -223,7 +224,10 @@ const prepareData = (data, args) => {

const renderStory = (data, args) => {
let story = banner(prepareData(data, args));
if (args.width === 'container' || args.width === 'inside') {
if (
args.width === 'inside the grid container' ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it felt there was something strange since you are receiving the labels and not the values in the args object, this is due to a reverse mapping, it should be:

    mapping: {
      'outside the ecl-container': 'outside',
      'inside the ecl-container': 'container',
      'inside the ecl-container, with fullwidth class': 'inside',
    },

and then you would deal with the values here, the same in the url ;)

args.width === 'inside the grid container, with fullwidth class'
) {
story = `<div class="ecl-container">${story}</div>`;
}
if (args.gridContent) {
Expand Down
3 changes: 2 additions & 1 deletion src/implementations/twig/components/banner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"access": "public"
},
"dependencies": {
"@ecl/twig-component-link": "3.8.4"
"@ecl/twig-component-link": "3.8.4",
"@ecl/twig-component-picture": "3.8.4"
},
"devDependencies": {
"@ecl/specs-component-banner": "3.8.4",
Expand Down
3 changes: 2 additions & 1 deletion src/implementations/twig/components/card/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"access": "public"
},
"dependencies": {
"@ecl/twig-component-content-block": "3.8.4"
"@ecl/twig-component-content-block": "3.8.4",
"@ecl/twig-component-picture": "3.8.4"
},
"devDependencies": {
"@ecl/specs-component-card": "3.8.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,28 @@ exports[`Featured item Default renders correctly 1`] = `
<div
class="ecl-featured-item__item"
>
<figure
<div
class="ecl-media-container ecl-featured-item__media_container"
>
<picture
class="ecl-picture ecl-media-container__picture"
>
<img
alt="Lorem ipsum dolor sit amet"
class="ecl-media-container__media"
src="https://inno-ecl.s3.amazonaws.com/media/examples/example-image.jpg"
/>
</picture>
<figcaption
class="ecl-media-container__caption"
<figure
class="ecl-media-container__figure"
>
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
</figcaption>
</figure>
<picture
class="ecl-picture ecl-media-container__picture"
>
<img
alt="Lorem ipsum dolor sit amet"
class="ecl-media-container__media"
src="https://inno-ecl.s3.amazonaws.com/media/examples/example-image.jpg"
/>
</picture>
<figcaption
class="ecl-media-container__caption"
>
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
</figcaption>
</figure>
</div>
</div>
<div
class="ecl-featured-item__item"
Expand Down Expand Up @@ -133,24 +137,28 @@ exports[`Featured item Extended renders correctly 1`] = `
<div
class="ecl-featured-item__item"
>
<figure
<div
class="ecl-media-container ecl-featured-item__media_container"
>
<picture
class="ecl-picture ecl-media-container__picture"
>
<img
alt="Lorem ipsum dolor sit amet"
class="ecl-media-container__media"
src="https://inno-ecl.s3.amazonaws.com/media/examples/example-image.jpg"
/>
</picture>
<figcaption
class="ecl-media-container__caption"
<figure
class="ecl-media-container__figure"
>
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
</figcaption>
</figure>
<picture
class="ecl-picture ecl-media-container__picture"
>
<img
alt="Lorem ipsum dolor sit amet"
class="ecl-media-container__media"
src="https://inno-ecl.s3.amazonaws.com/media/examples/example-image.jpg"
/>
</picture>
<figcaption
class="ecl-media-container__caption"
>
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
</figcaption>
</figure>
</div>
</div>
<div
class="ecl-featured-item__item"
Expand Down Expand Up @@ -207,24 +215,28 @@ exports[`Featured item renders correctly with extra attributes 1`] = `
<div
class="ecl-featured-item__item"
>
<figure
<div
class="ecl-media-container ecl-featured-item__media_container"
>
<picture
class="ecl-picture ecl-media-container__picture"
>
<img
alt="Lorem ipsum dolor sit amet"
class="ecl-media-container__media"
src="https://inno-ecl.s3.amazonaws.com/media/examples/example-image.jpg"
/>
</picture>
<figcaption
class="ecl-media-container__caption"
<figure
class="ecl-media-container__figure"
>
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
</figcaption>
</figure>
<picture
class="ecl-picture ecl-media-container__picture"
>
<img
alt="Lorem ipsum dolor sit amet"
class="ecl-media-container__media"
src="https://inno-ecl.s3.amazonaws.com/media/examples/example-image.jpg"
/>
</picture>
<figcaption
class="ecl-media-container__caption"
>
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
</figcaption>
</figure>
</div>
</div>
<div
class="ecl-featured-item__item"
Expand Down Expand Up @@ -279,24 +291,28 @@ exports[`Featured item renders correctly with extra class names 1`] = `
<div
class="ecl-featured-item__item"
>
<figure
<div
class="ecl-media-container ecl-featured-item__media_container"
>
<picture
class="ecl-picture ecl-media-container__picture"
>
<img
alt="Lorem ipsum dolor sit amet"
class="ecl-media-container__media"
src="https://inno-ecl.s3.amazonaws.com/media/examples/example-image.jpg"
/>
</picture>
<figcaption
class="ecl-media-container__caption"
<figure
class="ecl-media-container__figure"
>
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
</figcaption>
</figure>
<picture
class="ecl-picture ecl-media-container__picture"
>
<img
alt="Lorem ipsum dolor sit amet"
class="ecl-media-container__media"
src="https://inno-ecl.s3.amazonaws.com/media/examples/example-image.jpg"
/>
</picture>
<figcaption
class="ecl-media-container__caption"
>
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
</figcaption>
</figure>
</div>
</div>
<div
class="ecl-featured-item__item"
Expand Down
3 changes: 2 additions & 1 deletion src/implementations/twig/components/file/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"dependencies": {
"@ecl/twig-component-button": "3.8.4",
"@ecl/twig-component-icon": "3.8.4",
"@ecl/twig-component-link": "3.8.4"
"@ecl/twig-component-link": "3.8.4",
"@ecl/twig-component-picture": "3.8.4"
},
"devDependencies": {
"@ecl/specs-component-file": "3.8.4",
Expand Down
3 changes: 2 additions & 1 deletion src/implementations/twig/components/gallery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"dependencies": {
"@ecl/twig-component-button": "3.8.4",
"@ecl/twig-component-icon": "3.8.4",
"@ecl/twig-component-link": "3.8.4"
"@ecl/twig-component-link": "3.8.4",
"@ecl/twig-component-picture": "3.8.4"
},
"devDependencies": {
"@ecl/specs-component-gallery": "3.8.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"access": "public"
},
"dependencies": {
"@ecl/twig-component-icon": "3.8.4"
"@ecl/twig-component-icon": "3.8.4",
"@ecl/twig-component-picture": "3.8.4"
},
"devDependencies": {
"@ecl/specs-component-list-illustration": "3.8.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ npm install --save @ecl/twig-component-media-container
- "description" (string) (default: ''),
- **"image"**: (string) (default: '') Path or url to the image used as the video placeholder
- **"ratio"** (string) ('') Ratio of the embedded media, if empty the ratio will be set by the js
- **"expandable"** (associative array) (default: {}): Optional expandable block, following ECL Expandable structure
- **"extra_classes"** (optional) (string) (default: '') Extra classes (space separated)
- **"extra_attributes"** (optional) (array) (default: []) Extra attributes

Expand Down
Loading