Merging explore-redesign branch into develop for Explore July release #7

Merged
konstantina.galouni merged 112 commits from explore-redesign into develop 2023-07-05 11:11:53 +02:00
33 changed files with 425 additions and 149 deletions
Showing only changes of commit 128c03c671 - Show all commits

View File

@ -122,8 +122,8 @@ export class CommunityService {
} else {
community.fos = [];
}
if (resData.advancedConstraint != null) {
community.selectionCriteria = resData.advancedConstraint;
if (resData.advancedConstraints != null) {
community.selectionCriteria = resData.advancedConstraints;
} else {
community.selectionCriteria = new SelectionCriteria();
}

View File

@ -13,7 +13,6 @@ import {
import {LayoutService, SidebarItem} from "../sidebar/layout.service";
declare var UIkit;
declare var ResizeObserver;
@Component({
selector: '[page-content]',
@ -99,23 +98,24 @@ export class PageContentComponent implements OnInit, AfterViewInit, OnDestroy {
ngAfterViewInit() {
if (typeof document !== "undefined") {
this.observeStickyFooter();
if (this.shouldSticky && typeof document !== 'undefined') {
this.sticky.header = UIkit.sticky((this.headerSticky ? this.header.nativeElement : this.actions.nativeElement), {
offset: this.offset
});
this.subscriptions.push(UIkit.util.on(document, 'active', '#' + this.sticky.header.$el.id, () => {
this.isStickyActive = true;
this.cdr.detectChanges();
}));
this.subscriptions.push(UIkit.util.on(document, 'inactive', '#' + this.sticky.header.$el.id, () => {
this.isStickyActive = false;
this.cdr.detectChanges();
}));
}
if (this.sticky_footer) {
let footer_offset = this.calcStickyFooterOffset(this.sticky_footer.nativeElement);
this.sticky.footer = UIkit.sticky(this.sticky_footer.nativeElement, {bottom: true, offset: footer_offset});
this.initFooter();
this.observeStickyFooter();
}
if (this.shouldSticky && typeof document !== 'undefined') {
setTimeout(() => {
this.sticky.header = UIkit.sticky((this.headerSticky ? this.header.nativeElement : this.actions.nativeElement), {
offset: this.offset
});
this.subscriptions.push(UIkit.util.on(document, 'active', '#' + this.sticky.header.$el.id, () => {
this.isStickyActive = true;
this.cdr.detectChanges();
}));
this.subscriptions.push(UIkit.util.on(document, 'inactive', '#' + this.sticky.header.$el.id, () => {
this.isStickyActive = false;
this.cdr.detectChanges();
}));
});
}
}
}
@ -124,12 +124,16 @@ export class PageContentComponent implements OnInit, AfterViewInit, OnDestroy {
this.subscriptions.forEach(subscription => {
if (typeof ResizeObserver !== "undefined" && subscription instanceof ResizeObserver) {
subscription.disconnect();
} else if (typeof ResizeObserver !== "undefined" && subscription instanceof IntersectionObserver) {
} else if (typeof IntersectionObserver !== "undefined" && subscription instanceof IntersectionObserver) {
subscription.disconnect();
}
});
}
initFooter() {
let footer_offset = this.calcStickyFooterOffset(this.sticky_footer.nativeElement);
this.sticky.footer = UIkit.sticky(this.sticky_footer.nativeElement, {bottom: true, offset: footer_offset});
}
/**
* Workaround for sticky not update bug when sidebar is toggled.
@ -206,8 +210,7 @@ export class PageContentComponent implements OnInit, AfterViewInit, OnDestroy {
let resizeObs = new ResizeObserver(entries => {
entries.forEach(entry => {
setTimeout(() => {
this.sticky.footer.offset = this.calcStickyFooterOffset(entry.target);
this.cdr.detectChanges();
this.initFooter();
});
})
});

View File

@ -59,7 +59,7 @@ export class LayoutService {
/**
* Add hasQuickContact: false on data of route config, if the quick-contact fixed button is not needed.
*/
private hasQuickContactSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(true);
private hasQuickContactSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
/**
* Add activeMenuItem: string on data of route config, if page should activate a specific MenuItem and route url does not match.
*/

View File

@ -49,7 +49,9 @@ export class SideBarComponent implements OnInit, AfterViewInit, OnDestroy, OnCha
}
ngAfterViewInit() {
this.toggle(true);
setTimeout(() => {
this.toggle(true);
});
}
ngOnChanges(changes: SimpleChanges) {

View File

@ -5,7 +5,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>
@ -122,7 +122,7 @@
[compatibility]="dataProviderInfo.compatibility"
[aggregationStatus]="dataProviderInfo.aggregationStatus"
[thematic]="dataProviderInfo.thematic" [type]="type"
[journal]="dataProviderInfo.journal">
[journal]="dataProviderInfo.journal" [prevPath]="prevPath">
</landing-header>
<!-- Labels -->
@ -228,7 +228,6 @@
</div>
</div>
</div>
<div id="main-tabs-div" class="uk-sticky uk-blur-background"
uk-sticky="bottom: true; media: @m" [attr.offset]="offset">
<div class="uk-padding uk-padding-remove-horizontal uk-padding-remove-bottom">
@ -236,7 +235,7 @@
[properties]="properties" [title]="dataProviderInfo.title.name"
[entityType]="getTypeName()"
[types]="dataProviderInfo.type ? [dataProviderInfo.type] : null"
isSticky="true">
isSticky="true" [prevPath]="prevPath">
</landing-header>
<!-- <showTitle *ngIf="stickyHeader" [titleName]="dataProviderInfo.title.name" classNames="uk-margin-remove-bottom" class="uk-visible@m"></showTitle>-->
<my-tabs (selectedActiveTab)="onSelectActiveTab($event)" [offsetForSticky]="offset" [(isSticky)]="stickyHeader">
@ -338,7 +337,7 @@
[compatibility]="dataProviderInfo.compatibility"
[aggregationStatus]="dataProviderInfo.aggregationStatus"
[thematic]="dataProviderInfo.thematic" [type]="type"
[journal]="dataProviderInfo.journal">
[journal]="dataProviderInfo.journal" [prevPath]="prevPath">
</landing-header>
<div *ngIf="dataProviderInfo.title && dataProviderInfo.title.url"
class="uk-text-small uk-margin-small-top">
@ -529,8 +528,8 @@
[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"
[routerLink]="properties.searchLinkToOrganization.split('?')[0]">
[queryParams]="addEoscPrevInParams({organizationId: organization.id})" routerLinkActive="router-link-active"
[routerLink]="properties.searchLinkToOrganization.split('?')[0]">
{{(organization.acronym) ? organization.acronym : ''}}
{{(!organization.acronym && organization.name) ? organization.name : ''}}
</a>
@ -693,7 +692,7 @@
<search-tab [fetch]="fetchProjects" resultType="project"
[params]="getParamsForSearchLink()"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedProjects"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
</ng-template>
@ -703,7 +702,7 @@
<search-tab [fetch]="fetchDataproviders" resultType="dataprovider"
[params]="getParamsForSearchLink()"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedDataProviders"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
</ng-template>
@ -713,7 +712,7 @@
<search-tab [fetch]="fetchPublications" resultType="publication"
[params]="getParamsForSearchLink('publications')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
</ng-template>
@ -723,7 +722,7 @@
<search-tab [fetch]="fetchDatasets" resultType="dataset"
[params]="getParamsForSearchLink('datasets')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
</ng-template>
@ -733,7 +732,7 @@
<search-tab [fetch]="fetchSoftware" resultType="software"
[params]="getParamsForSearchLink('software')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
</ng-template>
@ -743,7 +742,7 @@
<search-tab [fetch]="fetchOrps" resultType="other"
[params]="getParamsForSearchLink('other')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
</ng-template>
@ -757,7 +756,7 @@
[fetchResults]="fetchAggregatorsResults"
[collectedFromName]="dataProviderInfo.title.name"
[properties]=properties
[modal]="relatedDatasourcesModal">
[modal]="relatedDatasourcesModal" [prevPath]="prevPath">
</relatedDatasourcesTab>
</div>
</ng-template>

View File

@ -42,6 +42,9 @@ declare var ResizeObserver;
})
export class DataProviderComponent {
public referrer: string;
public prevPath: string;
@Input() type: string = "dataprovider";
private typeQueryPathParam: string = "datasources";
@Input() piwikSiteId = null;
@ -208,6 +211,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'];
@ -926,4 +937,19 @@ export class DataProviderComponent {
return "<div class='uk-flex uk-flex-middle'><a href='https://usagecounts.openaire.eu/' target='_blank'><img class='uk-margin-small-right' src='assets/common-assets/logo-small-usage-counts.png' loading='lazy' alt='OpenAIRE UsageCounts'></a><span class='uk-text-uppercase uk-margin-small-left'>Views provided by <a href='https://usagecounts.openaire.eu/' target='_blank' class='uk-link-reset'><strong>UsageCounts</strong></a></div>";
}
}
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+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

@ -5,6 +5,7 @@ import {StringUtils} from '../../utils/string-utils.class';
import {FullScreenModalComponent} from "../../utils/modal/full-screen-modal/full-screen-modal.component";
declare var UIkit;
import {RouterHelper} from "../../utils/routerHelper.class";
@Component({
selector: 'availableOn',
@ -76,13 +77,10 @@ declare var UIkit;
<ng-template #elseBlock> {{instance.license}}</ng-template>
</div>
<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">
{{collectedName}}
<ng-container *ngIf="(i !== (instance.collectedNamesAndIds.size - 1))">;</ng-container>
<span>Data sources: </span>
<a *ngFor="let collectedName of getKeys(instance.collectedNamesAndIds); let i=index" [routerLink]="dataProviderUrl"
[queryParams]="addEoscPrevInParams({datasourceId: instance.collectedNamesAndIds.get(collectedName)})" class="uk-link-text">
{{collectedName}}<ng-container *ngIf="(i !== (instance.collectedNamesAndIds.size - 1))">; </ng-container>
</a>
</div>
</div>
@ -94,6 +92,7 @@ declare var UIkit;
export class AvailableOnComponent {
@Input() isMobile: boolean = false;
@Input() usedBy: "search" | "landing" = "search";
@Input() prevPath: string = "";
@Input() availableOn: HostedByCollectedFrom[];
/** @deprecated */
@Output() viewAllClicked = new EventEmitter();
@ -102,6 +101,7 @@ export class AvailableOnComponent {
public threshold: number = 1;
public dataProviderUrl = properties.searchLinkToDataProvider.split('?')[0];
public title: string = "Download from";
public routerHelper:RouterHelper = new RouterHelper();
constructor() {
}
@ -137,4 +137,11 @@ export class AvailableOnComponent {
}
return "Not available access";
}
public addEoscPrevInParams(obj) {
if(properties.adminToolsPortalType == "eosc" && this.prevPath) {
return this.routerHelper.addQueryParam("pv", this.prevPath, obj);
}
return obj;
}
}

View File

@ -3,6 +3,7 @@ import {EnvProperties} from "../../utils/properties/env-properties";
import {properties} from "../../../../environments/environment";
import {OpenaireEntities} from "../../utils/properties/searchFields";
import {Organization, Project} from "../../utils/result-preview/result-preview";
import {RouterHelper} from "../../utils/routerHelper.class";
@Component({
selector: 'entity-metadata',
@ -122,7 +123,7 @@ import {Organization, Project} from "../../utils/result-preview/result-preview";
<ng-container *ngIf="compatibility && !(compatibility.info == 'not available' && type == 'service')">
<span uk-tooltip title="Compatibility">
<a *ngIf="compatibility.id"
[queryParams]="{datasourceId: compatibility.id}" routerLinkActive="router-link-active"
[queryParams]="addEoscPrevInParams({datasourceId: compatibility.id})" routerLinkActive="router-link-active"
[routerLink]="properties.searchLinkToDataProvider.split('?')[0]">
{{compatibility.info}}
<ng-container *ngIf="compatibility.name">{{compatibility.name}}</ng-container>
@ -201,10 +202,12 @@ export class EntityMetadataComponent {
@Input() projects: Project[];
@Input() organizations: Organization[];
@Input() subjects: string[];
@Input() prevPath: string = "";
properties: EnvProperties = properties;
public openaireEntities = OpenaireEntities;
public routerHelper: RouterHelper = new RouterHelper();
public removeUnknown(array: string[], type: boolean = false): string[] {
if (type) {
return this.removeDuplicates(array).filter(value => value.toLowerCase() !== 'unknown');
@ -250,4 +253,11 @@ export class EntityMetadataComponent {
}
return [];
}
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',
@ -57,7 +58,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">
@ -94,6 +95,7 @@ import {HelperFunctions} from '../../utils/HelperFunctions.class';
export class FundedByComponent {
@Input() isMobile: boolean = false;
@Input() prevPath: string = "";
@Input() fundedByProjects: Project[];
@Input() viewAll: boolean = false;
@Output() viewAllClicked = new EventEmitter();
@ -103,6 +105,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) {
@ -126,4 +129,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

@ -20,7 +20,7 @@ import {AlertModal} from "../../../utils/modal/alert";
[underCuration]="underCuration" [publisher]="publisher" [journal]="journal"
[languages]="languages" [programmingLanguages]="programmingLanguages"
[compatibility]="compatibility" [aggregationStatus]="aggregationStatus"
[thematic]="thematic" [type]="type"
[thematic]="thematic" [type]="type" [prevPath]="prevPath"
></entity-metadata>
</div>
<div *ngIf="authors">
@ -60,4 +60,5 @@ export class LandingHeaderComponent {
@Input() aggregationStatus; // data provider landing
@Input() thematic: boolean; // data provider landing
@Input() type; // data provider landing
@Input() prevPath: string = "";
}

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

@ -5,7 +5,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>
@ -152,7 +152,7 @@
<landing-header [properties]="properties" [title]="organizationInfo.title.name"
[subTitle]="(organizationInfo.name
&& organizationInfo.title.name !== organizationInfo.name)?organizationInfo.name:null"
[entityType]="'organization'">
[entityType]="'organization'" [prevPath]="prevPath">
</landing-header>
<!-- Basic info -->
<div class="uk-text-small">
@ -176,7 +176,7 @@
<!-- <showTitle *ngIf="stickyHeader" [titleName]="organizationInfo.title.name" classNames="uk-margin-remove-bottom" class="uk-visible@m"></showTitle>-->
<landing-header *ngIf="stickyHeader" class="uk-visible@m"
[properties]="properties" [title]="organizationInfo.title.name"
[entityType]="'organization'" isSticky="true">
[entityType]="'organization'" isSticky="true" [prevPath]="prevPath">
</landing-header>
<my-tabs (selectedActiveTab)="onSelectActiveTab($event)" [offsetForSticky]="offset" [(isSticky)]="stickyHeader">
<my-tab [active]="true" [tabTitle]="'Funding / ' +openaireEntities.PROJECTS" [tabId]="'projects'"
@ -209,7 +209,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"
@ -217,7 +217,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"
@ -225,7 +225,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"
@ -233,7 +233,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"
@ -241,7 +241,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"
@ -249,7 +249,7 @@
<search-tab [fetch]="fetchOrps" resultType="other"
[params]="getParamsForSearchLink('other')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
</div>
@ -263,7 +263,6 @@
</ng-container>
</div>
</div>
</div>
</div>
</div>
@ -282,7 +281,7 @@
<landing-header [properties]="properties" [title]="organizationInfo.title.name"
[subTitle]="(organizationInfo.name
&& organizationInfo.title.name !== organizationInfo.name)?organizationInfo.name:null"
[entityType]="'organization'">
[entityType]="'organization'" [prevPath]="prevPath">
</landing-header>
<div class="uk-section uk-margin-top uk-text-large uk-text-empashis uk-text-bold">
<hr>
@ -390,7 +389,7 @@
[id]="organizationInfo.objIdentifier"
[ids]="organizationInfo.deletedByInferenceIds"
[modal]="AlertModalDeletedByInference"
[type]="'organizations'">
[type]="'organizations'" [prevPath]="prevPath">
</organizationsDeletedByInference>
</modal-alert>
<!-- Share -->
@ -507,7 +506,7 @@
<organizationsDeletedByInference *ngIf="deleteByInferenceOpened"
[id]="organizationInfo.objIdentifier"
[ids]="organizationInfo.deletedByInferenceIds"
[type]="'organizations'">
[type]="'organizations'" [prevPath]="prevPath">
</organizationsDeletedByInference>
</fs-modal>
<!-- Share -->
@ -535,7 +534,7 @@
<fs-modal *ngIf="isMobile" #fsModal classTitle="uk-tile-default uk-border-bottom">
<div *ngIf="activeTab == '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="activeTab == 'dataProviders' && fetchDataproviders && fetchDataproviders.searchUtils.totalResults > 0"
@ -543,7 +542,7 @@
<search-tab [fetch]="fetchDataproviders" resultType="dataprovider"
[params]="getParamsForSearchLink()"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedDataProviders"
[properties]="properties" [isMobile]="true">
[properties]="properties" [isMobile]="true" [prevPath]="prevPath">
</search-tab>
</div>
<div *ngIf="activeTab == 'publications' && fetchPublications && fetchPublications.searchUtils.totalResults > 0"
@ -551,7 +550,7 @@
<search-tab [fetch]="fetchPublications" resultType="publication"
[params]="getParamsForSearchLink('publications')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties" [isMobile]="true">
[properties]="properties" [isMobile]="true" [prevPath]="prevPath">
</search-tab>
</div>
<div *ngIf="activeTab == 'datasets' && fetchDatasets && fetchDatasets.searchUtils.totalResults > 0"
@ -559,7 +558,7 @@
<search-tab [fetch]="fetchDatasets" resultType="dataset"
[params]="getParamsForSearchLink('datasets')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties" [isMobile]="true">
[properties]="properties" [isMobile]="true" [prevPath]="prevPath">
</search-tab>
</div>
<div *ngIf="activeTab == 'software' && fetchSoftware && fetchSoftware.searchUtils.totalResults > 0"
@ -567,7 +566,7 @@
<search-tab [fetch]="fetchSoftware" resultType="software"
[params]="getParamsForSearchLink('software')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties" [isMobile]="true">
[properties]="properties" [isMobile]="true" [prevPath]="prevPath">
</search-tab>
</div>
<div *ngIf="activeTab == 'other' && fetchOrps && fetchOrps.searchUtils.totalResults > 0"
@ -575,7 +574,7 @@
<search-tab [fetch]="fetchOrps" resultType="other"
[params]="getParamsForSearchLink('other')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties" [isMobile]="true">
[properties]="properties" [isMobile]="true" [prevPath]="prevPath">
</search-tab>
</div>
</fs-modal>

View File

@ -36,6 +36,9 @@ declare var ResizeObserver;
templateUrl: 'organization.component.html',
})
export class OrganizationComponent {
public referrer: string;
public prevPath: string;
@Input() piwikSiteId = null;
@Input() communityId = null;
@ -181,6 +184,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)) {
@ -839,4 +849,12 @@ export class OrganizationComponent {
fsModal.stayOpenInBack = true;
fsModal.open();
}
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 + this.prevPath;
} else {
return "https://" + (this.properties.environment == "beta" ? "beta." : "") + "search.marketplace.eosc-portal.eu/";
}
}
}

View File

@ -5,7 +5,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>
@ -201,7 +201,7 @@
[startDate]="projectInfo.startDate" [endDate]="projectInfo.endDate"
[currentDate]="projectInfo.currentDate" [status]="projectInfo.status"
[openAccessMandatePublications]="projectInfo.openAccessMandatePublications"
[openAccessMandateDatasets]="projectInfo.openAccessMandateDatasets">
[openAccessMandateDatasets]="projectInfo.openAccessMandateDatasets" [prevPath]="prevPath">
</landing-header>
<!-- Labels -->
<!-- To be moved inside the landing-header -->
@ -372,7 +372,7 @@
[startDate]="projectInfo.startDate"
[endDate]="projectInfo.endDate"
[status]="projectInfo.status"
isSticky="true">
isSticky="true" [prevPath]="prevPath">
</landing-header>
<my-tabs (selectedActiveTab)="onSelectActiveTab($event)" [offsetForSticky]="offset" [(isSticky)]="stickyHeader">
<my-tab tabTitle="Summary" [tabId]="'summary'" [active]="true"></my-tab>
@ -451,7 +451,7 @@
[startDate]="projectInfo.startDate" [endDate]="projectInfo.endDate"
[currentDate]="projectInfo.currentDate" [status]="projectInfo.status"
[openAccessMandatePublications]="projectInfo.openAccessMandatePublications"
[openAccessMandateDatasets]="projectInfo.openAccessMandateDatasets">
[openAccessMandateDatasets]="projectInfo.openAccessMandateDatasets" [prevPath]="prevPath">
</landing-header>
<div class="uk-section uk-margin-top uk-text-large uk-text-empashis uk-text-bold">
<hr>
@ -671,7 +671,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 : ''}}
@ -744,7 +744,7 @@
<search-tab [fetch]="fetchPublications" resultType="publication"
[params]="getParamsForSearchLink('publications')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
</ng-template>
@ -754,7 +754,7 @@
<search-tab [fetch]="fetchDatasets" resultType="dataset"
[params]="getParamsForSearchLink('datasets')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
</ng-template>
@ -764,7 +764,7 @@
<search-tab [fetch]="fetchSoftware" resultType="software"
[params]="getParamsForSearchLink('software')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
</ng-template>
@ -774,7 +774,7 @@
<search-tab [fetch]="fetchOrps" resultType="other"
[params]="getParamsForSearchLink('other')"
[searchLinkToAdvancedPage]="properties.searchLinkToAdvancedResults"
[properties]="properties">
[properties]="properties" [prevPath]="prevPath">
</search-tab>
</div>
</ng-template>
@ -782,7 +782,7 @@
<ng-template #dmps_content>
<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"
[queryParams]="getParamsForSearchLink('publications', 'Data Management Plan')"

View File

@ -42,6 +42,9 @@ declare var ResizeObserver;
})
export class ProjectComponent {
public referrer: string;
public prevPath: string;
@Input() piwikSiteId = null;
@Input() communityId = null;
public projectInfo: ProjectInfo;
@ -233,6 +236,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'];
@ -1053,4 +1064,19 @@ export class ProjectComponent {
return "<div class='uk-flex uk-flex-middle'><a href='https://usagecounts.openaire.eu/' target='_blank'><img class='uk-margin-small-right' src='assets/common-assets/logo-small-usage-counts.png' loading='lazy' alt='OpenAIRE UsageCounts'></a><span class='uk-text-uppercase uk-margin-small-left'>Views provided by <a href='https://usagecounts.openaire.eu/' target='_blank' class='uk-link-reset'><strong>UsageCounts</strong></a></div>";
}
}
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+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-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

