Merge branch 'new-theme' of code-repo.d4science.org:MaDgIK/openaire-library into new-theme

This commit is contained in:
argirok 2022-05-30 16:28:49 +03:00
commit b782c52f9c
25 changed files with 301 additions and 179 deletions

View File

@ -75,7 +75,7 @@
<div [attr.style]="'margin-top: '+(graph_height? 'calc(40px + 20px - '+graph_height+'px)': '40px')">
<!-- schema.org-->
<schema2jsonld [data]=dataProviderInfo
[URL]="properties.domain+ properties.baseLink + linkToLandingPage +datasourceId"
[URL]="canonicalUrl"
type="datasource"
[otherURL]="(dataProviderInfo.provenance)?provenanceUrls:null"></schema2jsonld>
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
@ -139,7 +139,14 @@
uk-sticky="bottom: true; media: @m" [attr.offset]="offset"
cls-active="active">
<div class="uk-padding uk-padding-remove-horizontal uk-padding-remove-bottom">
<showTitle *ngIf="stickyHeader" [titleName]="dataProviderInfo.title.name" classNames="uk-margin-remove-bottom" class="uk-visible@m"></showTitle>
<landing-header *ngIf="stickyHeader" class="uk-visible@m"
[properties]="properties" [title]="dataProviderInfo.title.name"
[subTitle]="(dataProviderInfo.officialName
&& dataProviderInfo.title.name !== dataProviderInfo.officialName)?dataProviderInfo.officialName:null"
[types]="dataProviderInfo.type ? [dataProviderInfo.type] : null"
isSticky="true">
</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">
<my-tab [tabTitle]="'Summary'" [tabId]="'summary'" [active]="true"></my-tab>
<my-tab *ngIf="fetchProjects.searchUtils.totalResults > 0"

View File

