Skip to content

Commit

Permalink
feat(news-ticker): Adding support for external links - FRONT-2653 (#2559
Browse files Browse the repository at this point in the history
)
  • Loading branch information
planctus committed Jun 7, 2022
1 parent b7556a5 commit 43ed0a4
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,24 @@ exports[`News ticker Default renders correctly 1`] = `
class="ecl-news-ticker__slide"
>
<a
class="ecl-link ecl-news-ticker__slide-text"
class="ecl-link ecl-link--icon ecl-link--icon-after ecl-news-ticker__slide-text"
href="/example"
tabindex="-1"
>
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat
<span
class="ecl-link__label"
>
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat
</span>
<svg
aria-hidden="true"
class="ecl-icon ecl-icon--2xs ecl-link__icon"
focusable="false"
>
<use
xlink:href="/icons.svg#external"
/>
</svg>
</a>
</li>
<li
Expand Down Expand Up @@ -234,11 +247,24 @@ exports[`News ticker Default renders correctly with extra attributes 1`] = `
class="ecl-news-ticker__slide"
>
<a
class="ecl-link ecl-news-ticker__slide-text"
class="ecl-link ecl-link--icon ecl-link--icon-after ecl-news-ticker__slide-text"
href="/example"
tabindex="-1"
>
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat
<span
class="ecl-link__label"
>
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat
</span>
<svg
aria-hidden="true"
class="ecl-icon ecl-icon--2xs ecl-link__icon"
focusable="false"
>
<use
xlink:href="/icons.svg#external"
/>
</svg>
</a>
</li>
<li
Expand Down Expand Up @@ -432,11 +458,24 @@ exports[`News ticker Default renders correctly with extra class names 1`] = `
class="ecl-news-ticker__slide"
>
<a
class="ecl-link ecl-news-ticker__slide-text"
class="ecl-link ecl-link--icon ecl-link--icon-after ecl-news-ticker__slide-text"
href="/example"
tabindex="-1"
>
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat
<span
class="ecl-link__label"
>
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat
</span>
<svg
aria-hidden="true"
class="ecl-icon ecl-icon--2xs ecl-link__icon"
focusable="false"
>
<use
xlink:href="/icons.svg#external"
/>
</svg>
</a>
</li>
<li
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
{
"content" (string)
"link" (string)
"external" (boolean)
},
...
]
Expand Down Expand Up @@ -75,6 +76,8 @@
link: {
label: _item.content,
path: _item.link,
external: _item.external,
icon_path: icon_path,
},
extra_classes: 'ecl-news-ticker__slide-text',
extra_attributes: [
Expand Down
1 change: 1 addition & 0 deletions src/specs/components/news-ticker/demo/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = {
content:
'Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat',
link: exampleLink,
external: true,
},
{
content:
Expand Down

1 comment on commit 43ed0a4

@github-actions
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.