Skip to content

Commit

Permalink
135841 Bmc values issue fix for selected search filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Shailrocks123 authored and samarthtrigyn committed Feb 29, 2024
1 parent f7f3f2e commit 05a444e
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<label>{{facet.label}} :&nbsp;</label>
<ng-container *ngFor="let item of selectedFilters[facet.name]">
<a class="ui label mt-8 mr-8 py-0 sbt-label-green text-capitalize" *ngIf="item && item.length > 0">
{{item}}
{{formetText(item)}}
<i class="delete icon" tabindex="0" (click)="removeFilterSelection({type: facet.name, value: item})"></i>
</a>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,41 @@ export class GlobalSearchSelectedFilterComponent implements OnInit {
}
});
}

toTitleCase(str) {
return str.toLowerCase().replace(/\b\w/g, function (char) {
return char.toUpperCase();
});
}
formetText(selectedFilters:string):string{
if(selectedFilters.toLowerCase() ==='cbse training'){
return 'CBSE Training'
}
else if (selectedFilters.toLowerCase() == 'igot-health' ) {
return 'IGOT-Health';
} else if (selectedFilters.toLowerCase() == 'cbse/ncert' ) {
return 'CBSE/NCERT ';
} else if (selectedFilters.toLowerCase() == 'cisce' ) {
return 'CISCE ';
} else if (selectedFilters.toLowerCase() == 'nios' ) {
return 'NIOS ';
}
else if(selectedFilters.toLowerCase() === 'cpd'){
return 'CPD'
}
else if(selectedFilters.toLowerCase() == 'ut (dnh and dd)'){
return 'UT (DNH And DD) '
}
else if( selectedFilters.startsWith("ut") || selectedFilters.startsWith("UT")){
let text1 = selectedFilters.split(' ')
let firstPart = text1.shift()
let secondPart = text1.join(' ')
return (firstPart.toUpperCase()+(' ').concat(this.toTitleCase(secondPart)))
}
else {
return selectedFilters
}
}

removeFilterSelection(data) {
_.map(this.selectedFilters, (value, key) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@
<use xlink:href="assets/images/sprite.svg#arrow-long-left"></use>
</svg></i><span>{{resourceService?.frmelmnts?.btn?.back}}</span> </button>
<div class="d-flex flex-dc ml-16">
<h4 class="mb-4 explore-title text-capitalize">{{showingResult}}</h4>
<h4 class="mb-4 explore-title text-capitalize">{{formatText(showingResult)}}</h4>
<div class="fsmall"></div>
<div class="explore-description-info">{{showingDescription}}</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,18 @@ export class MainHeaderComponent implements OnInit, OnDestroy {
this.switchToNewTheme();
}

formatText(showingResult:string):string{
if(showingResult.toLowerCase() ==='explore cbse training'){
return 'Explore CBSE Training'
}
else if(showingResult.toLowerCase() ==='explore cpd'){
return 'Explore CPD'
}
else {
return showingResult
}
}

checkFullScreenView() {
this.navigationHelperService.contentFullScreenEvent?.pipe(takeUntil(this.unsubscribe$)).subscribe(isFullScreen => {
this.isFullScreenView = isFullScreen;
Expand Down

0 comments on commit 05a444e

Please sign in to comment.