taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 3209f7084536289b9285ffcf15bf969ac204d390
parent a6213136523addf2ed9113a127d7e99cfcd35a48
Author: Sebastian <sebasjm@gmail.com>
Date:   Tue, 18 Nov 2025 16:59:32 -0300

fix: template should not be on ecommerce

Diffstat:
Mpackages/merchant-backoffice-ui/src/components/menu/SideBar.tsx | 97+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------
1 file changed, 83 insertions(+), 14 deletions(-)

diff --git a/packages/merchant-backoffice-ui/src/components/menu/SideBar.tsx b/packages/merchant-backoffice-ui/src/components/menu/SideBar.tsx @@ -393,14 +393,17 @@ export function Sidebar({ mobile }: Props): VNode { } type ElementMap = { - [sdt in UIElement]?: true; + [sdt in UIElement]: boolean; }; const ALL_ELEMENTS = Object.values(UIElement).reduce((prev, ui) => { prev[ui as UIElement] = true; return prev; }, {} as ElementMap); + function getAvailableForPersona(p: MerchantPersona): ElementMap { switch (p) { + case "developer": + return ALL_ELEMENTS; case "expert": return { [UIElement.sidebar_orders]: true, @@ -411,9 +414,6 @@ function getAvailableForPersona(p: MerchantPersona): ElementMap { [UIElement.sidebar_password]: true, [UIElement.sidebar_accessTokens]: true, [UIElement.sidebar_categories]: true, - // [UIElement.sidebar_discounts]: true, - // [UIElement.sidebar_subscriptions]: true, - // [UIElement.sidebar_tokenFamilies]: true, [UIElement.sidebar_webhooks]: true, [UIElement.sidebar_wireTransfers]: true, [UIElement.sidebar_inventory]: true, @@ -423,12 +423,14 @@ function getAvailableForPersona(p: MerchantPersona): ElementMap { [UIElement.option_advanceOrderCreation]: true, [UIElement.option_otpDevicesOnTemplate]: true, [UIElement.option_paymentTimeoutOnTemplate]: true, - // [UIElement.option_ageRestriction]: true, [UIElement.action_useRevenueApi]: true, [UIElement.option_inventoryTaxes]: true, + + [UIElement.sidebar_discounts]: false, + [UIElement.sidebar_subscriptions]: false, + [UIElement.sidebar_tokenFamilies]: false, + [UIElement.option_ageRestriction]: false, }; - case "developer": - return ALL_ELEMENTS; case "offline-vending-machine": return { [UIElement.sidebar_orders]: true, @@ -437,42 +439,109 @@ function getAvailableForPersona(p: MerchantPersona): ElementMap { [UIElement.sidebar_bankAccounts]: true, [UIElement.sidebar_settings]: true, [UIElement.sidebar_password]: true, + + [UIElement.sidebar_accessTokens]: false, + [UIElement.sidebar_categories]: false, + [UIElement.sidebar_discounts]: false, + [UIElement.sidebar_subscriptions]: false, + [UIElement.sidebar_tokenFamilies]: false, + [UIElement.sidebar_webhooks]: false, + [UIElement.sidebar_wireTransfers]: false, + [UIElement.sidebar_inventory]: false, + [UIElement.sidebar_otpDevices]: false, + [UIElement.action_createOrderManually]: false, + [UIElement.option_advanceInstanceSettings]: false, + [UIElement.option_advanceOrderCreation]: false, + [UIElement.option_otpDevicesOnTemplate]: false, + [UIElement.option_paymentTimeoutOnTemplate]: false, + [UIElement.option_ageRestriction]: false, + [UIElement.action_useRevenueApi]: false, + [UIElement.option_inventoryTaxes]: false, + }; + // case "inperson-vending-with-inventory": case "point-of-sale": return { [UIElement.sidebar_orders]: true, [UIElement.sidebar_templates]: true, [UIElement.sidebar_inventory]: true, [UIElement.sidebar_categories]: true, + [UIElement.sidebar_accessTokens]: true, [UIElement.sidebar_kycStatus]: true, [UIElement.sidebar_bankAccounts]: true, [UIElement.sidebar_settings]: true, [UIElement.sidebar_password]: true, + + [UIElement.sidebar_discounts]: false, + [UIElement.sidebar_subscriptions]: false, + [UIElement.sidebar_tokenFamilies]: false, + [UIElement.sidebar_webhooks]: false, + [UIElement.sidebar_wireTransfers]: false, + [UIElement.sidebar_otpDevices]: false, + [UIElement.action_createOrderManually]: false, + [UIElement.option_advanceInstanceSettings]: false, + [UIElement.option_advanceOrderCreation]: false, + [UIElement.option_otpDevicesOnTemplate]: false, + [UIElement.option_paymentTimeoutOnTemplate]: false, + [UIElement.option_ageRestriction]: false, + [UIElement.action_useRevenueApi]: false, + [UIElement.option_inventoryTaxes]: false, }; case "digital-publishing": return { [UIElement.sidebar_orders]: true, - [UIElement.sidebar_templates]: true, - // only once v1.6 - // [UIElement.sidebar_tokenFamilies]: true, + [UIElement.sidebar_accessTokens]: true, [UIElement.sidebar_kycStatus]: true, [UIElement.sidebar_bankAccounts]: true, [UIElement.sidebar_settings]: true, [UIElement.sidebar_password]: true, - }; + + [UIElement.sidebar_templates]: false, + [UIElement.sidebar_categories]: false, + [UIElement.sidebar_discounts]: false, + [UIElement.sidebar_subscriptions]: false, + [UIElement.sidebar_tokenFamilies]: false, + [UIElement.sidebar_webhooks]: false, + [UIElement.sidebar_wireTransfers]: false, + [UIElement.sidebar_inventory]: false, + [UIElement.sidebar_otpDevices]: false, + [UIElement.action_createOrderManually]: false, + [UIElement.option_advanceInstanceSettings]: false, + [UIElement.option_advanceOrderCreation]: false, + [UIElement.option_otpDevicesOnTemplate]: false, + [UIElement.option_paymentTimeoutOnTemplate]: false, + [UIElement.option_ageRestriction]: false, + [UIElement.action_useRevenueApi]: false, + [UIElement.option_inventoryTaxes]: false, + }; case "e-commerce": return { [UIElement.sidebar_orders]: true, - [UIElement.sidebar_templates]: true, - // only once v1.6 - // [UIElement.sidebar_tokenFamilies]: true, [UIElement.sidebar_webhooks]: true, [UIElement.sidebar_accessTokens]: true, [UIElement.sidebar_kycStatus]: true, [UIElement.sidebar_bankAccounts]: true, [UIElement.sidebar_settings]: true, [UIElement.sidebar_password]: true, + + + [UIElement.sidebar_templates]: false, + [UIElement.sidebar_categories]: false, + [UIElement.sidebar_discounts]: false, + [UIElement.sidebar_subscriptions]: false, + [UIElement.sidebar_tokenFamilies]: false, + [UIElement.sidebar_wireTransfers]: false, + [UIElement.sidebar_inventory]: false, + [UIElement.sidebar_otpDevices]: false, + [UIElement.action_createOrderManually]: false, + [UIElement.option_advanceInstanceSettings]: false, + [UIElement.option_advanceOrderCreation]: false, + [UIElement.option_otpDevicesOnTemplate]: false, + [UIElement.option_paymentTimeoutOnTemplate]: false, + [UIElement.option_ageRestriction]: false, + [UIElement.action_useRevenueApi]: false, + [UIElement.option_inventoryTaxes]: false, }; } }