fix: context-aware back button for cross-module admin navigation
All checks were successful
CI / ruff (push) Successful in 16s
CI / pytest (push) Successful in 2h40m11s
CI / validate (push) Successful in 32s
CI / dependency-scanning (push) Successful in 37s
CI / docs (push) Successful in 49s
CI / deploy (push) Successful in 1m10s

The tenancy merchant detail page now reads an optional ?back= query
parameter to determine the back button destination. Falls back to
/admin/merchants when no param is present (default behavior preserved).

The loyalty merchant detail "View Merchant" link now passes
?back=/admin/loyalty/merchants/{id} so clicking back from the tenancy
page returns to the loyalty context instead of the merchants list.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-23 16:37:28 +01:00
parent f3344b2859
commit edd55cd2fd
2 changed files with 2 additions and 4 deletions

View File

@@ -41,12 +41,10 @@
{{ _('loyalty.admin.merchant_detail.admin_policy') }}
</a>
<a
:href="`/admin/merchants/${merchant?.id}`"
target="_blank"
:href="`/admin/merchants/${merchant?.id}?back=/admin/loyalty/merchants/${merchantId}`"
class="flex items-center px-4 py-2 text-sm font-medium leading-5 text-gray-700 transition-colors duration-150 bg-gray-100 border border-gray-300 rounded-lg hover:bg-gray-200 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-600 dark:hover:bg-gray-600">
<span x-html="$icon('building-office', 'w-4 h-4 mr-2')"></span>
{{ _('loyalty.admin.merchant_detail.view_merchant') }}
<span x-html="$icon('arrow-top-right-on-square', 'w-3 h-3 ml-1 opacity-50')"></span>
</a>
<a x-show="program"
:href="`/admin/loyalty/merchants/${merchantId}/cards`"