diff --git a/landingPages/dataProvider/dataProvider.component.html b/landingPages/dataProvider/dataProvider.component.html index 416fe498..146e2207 100644 --- a/landingPages/dataProvider/dataProvider.component.html +++ b/landingPages/dataProvider/dataProvider.component.html @@ -75,7 +75,7 @@
- + + + { 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: { diff --git a/landingPages/dataProvider/dataProvider.service.ts b/landingPages/dataProvider/dataProvider.service.ts index ab6f237e..f1c8598a 100644 --- a/landingPages/dataProvider/dataProvider.service.ts +++ b/landingPages/dataProvider/dataProvider.service.ts @@ -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 => 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; diff --git a/landingPages/landing-utils/fos.component.ts b/landingPages/landing-utils/fos.component.ts index cea6c60d..add39177 100644 --- a/landingPages/landing-utils/fos.component.ts +++ b/landingPages/landing-utils/fos.component.ts @@ -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) { diff --git a/landingPages/landing-utils/landing-header/landing-header.component.ts b/landingPages/landing-utils/landing-header/landing-header.component.ts index a64ebf59..805ded09 100644 --- a/landingPages/landing-utils/landing-header/landing-header.component.ts +++ b/landingPages/landing-utils/landing-header/landing-header.component.ts @@ -6,7 +6,7 @@ import {AlertModal} from "../../../utils/modal/alert"; @Component({ selector: 'landing-header', template: ` -
+
{{entityType}} @@ -49,7 +49,7 @@ import {AlertModal} from "../../../utils/modal/alert"; class="uk-text-primary">Under curation
-
+
@@ -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'); diff --git a/landingPages/landing-utils/sdg.component.ts b/landingPages/landing-utils/sdg.component.ts index f575382e..29a8199e 100644 --- a/landingPages/landing-utils/sdg.component.ts +++ b/landingPages/landing-utils/sdg.component.ts @@ -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) { diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index c7424b7e..d1324bcd 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -68,7 +68,8 @@
  • @@ -173,7 +174,16 @@ uk-sticky="bottom: true; media: @m" [attr.offset]="offset" cls-active="active">
    - + + +
    - -
    -
    -
    +
    +
    +
    • diff --git a/searchPages/searchUtils/advancedSearchForm.component.html b/searchPages/searchUtils/advancedSearchForm.component.html index 947d3650..1e772bd3 100644 --- a/searchPages/searchUtils/advancedSearchForm.component.html +++ b/searchPages/searchUtils/advancedSearchForm.component.html @@ -17,16 +17,24 @@
      - +
      - - + + - - diff --git a/searchPages/searchUtils/advancedSearchForm.component.ts b/searchPages/searchUtils/advancedSearchForm.component.ts index d865ddcc..3765f13f 100644 --- a/searchPages/searchUtils/advancedSearchForm.component.ts +++ b/searchPages/searchUtils/advancedSearchForm.component.ts @@ -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') + } } diff --git a/searchPages/searchUtils/newSearchPage.component.html b/searchPages/searchUtils/newSearchPage.component.html index 20de2eac..35e94209 100644 --- a/searchPages/searchUtils/newSearchPage.component.html +++ b/searchPages/searchUtils/newSearchPage.component.html @@ -47,7 +47,14 @@
    • - {{value.name}} + + {{filter.title}}: + {{value.name=='true'?'Yes':'No'}} + + + {{value.name}} + diff --git a/searchPages/searchUtils/newSearchPage.component.ts b/searchPages/searchUtils/newSearchPage.component.ts index c99ddae0..e8114ed5 100644 --- a/searchPages/searchUtils/newSearchPage.component.ts +++ b/searchPages/searchUtils/newSearchPage.component.ts @@ -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"]) { diff --git a/searchPages/searchUtils/searchFilter.component.html b/searchPages/searchUtils/searchFilter.component.html index 0ffe75d9..a3507caa 100644 --- a/searchPages/searchUtils/searchFilter.component.html +++ b/searchPages/searchUtils/searchFilter.component.html @@ -53,7 +53,13 @@ (ngModelChange)="uniqueFilterChange(value)"/> - {{_formatName(value)}} + + {{value.name=='true'?'Yes':'No'}} + + + {{_formatName(value)}} + + ({{value.number|number}}) diff --git a/searchPages/searchUtils/searchHelperClasses.class.ts b/searchPages/searchUtils/searchHelperClasses.class.ts index 52268e53..4663be5f 100644 --- a/searchPages/searchUtils/searchHelperClasses.class.ts +++ b/searchPages/searchUtils/searchHelperClasses.class.ts @@ -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"; } diff --git a/services/metrics.service.ts b/services/metrics.service.ts index e5be196c..97703c49 100644 --- a/services/metrics.service.ts +++ b/services/metrics.service.ts @@ -78,7 +78,6 @@ export class MetricsService { }catch(e){ console.error(e) } - console.log(map) return map; } diff --git a/services/searchDataproviders.service.ts b/services/searchDataproviders.service.ts index 7d54195f..49b49462 100644 --- a/services/searchDataproviders.service.ts +++ b/services/searchDataproviders.service.ts @@ -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']) { diff --git a/services/servicesUtils/refineResults.class.ts b/services/servicesUtils/refineResults.class.ts index 23ff0896..29bc5fbf 100644 --- a/services/servicesUtils/refineResults.class.ts +++ b/services/servicesUtils/refineResults.class.ts @@ -15,10 +15,12 @@ export class RefineResultsUtils { for(let j=0; j -
      +
      -
      +
      @@ -67,18 +68,21 @@ declare var UIkit; -
      {{placeholderInfo.label}}
      -
      {{getLabel(formControl.value)}}
      +
      {{placeholderInfo.label}}
      +
      {{getLabel(formControl.value)}}
      No value selected
      -
      {{getLabel(formControl.value)}}
      +
      {{getLabel(formControl.value)}}
      -
      {{getLabel(formAsControl.value)}}
      +
      {{getLabel(formAsControl.value)}}
      -
      +
      {{getLabel(chip.value)}} @@ -111,9 +116,9 @@ declare var UIkit; class="uk-margin-left icon"> - - - @@ -130,7 +135,7 @@ declare var UIkit;
      • + [attr.uk-tooltip]="(tooltip)?('title: ' + option.label + '; delay: 500'):null"> {{option.label}}
      • @@ -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; } } } diff --git a/utils/dataTransfer/transferData.component.ts b/utils/dataTransfer/transferData.component.ts index 13f19a3c..e3ab57f4 100644 --- a/utils/dataTransfer/transferData.component.ts +++ b/utils/dataTransfer/transferData.component.ts @@ -22,7 +22,7 @@ declare var UIkit; - +
        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;

        Please select the Destination Storage type and provide the corresponding storage destination path.

        -
        @@ -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(){ diff --git a/utils/entities/dataProviderInfo.ts b/utils/entities/dataProviderInfo.ts index 8688fe3f..0f329175 100644 --- a/utils/entities/dataProviderInfo.ts +++ b/utils/entities/dataProviderInfo.ts @@ -13,6 +13,9 @@ export class DataproviderProvenance { } export class DataProviderInfo { + relcanId; + objIdentifier: string; + record; title: { "name": string, "url": string }; officialName: string; type: string; diff --git a/utils/modal/alert.ts b/utils/modal/alert.ts index e67bbb1e..b7acc0b5 100644 --- a/utils/modal/alert.ts +++ b/utils/modal/alert.ts @@ -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 = new EventEmitter(); - - /** - * If emitHidden is true, this output is emitted when modal is hidden. - */ - @Output() public alertHidden: EventEmitter = 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. diff --git a/utils/properties/searchFields.ts b/utils/properties/searchFields.ts index bff91562..0bffac9c 100644 --- a/utils/properties/searchFields.ts +++ b/utils/properties/searchFields.ts @@ -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 = []; diff --git a/utils/result-preview/result-preview.component.ts b/utils/result-preview/result-preview.component.ts index d820992e..35a72301 100644 --- a/utils/result-preview/result-preview.component.ts +++ b/utils/result-preview/result-preview.component.ts @@ -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() { diff --git a/utils/string-utils.class.ts b/utils/string-utils.class.ts index 15ab8fa6..fd496ad6 100644 --- a/utils/string-utils.class.ts +++ b/utils/string-utils.class.ts @@ -207,8 +207,8 @@ export class Identifier { return (strict?null:{"class": "doi", "id": pid}); } - public static getResultPIDFromIdentifiers(identifiers: Map): Identifier { - let classes:string [] = ["doi", "handle", "pmc", "pmid"]; + public static getPIDFromIdentifiers(identifiers: Map): Identifier { + let classes:string [] = ["doi", "handle", "pmc", "pmid", "re3data"]; if(identifiers) { for (let cl of classes){ if(identifiers.get(cl)){
    • Field to searchTermSearching FieldsTerms
      + +
      +
      +
      +
      includes
      +
      include
      +
      +
      - {{op.id}} - + +
      +
      and