Merge branch 'develop' into stats-profile
This commit is contained in:
commit
f00607f8d3
|
@ -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 : ''}}
|
||||
|
|
|
@ -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+this.prevPath;
|
||||
} else {
|
||||
return "https://"+(this.properties.environment == "beta" ? "beta." : "")+"search.marketplace.eosc-portal.eu/";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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',
|
||||
|
@ -47,9 +48,9 @@ import {properties} from "../../../../environments/environment";
|
|||
<ng-template #elseBlock> {{instance.license}}</ng-template>
|
||||
</div>
|
||||
<div *ngIf="instance.collectedNamesAndIds?.size > 0" class="uk-text-meta">
|
||||
<span>Providers: </span>
|
||||
<span>Data sources: </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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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[] = [];
|
||||
|
|
|
@ -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 -->
|
||||
|
|
|
@ -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+this.prevPath;
|
||||
} else {
|
||||
return "https://"+(this.properties.environment == "beta" ? "beta." : "")+"search.marketplace.eosc-portal.eu/";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 : ''}}
|
||||
|
|
|
@ -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+this.prevPath;
|
||||
} else {
|
||||
return "https://"+(this.properties.environment == "beta" ? "beta." : "")+"search.marketplace.eosc-portal.eu/";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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[] = [];
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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+this.prevPath;
|
||||
} else {
|
||||
return "https://"+(this.properties.environment == "beta" ? "beta." : "")+"search.marketplace.eosc-portal.eu/";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -23,14 +23,22 @@ 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';
|
||||
|
||||
export interface Option {
|
||||
icon?: string,
|
||||
iconClass?: string,
|
||||
value: any,
|
||||
label: string,
|
||||
tooltip?: string,
|
||||
tooltip?: string,
|
||||
disabled?: boolean,
|
||||
hidden?: boolean
|
||||
}
|
||||
|
@ -112,7 +120,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)"
|
||||
|
@ -274,10 +282,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 +325,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 +339,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 +363,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
|
|||
} else {
|
||||
this.focus(false, event);
|
||||
}
|
||||
if(this.extendEnter) {
|
||||
if (this.extendEnter) {
|
||||
this.extendEnter();
|
||||
}
|
||||
}
|
||||
|
@ -389,7 +397,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
|
|||
}
|
||||
}
|
||||
this.activeElement.subscribe(element => {
|
||||
if(element) {
|
||||
if (element) {
|
||||
element.nativeElement.scrollIntoView({behavior: 'smooth'});
|
||||
}
|
||||
})
|
||||
|
@ -404,7 +412,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) {
|
||||
|
@ -508,7 +516,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 +556,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,8 +591,8 @@ 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);
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue