Skip to content

Commit

Permalink
feat: hide loyalty program in sidebar when not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
AbleKSaju committed Aug 22, 2024
1 parent 72c7330 commit 71bd519
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions models/baseModels/AccountingSettings/AccountingSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export class AccountingSettings extends Doc {
enableLead?: boolean;
enableFormCustomization?: boolean;
enableInvoiceReturns?: boolean;
enableLoyaltyProgram?: boolean;
enablePricingRule?: boolean;

static filters: FiltersMap = {
Expand Down Expand Up @@ -56,6 +57,9 @@ export class AccountingSettings extends Doc {
enableInvoiceReturns: () => {
return !!this.enableInvoiceReturns;
},
enableLoyaltyProgram: () => {
return !!this.enableLoyaltyProgram;
},
};

override hidden: HiddenMap = {
Expand Down
7 changes: 7 additions & 0 deletions src/utils/sidebarConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,13 @@ function getCompleteSidebar(): SidebarConfig {
schemaName: 'Item',
filters: routeFilters.SalesItems,
},
{
label: t`Loyalty Program`,
name: 'loyalty-program',
route: '/list/LoyaltyProgram',
schemaName: 'LoyaltyProgram',
hidden: () => !fyo.singles.AccountingSettings?.enableLoyaltyProgram,
},
{
label: t`Lead`,
name: 'lead',
Expand Down

0 comments on commit 71bd519

Please sign in to comment.