[Library | develop & Eosc Explore | develop]: Added in eoscSubjects, "EOSC::Data Cube" | Updated eosc url params in landing for back "Go to Search" link - "return_path" and "search_params" (instead of pv).
1. parsingFunctions.class.ts: Added in eoscSubjects, subject "EOSC::Data Cube" (linked with Adam plarform). 2. result-preview.component.ts & fundedBy.component.ts & availableOn.component.ts & relatedDatasourcesTab.component.ts: Updated method "addEoscPrevInParams()" to add 2 parameters: "return_path" and "search_params" (instead of pv). 3. resultLanding.component.ts: a. Updated how this.prevPath is initialized (parse url params "return_path" and "search_params" instead of "pv"). b. Added method "getEoscParams()" to return eosc params as a string (to be used in href). c. Updated method "addEoscPrevInParams()" to add 2 parameters: "return_path" and "search_params" (instead of pv). 4. project.component.ts & dataProvider.component.ts: a. Updated how this.prevPath is initialized (parse url params "return_path" and "search_params" instead of "pv"). b. Updated method "addEoscPrevInParams()" to add 2 parameters: "return_path" and "search_params" (instead of pv). 5. organization.component.ts: Updated how this.prevPath is initialized (parse url params "return_path" and "search_params" instead of "pv"). 6. metrics.component.ts: Added method "getEoscParams()" to return eosc params as a string (to be used in href).
This commit is contained in:
parent
39a7ed58be
commit
d24576a5c7
|
@ -186,8 +186,8 @@ export class DataProviderComponent {
|
||||||
this.stickyHeader = false;
|
this.stickyHeader = false;
|
||||||
this.updateDescription("");
|
this.updateDescription("");
|
||||||
|
|
||||||
if(data["pv"]) {
|
if(data["return_path"]) {
|
||||||
this.prevPath = data["pv"];
|
this.prevPath = data["return_path"] + (data["search_params"] ? ("?"+data["search_params"]) : "");
|
||||||
}
|
}
|
||||||
if((typeof document !== 'undefined') && document.referrer) {
|
if((typeof document !== 'undefined') && document.referrer) {
|
||||||
this.referrer = document.referrer;
|
this.referrer = document.referrer;
|
||||||
|
@ -845,7 +845,11 @@ export class DataProviderComponent {
|
||||||
|
|
||||||
public addEoscPrevInParams(obj) {
|
public addEoscPrevInParams(obj) {
|
||||||
if(properties.adminToolsPortalType == "eosc" && this.prevPath) {
|
if(properties.adminToolsPortalType == "eosc" && this.prevPath) {
|
||||||
return this.routerHelper.addQueryParam("pv", this.prevPath, obj);
|
let splitted: string[] = this.prevPath.split("?");
|
||||||
|
obj = this.routerHelper.addQueryParam("return_path", splitted[0], obj);
|
||||||
|
if(splitted.length > 0) {
|
||||||
|
obj = this.routerHelper.addQueryParam("search_params", splitted[1], obj);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,7 +141,11 @@ export class RelatedDatasourcesTabComponent {
|
||||||
|
|
||||||
public addEoscPrevInParams(obj) {
|
public addEoscPrevInParams(obj) {
|
||||||
if(properties.adminToolsPortalType == "eosc" && this.prevPath) {
|
if(properties.adminToolsPortalType == "eosc" && this.prevPath) {
|
||||||
return this.routerHelper.addQueryParam("pv", this.prevPath, obj);
|
let splitted: string[] = this.prevPath.split("?");
|
||||||
|
obj = this.routerHelper.addQueryParam("return_path", splitted[0], obj);
|
||||||
|
if(splitted.length > 0) {
|
||||||
|
obj = this.routerHelper.addQueryParam("search_params", splitted[1], obj);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,7 +128,11 @@ export class AvailableOnComponent {
|
||||||
|
|
||||||
public addEoscPrevInParams(obj) {
|
public addEoscPrevInParams(obj) {
|
||||||
if(properties.adminToolsPortalType == "eosc" && this.prevPath) {
|
if(properties.adminToolsPortalType == "eosc" && this.prevPath) {
|
||||||
return this.routerHelper.addQueryParam("pv", this.prevPath, obj);
|
let splitted: string[] = this.prevPath.split("?");
|
||||||
|
obj = this.routerHelper.addQueryParam("return_path", splitted[0], obj);
|
||||||
|
if(splitted.length > 0) {
|
||||||
|
obj = this.routerHelper.addQueryParam("search_params", splitted[1], obj);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,7 +110,11 @@ export class FundedByComponent {
|
||||||
|
|
||||||
public addEoscPrevInParams(obj) {
|
public addEoscPrevInParams(obj) {
|
||||||
if(properties.adminToolsPortalType == "eosc" && this.prevPath) {
|
if(properties.adminToolsPortalType == "eosc" && this.prevPath) {
|
||||||
return this.routerHelper.addQueryParam("pv", this.prevPath, obj);
|
let splitted: string[] = this.prevPath.split("?");
|
||||||
|
obj = this.routerHelper.addQueryParam("return_path", splitted[0], obj);
|
||||||
|
if(splitted.length > 0) {
|
||||||
|
obj = this.routerHelper.addQueryParam("search_params", splitted[1], obj);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import {EnvProperties} from '../../../utils/properties/env-properties';
|
||||||
import {ClickEvent} from "../../../utils/click/click-outside-or-esc.directive";
|
import {ClickEvent} from "../../../utils/click/click-outside-or-esc.directive";
|
||||||
import {NumberUtils} from "../../../utils/number-utils.class";
|
import {NumberUtils} from "../../../utils/number-utils.class";
|
||||||
import {OpenaireEntities} from "../../../utils/properties/searchFields";
|
import {OpenaireEntities} from "../../../utils/properties/searchFields";
|
||||||
|
import {StringUtils} from "../../../utils/string-utils.class";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'metrics',
|
selector: 'metrics',
|
||||||
|
@ -77,7 +78,7 @@ import {OpenaireEntities} from "../../../utils/properties/searchFields";
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr *ngFor="let key of getKeys(metrics.infos)">
|
<tr *ngFor="let key of getKeys(metrics.infos)">
|
||||||
<td class="uk-width-1-3 uk-text-center uk-text-truncate" uk-tooltip [title]="metrics.infos.get(key).name">
|
<td class="uk-width-1-3 uk-text-center uk-text-truncate" uk-tooltip [title]="metrics.infos.get(key).name">
|
||||||
<a [href]="metrics.infos.get(key).url + (prevPath ? ('&pv='+prevPath) : '')">
|
<a [href]="metrics.infos.get(key).url + getEoscParams()">
|
||||||
{{metrics.infos.get(key).name}}
|
{{metrics.infos.get(key).name}}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
@ -313,4 +314,16 @@ export class MetricsComponent {
|
||||||
let formatted = NumberUtils.roundNumber(+num);
|
let formatted = NumberUtils.roundNumber(+num);
|
||||||
return formatted.number + formatted.size;
|
return formatted.number + formatted.size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getEoscParams() {
|
||||||
|
let params = "";
|
||||||
|
if(this.prevPath) {
|
||||||
|
let splitted: string[] = this.prevPath.split("?");
|
||||||
|
params = "&return_path="+StringUtils.URIEncode(splitted[0]);
|
||||||
|
if(splitted.length > 0) {
|
||||||
|
params += "&search_params="+StringUtils.URIEncode(splitted[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return params;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,10 +9,11 @@ import {StringUtils} from "../../utils/string-utils.class";
|
||||||
})
|
})
|
||||||
export class ParsingFunctions {
|
export class ParsingFunctions {
|
||||||
public eoscSubjects = [
|
public eoscSubjects = [
|
||||||
{label: 'EOSC::Jupyter Notebook', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'marketplace.eosc-portal.eu/services?tag=EOSC%3A%3AJupyter+Notebook', value: 'Jupyter Notebook'},
|
{label: 'EOSC::Jupyter Notebook', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'search.marketplace.eosc-portal.eu/search/service?q=*&fq=tag_list:"EOSC%5C:%5C:Jupyter%20Notebook"', value: 'Jupyter Notebook'},
|
||||||
{label: 'EOSC::RO-crate', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'marketplace.eosc-portal.eu/datasources/eosc.psnc.6f0470e3bb9203ec3a7553f3a72a7a1f?q=ROHub', value: 'RO-crate'},
|
{label: 'EOSC::RO-crate', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'search.marketplace.eosc-portal.eu/search/data-source?q=*&fq=tag_list:%22eosc%5C:%5C:ro%5C-crate%22', value: 'RO-crate'},
|
||||||
{label: 'EOSC::Galaxy Workflow', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'marketplace.eosc-portal.eu/services?tag=EOSC%3A%3AGalaxy+Workflow', value: 'Galaxy Workflow'},
|
{label: 'EOSC::Galaxy Workflow', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'search.marketplace.eosc-portal.eu/search/service?q=*&fq=tag_list:%22eosc%5C:%5C:galaxy%20workflow%22', value: 'Galaxy Workflow'},
|
||||||
{label: 'EOSC::Twitter Data', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'marketplace.eosc-portal.eu/services?tag=EOSC%3A%3ATwitter+Data', value: 'Twitter Data'}
|
{label: 'EOSC::Twitter Data', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'search.marketplace.eosc-portal.eu/search/service?q=*&fq=tag_list:%22EOSC%5C:%5C:Twitter%20Data%22', value: 'Twitter Data'},
|
||||||
|
{label: 'EOSC::Data Cube', link: 'https://' + (properties.environment != 'production'?'beta.':'') + 'search.marketplace.eosc-portal.eu/search/service?q=*&fq=tag_list:%22EOSC%5C:%5C:Data%20Cube%22', value: 'Data Cube'}
|
||||||
]
|
]
|
||||||
|
|
||||||
public notebookInSubjects: boolean = false;
|
public notebookInSubjects: boolean = false;
|
||||||
|
|
|
@ -170,8 +170,8 @@ export class OrganizationComponent {
|
||||||
this.updateTitle("Organization");
|
this.updateTitle("Organization");
|
||||||
this.updateDescription("");
|
this.updateDescription("");
|
||||||
|
|
||||||
if(params["pv"]) {
|
if(params["return_path"]) {
|
||||||
this.prevPath = params["pv"];
|
this.prevPath = params["return_path"] + (params["search_params"] ? ("?"+params["search_params"]) : "");
|
||||||
}
|
}
|
||||||
if((typeof document !== 'undefined') && document.referrer) {
|
if((typeof document !== 'undefined') && document.referrer) {
|
||||||
this.referrer = document.referrer;
|
this.referrer = document.referrer;
|
||||||
|
|
|
@ -214,8 +214,8 @@ export class ProjectComponent {
|
||||||
this.updateTitle(title);
|
this.updateTitle(title);
|
||||||
this.updateDescription(description);
|
this.updateDescription(description);
|
||||||
|
|
||||||
if(params["pv"]) {
|
if(params["return_path"]) {
|
||||||
this.prevPath = params["pv"];
|
this.prevPath = params["return_path"] + (params["search_params"] ? ("?"+params["search_params"]) : "");
|
||||||
}
|
}
|
||||||
if((typeof document !== 'undefined') && document.referrer) {
|
if((typeof document !== 'undefined') && document.referrer) {
|
||||||
this.referrer = document.referrer;
|
this.referrer = document.referrer;
|
||||||
|
@ -979,7 +979,11 @@ export class ProjectComponent {
|
||||||
|
|
||||||
public addEoscPrevInParams(obj) {
|
public addEoscPrevInParams(obj) {
|
||||||
if(properties.adminToolsPortalType == "eosc" && this.prevPath) {
|
if(properties.adminToolsPortalType == "eosc" && this.prevPath) {
|
||||||
return this.routerHelper.addQueryParam("pv", this.prevPath, obj);
|
let splitted: string[] = this.prevPath.split("?");
|
||||||
|
obj = this.routerHelper.addQueryParam("return_path", splitted[0], obj);
|
||||||
|
if(splitted.length > 0) {
|
||||||
|
obj = this.routerHelper.addQueryParam("search_params", splitted[1], obj);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,9 +208,8 @@ export class ResultLandingComponent {
|
||||||
this.egiTransferModalOpen = true;
|
this.egiTransferModalOpen = true;
|
||||||
}
|
}
|
||||||
this.updateDescription("");
|
this.updateDescription("");
|
||||||
|
if(data["return_path"]) {
|
||||||
if(data["pv"]) {
|
this.prevPath = data["return_path"] + (data["search_params"] ? ("?"+data["search_params"]) : "");
|
||||||
this.prevPath = data["pv"];
|
|
||||||
}
|
}
|
||||||
if((typeof document !== 'undefined') && document.referrer) {
|
if((typeof document !== 'undefined') && document.referrer) {
|
||||||
this.referrer = document.referrer;
|
this.referrer = document.referrer;
|
||||||
|
@ -723,7 +722,7 @@ export class ResultLandingComponent {
|
||||||
}
|
}
|
||||||
if(!this.identifier) {
|
if(!this.identifier) {
|
||||||
this._location.go(( pid ? (this.linkToLandingPage.split("?")[0] + "?pid=" + pid.id):
|
this._location.go(( pid ? (this.linkToLandingPage.split("?")[0] + "?pid=" + pid.id):
|
||||||
(this.linkToLandingPage + this.id)) + (this.prevPath ? ("&pv="+this.prevPath) : ""));
|
(this.linkToLandingPage + this.id)) + this.getEoscParams());
|
||||||
}
|
}
|
||||||
// else {
|
// else {
|
||||||
// this._location.go(this.linkToLandingPage.split("?")[0] + "?pid=" + this.identifier.id);
|
// this._location.go(this.linkToLandingPage.split("?")[0] + "?pid=" + this.identifier.id);
|
||||||
|
@ -924,9 +923,25 @@ export class ResultLandingComponent {
|
||||||
this.descriptionModal.open();
|
this.descriptionModal.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getEoscParams() {
|
||||||
|
let params = "";
|
||||||
|
if(this.prevPath) {
|
||||||
|
let splitted: string[] = this.prevPath.split("?");
|
||||||
|
params = "&return_path="+StringUtils.URIEncode(splitted[0]);
|
||||||
|
if(splitted.length > 0) {
|
||||||
|
params += "&search_params="+StringUtils.URIEncode(splitted[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
public addEoscPrevInParams(obj) {
|
public addEoscPrevInParams(obj) {
|
||||||
if(properties.adminToolsPortalType == "eosc" && this.prevPath) {
|
if(properties.adminToolsPortalType == "eosc" && this.prevPath) {
|
||||||
return this.routerHelper.addQueryParam("pv", this.prevPath, obj);
|
let splitted: string[] = this.prevPath.split("?");
|
||||||
|
obj = this.routerHelper.addQueryParam("return_path", splitted[0], obj);
|
||||||
|
if(splitted.length > 0) {
|
||||||
|
obj = this.routerHelper.addQueryParam("search_params", splitted[1], obj);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
|
@ -180,7 +180,11 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
|
||||||
|
|
||||||
public addEoscPrevInParams(obj) {
|
public addEoscPrevInParams(obj) {
|
||||||
if(properties.adminToolsPortalType == "eosc" && this.prevPath) {
|
if(properties.adminToolsPortalType == "eosc" && this.prevPath) {
|
||||||
return this.routerHelper.addQueryParam("pv", this.prevPath, obj);
|
let splitted: string[] = this.prevPath.split("?");
|
||||||
|
obj = this.routerHelper.addQueryParam("return_path", splitted[0], obj);
|
||||||
|
if(splitted.length > 0) {
|
||||||
|
obj = this.routerHelper.addQueryParam("search_params", splitted[1], obj);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue