1. bug fix in dataProvider.component.html to display properly 'Content Providers' tab.

2. bug fix in searchResult.component.html in 'Funder' label.
3. tabResult.component: show information the same way as searchResult.component.
4. 'getResultsForHome' function added in fetchDataproviders - currently not used, should be used by home.component of explore portal.


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@51996 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2018-05-10 14:36:33 +00:00
parent ad6b076cde
commit 787c81f4a6
4 changed files with 102 additions and 98 deletions

View File

@ -26,10 +26,10 @@
<span *ngIf="dataProviderInfo.compatibility" class="uk-label custom-label label-compatibility " title="Compatibility">{{dataProviderInfo.compatibility}}</span>
<ul class="uk-list">
<li *ngIf="dataProviderInfo.aggregationStatus && dataProviderInfo.aggregationStatus.fundedContent != -1"><span class="uk-text-bold">Number of results with funding information: </span>
<li *ngIf="dataProviderInfo.aggregationStatus && dataProviderInfo.aggregationStatus.fundedContent != -1"><span class="uk-text-bold">Results with funding information: </span>
{{dataProviderInfo.aggregationStatus.fundedContent | number}}
</li>
<li *ngIf="dataProviderInfo.aggregationStatus && dataProviderInfo.aggregationStatus.indexRecords != -1"><span class="uk-text-bold">Number of collected full-texts: </span>
<li *ngIf="dataProviderInfo.aggregationStatus && dataProviderInfo.aggregationStatus.indexRecords != -1"><span class="uk-text-bold">Collected full-texts: </span>
{{dataProviderInfo.aggregationStatus.indexRecords | number}}
</li>
<li *ngIf="dataProviderInfo.oaiPmhURL"><span class="uk-text-bold">OAI-PMH: </span>
@ -156,7 +156,7 @@
[fetchProjects]="fetchProjects" [(properties)]=properties>
</projectsTab>
<!--*ngIf=" tab.content=='datasourcesTab'"-->
<datasourcesTab *ngIf="activeTab=='Datasources'"
<datasourcesTab *ngIf="activeTab=='Content Providers'"
[paramsForSearchLink]="paramsForSearchLink"
[fetchDataproviders]="fetchDataproviders" [(properties)]=properties>
</datasourcesTab>

View File

@ -24,7 +24,7 @@
*ngIf="i < result['funders'].length-1">, </span>
</span></span> -->
<span *ngIf="result['funderShortname']" class="uk-label custom-label label-funder " title="Funder">{{result['funderShortname']}}></span>
<span *ngIf="result['funderShortname']" class="uk-label custom-label label-funder " title="Funder">{{result['funderShortname']}}</span>
<span *ngIf="result.openAccessMandate != undefined && result.openAccessMandate " class="uk-label custom-label label-openaccessmandate " title="Open Access mandate">Open Access mandate</span>
<span *ngIf="result.title && result.title.sc39" class="uk-label custom-label label-sc39 " title="Special Clause 39">Special Clause 39</span>

View File

