[Library | develop & Eosc Explore | develop]: Added font-family "Inter" to align with Marketplace | Updated how back button "Go to search" is build - combine referrer and the new url parameter "pv", which is expected to have the previous url path and params.

1. /assets: Added /media/fonts/inter folder with the "Inter" font-family.
2. eosc-custom.less: Override the default font family to use 'Inter', sans-serif.
3. routerHelper.class.ts: Added method "addQueryParam()" to add a query parameter in already existing or not object with parameters.
4. search-tab.component.ts & searchResult.component & projects-in-modal.component.ts & result/deletedByInference/deletedByInference.component.ts & organization/deletedByInference/deletedByInference.component.ts: Added @Input() prevPath: string = ""; and pass it to the appropriate children components.
5. result-preview.component & fundedBy.component.ts & availableOn.component.ts & relatedDatasourcesTab.component.ts: Added @Input() prevPath: string = ""; and method "addEoscPrevInParams()" and call it when building queryParams of internal links.
6. metrics.component.ts: Added @Input() prevPath: string = ""; and use it when building internal urls.
7. resultLanding.component.ts & project.component.ts & organization.component.ts & dataProvider.component.ts:
   a. Added fields public referrer: string; and public prevPath: string;
   b. Read "pv" url property and get referrer.
   c. Added methods "addEoscPrevInParams()" and "eoscBackLink()".
8. resultLanding.component.html & project.component.html & organization.component.html & dataProvider.component.html:
   a. Update "Go to Search" back link.
   b. Call "addEoscPrevInParams()" method when building queryParams of internal links.
   c. Pass "prevPath" to the appropriate children components.
This commit is contained in:
Konstantina Galouni 2023-04-20 20:06:53 +03:00
parent 65415d0146
commit f22a0bc806
21 changed files with 208 additions and 50 deletions

View File

