Skip to content

Commit

Permalink
Merge pull request #437 from PrestaShop/develop
Browse files Browse the repository at this point in the history
Release 0.1.3
  • Loading branch information
Hlavtox authored Jan 22, 2023
2 parents 747e7c0 + 9aa972c commit be85a07
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/theme.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: hummingbird
display_name: Hummingbird
version: 0.1.0
version: 0.1.3
author:
name: "PrestaShop Team"
email: "[email protected]"
Expand Down
9 changes: 5 additions & 4 deletions modules/ps_customersignin/ps_customersignin.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@
<div class="user-info">
{if $customer.is_logged}
<div class="dropdown header-block">
<button
<a
href="#"
class="dropdown-toggle header-block__action-btn"
type="button"
role="button"
id="userMenuButton"
data-bs-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false">
<i class="material-icons header-block__icon">&#xE7FD;</i>
<span class="header-block__title">{$customerName|truncate:22:"..":true}</span>
</button>
<span class="header-block__title d-lg-inline d-none">{$customerName|truncate:22:"..":true}</span>
</a>

<div class="dropdown-menu dropdown-menu-start" aria-labelledby="userMenuButton">
<a class="dropdown-item" href="{$urls.pages.my_account}">
Expand Down
19 changes: 19 additions & 0 deletions src/js/errors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

import useToast from './components/useToast';

const initErrorHandler = () => {
const {Theme: {events}} = window;
const {prestashop} = window;

prestashop.on(events.handleError, ({resp}: {resp: {errors: string[]}}) => {
resp.errors.forEach((error) => {
useToast(error, {type: 'danger'}).show();
});
});
};

export default initErrorHandler;
3 changes: 3 additions & 0 deletions src/js/modules/facetedsearch/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* file that was distributed with this source code.
*/

import useQuantityInput from '@js/components/useQuantityInput';

// @TODO(NeOMakinG): Refactor this file, it comes from facetedsearch or classic
export const parseSearchUrl = function (event: {target: HTMLElement}) {
if (event.target.dataset.searchUrl !== undefined) {
Expand Down Expand Up @@ -96,6 +98,7 @@ export default () => {

prestashop.on(events.updateProductList, (data: Record<string, never>) => {
updateProductListDOM(data);
useQuantityInput();
window.scrollTo(0, 0);
});
};
2 changes: 2 additions & 0 deletions src/js/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import initSearchbar from './modules/ps_searchbar';
import initLanguageSelector from './modules/ps_languageselector';
import initCurrencySelector from './modules/ps_currencyselector';
import initVisiblePassword from './visible-password';
import initErrorHandler from './errors';
import useToast from './components/useToast';
import useAlert from './components/useAlert';
import usePasswordPolicy from './components/usePasswordPolicy';
Expand Down Expand Up @@ -51,6 +52,7 @@ $(() => {
initVisiblePassword();
initDesktopMenu();
initFormValidation();
initErrorHandler();
usePasswordPolicy('.field-password-policy');

prestashop.on(events.responsiveUpdate, () => {
Expand Down

0 comments on commit be85a07

Please sign in to comment.