[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>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<!-- Country -->
|
<!-- Country -->
|
||||||
<li *ngIf="organizationInfo.country">
|
<li *ngIf="organizationInfo.country && !organizationInfo.country.toLowerCase().includes('unknown')">
|
||||||
<span class="uk-text-muted">Country: </span>{{organizationInfo.country}}
|
<span class="uk-text-muted">Country: </span>{{organizationInfo.country}}
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -168,8 +168,8 @@
|
||||||
<ul class="uk-list organizations uk-margin-remove-top">
|
<ul class="uk-list organizations uk-margin-remove-top">
|
||||||
<li *ngFor="let organization of (showAll?resultLandingInfo.organizations:resultLandingInfo.organizations.slice(0,3))">
|
<li *ngFor="let organization of (showAll?resultLandingInfo.organizations:resultLandingInfo.organizations.slice(0,3))">
|
||||||
<a [routerLink]="properties.searchLinkToOrganization.split('?')[0]" [queryParams]="{organizationId: organization.id}">
|
<a [routerLink]="properties.searchLinkToOrganization.split('?')[0]" [queryParams]="{organizationId: organization.id}">
|
||||||
{{(organization.name ? organization.name : (organization.shortname?organization.shortname:'No title available'))}}
|
{{(organization.name ? organization.name : (organization.shortname?organization.shortname:'[No title available]'))}}
|
||||||
<span *ngIf="organization.shortname">({{organization.shortname}})</span>
|
<span *ngIf="!organization.name && organization.shortname">({{organization.shortname}})</span>
|
||||||
</a>
|
</a>
|
||||||
<div *ngIf="organization.country && !organization.country.toLowerCase().includes('unknown')">{{organization.country}}</div>
|
<div *ngIf="organization.country && !organization.country.toLowerCase().includes('unknown')">{{organization.country}}</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -85,7 +85,8 @@ export class SearchOrganizationsComponent {
|
||||||
this.properties= data.envSpecific;
|
this.properties= data.envSpecific;
|
||||||
if (!this.simpleSearchLink) {
|
if (!this.simpleSearchLink) {
|
||||||
this.simpleSearchLink = this.properties.searchLinkToOrganizations;
|
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.searchUtils.baseUrl = (this.simpleView)?this.simpleSearchLink:this.advancedSearchLink;
|
||||||
this.pagingLimit = data.envSpecific.pagingLimit;
|
this.pagingLimit = data.envSpecific.pagingLimit;
|
||||||
this.isPiwikEnabled = data.envSpecific.enablePiwikTrack;
|
this.isPiwikEnabled = data.envSpecific.enablePiwikTrack;
|
||||||
|
|
|
@ -68,7 +68,7 @@ export class OrganizationService {
|
||||||
|
|
||||||
this.organizationInfo.name = organization.legalname;
|
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;
|
this.organizationInfo.title.name = this.organizationInfo.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ export class SearchOrganizationsService {
|
||||||
result['title'] = {"name": '', "accessMode": '', "sc39": ''};
|
result['title'] = {"name": '', "accessMode": '', "sc39": ''};
|
||||||
|
|
||||||
result['title'].name = resData.legalshortname;
|
result['title'].name = resData.legalshortname;
|
||||||
if(result['title'].name == '') {
|
if(!result['title'].name || result['title'].name == '') {
|
||||||
result['title'].name = resData.legalname;
|
result['title'].name = resData.legalname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -107,8 +107,8 @@
|
||||||
title="Open Access mandate for Publications and Research Data">
|
title="Open Access mandate for Publications and Research Data">
|
||||||
Open Access mandate for Publications and Research Data
|
Open Access mandate for Publications and Research Data
|
||||||
</span>{{' '}}
|
</span>{{' '}}
|
||||||
<span *ngIf="result.languages && removeUnknown(result.languages).length > 0">
|
<span *ngIf="result.languages && result.languages.length > 0">
|
||||||
<span *ngFor="let language of removeUnknown(result.languages)"
|
<span *ngFor="let language of result.languages"
|
||||||
class="uk-label custom-label label-language " title="Language">
|
class="uk-label custom-label label-language " title="Language">
|
||||||
{{language}}
|
{{language}}
|
||||||
</span>{{' '}}
|
</span>{{' '}}
|
||||||
|
|
|
@ -49,6 +49,12 @@ export class ResultPreviewComponent implements OnInit{
|
||||||
this.url = properties.searchLinkToResult.split('?')[0];
|
this.url = properties.searchLinkToResult.split('?')[0];
|
||||||
}
|
}
|
||||||
this.initBeforeTitle();
|
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() {
|
public initBeforeTitle() {
|
||||||
|
|
|
@ -246,6 +246,7 @@ export class ResultPreview {
|
||||||
|
|
||||||
public static organizationInfoConvert(result: OrganizationInfo): ResultPreview {
|
public static organizationInfoConvert(result: OrganizationInfo): ResultPreview {
|
||||||
let resultPreview: ResultPreview = new ResultPreview();
|
let resultPreview: ResultPreview = new ResultPreview();
|
||||||
|
console.log(result);
|
||||||
if(result.title && result.title.name) {
|
if(result.title && result.title.name) {
|
||||||
resultPreview.title = result.title.name;
|
resultPreview.title = result.title.name;
|
||||||
if(result.name) {
|
if(result.name) {
|
||||||
|
|
Loading…
Reference in New Issue