@ -5,7 +5,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>
@ -21,10 +21,11 @@
<div class="uk-align-center uk-text-center uk-margin-medium-top uk-flex uk-flex-column uk-flex-between">
<ng-container *ngIf="resultLandingInfo && (hasAltMetrics || hasMetrics)">
<metrics *ngIf="hasMetrics" class="uk-margin-bottom"
[pageViews]="pageViews"
[id]="id" [entityType]="'results'" [entity]="title"
[viewsFrameUrl]="viewsFrameUrl" [downloadsFrameUrl]="downloadsFrameUrl"
(metricsResults)="metricsResults($event)" [properties]=properties>
[pageViews]="pageViews"
[id]="id" [entityType]="'results'" [entity]="title"
[viewsFrameUrl]="viewsFrameUrl" [downloadsFrameUrl]="downloadsFrameUrl"
(metricsResults)="metricsResults($event)" [properties]=properties
[prevPath]="prevPath">
</metrics>
<altmetrics *ngIf="hasAltMetrics" id="{{resultLandingInfo.identifiers?.get('doi')[0]}}" type="doi"></altmetrics>
</ng-container>
@ -220,7 +221,8 @@
[entityType]="getTypeName()" [types]="resultLandingInfo.types"
[date]="resultLandingInfo.dateofacceptance" [embargoEndDate]="resultLandingInfo.embargoEndDate"
[publisher]="resultLandingInfo.publisher" [journal]="resultLandingInfo.journal"
[languages]="resultLandingInfo.languages" [programmingLanguages]="resultLandingInfo.programmingLanguages">
[languages]="resultLandingInfo.languages" [programmingLanguages]="resultLandingInfo.programmingLanguages"
[prevPath]="prevPath">
</landing-header>
<!-- Labels -->
<!-- Not used anymore - access labels will be in action bars, languages in the landing-header component -->
@ -270,7 +272,7 @@
[underCuration]="resultLandingInfo.underCurationMessage"
[entityType]="getTypeName()" [types]="resultLandingInfo.types"
[date]="resultLandingInfo.dateofacceptance" [embargoEndDate]="resultLandingInfo.embargoEndDate"
isSticky="true">
isSticky="true" [prevPath]="prevPath">
</landing-header>
<!-- <showTitle *ngIf="stickyHeader" [titleName]="resultLandingInfo.title" classNames="uk-margin-remove-bottom" class="uk-visible@m"></showTitle>-->
<my-tabs (selectedActiveTab)="onSelectActiveTab($event)" [offsetForSticky]="offset" [(isSticky)]="stickyHeader">
@ -460,7 +462,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')"
@ -500,7 +503,7 @@
[date]="resultLandingInfo.dateofacceptance" [embargoEndDate]="resultLandingInfo.embargoEndDate"
[publisher]="resultLandingInfo.publisher" [journal]="resultLandingInfo.journal"
[languages]="resultLandingInfo.languages" [programmingLanguages]="resultLandingInfo.programmingLanguages"
[isMobile]="true">
[isMobile]="true" [prevPath]="prevPath">
</landing-header>
<div class="uk-text-small">
<!-- Identifiers -->
@ -759,22 +762,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"
@ -811,7 +814,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>
@ -839,8 +842,8 @@
<li *ngFor="let item of researchResults.slice((relatedPage-1)*pageSize, relatedPage*pageSize)">
<result-preview [properties]="properties"
[result]="getResultPreview(item)" [provenanceActionVocabulary]="provenanceActionVocabulary"
[relationsVocabulary]="relationsVocabulary"
[isCard]="false"></result-preview>
[relationsVocabulary]="relationsVocabulary"
[isCard]="false" [prevPath]="prevPath"></result-preview>
</li>
</ul>
<paging-no-load *ngIf="researchResults.length > pageSize"
@ -934,7 +937,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>

