The store and merchant init-alpine.js derive currentPage from the URL's last segment (e.g., /loyalty/program -> 'program'). Loyalty menu items used prefixed IDs like 'loyalty-program' which never matched, so sidebar items never highlighted. Fixed by renaming all store/merchant menu item IDs and JS currentPage values to match URL segments: program, cards, analytics, transactions, pins, settings — consistent with how every other module works. Also reverted the init-alpine.js guard that broke storeCode extraction, and added missing loyalty.common.contact_admin_setup translation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
19 lines
672 B
JavaScript
19 lines
672 B
JavaScript
// app/modules/loyalty/static/merchant/js/loyalty-cards.js
|
|
// noqa: js-006 - async init pattern is safe, loadData has try/catch
|
|
|
|
const merchantCardsLog = window.LogConfig.loggers.merchantCards || window.LogConfig.createLogger('merchantCards');
|
|
|
|
function merchantLoyaltyCards() {
|
|
return loyaltyCardsList({
|
|
apiPrefix: '/merchants/loyalty',
|
|
baseUrl: '/merchants/loyalty/cards',
|
|
showStoreFilter: true,
|
|
currentPage: 'cards',
|
|
});
|
|
}
|
|
|
|
if (!window.LogConfig.loggers.merchantCards) {
|
|
window.LogConfig.loggers.merchantCards = window.LogConfig.createLogger('merchantCards');
|
|
}
|
|
merchantCardsLog.info('Merchant loyalty cards module loaded');
|