@ -1,14 +1,6 @@
<ul class="uk-list uk-list-divider uk-margin">
<!--div *ngIf="status == errorCodes.NONE" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No Results found</div>
<div *ngIf="status == errorCodes.ERROR" class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
<div *ngIf="status == errorCodes.NOT_AVAILABLE" class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
<div *ngIf="status == errorCodes.LOADING && showLoading" class="uk-alert uk-alert-primary uk-animation-fade" role="alert">Loading...</div-->
<li *ngFor="let result of results" class="uk-animation-fade">
<div class = "uk-h4 {{result.title.accessMode}} {{result.title.sc39}}" [title] = result.title.accessMode >
<!--a href="{{result['title'].url}}"-->
<!--a [queryParams]="{articleId: 'od_______908::3a5b2885656a91307156325644e73b92'}" routerLinkActive="router-link-active" routerLink="search/publication"-->
<!-- <div class = "uk-h4 {{result.title.accessMode}} {{result.title.sc39}}" [title] = result.title.accessMode >
<a [queryParams]="routerHelper.createQueryParam(urlParam,result.id)" routerLinkActive="router-link-active" routerLink="/search/{{type}}">
<span *ngIf="result['title'].name || result.acronym">
<span *ngIf="result.acronym">{{result.acronym}}</span>
@ -21,14 +13,17 @@
<span *ngIf="result.code">({{result.code}})</span>
</span>
</a>
</div>
</div> -->
<h4 [title] = result.title.accessMode >
<a [queryParams]="routerHelper.createQueryParam(urlParam,result.id)" routerLinkActive="router-link-active" routerLink="/search/{{type}}">
<p *ngIf="result['title'].name || result.acronym"><span *ngIf="result.acronym">{{result.acronym}}</span><span *ngIf="result.acronym && result['title'].name">-</span><span *ngIf="result['title'].name" [innerHTML]="result['title'].name"></span><span *ngIf="result.code">({{result.code}})</span></p>
<p *ngIf="!result['title'].name && !result.acronym">[no title available]<span *ngIf="result.code">({{result.code}})</span></p>
</a>
</h4>
<div>
<span *ngIf="result['authors'] != undefined">
<span *ngFor="let author of result['authors'].slice(0,15)">
<!--a [queryParams]="routerHelper.createQueryParams(['author','au'],[quote(author['name']),'and'])" routerLinkActive="router-link-active" [routerLink]="'/search/advanced/'+type+'s'">
{{author['name']}};
</a-->
{{author}};
</span>
<span *ngIf="result['authors'].length > 15">...</span>
@ -38,20 +33,23 @@
</span>
</div>
<div *ngIf="result.publisher != undefined && result.publisher != ''">Publisher: {{result.publisher}}</div>
<div *ngIf="result.country != undefined && result.country != ''">Country: {{result.country}}</div>
<span *ngIf="result.title && result.title.accessMode" [class]="'uk-label custom-label label-'+ result.title.accessMode " title="Access Mode">{{result.title.accessMode}}</span>
<span *ngIf="result['funderShortname']" class="uk-label custom-label label-funder " title="Funder">{{result['funderShortname']}}></span>
<span *ngIf="result.openAccessMandate != undefined && result.openAccessMandate " class="uk-label custom-label label-openaccessmandate " title="Open Access mandate">Open Access mandate</span>
<div *ngIf="result.publisher != undefined && result.publisher != ''"><span class="uk-text-bold">Publisher:</span> {{result.publisher}}</div>
<span *ngIf="result['type'] != undefined && result['type'] != ''" class="uk-label custom-label label-blue label-dataprovider" title="Type"> {{result['type']}}</span>
<span *ngIf="result['compatibility'] != undefined && result['compatibility'] != ''" class="uk-label custom-label label-compatibility" title="Compatibility">{{result.compatibility}}</span>
<span *ngIf="result.country != undefined && result.country != ''" class="uk-label custom-label label-country" title="Country"> {{result.country}}</span>
<div *ngIf="result['projects'] != undefined">
<span> Project: </span>
<span *ngFor="let project of result['projects'].slice(0,15) let i=index">
<!--a *ngIf="project.url != undefined" href="{{project.url}}"-->
<a *ngIf="project.id" [queryParams]="{projectId: project.id}" routerLinkActive="router-link-active" routerLink="/search/project">
{{project['funderShortname']?project['funderShortname']:project['funderName']}}
| {{ project['acronym']?project['acronym']:project['title']}} ({{project.code}})</a><span
| {{ project['acronym']?project['acronym']:(project['title'].length>25?project['title'].substring(0,25)+'...':project['title'])}} ({{project.code}})</a><span
*ngIf="!project.id">{{project['funderShortname']?project['funderShortname']:project['funderName']}}<span
*ngIf="project['acronym'] || project['title']"> | {{ project['acronym']?project['acronym']:project['title']}}</span><span
*ngIf="project['acronym'] || project['title']"> | {{ project['acronym']?project['acronym']:(project['title'].length>25?project['title'].substring(0,25)+'...':project['title'])}}</span><span
*ngIf="project.code">({{project.code}})</span></span><span
*ngIf="i < result['projects'].length-1">,</span>
@ -59,31 +57,12 @@
<span *ngIf="result['projects'].length > 15">...</span>
</div>
<!--blockquote *ngIf="result.description != undefined && result.description != ''">
<div class="text-justify">
{{result.description}}
</div>
</blockquote-->
<mark *ngIf="result.embargoEndDate != undefined && result.embargoEndDate != ''">Embargo End Date: {{result.embargoEndDate}}</mark>
<div *ngIf="result['funderShortname']">
<!-- <span *ngFor="let funder of result['funders'] let i=index">
<span *ngIf="funder.funderShortname">
{{funder.funderShortname}}</span><span
*ngIf="i < result['funders'].length-1">,</span>
</span> -->
<span>{{result['funderShortname']}}</span>
<span *ngIf="result.startYear && result.endYear"> (start {{result.startYear}} - end {{result.endYear}})</span>
</div>
<div *ngIf="result.startYear && result.endYear"> Start year: {{result.startYear}} - End year: {{result.endYear}}</div>
<div *ngIf="showOrganizations && result['organizations'] != undefined && result['organizations'].length > 0">
<span> Organization: </span>
<span *ngFor="let organization of result['organizations'].slice(0, 10) let i=index">
<!--a *ngIf="organization.url != undefined" href="{{organization.url}}"-->
<span *ngFor="let organization of result['organizations'].slice(0,10) let i=index">
<a *ngIf="organization.id" [queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active" routerLink="/search/organization">
{{organization.name}}</a><span
@ -95,9 +74,8 @@
<span *ngIf="result['organizations'].length > 10">...</span>
</div>
<div *ngIf="result['type'] != undefined && result['type'] != ''">Type: {{result['type']}}</div>
<div *ngIf="result['countries'] && result['countries'].length > 0">
Country: {{result.countries}}
Country: <span *ngFor="let country of result['countries'].slice(0,10) let i = index">{{country}}{{(i < ( result['countries'].slice(0,10).length-1))?", ":""}}{{(i == result['countries'].slice(0,10).length-1 && result['countries'].length > 10)?"...":""}}</span>
</div>
<div *ngIf="result['websiteURL'] != undefined && result['websiteURL'] != ''">
<span>Website URL: </span>
@ -115,10 +93,5 @@
</a>
</span>
</div>
<div *ngIf="result['compatibility'] != undefined && result['compatibility'] != ''">
Compatibility: {{result.compatibility}}
</div>
</li>
</ul>

View File

@ -72,6 +72,37 @@ export class FetchDataproviders {
);
}
public getResultsForHome(size: number, properties:EnvProperties){
let page = 1;
var parameters = "&sortBy=resultdateofacceptance,descending";//"orderby=date";
this.searchUtils.status = this.errorCodes.LOADING;
this.subResults = this._searchDataprovidersService.searchDataproviders(parameters,null, page, size,[], properties).subscribe(
data => {
this.searchUtils.totalResults = data[0];
console.info("search Content Providers: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
this.results = data[1];
this.searchUtils.status = this.errorCodes.DONE;
if(this.searchUtils.totalResults == 0 ){
this.searchUtils.status = this.errorCodes.NONE;
}
},
err => {
console.log(err);
//TODO check erros (service not available, bad request)
if(err.status == '404') {
this.searchUtils.status = this.errorCodes.NOT_FOUND;
} else if(err.status == '500') {
this.searchUtils.status = this.errorCodes.ERROR;
} else {
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
}
}
);
}
public getNumForEntity(entity: string, id:string, properties:EnvProperties) {
//var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = this.errorCodes.LOADING;