@ -4,7 +4,7 @@
<div *ngIf="properties.adminToolsPortalType == 'eosc'" class="eosc-explore-back-search-bar"> <div *ngIf="properties.adminToolsPortalType == 'eosc'" class="eosc-explore-back-search-bar">
<div class="uk-light uk-container uk-container-large uk-padding-small uk-height-1-1"> <div class="uk-light uk-container uk-container-large uk-padding-small uk-height-1-1">
<div class="uk-flex uk-flex-inline uk-flex-middle uk-height-1-1"> <div class="uk-flex uk-flex-inline uk-flex-middle uk-height-1-1">
<a href="https://search.marketplace.eosc-portal.eu/" target="_self" class="uk-link-reset uk-flex uk-flex-middle uk-text-light uk-text-small"> <a [href]="eoscBackLink" target="_self" class="uk-link-reset uk-flex uk-flex-middle uk-text-light uk-text-small">
<icon name="arrow_back" visuallyHidden="back" flex="true" ratio="0.7" customClass="uk-text-light"></icon> <icon name="arrow_back" visuallyHidden="back" flex="true" ratio="0.7" customClass="uk-text-light"></icon>
<span class="uk-margin-small-left">Go to Search</span> <span class="uk-margin-small-left">Go to Search</span>
</a> </a>
@ -115,7 +115,7 @@
<div> <div>
<span class="uk-label uk-text-truncate" [class.uk-label-danger]="dataProviderInfo.compatibility.info == 'not available'" title="Compatibility"> <span class="uk-label uk-text-truncate" [class.uk-label-danger]="dataProviderInfo.compatibility.info == 'not available'" title="Compatibility">
<a *ngIf="dataProviderInfo.compatibility.id" <a *ngIf="dataProviderInfo.compatibility.id"
[queryParams]="{datasourceId: dataProviderInfo.compatibility.id}" routerLinkActive="router-link-active" [queryParams]="addEoscPrevInParams({datasourceId: dataProviderInfo.compatibility.id})" routerLinkActive="router-link-active"
[routerLink]="properties.searchLinkToDataProvider.split('?')[0]"> [routerLink]="properties.searchLinkToDataProvider.split('?')[0]">
{{dataProviderInfo.compatibility.info}} {{dataProviderInfo.compatibility.info}}
<ng-container *ngIf="dataProviderInfo.compatibility.name">{{dataProviderInfo.compatibility.name}}</ng-container> <ng-container *ngIf="dataProviderInfo.compatibility.name">{{dataProviderInfo.compatibility.name}}</ng-container>
@ -355,7 +355,7 @@
<search-tab [fetch]="fetchProjects" resultType="project" <search-tab [fetch]="fetchProjects" resultType="project"
[params]="getParamsForSearchLink()" [params]="getParamsForSearchLink()"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedProjects" [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedProjects"
[properties]="properties"> [properties]="properties" [prevPath]="prevPath">
</search-tab> </search-tab>
</div> </div>
</ng-container> </ng-container>
@ -365,7 +365,7 @@
<search-tab [fetch]="fetchDataproviders" resultType="dataprovider" <search-tab [fetch]="fetchDataproviders" resultType="dataprovider"
[params]="getParamsForSearchLink()" [params]="getParamsForSearchLink()"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedDataProviders" [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedDataProviders"
[properties]="properties"> [properties]="properties" [prevPath]="prevPath">
</search-tab> </search-tab>
</div> </div>
</ng-container> </ng-container>
@ -375,7 +375,7 @@
<search-tab [fetch]="fetchPublications" resultType="publication" <search-tab [fetch]="fetchPublications" resultType="publication"
[params]="getParamsForSearchLink('publications')" [params]="getParamsForSearchLink('publications')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults" [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties"> [properties]="properties" [prevPath]="prevPath">
</search-tab> </search-tab>
</div> </div>
</ng-container> </ng-container>
@ -385,7 +385,7 @@
<search-tab [fetch]="fetchDatasets" resultType="dataset" <search-tab [fetch]="fetchDatasets" resultType="dataset"
[params]="getParamsForSearchLink('datasets')" [params]="getParamsForSearchLink('datasets')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults" [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties"> [properties]="properties" [prevPath]="prevPath">
</search-tab> </search-tab>
</div> </div>
</ng-container> </ng-container>
@ -395,7 +395,7 @@
<search-tab [fetch]="fetchSoftware" resultType="software" <search-tab [fetch]="fetchSoftware" resultType="software"
[params]="getParamsForSearchLink('software')" [params]="getParamsForSearchLink('software')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults" [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties"> [properties]="properties" [prevPath]="prevPath">
</search-tab> </search-tab>
</div> </div>
</ng-container> </ng-container>
@ -405,7 +405,7 @@
<search-tab [fetch]="fetchOrps" resultType="other" <search-tab [fetch]="fetchOrps" resultType="other"
[params]="getParamsForSearchLink('other')" [params]="getParamsForSearchLink('other')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults" [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties"> [properties]="properties" [prevPath]="prevPath">
</search-tab> </search-tab>
</div> </div>
</ng-container> </ng-container>
@ -420,7 +420,7 @@
[fetchResults]="fetchAggregatorsResults" [fetchResults]="fetchAggregatorsResults"
[collectedFromName]="dataProviderInfo.title.name" [collectedFromName]="dataProviderInfo.title.name"
[properties]=properties [properties]=properties
[modal]="relatedDatasourcesModal"> [modal]="relatedDatasourcesModal" [prevPath]="prevPath">
</relatedDatasourcesTab> </relatedDatasourcesTab>
</div> </div>
</ng-container> </ng-container>
@ -477,7 +477,7 @@
[attr.uk-tooltip]="organization.acronym && organization.name ? 'pos:right; delay:10' : 'cls: uk-invisible'" [attr.uk-tooltip]="organization.acronym && organization.name ? 'pos:right; delay:10' : 'cls: uk-invisible'"
[title]="organization.name"> [title]="organization.name">
<a *ngIf="organization.id" class="uk-link-text" <a *ngIf="organization.id" class="uk-link-text"
[queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active" [queryParams]="addEoscPrevInParams({organizationId: organization.id})" routerLinkActive="router-link-active"
[routerLink]="properties.searchLinkToOrganization.split('?')[0]"> [routerLink]="properties.searchLinkToOrganization.split('?')[0]">
{{(organization.acronym) ? organization.acronym : ''}} {{(organization.acronym) ? organization.acronym : ''}}
{{(!organization.acronym && organization.name) ? organization.name : ''}} {{(!organization.acronym && organization.name) ? organization.name : ''}}

View File

@ -38,6 +38,9 @@ declare var ResizeObserver;
}) })
export class DataProviderComponent { export class DataProviderComponent {
public referrer: string;
public prevPath: string;
@Input() type: string = "dataprovider"; @Input() type: string = "dataprovider";
private typeQueryPathParam: string = "datasources"; private typeQueryPathParam: string = "datasources";
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@ -182,6 +185,14 @@ export class DataProviderComponent {
this.subscriptions.push(this.route.queryParams.subscribe(data => { this.subscriptions.push(this.route.queryParams.subscribe(data => {
this.stickyHeader = false; this.stickyHeader = false;
this.updateDescription(""); this.updateDescription("");
if(data["pv"]) {
this.prevPath = data["pv"];
}
if((typeof document !== 'undefined') && document.referrer) {
this.referrer = document.referrer;
}
// this.datasourceId = data['datasourceId']; // this.datasourceId = data['datasourceId'];
if (data['datasourceId']) { if (data['datasourceId']) {
this.datasourceId = data['datasourceId']; this.datasourceId = data['datasourceId'];
@ -831,4 +842,19 @@ export class DataProviderComponent {
this.descriptionModal.alertTitle = "Description"; this.descriptionModal.alertTitle = "Description";
this.descriptionModal.open(); this.descriptionModal.open();
} }
public addEoscPrevInParams(obj) {
if(properties.adminToolsPortalType == "eosc" && this.prevPath) {
return this.routerHelper.addQueryParam("pv", this.prevPath, obj);
}
return obj;
}
public get eoscBackLink() {
if(this.prevPath && this.referrer && ((this.referrer == "https://eosc-search-service.grid.cyfronet.pl/") || (this.referrer == "https://beta.search.marketplace.eosc-portal.eu/") || (this.referrer == "https://search.marketplace.eosc-portal.eu/"))) {
return this.referrer+atob(this.prevPath);
} else {
return "https://"+(this.properties.environment == "beta" ? "beta" : "")+"search.marketplace.eosc-portal.eu/";
}
}
} }

View File

@ -40,7 +40,7 @@ import {OpenaireEntities} from "../../utils/properties/searchFields";
<ng-container *ngFor="let result of results; let i=index"> <ng-container *ngFor="let result of results; let i=index">
<tr *ngIf="i>=(page-1)*pageSize && i<page*pageSize"> <tr *ngIf="i>=(page-1)*pageSize && i<page*pageSize">
<td> <td>
<a [queryParams]="{datasourceId: result.id}" routerLinkActive="router-link-active" [routerLink]="dataProviderUrl" <a [queryParams]="addEoscPrevInParams({datasourceId: result.id})" routerLinkActive="router-link-active" [routerLink]="dataProviderUrl"
(click)="onLinkClick()"> (click)="onLinkClick()">
{{result.name}} {{result.name}}
</a> </a>
@ -73,6 +73,7 @@ import {OpenaireEntities} from "../../utils/properties/searchFields";
}) })
export class RelatedDatasourcesTabComponent { export class RelatedDatasourcesTabComponent {
@Input() prevPath: string = "";
@Input() dataproviderId: string; @Input() dataproviderId: string;
// @Input() fetchPublications : FetchResearchResults; // @Input() fetchPublications : FetchResearchResults;
// @Input() fetchDatasets : FetchResearchResults; // @Input() fetchDatasets : FetchResearchResults;
@ -137,4 +138,11 @@ export class RelatedDatasourcesTabComponent {
this.modal.cancel(); this.modal.cancel();
} }
} }
public addEoscPrevInParams(obj) {
if(properties.adminToolsPortalType == "eosc" && this.prevPath) {
return this.routerHelper.addQueryParam("pv", this.prevPath, obj);
}
return obj;
}
} }

View File

@ -1,6 +1,7 @@
import {Component, EventEmitter, Input, Output} from '@angular/core'; import {Component, EventEmitter, Input, Output} from '@angular/core';
import {HostedByCollectedFrom} from "../../utils/result-preview/result-preview"; import {HostedByCollectedFrom} from "../../utils/result-preview/result-preview";
import {properties} from "../../../../environments/environment"; import {properties} from "../../../../environments/environment";
import {RouterHelper} from "../../utils/routerHelper.class";
@Component({ @Component({
selector: 'availableOn', selector: 'availableOn',
@ -49,7 +50,7 @@ import {properties} from "../../../../environments/environment";
<div *ngIf="instance.collectedNamesAndIds?.size > 0" class="uk-text-meta"> <div *ngIf="instance.collectedNamesAndIds?.size > 0" class="uk-text-meta">
<span>Providers: </span> <span>Providers: </span>
<a *ngFor="let collectedName of getKeys(instance.collectedNamesAndIds); let i=index" [routerLink]="dataProviderUrl" <a *ngFor="let collectedName of getKeys(instance.collectedNamesAndIds); let i=index" [routerLink]="dataProviderUrl"
[queryParams]="{datasourceId: instance.collectedNamesAndIds.get(collectedName)}" class="uk-link-text"> [queryParams]="addEoscPrevInParams({datasourceId: instance.collectedNamesAndIds.get(collectedName)})" class="uk-link-text">
{{collectedName}}<ng-container *ngIf="(i !== (instance.collectedNamesAndIds.size - 1))">; </ng-container> {{collectedName}}<ng-container *ngIf="(i !== (instance.collectedNamesAndIds.size - 1))">; </ng-container>
</a> </a>
</div> </div>
@ -80,6 +81,7 @@ import {properties} from "../../../../environments/environment";
}) })
export class AvailableOnComponent { export class AvailableOnComponent {
@Input() prevPath: string = "";
@Input() availableOn: HostedByCollectedFrom[]; @Input() availableOn: HostedByCollectedFrom[];
@Input() viewAll: boolean = false; @Input() viewAll: boolean = false;
@Output() viewAllClicked = new EventEmitter(); @Output() viewAllClicked = new EventEmitter();
@ -87,7 +89,8 @@ export class AvailableOnComponent {
public threshold: number = 1; public threshold: number = 1;
public dataProviderUrl = properties.searchLinkToDataProvider.split('?')[0]; public dataProviderUrl = properties.searchLinkToDataProvider.split('?')[0];
public title: string = "Download from"; public title: string = "Download from";
public routerHelper:RouterHelper = new RouterHelper();
constructor() { constructor() {
} }
@ -122,4 +125,11 @@ export class AvailableOnComponent {
public isUrl(str: string): boolean { public isUrl(str: string): boolean {
return str.startsWith('http://') || str.startsWith('https://') || str.startsWith('//') || str.startsWith('www.'); return str.startsWith('http://') || str.startsWith('https://') || str.startsWith('//') || str.startsWith('www.');
} }
public addEoscPrevInParams(obj) {
if(properties.adminToolsPortalType == "eosc" && this.prevPath) {
return this.routerHelper.addQueryParam("pv", this.prevPath, obj);
}
return obj;
}
} }

View File

@ -2,6 +2,7 @@ import {Component, EventEmitter, Input, Output} from '@angular/core';
import {Project} from "../../utils/result-preview/result-preview"; import {Project} from "../../utils/result-preview/result-preview";
import {properties} from "../../../../environments/environment"; import {properties} from "../../../../environments/environment";
import {HelperFunctions} from '../../utils/HelperFunctions.class'; import {HelperFunctions} from '../../utils/HelperFunctions.class';
import {RouterHelper} from "../../utils/routerHelper.class";
@Component({ @Component({
selector: 'fundedBy', selector: 'fundedBy',
@ -33,7 +34,7 @@ import {HelperFunctions} from '../../utils/HelperFunctions.class';
<span>Project</span> <span>Project</span>
<div class="uk-margin-bottom"> <div class="uk-margin-bottom">
<a *ngIf="item.id" class="uk-h6 uk-margin-remove portal-link" <a *ngIf="item.id" class="uk-h6 uk-margin-remove portal-link"
[queryParams]="{projectId: item.id}" [routerLink]="url"> [queryParams]="addEoscPrevInParams({projectId: item.id})" [routerLink]="url">
{{item['acronym'] ? item['acronym'] : item['title']}} {{item['acronym'] ? item['acronym'] : item['title']}}
</a> </a>
<span *ngIf="!item.id" class="uk-h6 uk-margin-remove"> <span *ngIf="!item.id" class="uk-h6 uk-margin-remove">
@ -72,6 +73,7 @@ import {HelperFunctions} from '../../utils/HelperFunctions.class';
}) })
export class FundedByComponent { export class FundedByComponent {
@Input() prevPath: string = "";
@Input() fundedByProjects: Project[]; @Input() fundedByProjects: Project[];
@Input() viewAll: boolean = false; @Input() viewAll: boolean = false;
@Output() viewAllClicked = new EventEmitter(); @Output() viewAllClicked = new EventEmitter();
@ -81,6 +83,7 @@ export class FundedByComponent {
public title: string = "Funded by"; public title: string = "Funded by";
@Input() provenanceActionVocabulary = null; @Input() provenanceActionVocabulary = null;
public provenancesCalculated: boolean[] = []; public provenancesCalculated: boolean[] = [];
public routerHelper:RouterHelper = new RouterHelper();
public viewAllClick() { public viewAllClick() {
if(this.fundedByProjects.length <= this.threshold*2) { if(this.fundedByProjects.length <= this.threshold*2) {
@ -104,4 +107,11 @@ export class FundedByComponent {
} }
return item.provenanceAction; return item.provenanceAction;
} }
public addEoscPrevInParams(obj) {
if(properties.adminToolsPortalType == "eosc" && this.prevPath) {
return this.routerHelper.addQueryParam("pv", this.prevPath, obj);
}
return obj;
}
} }

View File

@ -77,7 +77,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}}"> <a [href]="metrics.infos.get(key).url + (prevPath ? ('&pv='+prevPath) : '')">
{{metrics.infos.get(key).name}} {{metrics.infos.get(key).name}}
</a> </a>
</td> </td>
@ -128,6 +128,7 @@ import {OpenaireEntities} from "../../../utils/properties/searchFields";
}) })
export class MetricsComponent { export class MetricsComponent {
@Input() prevPath: string = "";
@Output() metricsResults = new EventEmitter(); @Output() metricsResults = new EventEmitter();
@Input() id: string; @Input() id: string;
@Input() entityType: string; @Input() entityType: string;

View File

@ -39,7 +39,7 @@ import {OpenaireEntities} from '../../utils/properties/searchFields';
<search-result [results]="fetchProjects.results" <search-result [results]="fetchProjects.results"
[status]="fetchProjects.searchUtils.status" [status]="fetchProjects.searchUtils.status"
[type]="'project'" [type]="'project'"
[showLoading]="true" [properties]="properties"> [showLoading]="true" [properties]="properties" [prevPath]="prevPath">
</search-result> </search-result>
<paging-no-load *ngIf="fetchProjects.searchUtils.totalResults > size" <paging-no-load *ngIf="fetchProjects.searchUtils.totalResults > size"
(pageChange)="pageChange($event)" (pageChange)="pageChange($event)"
@ -52,6 +52,7 @@ import {OpenaireEntities} from '../../utils/properties/searchFields';
}) })
export class ProjectsInModalComponent { export class ProjectsInModalComponent {
@Input() prevPath: string = "";
@Input() fetchProjects: FetchProjects; @Input() fetchProjects: FetchProjects;
@Input() organizationId: string = ""; @Input() organizationId: string = "";
@Input() properties: EnvProperties; @Input() properties: EnvProperties;

View File

@ -26,7 +26,8 @@ import {HelperFunctions} from "../../../utils/HelperFunctions.class";
</no-load-paging> </no-load-paging>
<ul class="uk-list uk-list-divider uk-margin"> <ul class="uk-list uk-list-divider uk-margin">
<li *ngFor="let result of results.slice((page-1)*pageSize, page*pageSize)"> <li *ngFor="let result of results.slice((page-1)*pageSize, page*pageSize)">
<result-preview [modal]="modal" [properties]="properties" [hasLink]="false" [result]="getResultPreview(result)" [isCard]="false"></result-preview> <result-preview [modal]="modal" [properties]="properties" [hasLink]="false" [result]="getResultPreview(result)"
[isCard]="false" [prevPath]="prevPath"></result-preview>
</li> </li>
</ul> </ul>
<no-load-paging *ngIf="results.length > pageSize" [type]="type" <no-load-paging *ngIf="results.length > pageSize" [type]="type"
@ -38,6 +39,7 @@ import {HelperFunctions} from "../../../utils/HelperFunctions.class";
` `
}) })
export class OrganizationsDeletedByInferenceComponent { export class OrganizationsDeletedByInferenceComponent {
@Input() prevPath: string = "";
public results: OrganizationInfo[] = []; public results: OrganizationInfo[] = [];
@Input() id: string; @Input() id: string;
@Input() ids: string[] = []; @Input() ids: string[] = [];

View File

@ -4,7 +4,7 @@
<div *ngIf="properties.adminToolsPortalType == 'eosc'" class="eosc-explore-back-search-bar"> <div *ngIf="properties.adminToolsPortalType == 'eosc'" class="eosc-explore-back-search-bar">
<div class="uk-light uk-container uk-container-large uk-padding-small uk-height-1-1"> <div class="uk-light uk-container uk-container-large uk-padding-small uk-height-1-1">
<div class="uk-flex uk-flex-inline uk-flex-middle uk-height-1-1"> <div class="uk-flex uk-flex-inline uk-flex-middle uk-height-1-1">
<a href="https://search.marketplace.eosc-portal.eu/" target="_self" class="uk-link-reset uk-flex uk-flex-middle uk-text-light uk-text-small"> <a [href]="eoscBackLink" target="_self" class="uk-link-reset uk-flex uk-flex-middle uk-text-light uk-text-small">
<icon name="arrow_back" visuallyHidden="back" flex="true" ratio="0.7" customClass="uk-text-light"></icon> <icon name="arrow_back" visuallyHidden="back" flex="true" ratio="0.7" customClass="uk-text-light"></icon>
<span class="uk-margin-small-left">Go to Search</span> <span class="uk-margin-small-left">Go to Search</span>
</a> </a>
@ -176,7 +176,7 @@
<div id="landing-sections" class="uk-text-small"> <div id="landing-sections" class="uk-text-small">
<div id="projects" class="landing-section landing-section-height-auto uk-padding uk-padding-remove-horizontal"> <div id="projects" class="landing-section landing-section-height-auto uk-padding uk-padding-remove-horizontal">
<projectsInModal [fetchProjects]="fetchProjects" <projectsInModal [fetchProjects]="fetchProjects"
[organizationId]="organizationId" [properties]=properties> [organizationId]="organizationId" [properties]=properties [prevPath]="prevPath">
</projectsInModal> </projectsInModal>
</div> </div>
<div *ngIf="fetchDataproviders && fetchDataproviders.searchUtils.totalResults > 0" <div *ngIf="fetchDataproviders && fetchDataproviders.searchUtils.totalResults > 0"
@ -184,7 +184,7 @@
<search-tab [fetch]="fetchDataproviders" resultType="dataprovider" <search-tab [fetch]="fetchDataproviders" resultType="dataprovider"
[params]="getParamsForSearchLink()" [params]="getParamsForSearchLink()"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedDataProviders" [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedDataProviders"
[properties]="properties"> [properties]="properties" [prevPath]="prevPath">
</search-tab> </search-tab>
</div> </div>
<div *ngIf="fetchPublications && fetchPublications.searchUtils.totalResults > 0" <div *ngIf="fetchPublications && fetchPublications.searchUtils.totalResults > 0"
@ -192,7 +192,7 @@
<search-tab [fetch]="fetchPublications" resultType="publication" <search-tab [fetch]="fetchPublications" resultType="publication"
[params]="getParamsForSearchLink('publications')" [params]="getParamsForSearchLink('publications')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults" [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties"> [properties]="properties" [prevPath]="prevPath">
</search-tab> </search-tab>
</div> </div>
<div *ngIf="fetchDatasets && fetchDatasets.searchUtils.totalResults > 0" <div *ngIf="fetchDatasets && fetchDatasets.searchUtils.totalResults > 0"
@ -200,7 +200,7 @@
<search-tab [fetch]="fetchDatasets" resultType="dataset" <search-tab [fetch]="fetchDatasets" resultType="dataset"
[params]="getParamsForSearchLink('datasets')" [params]="getParamsForSearchLink('datasets')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults" [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties"> [properties]="properties" [prevPath]="prevPath">
</search-tab> </search-tab>
</div> </div>
<div *ngIf="fetchSoftware && fetchSoftware.searchUtils.totalResults > 0" <div *ngIf="fetchSoftware && fetchSoftware.searchUtils.totalResults > 0"
@ -208,7 +208,7 @@
<search-tab [fetch]="fetchSoftware" resultType="software" <search-tab [fetch]="fetchSoftware" resultType="software"
[params]="getParamsForSearchLink('software')" [params]="getParamsForSearchLink('software')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults" [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties"> [properties]="properties" [prevPath]="prevPath">
</search-tab> </search-tab>
</div> </div>
<div *ngIf="fetchOrps && fetchOrps.searchUtils.totalResults > 0" <div *ngIf="fetchOrps && fetchOrps.searchUtils.totalResults > 0"
@ -216,7 +216,7 @@
<search-tab [fetch]="fetchOrps" resultType="other" <search-tab [fetch]="fetchOrps" resultType="other"
[params]="getParamsForSearchLink('other')" [params]="getParamsForSearchLink('other')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults" [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties"> [properties]="properties" [prevPath]="prevPath">
</search-tab> </search-tab>
</div> </div>
</div> </div>
@ -247,7 +247,7 @@
[id]="organizationInfo.objIdentifier" [id]="organizationInfo.objIdentifier"
[ids]="organizationInfo.deletedByInferenceIds" [ids]="organizationInfo.deletedByInferenceIds"
[modal]="AlertModalDeletedByInference" [modal]="AlertModalDeletedByInference"
[type]="'organizations'"> [type]="'organizations'" [prevPath]="prevPath">
</organizationsDeletedByInference> </organizationsDeletedByInference>
</modal-alert> </modal-alert>
<!-- Share --> <!-- Share -->

View File

@ -34,6 +34,9 @@ declare var ResizeObserver;
templateUrl: 'organization.component.html', templateUrl: 'organization.component.html',
}) })
export class OrganizationComponent { export class OrganizationComponent {
public referrer: string;
public prevPath: string;
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() communityId = null; @Input() communityId = null;
@ -167,6 +170,13 @@ export class OrganizationComponent {
this.updateTitle("Organization"); this.updateTitle("Organization");
this.updateDescription(""); this.updateDescription("");
if(params["pv"]) {
this.prevPath = params["pv"];
}
if((typeof document !== 'undefined') && document.referrer) {
this.referrer = document.referrer;
}
this.organizationId = params['organizationId']; this.organizationId = params['organizationId'];
if (this.organizationId && StringUtils.isOpenAIREID(this.organizationId)) { if (this.organizationId && StringUtils.isOpenAIREID(this.organizationId)) {
@ -805,4 +815,12 @@ export class OrganizationComponent {
public scroll() { public scroll() {
HelperFunctions.scroll(); HelperFunctions.scroll();
} }
public get eoscBackLink() {
if(this.prevPath && this.referrer && ((this.referrer == "https://eosc-search-service.grid.cyfronet.pl/") || (this.referrer == "https://beta.search.marketplace.eosc-portal.eu/") || (this.referrer == "https://search.marketplace.eosc-portal.eu/"))) {
return this.referrer+atob(this.prevPath);
} else {
return "https://"+(this.properties.environment == "beta" ? "beta" : "")+"search.marketplace.eosc-portal.eu/";
}
}
} }

View File

@ -4,7 +4,7 @@
<div *ngIf="properties.adminToolsPortalType == 'eosc'" class="eosc-explore-back-search-bar"> <div *ngIf="properties.adminToolsPortalType == 'eosc'" class="eosc-explore-back-search-bar">
<div class="uk-light uk-container uk-container-large uk-padding-small uk-height-1-1"> <div class="uk-light uk-container uk-container-large uk-padding-small uk-height-1-1">
<div class="uk-flex uk-flex-inline uk-flex-middle uk-height-1-1"> <div class="uk-flex uk-flex-inline uk-flex-middle uk-height-1-1">
<a href="https://search.marketplace.eosc-portal.eu/" target="_self" class="uk-link-reset uk-flex uk-flex-middle uk-text-light uk-text-small"> <a [href]="eoscBackLink" target="_self" class="uk-link-reset uk-flex uk-flex-middle uk-text-light uk-text-small">
<icon name="arrow_back" visuallyHidden="back" flex="true" ratio="0.7" customClass="uk-text-light"></icon> <icon name="arrow_back" visuallyHidden="back" flex="true" ratio="0.7" customClass="uk-text-light"></icon>
<span class="uk-margin-small-left">Go to Search</span> <span class="uk-margin-small-left">Go to Search</span>
</a> </a>
@ -391,7 +391,7 @@
<search-tab [fetch]="fetchPublications" resultType="publication" <search-tab [fetch]="fetchPublications" resultType="publication"
[params]="getParamsForSearchLink('publications')" [params]="getParamsForSearchLink('publications')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults" [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties"> [properties]="properties" [prevPath]="prevPath">
</search-tab> </search-tab>
</div> </div>
</ng-container> </ng-container>
@ -401,7 +401,7 @@
<search-tab [fetch]="fetchDatasets" resultType="dataset" <search-tab [fetch]="fetchDatasets" resultType="dataset"
[params]="getParamsForSearchLink('datasets')" [params]="getParamsForSearchLink('datasets')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults" [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties"> [properties]="properties" [prevPath]="prevPath">
</search-tab> </search-tab>
</div> </div>
</ng-container> </ng-container>
@ -410,7 +410,7 @@
<search-tab [fetch]="fetchSoftware" resultType="software" <search-tab [fetch]="fetchSoftware" resultType="software"
[params]="getParamsForSearchLink('software')" [params]="getParamsForSearchLink('software')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults" [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties"> [properties]="properties" [prevPath]="prevPath">
</search-tab> </search-tab>
</div> </div>
</ng-container> </ng-container>
@ -419,16 +419,23 @@
<search-tab [fetch]="fetchOrps" resultType="other" <search-tab [fetch]="fetchOrps" resultType="other"
[params]="getParamsForSearchLink('other')" [params]="getParamsForSearchLink('other')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults" [searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties"> [properties]="properties" [prevPath]="prevPath">
</search-tab> </search-tab>
</div> </div>
</ng-container> </ng-container>
<ng-container> <ng-container>
<div id="dmps" class="landing-section uk-padding uk-padding-remove-horizontal"> <div id="dmps" class="landing-section uk-padding uk-padding-remove-horizontal">
<search-tab [fetch]="fetchDmps" customTitle="Data Management Plans" <search-tab [fetch]="fetchDmps" customTitle="Data Management Plans"
[properties]="properties" resultType="DMPs"> [properties]="properties" resultType="DMPs" [prevPath]="prevPath">
<div class="uk-margin-medium-top uk-margin-bottom uk-width-1-1 uk-flex uk-flex-center uk-flex-middle"> <div class="uk-margin-medium-top uk-margin-bottom uk-width-1-1 uk-flex uk-flex-center uk-flex-middle">
<a *ngIf="fetchDmps.searchUtils.totalResults > 0" class="uk-button uk-button-text uk-margin-right" <a *ngIf="properties.adminToolsPortalType == 'eosc' && fetchDmps.searchUtils.totalResults > 0"
class="uk-button uk-button-text uk-margin-right custom-external"
[href]="'https://explore.openaire.eu'+properties.searchLinkToAdvancedResults+
'?f0=relprojectid&fv0='+projectId+'&type=publications&instancetypename=Data Management Plan&qf=false&sortBy=resultdateofacceptance,descending'"
target="_blank">
View all in OpenAIRE
</a>
<a *ngIf="properties.adminToolsPortalType != 'eosc' && fetchDmps.searchUtils.totalResults > 0" class="uk-button uk-button-text uk-margin-right"
[queryParams]="getParamsForSearchLink('publications', 'Data Management Plan')" [queryParams]="getParamsForSearchLink('publications', 'Data Management Plan')"
[routerLink]="properties.searchLinkToAdvancedResults"> [routerLink]="properties.searchLinkToAdvancedResults">
View all View all
@ -592,7 +599,7 @@
[attr.uk-tooltip]="organization.acronym && organization.name ? 'pos:right; delay:10' : 'cls: uk-invisible'" [attr.uk-tooltip]="organization.acronym && organization.name ? 'pos:right; delay:10' : 'cls: uk-invisible'"
[title]="organization.name"> [title]="organization.name">
<a *ngIf="organization.id" class="uk-link-text" <a *ngIf="organization.id" class="uk-link-text"
[queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active" [queryParams]="addEoscPrevInParams({organizationId: organization.id})" routerLinkActive="router-link-active"
[routerLink]="properties.searchLinkToOrganization.split('?')[0]"> [routerLink]="properties.searchLinkToOrganization.split('?')[0]">
{{(organization.acronym) ? organization.acronym : ''}} {{(organization.acronym) ? organization.acronym : ''}}
{{(!organization.acronym && organization.name) ? organization.name : ''}} {{(!organization.acronym && organization.name) ? organization.name : ''}}

View File

@ -38,6 +38,9 @@ declare var ResizeObserver;
}) })
export class ProjectComponent { export class ProjectComponent {
public referrer: string;
public prevPath: string;
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() communityId = null; @Input() communityId = null;
public projectInfo: ProjectInfo; public projectInfo: ProjectInfo;
@ -210,6 +213,14 @@ export class ProjectComponent {
this.updateTitle(title); this.updateTitle(title);
this.updateDescription(description); this.updateDescription(description);
if(params["pv"]) {
this.prevPath = params["pv"];
}
if((typeof document !== 'undefined') && document.referrer) {
this.referrer = document.referrer;
}
this.projectId = params['projectId']; this.projectId = params['projectId'];
var grantId = params['grantId']; var grantId = params['grantId'];
var funder = params['funder']; var funder = params['funder'];
@ -965,4 +976,19 @@ export class ProjectComponent {
this.descriptionModal.alertTitle = "Description"; this.descriptionModal.alertTitle = "Description";
this.descriptionModal.open(); this.descriptionModal.open();
} }
public addEoscPrevInParams(obj) {
if(properties.adminToolsPortalType == "eosc" && this.prevPath) {
return this.routerHelper.addQueryParam("pv", this.prevPath, obj);
}
return obj;
}
public get eoscBackLink() {
if(this.prevPath && this.referrer && ((this.referrer == "https://eosc-search-service.grid.cyfronet.pl/") || (this.referrer == "https://beta.search.marketplace.eosc-portal.eu/") || (this.referrer == "https://search.marketplace.eosc-portal.eu/"))) {
return this.referrer+atob(this.prevPath);
} else {
return "https://"+(this.properties.environment == "beta" ? "beta" : "")+"search.marketplace.eosc-portal.eu/";
}
}
} }

View File

@ -26,7 +26,8 @@ import {HelperFunctions} from "../../../utils/HelperFunctions.class";
</no-load-paging> </no-load-paging>
<ul class="uk-list uk-list-divider uk-margin"> <ul class="uk-list uk-list-divider uk-margin">
<li *ngFor="let result of results.slice((page-1)*pageSize, page*pageSize)"> <li *ngFor="let result of results.slice((page-1)*pageSize, page*pageSize)">
<result-preview [modal]="modal" [properties]="properties" [hasLink]="false" [result]="getResultPreview(result)" [showOrcid]="false" [isCard]="false"></result-preview> <result-preview [modal]="modal" [properties]="properties" [hasLink]="false" [result]="getResultPreview(result)"
[showOrcid]="false" [isCard]="false" [prevPath]="prevPath"></result-preview>
</li> </li>
</ul> </ul>
<no-load-paging *ngIf="results.length > pageSize" [type]="type" <no-load-paging *ngIf="results.length > pageSize" [type]="type"
@ -38,6 +39,7 @@ import {HelperFunctions} from "../../../utils/HelperFunctions.class";
` `
}) })
export class DeletedByInferenceComponent { export class DeletedByInferenceComponent {
@Input() prevPath: string = "";
public results: ResultLandingInfo[] = []; public results: ResultLandingInfo[] = [];
@Input() id: string; @Input() id: string;
@Input() ids: string[] = []; @Input() ids: string[] = [];

View File

@ -4,7 +4,7 @@
<div *ngIf="properties.adminToolsPortalType == 'eosc'" class="eosc-explore-back-search-bar"> <div *ngIf="properties.adminToolsPortalType == 'eosc'" class="eosc-explore-back-search-bar">
<div class="uk-light uk-container uk-container-large uk-padding-small uk-height-1-1"> <div class="uk-light uk-container uk-container-large uk-padding-small uk-height-1-1">
<div class="uk-flex uk-flex-inline uk-flex-middle uk-height-1-1"> <div class="uk-flex uk-flex-inline uk-flex-middle uk-height-1-1">
<a href="https://search.marketplace.eosc-portal.eu/" target="_self" class="uk-link-reset uk-flex uk-flex-middle uk-text-light uk-text-small"> <a [href]="eoscBackLink" target="_self" class="uk-link-reset uk-flex uk-flex-middle uk-text-light uk-text-small">
<icon name="arrow_back" visuallyHidden="back" flex="true" ratio="0.7" customClass="uk-text-light"></icon> <icon name="arrow_back" visuallyHidden="back" flex="true" ratio="0.7" customClass="uk-text-light"></icon>
<span class="uk-margin-small-left">Go to Search</span> <span class="uk-margin-small-left">Go to Search</span>
</a> </a>
@ -23,7 +23,8 @@
[pageViews]="pageViews" [pageViews]="pageViews"
[id]="id" [entityType]="'results'" [entity]="title" [id]="id" [entityType]="'results'" [entity]="title"
[viewsFrameUrl]="viewsFrameUrl" [downloadsFrameUrl]="downloadsFrameUrl" [viewsFrameUrl]="viewsFrameUrl" [downloadsFrameUrl]="downloadsFrameUrl"
(metricsResults)="metricsResults($event)" [properties]=properties> (metricsResults)="metricsResults($event)" [properties]=properties
[prevPath]="prevPath">
</metrics> </metrics>
<altmetrics *ngIf="hasAltMetrics" id="{{resultLandingInfo.identifiers?.get('doi')[0]}}" type="doi"></altmetrics> <altmetrics *ngIf="hasAltMetrics" id="{{resultLandingInfo.identifiers?.get('doi')[0]}}" type="doi"></altmetrics>
</ng-container> </ng-container>
@ -330,7 +331,7 @@
[<a *ngIf="id.type !== 'openaire'" href="{{getReferenceUrl(id)}}" [<a *ngIf="id.type !== 'openaire'" href="{{getReferenceUrl(id)}}"
target="_blank">{{getReferenceIdName(id)}}</a> target="_blank">{{getReferenceIdName(id)}}</a>
<a *ngIf="id.type === 'openaire'" [routerLink]="properties.searchLinkToResult.split('?')[0]" <a *ngIf="id.type === 'openaire'" [routerLink]="properties.searchLinkToResult.split('?')[0]"
[queryParams]="{id: id.value}" [queryParams]="addEoscPrevInParams({id: id.value})"
target="_blank">OpenAIRE</a>] target="_blank">OpenAIRE</a>]
</span> </span>
</ng-container> </ng-container>
@ -480,7 +481,8 @@
</div> </div>
<!-- Funded By --> <!-- Funded By -->
<div *ngIf="resultLandingInfo.fundedByProjects && resultLandingInfo.fundedByProjects.length > 0 && (!viewAll || viewAll=='fundedBy')"> <div *ngIf="resultLandingInfo.fundedByProjects && resultLandingInfo.fundedByProjects.length > 0 && (!viewAll || viewAll=='fundedBy')">
<fundedBy [fundedByProjects]="resultLandingInfo.fundedByProjects" [provenanceActionVocabulary]="provenanceActionVocabulary" (viewAllClicked)="viewAll=$event"></fundedBy> <fundedBy [fundedByProjects]="resultLandingInfo.fundedByProjects" [provenanceActionVocabulary]="provenanceActionVocabulary" (viewAllClicked)="viewAll=$event"
[prevPath]="prevPath"></fundedBy>
</div> </div>
<!-- Communities --> <!-- Communities -->
<div *ngIf="resultLandingInfo.contexts && resultLandingInfo.contexts.length > 0 && !noCommunities && (!viewAll || viewAll=='relatedTo')"> <div *ngIf="resultLandingInfo.contexts && resultLandingInfo.contexts.length > 0 && !noCommunities && (!viewAll || viewAll=='relatedTo')">
@ -489,7 +491,7 @@
</div> </div>
<!-- Download From --> <!-- Download From -->
<div *ngIf="resultLandingInfo.hostedBy_collectedFrom && resultLandingInfo.hostedBy_collectedFrom.length > 0 && (!viewAll || viewAll=='availableOn')"> <div *ngIf="resultLandingInfo.hostedBy_collectedFrom && resultLandingInfo.hostedBy_collectedFrom.length > 0 && (!viewAll || viewAll=='availableOn')">
<availableOn [availableOn]="resultLandingInfo.hostedBy_collectedFrom" (viewAllClicked)="viewAll=$event"></availableOn> <availableOn [availableOn]="resultLandingInfo.hostedBy_collectedFrom" (viewAllClicked)="viewAll=$event" [prevPath]="prevPath"></availableOn>
</div> </div>
</div> </div>
</ng-template> </ng-template>
@ -507,22 +509,22 @@
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds" [ids]="resultLandingInfo.deletedByInferenceIds"
[modal]="AlertModalDeletedByInference" [modal]="AlertModalDeletedByInference"
[resultType]="type" [type]="openaireEntities.PUBLICATIONS"></deletedByInference> [resultType]="type" [type]="openaireEntities.PUBLICATIONS" [prevPath]="prevPath"></deletedByInference>
<deletedByInference *ngIf="type == 'dataset' && deleteByInferenceOpened" <deletedByInference *ngIf="type == 'dataset' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds" [ids]="resultLandingInfo.deletedByInferenceIds"
[modal]="AlertModalDeletedByInference" [modal]="AlertModalDeletedByInference"
[resultType]="'dataset'" [type]="openaireEntities.DATASETS"></deletedByInference> [resultType]="'dataset'" [type]="openaireEntities.DATASETS" [prevPath]="prevPath"></deletedByInference>
<deletedByInference *ngIf="type == 'software' && deleteByInferenceOpened" <deletedByInference *ngIf="type == 'software' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds" [ids]="resultLandingInfo.deletedByInferenceIds"
[modal]="AlertModalDeletedByInference" [modal]="AlertModalDeletedByInference"
[resultType]="type" [type]="openaireEntities.SOFTWARE"></deletedByInference> [resultType]="type" [type]="openaireEntities.SOFTWARE" [prevPath]="prevPath"></deletedByInference>
<deletedByInference *ngIf="type == 'orp' && deleteByInferenceOpened" <deletedByInference *ngIf="type == 'orp' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds" [ids]="resultLandingInfo.deletedByInferenceIds"
[modal]="AlertModalDeletedByInference" [modal]="AlertModalDeletedByInference"
[resultType]="'other'" [type]="openaireEntities.OTHER"></deletedByInference> [resultType]="'other'" [type]="openaireEntities.OTHER" [prevPath]="prevPath"></deletedByInference>
</modal-alert> </modal-alert>
<modal-alert *ngIf="resultLandingInfo" #citeModal> <modal-alert *ngIf="resultLandingInfo" #citeModal>
<citeThis *ngIf="citeThisClicked" [result]="resultLandingInfo" [id]="id" <citeThis *ngIf="citeThisClicked" [result]="resultLandingInfo" [id]="id"
@ -546,7 +548,7 @@
<ng-template #organizations_template let-threshold="threshold"> <ng-template #organizations_template let-threshold="threshold">
<ul class="uk-list organizations uk-margin-remove-top"> <ul class="uk-list organizations uk-margin-remove-top">
<li *ngFor="let organization of resultLandingInfo.organizations.slice(0, threshold)" class="uk-tile uk-tile-default uk-padding-small"> <li *ngFor="let organization of resultLandingInfo.organizations.slice(0, threshold)" class="uk-tile uk-tile-default uk-padding-small">
<a [routerLink]="properties.searchLinkToOrganization.split('?')[0]" [queryParams]="{organizationId: organization.id}" class="uk-link-text uk-text-bold"> <a [routerLink]="properties.searchLinkToOrganization.split('?')[0]" [queryParams]="addEoscPrevInParams({organizationId: organization.id})" class="uk-link-text uk-text-bold">
{{(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.name && organization.shortname">({{organization.shortname}})</span> <span *ngIf="!organization.name && organization.shortname">({{organization.shortname}})</span>
</a> </a>
@ -575,7 +577,7 @@
<result-preview [modal]="relationModal" [properties]="properties" <result-preview [modal]="relationModal" [properties]="properties"
[result]="getResultPreview(item)" [provenanceActionVocabulary]="provenanceActionVocabulary" [result]="getResultPreview(item)" [provenanceActionVocabulary]="provenanceActionVocabulary"
[relationsVocabulary]="relationsVocabulary" [relationsVocabulary]="relationsVocabulary"
[isCard]="false"></result-preview> [isCard]="false" [prevPath]="prevPath"></result-preview>
</li> </li>
</ul> </ul>
<paging-no-load *ngIf="researchResults.length > pageSize" <paging-no-load *ngIf="researchResults.length > pageSize"

View File

@ -33,6 +33,9 @@ declare var ResizeObserver;
templateUrl: 'resultLanding.component.html', templateUrl: 'resultLanding.component.html',
}) })
export class ResultLandingComponent { export class ResultLandingComponent {
public referrer: string;
public prevPath: string;
@Input() type: string = "publication"; @Input() type: string = "publication";
@Input() piwikSiteId = properties.piwikSiteId; @Input() piwikSiteId = properties.piwikSiteId;
@Input() communityId = null; @Input() communityId = null;
@ -206,6 +209,13 @@ export class ResultLandingComponent {
} }
this.updateDescription(""); this.updateDescription("");
if(data["pv"]) {
this.prevPath = data["pv"];
}
if((typeof document !== 'undefined') && document.referrer) {
this.referrer = document.referrer;
}
this.metricsClicked = false; this.metricsClicked = false;
if(this.resultFromInput){ if(this.resultFromInput){
this.id = this.resultLandingInfo.objIdentifier; this.id = this.resultLandingInfo.objIdentifier;
@ -713,7 +723,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.linkToLandingPage + this.id)) + (this.prevPath ? ("pv="+this.prevPath) : ""));
} }
// else { // else {
// this._location.go(this.linkToLandingPage.split("?")[0] + "?pid=" + this.identifier.id); // this._location.go(this.linkToLandingPage.split("?")[0] + "?pid=" + this.identifier.id);
@ -913,4 +923,20 @@ export class ResultLandingComponent {
this.descriptionModal.alertTitle = "Abstract"; this.descriptionModal.alertTitle = "Abstract";
this.descriptionModal.open(); this.descriptionModal.open();
} }
public addEoscPrevInParams(obj) {
if(properties.adminToolsPortalType == "eosc" && this.prevPath) {
return this.routerHelper.addQueryParam("pv", this.prevPath, obj);
}
return obj;
}
public get eoscBackLink() {
if(this.prevPath && this.referrer && ((this.referrer == "https://eosc-search-service.grid.cyfronet.pl/") || (this.referrer == "https://beta.search.marketplace.eosc-portal.eu/") || (this.referrer == "https://search.marketplace.eosc-portal.eu/"))) {
return this.referrer+atob(this.prevPath);
} else {
return "https://"+(this.properties.environment == "beta" ? "beta" : "")+"search.marketplace.eosc-portal.eu/";
}
}
} }

