Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

Commit

Permalink
fix(file): remove button classes - INNO-1560 (#99)
Browse files Browse the repository at this point in the history
* fix(file): remove button classes - INNO-1560

* update snapshots

* turn off logging (causes issues with netlify)
  • Loading branch information
yhuard authored and degliwe committed Jun 24, 2019
1 parent dcd9ee3 commit 3c0a460
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
15 changes: 15 additions & 0 deletions src/ec/.storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const webpack = require('webpack');

module.exports = ({ config, mode }) => {
config.module.rules.push({
test: /\.twig$/,
Expand All @@ -7,5 +9,18 @@ module.exports = ({ config, mode }) => {
// Trick "babel-loader", force it to transpile @ecl-twig addons
config.module.rules[0].exclude = /node_modules\/(?!@ecl-twig\/).*/;

// Make it less verbose
if (mode === 'PRODUCTION') {
// Remove ProgressPlugin (4th plugin)
const plugin = config.plugins.splice(3, 1);

if (!(plugin[0] instanceof webpack.ProgressPlugin)) {
console.error(
'Error: 4th plugin is not ProgressPlugin.\nCheck src/systems/ec/implementations/react/storybook/.storybook/webpack.config.js'
);
return process.exit(1);
}
}

return config;
};
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ exports[`EC - File With translation renders correctly 1`] = `
</div>
</div>
<a
class="ecl-link ecl-link--standalone ecl-link--icon ecl-link--icon-after ecl-file__download ecl-button ecl-button--secondary"
class="ecl-link ecl-link--standalone ecl-link--icon ecl-link--icon-after ecl-file__download"
download=""
href="/example"
>
Expand Down Expand Up @@ -262,7 +262,7 @@ exports[`EC - File With translation renders correctly with extra attributes 1`]
</div>
</div>
<a
class="ecl-link ecl-link--standalone ecl-link--icon ecl-link--icon-after ecl-file__download ecl-button ecl-button--secondary"
class="ecl-link ecl-link--standalone ecl-link--icon ecl-link--icon-after ecl-file__download"
download=""
href="/example"
>
Expand Down Expand Up @@ -485,7 +485,7 @@ exports[`EC - File With translation renders correctly with extra class names 1`]
</div>
</div>
<a
class="ecl-link ecl-link--standalone ecl-link--icon ecl-link--icon-after ecl-file__download ecl-button ecl-button--secondary"
class="ecl-link ecl-link--standalone ecl-link--icon ecl-link--icon-after ecl-file__download"
download=""
href="/example"
>
Expand Down Expand Up @@ -708,7 +708,7 @@ exports[`EC - File Without translation renders correctly 1`] = `
</div>
</div>
<a
class="ecl-link ecl-link--standalone ecl-link--icon ecl-link--icon-after ecl-file__download ecl-button ecl-button--secondary"
class="ecl-link ecl-link--standalone ecl-link--icon ecl-link--icon-after ecl-file__download"
download=""
href="/example"
>
Expand Down Expand Up @@ -771,7 +771,7 @@ exports[`EC - File Without translation renders correctly with extra attributes 1
</div>
</div>
<a
class="ecl-link ecl-link--standalone ecl-link--icon ecl-link--icon-after ecl-file__download ecl-button ecl-button--secondary"
class="ecl-link ecl-link--standalone ecl-link--icon ecl-link--icon-after ecl-file__download"
download=""
href="/example"
>
Expand Down Expand Up @@ -832,7 +832,7 @@ exports[`EC - File Without translation renders correctly with extra class names
</div>
</div>
<a
class="ecl-link ecl-link--standalone ecl-link--icon ecl-link--icon-after ecl-file__download ecl-button ecl-button--secondary"
class="ecl-link ecl-link--standalone ecl-link--icon ecl-link--icon-after ecl-file__download"
download=""
href="/example"
>
Expand Down
2 changes: 1 addition & 1 deletion src/ec/packages/ec-component-file/file.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
type: 'standalone',
icon_position: 'after',
}),
extra_classes: 'ecl-file__download ecl-button ecl-button--secondary',
extra_classes: 'ecl-file__download',
extra_attributes: [{ name: 'download' }]
}) only %}
</div>
Expand Down

0 comments on commit 3c0a460

Please sign in to comment.