Skip to content

Commit f9839bf

Browse files
authored
Merge pull request #466 from PrestaShop/develop
Release 0.1.5
2 parents f9d8f53 + 79a363a commit f9839bf

File tree

16 files changed

+164
-113
lines changed

16 files changed

+164
-113
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.3
3+
version: 0.1.5
44
author:
55
name: "PrestaShop Team"
66
email: "pub@prestashop.com"

modules/ps_emailsubscription/views/templates/hook/ps_emailsubscription-column.tpl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<div class="block_newsletter" id="blockEmailSubscription_{$hookName}">
77
<form action="{$urls.current_url}#blockEmailSubscription_{$hookName}" method="post">
8-
<p id="block-newsletter-label">{l s='Get our latest news and special sales' d='Shop.Theme.Global'}</p>
8+
<p id="block-newsletter-label-{$hookName}">{l s='Get our latest news and special sales' d='Shop.Theme.Global'}</p>
99
<div class="mb-1">
1010
<input
1111
class="btn btn-primary float-end"
@@ -19,7 +19,8 @@
1919
type="email"
2020
value="{$value}"
2121
placeholder="{l s='Your email address' d='Shop.Forms.Labels'}"
22-
aria-labelledby="block-newsletter-label"
22+
aria-labelledby="block-newsletter-label-{$hookName}"
23+
required
2324
>
2425
</div>
2526
<input type="hidden" name="blockHookName" value="{$hookName}" />

modules/ps_emailsubscription/views/templates/hook/ps_emailsubscription.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<div class="container px-1">
1010
<div class="{$componentName}__content row">
1111
<div class="{$componentName}__content__left col-md-5">
12-
<p class="{$componentName}__label">{l s='Get our latest news and special sales' d='Shop.Theme.Global'}</p>
12+
<p id="block-newsletter-label-{$hookName}" class="{$componentName}__label">{l s='Get our latest news and special sales' d='Shop.Theme.Global'}</p>
1313
</div>
1414

