test: Product Query & Filter Engine, Item Group Page

- Test for ProductQuery engine and ProductFilters engine
- Test for engine for Item Group too
- Renamed ‘product_configurator’ to ‘variant_selector’
- Cleaned up filters.py
- Modal freeze backdrop lighter only in cart, since there’s nothing over it
- Fixed unusual spacing in variant selector dialog
- Made `get_child_groups_for_website` more readable
- Replaced ‘Configure’ with ‘Select’ for variant selection
This commit is contained in:
marination
2021-08-17 00:48:36 +05:30
parent 34df274bf2
commit 71b0e0a146
16 changed files with 574 additions and 246 deletions

View File

@@ -3,11 +3,11 @@
<div class="mt-5 mb-6">
{% if cart_settings.enable_variants | int %}
<button class="btn btn-primary-light btn-configure font-md"
<button class="btn btn-primary-light btn-configure font-md mr-2"
data-item-code="{{ doc.name }}"
data-item-name="{{ doc.item_name }}"
>
{{ _('Configure') }}
{{ _('Select Variant') }}
</button>
{% endif %}
{% if cart_settings.show_contact_us_button %}

View File

@@ -29,7 +29,7 @@ class ItemConfigure {
});
this.dialog = new frappe.ui.Dialog({
title: __('Configure {0}', [this.item_name]),
title: __('Select Variant for {0}', [this.item_name]),
fields,
on_hide: () => {
set_continue_configuration();
@@ -280,14 +280,14 @@ class ItemConfigure {
}
get_next_attribute_and_values(selected_attributes) {
return this.call('erpnext.e_commerce.product_configurator.utils.get_next_attribute_and_values', {
return this.call('erpnext.e_commerce.variant_selector.utils.get_next_attribute_and_values', {
item_code: this.item_code,
selected_attributes
});
}
get_attributes_and_values() {
return this.call('erpnext.e_commerce.product_configurator.utils.get_attributes_and_values', {
return this.call('erpnext.e_commerce.variant_selector.utils.get_attributes_and_values', {
item_code: this.item_code
});
}
@@ -311,9 +311,9 @@ function set_continue_configuration() {
const { itemCode } = $btn_configure.data();
if (localStorage.getItem(`configure:${itemCode}`)) {
$btn_configure.text(__('Continue Configuration'));
$btn_configure.text(__('Continue Selection'));
} else {
$btn_configure.text(__('Configure'));
$btn_configure.text(__('Select Variant'));
}
}