Skip to content

Commit

Permalink
Merge pull request #894 from PrestaShop/dev
Browse files Browse the repository at this point in the history
Release 3.13.1
  • Loading branch information
Hlavtox authored Aug 9, 2023
2 parents 42f30f0 + a8784cd commit 02ccda6
Show file tree
Hide file tree
Showing 25 changed files with 538 additions and 457 deletions.
5 changes: 5 additions & 0 deletions _dev/back/blocklayered.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,8 @@
.sortable-ghost {
color: orange;
}
#content.bootstrap {
.form-group-categories .panel {
margin-bottom: 0;
}
}
21 changes: 20 additions & 1 deletion _dev/back/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import './blocklayered.scss';
/* eslint-disable no-unused-vars, no-alert */
window.checkForm = function checkForm() {
let isCategorySelected = false;
let isCategoryControllerSelected = false;
let isControllerSelected = false;
let isFilterSelected = false;

$('#categories-treeview input[type=checkbox]').each(function checkCategoriesCheckboxes() {
Expand All @@ -31,6 +33,15 @@ window.checkForm = function checkForm() {
return true;
});

$('input[name="controllers[]"]').each(function checkPagesCheckboxes() {
if ($(this).prop('checked')) {
isControllerSelected = true;
if ($(this).val() === 'category') {
isCategoryControllerSelected = true;
}
}
});

$('.filter_list_item input[type=checkbox]').each(function checkFilterListCheckboxes() {
if ($(this).prop('checked')) {
isFilterSelected = true;
Expand All @@ -39,12 +50,20 @@ window.checkForm = function checkForm() {
return true;
});

if (!isCategorySelected) {
// If no controller is selected at all
if (!isControllerSelected) {
alert(translations.no_selected_controllers);
return false;
}

// If category controller was checked, but no category is selected
if (isCategoryControllerSelected && !isCategorySelected) {
alert(translations.no_selected_categories);
$('#categories-treeview input[type=checkbox]').first().focus();
return false;
}

// If no filter is selected at all
if (!isFilterSelected) {
alert(translations.no_selected_filters);
$('#filter_list_item input[type=checkbox]').first().focus();
Expand Down
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<module>
<name>ps_facetedsearch</name>
<displayName><![CDATA[Faceted search]]></displayName>
<version><![CDATA[3.13.0]]></version>
<version><![CDATA[3.13.1]]></version>
<description><![CDATA[Displays a block allowing multiple filters.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
Expand Down
Loading

0 comments on commit 02ccda6

Please sign in to comment.