[Library | Trunk]: Change organization parsing. Remove unknown countries
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@59105 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
b8d949976e
commit
4ba22261aa
|
@ -35,7 +35,7 @@
|
|||
</a>
|
||||
</li>
|
||||
<!-- Country -->
|
||||
<li *ngIf="organizationInfo.country">
|
||||
<li *ngIf="organizationInfo.country && !organizationInfo.country.toLowerCase().includes('unknown')">
|
||||
<span class="uk-text-muted">Country: </span>{{organizationInfo.country}}
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -168,8 +168,8 @@
|
|||
<ul class="uk-list organizations uk-margin-remove-top">
|
||||
<li *ngFor="let organization of (showAll?resultLandingInfo.organizations:resultLandingInfo.organizations.slice(0,3))">
|
||||
<a [routerLink]="properties.searchLinkToOrganization.split('?')[0]" [queryParams]="{organizationId: organization.id}">
|
||||
{{(organization.name ? organization.name : (organization.shortname?organization.shortname:'No title available'))}}
|
||||
<span *ngIf="organization.shortname">({{organization.shortname}})</span>
|
||||
{{(organization.name ? organization.name : (organization.shortname?organization.shortname:'[No title available]'))}}
|
||||
<span *ngIf="!organization.name && organization.shortname">({{organization.shortname}})</span>
|
||||
</a>
|
||||
<div *ngIf="organization.country && !organization.country.toLowerCase().includes('unknown')">{{organization.country}}</div>
|
||||
</li>
|
||||
|
|
|
@ -85,7 +85,8 @@ export class SearchOrganizationsComponent {
|
|||
this.properties= data.envSpecific;
|
||||
if (!this.simpleSearchLink) {
|
||||
this.simpleSearchLink = this.properties.searchLinkToOrganizations;
|
||||
} this.advancedSearchLink = this.properties.searchLinkToAdvancedOrganizations;
|
||||
}
|
||||
this.advancedSearchLink = this.properties.searchLinkToAdvancedOrganizations;
|
||||
this.searchUtils.baseUrl = (this.simpleView)?this.simpleSearchLink:this.advancedSearchLink;
|
||||
this.pagingLimit = data.envSpecific.pagingLimit;
|
||||
this.isPiwikEnabled = data.envSpecific.enablePiwikTrack;
|
||||
|
|
|
@ -68,7 +68,7 @@ export class OrganizationService {
|
|||
|
||||
this.organizationInfo.name = organization.legalname;
|
||||
|
||||
if(this.organizationInfo.title.name == '') {
|
||||
if(!this.organizationInfo.title.name || this.organizationInfo.title.name == '') {
|
||||
this.organizationInfo.title.name = this.organizationInfo.name;
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ export class SearchOrganizationsService {
|
|||
result['title'] = {"name": '', "accessMode": '', "sc39": ''};
|
||||
|
||||
result['title'].name = resData.legalshortname;
|
||||
if(result['title'].name == '') {
|
||||
if(!result['title'].name || result['title'].name == '') {
|
||||
result['title'].name = resData.legalname;
|
||||
}
|
||||
|
||||
|
|
|
@ -107,8 +107,8 @@
|
|||
title="Open Access mandate for Publications and Research Data">
|
||||
Open Access mandate for Publications and Research Data
|
||||
</span>{{' '}}
|
||||
<span *ngIf="result.languages && removeUnknown(result.languages).length > 0">
|
||||
<span *ngFor="let language of removeUnknown(result.languages)"
|
||||
<span *ngIf="result.languages && result.languages.length > 0">
|
||||
<span *ngFor="let language of result.languages"
|
||||
class="uk-label custom-label label-language " title="Language">
|
||||
{{language}}
|
||||
</span>{{' '}}
|
||||
|
|
|
@ -49,6 +49,12 @@ export class ResultPreviewComponent implements OnInit{
|
|||
this.url = properties.searchLinkToResult.split('?')[0];
|
||||
}
|
||||
this.initBeforeTitle();
|
||||
if(this.result.languages) {
|
||||
this.result.languages = this.removeUnknown(this.result.languages);
|
||||
}
|
||||
if(this.result.countries) {
|
||||
this.result.countries = this.removeUnknown(this.result.countries);
|
||||
}
|
||||
}
|
||||
|
||||
public initBeforeTitle() {
|
||||
|
|
|
@ -246,6 +246,7 @@ export class ResultPreview {
|
|||
|
||||
public static organizationInfoConvert(result: OrganizationInfo): ResultPreview {
|
||||
let resultPreview: ResultPreview = new ResultPreview();
|
||||
console.log(result);
|
||||
if(result.title && result.title.name) {
|
||||
resultPreview.title = result.title.name;
|
||||
if(result.name) {
|
||||
|
|
Loading…
Reference in New Issue