[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 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">
<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>
<span class="uk-margin-small-left">Go to Search</span>
</a>
@ -115,7 +115,7 @@
<div>
<span class="uk-label uk-text-truncate" [class.uk-label-danger]="dataProviderInfo.compatibility.info == 'not available'" title="Compatibility">
<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]">
{{dataProviderInfo.compatibility.info}}
<ng-container *ngIf="dataProviderInfo.compatibility.name">{{dataProviderInfo.compatibility.name}}</ng-container>
@ -355,7 +355,7 @@
<search-tab [fetch]="fetchProjects" resultType="project"
[params]="getParamsForSearchLink()"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedProjects"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
</ng-container>
@ -365,7 +365,7 @@
<search-tab [fetch]="fetchDataproviders" resultType="dataprovider"
[params]="getParamsForSearchLink()"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedDataProviders"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
</ng-container>
@ -375,7 +375,7 @@
<search-tab [fetch]="fetchPublications" resultType="publication"
[params]="getParamsForSearchLink('publications')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
</ng-container>
@ -385,7 +385,7 @@
<search-tab [fetch]="fetchDatasets" resultType="dataset"
[params]="getParamsForSearchLink('datasets')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
</ng-container>
@ -395,7 +395,7 @@
<search-tab [fetch]="fetchSoftware" resultType="software"
[params]="getParamsForSearchLink('software')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
</ng-container>
@ -405,7 +405,7 @@
<search-tab [fetch]="fetchOrps" resultType="other"
[params]="getParamsForSearchLink('other')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
</ng-container>
@ -420,7 +420,7 @@
[fetchResults]="fetchAggregatorsResults"
[collectedFromName]="dataProviderInfo.title.name"
[properties]=properties
[modal]="relatedDatasourcesModal">
[modal]="relatedDatasourcesModal" [prevPath]="prevPath">
</relatedDatasourcesTab>
</div>
</ng-container>
@ -477,7 +477,7 @@
[attr.uk-tooltip]="organization.acronym && organization.name ? 'pos:right; delay:10' : 'cls: uk-invisible'"
[title]="organization.name">
<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]">
{{(organization.acronym) ? organization.acronym : ''}}
{{(!organization.acronym && organization.name) ? organization.name : ''}}

View File