View File

@ -3,7 +3,7 @@
<li *ngFor="let result of previewResults"> <li *ngFor="let result of previewResults">
<result-preview [properties]="properties" [showOrganizations]="showOrganizations" <result-preview [properties]="properties" [showOrganizations]="showOrganizations"
[showSubjects]="showSubjects" [result]="result" [showEnermaps]="showEnermaps" [showSubjects]="showSubjects" [result]="result" [showEnermaps]="showEnermaps"
[isCard]="true"> [isCard]="true" [prevPath]="prevPath">
</result-preview> </result-preview>
</li> </li>
</ul> </ul>

View File

@ -12,6 +12,7 @@ import {properties} from "../../../../environments/environment";
templateUrl: 'searchResult.component.html' templateUrl: 'searchResult.component.html'
}) })
export class SearchResultComponent implements OnInit, OnChanges { export class SearchResultComponent implements OnInit, OnChanges {
@Input() prevPath: string = "";
@Input() results: SearchResult[]; @Input() results: SearchResult[];
previewResults:ResultPreview[]; previewResults:ResultPreview[];
@Input() status: number; @Input() status: number;

View File

@ -37,7 +37,7 @@
<!-- Title --> <!-- Title -->
<div> <div>
<h2 class="uk-margin-remove uk-text-break uk-inline-block uk-h6"> <h2 class="uk-margin-remove uk-text-break uk-inline-block uk-h6">
<a *ngIf="!externalUrl && result.id" (click)="onClick()" [queryParams]="createParam()" <a *ngIf="!externalUrl && result.id" (click)="onClick()" [queryParams]="addEoscPrevInParams(createParam())"
[routerLink]="url" class="uk-link uk-link-heading uk-width-expand"> [routerLink]="url" class="uk-link uk-link-heading uk-width-expand">
<div *ngIf="(result.title) || result.acronym"> <div *ngIf="(result.title) || result.acronym">
<span *ngIf="result.acronym"> <span *ngIf="result.acronym">
@ -273,7 +273,7 @@
<span class="provider uk-display-inline-block"> <span class="provider uk-display-inline-block">
<span class="uk-text-meta">Provider: </span> <span class="uk-text-meta">Provider: </span>
<a *ngFor="let collectedName of from.collectedNamesAndIds.keys(); let i=index" [routerLink]="dataProviderUrl" <a *ngFor="let collectedName of from.collectedNamesAndIds.keys(); let i=index" [routerLink]="dataProviderUrl"
[queryParams]="{datasourceId: from.collectedNamesAndIds.get(collectedName)}" (click)="onClick();"> [queryParams]="addEoscPrevInParams({datasourceId: from.collectedNamesAndIds.get(collectedName)})" (click)="onClick();">
{{collectedName}}<ng-container *ngIf="(i !== (from.collectedNamesAndIds.size - 1))">; </ng-container> {{collectedName}}<ng-container *ngIf="(i !== (from.collectedNamesAndIds.size - 1))">; </ng-container>
</a> </a>
</span> </span>

View File

@ -15,6 +15,7 @@ import {HelperFunctions} from "../HelperFunctions.class";
styleUrls: ['result-preview.component.less'] styleUrls: ['result-preview.component.less']
}) })
export class ResultPreviewComponent implements OnInit, OnChanges { export class ResultPreviewComponent implements OnInit, OnChanges {
@Input() prevPath: string = "";
@Input() result: ResultPreview; @Input() result: ResultPreview;
@Input() properties: EnvProperties; @Input() properties: EnvProperties;
public openaireEntities = OpenaireEntities; public openaireEntities = OpenaireEntities;
@ -176,4 +177,11 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
return this.result.resultType == "publication" || this.result.resultType == "dataset" || return this.result.resultType == "publication" || this.result.resultType == "dataset" ||
this.result.resultType == "software" || this.result.resultType == "other" || this.result.resultType == "result"; this.result.resultType == "software" || this.result.resultType == "other" || this.result.resultType == "result";
} }
public addEoscPrevInParams(obj) {
if(properties.adminToolsPortalType == "eosc" && this.prevPath) {
return this.routerHelper.addQueryParam("pv", this.prevPath, obj);
}
return obj;
}
} }

