fix on breadcrumbs text

This commit is contained in:
Sofia Papacharalampous 2024-05-08 15:01:09 +03:00
parent 12c990de7f
commit bded2d4d23
6 changed files with 30 additions and 9 deletions

View File

@ -11,6 +11,7 @@ import { DateTimeCultureFormatPipe } from './pipes/date-time-culture-format.pipe
import {FieldValuePipe} from "@app/core/pipes/field-value.pipe"; import {FieldValuePipe} from "@app/core/pipes/field-value.pipe";
import {ColumnClassPipe} from "@app/core/pipes/column-class.pipe"; import {ColumnClassPipe} from "@app/core/pipes/column-class.pipe";
import { PipeService } from '@common/formatting/pipe.service'; import { PipeService } from '@common/formatting/pipe.service';
import { AppTitleCaseFormatPipe } from '@common/formatting/pipes/app-title-case-format.pipe';
// //
// //
@ -20,6 +21,7 @@ import { PipeService } from '@common/formatting/pipe.service';
@NgModule({ @NgModule({
declarations: [ declarations: [
AppTitleCaseFormatPipe,
NgForLimitPipe, NgForLimitPipe,
SumarizeTextPipe, SumarizeTextPipe,
TimezoneInfoDisplayPipe, TimezoneInfoDisplayPipe,
@ -31,6 +33,7 @@ import { PipeService } from '@common/formatting/pipe.service';
ColumnClassPipe, ColumnClassPipe,
], ],
exports: [ exports: [
AppTitleCaseFormatPipe,
NgForLimitPipe, NgForLimitPipe,
SumarizeTextPipe, SumarizeTextPipe,
TimezoneInfoDisplayPipe, TimezoneInfoDisplayPipe,
@ -45,6 +48,7 @@ import { PipeService } from '@common/formatting/pipe.service';
EnumUtils, EnumUtils,
DatePipe, DatePipe,
PipeService, PipeService,
AppTitleCaseFormatPipe,
NgForLimitPipe, NgForLimitPipe,
SumarizeTextPipe, SumarizeTextPipe,
TimezoneInfoDisplayPipe, TimezoneInfoDisplayPipe,

View File

@ -15,10 +15,10 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-auto header-title"> <div class="col-auto">
<div class="row"> <div *ngIf="listingItems && listingItems.length > 0 || this.lookup.like" class="row">
<div class="col-12"> <div class="col-12 header-title">
<p *ngIf="listingItems && listingItems.length > 0 || this.lookup.like">{{(isPublic ? 'DESCRIPTION-LISTING.TITLE-EXPLORE' : 'DESCRIPTION-LISTING.TITLE') | translate}}</p> <p >{{(isPublic ? 'DESCRIPTION-LISTING.TITLE-EXPLORE' : 'DESCRIPTION-LISTING.TITLE') | translate}}</p>
</div> </div>
<div class="col-12"> <div class="col-12">
<app-navigation-breadcrumb /> <app-navigation-breadcrumb />

View File

@ -11,10 +11,10 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-12"> <div *ngIf="listingItems && listingItems.length > 0 || this.lookup.like" class="col-12">
<p *ngIf="listingItems && listingItems.length > 0 || this.lookup.like" class="col-auto header-title">{{(isPublic ? 'GENERAL.TITLES.EXPLORE-PLANS' : 'GENERAL.TITLES.PLANS') | translate}}</p> <p class="col-auto header-title">{{(isPublic ? 'GENERAL.TITLES.EXPLORE-PLANS' : 'GENERAL.TITLES.PLANS') | translate}}</p>
</div> </div>
<div class="col-12"> <div *ngIf="listingItems && listingItems.length > 0 || this.lookup.like" class="col-12">
<app-navigation-breadcrumb /> <app-navigation-breadcrumb />
</div> </div>
<!-- TODO: implement filters --> <!-- TODO: implement filters -->

View File

@ -5,12 +5,12 @@
<a *ngIf="(!item?.skipNavigation && !last) else regularText" [routerLink]="computePath(index)" class="text-black" disabled> <a *ngIf="(!item?.skipNavigation && !last) else regularText" [routerLink]="computePath(index)" class="text-black" disabled>
<ng-container *ngIf="item.title !== HOME_SYMBOL else homeIcon"> <ng-container *ngIf="item.title !== HOME_SYMBOL else homeIcon">
{{ item.title | translate:item.translateParams | titlecase }} {{ item.title | translate:item.translateParams | appTitleCaseTransform }}
</ng-container> </ng-container>
</a> </a>
<ng-template #regularText> <ng-template #regularText>
<ng-container *ngIf="item.title !== HOME_SYMBOL else homeIcon"> <ng-container *ngIf="item.title !== HOME_SYMBOL else homeIcon">
{{ item.title | translate:item.translateParams | titlecase }} {{ item.title | translate:item.translateParams | appTitleCaseTransform }}
</ng-container> </ng-container>
</ng-template> </ng-template>

View File

@ -0,0 +1,15 @@
import { Pipe, PipeTransform } from "@angular/core";
@Pipe({
name: 'appTitleCaseTransform'
})
export class AppTitleCaseFormatPipe implements PipeTransform {
transform(value: any, ...args: any[]) {
let foo1 = value.split('-');
let foo2 = foo1.map(element => element.charAt(0).toUpperCase() + element.slice(1))
let foo3 = foo2.join(' ');
return value.split('-').map(element => element.charAt(0).toUpperCase() + element.slice(1)).join(' ');
}
}

View File

@ -1,5 +1,6 @@
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { FormattingModule } from '@app/core/formatting.module';
import { NavigationBreadcrumbComponent } from '@app/ui/misc/breadcrumb/navigation-breadcrumb.component'; import { NavigationBreadcrumbComponent } from '@app/ui/misc/breadcrumb/navigation-breadcrumb.component';
import { SecureImagePipe } from '@common/http/image/secure-image.pipe'; import { SecureImagePipe } from '@common/http/image/secure-image.pipe';
import { MaterialModule } from '@common/material/material.module'; import { MaterialModule } from '@common/material/material.module';
@ -10,6 +11,7 @@ import { TranslateModule } from '@ngx-translate/core';
CommonModule, CommonModule,
MaterialModule, MaterialModule,
TranslateModule, TranslateModule,
FormattingModule
], ],
declarations: [ declarations: [
SecureImagePipe, SecureImagePipe,