fix: breadcrumbs issues on many screens (#1441)
* fix: breadcrumbs issues on many screens * lint fix * minor lint fix
This commit is contained in:
@@ -51,12 +51,14 @@ const routes: Routes = [
|
|||||||
{
|
{
|
||||||
path: ':centerId',
|
path: ':centerId',
|
||||||
data: { title: extract('Centers View'), routeParamBreadcrumb: 'centerId' },
|
data: { title: extract('Centers View'), routeParamBreadcrumb: 'centerId' },
|
||||||
|
resolve: {
|
||||||
|
centerViewData: CenterViewResolver,
|
||||||
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: CentersViewComponent,
|
component: CentersViewComponent,
|
||||||
resolve: {
|
resolve: {
|
||||||
centerViewData: CenterViewResolver,
|
|
||||||
centerDatatables: CenterDatatablesResolver
|
centerDatatables: CenterDatatablesResolver
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -176,6 +176,9 @@ const routes: Routes = [
|
|||||||
{
|
{
|
||||||
path: ':clientId',
|
path: ':clientId',
|
||||||
data: { title: extract('Clients View'), routeParamBreadcrumb: 'clientId' },
|
data: { title: extract('Clients View'), routeParamBreadcrumb: 'clientId' },
|
||||||
|
resolve: {
|
||||||
|
clientViewData: ClientViewResolver
|
||||||
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'edit',
|
path: 'edit',
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/** Angular Imports */
|
/** Angular Imports */
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { ActivatedRoute, Router, NavigationEnd } from '@angular/router';
|
import { ActivatedRoute, Router, NavigationEnd, Data } from '@angular/router';
|
||||||
|
|
||||||
/** rxjs Imports */
|
/** rxjs Imports */
|
||||||
import { filter } from 'rxjs/operators';
|
import { filter } from 'rxjs/operators';
|
||||||
@@ -104,6 +104,38 @@ export class BreadcrumbComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
} else if (route.snapshot.data.hasOwnProperty(routeParamBreadcrumb) && route.snapshot.paramMap.get(route.snapshot.data[routeParamBreadcrumb])) {
|
} else if (route.snapshot.data.hasOwnProperty(routeParamBreadcrumb) && route.snapshot.paramMap.get(route.snapshot.data[routeParamBreadcrumb])) {
|
||||||
breadcrumbLabel = route.snapshot.paramMap.get(route.snapshot.data[routeParamBreadcrumb]);
|
breadcrumbLabel = route.snapshot.paramMap.get(route.snapshot.data[routeParamBreadcrumb]);
|
||||||
|
const routeData: Data = route.snapshot.data;
|
||||||
|
if (routeData.breadcrumb === 'Clients') {
|
||||||
|
breadcrumbLabel = routeData.clientViewData.displayName;
|
||||||
|
} else if (routeData.breadcrumb === 'Groups') {
|
||||||
|
breadcrumbLabel = routeData.groupViewData.name;
|
||||||
|
} else if (routeData.breadcrumb === 'Centers') {
|
||||||
|
breadcrumbLabel = routeData.centerViewData.name;
|
||||||
|
} else if (routeData.breadcrumb === 'Loans') {
|
||||||
|
breadcrumbLabel = routeData.loanDetailsData.loanProductName + '(' + routeData.loanDetailsData.accountNo + ')';
|
||||||
|
} else if (routeData.breadcrumb === 'Savings') {
|
||||||
|
breadcrumbLabel = routeData.savingsAccountData.savingsProductName + '(' + routeData.savingsAccountData.accountNo + ')';
|
||||||
|
} else if (routeData.breadcrumb === 'Fixed Deposits') {
|
||||||
|
breadcrumbLabel = routeData.fixedDepositsAccountData.depositProductName + '(' + routeData.fixedDepositsAccountData.accountNo + ')';
|
||||||
|
} else if (routeData.breadcrumb === 'Loan Products') {
|
||||||
|
breadcrumbLabel = routeData.loanProduct.name;
|
||||||
|
} else if (routeData.breadcrumb === 'Charges') {
|
||||||
|
breadcrumbLabel = routeData.charge.name;
|
||||||
|
} else if (routeData.breadcrumb === 'Saving Products') {
|
||||||
|
breadcrumbLabel = routeData.savingProduct.name;
|
||||||
|
} else if (routeData.breadcrumb === 'Share Products') {
|
||||||
|
breadcrumbLabel = routeData.shareProduct.name;
|
||||||
|
} else if (routeData.breadcrumb === 'Fixed Deposit Products') {
|
||||||
|
breadcrumbLabel = routeData.fixedDepositProduct.name;
|
||||||
|
} else if (routeData.breadcrumb === 'Recurring Deposit Products') {
|
||||||
|
breadcrumbLabel = routeData.recurringDepositProduct.name;
|
||||||
|
} else if (routeData.breadcrumb === 'Floating Rates') {
|
||||||
|
breadcrumbLabel = routeData.floatingRate.name;
|
||||||
|
} else if (routeData.breadcrumb === 'Tax Components') {
|
||||||
|
breadcrumbLabel = routeData.taxComponent.name;
|
||||||
|
} else if (routeData.breadcrumb === 'Tax Groups') {
|
||||||
|
breadcrumbLabel = routeData.taxGroup.name;
|
||||||
|
}
|
||||||
} else if (route.snapshot.data.hasOwnProperty(routeDataBreadcrumb)) {
|
} else if (route.snapshot.data.hasOwnProperty(routeDataBreadcrumb)) {
|
||||||
breadcrumbLabel = route.snapshot.data[routeDataBreadcrumb];
|
breadcrumbLabel = route.snapshot.data[routeDataBreadcrumb];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,12 +42,14 @@ const routes: Routes = [
|
|||||||
{
|
{
|
||||||
path: ':fixedDepositAccountId',
|
path: ':fixedDepositAccountId',
|
||||||
data: { title: extract('Fixed Deposit Account View'), routeParamBreadcrumb: 'fixedDepositAccountId' },
|
data: { title: extract('Fixed Deposit Account View'), routeParamBreadcrumb: 'fixedDepositAccountId' },
|
||||||
|
resolve: {
|
||||||
|
fixedDepositsAccountData: FixedDepositsAccountViewResolver,
|
||||||
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: FixedDepositAccountViewComponent,
|
component: FixedDepositAccountViewComponent,
|
||||||
resolve: {
|
resolve: {
|
||||||
fixedDepositsAccountData: FixedDepositsAccountViewResolver,
|
|
||||||
savingsDatatables: SavingsDatatablesResolver
|
savingsDatatables: SavingsDatatablesResolver
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -53,12 +53,14 @@ const routes: Routes = [
|
|||||||
{
|
{
|
||||||
path: ':groupId',
|
path: ':groupId',
|
||||||
data: { title: extract('View Group'), routeParamBreadcrumb: 'groupId' },
|
data: { title: extract('View Group'), routeParamBreadcrumb: 'groupId' },
|
||||||
|
resolve: {
|
||||||
|
groupViewData: GroupViewResolver
|
||||||
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: GroupsViewComponent,
|
component: GroupsViewComponent,
|
||||||
resolve: {
|
resolve: {
|
||||||
groupViewData: GroupViewResolver,
|
|
||||||
groupDatatables: GroupDatatablesResolver
|
groupDatatables: GroupDatatablesResolver
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -61,12 +61,14 @@ const routes: Routes = [
|
|||||||
{
|
{
|
||||||
path: ':loanId',
|
path: ':loanId',
|
||||||
data: { title: extract('Loan View'), routeParamBreadcrumb: 'loanId' },
|
data: { title: extract('Loan View'), routeParamBreadcrumb: 'loanId' },
|
||||||
|
resolve: {
|
||||||
|
loanDetailsData: LoanDetailsResolver
|
||||||
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: LoansViewComponent,
|
component: LoansViewComponent,
|
||||||
resolve: {
|
resolve: {
|
||||||
loanDetailsData: LoanDetailsResolver,
|
|
||||||
loanDatatables: LoanDatatablesResolver,
|
loanDatatables: LoanDatatablesResolver,
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@@ -128,13 +128,13 @@ const routes: Routes = [
|
|||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
data: { title: extract('View Loan Product'), routeParamBreadcrumb: 'id' },
|
data: { title: extract('View Loan Product'), routeParamBreadcrumb: 'id' },
|
||||||
|
resolve: {
|
||||||
|
loanProduct: LoanProductResolver
|
||||||
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: ViewLoanProductComponent,
|
component: ViewLoanProductComponent,
|
||||||
resolve: {
|
|
||||||
loanProduct: LoanProductResolver
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'edit',
|
path: 'edit',
|
||||||
@@ -170,13 +170,13 @@ const routes: Routes = [
|
|||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
data: { title: extract('View Saving Product'), routeParamBreadcrumb: 'id' },
|
data: { title: extract('View Saving Product'), routeParamBreadcrumb: 'id' },
|
||||||
|
resolve: {
|
||||||
|
savingProduct: SavingProductResolver
|
||||||
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: ViewSavingProductComponent,
|
component: ViewSavingProductComponent,
|
||||||
resolve: {
|
|
||||||
savingProduct: SavingProductResolver
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'edit',
|
path: 'edit',
|
||||||
@@ -212,13 +212,13 @@ const routes: Routes = [
|
|||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
data: { title: extract('View Share Product'), routeParamBreadcrumb: 'id' },
|
data: { title: extract('View Share Product'), routeParamBreadcrumb: 'id' },
|
||||||
|
resolve: {
|
||||||
|
shareProduct: ShareProductResolver
|
||||||
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: ViewShareProductComponent,
|
component: ViewShareProductComponent,
|
||||||
resolve: {
|
|
||||||
shareProduct: ShareProductResolver
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'edit',
|
path: 'edit',
|
||||||
@@ -291,13 +291,13 @@ const routes: Routes = [
|
|||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
data: { title: extract('View Tax Component'), routeParamBreadcrumb: 'id' },
|
data: { title: extract('View Tax Component'), routeParamBreadcrumb: 'id' },
|
||||||
|
resolve: {
|
||||||
|
taxComponent: TaxComponentResolver
|
||||||
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: ViewTaxComponentComponent,
|
component: ViewTaxComponentComponent,
|
||||||
resolve: {
|
|
||||||
taxComponent: TaxComponentResolver
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'edit',
|
path: 'edit',
|
||||||
@@ -333,13 +333,13 @@ const routes: Routes = [
|
|||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
data: { title: extract('View Tax Group'), routeParamBreadcrumb: 'id' },
|
data: { title: extract('View Tax Group'), routeParamBreadcrumb: 'id' },
|
||||||
|
resolve: {
|
||||||
|
taxGroup: TaxGroupResolver
|
||||||
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: ViewTaxGroupComponent,
|
component: ViewTaxGroupComponent,
|
||||||
resolve: {
|
|
||||||
taxGroup: TaxGroupResolver
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'edit',
|
path: 'edit',
|
||||||
@@ -377,12 +377,14 @@ const routes: Routes = [
|
|||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
data: { title: extract('View Recurring Deposit Product'), routeParamBreadcrumb: 'id' },
|
data: { title: extract('View Recurring Deposit Product'), routeParamBreadcrumb: 'id' },
|
||||||
|
resolve: {
|
||||||
|
recurringDepositProduct: RecurringDepositProductResolver
|
||||||
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: ViewRecurringDepositProductComponent,
|
component: ViewRecurringDepositProductComponent,
|
||||||
resolve: {
|
resolve: {
|
||||||
recurringDepositProduct: RecurringDepositProductResolver,
|
|
||||||
recurringDepositProductsTemplate: RecurringDepositProductsTemplateResolver
|
recurringDepositProductsTemplate: RecurringDepositProductsTemplateResolver
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -420,12 +422,14 @@ const routes: Routes = [
|
|||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
data: { title: extract('View Fixed Deposit Product'), routeParamBreadcrumb: 'id' },
|
data: { title: extract('View Fixed Deposit Product'), routeParamBreadcrumb: 'id' },
|
||||||
|
resolve: {
|
||||||
|
fixedDepositProduct: FixedDepositProductResolver,
|
||||||
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: ViewFixedDepositProductComponent,
|
component: ViewFixedDepositProductComponent,
|
||||||
resolve: {
|
resolve: {
|
||||||
fixedDepositProduct: FixedDepositProductResolver,
|
|
||||||
fixedDepositProductsTemplate: FixedDepositProductsTemplateResolver
|
fixedDepositProductsTemplate: FixedDepositProductsTemplateResolver
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -463,13 +467,13 @@ const routes: Routes = [
|
|||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
data: { title: extract('View Product Mix'), routeParamBreadcrumb: 'id'},
|
data: { title: extract('View Product Mix'), routeParamBreadcrumb: 'id'},
|
||||||
|
resolve: {
|
||||||
|
productMix: ViewProductMixResolver
|
||||||
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: ViewProductMixComponent,
|
component: ViewProductMixComponent,
|
||||||
resolve: {
|
|
||||||
productMix: ViewProductMixResolver
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'edit',
|
path: 'edit',
|
||||||
@@ -502,13 +506,13 @@ const routes: Routes = [
|
|||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
data: { title: extract('View Floating Rate'), routeParamBreadcrumb: 'id' },
|
data: { title: extract('View Floating Rate'), routeParamBreadcrumb: 'id' },
|
||||||
|
resolve: {
|
||||||
|
floatingRate: FloatingRateResolver
|
||||||
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: ViewFloatingRateComponent,
|
component: ViewFloatingRateComponent,
|
||||||
resolve: {
|
|
||||||
floatingRate: FloatingRateResolver
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'edit',
|
path: 'edit',
|
||||||
@@ -544,13 +548,13 @@ const routes: Routes = [
|
|||||||
{
|
{
|
||||||
path: ':id',
|
path: ':id',
|
||||||
data: { title: extract('View Charges'), routeParamBreadcrumb: 'id' },
|
data: { title: extract('View Charges'), routeParamBreadcrumb: 'id' },
|
||||||
|
resolve: {
|
||||||
|
charge: ChargeResolver
|
||||||
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: ViewChargeComponent,
|
component: ViewChargeComponent,
|
||||||
resolve: {
|
|
||||||
charge: ChargeResolver
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'edit',
|
path: 'edit',
|
||||||
|
|||||||
@@ -49,12 +49,14 @@ const routes: Routes = [
|
|||||||
{
|
{
|
||||||
path: ':savingAccountId',
|
path: ':savingAccountId',
|
||||||
data: { title: extract('Saving Account View'), routeParamBreadcrumb: 'savingAccountId' },
|
data: { title: extract('Saving Account View'), routeParamBreadcrumb: 'savingAccountId' },
|
||||||
|
resolve: {
|
||||||
|
savingsAccountData: SavingsAccountViewResolver
|
||||||
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: SavingsAccountViewComponent,
|
component: SavingsAccountViewComponent,
|
||||||
resolve: {
|
resolve: {
|
||||||
savingsAccountData: SavingsAccountViewResolver,
|
|
||||||
savingsDatatables: SavingsDatatablesResolver
|
savingsDatatables: SavingsDatatablesResolver
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
Reference in New Issue
Block a user