View File

@ -5,6 +5,15 @@ export class RouterHelper {
//Use this class function to create queryParams Objects in format {key1:value1} or {key1:value1,key2:value2,key3:value3,...} for multiple parameters //Use this class function to create queryParams Objects in format {key1:value1} or {key1:value1,key2:value2,key3:value3,...} for multiple parameters
constructor(){} constructor(){}
// <a [queryParams]="RouterHelper.createQueryParam(filter.filterId,value.id)" routerLinkActive="router-link-active" [routerLink]=baseUrl>Link</a> // <a [queryParams]="RouterHelper.createQueryParam(filter.filterId,value.id)" routerLinkActive="router-link-active" [routerLink]=baseUrl>Link</a>
public addQueryParam(key:string,value:string, obj){
if(!obj) {
obj = {};
}
obj[key] = value;
return obj;
}
public createQueryParam(key:string,value:string){ public createQueryParam(key:string,value:string){
var obj ={}; var obj ={};
obj[key]=value; obj[key]=value;

View File

@ -43,7 +43,7 @@ import {StringUtils} from "../../string-utils.class";
<search-result [properties]="properties" <search-result [properties]="properties"
[results]="results" [results]="results"
[status]="fetch.searchUtils.status" [status]="fetch.searchUtils.status"
[type]="resultType" [showEnermaps]="showEnermaps"> [type]="resultType" [showEnermaps]="showEnermaps" [prevPath]="prevPath">
</search-result> </search-result>
<!-- <div *ngIf="searchLinkToAdvancedPage && fetch.results?.length > 0" class="uk-text-right">--> <!-- <div *ngIf="searchLinkToAdvancedPage && fetch.results?.length > 0" class="uk-text-right">-->
@ -57,6 +57,7 @@ import {StringUtils} from "../../string-utils.class";
}) })
export class SearchTabComponent { export class SearchTabComponent {
@Input() prevPath: string = "";
@Input() public fetch; @Input() public fetch;
@Input() public resultType: string; @Input() public resultType: string;
@Input() public params: any; @Input() public params: any;