diff --git a/src/app/clients/clients-view/clients-view.component.html b/src/app/clients/clients-view/clients-view.component.html index 90badbfc5..61e0c65c6 100644 --- a/src/app/clients/clients-view/clients-view.component.html +++ b/src/app/clients/clients-view/clients-view.component.html @@ -435,7 +435,7 @@ [active]="datatable.isActive" *mifosxHasPermission="'READ_' + clientDatatable.registeredTableName" > - {{ clientDatatable.registeredTableName }} + {{ formatTabLabel(clientDatatable.registeredTableName) }} } diff --git a/src/app/clients/clients-view/clients-view.component.ts b/src/app/clients/clients-view/clients-view.component.ts index 27c148769..6c220135e 100644 --- a/src/app/clients/clients-view/clients-view.component.ts +++ b/src/app/clients/clients-view/clients-view.component.ts @@ -45,6 +45,7 @@ import { MatTabNav, MatTabLink, MatTabNavPanel } from '@angular/material/tabs'; import { StatusLookupPipe } from '../../pipes/status-lookup.pipe'; import { DateFormatPipe } from '../../pipes/date-format.pipe'; import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module'; +import { formatTabLabel } from 'app/shared/utils/format-tab-label.util'; @Component({ selector: 'mifosx-clients-view', @@ -78,6 +79,9 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module'; ] }) export class ClientsViewComponent implements OnInit { + formatTabLabel(label: string): string { + return formatTabLabel(label); + } private route = inject(ActivatedRoute); private router = inject(Router); private clientsService = inject(ClientsService); diff --git a/src/app/core/shell/breadcrumb/breadcrumb.component.ts b/src/app/core/shell/breadcrumb/breadcrumb.component.ts index 67a52c226..44e13c6e5 100644 --- a/src/app/core/shell/breadcrumb/breadcrumb.component.ts +++ b/src/app/core/shell/breadcrumb/breadcrumb.component.ts @@ -22,6 +22,7 @@ import { PopoverService } from '../../../configuration-wizard/popover/popover.se import { ConfigurationWizardService } from '../../../configuration-wizard/configuration-wizard.service'; import { TranslateService } from '@ngx-translate/core'; import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module'; +import { formatTabLabel } from 'app/shared/utils/format-tab-label.util'; /** * Route data property to generate breadcrumb using a static string. @@ -139,6 +140,9 @@ export class BreadcrumbComponent implements AfterViewInit, OnDestroy { route.snapshot.paramMap.get(route.snapshot.data[routeParamBreadcrumb]) ) { breadcrumbLabel = route.snapshot.paramMap.get(route.snapshot.data[routeParamBreadcrumb]); + if (route.snapshot.data[routeParamBreadcrumb] === 'datatableName' && breadcrumbLabel) { + breadcrumbLabel = formatTabLabel(breadcrumbLabel); + } const routeData: Data = route.snapshot.data; if (routeData.breadcrumb === 'Clients') { breadcrumbLabel = this.printableValue(routeData.clientViewData.displayName); diff --git a/src/app/shared/tabs/entity-datatable-tab/datatable-multi-row/datatable-multi-row.component.ts b/src/app/shared/tabs/entity-datatable-tab/datatable-multi-row/datatable-multi-row.component.ts index 56b0db392..c19c7c0db 100644 --- a/src/app/shared/tabs/entity-datatable-tab/datatable-multi-row/datatable-multi-row.component.ts +++ b/src/app/shared/tabs/entity-datatable-tab/datatable-multi-row/datatable-multi-row.component.ts @@ -11,6 +11,7 @@ import { DecimalPipe, NgClass } from '@angular/common'; import { Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, ViewChild, inject } from '@angular/core'; import { MatCheckboxChange as MatCheckboxChange, MatCheckbox } from '@angular/material/checkbox'; import { MatDialog } from '@angular/material/dialog'; +import { formatTabLabel } from 'app/shared/utils/format-tab-label.util'; import { MatTable, MatColumnDef, @@ -62,6 +63,9 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module'; ] }) export class DatatableMultiRowComponent implements OnInit, OnDestroy, OnChanges { + formatTabLabel(label: string): string { + return formatTabLabel(label); + } private route = inject(ActivatedRoute); private dateUtils = inject(Dates); private systemService = inject(SystemService); @@ -163,7 +167,7 @@ export class DatatableMultiRowComponent implements OnInit, OnDestroy, OnChanges dataTableEntryObject ); const data = { - title: 'Add ' + this.datatableName + ' for ' + this.entityType, + title: 'Add ' + formatTabLabel(this.datatableName) + ' for ' + this.entityType, formfields: formfields }; const addDialogRef = this.dialog.open(FormDialogComponent, { data, width: '50rem' }); @@ -190,7 +194,7 @@ export class DatatableMultiRowComponent implements OnInit, OnDestroy, OnChanges */ delete() { const deleteDataTableDialogRef = this.dialog.open(DeleteDialogComponent, { - data: { deleteContext: `the contents of ${this.datatableName}` } + data: { deleteContext: `the contents of ${formatTabLabel(this.datatableName)}` } }); deleteDataTableDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { @@ -206,7 +210,9 @@ export class DatatableMultiRowComponent implements OnInit, OnDestroy, OnChanges */ deleteSelected() { const deleteDataTableDialogRef = this.dialog.open(DeleteDialogComponent, { - data: { deleteContext: `the ${this.selection.selected.length} items selected of ${this.datatableName}` } + data: { + deleteContext: `the ${this.selection.selected.length} items selected of ${formatTabLabel(this.datatableName)}` + } }); deleteDataTableDialogRef.afterClosed().subscribe((response: any) => { if (response.delete) { diff --git a/src/app/shared/tabs/entity-datatable-tab/datatable-single-row/datatable-single-row.component.html b/src/app/shared/tabs/entity-datatable-tab/datatable-single-row/datatable-single-row.component.html index 29eda4231..ebc72bd69 100644 --- a/src/app/shared/tabs/entity-datatable-tab/datatable-single-row/datatable-single-row.component.html +++ b/src/app/shared/tabs/entity-datatable-tab/datatable-single-row/datatable-single-row.component.html @@ -7,7 +7,7 @@ -->