mirror of
https://github.com/pretix/pretix.git
synced 2026-05-03 14:54:04 +00:00
Improve UI to configure unavailable items handling (Z#23131828) (#3739)
* start impl of unavailability modes ui * add db migration * use new widget for more fields * improve contrast * use new widget for hide_without_voucher field * improved wording * rebase migration * undo changes to require_membership_hidden * code formatting * move unavail_reason logic around * enforce consistent state of hide_without_voucher / require_voucher * annotate unavailability info in get_grouped_items * remove MSIE6 compat * add unavailability reasons to widget * remove test output * Apply suggestions from code review text improvements Co-authored-by: Richard Schreiber <schreiber@rami.io> * add css fix for jumping items due to tooltip * dynamically retrieve unavailability reason message * widget: simplify logic conditions * add available_{from,until}_mode to api and api docs * rebase migration * rebase migration * add unavailable_*_mode to ItemVariation * add available_*_mode to API docs for items * fix wrong reference * fix test cases * add available_*_mode to item variation form * apply unavailability modes to subevents and variations (presale) * /o\ * apply unavailability modes to subevents and variations (widget) * display unavailability mode in subevent product settings * fix widget test * fix api item tests * copy available_*_mode when copying an item * Apply suggestions from code review Co-authored-by: Raphael Michel <michel@rami.io> * Add unavail mode indicator to bulk create and edit forms --------- Co-authored-by: Richard Schreiber <schreiber@rami.io> Co-authored-by: Raphael Michel <michel@rami.io>
This commit is contained in:
@@ -270,6 +270,8 @@ TEST_ITEM_RES = {
|
||||
"picture": None,
|
||||
"available_from": None,
|
||||
"available_until": None,
|
||||
"available_from_mode": "hide",
|
||||
"available_until_mode": "hide",
|
||||
"require_bundling": False,
|
||||
"require_voucher": False,
|
||||
"hide_without_voucher": False,
|
||||
@@ -401,6 +403,8 @@ def test_item_detail_variations(token_client, organizer, event, team, item):
|
||||
"sales_channels": list(get_all_sales_channels().keys()),
|
||||
"available_from": None,
|
||||
"available_until": None,
|
||||
"available_from_mode": "hide",
|
||||
"available_until_mode": "hide",
|
||||
"hide_without_voucher": False,
|
||||
"original_price": None,
|
||||
"meta_data": {}
|
||||
@@ -1330,6 +1334,8 @@ TEST_VARIATIONS_RES = {
|
||||
"sales_channels": list(get_all_sales_channels().keys()),
|
||||
"available_from": None,
|
||||
"available_until": None,
|
||||
"available_from_mode": "hide",
|
||||
"available_until_mode": "hide",
|
||||
"hide_without_voucher": False,
|
||||
"original_price": None,
|
||||
"free_price_suggestion": None,
|
||||
@@ -1353,6 +1359,8 @@ TEST_VARIATIONS_UPDATE = {
|
||||
"sales_channels": ["web"],
|
||||
"available_from": None,
|
||||
"available_until": None,
|
||||
"available_from_mode": "hide",
|
||||
"available_until_mode": "hide",
|
||||
"hide_without_voucher": False,
|
||||
"original_price": None,
|
||||
"free_price_suggestion": None,
|
||||
|
||||
@@ -186,7 +186,7 @@ class WidgetCartTest(CartTestMixin, TestCase):
|
||||
{
|
||||
"items": [
|
||||
{
|
||||
"require_voucher": False,
|
||||
"current_unavailability_reason": None,
|
||||
"order_min": None,
|
||||
"max_price": None,
|
||||
"price": {"gross": "23.00", "net": "19.33", "tax": "3.67", "name": "", "rate": "19.00", "includes_mixed_tax_rate": False},
|
||||
@@ -207,7 +207,7 @@ class WidgetCartTest(CartTestMixin, TestCase):
|
||||
"order_max": 4
|
||||
},
|
||||
{
|
||||
"require_voucher": False,
|
||||
"current_unavailability_reason": None,
|
||||
"order_min": None,
|
||||
"max_price": "14.00",
|
||||
"price": None,
|
||||
@@ -231,7 +231,8 @@ class WidgetCartTest(CartTestMixin, TestCase):
|
||||
"rate": "19.00", "includes_mixed_tax_rate": False},
|
||||
"description": None,
|
||||
"avail": [100, None],
|
||||
"order_max": 2
|
||||
"order_max": 2,
|
||||
"current_unavailability_reason": None,
|
||||
},
|
||||
{
|
||||
"value": "Blue",
|
||||
@@ -243,7 +244,8 @@ class WidgetCartTest(CartTestMixin, TestCase):
|
||||
"rate": "19.00", "includes_mixed_tax_rate": False},
|
||||
"description": None,
|
||||
"avail": [100, None],
|
||||
"order_max": 2
|
||||
"order_max": 2,
|
||||
"current_unavailability_reason": None,
|
||||
}
|
||||
],
|
||||
"id": self.shirt.pk,
|
||||
@@ -273,7 +275,7 @@ class WidgetCartTest(CartTestMixin, TestCase):
|
||||
{
|
||||
"items": [
|
||||
{
|
||||
"require_voucher": False,
|
||||
"current_unavailability_reason": None,
|
||||
"order_min": None,
|
||||
"max_price": None,
|
||||
"price": {"gross": "23.00", "net": "19.33", "tax": "3.67", "name": "", "rate": "19.00",
|
||||
@@ -322,7 +324,7 @@ class WidgetCartTest(CartTestMixin, TestCase):
|
||||
{
|
||||
"items": [
|
||||
{
|
||||
"require_voucher": False,
|
||||
"current_unavailability_reason": None,
|
||||
"order_min": None,
|
||||
"max_price": "14.00",
|
||||
"price": None,
|
||||
@@ -346,7 +348,8 @@ class WidgetCartTest(CartTestMixin, TestCase):
|
||||
"rate": "19.00", "includes_mixed_tax_rate": False},
|
||||
"description": None,
|
||||
"avail": [100, None],
|
||||
"order_max": 2
|
||||
"order_max": 2,
|
||||
"current_unavailability_reason": None,
|
||||
}
|
||||
],
|
||||
"id": self.shirt.pk,
|
||||
@@ -389,7 +392,7 @@ class WidgetCartTest(CartTestMixin, TestCase):
|
||||
{
|
||||
"items": [
|
||||
{
|
||||
"require_voucher": False,
|
||||
"current_unavailability_reason": None,
|
||||
"order_min": None,
|
||||
"max_price": None,
|
||||
"price": {"gross": "23.00", "net": "19.33", "tax": "3.67", "name": "", "rate": "19.00", "includes_mixed_tax_rate": False},
|
||||
@@ -457,7 +460,7 @@ class WidgetCartTest(CartTestMixin, TestCase):
|
||||
'has_variations': 2,
|
||||
"allow_waitinglist": True,
|
||||
"mandatory_priced_addons": False,
|
||||
'require_voucher': False,
|
||||
'current_unavailability_reason': None,
|
||||
'order_min': None,
|
||||
'order_max': None,
|
||||
'price': None,
|
||||
@@ -490,7 +493,8 @@ class WidgetCartTest(CartTestMixin, TestCase):
|
||||
'name': '',
|
||||
'includes_mixed_tax_rate': False
|
||||
},
|
||||
'avail': [100, None]
|
||||
'avail': [100, None],
|
||||
'current_unavailability_reason': None,
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user