mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-30 23:18:02 +00:00
Chore: Miscellaneous UI review changes
- Added bg (variable) to pages, card space separation visible - Removed `show brand line` in settings, shown by default - Re-arranged settings by importance - View toggling primary colour is grey - Only populate recent searches on successful search - Hit only one server side api, once while searching - List view primary button float right - Discounts takes upper limit eg. 10% and below - Navbar icons only wiggle on qty increase in cart/wishlist - Pay button in SO portal - Remove bottom white space below item full page image, min-height fits to content - List view vertical space between heading and item code - Empty offer subtitle handled
This commit is contained in:
@@ -129,11 +129,15 @@ class ProductFiltersBuilder:
|
||||
min_discount, max_discount = discounts[0], discounts[1]
|
||||
# [25, 60] rounded min max
|
||||
min_range_absolute, max_range_absolute = floor(min_discount), floor(max_discount)
|
||||
|
||||
min_range = int(min_discount - (min_range_absolute % 10)) # 20
|
||||
max_range = int(max_discount - (max_range_absolute % 10)) # 60
|
||||
|
||||
min_range = (min_range + 10) if min_range != min_range_absolute else min_range # 30 (upper limit of 25.89 in range of 10)
|
||||
max_range = (max_range + 10) if max_range != max_range_absolute else max_range # 60
|
||||
|
||||
for discount in range(min_range, (max_range + 1), 10):
|
||||
label = f"{discount}% and above"
|
||||
label = f"{discount}% and below"
|
||||
discount_filters.append([discount, label])
|
||||
|
||||
return discount_filters
|
||||
|
||||
@@ -226,7 +226,7 @@ class TestProductDataEngine(unittest.TestCase):
|
||||
|
||||
self.assertEqual(len(discount_filters[0]), 2)
|
||||
self.assertEqual(discount_filters[0][0], 10)
|
||||
self.assertEqual(discount_filters[0][1], "10% and above")
|
||||
self.assertEqual(discount_filters[0][1], "10% and below")
|
||||
|
||||
def test_product_list_with_discount_filters(self):
|
||||
"Test if discount filters are applied correctly."
|
||||
@@ -261,7 +261,7 @@ class TestProductDataEngine(unittest.TestCase):
|
||||
)
|
||||
items = result.get("items")
|
||||
|
||||
# check if only product with 10% and above discount are fetched in the right order
|
||||
# check if only product with 10% and below discount are fetched in the right order
|
||||
self.assertEqual(len(items), 2)
|
||||
self.assertEqual(items[0].get("item_code"), "Test 13I Laptop")
|
||||
self.assertEqual(items[1].get("item_code"), "Test 12I Laptop")
|
||||
|
||||
Reference in New Issue
Block a user