sure . will share now.Thanks.
ok great ! Thanks.
There seems to be ambiguity with Dynamic Entity properties.
Basically our issue is : we are unable to call applicationService which is created in Application project. We have created a menu in DashBoarMenuContributor.cs now we want to call the method from the appservice as show in the shared image repository returns null value we are unable to get current user in DashboardContributor.cs file
I am sharing the AppService and the MenuContributor files code here :
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;
namespace Pulsar.Dashboard.Account
{
public class AccountInfoAppService : ApplicationService, IAccountInfoAppService
{
private readonly IRepository<UserAccountsMapping, Guid> _accountRepository;
public AccountInfoAppService(IRepository<UserAccountsMapping, Guid> accountRepository )
{
_accountRepository = accountRepository;
}
public List<string> GetAccId()
{
var list = _accountRepository
.Where(p => p.UserId == CurrentUser.Id.ToString()).Select(x => x.AccountId)
.ToList();
return list;
}
}
}
DashboardMenuContributor.cs
using Abp.Domain.Repositories;
using Pulsar.Dashboard.Account;
using Pulsar.Dashboard.Localization;
using Pulsar.Dashboard.Permissions;
using Pulsar.Dashboard.PulsarEnums;
using Pulsar.Dashboard.PulsarModel;
using Pulsar.Dashboard.Users;
using System;
using System.Threading.Tasks;
using Volo.Abp.Account;
using Volo.Abp.AuditLogging.Web.Navigation;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Identity.Web.Navigation;
using Volo.Abp.IdentityServer.Web.Navigation;
using Volo.Abp.LanguageManagement.Navigation;
using Volo.Abp.SettingManagement.Web.Navigation;
using Volo.Abp.TextTemplateManagement.Web.Navigation;
using Volo.Abp.UI.Navigation;
using Volo.Abp.Users;
using Volo.Saas.Host.Navigation;
namespace Pulsar.Dashboard.Web.Menus
{
public class DashboardMenuContributor : IMenuContributor
{
private readonly IAccountInfoAppService _accountAppService;
public async Task ConfigureMenuAsync(MenuConfigurationContext context)
{
if (context.Menu.Name == StandardMenus.Main)
{
await ConfigureMainMenuAsync(context);
}
}
private async Task ConfigureMainMenuAsync(MenuConfigurationContext context)
{
var l = context.GetLocalizer<DashboardResource>();
//Home
context.Menu.AddItem(
new ApplicationMenuItem(
DashboardMenus.Home,
l["Menu:Home"],
"~/",
icon: "fa fa-home",
order: 1
)
);
context.Menu.AddItem(
new ApplicationMenuItem(
DashboardMenus.Trades,
l["Menu:Trades"],
"~/",
icon: "fa fa-home",
order: 2
)
);
//Trades
context.Menu.AddItem(
new ApplicationMenuItem(
DashboardMenus.Brokers,
l["Menu:Brokers"],
"~/",
icon: "fa fa-home",
order: 3
)
);
if (await context.IsGrantedAsync(DashboardPermissions.Dashboard.Host))
{
//HostDashboard
context.Menu.AddItem(
new ApplicationMenuItem(
DashboardMenus.HostDashboard,
l["Menu:Dashboard"],
"~/HostDashboard",
icon: "fa fa-line-chart",
order: 3
)
);
}
if (await context.IsGrantedAsync(DashboardPermissions.Dashboard.Tenant))
{
//TenantDashboard
var dashboardMenu = context.Menu.AddItem(
new ApplicationMenuItem(
DashboardMenus.TenantDashboard,
l["Menu:Dashboard"],
"~/Dashboard",
icon: "fa fa-line-chart",
order: 3
)
);
var result = _accountAppService.GetAccId();
Console.WriteLine(result);
}
//Administration
var administration = context.Menu.GetAdministration();
administration.Order = 4;
//Administration->Saas
administration.SetSubItemOrder(SaasHostMenuNames.GroupName, 1);
//Administration->Identity
administration.SetSubItemOrder(IdentityMenuNames.GroupName, 2);
//Administration->Identity Server
administration.SetSubItemOrder(AbpIdentityServerMenuNames.GroupName, 3);
//Administration->Language Management
administration.SetSubItemOrder(LanguageManagementMenuNames.GroupName, 4);
//Administration->Text Template Management
administration.SetSubItemOrder(TextTemplateManagementMainMenuNames.GroupName, 5);
//Administration->Audit Logs
administration.SetSubItemOrder(AbpAuditLoggingMainMenuNames.GroupName, 6);
//Administration->Settings
administration.SetSubItemOrder(SettingManagementMenuNames.GroupName, 7);
}
}
}
Please check where _accountAppService.GetAccId(); is called.
Thanks...
What is the process to uninstall Volo.Identity: Open source module ? Can we do it from abp cli ? What is the command ?
I tried that also, but still it shows me null.
using Org.BouncyCastle.Math.EC.Rfc7748;
using Pulsar.Dashboard.Account.Dto;
using Pulsar.Dashboard.PulsarModel;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;
namespace Pulsar.Dashboard.Account
{
public class AccountInfoAppService : ApplicationService, IAccountInfoAppService
{
private readonly IRepository<UserAccountsMapping, Guid> _accountRepository;
public AccountInfoAppService(IRepository<UserAccountsMapping, Guid> accountRepository )
{
_accountRepository = accountRepository;
}
public List<string> GetAccId()
{
var list = _accountRepository
.Where(p => p.UserId == CurrentUser.Id.ToString()).Select(x => x.AccountId)
.ToList();
return list;
}
}
}
Here is the code for MenuContributor.cs where i want to use the AccountInfoAppService.
Is there another way to do this ?
Thanks
ok. Let me uninstall the pro module and check. Thanks.
Yes i removed the above code and its working now. I can see the following dashboard
**I want to build a custom layout like the figure below for the dashboard. What is the best way to go ahead ? which source code module will i need to download to 1. modify existing dashboard layout or 2. To build a custom layout. Can you please provide some pointers ? **