@ -38,6 +38,9 @@ declare var ResizeObserver;
})
export class DataProviderComponent {
public referrer: string;
public prevPath: string;
@Input() type: string = "dataprovider";
private typeQueryPathParam: string = "datasources";
@Input() piwikSiteId = null;
@ -182,6 +185,14 @@ export class DataProviderComponent {
this.subscriptions.push(this.route.queryParams.subscribe(data => {
this.stickyHeader = false;
this.updateDescription("");
if(data["pv"]) {
this.prevPath = data["pv"];
}
if((typeof document !== 'undefined') && document.referrer) {
this.referrer = document.referrer;
}
// this.datasourceId = data['datasourceId'];
if (data['datasourceId']) {
this.datasourceId = data['datasourceId'];
@ -831,4 +842,19 @@ export class DataProviderComponent {
this.descriptionModal.alertTitle = "Description";
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">
<tr *ngIf="i>=(page-1)*pageSize && i<page*pageSize">
<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()">
{{result.name}}
</a>
@ -73,6 +73,7 @@ import {OpenaireEntities} from "../../utils/properties/searchFields";
})
export class RelatedDatasourcesTabComponent {
@Input() prevPath: string = "";
@Input() dataproviderId: string;
// @Input() fetchPublications : FetchResearchResults;
// @Input() fetchDatasets : FetchResearchResults;
@ -137,4 +138,11 @@ export class RelatedDatasourcesTabComponent {
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 {HostedByCollectedFrom} from "../../utils/result-preview/result-preview";
import {properties} from "../../../../environments/environment";
import {RouterHelper} from "../../utils/routerHelper.class";
@Component({
selector: 'availableOn',
@ -49,7 +50,7 @@ import {properties} from "../../../../environments/environment";
<div *ngIf="instance.collectedNamesAndIds?.size > 0" class="uk-text-meta">
<span>Providers: </span>
<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>
</a>
</div>
@ -80,6 +81,7 @@ import {properties} from "../../../../environments/environment";
})
export class AvailableOnComponent {
@Input() prevPath: string = "";
@Input() availableOn: HostedByCollectedFrom[];
@Input() viewAll: boolean = false;
@Output() viewAllClicked = new EventEmitter();
@ -87,7 +89,8 @@ export class AvailableOnComponent {
public threshold: number = 1;
public dataProviderUrl = properties.searchLinkToDataProvider.split('?')[0];
public title: string = "Download from";
public routerHelper:RouterHelper = new RouterHelper();
constructor() {
}
@ -122,4 +125,11 @@ export class AvailableOnComponent {
public isUrl(str: string): boolean {
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 {properties} from "../../../../environments/environment";
import {HelperFunctions} from '../../utils/HelperFunctions.class';
import {RouterHelper} from "../../utils/routerHelper.class";
@Component({
selector: 'fundedBy',
@ -33,7 +34,7 @@ import {HelperFunctions} from '../../utils/HelperFunctions.class';
<span>Project</span>
<div class="uk-margin-bottom">
<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']}}
</a>
<span *ngIf="!item.id" class="uk-h6 uk-margin-remove">
@ -72,6 +73,7 @@ import {HelperFunctions} from '../../utils/HelperFunctions.class';
})
export class FundedByComponent {
@Input() prevPath: string = "";
@Input() fundedByProjects: Project[];
@Input() viewAll: boolean = false;
@Output() viewAllClicked = new EventEmitter();
@ -81,6 +83,7 @@ export class FundedByComponent {
public title: string = "Funded by";
@Input() provenanceActionVocabulary = null;
public provenancesCalculated: boolean[] = [];
public routerHelper:RouterHelper = new RouterHelper();
public viewAllClick() {
if(this.fundedByProjects.length <= this.threshold*2) {
@ -104,4 +107,11 @@ export class FundedByComponent {
}
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>
<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">
<a href="{{metrics.infos.get(key).url}}">
<a [href]="metrics.infos.get(key).url + (prevPath ? ('&pv='+prevPath) : '')">
{{metrics.infos.get(key).name}}
</a>
</td>
@ -128,6 +128,7 @@ import {OpenaireEntities} from "../../../utils/properties/searchFields";
})
export class MetricsComponent {
@Input() prevPath: string = "";
@Output() metricsResults = new EventEmitter();
@Input() id: string;
@Input() entityType: string;

View File

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

View File

@ -26,7 +26,8 @@ import {HelperFunctions} from "../../../utils/HelperFunctions.class";
</no-load-paging>
<ul class="uk-list uk-list-divider uk-margin">
<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>
</ul>
<no-load-paging *ngIf="results.length > pageSize" [type]="type"
@ -38,6 +39,7 @@ import {HelperFunctions} from "../../../utils/HelperFunctions.class";
`
})
export class OrganizationsDeletedByInferenceComponent {
@Input() prevPath: string = "";
public results: OrganizationInfo[] = [];
@Input() id: string;
@Input() ids: string[] = [];

View File

@ -4,7 +4,7 @@
<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-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>
<span class="uk-margin-small-left">Go to Search</span>
</a>
@ -176,7 +176,7 @@
<div id="landing-sections" class="uk-text-small">
<div id="projects" class="landing-section landing-section-height-auto uk-padding uk-padding-remove-horizontal">
<projectsInModal [fetchProjects]="fetchProjects"
[organizationId]="organizationId" [properties]=properties>
[organizationId]="organizationId" [properties]=properties [prevPath]="prevPath">
</projectsInModal>
</div>
<div *ngIf="fetchDataproviders && fetchDataproviders.searchUtils.totalResults > 0"
@ -184,7 +184,7 @@
<search-tab [fetch]="fetchDataproviders" resultType="dataprovider"
[params]="getParamsForSearchLink()"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedDataProviders"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
<div *ngIf="fetchPublications && fetchPublications.searchUtils.totalResults > 0"
@ -192,7 +192,7 @@
<search-tab [fetch]="fetchPublications" resultType="publication"
[params]="getParamsForSearchLink('publications')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
<div *ngIf="fetchDatasets && fetchDatasets.searchUtils.totalResults > 0"
@ -200,7 +200,7 @@
<search-tab [fetch]="fetchDatasets" resultType="dataset"
[params]="getParamsForSearchLink('datasets')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
<div *ngIf="fetchSoftware && fetchSoftware.searchUtils.totalResults > 0"
@ -208,7 +208,7 @@
<search-tab [fetch]="fetchSoftware" resultType="software"
[params]="getParamsForSearchLink('software')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
<div *ngIf="fetchOrps && fetchOrps.searchUtils.totalResults > 0"
@ -216,7 +216,7 @@
<search-tab [fetch]="fetchOrps" resultType="other"
[params]="getParamsForSearchLink('other')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
</div>
@ -247,7 +247,7 @@
[id]="organizationInfo.objIdentifier"
[ids]="organizationInfo.deletedByInferenceIds"
[modal]="AlertModalDeletedByInference"
[type]="'organizations'">
[type]="'organizations'" [prevPath]="prevPath">
</organizationsDeletedByInference>
</modal-alert>
<!-- Share -->

View File

@ -34,6 +34,9 @@ declare var ResizeObserver;
templateUrl: 'organization.component.html',
})
export class OrganizationComponent {
public referrer: string;
public prevPath: string;
@Input() piwikSiteId = null;
@Input() communityId = null;
@ -167,6 +170,13 @@ export class OrganizationComponent {
this.updateTitle("Organization");
this.updateDescription("");
if(params["pv"]) {
this.prevPath = params["pv"];
}
if((typeof document !== 'undefined') && document.referrer) {
this.referrer = document.referrer;
}
this.organizationId = params['organizationId'];
if (this.organizationId && StringUtils.isOpenAIREID(this.organizationId)) {
@ -805,4 +815,12 @@ export class OrganizationComponent {
public 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 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">
<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>
<span class="uk-margin-small-left">Go to Search</span>
</a>
@ -391,7 +391,7 @@
<search-tab [fetch]="fetchPublications" resultType="publication"
[params]="getParamsForSearchLink('publications')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
</ng-container>
@ -401,7 +401,7 @@
<search-tab [fetch]="fetchDatasets" resultType="dataset"
[params]="getParamsForSearchLink('datasets')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
</ng-container>
@ -410,7 +410,7 @@
<search-tab [fetch]="fetchSoftware" resultType="software"
[params]="getParamsForSearchLink('software')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
</ng-container>
@ -419,16 +419,23 @@
<search-tab [fetch]="fetchOrps" resultType="other"
[params]="getParamsForSearchLink('other')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
</ng-container>
<ng-container>
<div id="dmps" class="landing-section uk-padding uk-padding-remove-horizontal">
<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">
<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')"
[routerLink]="properties.searchLinkToAdvancedResults">
View all
@ -592,7 +599,7 @@
[attr.uk-tooltip]="organization.acronym && organization.name ? 'pos:right; delay:10' : 'cls: uk-invisible'"
[title]="organization.name">
<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]">
{{(organization.acronym) ? organization.acronym : ''}}
{{(!organization.acronym && organization.name) ? organization.name : ''}}

View File

@ -38,6 +38,9 @@ declare var ResizeObserver;
})
export class ProjectComponent {
public referrer: string;
public prevPath: string;
@Input() piwikSiteId = null;
@Input() communityId = null;
public projectInfo: ProjectInfo;
@ -210,6 +213,14 @@ export class ProjectComponent {
this.updateTitle(title);
this.updateDescription(description);
if(params["pv"]) {
this.prevPath = params["pv"];
}
if((typeof document !== 'undefined') && document.referrer) {
this.referrer = document.referrer;
}
this.projectId = params['projectId'];
var grantId = params['grantId'];
var funder = params['funder'];
@ -965,4 +976,19 @@ export class ProjectComponent {
this.descriptionModal.alertTitle = "Description";
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>
<ul class="uk-list uk-list-divider uk-margin">
<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>
</ul>
<no-load-paging *ngIf="results.length > pageSize" [type]="type"
@ -38,6 +39,7 @@ import {HelperFunctions} from "../../../utils/HelperFunctions.class";
`
})
export class DeletedByInferenceComponent {
@Input() prevPath: string = "";
public results: ResultLandingInfo[] = [];
@Input() id: string;
@Input() ids: string[] = [];

View File

@ -4,7 +4,7 @@
<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-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>
<span class="uk-margin-small-left">Go to Search</span>
</a>
@ -23,7 +23,8 @@
[pageViews]="pageViews"
[id]="id" [entityType]="'results'" [entity]="title"
[viewsFrameUrl]="viewsFrameUrl" [downloadsFrameUrl]="downloadsFrameUrl"
(metricsResults)="metricsResults($event)" [properties]=properties>
(metricsResults)="metricsResults($event)" [properties]=properties
[prevPath]="prevPath">
</metrics>
<altmetrics *ngIf="hasAltMetrics" id="{{resultLandingInfo.identifiers?.get('doi')[0]}}" type="doi"></altmetrics>
</ng-container>
@ -330,7 +331,7 @@
[<a *ngIf="id.type !== 'openaire'" href="{{getReferenceUrl(id)}}"
target="_blank">{{getReferenceIdName(id)}}</a>
<a *ngIf="id.type === 'openaire'" [routerLink]="properties.searchLinkToResult.split('?')[0]"
[queryParams]="{id: id.value}"
[queryParams]="addEoscPrevInParams({id: id.value})"
target="_blank">OpenAIRE</a>]
</span>
</ng-container>
@ -480,7 +481,8 @@
</div>
<!-- Funded By -->
<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>
<!-- Communities -->
<div *ngIf="resultLandingInfo.contexts && resultLandingInfo.contexts.length > 0 && !noCommunities && (!viewAll || viewAll=='relatedTo')">
@ -489,7 +491,7 @@
</div>
<!-- Download From -->
<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>
</ng-template>
@ -507,22 +509,22 @@
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds"
[modal]="AlertModalDeletedByInference"
[resultType]="type" [type]="openaireEntities.PUBLICATIONS"></deletedByInference>
[resultType]="type" [type]="openaireEntities.PUBLICATIONS" [prevPath]="prevPath"></deletedByInference>
<deletedByInference *ngIf="type == 'dataset' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds"
[modal]="AlertModalDeletedByInference"
[resultType]="'dataset'" [type]="openaireEntities.DATASETS"></deletedByInference>
[resultType]="'dataset'" [type]="openaireEntities.DATASETS" [prevPath]="prevPath"></deletedByInference>
<deletedByInference *ngIf="type == 'software' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds"
[modal]="AlertModalDeletedByInference"
[resultType]="type" [type]="openaireEntities.SOFTWARE"></deletedByInference>
[resultType]="type" [type]="openaireEntities.SOFTWARE" [prevPath]="prevPath"></deletedByInference>
<deletedByInference *ngIf="type == 'orp' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds"
[modal]="AlertModalDeletedByInference"
[resultType]="'other'" [type]="openaireEntities.OTHER"></deletedByInference>
[resultType]="'other'" [type]="openaireEntities.OTHER" [prevPath]="prevPath"></deletedByInference>
</modal-alert>
<modal-alert *ngIf="resultLandingInfo" #citeModal>
<citeThis *ngIf="citeThisClicked" [result]="resultLandingInfo" [id]="id"
@ -546,7 +548,7 @@
<ng-template #organizations_template let-threshold="threshold">
<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">
<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]'))}}
<span *ngIf="!organization.name && organization.shortname">({{organization.shortname}})</span>
</a>
@ -575,7 +577,7 @@
<result-preview [modal]="relationModal" [properties]="properties"
[result]="getResultPreview(item)" [provenanceActionVocabulary]="provenanceActionVocabulary"
[relationsVocabulary]="relationsVocabulary"
[isCard]="false"></result-preview>
[isCard]="false" [prevPath]="prevPath"></result-preview>
</li>
</ul>
<paging-no-load *ngIf="researchResults.length > pageSize"

View File

@ -33,6 +33,9 @@ declare var ResizeObserver;
templateUrl: 'resultLanding.component.html',
})
export class ResultLandingComponent {
public referrer: string;
public prevPath: string;
@Input() type: string = "publication";
@Input() piwikSiteId = properties.piwikSiteId;
@Input() communityId = null;
@ -206,6 +209,13 @@ export class ResultLandingComponent {
}
this.updateDescription("");
if(data["pv"]) {
this.prevPath = data["pv"];
}
if((typeof document !== 'undefined') && document.referrer) {
this.referrer = document.referrer;
}
this.metricsClicked = false;
if(this.resultFromInput){
this.id = this.resultLandingInfo.objIdentifier;
@ -713,7 +723,7 @@ export class ResultLandingComponent {
}
if(!this.identifier) {
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 {
// this._location.go(this.linkToLandingPage.split("?")[0] + "?pid=" + this.identifier.id);
@ -913,4 +923,20 @@ export class ResultLandingComponent {
this.descriptionModal.alertTitle = "Abstract";
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">
<result-preview [properties]="properties" [showOrganizations]="showOrganizations"
[showSubjects]="showSubjects" [result]="result" [showEnermaps]="showEnermaps"
[isCard]="true">
[isCard]="true" [prevPath]="prevPath">
</result-preview>
</li>
</ul>

View File

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

View File

@ -37,7 +37,7 @@
<!-- Title -->
<div>
<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">
<div *ngIf="(result.title) || result.acronym">
<span *ngIf="result.acronym">
@ -273,7 +273,7 @@
<span class="provider uk-display-inline-block">
<span class="uk-text-meta">Provider: </span>
<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>
</a>
</span>

View File

@ -15,6 +15,7 @@ import {HelperFunctions} from "../HelperFunctions.class";
styleUrls: ['result-preview.component.less']
})
export class ResultPreviewComponent implements OnInit, OnChanges {
@Input() prevPath: string = "";
@Input() result: ResultPreview;
@Input() properties: EnvProperties;
public openaireEntities = OpenaireEntities;
@ -176,4 +177,11 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
return this.result.resultType == "publication" || this.result.resultType == "dataset" ||
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
constructor(){}
// <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){
var obj ={};
obj[key]=value;

View File

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