Skip to content

Commit

Permalink
feat: storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
tblivet committed Dec 18, 2024
1 parent 8aa56df commit b552539
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 3 deletions.
4 changes: 3 additions & 1 deletion _dev/src/scss/components/_scrollable-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ $e: ".scrollable-list";
&__count {
flex-shrink: 0;
min-width: 1.25rem;
padding: 0.0625rem 0.3125rem;
font-size: 0.875rem;
line-height: 1.125rem;
text-align: center;
}

&__scroll {
Expand All @@ -35,7 +37,7 @@ $e: ".scrollable-list";
overflow-y: auto;
border-radius: var(--#{$ua-prefix}border-radius);
font-size: 0.875rem;
line-height: 1.25;
line-height: 1.25rem;
}

&__item {
Expand Down
64 changes: 64 additions & 0 deletions storybook/stories/components/DialogTemperedFiles.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <[email protected]>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/

import DialogTemperedFiles from "../../../views/templates/dialogs/dialog-tempered-files.html.twig";
import { Default as Dialog } from "./Dialog.stories";

export default {
title: "Components/Dialog",
component: DialogTemperedFiles,
};

export const TemperedFiles = {
args: {
...Dialog.args,
title: "List of core alterations",
message: "Some core files have been altered, customization made on these files will be lost during the update.",
missing_files: [
"adminProjetX/autoupgrade/index.php",
"adminProjetX/backups/index.php",
"config/xml/.htaccess",
"config/xml/themes/index.php",
],
altered_files: [
"adminProjetX/themes/new-theme/public/tax.bundle.js",
"adminProjetX/themes/new-theme/public/order_return_states_form.bundle.js",
"adminProjetX/themes/new-theme/public/carrier.bundle.js",
"adminProjetX/themes/new-theme/public/create_product_default_theme.css",
"adminProjetX/themes/new-theme/public/meta.bundle.js",
"adminProjetX/themes/new-theme/public/module.bundle.js",
"adminProjetX/themes/new-theme/public/tax.bundle.js",
"adminProjetX/themes/new-theme/public/order_return_states_form.bundle.js",
"adminProjetX/themes/new-theme/public/carrier.bundle.js",
"adminProjetX/themes/new-theme/public/create_product_default_theme.css",
"adminProjetX/themes/new-theme/public/meta.bundle.js",
"adminProjetX/themes/new-theme/public/module.bundle.js",
],
},
play: async () => {
const dialog = document.querySelector(".dialog");
dialog.showModal();
},
};
4 changes: 2 additions & 2 deletions views/templates/components/scrollable-list.html.twig
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class="scrollable-list">
{% if title is defined and title and not empty %}
{% if title is defined and title is not empty %}
<div class="scrollable-list__header">
<p class="h3">{{ title }}</p>
{% if status is defined and status and not empty %}
{% if status is defined and status is not empty %}
<span class="scrollable-list__count badge badge-{{ status }}">{{ items|length }}</span>
{% endif %}
</div>
Expand Down

0 comments on commit b552539

Please sign in to comment.