1515
<div class="{$componentName}__content__right col-md-7">
@@ -21,7 +21,7 @@
2121
class="form-control"
2222
value="{$value}"
2323
placeholder="{l s='Your email address' d='Shop.Forms.Labels'}"
24-
aria-labelledby="block-newsletter-label"
24+
aria-labelledby="block-newsletter-label-{$hookName}"
2525
required
2626
>
2727

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "prestashop-hummingbird-dev-tools",
3-
"version": "1.0.0",
3+
"version": "0.1.5",
44
"description": "Tools to help while developing the Hummingbird theme",
55
"engines": {
66
"node": ">= 14"

src/js/modules/facetedsearch/index.ts

Lines changed: 45 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,38 +11,60 @@ import filterHandler from './filter-handler';
1111
const initSliders = () => {
1212
const {Theme} = window;
1313

14+
// Get all slider configurations found in the DOM
1415
document.querySelectorAll(Theme.selectors.facetedsearch.filterSlider).forEach((filter: HTMLElement) => {
1516
const container = <target>filter.querySelector(Theme.selectors.facetedsearch.rangeContainer);
17+
18+
// Init basic slider data
19+
let unitPosition = 'suffix';
20+
let unitSymbol = container.dataset.sliderUnit;
21+
let decimalCount = 2;
22+
let decimalSeparator = '.';
23+
let thousandsSeparator = '';
24+
25+
// Specify further if there are more options, currently used for price slider,
26+
// which is the only one providing price specifications.
1627
const options = JSON.parse(<string>container.dataset.sliderSpecifications);
17-
const signPosition = options.positivePattern.indexOf('¤') === 0 ? 'prefix' : 'suffix';
18-
// const sliderType = container.dataset.sliderSpecifications ? 'price' : 'weight';
19-
const sliderDirection = container.dataset.sliderDirection === '1' ? 'rtl' : 'ltr';
28+
29+
if (options !== null) {
30+
// Sign position
31+
if (options.positivePattern !== undefined && options.positivePattern.indexOf('¤') === 0) {
32+
unitPosition = 'prefix';
33+
}
34+
35+
// Unit
36+
if (options.currencySymbol !== undefined) {
37+
unitSymbol = options.currencySymbol;
38+
}
39+
40+
// Separators
41+
if (options.numberSymbols !== undefined) {
42+
decimalSeparator = options.numberSymbols[0];
43+
thousandsSeparator = options.numberSymbols[1];
44+
}
45+
46+
// Decimals
47+
if (options.minFractionDigits !== undefined) {
48+
decimalCount = options.minFractionDigits;
49+
}
50+
}
51+
52+
// Minimum and maximum values
2053
const min = parseInt(<string>container.dataset.sliderMin, 10);
2154
const max = parseInt(<string>container.dataset.sliderMax, 10);
55+
56+
// const sliderType = container.dataset.sliderSpecifications ? 'price' : 'weight';
57+
const sliderDirection = container.dataset.sliderDirection === '1' ? 'rtl' : 'ltr';
58+
2259
// let format;
2360
let initiatedSlider: API;
2461

25-
// Not used for the moment
26-
/* if (sliderType === 'price') {
27-
format = wNumb({
28-
mark: ',',
29-
thousand: ' ',
30-
decimals: 0,
31-
[signPosition]:
32-
signPosition === 'prefix' ? options.currencySymbol : ` ${options.currencySymbol}`,
33-
});
34-
} else if (sliderType === 'weight') {
35-
format = wNumb({
36-
mark: ',',
37-
thousand: ' ',
38-
decimals: 0,
39-
});
40-
} */
41-
62+
// Initialize tooltip format
4263
const tooltipsFormat = wNumb({
43-
decimals: 2,
44-
[signPosition]:
45-
signPosition === 'prefix' ? options.currencySymbol : ` ${options.currencySymbol}`,
64+
mark: decimalSeparator,
65+
thousand: thousandsSeparator,
66+
decimals: decimalCount,
67+
[unitPosition]: unitPosition === 'prefix' ? unitSymbol : ` ${unitSymbol}`,
4668
});
4769

4870
const sliderValues = JSON.parse(<string>container.dataset.sliderValues);

src/js/pages/checkout.ts

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const initCheckout = () => {
1717
const termsModalElement = document.querySelector<HTMLLinkElement>(CheckoutMap.checkoutModal);
1818

1919
// Only UI things, the real toggle is handled by Bootstrap Tabs
20+
// A thing we handle manually is the .active class on the toggling buttons
2021
const toggleStep = (content: HTMLElement, step?: HTMLElement) => {
2122
const currentContent = document.querySelector(CheckoutMap.steps.current);
2223
currentContent?.classList.remove('step--current', 'js-current-step');
@@ -51,18 +52,26 @@ const initCheckout = () => {
5152
});
5253
});
5354

55+
// Initial step settings
5456
steps.forEach((step, index) => {
57+
// Get step content
5558
const stepContent = document.querySelector<HTMLElement>(
5659
CheckoutMap.steps.specificStepContent(step.dataset.step),
5760
);
5861

62+
// Get step selector button (toggler)
63+
const stepButton = step.querySelector<HTMLButtonElement>('button');
64+
5965
if (stepContent) {
66+
// If step is finished, we mark it green
6067
if (stepContent.classList.contains('step--complete')) {
6168
step.classList.add('checkout__steps--success');
6269
}
6370

71+
// Current step will get an active property
6472
if (stepContent.classList.contains('step--current')) {
6573
step.classList.add('checkout__steps--current');
74+
stepButton?.classList.add('active');
6675
const responsiveStep = document.querySelector<HTMLElement>(
6776
CheckoutMap.steps.specificStep(step.dataset.step),
6877
);
@@ -74,14 +83,15 @@ const initCheckout = () => {
7483
if (setProgress) {
7584
setProgress(index + 1);
7685
}
86+
} else {
87+
stepButton?.classList.remove('active');
7788
}
7889

90+
// If the step can be navigated
7991
if (stepContent.classList.contains('step--reachable')) {
80-
const button = step.querySelector<HTMLButtonElement>('button');
81-
82-
button?.classList.add('btn-link');
92+
stepButton?.classList.add('btn-link');
8393

84-
button?.addEventListener('click', () => {
94+
stepButton?.addEventListener('click', () => {
8595
if (setProgress) {
8696
setProgress(index + 1);
8797
}
@@ -90,12 +100,10 @@ const initCheckout = () => {
90100
});
91101
}
92102

103+
// If the step is not finished yet, we disable the navigator
93104
if (stepContent.classList.contains('step--unreachable')) {
94-
const button = step.querySelector<HTMLButtonElement>('button');
95-
96-
button?.setAttribute('disabled', 'true');
97-
98-
button?.addEventListener('click', () => {
105+
stepButton?.setAttribute('disabled', 'true');
106+
stepButton?.addEventListener('click', () => {
99107
toggleStep(stepContent, step);
100108
});
101109
}

src/scss/core/components/_checkout-steps.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,13 @@ $component-name: checkout__steps;
9898
&__mobile {
9999
width: 100%;
100100
}
101+
102+
/* Do not assign any styles to active tab */
103+
.nav-tabs .checkout__steps--success .nav-link.active {
104+
color: var(--bs-success);
105+
}
106+
107+
.nav-tabs .checkout__steps--current .nav-link.active {
108+
color: var(--bs-gray-900);
109+
}
101110
}

src/scss/core/components/_search.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ $component-name: search;
6262

6363
&-widgets {
6464
position: relative;
65-
overflow: visible;
65+
// stylelint-disable-next-line
66+
overflow: visible !important;
6667

6768
@include media-breakpoint-down(md) {
6869
max-width: inherit;

src/scss/core/layout/_header-bottom.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@ $component-name: header-bottom;
66
min-height: 4rem;
77
}
88
}
9+
10+
&__h1 {
11+
font-size: unset;
12+
}
913
}

templates/_partials/header.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<div class="row align-items-center gx-2 {$headerBottomName}__row">
3333
<div class="col-auto logo order-xl-1 ms-lg-0 ms-2 me-lg-0 me-auto">
3434
{if $shop.logo_details}
35-
{if $page.page_name == 'index'}<h1 class="mb-0">{/if}
35+
{if $page.page_name == 'index'}<h1 class="{$headerBottomName}__h1 mb-0">{/if}
3636
{renderLogo}
3737
{if $page.page_name == 'index'}</h1>{/if}
3838
{/if}

0 commit comments

Comments
 (0)