Skip to content

Commit

Permalink
feat: order buttons by priority
Browse files Browse the repository at this point in the history
  • Loading branch information
blaggacao committed Jul 10, 2024
1 parent 1c35421 commit d8239fe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
13 changes: 10 additions & 3 deletions payments/payments/doctype/payment_button/payment_button.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"column_break_mjuo",
"label",
"enabled",
"priority",
"button_configuration_section",
"column_break_zwhf",
"icon",
Expand Down Expand Up @@ -133,11 +134,17 @@
"label": "Payment Gateway",
"options": "Payment Gateway",
"reqd": 1
},
{
"fieldname": "priority",
"fieldtype": "Int",
"in_list_view": 1,
"label": "Priority"
}
],
"image_field": "icon",
"links": [],
"modified": "2024-07-07 11:59:22.360602",
"modified": "2024-07-10 05:38:57.786232",
"modified_by": "Administrator",
"module": "Payments",
"name": "Payment Button",
Expand All @@ -163,7 +170,7 @@
}
],
"quick_entry": 1,
"sort_field": "modified",
"sort_order": "DESC",
"sort_field": "priority",
"sort_order": "ASC",
"states": []
}
1 change: 1 addition & 0 deletions payments/payments/doctype/payment_button/payment_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class PaymentButton(Document):
implementation_variant: DF.Literal["Third Party Widget", "Data Capture"]
label: DF.Data
payment_gateway: DF.Link
priority: DF.Int
# end: auto-generated types

# Frontend Assets (widget)
Expand Down
1 change: 1 addition & 0 deletions payments/www/pay.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def get_context(context):
"Payment Button",
fields=["name", "icon", "label"],
filters=filters,
order_by="priority",
)

context.payment_buttons = [
Expand Down

0 comments on commit d8239fe

Please sign in to comment.