123 lines
4.0 KiB
Plaintext
123 lines
4.0 KiB
Plaintext
@page "/pipeline"
|
|
@using Indotalent.Features.Pipeline.Budget.Components
|
|
@using Indotalent.Features.Pipeline.Campaign.Components
|
|
@using Indotalent.Features.Pipeline.Expense.Components
|
|
@using Indotalent.Features.Pipeline.Lead.Components
|
|
@using Indotalent.Features.Pipeline.LeadActivity.Components
|
|
@using Indotalent.Features.Pipeline.LeadContact.Components
|
|
@using Indotalent.Features.Pipeline.SalesRepresentative.Components
|
|
@using Indotalent.Features.Pipeline.SalesTeam.Components
|
|
@using Microsoft.AspNetCore.Authorization
|
|
@using Indotalent.Infrastructure.Authorization.Identity
|
|
@using MudBlazor
|
|
@inject NavigationManager NavigationManager
|
|
|
|
|
|
@attribute [Authorize(Roles = $"{ApplicationRoles.Admin},{ApplicationRoles.Member}")]
|
|
|
|
<style>
|
|
.clean-white-tabs .mud-tabs-toolbar {
|
|
background-color: white !important;
|
|
border-bottom: 2px solid #DCEBFA;
|
|
border-radius: 0px !important;
|
|
}
|
|
|
|
.clean-white-tabs .mud-tab {
|
|
color: #94a3b8 !important;
|
|
text-transform: none;
|
|
font-weight: 500;
|
|
min-width: 140px;
|
|
border-radius: 0px !important;
|
|
}
|
|
|
|
.clean-white-tabs .mud-tab-active {
|
|
color: var(--mud-palette-primary) !important;
|
|
font-weight: 800;
|
|
}
|
|
|
|
.clean-white-tabs .mud-tabs-slider {
|
|
background-color: var(--mud-palette-primary) !important;
|
|
height: 3px !important;
|
|
bottom: 0;
|
|
}
|
|
</style>
|
|
|
|
<MudContainer MaxWidth="MaxWidth.ExtraLarge" Class="mt-2 mb-8">
|
|
<div class="clean-white-tabs">
|
|
<MudTabs Elevation="0"
|
|
ActivePanelIndex="@_activeTabIndex"
|
|
ActivePanelIndexChanged="OnTabChanged"
|
|
ApplyEffectsToContainer="true"
|
|
TabPanelsClass="pt-4"
|
|
ScrollButtons="ScrollButtons.Always">
|
|
|
|
<MudTabPanel Text="Campaign" Icon="@Icons.Material.Outlined.Campaign">
|
|
<CampaignPage />
|
|
</MudTabPanel>
|
|
|
|
<MudTabPanel Text="Budget" Icon="@Icons.Material.Outlined.Paid">
|
|
<BudgetPage />
|
|
</MudTabPanel>
|
|
|
|
<MudTabPanel Text="Expense" Icon="@Icons.Material.Outlined.ReceiptLong">
|
|
<ExpensePage />
|
|
</MudTabPanel>
|
|
|
|
<MudTabPanel Text="Leads" Icon="@Icons.Material.Outlined.FilterAlt">
|
|
<LeadPage />
|
|
</MudTabPanel>
|
|
|
|
<MudTabPanel Text="Lead Contacts" Icon="@Icons.Material.Outlined.ContactPhone">
|
|
<LeadContactPage />
|
|
</MudTabPanel>
|
|
|
|
<MudTabPanel Text="Lead Activities" Icon="@Icons.Material.Outlined.EventNote">
|
|
<LeadActivityPage />
|
|
</MudTabPanel>
|
|
|
|
<MudTabPanel Text="Sales Team" Icon="@Icons.Material.Outlined.Groups">
|
|
<SalesTeamPage />
|
|
</MudTabPanel>
|
|
|
|
<MudTabPanel Text="Sales Rep" Icon="@Icons.Material.Outlined.Badge">
|
|
<SalesRepresentativePage />
|
|
</MudTabPanel>
|
|
|
|
</MudTabs>
|
|
</div>
|
|
</MudContainer>
|
|
|
|
@code {
|
|
private int _activeTabIndex = 0;
|
|
|
|
private readonly Dictionary<int, string> _tabMapping = new()
|
|
{
|
|
{ 0, "campaign" },
|
|
{ 1, "budget" },
|
|
{ 2, "expense" },
|
|
{ 3, "leads" },
|
|
{ 4, "lead-contacts" },
|
|
{ 5, "lead-activities" },
|
|
{ 6, "sales-team" },
|
|
{ 7, "sales-rep" }
|
|
};
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
var uri = NavigationManager.ToAbsoluteUri(NavigationManager.Uri);
|
|
if (Microsoft.AspNetCore.WebUtilities.QueryHelpers.ParseQuery(uri.Query).TryGetValue("tab", out var tabValue))
|
|
{
|
|
var tabStr = tabValue.ToString().ToLower();
|
|
var match = _tabMapping.FirstOrDefault(x => x.Value == tabStr);
|
|
_activeTabIndex = match.Value != null ? match.Key : 0;
|
|
}
|
|
}
|
|
|
|
private void OnTabChanged(int index)
|
|
{
|
|
_activeTabIndex = index;
|
|
_tabMapping.TryGetValue(index, out var tabName);
|
|
|
|
NavigationManager.NavigateTo($"/pipeline?tab={tabName ?? "campaign"}", replace: false);
|
|
}
|
|
} |