Skip to content

Commit be85a07

Browse files
authored
Merge pull request #437 from PrestaShop/develop
Release 0.1.3
2 parents 747e7c0 + 9aa972c commit be85a07

File tree

5 files changed

+30
-5
lines changed

5 files changed

+30
-5
lines changed

config/theme.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: hummingbird
22
display_name: Hummingbird
3-
version: 0.1.0
3+
version: 0.1.3
44
author:
55
name: "PrestaShop Team"
66
email: "pub@prestashop.com"

modules/ps_customersignin/ps_customersignin.tpl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@
77
<div class="user-info">
88
{if $customer.is_logged}
99
<div class="dropdown header-block">
10-
<button
10+
<a
11+
href="#"
1112
class="dropdown-toggle header-block__action-btn"
12-
type="button"
13+
role="button"
1314
id="userMenuButton"
1415
data-bs-toggle="dropdown"
1516
aria-haspopup="true"
1617
aria-expanded="false">
1718
<i class="material-icons header-block__icon">&#xE7FD;</i>
18-
<span class="header-block__title">{$customerName|truncate:22:"..":true}</span>
19-
</button>
19+
<span class="header-block__title d-lg-inline d-none">{$customerName|truncate:22:"..":true}</span>
20+
</a>
2021

2122
<div class="dropdown-menu dropdown-menu-start" aria-labelledby="userMenuButton">
2223
<a class="dropdown-item" href="{$urls.pages.my_account}">

src/js/errors.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* For the full copyright and license information, please view the LICENSE
3+
* file that was distributed with this source code.
4+
*/
5+
6+
import useToast from './components/useToast';
7+
8+
const initErrorHandler = () => {
9+
const {Theme: {events}} = window;
10+
const {prestashop} = window;
11+
12+
prestashop.on(events.handleError, ({resp}: {resp: {errors: string[]}}) => {
13+
resp.errors.forEach((error) => {
14+
useToast(error, {type: 'danger'}).show();
15+
});
16+
});
17+
};
18+
19+
export default initErrorHandler;

src/js/modules/facetedsearch/update.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* file that was distributed with this source code.
44
*/
55

6+
import useQuantityInput from '@js/components/useQuantityInput';
7+
68
// @TODO(NeOMakinG): Refactor this file, it comes from facetedsearch or classic
79
export const parseSearchUrl = function (event: {target: HTMLElement}) {
810
if (event.target.dataset.searchUrl !== undefined) {
@@ -96,6 +98,7 @@ export default () => {
9698

9799
prestashop.on(events.updateProductList, (data: Record<string, never>) => {
98100
updateProductListDOM(data);
101+
useQuantityInput();
99102
window.scrollTo(0, 0);
100103
});
101104
};

src/js/theme.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import initSearchbar from './modules/ps_searchbar';
1616
import initLanguageSelector from './modules/ps_languageselector';
1717
import initCurrencySelector from './modules/ps_currencyselector';
1818
import initVisiblePassword from './visible-password';
19+
import initErrorHandler from './errors';
1920
import useToast from './components/useToast';
2021
import useAlert from './components/useAlert';
2122
import usePasswordPolicy from './components/usePasswordPolicy';
@@ -51,6 +52,7 @@ $(() => {
5152
initVisiblePassword();
5253
initDesktopMenu();
5354
initFormValidation();
55+
initErrorHandler();
5456
usePasswordPolicy('.field-password-policy');
5557

5658
prestashop.on(events.responsiveUpdate, () => {

0 commit comments

Comments
 (0)