[Trunk | Library]:

1. newSearchPage.component.ts: [Bug fix] Initialize properties (Envproperties) in field definition, not in ngOnInit method (when parent called a method that needs property, may had not been initialized).
2. portal-search-result.component.html: Removed tooltip from description.
3. portal-search-result.component.ts: In method "_formatDescription()" call method "StringUtils.HTMLToString()" before cutting it.


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60984 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2021-05-11 09:14:53 +00:00
parent 76a46606a6
commit ac16d505d6
3 changed files with 7 additions and 5 deletions

View File

@ -100,7 +100,7 @@ export class NewSearchPageComponent {
public pagingLimit: number = 0; public pagingLimit: number = 0;
public resultsPerPage: number = 0; public resultsPerPage: number = 0;
isPiwikEnabled = false; isPiwikEnabled = false;
properties: EnvProperties; properties: EnvProperties = properties;
public pageContents = null; public pageContents = null;
public divContents = null; public divContents = null;
public routerHelper: RouterHelper = new RouterHelper(); public routerHelper: RouterHelper = new RouterHelper();
@ -138,7 +138,7 @@ export class NewSearchPageComponent {
} }
ngOnInit() { ngOnInit() {
this.properties = properties; // this.properties = properties;
//this.getDivContents(); //this.getDivContents();
this.getPageContents(); this.getPageContents();
this.pagingLimit = this.properties.pagingLimit; this.pagingLimit = this.properties.pagingLimit;

View File

@ -105,8 +105,8 @@
</span> </span>
</div> </div>
<div *ngIf="result.description"> <div *ngIf="result.description">
<div class="text-justify descriptionText uk-text-small uk-text-muted uk-margin-auto-right" <div class="text-justify descriptionText uk-text-small uk-text-muted uk-margin-auto-right">
[title]="result.description"> <!-- [title]="result.description">-->
{{_formatDescription(result.description)}} {{_formatDescription(result.description)}}
</div> </div>
</div> </div>

View File

@ -6,6 +6,7 @@ import {CommunityInfo} from "../../connect/community/communityInfo";
import {Router} from "@angular/router"; import {Router} from "@angular/router";
import {LocalStorageService} from "../../services/localStorage.service"; import {LocalStorageService} from "../../services/localStorage.service";
import {Stakeholder, StakeholderInfo} from "../../monitor/entities/stakeholder"; import {Stakeholder, StakeholderInfo} from "../../monitor/entities/stakeholder";
import {StringUtils} from "../../utils/string-utils.class";
@Component({ @Component({
selector: 'portal-search-result', selector: 'portal-search-result',
@ -61,7 +62,8 @@ export class PortalSearchResultComponent implements OnInit{
} }
public _formatDescription(description) { public _formatDescription(description) {
return (((description).length > this.maxCharacters) ? (description.substring(0, (this.maxCharacters - ('...').length)) + "...") : description); let descr: string = StringUtils.HTMLToString(description);
return (((descr).length > this.maxCharacters) ? (descr.substring(0, (this.maxCharacters - ('...').length)) + "...") : descr);
} }
public confirmModalOpen(result: CommunityInfo & Stakeholder) { public confirmModalOpen(result: CommunityInfo & Stakeholder) {