@ -20,7 +20,7 @@ import {SEOService} from '../../sharedComponents/SEO/SEO.service';
import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {HelperService} from "../../utils/helper/helper.service";
import {Location} from "@angular/common";
import {StringUtils} from "../../utils/string-utils.class";
import {Identifier, StringUtils} from "../../utils/string-utils.class";
import {SearchResult} from "../../utils/entities/searchResult";
import {ResultPreview} from "../../utils/result-preview/result-preview";
import {IndexInfoService} from "../../utils/indexInfo.service";
@ -44,11 +44,13 @@ export class DataProviderComponent {
@Input() communityId = null;
public dataProviderInfo: DataProviderInfo;
public datasourceId: string;
public identifier: Identifier = null;
public provenanceUrls: string[] = null;
// Links for SEO
public linkToLandingPage: string = null;
public linkToSearchPage: string = null;
public canonicalUrl: string = null;
// Message variables
public warningMessage = "";
@ -186,8 +188,11 @@ export class DataProviderComponent {
this.datasourceId = data['serviceId'];
this.typeQueryPathParam = "services";
this.initMetaAndLinks("service");
} else if (data["pid"]) {
this.identifier = Identifier.getIdentifierFromString(decodeURIComponent(data["pid"]), false);
this.initMetaAndLinks(this.type);
}
if (this.datasourceId && StringUtils.isOpenAIREID(this.datasourceId)) {
if (this.datasourceId && StringUtils.isOpenAIREID(this.datasourceId) || (this.identifier)) {
this.initializeValues();
this.getDataProviderInfo(this.datasourceId);
} else {
@ -319,14 +324,20 @@ export class DataProviderComponent {
this.provenanceUrls = null;
this.showTabs = false;
if (this.datasourceId == null || this.datasourceId == '') {
if ((this.datasourceId == null || this.datasourceId == '') && this.identifier == null) {
this.showLoading = false;
this.warningMessage = "No valid "+this.getTypeName()+" id";
} else {
this.subscriptions.push(this._dataproviderService.getDataproviderInfo(this.datasourceId, this.properties, this.typeQueryPathParam).subscribe(
this.subscriptions.push(this._dataproviderService.getDataproviderInfo(this.datasourceId, this.identifier, this.properties, this.typeQueryPathParam).subscribe(
data => {
this.dataProviderInfo = data;
this.getProvenanceUrls();
this.datasourceId = this.dataProviderInfo.objIdentifier;
let pid:Identifier = Identifier.getPIDFromIdentifiers(this.dataProviderInfo.identifiers);
this.canonicalUrl = this.properties.domain+ properties.baseLink + ( pid ? (this.linkToLandingPage.split("?")[0] + "?pid=" + encodeURIComponent(pid.id)):
(this.linkToLandingPage + this.dataProviderInfo.relcanId));
this.seoService.createLinkForCanonicalURL(this.canonicalUrl);
this.updateUrl(this.canonicalUrl);
this.seoService.createLinkForCanonicalURL(this.properties.domain +this.properties.baseLink + this._router.url);
if (typeof document !== 'undefined') {
this.getDataProviderAggregationStatus(this.dataProviderInfo.originalId);
@ -352,7 +363,7 @@ export class DataProviderComponent {
},
err => {
//console.log(err);
this.handleError("Error getting "+this.openaireEntities.DATASOURCE+" for id: " + this.datasourceId, err);
this.handleError("Error getting " + this.type + " for " + (this.datasourceId ? ("id: " + this.datasourceId) : ("pid: " + this.identifier.id + " ("+this.identifier.class+")")), err);
if (err.status == 404) {
this._router.navigate([this.properties.errorLink], {
queryParams: {

View File

@ -6,6 +6,8 @@ import{EnvProperties} from '../../utils/properties/env-properties';
import {map} from "rxjs/operators";
import {ParsingFunctions} from "../landing-utils/parsingFunctions.class";
import {OpenaireEntities} from "../../utils/properties/searchFields";
import {Identifier} from "../../utils/string-utils.class";
import {properties} from "../../../../environments/environment";
@Injectable()
@ -18,24 +20,46 @@ export class DataProviderService {
dataProviderInfo: DataProviderInfo;
public parsingFunctions: ParsingFunctions;
getDataproviderInfo (id: string, properties:EnvProperties, typePathParam: string):any {
let url = properties.searchAPIURLLAst + typePathParam+ '/' +id +"?format=json";
let key = url;
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
//.map(res => <any> res.json())
.pipe(map(res => res['result']['metadata']['oaf:entity']))
.pipe(map(res => [res['oaf:datasource'],
res['oaf:datasource']['datasourcetype'],
res['oaf:datasource']['openairecompatibility'],
res['oaf:datasource']['collectedfrom'],
res['oaf:datasource']['accessinfopackage'],
res['oaf:datasource']['rels']['rel'],
res['oaf:datasource']['journal'] //6
]))
.pipe(map(res => this.parseDataProviderInfo(res)));
private buildDatasourceLandingInfoUrl(id: string, identifier: Identifier, typePathParam: string): string {
if (id) {
return properties.searchAPIURLLAst + typePathParam + "/" + id + '?format=json';
} else if (identifier) {
return properties.searchAPIURLLAst + "resources2?pid="+encodeURIComponent(identifier.id) + "&pidtype=" + identifier.class + "&type="+typePathParam+"&format=json";
}
}
getDataproviderInfo (id: string, identifier: Identifier, properties: EnvProperties, typePathParam: string): any {
let url: string = this.buildDatasourceLandingInfoUrl(id, identifier, typePathParam);
let finalUrl: string = (properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url;
return this.http.get(finalUrl)
.pipe(map(res => {
if(!id && identifier) {
if(!res['results'] || res['results'].length == 0) {
throw new HttpErrorResponse({
status: 404,
statusText: "Not found",
url: finalUrl,
error: "Http failure response for "+finalUrl+": 404 Not Found"
});
}
return res['results'][0];
} else {
return res;
}
}))
.pipe(map(res => [res['result']['metadata']['oaf:entity'], res]))
.pipe(map(res => [
res[0]['oaf:datasource'], // 0
res[0]['oaf:datasource']['datasourcetype'], // 1
res[0]['oaf:datasource']['openairecompatibility'], // 2
res[0]['oaf:datasource']['collectedfrom'], // 3
res[0]['oaf:datasource']['accessinfopackage'], // 4
res[0]['oaf:datasource']['rels']['rel'], // 5
res[0]['oaf:datasource']['journal'], // 6
res[1] // 7
]))
.pipe(map(res => this.parseDataProviderInfo(res)));
}
getDataproviderAggregationStatus(original_id: string, properties:EnvProperties):any {
//let headers = new Headers({'Content-Type': 'application/json', 'accept': 'application/json'});
@ -109,6 +133,10 @@ export class DataProviderService {
parseDataProviderInfo (data: any):any {
this.dataProviderInfo = new DataProviderInfo();
this.dataProviderInfo.record = data[7];
this.dataProviderInfo.objIdentifier = data[7]["result"]["header"]["dri:objIdentifier"];
this.dataProviderInfo.relcanId = ParsingFunctions.parseRelCanonicalId(this.dataProviderInfo.record, "datasource");
if(data[0] != null) {
this.dataProviderInfo.title = {"name": (data[0].englishname)?data[0].englishname: data[0].officialname, "url": data[0].websiteurl};
this.dataProviderInfo.officialName = data[0].officialname;

View File

@ -34,7 +34,7 @@ export class FosComponent {
public threshold: number = 2;
public routerHelper: RouterHelper = new RouterHelper();
public properties = properties;
public title: string = "Fields of Science (FOS)";
public title: string = "Fields of Science (FOS) [Beta]";
public viewAllClick() {
if(this.subjects.length <= this.threshold*2) {

View File

@ -6,7 +6,7 @@ import {AlertModal} from "../../../utils/modal/alert";
@Component({
selector: 'landing-header',
template: `
<div class="title-section uk-margin-bottom" [ngClass]="titleClass">
<div class="title-section" [class.uk-margin-bottom]="!isSticky" [ngClass]="titleClass">
<div class="uk-text-small">
<span *ngIf="entityType" class="uk-text-capitalize uk-text-small">
{{entityType}}
@ -49,7 +49,7 @@ import {AlertModal} from "../../../utils/modal/alert";
class="uk-text-primary">Under curation</span>
</span>
</div>
<div class="uk-margin-medium-bottom">
<div [class]="isSticky ? 'uk-margon-bottom' : 'uk-margin-medium-bottom'">
<showTitle [titleName]="title" classNames="uk-margin-remove-bottom"></showTitle>
<div *ngIf="subTitle">
<span class="uk-text-meta uk-text-small" [innerHTML]="subTitle"></span>
@ -78,6 +78,7 @@ export class LandingHeaderComponent {
@Input() modal: AlertModal;
@Input() titleClass: string = null;
@Input() isTitleH1:boolean =true;
@Input() isSticky: boolean = false;
public removeUnknown(array: string[], type: boolean = false): string[] {
if (type) {
return this.removeDuplicates(array).filter(value => value.toLowerCase() !== 'unknown');

View File

@ -39,7 +39,7 @@ export class SdgComponent {
public threshold: number = 4;
public routerHelper: RouterHelper = new RouterHelper();
public properties = properties;
public title: string = "Sustainable Development Goals (SDG)";
public title: string = "Sustainable Development Goals (SDG) [Beta]";
public viewAllClick() {
if(this.subjects.length <= this.threshold*2) {

View File

@ -68,7 +68,8 @@
</orcid-work>
</li>
<li *ngIf=" properties.enableEoscDataTransfer && resultLandingInfo.resultType == 'dataset' &&
resultLandingInfo.identifiers.get('doi').length > 0 && resultLandingInfo.identifiers.get('doi').join('').indexOf('zenodo.')!=-1"
resultLandingInfo.identifiers && resultLandingInfo.identifiers.get('doi') &&
resultLandingInfo.identifiers.get('doi').join('').indexOf('zenodo.')!=-1"
class="uk-text-center">
<egi-transfer-data [dois]="resultLandingInfo.identifiers.get('doi')" [isOpen]="egiTransferModalOpen"></egi-transfer-data>
</li>
@ -173,7 +174,16 @@
uk-sticky="bottom: true; media: @m" [attr.offset]="offset"
cls-active="active">
<div class="uk-padding uk-padding-remove-horizontal uk-padding-remove-bottom">
<showTitle *ngIf="stickyHeader" [titleName]="resultLandingInfo.title" classNames="uk-margin-remove-bottom" class="uk-visible@m"></showTitle>
<landing-header *ngIf="stickyHeader" class="uk-visible@m"
[properties]="properties" [title]="resultLandingInfo.title"
[subTitle]="resultLandingInfo.subtitle"
[authors]="resultLandingInfo.authors"
[underCuration]="resultLandingInfo.underCurationMessage"
[entityType]="getTypeName()" [types]="resultLandingInfo.types"
[year]="resultLandingInfo.date" [embargoEndDate]="resultLandingInfo.embargoEndDate"
isSticky="true">
</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">
<my-tab tabTitle="Summary" [tabId]="'summary'" [active]="true"></my-tab>
<my-tab *ngIf="resultLandingInfo.references && resultLandingInfo.references.length > 0"

View File

@ -450,7 +450,7 @@ export class ResultLandingComponent {
this.viewsFrameUrl = this.properties.statisticsFrameNewAPIURL + 'chart?json=' + encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Monthly views","type":"column","query":{"name":"usagestats.results.views.monthly", "parameters":["' + this.id + '"], "profile":"OpenAIRE All-inclusive" }}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Monthly views"},"subtitle":{},"yAxis":{"title":{"text":""}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":true,"text":""}}}');
this.downloadsFrameUrl = this.properties.statisticsFrameNewAPIURL + 'chart?json=' +
encodeURIComponent('{"library":"HighCharts","chartDescription":{"queries":[{"name":"Monthly downloads","type":"column","query":{"name":"usagestats.results.downloads.monthly", "parameters":["' + this.id + '"], "profile":"OpenAIRE All-inclusive" }}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Monthly downloads"},"subtitle":{},"yAxis":{"title":{"text":""}},"xAxis":{"title":{}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":false},"credits":{"href":null,"enabled":true,"text":""}}}');
let pid:Identifier = Identifier.getResultPIDFromIdentifiers(this.resultLandingInfo.identifiers);
let pid:Identifier = Identifier.getPIDFromIdentifiers(this.resultLandingInfo.identifiers);
if (this.type == "result") { // no type was specified - update URL based this.resultLandingInfo.resultType
this.updateUrlWithType(pid);
}

View File

@ -10,7 +10,7 @@
<div class="uk-container uk-container-large uk-section uk-section-small uk-margin-bottom" id="searchForm">
<div class="uk-grid uk-flex uk-flex-middle uk-flex-center" uk-grid>
<div class="uk-width-1-1 uk-width-auto@m"><div id="searchImage"></div></div>
<advanced-search-form
<advanced-search-form class="uk-width-expand uk-padding uk-padding-remove-vertical"
entityType="all"
(queryChange)="keywordChanged($event)"
[isDisabled]="disableForms"
@ -28,9 +28,9 @@
<schema2jsonld *ngIf="name && logoURL" [URL]="properties.domain+ properties.baseLink +'/search/find'"
[logoURL]="properties.domain + properties.baseLink+logoURL" type="search" [name]=name
description="Search for {{openaireEntities.RESULTS}} ({{openaireEntities.PUBLICATIONS}}, {{openaireEntities.DATASETS}}, {{openaireEntities.SOFTWARE}}, {{openaireEntities.OTHER}}), {{openaireEntities.PROJECTS}}, {{openaireEntities.ORGANIZATIONS}}, {{openaireEntities.DATASOURCES}} in the OpenAIRE Research Graph. "></schema2jsonld>
<div class="uk-container-large uk-container uk-margin-large-top uk-flex uk-flex-center">
<div uk-slider="finite: true">
<div class="uk-position-relative">
<div class="uk-container-large uk-container uk-margin-large-top">
<div class="uk-width-1-1" uk-slider="finite: true">
<div class="uk-position-relative uk-flex uk-flex-center">
<div class="uk-slider-container">
<ul class="uk-slider-items" style="flex-wrap: nowrap !important;">
<li *ngIf="showPublications || showDatasets || showOrps || showSoftware" (click)="entityChanged('result')">

View File

@ -17,16 +17,24 @@
<form (ngSubmit)="queryChanged()" class="uk-card uk-card-default uk-box-shadow-medium" [class.dark]="dark">
<button type="submit" class="uk-hidden"></button>
<div class="uk-card-body uk-height-medium uk-overflow-auto">
<table class="uk-table uk-table-middle uk-table-responsive uk-table-small uk-margin-remove">
<table class="uk-table uk-table-middle uk-text-small uk-table-responsive uk-table-small uk-margin-remove">
<tr>
<td class="uk-text-muted uk-text-uppercase">Field to search</td>
<td class="uk-text-muted uk-text-uppercase uk-width-1-2">Term</td>
<td class="uk-text-bold uk-text-uppercase uk-width-2-5">Searching Fields</td>
<td class="uk-text-bold uk-text-uppercase uk-width-1-3">Terms</td>
</tr>
<tr *ngFor="let selectedField of selectedFields; let i = index">
<td><mat-select [(ngModel)]="selectedField.id" name="selectField_{{i}}" [disableOptionCentering]="true" class="matSelection" panelClass="matSelectionPanel"
(ngModelChange)="fieldIdsChanged(i,selectedField.id)"><!--(click)="fieldIdsChanged(i)" -->
<td>
<div class="uk-grid uk-flex-middle uk-child-width-1-2@m uk-child-width-1-1">
<div input [(value)]="selectedField.id" inputClass="border-bottom" [tooltip]="true"
[options]="fieldIdsOptions" (valueChange)="fieldIdsChanged(i,selectedField.id)" type="select"></div>
<div input *ngIf="selectedField.id != 'q' && !onlyIncludesSupported(i)" [(value)]="selectedField.includes" inputClass="border-bottom" [options]="notOperators" type="select"></div>
<div *ngIf="selectedField.id != 'q' && onlyIncludesSupported(i)">includes</div>
<div *ngIf="selectedField.id == 'q'">include</div>
</div>
<!-- <mat-select [(ngModel)]="selectedField.id" name="selectField_{{i}}" [disableOptionCentering]="true" class="matSelection" panelClass="matSelectionPanel"
(ngModelChange)="fieldIdsChanged(i,selectedField.id)">&lt;!&ndash;(click)="fieldIdsChanged(i)" &ndash;&gt;
<mat-option *ngFor="let id of fieldIds" [value]="id">{{fieldIdsMap[id].name}} </mat-option>
</mat-select></td>
</mat-select>--></td>
<td *ngIf="selectedField.type == 'keyword' || selectedField.type == 'identifier'">
<div class="uk-inline uk-width-expand">
<a *ngIf="selectedField.value.length > 0" class="uk-form-icon uk-form-icon-flip"
@ -82,17 +90,15 @@
value="false">No<br>
</span>
</td>
<td style="min-width: 75px;"><mat-select *ngIf="i+1 <selectedFields.length"
[(ngModel)]="selectedFields[i+1].operatorId"
name="selectOp_{{i}}" [disableOptionCentering]="true" class="matSelection uk-input" panelClass="matSelectionPanel">
<mat-option *ngFor="let op of operators" (change)="fieldOperatorChanged(i+1, op.id, op.id)"
(click)="fieldOperatorChanged(i+1, op.id, op.id)" [value]="op.id">{{op.id}}</mat-option>
</mat-select>
<td class="uk-width-small">
<div *ngIf="i+1 <selectedFields.length && !onlyAndSupported(i)" [(value)]="selectedFields[i+1].operatorId" (valueChange)="fieldOperatorChanged(i+1, $event, $event)"
input [options]="operators" inputClass="border-bottom" type="select"></div>
<div *ngIf="i+1 <selectedFields.length && onlyAndSupported(i)">and</div>
</td>
<td [class.uk-invisible]="selectedFields.length === 1">
<button class="uk-icon uk-close"
(click)="removeField(i)">
<icon name="close" [flex]="true" [ratio]="1.5"></icon>
<icon name="close" [flex]="true" [ratio]="1.2"></icon>
</button>
</td>
</tr>

View File

@ -1,4 +1,14 @@
import {ChangeDetectorRef, Component, EventEmitter, Input, Output} from '@angular/core';
import {
ChangeDetectorRef,
Component,
EventEmitter,
Input,
OnChanges,
OnDestroy,
OnInit,
Output,
SimpleChanges
} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {AdvancedField, Filter} from './searchHelperClasses.class';
@ -9,15 +19,17 @@ import {SearchCustomFilter} from "./searchUtils.class";
import {Subscriber} from "rxjs";
import {properties} from "../../../../environments/environment";
import {Open} from "../../utils/modal/open.component";
import {Option} from "../../sharedComponents/input/input.component";
@Component({
selector: 'advanced-search-form',
templateUrl: 'advancedSearchForm.component.html'
})
export class AdvancedSearchFormComponent {
export class AdvancedSearchFormComponent implements OnInit, OnDestroy, OnChanges {
@Input() entityType;
@Input() fieldIds: string[];
@Input() fieldIdsMap;
public fieldIdsOptions: Option[] = [];
@Input() selectedFields: AdvancedField[];
@Input() isDisabled: boolean = false;
@Input() simpleSearchLink;
@ -39,7 +51,9 @@ export class AdvancedSearchFormComponent {
public searchFields: SearchFields = new SearchFields();
properties: EnvProperties;
public openaireEntities = OpenaireEntities;
public operators: { name: string, id: string }[] = this.searchFields.ADVANCED_SEARCH_OPERATORS;
public operators: string[] = this.searchFields.ADVANCED_SEARCH_OPERATORS;
public notOperators: Option[] = [];
public logicalOperators: Option[] = [];
selectedEntity;
selectedEntitySimpleUrl;
selectedEntityAdvancedUrl;
@ -49,12 +63,6 @@ export class AdvancedSearchFormComponent {
constructor(private route: ActivatedRoute, private router: Router, private cdr: ChangeDetectorRef) {}
ngOnDestroy() {
if (this.sub instanceof Subscriber) {
this.sub.unsubscribe();
}
}
ngOnInit() {
this.selectedEntity = this.entityType;
@ -65,6 +73,32 @@ export class AdvancedSearchFormComponent {
}
this.newFieldId = this.fieldIds[0];
this.newFieldName = this.fieldIdsMap[this.newFieldId].name;
this.buildOperatorsOptions();
this.buildFieldIdsOptions();
}
ngOnDestroy() {
if (this.sub instanceof Subscriber) {
this.sub.unsubscribe();
}
}
ngOnChanges(changes: SimpleChanges) {
if(changes.fieldIds || changes.fieldIdsMap) {
this.buildFieldIdsOptions();
}
}
buildOperatorsOptions() {
this.notOperators = [{label: 'includes', value: true}, {label: 'not includes', value: false}];
this.logicalOperators = [];
}
buildFieldIdsOptions() {
this.fieldIdsOptions = [];
this.fieldIds.forEach(id => {
this.fieldIdsOptions.push({label: this.fieldIdsMap[id].name, value: id})
});
}
simpleEntityChanged($event) {
@ -145,20 +179,11 @@ export class AdvancedSearchFormComponent {
}
fieldIdsChanged(index: number, fieldId: string) {
//console.log("Field index::"+index + " " + this.selectedFields[index].id + " function id:" +fieldId);
var id = this.fieldIds[0];
this.selectedFields[index].name = this.fieldIdsMap[id].name;
this.selectedFields[index].type = this.fieldIdsMap[id].type;
this.selectedFields[index].name = this.fieldIdsMap[fieldId].name;
this.selectedFields[index].type = this.fieldIdsMap[fieldId].type;
this.selectedFields[index].value = "";
this.selectedFields[index].param = this.fieldIdsMap[id].param;
var id = fieldId;//this.selectedFields[index].id;
this.selectedFields[index].name = this.fieldIdsMap[id].name;
this.selectedFields[index].type = this.fieldIdsMap[id].type;
this.selectedFields[index].value = "";
this.selectedFields[index].param = this.fieldIdsMap[id].param;
if (this.fieldIdsMap[id].type == "boolean") {
this.selectedFields[index].param = this.fieldIdsMap[fieldId].param;
if (this.fieldIdsMap[fieldId].type == "boolean") {
this.selectedFields[index].value = "true";
}
}
@ -175,4 +200,11 @@ export class AdvancedSearchFormComponent {
this.fieldList[fieldId] = $event.value;
}
onlyAndSupported(index: number) {
return (this.selectedFields[index] && !this.selectedFields[index].includes) || (this.selectedFields[index+1] && !this.selectedFields[index+1].includes)
}
onlyIncludesSupported(index: number) {
return (this.selectedFields[index] && this.selectedFields[index].operatorId === 'or') || (this.selectedFields[index+1] && this.selectedFields[index+1].operatorId === 'or')
}
}

View File

@ -47,7 +47,14 @@
<li *ngIf="!customFilter || (customFilter.isHiddenFilter && customFilter.valueId != value.id)"
class="">
<span class="uk-label uk-label-primary uk-flex uk-flex-middle">
<span class="uk-margin-small-right uk-width-expand uk-text-truncate">{{value.name}}</span>
<span
class="uk-margin-small-right uk-width-expand uk-text-truncate">
<span *ngIf="filter.type && filter.type == 'boolean' else noboolean">{{filter.title}}:
{{value.name=='true'?'Yes':'No'}}
</span>
<ng-template #noboolean>
{{value.name}}
</ng-template></span>
<button [class.uk-disabled]="disabled" (click)="removeFilter(value, filter)" class="uk-close uk-icon" [disabled]="disabled">
<icon name="close" flex="true" ratio="0.7"></icon>
</button>

View File

@ -24,7 +24,6 @@ import {properties} from "../../../../environments/environment";
import {AlertModal} from "../../utils/modal/alert";
import {Subscriber} from "rxjs";
import {IndexInfoService} from "../../utils/indexInfo.service";
import { Option } from '../../sharedComponents/input/input.component';
export interface SearchForm {
class: string,
@ -756,6 +755,7 @@ export class NewSearchPageComponent {
if (params["f" + i] && params["fv" + i]) {
let fieldId = params["f" + i].split(",")[0];
let operator = (params["f" + i].split(",").length > 1) ? params["f" + i].split(",")[1] : "and";
let not: boolean = params["fo" + i] === "not" && fieldId != 'q';
let fieldparam = (this.fieldIdsMap[fieldId]) ? this.fieldIdsMap[fieldId].param : "";
if (!this.fieldIdsMap[fieldId]) {
@ -765,7 +765,7 @@ export class NewSearchPageComponent {
let value: string = StringUtils.URIDecode(params["fv" + i]);
if (this.fieldIdsMap[fieldId].type == "date") {
let validDates: boolean = true;
let dateField: AdvancedField = new AdvancedField(fieldId, fieldparam, this.fieldIdsMap[fieldId].name, this.fieldIdsMap[fieldId].type, value, operator);
let dateField: AdvancedField = new AdvancedField(fieldId, fieldparam, this.fieldIdsMap[fieldId].name, this.fieldIdsMap[fieldId].type, value, operator, !not);
if (value.indexOf("range") != -1) {
dateField.dateValue.type = "range";
if (value.length < 26) {
@ -787,7 +787,7 @@ export class NewSearchPageComponent {
}
} else {
this.selectedFields.push(new AdvancedField(fieldId, fieldparam, this.fieldIdsMap[fieldId].name, this.fieldIdsMap[fieldId].type, value, operator));
this.selectedFields.push(new AdvancedField(fieldId, fieldparam, this.fieldIdsMap[fieldId].name, this.fieldIdsMap[fieldId].type, value, operator, !not));
}
}
@ -917,8 +917,8 @@ export class NewSearchPageComponent {
} else if (this.selectedFields[i].type == "identifier") {
params += NewSearchPageComponent.createKeywordQuery(this.entityType, this.selectedFields[i].value, this.selectedFields[i].id, this.selectedFields[i].operatorId, countParams);
} else if (countParams == 0 && this.selectedFields[i].operatorId == "not" && this.fieldIdsMap[this.selectedFields[i].id].equalityOperator != "=") {
params += " " + this.selectedFields[i].id + " <> " + '"' + StringUtils.URIEncode(this.selectedFields[i].value) + '"' + " ";
} else if ((!this.selectedFields[i].includes || (countParams == 0 && this.selectedFields[i].operatorId == "not" && this.fieldIdsMap[this.selectedFields[i].id].equalityOperator != "="))) {
params += (this.selectedFields[i].operatorId && countParams>0?this.selectedFields[i].operatorId:"") + " (" + this.selectedFields[i].id + " <> " + '"' + StringUtils.URIEncode(this.selectedFields[i].value) + '"' + ") ";
} else if (this.fieldIdsMap[this.selectedFields[i].id].equalityOperator == "=") {
params += NewSearchPageComponent.createQuotedKeywordQuery(this.selectedFields[i].value, this.selectedFields[i].id, this.selectedFields[i].operatorId, countParams, false);
} else {
@ -956,7 +956,7 @@ export class NewSearchPageComponent {
let params = "";
let doisParams = "";
var DOIs: Identifier[] = Identifier.getIdentifiersFromString(value);
if ((entityType == 'publication' || entityType == 'dataset' || entityType == 'software' || entityType == 'other' || entityType == "result" || entityType == "datasource" || entityType == "service")) {
if ((entityType == 'publication' || entityType == 'dataset' || entityType == 'software' || entityType == 'other' || entityType == "result" || entityType == "dataprovider" || entityType == "service")) {
for (let identifier of DOIs) {
// console.log(identifier)
// pidclassid exact \"doi\" and pid exact \"10.1016/j.nima.2015.11.134\"
@ -1334,6 +1334,10 @@ export class NewSearchPageComponent {
if ((this.selectedFields[i].value && this.selectedFields[i].value.length > 0) || this.selectedFields[i].type == "date") {
this.parameterNames.push("f" + i);
this.parameterValues.push(this.selectedFields[i].id + (this.selectedFields[i].operatorId != 'and' ? ("," + this.selectedFields[i].operatorId) : ''));
if(!this.selectedFields[i].includes && this.selectedFields[i].id !== "q") {
this.parameterNames.push("fo" + i);
this.parameterValues.push("not");
}
this.parameterNames.push("fv" + i);
}
if (this.selectedFields[i].type == "date") {
@ -1369,7 +1373,7 @@ export class NewSearchPageComponent {
(
(this.entityType == 'publication' || this.entityType == 'dataset' || this.entityType == 'software' || this.entityType == 'other' || this.entityType == "result")
||
(this.entityType == "datasource" || this.entityType == "service")
(this.entityType == "service")
)
) {
let values = [];
@ -1499,11 +1503,11 @@ export class NewSearchPageComponent {
let options = null;
if ((this.entityType == 'publication' || this.entityType == 'dataset' || this.entityType == 'software' || this.entityType == 'other' || this.entityType == "result")) {
options = this.resultTypeOptions;
} else if (this.entityType == "datasource" || this.entityType == "service") {
} else if (this.entityType == "service") {
options = this.serviceTypeOptions;
}
if (options) {
this.resultTypes = {values:[],filterId:"type", countSelectedValues: 0, filterType: 'checkbox', originalFilterId: "", valueIsExact: true, title: "Type",filterOperator:"or"};
this.resultTypes = {values:[],filterId:"type", countSelectedValues: 0, filterType: 'checkbox', type:'checkBox', originalFilterId: "", valueIsExact: true, title: "Type",filterOperator:"or"};
for (let typeOption of Object.keys(options)) {
let type = typeOption;
if ( URLparams["type"] && URLparams["type"].indexOf(type)==-1 || !URLparams["type"]) {

View File

@ -53,7 +53,13 @@
(ngModelChange)="uniqueFilterChange(value)"/>
</span>
<span class="uk-margin-small-left">
{{_formatName(value)}}
<span *ngIf="filter.type && filter.type == 'boolean' else noboolean">
{{value.name=='true'?'Yes':'No'}}
</span>
<ng-template #noboolean>
{{_formatName(value)}}
</ng-template>
<span *ngIf="showResultCount">({{value.number|number}})</span>
</span>
</span>

View File

@ -8,6 +8,7 @@ export class Filter{
public filterOperator: string ='or';
public valueIsExact: boolean = true; // for search table view, if value is contained or is equal with column entry
public filterType: string = "checkbox";
public type?: string = "keyword";
public radioValue?: string = "";
// public uniqueValueIdSelected: string;
}
@ -26,18 +27,20 @@ export class AdvancedField{
public type: string = "keyword"; //keyword, static or dynamic
public value: string = '';
public valueLabel: string = '';
public includes: boolean = true;
public operatorId: string;
public operatorName: string ="";
public valid: boolean = true;
public dateValue:DateValue = new DateValue("any");
constructor(id:string,param:string,name:string, type:string, value:string,operator:string){
constructor(id:string,param:string,name:string, type:string, value:string,operator:string, includes: boolean = true){
this.id = id;
this.param = param;
this.name = name;
this.type = type;
this.value = value;
this.operatorId = operator;
this.includes = includes;
// this.operatorName = "AND";
}

View File

@ -78,7 +78,6 @@ export class MetricsService {
}catch(e){
console.error(e)
}
console.log(map)
return map;
}

View File

@ -301,6 +301,11 @@ export class SearchDataprovidersService {
//result['title'].url = OpenaireProperties.getsearchLinkToDataProvider();
//result['title'].url += Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
result['id'] = Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
let canId = ParsingFunctions.parseRelCanonicalId(Array.isArray(data) ? data[i] : data, "datasource");
if (canId) {
result['id'] = canId;
}
result['relcanId'] = result['id'];
result['type'] = this.getDataproviderType(resData);
if (resData['eosctype']) {

View File

@ -15,10 +15,12 @@ export class RefineResultsUtils {
for(let j=0; j<fields.length; j++) {
var filter:Filter = new Filter();
filter.title = searchFields.getFieldName(fields[j],entityType);
let fieldInfo = searchFields.getField(fields[j],entityType);
filter.title = fieldInfo?fieldInfo.name:"UNDEFINED";
filter.filterId = fields[j];
filter.originalFilterId = fields[j];
filter.filterType = searchFields.getFieldFilterType(fields[j], entityType, usedBy);
filter.filterType = fieldInfo?fieldInfo.filterType:"checkbox";
filter.type = fieldInfo?fieldInfo.type:"keyword";
filter.filterOperator = searchFields.getFieldOperator(fields[j]);
filter.radioValue = "";
//console.info("filter.title: "+filter.title+" filter.filterType: "+filter.filterType);

View File

@ -50,13 +50,14 @@ declare var UIkit;
<div class="input-wrapper" [class.disabled]="formControl.disabled" [class.opened]="opened"
[class.focused]="focused" [ngClass]="inputClass" [class.hint]="hint"
[class.active]="(formAsControl?.value || type === 'select' || formAsArray?.length > 0 || getLabel(formAsControl?.value)) && !focused"
[class.danger]="(formControl.invalid && (formControl.touched || searchControl?.touched)) || (searchControl?.invalid && searchControl?.touched)">
<div #inputBox class="input-box" [class.select]="type === 'select'" click-outside-or-esc
[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">
<label>{{placeholderInfo.label}} <sup *ngIf="required">*</sup></label>
</div>
<div class="uk-flex" [class.uk-flex-middle]="type !== 'textarea'">
<div class="uk-flex" [class.uk-flex-middle]="type !== 'textarea'"
[attr.uk-tooltip]="(tooltip && !focused && type !== 'chips')?('title: ' + getLabel(formControl.value) + '; delay: 500'):null">
<ng-template [ngIf]="type === 'text' || type === 'URL' || type === 'logoURL'">
<input #input class="input" [attr.placeholder]="placeholderInfo?.static?placeholderInfo.label:hint"
[formControl]="formAsControl" [class.uk-text-truncate]="!focused">
@ -67,18 +68,21 @@ declare var UIkit;
</ng-template>
<ng-template [ngIf]="type === 'select'">
<ng-container *ngIf="placeholderInfo?.static">
<div *ngIf="!getLabel(formControl.value)" class="placeholder uk-text-truncate">{{placeholderInfo.label}}</div>
<div *ngIf="getLabel(formControl.value)" class="input uk-text-truncate">{{getLabel(formControl.value)}}</div>
<div *ngIf="!getLabel(formControl.value)"
class="placeholder uk-text-truncate">{{placeholderInfo.label}}</div>
<div *ngIf="getLabel(formControl.value)"
class="input uk-text-truncate">{{getLabel(formControl.value)}}</div>
</ng-container>
<ng-container *ngIf="!placeholderInfo?.static">
<div *ngIf="!getLabel(formControl.value)" class="input uk-text-truncate">No value selected</div>
<div *ngIf="getLabel(formControl.value)" class="input uk-text-truncate">{{getLabel(formControl.value)}}</div>
<div *ngIf="getLabel(formControl.value)"
class="input uk-text-truncate">{{getLabel(formControl.value)}}</div>
</ng-container>
</ng-template>
<ng-template [ngIf]="type === 'autocomplete'">
<input *ngIf="focused" [attr.placeholder]="placeholderInfo?.static?placeholderInfo.label:hint"
#searchInput class="input" [formControl]="searchControl" [class.uk-text-truncate]="!focused">
<div *ngIf="!focused" class="input">{{getLabel(formAsControl.value)}}</div>
<div *ngIf="!focused" class="input uk-text-truncate">{{getLabel(formAsControl.value)}}</div>
</ng-template>
<ng-template [ngIf]="type === 'autocomplete_soft'">
<input #input class="input" [attr.placeholder]="placeholderInfo?.static?placeholderInfo.label:hint"
@ -88,7 +92,8 @@ declare var UIkit;
<div class="uk-grid uk-grid-small uk-grid-row-collapse uk-width-expand" uk-grid>
<div *ngFor="let chip of formAsArray.controls; let i=index" [class.uk-hidden]="!focused && i > 0"
class="chip">
<div class="uk-label uk-label-small uk-flex uk-flex-middle">
<div class="uk-label uk-label-small uk-flex uk-flex-middle"
[attr.uk-tooltip]="(tooltip)?('title: ' + getLabel(chip.value) + '; delay: 500'):null">
<span class="uk-text-truncate uk-width-expand">{{getLabel(chip.value)}}</span>
<icon (click)="remove(i, $event)" class="uk-link-text uk-margin-small-left clickable" [flex]="true"
name="close" ratio="0.7"></icon>
@ -111,9 +116,9 @@ declare var UIkit;
class="uk-margin-left icon">
<icon *ngIf="formControl.disabled && disabledIcon" [name]="disabledIcon" [flex]="true"></icon>
<ng-template [ngIf]="formControl.enabled">
<icon *ngIf="!formControl.value && icon" [name]="icon" [flex]="true"></icon>
<icon *ngIf="!icon && type === 'select' && selectArrow" name="arrow_drop_down" [flex]="true"></icon>
<button *ngIf="searchControl?.value && type === 'autocomplete'" class="uk-close uk-icon"
<icon *ngIf="!searchControl?.value && icon" [name]="icon" [flex]="true"></icon>
<icon *ngIf="!icon && type === 'select' && selectArrow" [name]="selectArrow" [flex]="true"></icon>
<button *ngIf="!!searchControl?.value && type === 'autocomplete'" class="uk-close uk-icon"
(click)="resetSearch($event)">
<icon [flex]="true" name="close"></icon>
</button>
@ -130,7 +135,7 @@ declare var UIkit;
<ul class="uk-nav uk-dropdown-nav">
<li *ngFor="let option of filteredOptions; let i=index"
[class.uk-active]="(formControl.value === option.value) || selectedIndex === i"
[attr.uk-tooltip]="(tooltip)?('title: ' + option.label + ';'):null">
[attr.uk-tooltip]="(tooltip)?('title: ' + option.label + '; delay: 500'):null">
<a (click)="selectOption(option, $event)"
[class]="option.disabled ? 'uk-disabled uk-text-muted' : ''">{{option.label}}</a>
</li>
@ -198,6 +203,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
@Input() tooltip: boolean = false;
@Input() selectArrow: string = 'arrow_drop_down';
@Input() selectedIndex: number = 0;
@Input() selectable: boolean = false;
/** Chips && Autocomplete*/
public filteredOptions: Option[] = [];
public searchControl: FormControl;
@ -250,6 +256,14 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
return option;
}
});
if(this.type === "select") {
if (this.optionsArray.length > 7) {
this.type = 'autocomplete';
this.showOptionsOnEmpty = true;
this.icon = this.selectArrow;
}
this.selectable = true;
}
}
constructor(private elementRef: ElementRef, private cdr: ChangeDetectorRef) {
@ -481,9 +495,9 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
} else if (this.searchInput) {
this.searchInput.nativeElement.focus();
}
if (this.type === 'select') {
if (this.selectArrow) {
this.open(!this.opened);
} else if (this.type !== 'autocomplete' || !this.formControl.value) {
} else if (this.type !== 'autocomplete' || this.showOptionsOnEmpty || !this.formControl.value) {
this.open(true);
}
} else {
@ -505,15 +519,16 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
open(value: boolean) {
this.opened = value && this.formControl.enabled;
this.cdr.detectChanges();
if (this.optionBox) {
if (this.opened) {
this.selectedIndex = this.filteredOptions.findIndex(option => option.value === this.formControl.value);
if (this.selectedIndex === -1) {
this.selectedIndex = 0;
}
UIkit.dropdown(this.optionBox.nativeElement).show();
} else {
if (this.optionBox && this.opened) {
this.selectedIndex = this.filteredOptions.findIndex(option => option.value === this.formControl.value);
if (this.selectedIndex === -1) {
this.selectedIndex = 0;
}
UIkit.dropdown(this.optionBox.nativeElement).show();
} else {
if (this.optionBox) {
UIkit.dropdown(this.optionBox.nativeElement).hide();
this.focused = false;
}
}
}

View File

@ -22,7 +22,7 @@ declare var UIkit;
<!-- This is the modal -->
<modal-alert #egiTransferModal large="true" emitHidden="true" (alertHidden)="close()">
<modal-alert #egiTransferModal large="true" >
<div *ngIf="!accessToken" class="">
<div class="uk-width-1-1 uk-margin-top uk-margin-bottom uk-text-center">
In order to send data to a Cloud Storage, you would need to be authenticated, please login via EGI check-in.
@ -54,7 +54,7 @@ declare var UIkit;
</div>
<div>
<p class="uk-text-meta uk-text-xsmall uk-margin-remove-bottom uk-margin-top">Please select the Destination Storage type and provide the corresponding storage destination path.</p>
<div input type="select" [(value)]="selectedDestination" placeholder="Storage type" hint="Select..."
<div input type="select" [(value)]="selectedDestination" placeholder="Destination Storage" hint="Select..."
[options]="destinationOptions"></div>
<div input [(value)]="destinationPath" placeholder="Give a destination path..."
[validators]="validators" class="uk-margin-top"></div>
@ -97,7 +97,7 @@ export class EGIDataTransferComponent {
sourceUrls = []
selectedSourceUrl = null;
destinationPath = "";
destinationOptions = [{label: "EGI storage", value: { url: "https://dcache-demo.desy.de:2443", id: "egi" , webpage:"https://dcache-demo.desy.de"} }];
destinationOptions = [{label: "EGI dCache (dcache-demo.desy.de)", value: { url: "https://dcache-demo.desy.de:2443", id: "dcache" , webpage:"https://dcache-demo.desy.de"} }];
selectedDestination = null;
downloadElements = null;
@ -149,6 +149,11 @@ export class EGIDataTransferComponent {
this.egiTransferModal.cancelButton = false;
this.egiTransferModal.okButton = false;
this.egiTransferModal.alertTitle = "EOSC data transfer service [demo]";
this.destinationPath = "";
this.selectedDestination = this.destinationOptions[0].value;
this.selectedSourceUrl = this.sourceUrls[0];
this.message = null;
this.status = "init";
this.egiTransferModal.open();
}
close(){
@ -168,7 +173,7 @@ export class EGIDataTransferComponent {
}
checkin(){
window.location.href = this.loginURL+"?redirect="+ encodeURIComponent(window.location.href + "&egiTransfer=t");
window.location.href = this.loginURL+"?redirect="+ encodeURIComponent(window.location.href + (window.location.href.indexOf("&egiTransfer=t")!=-1?"":"&egiTransfer=t"));
}
parse(){

View File

@ -13,6 +13,9 @@ export class DataproviderProvenance {
}
export class DataProviderInfo {
relcanId;
objIdentifier: string;
record;
title: { "name": string, "url": string };
officialName: string;
type: string;

View File

@ -115,12 +115,6 @@ export class AlertModal {
@Input()
public choice: boolean = false;
/**
* If the value is true, on the hidden event the alertHidden Output is emitted
*/
@Input()
public emitHidden: boolean = false;
/**
* if the value is true then on ok clicked, modal will stay open.
*/
@ -135,24 +129,13 @@ export class AlertModal {
* or when Ok method is called.
*/
@Output() public alertOutput: EventEmitter<any> = new EventEmitter();
/**
* If emitHidden is true, this output is emitted when modal is hidden.
*/
@Output() public alertHidden: EventEmitter<any> = new EventEmitter();
@ViewChild('element') element: ElementRef;
constructor() {
}
ngAfterViewInit() {
if(this.emitHidden) {
UIkit.util.on('#' + this.id, 'hidden', () => {
this.alertHidden.emit(true);
});
}
}
/**
* Opens a alert window creating backdrop.

View File

@ -1,3 +1,5 @@
import {Filter} from "../../searchPages/searchUtils/searchHelperClasses.class";
export class SearchFields {
//main Entities
@ -232,7 +234,7 @@ export class SearchFields {
filterType: "checkbox"
},
["sdg"]: {
name: "SDG",
name: "SDG [Beta]",
type: "vocabulary",
param: "sdg",
operator: "sg",
@ -240,7 +242,7 @@ export class SearchFields {
filterType: "checkbox"
},
["fos"]: {
name: "Field of Science",
name: "Field of Science [Beta]",
type: "vocabulary",
param: "fos",
operator: "fs",
@ -257,7 +259,7 @@ export class SearchFields {
"fundinglevel2_id", "projectstartyear", "projectendyear", "projectecsc39"];
public PROJECT_ADVANCED_FIELDS: string[] = ["q", "projectacronym", "projecttitle", "projectkeywords",
"funder", "fundinglevel0_id", "fundinglevel1_id", "fundinglevel2_id",
"projectstartdate", "projectenddate", "projectecsc39",
"projectstartdate", "projectenddate",
"projectcode_nt", "relorganizationid", "collectedfromdatasourceid"];
public PROJECT_FIELDS: { [key: string]: FieldDetails } = {
["q"]: {name: "All fields", type: "keyword", param: "q", operator: "op", equalityOperator: "=", filterType: null},
@ -396,7 +398,8 @@ export class SearchFields {
//DATAPROVIDERS
// add Collected From Filter "collectedfromname"
public DATASOURCE_REFINE_FIELDS: string[] = ["datasourcetypeuiname", "datasourceodlanguages", "datasourceodcontenttypes",
"datasourcecompatibilityname", "country", "collectedfromname"];
"datasourcecompatibilityname", "country", "collectedfromname","datasourcethematic",
"datasourcejurisdiction"];
public DATASOURCE_ADVANCED_FIELDS: string[] = ["q", "datasourceofficialname",
"datasourceenglishname", "datasourceodsubjects", "datasourcetypename", "datasourceodlanguages",
"datasourceodcontenttypes", "datasourcecompatibilityname", "relorganizationid", "collectedfromdatasourceid"];
@ -514,7 +517,23 @@ export class SearchFields {
operator: "cu",
equalityOperator: "=",
filterType: "checkbox"
}
},
["datasourcethematic"]: {
name: "Thematic",
type: "boolean",
param: "thematic",
operator: "th",
equalityOperator: " exact ",
filterType: "radio"
},
["datasourcejurisdiction"]: {
name: "Jurisdiction",
type: "vocabulary",
param: "jurisdiction",
operator: "ju",
equalityOperator: "=",
filterType: "checkbox"
}
};
public DEPOSIT_DATASOURCE_KEYWORD_FIELDS: { "name": string, "equalityOperator": string } [] = [
@ -526,7 +545,7 @@ export class SearchFields {
{"name": "country", "equalityOperator": " exact "},
{"name": "datasourcesubject", "equalityOperator": " all "}
];
public DEPOSIT_DATASOURCE_REFINE_FIELDS: string[] = ["datasourcetypename", "country", "datasourceodsubjects", "datasourceodcontenttypes", "datasourcecompatibilityname"];
public DEPOSIT_DATASOURCE_REFINE_FIELDS: string[] = ["datasourcetypename", "country", "datasourceodsubjects", "datasourceodcontenttypes", "datasourcecompatibilityname","datasourcethematic", "datasourcejurisdiction"];
public DEPOSIT_DATASOURCE_FIELDS: { [key: string]: FieldDetails } = {
["datasourcetypeuiname"]: {
@ -636,10 +655,7 @@ export class SearchFields {
};
public ADVANCED_SEARCH_OPERATORS: { name: string, id: string }[] = [{name: "AND", id: "and"}, {
name: "OR",
id: "or"
}, {name: "NOT", id: "not"}];
public ADVANCED_SEARCH_OPERATORS: string[] = ["and", "or"];
public COMMUNITIES_SEARCH_FIELDS: string[] = ["type", "access", "role"];
@ -647,55 +663,34 @@ export class SearchFields {
constructor() {
}
getFieldName(fieldId: string, fieldType: string): string {
getField(fieldId: string, fieldType: string): any {
if (fieldType == "publication" || fieldType == "dataset" || fieldType == "software" || fieldType == "other" || fieldType == "result") {
return this.RESULT_FIELDS[fieldId].name;
return this.RESULT_FIELDS[fieldId];
} else if (fieldType == "project") {
return this.PROJECT_FIELDS[fieldId].name;
return this.PROJECT_FIELDS[fieldId];
} else if (fieldType == "organization") {
return this.ORGANIZATION_FIELDS[fieldId].name;
return this.ORGANIZATION_FIELDS[fieldId];
} else if (fieldType == "datasource" || fieldType == "dataprovider") {
return this.DATASOURCE_FIELDS[fieldId].name;
return this.DATASOURCE_FIELDS[fieldId];
} else if (fieldType == "service") {
return this.DATASOURCE_FIELDS[fieldId].name;
return this.DATASOURCE_FIELDS[fieldId];
} else {
return "UNDEFINED";
return null;
}
}
getFieldName(fieldId: string, fieldType: string): string {
let field = this.getField(fieldId, fieldType);
return field?field.name:"UNDEFINED";
}
getFieldFilterType(fieldId: string, fieldType: string, usedBy: string = "search"): string {
if (fieldType == "publication" || fieldType == "dataset" || fieldType == "software" || fieldType == "other" || fieldType == "result") {
return this.RESULT_FIELDS[fieldId].filterType;
} else if (fieldType == "project") {
return this.PROJECT_FIELDS[fieldId].filterType;
} else if (fieldType == "organization") {
return this.ORGANIZATION_FIELDS[fieldId].filterType;
} else if (fieldType == "datasource" || fieldType == "dataprovider") {
if (usedBy == "search") {
return this.DATASOURCE_FIELDS[fieldId].filterType;
} else if (usedBy == "deposit") {
return this.DEPOSIT_DATASOURCE_FIELDS[fieldId].filterType;
}
} else {
return "checkbox";
}
let field = this.getField(fieldId, fieldType);
return field?field.filterType:"checkbox";
}
getFieldParam(fieldId: string, fieldType: string): string {
if (fieldType == "publication" || fieldType == "dataset" || fieldType == "software" || fieldType == "other" || fieldType == "result") {
return this.RESULT_FIELDS[fieldId].param;
} else if (fieldType == "project") {
return this.PROJECT_FIELDS[fieldId].param;
} else if (fieldType == "organization") {
return this.ORGANIZATION_FIELDS[fieldId].param;
} else if (fieldType == "datasource" || fieldType == "dataprovider") {
return this.DATASOURCE_FIELDS[fieldId].param;
} else if (fieldType == "service") {
return this.DATASOURCE_FIELDS[fieldId].param;
} else {
return "UNDEFINED";
}
let field = this.getField(fieldId, fieldType);
return field?field.param:"UNDEFINED";
}
public static getParameterOrder(fieldId: string, params): number {
let fields = [];

View File

@ -99,7 +99,7 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
}
}
getPID() {
return Identifier.getResultPIDFromIdentifiers(this.result.identifiers);
return Identifier.getPIDFromIdentifiers(this.result.identifiers);
}
public initBeforeTitle() {

View File

@ -207,8 +207,8 @@ export class Identifier {
return (strict?null:{"class": "doi", "id": pid});
}
public static getResultPIDFromIdentifiers(identifiers: Map<string, string[]>): Identifier {
let classes:string [] = ["doi", "handle", "pmc", "pmid"];
public static getPIDFromIdentifiers(identifiers: Map<string, string[]>): Identifier {
let classes:string [] = ["doi", "handle", "pmc", "pmid", "re3data"];
if(identifiers) {
for (let cl of classes){
if(identifiers.get(cl)){