Skip to content

Commit

Permalink
Update storybook story
Browse files Browse the repository at this point in the history
  • Loading branch information
Quetzacoalt91 committed Oct 30, 2024
1 parent 1ed1fb8 commit 5b74224
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
26 changes: 22 additions & 4 deletions storybook/stories/pages/UpdateOptions.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,30 @@ export const UpdateOptions = {
code: "update-options",
title: "Update options",
},
default_deactive_non_native_modules: true,
default_regenerate_email_templates: true,
switch_the_theme: 1,
disable_all_overrides: false,
form_fields: {
deactive_non_native_modules: {
field: 'PS_AUTOUP_CUSTOM_MOD_DESACT',
value: true,
},
regenerate_email_templates: {
field: 'PS_AUTOUP_REGEN_EMAIL',
value: true,
},
disable_all_overrides: {
field: 'PS_DISABLE_OVERRIDES',
value: false,
},
},
step_parent_id: "ua_container",
stepper_parent_id: "stepper_content",

form_route_to_save: "update-step-update-options-save-option",
form_route_to_submit: "update-step-update-options-submit-form",

error: {
'PS_AUTOUP_REGEN_EMAIL': 'Example of an error that occured when switching the value!',
},

// Stepper
...Stepper.args,
},
Expand Down
6 changes: 3 additions & 3 deletions views/templates/steps/update-options.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
description: "All the modules installed after creating your store are considered non-native modules. They might be " ~
"incompatible with the new version of PrestaShop. We recommend deactivating them during the update.",
value: form_fields.deactive_non_native_modules.value,
error_message: error[form_fields.deactive_non_native_modules.field],
error_message: error[form_fields.deactive_non_native_modules.field] is defined ? error[form_fields.deactive_non_native_modules.field] : null,
} %}

{% include "@ModuleAutoUpgrade/components/render-switch.html.twig" with {
Expand All @@ -31,7 +31,7 @@
title: "Regenerate email templates",
description: "If you've customized email templates, your changes will be lost if you activate this option.",
value: form_fields.regenerate_email_templates.value,
error_message: error[form_fields.regenerate_email_templates.field],
error_message: error[form_fields.regenerate_email_templates.field] is defined ? error[form_fields.regenerate_email_templates.field] : null,
} %}

{% include "@ModuleAutoUpgrade/components/render-switch.html.twig" with {
Expand All @@ -42,7 +42,7 @@
"one method or as many as you need. This option disables all classes & controllers overrides, allowing " ~
"you to avoid conflicts during and after updates.",
value: form_fields.disable_all_overrides.value,
error_message: error[form_fields.disable_all_overrides.field],
error_message: error[form_fields.disable_all_overrides.field] is defined ? error[form_fields.disable_all_overrides.field] : null,
} %}
</form>
{% endblock %}
Expand Down

0 comments on commit 5b74224

Please sign in to comment.