Skip to content

Commit

Permalink
chore(content-block): Removing examples with tags - FRONT-3844 (#2787)
Browse files Browse the repository at this point in the history
Co-authored-by: Romain Emery <emery.romain@gmail.com>
  • Loading branch information
planctus and emeryro committed Mar 7, 2023
1 parent 8336015 commit 47bfa27
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 384 deletions.
16 changes: 1 addition & 15 deletions src/implementations/twig/components/card/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ npm install --save @ecl/twig-component-card
},
...
]
- **tags** (array) (default: []): Array of ECL Tags
- **tags** (array) (default: []): Array of ECL Tags (deprecated)
- **lists** (array) (default: []): Array of ECL Description list
- **extra_classes** (string) (default: '')
- **extra_attributes** (array) (default: []): format: [
Expand Down Expand Up @@ -72,20 +72,6 @@ npm install --save @ecl/twig-component-card
},
},
],
tags: [
{
label: 'Tag 1',
path: '/example-1',
},
{
label: 'Tag 2',
path: '/example-2',
},
{
label: 'Tag 3',
path: '/example-3',
},
],
}
} %}
```
Original file line number Diff line number Diff line change
Expand Up @@ -222,40 +222,6 @@ exports[`Card Default renders correctly 1`] = `
</span>
</li>
</ul>
<ul
class="ecl-content-block__tag-container"
>
<li
class="ecl-content-block__tag-item"
>
<a
class="ecl-tag"
href="/example"
>
tag 1
</a>
</li>
<li
class="ecl-content-block__tag-item"
>
<a
class="ecl-tag"
href="/example"
>
tag 2
</a>
</li>
<li
class="ecl-content-block__tag-item"
>
<a
class="ecl-tag"
href="/example"
>
tag 3
</a>
</li>
</ul>
<div
class="ecl-content-block__list-container"
>
Expand Down Expand Up @@ -489,40 +455,6 @@ exports[`Card Default renders correctly with extra attributes 1`] = `
</span>
</li>
</ul>
<ul
class="ecl-content-block__tag-container"
>
<li
class="ecl-content-block__tag-item"
>
<a
class="ecl-tag"
href="/example"
>
tag 1
</a>
</li>
<li
class="ecl-content-block__tag-item"
>
<a
class="ecl-tag"
href="/example"
>
tag 2
</a>
</li>
<li
class="ecl-content-block__tag-item"
>
<a
class="ecl-tag"
href="/example"
>
tag 3
</a>
</li>
</ul>
<div
class="ecl-content-block__list-container"
>
Expand Down Expand Up @@ -754,40 +686,6 @@ exports[`Card Default renders correctly with extra class names 1`] = `
</span>
</li>
</ul>
<ul
class="ecl-content-block__tag-container"
>
<li
class="ecl-content-block__tag-item"
>
<a
class="ecl-tag"
href="/example"
>
tag 1
</a>
</li>
<li
class="ecl-content-block__tag-item"
>
<a
class="ecl-tag"
href="/example"
>
tag 2
</a>
</li>
<li
class="ecl-content-block__tag-item"
>
<a
class="ecl-tag"
href="/example"
>
tag 3
</a>
</li>
</ul>
<div
class="ecl-content-block__list-container"
>
Expand Down
2 changes: 1 addition & 1 deletion src/implementations/twig/components/card/card.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
...
]
- "tags" (array) (default: []): Array of ECL Tags
- "tags" (array) (default: []): Array of ECL Tags (deprecated)
- "lists" (array) (default: []): Array of ECL Description list
- "extra_classes" (string) (default: '')
- "extra_attributes" (array) (default: []): format: [
Expand Down
15 changes: 0 additions & 15 deletions src/implementations/twig/components/card/card.story.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ import card from './card.html.twig';
import notes from './README.md';

const dataCardDefault = JSON.parse(JSON.stringify(dataCard));
delete dataCardDefault.tags;
delete dataCardDefault.lists;

const dataCardTags = JSON.parse(JSON.stringify(dataCard));
delete dataCardTags.lists;

const dataCardLists = JSON.parse(JSON.stringify(dataCard));
delete dataCardLists.tags;

const getArgs = (data) => {
const args = {};
Expand All @@ -39,9 +37,6 @@ const getArgs = (data) => {
if (data.secondary_meta) {
args.show_secondary_meta = true;
}
if (data.tags) {
args.show_tags = !!data.tags;
}
if (data.lists) {
args.show_lists = !!data.lists;
}
Expand Down Expand Up @@ -195,9 +190,6 @@ const prepareData = (data, args) => {
if (!args.show_secondary_meta) {
delete clone.secondary_meta;
}
if (!args.show_tags) {
delete clone.tags;
}
if (!args.title_link) {
delete clone.title.link;
}
Expand Down Expand Up @@ -232,13 +224,6 @@ Default.args = getArgs(dataCardDefault);
Default.argTypes = getArgTypes(dataCardDefault);
Default.parameters = { notes: { markdown: notes, json: dataCardDefault } };

export const Tags = (args) => card(prepareData(dataCardTags, args));

Tags.storyName = 'tags';
Tags.args = getArgs(dataCardTags);
Tags.argTypes = getArgTypes(dataCardTags);
Tags.parameters = { notes: { markdown: notes, json: dataCardTags } };

export const Lists = (args) => card(prepareData(dataCardLists, args));

Lists.storyName = 'lists';
Expand Down
13 changes: 1 addition & 12 deletions src/implementations/twig/components/content-block/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ npm install --save @ecl/twig-component-content-block
},
...
]
- **tags** (array) (default: []): Array of ECL Tags
- **tags** (array) (default: []): Array of ECL Tags (deprecated)
- **links** (array) (default: []): Array or multi array of ECL Links
- **lists** (array) (default: []): Array of ECL Description list
- **"extra_classes"** (string) (default: '')
Expand Down Expand Up @@ -63,17 +63,6 @@ npm install --save @ecl/twig-component-content-block
label: 'Luxembourg',
},
],
tags: [
{
tag: { label: 'tag 1', path: exampleLink },
},
{
tag: { label: 'tag 2', path: exampleLink },
},
{
tag: { label: 'tag 3', path: exampleLink },
},
],
links: [
[
{
Expand Down
Loading

1 comment on commit 47bfa27

@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.