Lazy routing disabled in datasources tab of dataprovider landing page (parameter lazy=false in searchResults page) | Added widget for publications and research data in project landing page | Project landing page: bug solved for publications in csv (not any more size=0)
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@46185 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
89c18ce14f
commit
7b42fc135b
|
@ -19,7 +19,8 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
|||
<div class = "uk-text-right" *ngIf = "fetchDataproviders.searchUtils.totalResults > 10" ><a [href] = "linkToSearchDataproviders" >View all {{fetchDataproviders.searchUtils.totalResults}} results</a></div>
|
||||
<search-result [(results)]="fetchDataproviders.results"
|
||||
[(status)]= "fetchDataproviders.status"
|
||||
type="dataprovider" urlParam="datasourceId">
|
||||
type="dataprovider" urlParam="datasourceId"
|
||||
lazy=false>
|
||||
</search-result>
|
||||
</div>
|
||||
`
|
||||
|
|
|
@ -9,7 +9,7 @@ import {ProjectService} from '../project/project.service';
|
|||
selector: 'htmlProjectReport',
|
||||
template: `
|
||||
<div class="uk-container uk-margin-top">
|
||||
<button class="uk-button uk-button-primary btn" (click)="copied = true;">
|
||||
<button class="uk-icon-clipboard uk-button uk-button-primary btn" (click)="copied = true;">
|
||||
Copy to clipboard
|
||||
</button>
|
||||
<!--span *ngIf="copied" class="uk-badge uk-badge-success">Success</span-->
|
||||
|
|
|
@ -177,12 +177,28 @@
|
|||
View all Project Publications
|
||||
</a>
|
||||
</li>
|
||||
<!--li>
|
||||
<span class="clickable">
|
||||
<span aria-hidden="true"></span>
|
||||
<span class="uk-icon-download">Dynamically incorporate publications in your site (HTML)</span>
|
||||
</span>
|
||||
</li-->
|
||||
<li>
|
||||
<div class="clickable" data-uk-toggle="{target:'#publications_dynamic', animation:'uk-animation-fade'}">Dynamically incorporate publications in your site (HTML)</div>
|
||||
|
||||
<!--div class="uk-hidden uk-panel uk-panel-box" id="publications_dynamic">
|
||||
{{publications_dynamic}}
|
||||
</div-->
|
||||
<div class="uk-vertical-align uk-hidden" id="publications_dynamic">
|
||||
<button class="uk-float-right uk-icon-clipboard uk-button publ_clipboard_btn" data-clipboard-target="#publ_clipboard">
|
||||
Copy to clipboard
|
||||
</button>
|
||||
<pre><code id="publ_clipboard">{{publications_dynamic}}</code></pre>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="clickable" data-uk-toggle="{target:'#datasets_dynamic', animation:'uk-animation-fade'}">Dynamically incorporate research data in your site (HTML)</div>
|
||||
<div class="uk-vertical-align uk-hidden" id="datasets_dynamic">
|
||||
<button class="uk-float-right uk-icon-clipboard uk-button datasets_clipboard_btn" data-clipboard-target="#datasets_clipboard">
|
||||
Copy to clipboard
|
||||
</button>
|
||||
<pre><code id="datasets_clipboard">{{datasets_dynamic}}</code></pre>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<!--li (click)="showHTML()"-->
|
||||
<li>
|
||||
|
@ -196,7 +212,7 @@
|
|||
[linkname]="'Download '+ projectInfo.funder +' progress report (CSV)'"
|
||||
[filename]="'publications.csv'">
|
||||
</export-->
|
||||
<span class="clickable" (click)="downloadfile(downloadURLAPI+'resources?'+csvParams)">
|
||||
<span class="clickable" (click)="downloadfile(downloadURLAPI+'resources?'+csvParams+fetchPublications.searchUtils.totalResults)">
|
||||
<span aria-hidden="true" class="glyphicon glyphicon-download"></span>
|
||||
<span class="uk-icon-download">{{projectInfo.funder}} progress report (CSV)</span>
|
||||
</span>
|
||||
|
|
|
@ -33,6 +33,9 @@ export class ProjectComponent{
|
|||
public chartAccessModeUrl: string;
|
||||
public chartDatasourcesUrl: string;
|
||||
|
||||
public publications_dynamic: string;
|
||||
public datasets_dynamic: string;
|
||||
|
||||
public project ;
|
||||
|
||||
public downloadURLAPI: string;
|
||||
|
@ -71,6 +74,26 @@ export class ProjectComponent{
|
|||
this.projectId = params['projectId'];
|
||||
console.info("Id is :"+this.projectId);
|
||||
if(this.projectId){
|
||||
this.publications_dynamic =
|
||||
"<script type=\"text/javascript\">"
|
||||
+ "\n<!--"
|
||||
+ "\ndocument.write('<div id=\"oa_widget\"></div>');"
|
||||
+ "\ndocument.write('<script type=\"text/javascript\""
|
||||
+ "\nsrc=\"https://beta.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId="
|
||||
+ this.projectId + "&type=publication\"></script>');"
|
||||
+ "\n-->"
|
||||
+ "\n</script>";
|
||||
|
||||
this.datasets_dynamic =
|
||||
"<script type=\"text/javascript\">"
|
||||
+ "\n<!--"
|
||||
+ "\ndocument.write('<div id=\"oa_widget\"></div>');"
|
||||
+ "\ndocument.write('<script type=\"text/javascript\""
|
||||
+ "\nsrc=\"https://beta.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId="
|
||||
+ this.projectId + "&type=dataset\"></script>');"
|
||||
+ "\n-->"
|
||||
+ "\n</script>";
|
||||
|
||||
this.getProjectInfo(this.projectId);
|
||||
// this.subPublications = this.route.queryParams.subscribe(params => {
|
||||
this.searchPublications();
|
||||
|
@ -88,9 +111,18 @@ export class ProjectComponent{
|
|||
}
|
||||
|
||||
this.downloadURLAPI = OpenaireProperties.getCsvAPIURL();
|
||||
this.csvParams = "format=csv-special&page=0&size="+this.fetchPublications.searchUtils.totalResults+"&type=publications&query=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact "+this.projectId+"))";
|
||||
|
||||
});
|
||||
|
||||
if(typeof window !== undefined) {
|
||||
let publ_clipboard, datasets_clipboard;
|
||||
let Clipboard;
|
||||
Clipboard = require('clipboard');
|
||||
publ_clipboard = new Clipboard('.publ_clipboard_btn');
|
||||
datasets_clipboard = new Clipboard('.datasets_clipboard_btn');
|
||||
}
|
||||
|
||||
console.info(this.fetchPublications.searchUtils.totalResults + " just before csv");
|
||||
this.csvParams = "format=csv-special&page=0&type=publications&query=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact "+this.projectId+"))&size=";
|
||||
}
|
||||
|
||||
|
||||
|
@ -142,6 +174,7 @@ export class ProjectComponent{
|
|||
);
|
||||
}
|
||||
downloadfile(url:string){
|
||||
|
||||
console.log("Downloading file: "+ url);
|
||||
this._reportsService.downloadCSVFile(url)
|
||||
.subscribe(data => window.open(window.URL.createObjectURL(data)),
|
||||
|
|
|
@ -16,7 +16,15 @@ import {RouterHelper} from '../../utils/routerHelper.class';
|
|||
<h4 class = "{{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"-->
|
||||
<a [queryParams]="routerHelper.createQueryParam(urlParam,result.id)" routerLinkActive="router-link-active" routerLink="/search/{{type}}">
|
||||
<a *ngIf="lazy" [queryParams]="routerHelper.createQueryParam(urlParam,result.id)" routerLinkActive="router-link-active" routerLink="/search/{{type}}">
|
||||
<p *ngIf="result['title'].name != undefined && result['title'].name != ''"
|
||||
[innerHTML]="result['title'].name">
|
||||
</p>
|
||||
<p *ngIf="result['title'].name == undefined || result['title'].name == ''">
|
||||
{{result['title'].url}}
|
||||
</p>
|
||||
</a>
|
||||
<a *ngIf="!lazy" href="/search/{{type}}?{{urlParam}}={{result.id}}">
|
||||
<p *ngIf="result['title'].name != undefined && result['title'].name != ''"
|
||||
[innerHTML]="result['title'].name">
|
||||
</p>
|
||||
|
@ -135,6 +143,7 @@ export class SearchResultComponent {
|
|||
@Input() type: string;
|
||||
@Input() urlParam: string;
|
||||
@Input() showLoading: boolean = false;
|
||||
@Input() lazy: boolean = true;
|
||||
|
||||
public errorCodes:ErrorCodes = new ErrorCodes();
|
||||
public routerHelper:RouterHelper = new RouterHelper();
|
||||
|
|
|
@ -118,10 +118,13 @@ public getResultsForEntity(entity:string, id:string, page: number, size: number)
|
|||
} else if(entity == "person") {
|
||||
parameters = "people/"+id;
|
||||
}
|
||||
|
||||
if(parameters != "") {
|
||||
this._searchPublicationsService.searchPublicationsForEntity(parameters, page, size).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
console.info(this.searchUtils.totalResults + " i think we got results");
|
||||
|
||||
console.info("search Publications for "+entity+": [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||
this.results = data[1];
|
||||
|
||||
|
|
Loading…
Reference in New Issue