View File

@ -37,6 +37,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;
@ -237,6 +240,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;
@ -745,7 +755,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);
@ -1104,4 +1114,19 @@ export class ResultLandingComponent {
}
return "Not available access";
}
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+this.prevPath;
} else {
return "https://"+(this.properties.environment == "beta" ? "beta." : "")+"search.marketplace.eosc-portal.eu/";
}
}
}

View File

@ -165,6 +165,7 @@ export class Indicator {
visibility: Visibility;
defaultId: string;
indicatorPaths: IndicatorPath[];
descriptionOverlay: boolean = false;
constructor(name: string, description: string, additionalDescription:string, type: IndicatorType, width: IndicatorSize,height: IndicatorSize, visibility: Visibility, indicatorPaths: IndicatorPath[], defaultId: string = null) {
this._id = null;

View File

@ -0,0 +1,3 @@
.uk-width-medium {
width: 350px;
}

View File

@ -50,7 +50,7 @@ declare var ResizeObserver;
</div>
<div class="uk-section uk-container uk-container-large" uk-scrollspy-class>
<div id="parentContainer" class="uk-grid uk-grid-large" uk-grid>
<div class="uk-width-1-4 uk-margin-top">
<div class="uk-width-medium uk-margin-top">
<div class="uk-sticky" uk-sticky="bottom: !#parentContainer; offset: 100;">
<slider-tabs type="scrollable" position="left">
<slider-tab tabId="entities" tabTitle="1. Entities"></slider-tab>
@ -116,7 +116,8 @@ declare var ResizeObserver;
</div>
</div>
</div>
`
`,
styleUrls: ['terminology.component.less']
})
export class TerminologyComponent implements OnInit, OnDestroy, AfterViewInit, AfterContentChecked {
public tab: 'entities' | 'attributes' = 'entities';

View File

@ -2,8 +2,8 @@
<errorMessages [status]="[status]" [type]="'results'"></errorMessages>
<li *ngFor="let result of previewResults">
<result-preview [properties]="properties" [showOrganizations]="showOrganizations"
[showSubjects]="showSubjects" [result]="result" [showEnermaps]="showEnermaps"
[isCard]="isMobile" [isMobile]="isMobile">
[showSubjects]="showSubjects" [result]="result" [showEnermaps]="showEnermaps"
[isCard]="true" [prevPath]="prevPath">
</result-preview>
</li>
</ul>

View File

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

View File

@ -15,22 +15,30 @@ import {
ViewChild,
ViewChildren
} from "@angular/core";
import {AbstractControl, UntypedFormArray, UntypedFormControl, ValidatorFn} from "@angular/forms";
import {AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup, ValidatorFn} from "@angular/forms";
import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {BehaviorSubject, Subscription} from "rxjs";
import {EnvProperties} from "../../utils/properties/env-properties";
import {properties} from "../../../../environments/environment";
import {ClickEvent} from "../../utils/click/click-outside-or-esc.directive";
import {element} from "protractor";
export type InputType = 'text' | 'URL' | 'logoURL' | 'autocomplete' | 'autocomplete_soft' | 'textarea' | 'select' | 'chips';
export type InputType =
'text'
| 'URL'
| 'logoURL'
| 'autocomplete'
| 'autocomplete_soft'
| 'textarea'
| 'select'
| 'chips'
| 'year-range';
export interface Option {
icon?: string,
iconClass?: string,
value: any,
label: string,
tooltip?: string,
tooltip?: string,
disabled?: boolean,
hidden?: boolean
}
@ -40,6 +48,16 @@ export interface Placeholder {
static?: boolean
}
export interface YearRange {
from: ControlConfiguration,
to: ControlConfiguration
}
export interface ControlConfiguration {
control: string,
placeholder: string
}
declare var UIkit;
/**
@ -55,11 +73,11 @@ declare var UIkit;
<div *ngIf="formControl" [id]="id">
<div class="input-wrapper" [class.disabled]="formControl.disabled" [class.opened]="opened"
[class.focused]="focused" [ngClass]="inputClass" [class.hint]="hint"
[class.active]="(formAsControl?.value || selectable || formAsArray?.length > 0 || getLabel(formAsControl?.value)) && !focused"
[class.active]="!focused && (formAsControl?.value || selectable || formAsArray?.length > 0 || getLabel(formAsControl?.value) || yearRangeActive)"
[class.danger]="(formControl.invalid && (formControl.touched || !!searchControl?.touched)) || (!!searchControl?.invalid && !!searchControl?.touched)">
<div #inputBox class="input-box" [class.select]="selectable" click-outside-or-esc
[class.static]="placeholderInfo?.static" (clickOutside)="click($event)">
<div *ngIf="!placeholderInfo?.static && placeholderInfo.label" class="placeholder">
<div *ngIf="!placeholderInfo?.static && placeholderInfo?.label" class="placeholder">
<label>{{placeholderInfo.label}} <sup *ngIf="required">*</sup></label>
</div>
<div class="uk-flex" [class.uk-flex-middle]="type !== 'textarea'"
@ -112,7 +130,7 @@ declare var UIkit;
<div *ngFor="let chip of formAsArray.controls; let i=index" #chip
[class.uk-hidden]="!focused && i > visibleChips - 1"
class="chip">
<div class="uk-label uk-label-small uk-flex uk-flex-middle"
<div class="uk-label uk-label-small uk-text-transform-none uk-flex uk-flex-middle"
[attr.uk-tooltip]="(tooltip)?('title: ' + getLabel(chip.value) + '; delay: 500; pos: bottom-left'):null">
<span class="uk-text-truncate uk-width-expand">{{getLabel(chip.value)}}</span>
<icon *ngIf="focused" (click)="remove(i, $event)"
@ -132,6 +150,19 @@ declare var UIkit;
</div>
</div>
</ng-template>
<ng-template [ngIf]="type === 'year-range' && yearRange && formAsGroup">
<div class="uk-width-2-5">
<input #input class="input uk-text-truncate" [attr.placeholder]="yearRange.from.placeholder"
(click)="activeIndex = 0;$event.preventDefault()"
[formControl]="getFormByName(yearRange.from.control)">
</div>
<div class="uk-width-1-5 uk-text-center">-</div>
<div class="uk-width-2-5">
<input #input class="input uk-text-truncate" [attr.placeholder]="yearRange.to.placeholder"
(click)="activeIndex = 1;$event.preventDefault()"
[formControl]="getFormByName(yearRange.to.control)">
</div>
</ng-template>
<div
*ngIf="(formControl.disabled && disabledIcon) || icon || (selectable && selectArrow) || type === 'autocomplete' || searchable"
class="uk-margin-small-left icon">
@ -149,6 +180,7 @@ declare var UIkit;
</button>
</ng-template>
</div>
<!-- use action-icon class in order to apply css in your icon button-->
<ng-content select="[action]"></ng-content>
</div>
<div class="tools">
@ -171,7 +203,7 @@ declare var UIkit;
</div>
</div>
<span *ngIf="formControl?.invalid && formControl?.touched" class="uk-text-danger">
<span *ngIf="formControl.errors.error">{{formControl.errors.error}}</span>
<span *ngIf="errors?.error">{{errors?.error}}</span>
<span *ngIf="type === 'URL' || type === 'logoURL'">Please provide a valid URL (e.g. https://example.com)</span>
</span>
<span class="uk-text-small uk-text-danger">
@ -205,7 +237,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
@Input() tooltip: boolean = false;
@Input() searchable: boolean = false;
/** Text */
@ViewChild('input') input: ElementRef;
@ViewChildren('input') input: QueryList<ElementRef>;
/** Textarea options */
@ViewChild('textArea') textArea: ElementRef;
@Input('rows') rows: number = 3;
@ -228,6 +260,10 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
@Input() visibleChips: number = 1;
@Input() separators: string[] = [];
@Input() noWrap: boolean = false;
/** Year Range Configuration */
@Input() yearRange: YearRange;
public activeIndex: 0 | 1 | null = null;
@Input() visibleRows: number = -1;
@Input() extendEnter: () => void = null;
@Output() focusEmitter: EventEmitter<boolean> = new EventEmitter<boolean>();
@ -251,7 +287,9 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
@Input()
set placeholder(placeholder: string | Placeholder) {
if (typeof placeholder === 'string') {
if(this.type === 'year-range') {
this.placeholderInfo = null;
} else if (typeof placeholder === 'string') {
this.placeholderInfo = {label: placeholder, static: false};
} else {
if (placeholder.static && (this.type === 'autocomplete' || this.hint)) {
@ -274,10 +312,10 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
return option;
}
});
if(!this.tooltip) {
if (!this.tooltip) {
this.tooltip = this.optionsArray.length > 0;
}
if(this.type === "select") {
if (this.type === "select") {
if (this.optionsArray.length > this.optionsBreakpoint) {
this.type = 'autocomplete';
this.showOptionsOnEmpty = true;
@ -317,11 +355,11 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
@HostListener('window:keydown.arrowLeft', ['$event'])
arrowLeft(event: KeyboardEvent) {
if(this.focused) {
if (this.focused) {
event.preventDefault();
if(this.activeElement.getValue()) {
if (this.activeElement.getValue()) {
let index = this.chips.toArray().indexOf(this.activeElement.getValue());
if(index > 0) {
if (index > 0) {
this.activeElement.next(this.chips.get(index - 1));
return;
}
@ -331,11 +369,11 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
@HostListener('window:keydown.arrowRight', ['$event'])
arrowRight(event: KeyboardEvent) {
if(this.focused) {
if (this.focused) {
event.preventDefault();
if(this.activeElement.getValue()) {
if (this.activeElement.getValue()) {
let index = this.chips.toArray().indexOf(this.activeElement.getValue());
if(index < this.chips.length - 1) {
if (index < this.chips.length - 1) {
this.activeElement.next(this.chips.get(index + 1));
return;
}
@ -355,7 +393,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
} else {
this.focus(false, event);
}
if(this.extendEnter) {
if (this.extendEnter) {
this.extendEnter();
}
}
@ -389,7 +427,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
}
}
this.activeElement.subscribe(element => {
if(element) {
if (element) {
element.nativeElement.scrollIntoView({behavior: 'smooth'});
}
})
@ -404,7 +442,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
if (changes.value) {
this.formControl.setValue(this.value);
}
if(changes.validators) {
if (changes.validators) {
this.updateValidators();
}
if (changes.formControl || changes.validators || changes.options) {
@ -424,6 +462,22 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
this.unsubscribe();
}
getFormByName(name: string): UntypedFormControl {
if (this.formControl instanceof UntypedFormGroup) {
return <UntypedFormControl>this.formControl.get(name);
} else {
return null;
}
}
get formAsGroup(): UntypedFormGroup {
if (this.formControl instanceof UntypedFormGroup) {
return this.formControl;
} else {
return null;
}
}
get formAsControl(): UntypedFormControl {
if (this.formControl instanceof UntypedFormControl) {
return this.formControl;
@ -440,6 +494,25 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
}
}
get yearRangeActive(): boolean {
if(this.yearRange) {
return this.formAsGroup && (this.getFormByName(this.yearRange.from.control)?.value || this.getFormByName(this.yearRange.to.control)?.value);
}
return false;
}
get errors(): any {
if(this.formAsGroup) {
return (this.formAsGroup.errors
?this.formAsGroup.errors:(this.getFormByName(this.yearRange.from.control).errors
?this.getFormByName(this.yearRange.from.control).errors:this.getFormByName(this.yearRange.to.control).errors));
} else if(this.formAsControl) {
return this.formAsControl.errors;
} else {
return this.searchControl.errors;
}
}
reset() {
this.secure = true;
this.unsubscribe();
@ -447,7 +520,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
if (this.type === 'logoURL') {
this.secure = (!this.initValue || this.initValue.includes('https://'));
}
if (this.optionsArray) {
if (this.optionsArray?.length > 0) {
this.filteredOptions = this.filter('');
this.cdr.detectChanges();
}
@ -467,7 +540,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
}
}));
}
if (this.formControl.validator) {
if (this.formAsControl?.validator) {
let validator = this.formControl.validator({} as AbstractControl);
this.required = (validator && validator.required);
}
@ -494,8 +567,20 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
}
}
}));
if(this.formAsGroup) {
this.subscriptions.push(this.formAsGroup.get(this.yearRange.from.control).valueChanges.subscribe(value => {
if(this.formAsGroup.get(this.yearRange.from.control).valid) {
if(this.activeIndex === 0 && value.length > 0) {
this.activeIndex = 1;
this.input.get(this.activeIndex).nativeElement.focus();
}
}
}));
}
if (this.input) {
this.input.nativeElement.disabled = this.formControl.disabled;
this.input.forEach(input => {
input.nativeElement.disabled = this.formControl.disabled;
});
}
}
@ -508,7 +593,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
}
updateValidators() {
if(this.formAsArray) {
if (this.formAsArray) {
this.formAsArray.controls.forEach(control => {
control.setValidators(this.validators);
control.updateValueAndValidity();
@ -548,15 +633,33 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
}
add(event, addChips = false) {
if (addChips && this.searchControl.value && this.searchControl.valid) {
if (event && event.stopPropagation) {
event.stopPropagation();
}
this.formAsArray.push(new UntypedFormControl(this.searchControl.value, this.validators));
this.formAsArray.markAsDirty();
if (addChips && this.searchControl.value) {
this.splitSearchControl();
} else if (!this.focused) {
this.searchControl.setValue('');
}
}
splitSearchControl() {
let values = [this.searchControl.value];
this.separators.forEach(separator => {
values = ([] as string[]).concat(...values.map(value => {
if (Array.isArray(value)) {
return ([] as string[]).concat(...value.map(element => element.split(separator)));
} else {
return value.split(separator);
}
}));
});
values.forEach(value => {
let control = new UntypedFormControl(value.trim(), this.validators);
if (control.valid) {
this.formAsArray.push(control);
this.formAsArray.markAsDirty();
}
});
if (this.formAsArray.dirty) {
this.activeElement.next(this.chips.last);
} else if(!this.focused) {
this.searchControl.setValue('');
}
}
@ -565,21 +668,24 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
let option = this.optionsArray.find(option => HelperFunctions.equals(option.value, value));
return (option) ? option.label : (value);
}
getTooltip(value: any): string {
getTooltip(value: any): string {
let option = this.optionsArray.find(option => HelperFunctions.equals(option.value, value));
return (option) ? (option.tooltip ? option.tooltip : option.label) : (value);
}
focus(value: boolean, event = null) {
if(!this.activeIndex) {
this.activeIndex = 0;
}
if (this.focused) {
this.formControl.markAsTouched();
}
this.focused = value;
this.cdr.detectChanges();
if (this.focused) {
if (this.input) {
this.input.nativeElement.focus();
if (this.input?.length > 0) {
this.input.get(this.activeIndex).nativeElement.focus();
} else if (this.textArea) {
this.textArea.nativeElement.focus();
} else if (this.searchInput) {
@ -592,9 +698,12 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
this.open(true);
}
} else {
this.activeIndex = null;
this.open(false);
if (this.input) {
this.input.nativeElement.blur();
this.input.forEach(input => {
input.nativeElement.blur();
})
} else if (this.textArea) {
this.textArea.nativeElement.blur();
} else if (this.searchInput) {

View File

@ -5,7 +5,7 @@ import { BehaviorSubject, Observable } from "rxjs";
providedIn: "root"
})
export class QuickContactService {
private display: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(true);
private display: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
public get isDisplayed(): Observable<boolean> {
return this.display.asObservable();

View File

@ -60,7 +60,7 @@ export class EGIDataTransferComponent {
}
ngAfterViewInit() {
if(this.isOpen){
if(this.isOpen && typeof document !== 'undefined'){
this.open();
}
}

View File

@ -22,7 +22,7 @@
<div class="uk-grid">
<div class="multi-line-ellipsis lines-3 uk-width-expand">
<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-text-decoration-none uk-width-expand">
<div *ngIf="(result.title) || result.acronym">
<span *ngIf="result.acronym">
@ -86,7 +86,7 @@
[languages]="result.languages" [programmingLanguages]="result.programmingLanguages"
[compatibilityString]="result.compatibility" [type]="type" [projects]="result.projects"
[subjects]="showSubjects?result.subjects:null" [organizations]="showOrganizations?result.organizations:null"
[relationName]="relationName" [provenanceAction]="provenanceAction"
[relationName]="relationName" [provenanceAction]="provenanceAction" [prevPath]="prevPath"
></entity-metadata>
</div>
</div>

View File

@ -15,6 +15,7 @@ import {NumberUtils} from '../../utils/number-utils.class';
styleUrls: ['result-preview.component.less']
})
export class ResultPreviewComponent implements OnInit, OnChanges {
@Input() prevPath: string = "";
@Input() result: ResultPreview;
@Input() properties: EnvProperties;
public openaireEntities = OpenaireEntities;
@ -226,4 +227,11 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
}
return "Not available access";
}
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">-->
@ -58,6 +58,7 @@ import {StringUtils} from "../../string-utils.class";
export class SearchTabComponent {
@Input() public isMobile: boolean = false;
@Input() prevPath: string = "";
@Input() public fetch;
@Input() public resultType: string;
@Input() public params: any;