[Explore|Trunk]
Result Landing page: add type "result" add query for type result update result info with resulttype update urls when the result type is returned git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58176 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
803826efd3
commit
826de9f393
|
@ -134,6 +134,12 @@ export class ResultLandingComponent {
|
|||
this.linkToSearchPage = this.properties.searchLinkToOrps;
|
||||
this.id = data['orpId'];
|
||||
this.title = "Other Research Product";
|
||||
}else if(this.type == "result"){
|
||||
this.id = data["id"];
|
||||
this.updateTitle("Research Result");
|
||||
this.linkToLandingPage = this.properties.searchLinkToOrp;
|
||||
this.linkToSearchPage = this.properties.searchLinkToResults;
|
||||
this.title = "Research Result";
|
||||
}
|
||||
this.updateDescription("");
|
||||
|
||||
|
@ -223,6 +229,9 @@ export class ResultLandingComponent {
|
|||
this.infoSub = this._resultLaningService.getResultLandingInfo(this.id, this.type, provenanceActionVocabulary, this.properties).subscribe(
|
||||
data => {
|
||||
this.resultLandingInfo = data;
|
||||
if(this.type == "result"){ // no type was specified - update URL based this.resultLandingInfo.resultType
|
||||
this.updateUrlWithType();
|
||||
}
|
||||
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.linkToLandingPage + this.resultLandingInfo.record["result"]["header"]["dri:objIdentifier"]);
|
||||
if ((this.type == "publication") && (this.properties.environment == "beta" || this.properties.environment == "development") && (typeof document !== 'undefined')) {
|
||||
this.getOpenCitations(this.id);
|
||||
|
@ -442,4 +451,23 @@ export class ResultLandingComponent {
|
|||
window.scroll(0, scrolledY - offsetHeight - 50);
|
||||
}
|
||||
}
|
||||
updateUrlWithType(){
|
||||
this.type = this.resultLandingInfo.resultType;
|
||||
if(this.type == "publication") {
|
||||
this._location.go("test");
|
||||
this.linkToLandingPage = this.properties.searchLinkToPublication;
|
||||
this.linkToSearchPage = this.properties.searchLinkToPublications;
|
||||
} else if(this.type == "dataset") {
|
||||
this.linkToLandingPage = this.properties.searchLinkToDataset;
|
||||
this.linkToSearchPage = this.properties.searchLinkToDatasets;
|
||||
} else if(this.type == "software") {
|
||||
this.linkToLandingPage = this.properties.searchLinkToSoftware;
|
||||
this.linkToSearchPage = this.properties.searchLinkToSoftwareLanding;
|
||||
} else if(this.type == "other") {
|
||||
this.type="orp";
|
||||
this.linkToLandingPage = this.properties.searchLinkToOrp;
|
||||
this.linkToSearchPage = this.properties.searchLinkToOrps;
|
||||
}
|
||||
this._location.go(this.linkToLandingPage + this.id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,8 @@ export class ResultLandingService {
|
|||
url += 'software/';
|
||||
} else if (type === 'orp') {
|
||||
url += 'other/';
|
||||
} else if (type === 'result') {
|
||||
url += 'results/';
|
||||
}
|
||||
url += id + '?format=json';
|
||||
|
||||
|
@ -81,6 +83,7 @@ export class ResultLandingService {
|
|||
|
||||
// res
|
||||
this.resultLandingInfo.record = data[14];
|
||||
this.resultLandingInfo.resultType = data[0].resulttype.classid;
|
||||
|
||||
// res['result']['metadata']['oaf:entity']['oaf:result']
|
||||
if (data[0] != null) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
export class ResultLandingInfo {
|
||||
// PUBLICATION, DATASET, SOFTWARE, ORP
|
||||
record;
|
||||
|
||||
resultType: "publication"|"dataset"|"other"|"software";
|
||||
// PUBLICATION, DATASET, SOFTWARE, ORP, DELETED_BY_INFERENCE
|
||||
title: string;
|
||||
accessMode: string;
|
||||
|
|
Loading…
Reference in New Issue