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',
|
||||
data: { title: extract('Centers View'), routeParamBreadcrumb: 'centerId' },
|
||||
resolve: {
|
||||
centerViewData: CenterViewResolver,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: CentersViewComponent,
|
||||
resolve: {
|
||||
centerViewData: CenterViewResolver,
|
||||
centerDatatables: CenterDatatablesResolver
|
||||
},
|
||||
children: [
|
||||
|
||||
@@ -176,6 +176,9 @@ const routes: Routes = [
|
||||
{
|
||||
path: ':clientId',
|
||||
data: { title: extract('Clients View'), routeParamBreadcrumb: 'clientId' },
|
||||
resolve: {
|
||||
clientViewData: ClientViewResolver
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'edit',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Router, NavigationEnd } from '@angular/router';
|
||||
import { ActivatedRoute, Router, NavigationEnd, Data } from '@angular/router';
|
||||
|
||||
/** rxjs Imports */
|
||||
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])) {
|
||||
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)) {
|
||||
breadcrumbLabel = route.snapshot.data[routeDataBreadcrumb];
|
||||
}
|
||||
|
||||
@@ -42,12 +42,14 @@ const routes: Routes = [
|
||||
{
|
||||
path: ':fixedDepositAccountId',
|
||||
data: { title: extract('Fixed Deposit Account View'), routeParamBreadcrumb: 'fixedDepositAccountId' },
|
||||
resolve: {
|
||||
fixedDepositsAccountData: FixedDepositsAccountViewResolver,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: FixedDepositAccountViewComponent,
|
||||
resolve: {
|
||||
fixedDepositsAccountData: FixedDepositsAccountViewResolver,
|
||||
savingsDatatables: SavingsDatatablesResolver
|
||||
},
|
||||
children: [
|
||||
|
||||
@@ -53,12 +53,14 @@ const routes: Routes = [
|
||||
{
|
||||
path: ':groupId',
|
||||
data: { title: extract('View Group'), routeParamBreadcrumb: 'groupId' },
|
||||
resolve: {
|
||||
groupViewData: GroupViewResolver
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: GroupsViewComponent,
|
||||
resolve: {
|
||||
groupViewData: GroupViewResolver,
|
||||
groupDatatables: GroupDatatablesResolver
|
||||
},
|
||||
children: [
|
||||
|
||||
@@ -61,12 +61,14 @@ const routes: Routes = [
|
||||
{
|
||||
path: ':loanId',
|
||||
data: { title: extract('Loan View'), routeParamBreadcrumb: 'loanId' },
|
||||
resolve: {
|
||||
loanDetailsData: LoanDetailsResolver
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: LoansViewComponent,
|
||||
resolve: {
|
||||
loanDetailsData: LoanDetailsResolver,
|
||||
loanDatatables: LoanDatatablesResolver,
|
||||
},
|
||||
children: [
|
||||
|
||||
@@ -128,13 +128,13 @@ const routes: Routes = [
|
||||
{
|
||||
path: ':id',
|
||||
data: { title: extract('View Loan Product'), routeParamBreadcrumb: 'id' },
|
||||
resolve: {
|
||||
loanProduct: LoanProductResolver
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: ViewLoanProductComponent,
|
||||
resolve: {
|
||||
loanProduct: LoanProductResolver
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'edit',
|
||||
@@ -170,13 +170,13 @@ const routes: Routes = [
|
||||
{
|
||||
path: ':id',
|
||||
data: { title: extract('View Saving Product'), routeParamBreadcrumb: 'id' },
|
||||
resolve: {
|
||||
savingProduct: SavingProductResolver
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: ViewSavingProductComponent,
|
||||
resolve: {
|
||||
savingProduct: SavingProductResolver
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'edit',
|
||||
@@ -212,13 +212,13 @@ const routes: Routes = [
|
||||
{
|
||||
path: ':id',
|
||||
data: { title: extract('View Share Product'), routeParamBreadcrumb: 'id' },
|
||||
resolve: {
|
||||
shareProduct: ShareProductResolver
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: ViewShareProductComponent,
|
||||
resolve: {
|
||||
shareProduct: ShareProductResolver
|
||||
},
|
||||
},
|
||||
{
|
||||
path: 'edit',
|
||||
@@ -291,13 +291,13 @@ const routes: Routes = [
|
||||
{
|
||||
path: ':id',
|
||||
data: { title: extract('View Tax Component'), routeParamBreadcrumb: 'id' },
|
||||
resolve: {
|
||||
taxComponent: TaxComponentResolver
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: ViewTaxComponentComponent,
|
||||
resolve: {
|
||||
taxComponent: TaxComponentResolver
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'edit',
|
||||
@@ -333,13 +333,13 @@ const routes: Routes = [
|
||||
{
|
||||
path: ':id',
|
||||
data: { title: extract('View Tax Group'), routeParamBreadcrumb: 'id' },
|
||||
resolve: {
|
||||
taxGroup: TaxGroupResolver
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: ViewTaxGroupComponent,
|
||||
resolve: {
|
||||
taxGroup: TaxGroupResolver
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'edit',
|
||||
@@ -377,12 +377,14 @@ const routes: Routes = [
|
||||
{
|
||||
path: ':id',
|
||||
data: { title: extract('View Recurring Deposit Product'), routeParamBreadcrumb: 'id' },
|
||||
resolve: {
|
||||
recurringDepositProduct: RecurringDepositProductResolver
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: ViewRecurringDepositProductComponent,
|
||||
resolve: {
|
||||
recurringDepositProduct: RecurringDepositProductResolver,
|
||||
recurringDepositProductsTemplate: RecurringDepositProductsTemplateResolver
|
||||
}
|
||||
},
|
||||
@@ -420,12 +422,14 @@ const routes: Routes = [
|
||||
{
|
||||
path: ':id',
|
||||
data: { title: extract('View Fixed Deposit Product'), routeParamBreadcrumb: 'id' },
|
||||
resolve: {
|
||||
fixedDepositProduct: FixedDepositProductResolver,
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: ViewFixedDepositProductComponent,
|
||||
resolve: {
|
||||
fixedDepositProduct: FixedDepositProductResolver,
|
||||
fixedDepositProductsTemplate: FixedDepositProductsTemplateResolver
|
||||
}
|
||||
},
|
||||
@@ -463,13 +467,13 @@ const routes: Routes = [
|
||||
{
|
||||
path: ':id',
|
||||
data: { title: extract('View Product Mix'), routeParamBreadcrumb: 'id'},
|
||||
resolve: {
|
||||
productMix: ViewProductMixResolver
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: ViewProductMixComponent,
|
||||
resolve: {
|
||||
productMix: ViewProductMixResolver
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'edit',
|
||||
@@ -502,13 +506,13 @@ const routes: Routes = [
|
||||
{
|
||||
path: ':id',
|
||||
data: { title: extract('View Floating Rate'), routeParamBreadcrumb: 'id' },
|
||||
resolve: {
|
||||
floatingRate: FloatingRateResolver
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: ViewFloatingRateComponent,
|
||||
resolve: {
|
||||
floatingRate: FloatingRateResolver
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'edit',
|
||||
@@ -544,13 +548,13 @@ const routes: Routes = [
|
||||
{
|
||||
path: ':id',
|
||||
data: { title: extract('View Charges'), routeParamBreadcrumb: 'id' },
|
||||
resolve: {
|
||||
charge: ChargeResolver
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: ViewChargeComponent,
|
||||
resolve: {
|
||||
charge: ChargeResolver
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'edit',
|
||||
|
||||
@@ -49,12 +49,14 @@ const routes: Routes = [
|
||||
{
|
||||
path: ':savingAccountId',
|
||||
data: { title: extract('Saving Account View'), routeParamBreadcrumb: 'savingAccountId' },
|
||||
resolve: {
|
||||
savingsAccountData: SavingsAccountViewResolver
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: SavingsAccountViewComponent,
|
||||
resolve: {
|
||||
savingsAccountData: SavingsAccountViewResolver,
|
||||
savingsDatatables: SavingsDatatablesResolver
|
||||
},
|
||||
children: [
|
||||
|
||||
Reference in New Issue
Block a user