Merge pull request 'Production release July 2024 [EXPLORE]' (#47) from develop into master

Reviewed-on: #47
This commit is contained in:
Konstantina Galouni 2024-07-12 10:03:50 +02:00
commit 9b1e662f4b
63 changed files with 608 additions and 515 deletions

View File

@ -72,7 +72,7 @@ export class ClaimProjectsSearchFormComponent {
this.openaireResultsStatus = this.errorCodes.LOADING;
this.showResults = true;
this.sub = this._projectService.advancedSearchProjects("", 1, 0, this.properties,
this.refineFieldsQuery, this.refineFields, "&type=projects&sf=funder").subscribe(
this.refineFieldsQuery, this.refineFields, "&type=projects&sf=funder", false, false).subscribe(
data => {
let option = {value : null, label: "No funder selected"};
this.funderOptions.push(option);
@ -110,7 +110,7 @@ export class ClaimProjectsSearchFormComponent {
this.prevFilters = this.filters;
//searchProjects (params: string, refineParams:string, page: number, size: number, refineFields:string[] , properties:EnvProperties ):any {
this.sub = this._projectService.advancedSearchProjects(this.createOpenaireQueryParams(), page, size, this.properties, this.createOpenaireRefineQuery(), [], null).subscribe(
this.sub = this._projectService.advancedSearchProjects(this.createOpenaireQueryParams(), page, size, this.properties, this.createOpenaireRefineQuery(), [], null, false, false).subscribe(
// this.sub = this._projectService.searchProjects(this.createOpenaireQueryParams(),(page==1)? this.refineFieldsQuery:null, page, size, (page==1)?this.refineFields:[], this.properties).subscribe(
data => {
if (data != null) {

View File

@ -28,7 +28,7 @@ import {DropdownFilterComponent} from "../../../utils/dropdown-filter/dropdown-f
})
export class DisplayClaimsComponent implements OnInit, OnDestroy {
@Input() pageTitle: string = "";
properties: EnvProperties;
properties: EnvProperties = properties;
public searchTermStream = new Subject<string>();
subscriptions: any = [];
public subResults: any;
@ -101,7 +101,6 @@ export class DisplayClaimsComponent implements OnInit, OnDestroy {
sort: this._fb.control(this.sortOptions[0].value)
});
this.properties = properties;
this.url = properties.domain + properties.baseLink + this._router.url;
if (!this.myClaims) {
this.sortOptions.push({label: "User (desc) ", value: {sort: "user", descending: true}});

View File

@ -34,7 +34,7 @@ export class DirectLinkingComponent {
sources: ClaimEntity[] = [];
inlineEntity: ClaimEntity = null;
validInput: boolean = null;//'true;
properties: EnvProperties;
properties: EnvProperties = properties;
@Input() communityId: string = null;
localStoragePrefix: string = "";
@Input() organizationClaim: boolean = false;
@ -50,7 +50,6 @@ export class DirectLinkingComponent {
});
}
ngOnInit() {
this.properties = properties;
/* if(!this.claimsProperties){
this.claimsProperties = new ClaimsProperties();
}*/

View File

@ -1,5 +1,5 @@
import {Component, Input, Output, EventEmitter, ViewChild} from '@angular/core';
import {Router, ActivatedRoute} from '@angular/router';
import {Component, EventEmitter, Input, Output, ViewChild} from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {ClaimsService} from '../../claim-utils/service/claims.service';
import {ModalLoading} from '../../../utils/modal/loading.component';
import {AlertModal} from '../../../utils/modal/alert';
@ -63,6 +63,7 @@ export class ClaimInsertComponent {
private userManagementService: UserManagementService, private _logService: LogService) {
}
subscriptions = [];
timerSubscription;
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
@ -88,13 +89,12 @@ export class ClaimInsertComponent {
})
).subscribe();
this.subscriptions.push(loadingTimerSubscription);
let timerSubscription = timer(0, 10000).pipe(
this.timerSubscription = timer(0, 10000).pipe(
map(() => {
this.getStatus(); // load data contains the http request
})
).subscribe();
this.subscriptions.push(timerSubscription);
this.subscriptions.push(this.timerSubscription);
}else{
this.claimsJob = null;
}
@ -274,12 +274,12 @@ export class ClaimInsertComponent {
}
}
this.saveLocalStorage();
let timerSubscription = timer(0, 10000).pipe(
this.timerSubscription = timer(0, 10000).pipe(
map(() => {
this.getStatus(); // load data contains the http request
})
).subscribe();
this.subscriptions.push(timerSubscription);
this.subscriptions.push(this.timerSubscription);
},
err => {
err = err && err.error?err.error:err;
@ -599,11 +599,10 @@ export class ClaimInsertComponent {
}
getStatus(){
if(this.feedRecordsJob && ! (this.feedRecordsJob.status == "COMPLETE" || this.feedRecordsJob.status == "ERROR") ) {
if(this.feedRecordsJob && ! (this.feedRecordsJob.status == "COMPLETE" || this.feedRecordsJob.status == "FAILED") ) {
this.subscriptions.push(this.claimService.getStatus(this.feedRecordsJob.id, this.properties.claimsAPIURL).subscribe(data => {
this.feedRecordsJob = data.data;
// console.log("feed", this.feedRecordsJob.status);
if (this.feedRecordsJob.status == "COMPLETE" || data.data.status == "ERROR") {
if (this.feedRecordsJob.status == "COMPLETE" || this.feedRecordsJob.status == "FAILED") {
this.insertedRecords = this.feedRecordsJob.insertedIds;
this.errorInRecords = this.feedRecordsJob.errorInClaims;
}
@ -622,8 +621,8 @@ export class ClaimInsertComponent {
if(this.claimsJob) {
this.subscriptions.push(this.claimService.getStatus(this.claimsJob.id, this.properties.claimsAPIURL).subscribe(data => {
this.claimsJob = data.data;
// console.log("claim: ", this.claimsJob.status, this.feedRecordsJob.status?this.feedRecordsJob.status:" no feed job");
if ((this.claimsJob.status == "COMPLETE" || data.data.status == "ERROR") && ( !this.feedRecordsJob || (this.feedRecordsJob.status == "COMPLETE" || data.data.status == "ERROR")) ) {
if ((this.claimsJob.status == "COMPLETE" || this.claimsJob.status == "FAILED") &&
( !this.feedRecordsJob || (this.feedRecordsJob.status == "COMPLETE" || data.data.status == "FAILED"))) {
this.insertedClaims = this.claimsJob.insertedIds;
this.errorInClaims = this.claimsJob.errorInClaims;
@ -636,7 +635,7 @@ export class ClaimInsertComponent {
this.errors.push(error);
}
this.afterclaimsInsertion();
this.timerSubscription.unsubscribe();
}
}, err => {

View File

@ -21,13 +21,12 @@ export class ApprovedByCommunityComponent {
public approved:boolean = false;
private communityContentProviders = [];
properties:EnvProperties;
properties:EnvProperties = properties;
public openaireEntities = OpenaireEntities;
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchCommunityDataprovidersService) {}
public ngOnInit() {
this.properties =properties;
this.route.queryParams.subscribe(
communityId => {
this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);

View File

@ -36,7 +36,7 @@ export class CuratorsComponent {
public viewingMore: boolean = false;
public curatorInModal;
public properties: EnvProperties;
public properties: EnvProperties = properties;
public pageContents = null;
public divContents = null;
@ -63,7 +63,6 @@ export class CuratorsComponent {
ngOnInit() {
this.showLoading = true;
this.properties = properties;
this.downloadUrl = this.properties.utilsService + '/download/';
//if (properties.environment !== 'development') {
if (!this.longView) {

View File

@ -166,7 +166,7 @@ export class ClassContentFormComponent implements OnInit {
this._router.navigate(['../'], {queryParams: {"pageId": this.pageId}, relativeTo: this.route});
NotificationHandler.rise('Page content has been <b>successfully updated</b>');
this.showLoading = false;
this._clearCacheService.clearCacheInRoute("Class help text saved or updated",this.portal, this.page.route);
this._clearCacheService.purgeBrowserCache("Class help text saved or updated",this.portal);
},
err => this.handleUpdateError('System error saving page content', err)
));

View File

@ -155,7 +155,7 @@ export class ClassHelpContentsComponent implements OnInit {
this.deletePageHelpContentsFromArray(this.selectedPageContents);
NotificationHandler.rise('Page content(s) has been <b>successfully deleted</b>');
this.showLoading = false;
this._clearCacheService.clearCacheInRoute("Class text texts deleted",this.portal, this.page.route);
this._clearCacheService.purgeBrowserCache("Class text texts deleted",this.portal);
},
error => this.handleUpdateError('System error deleting the selected page content(s)', error)
));
@ -198,7 +198,7 @@ export class ClassHelpContentsComponent implements OnInit {
this.countClassHelpContents();
this.applyCheck(false);
NotificationHandler.rise('Page content(s) has been <b>successfully updated</b>');
this._clearCacheService.clearCacheInRoute("class help text's status changed",this.portal, this.page.route);
this._clearCacheService.purgeBrowserCache("class help text's status changed",this.portal);
},
error => this.handleUpdateError('System error changing the status of the selected page content(s)', error)
));

View File

@ -345,7 +345,7 @@ export class EntitiesComponent implements OnInit {
this.checkboxes[i].entity.isEnabled = this.toggleStatus;
}
this.applyCheck(false);
this._clearCacheService.clearCacheInRoute("entity's status changed", this.portal, "/");
this._clearCacheService.purgeBrowserCache("entity's status changed", this.portal);
this._clearCacheService.purgeBrowserCache("entity's status changed", this.portal);
},
error => this.handleUpdateError('System error changing the status of the selected entity(-ies)', error)

View File

@ -199,7 +199,7 @@ export class PageContentFormComponent implements OnInit {
NotificationHandler.rise('Page content has been <b>successfully ' + (this.pageContentId ? 'updated' : 'created') + '</b>');
this._router.navigate(['../'], {queryParams: {"pageId": this.pageId}, relativeTo: this.route});
this.showLoading = false;
this._clearCacheService.clearCacheInRoute("page help content saved",this.portal, this.page.route);
this._clearCacheService.purgeBrowserCache("page help content saved",this.portal);
},
err => this.handleUpdateError('System error saving page content', err)
));

View File

@ -165,7 +165,7 @@ export class PageHelpContentsComponent implements OnInit {
this.deletePageHelpContentsFromArray(this.selectedPageContents);
NotificationHandler.rise('Page content(s) has been <b>successfully deleted</b>');
this.showLoading = false;
this._clearCacheService.clearCacheInRoute("Help texts deleted",this.portal, this.page.route);
this._clearCacheService.purgeBrowserCache("Help texts deleted",this.portal);
},
error => this.handleUpdateError('System error deleting the selected page content(s)', error)
));
@ -210,7 +210,7 @@ export class PageHelpContentsComponent implements OnInit {
NotificationHandler.rise('Page content(s) has been <b>successfully updated</b>');
this.countPageHelpContents();
this.applyCheck(false);
this._clearCacheService.clearCacheInRoute("Help text's status changed",this.portal, this.page.route);
this._clearCacheService.purgeBrowserCache("Help text's status changed",this.portal);
},
error => this.handleUpdateError('System error changing the status of the selected page content(s)', error)
));

View File

@ -7,8 +7,13 @@
<div class="uk-flex uk-flex-center uk-flex-wrap uk-flex-middle uk-grid" uk-grid
[class]="isPortalAdministrator ? 'uk-flex-between@m':'uk-flex-right@m'">
<div>
<div input inputClass="border-bottom" type="select" [options]="menuTypes" [(value)]="selectedMenuType" (valueChange)="valueChange()"
*ngIf="isPortalAdministrator"></div>
<!--<div input inputClass="border-bottom" type="select" [options]="menuTypes" [(value)]="selectedMenuType" (valueChange)="valueChange()"
*ngIf="isPortalAdministrator"></div>-->
<ul *ngIf="isPortalAdministrator" class="uk-subnav uk-subnav-pill uk-margin-medium-top">
<li *ngFor="let type of menuTypes; let i=index"
[class.uk-active]="selectedMenuType === type.value"><a
(click)="selectedMenuType = type.value"><span>{{type.label}}</span></a></li>
</ul>
</div>
<div>
<button class="uk-button uk-button-default uk-flex uk-flex-middle"
@ -163,9 +168,9 @@
<span class="uk-margin-small-left">Hidden</span>
</label>
</div>
<ng-container *ngIf="selectedMenuType == 'customMenu'">
<h6 class="uk-margin-medium-top">Menu alignment</h6>
<div *ngIf="selectedMenuType == 'customMenu'">
<div >
<div>
<label (click)="alignMenu('LEFT')">
<input class="uk-radio" type="radio" name="menuAlign" [checked]="(featuredAlignment == 'LEFT')">
@ -185,6 +190,7 @@
</label>
</div>
</div>
</ng-container>
</div>
</div>
<div *ngIf="displayMenuItems && displayMenuItems.length == 0"

View File

@ -46,8 +46,9 @@ export class MenuComponent implements OnInit {
public menuItemForm: FormGroup;
public pageForm: FormGroup;
public menuTypes = [
{label: 'Normal Menu', value: 'normalMenu'},
{label: 'Custom Menu', value: 'customMenu'}
{label: 'Custom', value: 'customMenu'},
{label: 'Main', value: 'normalMenu'}
];
public selectedMenuType = this.menuTypes[0].value;
public normalMenuItems: MenuItemExtended[] = [];
@ -126,8 +127,8 @@ export class MenuComponent implements OnInit {
} else {
this.title.setTitle('Administrator Dashboard | Menu');
}
this.isPortalAdministrator = Session.isPortalAdministrator(user);
this.selectedMenuType = this.isPortalAdministrator ? this.menuTypes[0].value : this.menuTypes[1].value;
this.isPortalAdministrator = false;//Session.isPortalAdministrator(user);
this.selectedMenuType = this.menuTypes[0].value
});
}
@ -271,7 +272,7 @@ export class MenuComponent implements OnInit {
this.deleteMenuItemFromArray(this.selectedMenuItem, this.isChild);
NotificationHandler.rise("Menu item have been <b>successfully deleted</b>");
this.showLoading = false;
this._clearCacheService.clearCacheInRoute("Menu item deleted",this.portal, "/");
this._clearCacheService.purgeBrowserCache("Menu item deleted",this.portal);
},
error => this.handleError("Server error deleting menu item", error)
@ -313,7 +314,7 @@ export class MenuComponent implements OnInit {
menuItem => {
this.menuItemSavedSuccessfully(menuItem, true);
NotificationHandler.rise('Menu item <b>' + menuItem.title + '</b> has been <b>successfully created</b>');
this._clearCacheService.clearCacheInRoute("Menu item saved",this.portal, "/");
this._clearCacheService.purgeBrowserCache("Menu item saved",this.portal);
},
error => this.handleError("System error creating menu item", error)
)
@ -324,7 +325,7 @@ export class MenuComponent implements OnInit {
menuItem => {
this.menuItemSavedSuccessfully(menuItem, false);
NotificationHandler.rise('Menu item <b>' + menuItem.title + '</b> has been <b>successfully updated</b>');
this._clearCacheService.clearCacheInRoute("Menu item updated",this.portal, "/");
this._clearCacheService.purgeBrowserCache("Menu item updated",this.portal);
},
error => this.handleError("System error updating menu item", error)
)
@ -390,7 +391,7 @@ export class MenuComponent implements OnInit {
HelperFunctions.swap(temp, index, newIndex);
this._helpContentService.reorderMenuItems(temp, this.portal).subscribe(() => {
HelperFunctions.swap(this.featuredMenuItems, index, newIndex);
this._clearCacheService.clearCacheInRoute("Menu items reordered",this.portal, "/");
this._clearCacheService.purgeBrowserCache("Menu items reordered",this.portal);
}, error => {
this.handleError("System error reordering menu items", error);
});
@ -402,7 +403,7 @@ export class MenuComponent implements OnInit {
HelperFunctions.swap(temp, index, newIndex);
this._helpContentService.reorderMenuItems(temp, this.portal).subscribe(() => {
HelperFunctions.swap(children && children.length ? children : this.normalMenuItems, index, newIndex);
this._clearCacheService.clearCacheInRoute("Menu items reordered",this.portal, "/");
this._clearCacheService.purgeBrowserCache("Menu items reordered",this.portal);
}, error => {
this.handleError("System error reordering menu items", error);
});
@ -417,7 +418,7 @@ export class MenuComponent implements OnInit {
} else {
this.showNormalMenu = status;
}
this._clearCacheService.clearCacheInRoute("Menu toggled",this.portal, "/");
this._clearCacheService.purgeBrowserCache("Menu toggled",this.portal);
NotificationHandler.rise("Menu has been <b>successfully toggled to be "+(status?"visible":"hidden")+"</b>");
}, error => {
this.handleError("System error toggling menu", error);
@ -429,7 +430,7 @@ export class MenuComponent implements OnInit {
this.subscriptions.push(
this._helpContentService.alignMenu(MenuAlignment[alignment], this.portal).subscribe(() => {
this.featuredAlignment = alignment;
this._clearCacheService.clearCacheInRoute("Menu aligned",this.portal, "/");
this._clearCacheService.purgeBrowserCache("Menu aligned",this.portal);
NotificationHandler.rise("Menu has been <b>successfully "+alignment.toLowerCase()+" aligned</b>");
}, error => {
this.handleError("System error aligning menu to the "+alignment.toLowerCase(), error);

View File

@ -415,7 +415,6 @@ export class PagesComponent implements OnInit {
this.checkboxes[i].page.isEnabled = status;
}
this.applyCheck(false);
this._clearCacheService.clearCacheInRoute("Page's status changed",this.portal, "/");
this._clearCacheService.purgeBrowserCache("Page's status changed", this.portal);
},
error => this.handleUpdateError('System error changing the status of the selected page(s)', error)

View File

@ -40,9 +40,9 @@ import {PluginStats} from "./plugin-stats.component";
type="checkbox" field="sdgs" (editClicked)="pluginEditEvent = $event"
(changed)="indicatorsChanged(indicator._id,$event)">
</plugin-field-edit>
{{indicator.indicatorPaths[0].name?indicator.name:(indicator.indicatorPaths[0].parameters['title'] )}}
{{decode(indicator.indicatorPaths[0].name?indicator.name:(indicator.indicatorPaths[0].parameters['title'] ))}}
<span class=" uk-text-xsmall">
{{ indicator.indicatorPaths[0].parameters['subtitle']? ' ' + indicator.indicatorPaths[0].parameters['subtitle']:''}}</span>
{{ decode(indicator.indicatorPaths[0].parameters['subtitle']? ' ' + indicator.indicatorPaths[0].parameters['subtitle']:'')}}</span>
</div>
</ng-container>
@ -78,4 +78,7 @@ export class PluginStatsFormComponent extends PluginBaseFormComponent<PluginStat
$event.value = this.pluginObject['url'];
this.valuesChanged.emit($event)
}
decode(text){
return text? decodeURIComponent(text):"";
}
}

View File

@ -34,7 +34,7 @@ export class PortalsComponent implements OnInit {
private searchText: RegExp = new RegExp('');
public keyword = '';
public properties: EnvProperties = null;
public properties: EnvProperties = properties;
public showLoading = true;
public portalUtils: PortalUtils = new PortalUtils();
@ -61,7 +61,6 @@ export class PortalsComponent implements OnInit {
}));
HelperFunctions.scroll();
this.properties = properties;
this.getPortals();
}

View File

@ -231,8 +231,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
}
this.filterActiveBySearch(this.filterForm.value.active);
this.userManagementService.updateUserInfo();
this.clearCacheService.clearCacheInRoute(this.role + 's of ' + this.id + ' have been updated',this.id, "/");
this.clearCacheService.clearCacheInRoute(this.role + 's of ' + this.id + ' have been updated',this.id, "/curators");
this.clearCacheService.purgeBrowserCache(this.role + 's of ' + this.id + ' have been updated',this.id);
NotificationHandler.rise(this.selectedUser + ' <b>is no longer</b> ' + this.role + ' of ' + this.name + ' Dashboard');
this.loadActive = false;
}, error => {

View File

@ -191,7 +191,7 @@ export class DepositFirstPageComponent {
public keyword: string;
public depositRoute: string;
public searchPlaceHolder = "Search by title, country, organization, subject, type...";
properties:EnvProperties;
properties:EnvProperties = properties;
public routerHelper:RouterHelper = new RouterHelper();
@Input() showBreadcrumb:boolean = false;
breadcrumbs:Breadcrumb[] = [];
@ -208,7 +208,6 @@ export class DepositFirstPageComponent {
ngOnInit() {
this.properties = properties;
this.url = this.properties.domain+this.properties.baseLink + this._router.url;
this.seoService.createLinkForCanonicalURL(this.url, false);

View File

@ -18,7 +18,7 @@ export class SearchResultsInDepositComponent {
@Input() results: SearchResult[];
@Input() status: number;
@Input() type: string;
@Input() properties:EnvProperties;
@Input() properties:EnvProperties = properties;
@Input() isMobile: boolean = false;
@ -60,8 +60,6 @@ export class SearchResultsInDepositComponent {
this.urlParam = "datasourceId";
}
this.properties = properties;
if (!this.zenodoInformation) {
this.zenodoInformation = new ZenodoInformationClass();
}

View File

@ -228,11 +228,13 @@
class="uk-link-text" [innerHTML]="highlightKeyword(searchFieldsHelper.getFosParameter() == 'foslabel' ? subSubItem.label : subSubItem.id)">
</a>
<ng-container *ngIf="properties.environment == 'development'">
<div *ngFor="let level4 of subSubItem?.children" class="uk-margin-left">
<a [routerLink]="properties.searchLinkToResults" [queryParams]="buildFosQueryParam(level4)"
class="uk-text-small uk-text-meta uk-margin-xsmall-bottom" [innerHTML]="highlightKeyword(searchFieldsHelper.getFosParameter() == 'foslabel' ? level4.label : level4.id)">
</a>
</div>
</ng-container>
</div>
</div>
</div>

View File

@ -78,15 +78,12 @@ export class StatisticsTabComponent {
private dataProjectsUrl:string ;
private pubsProjectsUrl:string;
public errorCodes:ErrorCodes = new ErrorCodes();
properties:EnvProperties;
properties:EnvProperties = properties;
public openaireEntities = OpenaireEntities;
sub;
constructor (private route: ActivatedRoute) {}
ngOnInit() {
this.properties = properties;
if (this.properties.useNewStatistisTool) {
this.docsTimelineUrl = this.properties.statisticsFrameNewAPIURL +
'chart?json='+StringUtils.URIEncode('{"library":"HighCharts","chartDescription":{"queries":[{"name":"'+this.openaireEntities.RESULTS+'","type":"column","query":{"name":"dtsrcYear","parameters":["'+this.datasourceId+'"]}}],"chart":{"backgroundColor":"#FFFFFFFF","borderColor":"#335cadff","borderRadius":0,"borderWidth":0,"plotBorderColor":"#ccccccff","plotBorderWidth":0},"title":{"text":"Produced '+this.openaireEntities.RESULTS+' per year"},"subtitle":{},"yAxis":{"title":{"text":"'+this.openaireEntities.RESULTS+'"}},"xAxis":{"title":{"text":"Year"}},"lang":{"noData":"No Data available for the Query"},"exporting":{"enabled":false},"plotOptions":{"series":{"dataLabels":{"enabled":false}}},"legend":{"enabled":true,"align":"center","verticalAlign":"bottom","layout":"horizontal"},"credits":{"href":null,"enabled":true,"text":"Created by OpenAIRE via HighCharts"}}}');

View File

@ -41,7 +41,7 @@ export class CiteThisComponent implements OnInit, OnDestroy {
public selectedStyle: string = null;
public selectedFormat: string = null;
public fileText: string;
properties:EnvProperties;
properties:EnvProperties = properties;
public citationText: string;
public citation: Citation = new Citation();
@Input() result: any;
@ -55,7 +55,6 @@ export class CiteThisComponent implements OnInit, OnDestroy {
constructor( @Inject(DOCUMENT) private document, private rendererFactory: RendererFactory2, private _piwikService: PiwikService){
}
ngOnInit() {
this.properties = properties;
try{
if (!this.document.getElementById('citationjs')) {
const renderer = this.rendererFactory.createRenderer(this.document, {

View File

@ -1,4 +1,9 @@
import {HostedByCollectedFrom, Project, RelationResult} from "../../utils/result-preview/result-preview";
import {
HostedByCollectedFrom,
Project,
RelationDatasource,
RelationResult
} from "../../utils/result-preview/result-preview";
import {Context, Measure, Metric, MetricPerDatasource, Reference} from "../../utils/entities/resultLandingInfo";
import {Injectable} from '@angular/core';
import {properties} from "../../../../environments/environment";
@ -527,6 +532,56 @@ export class ParsingFunctions {
return researchResults;
}
// publication & dataset & software & orp landing : for relatedResearchResults
parseDatasources(datasources: RelationDatasource[], relation, provenanceAction: string, relationName: string): RelationDatasource[] {
let datasource: RelationDatasource = {
name: "",
id: "",
percentage: null,
percentageName: null,
class: "",
provenanceAction: provenanceAction,
relationName: relationName,
openaireCompatibility: ""
};
datasource['id'] = relation['to'].content;
if(relation["officialname"])
datasource.name = relation.officialname;
else {
datasource['name'] = "[no title available]";
}
let percentageName: string;
if (relation.trust) {
percentageName = "trust";
} else if (relation.similarity) {
percentageName = "similarity";
}
if (percentageName) {
datasource['percentage'] = Math.round(relation[percentageName] * 100);
datasource['percentageName'] = percentageName;
}
// type
if(relation.hasOwnProperty('datasourcetype') && relation['datasourcetype'].hasOwnProperty("classname")) {
datasource.class = relation['datasourcetype'].classname;
}
// compatibility
if(relation.hasOwnProperty("openairecompatibility")) {
datasource.openaireCompatibility = relation['openairecompatibility'].classname;
}
if(datasource.class !== "service" || properties.adminToolsPortalType == "eosc") {
if (datasources == undefined) {
datasources = [];
}
datasources.push(datasource);
}
return datasources;
}
sortByPercentage(results: RelationResult[]): RelationResult[] {
if (results) {
return results.sort(function (a, b) {
@ -643,11 +698,11 @@ export class ParsingFunctions {
if (!classifiedSubjects.has(subject.classname)) {
classifiedSubjects.set(subject.classname, new Array<string>());
}
if(properties.environment == "production") {
classifiedSubjects.get(subject.classname).push(content);
} else {
// if(properties.environment == "production") {
// classifiedSubjects.get(subject.classname).push(content);
// } else {
classifiedSubjects.get(subject.classname).push(subject.classid + ": " + content);
}
// }
// }
}
} else {
@ -668,7 +723,7 @@ export class ParsingFunctions {
}
}
if(properties.environment != "production" && classifiedSubjects != null) {
if(classifiedSubjects != null) {
if (subjects == undefined) {
subjects = new Array<string>();
}

View File

@ -13,20 +13,19 @@ import {properties} from "../../../../environments/environment";
@Component({
selector: 'showSubjects',
template: `
<ng-container *ngIf="properties.environment == 'production' && !viewAllSubjects && ((classifiedSubjects && classifiedSubjects.size > 0) || (eoscSubjects && eoscSubjects.length > 0))">
<div *ngIf="!viewAllClassifiedSubjects" class="uk-text-meta">
Subjects by Vocabulary
</div>
<ng-container *ngTemplateOutlet="subjects_by_vocabulary_template; context: {customClasses: (isMobile && viewAllClassifiedSubjects) ? '' : 'multi-line-ellipsis lines-2', id: 'content'}"></ng-container>
<ng-container *ngIf="eoscSubjects && eoscSubjects.length > 0"><ng-container *ngTemplateOutlet="eosc_subjects_template"></ng-container></ng-container>
<div *ngIf="isClassifiedLarge && !viewAllClassifiedSubjects" class="uk-text-right">
<a (click)="viewAllSubjectsByVocabularyClicked()" class="view-more-less-link">View all</a>
</div>
</ng-container>
<!-- <ng-container *ngIf="properties.environment == 'production' && !viewAllSubjects && ((classifiedSubjects && classifiedSubjects.size > 0) || (eoscSubjects && eoscSubjects.length > 0))">-->
<!-- <div *ngIf="!viewAllClassifiedSubjects" class="uk-text-meta">-->
<!-- Subjects by Vocabulary-->
<!-- </div>-->
<!-- <ng-container *ngTemplateOutlet="subjects_by_vocabulary_template; context: {customClasses: (isMobile && viewAllClassifiedSubjects) ? '' : 'multi-line-ellipsis lines-2', id: 'content'}"></ng-container>-->
<!-- <ng-container *ngIf="eoscSubjects && eoscSubjects.length > 0"><ng-container *ngTemplateOutlet="eosc_subjects_template"></ng-container></ng-container>-->
<!-- <div *ngIf="isClassifiedLarge && !viewAllClassifiedSubjects" class="uk-text-right">-->
<!-- <a (click)="viewAllSubjectsByVocabularyClicked()" class="view-more-less-link">View all</a>-->
<!-- </div>-->
<!-- </ng-container>-->
<ng-container *ngIf="!viewAllClassifiedSubjects && ((subjects && subjects.length > 0) || (otherSubjects && otherSubjects.size > 0))">
<div *ngIf="!viewAllSubjects" class="uk-text-meta uk-margin-small-bottom"
[class.uk-margin-medium-top]="properties.environment == 'production' && ((classifiedSubjects && classifiedSubjects.size > 0) || (eoscSubjects && eoscSubjects.length > 0))">
<div *ngIf="!viewAllSubjects" class="uk-text-meta uk-margin-small-bottom">
Keywords
</div>
<ng-container *ngTemplateOutlet="subjects_template; context: {customClasses: (isMobile && viewAllSubjects) ? '' : 'multi-line-ellipsis lines-2', id: 'content'}"></ng-container>
@ -35,7 +34,7 @@ import {properties} from "../../../../environments/environment";
</div>
</ng-container>
<ng-container *ngIf="properties.environment != 'production' && !viewAllSubjects && ((eoscSubjects && eoscSubjects.length > 0))">
<ng-container *ngIf="!viewAllSubjects && ((eoscSubjects && eoscSubjects.length > 0))">
<div class="uk-text-meta uk-margin-small-bottom"
[class.uk-margin-medium-top]="(subjects && subjects.length > 0) || (otherSubjects && otherSubjects.size > 0)">
EOSC Subjects
@ -89,21 +88,21 @@ import {properties} from "../../../../environments/environment";
<ng-template #eosc_subjects_template let-customClasses="customClasses" let-id="id">
<div class="uk-flex-wrap uk-margin-medium-right"
[ngClass]="customClasses">
<p *ngIf="properties.environment == 'production'" class="uk-flex uk-flex-middle uk-margin-bottom">
<span #classifiedContent [id]="id+'_eosc'">
<span class="uk-margin-small-top uk-display-inline-block">
<span uk-icon="tag"></span>
<span class="uk-text-bold uk-margin-small-right"> EOSC: </span>
</span>
<span *ngFor="let subject of eoscSubjects; let j=index" class="uk-margin-small-top uk-width-auto uk-display-inline-block">
<span class="uk-border-rounded uk-label uk-label-small uk-label-primary uk-text-truncate uk-margin-small-right">
{{subject.value}}
</span>
</span>
</span>
</p>
<!-- <p *ngIf="properties.environment == 'production'" class="uk-flex uk-flex-middle uk-margin-bottom">-->
<!-- <span #classifiedContent [id]="id+'_eosc'">-->
<!-- <span class="uk-margin-small-top uk-display-inline-block">-->
<!-- <span uk-icon="tag"></span>-->
<!-- <span class="uk-text-bold uk-margin-small-right"> EOSC: </span>-->
<!-- </span>-->
<!-- <span *ngFor="let subject of eoscSubjects; let j=index" class="uk-margin-small-top uk-width-auto uk-display-inline-block">-->
<!-- <span class="uk-border-rounded uk-label uk-label-small uk-label-primary uk-text-truncate uk-margin-small-right">-->
<!-- {{subject.value}}-->
<!-- </span>-->
<!-- </span>-->
<!-- </span>-->
<!-- </p>-->
<p *ngIf="properties.environment != 'production' && eoscSubjects && eoscSubjects.length > 0">
<p *ngIf="eoscSubjects && eoscSubjects.length > 0">
<span #classifiedContent [id]="id+'_eosc'">{{getValue(eoscSubjects).join(', ')}}</span>
</p>
</div>

View File

@ -19,28 +19,30 @@ import {HelperFunctions} from "../../../utils/HelperFunctions.class";
template: `
<div id="versions_container">
<errorMessages [status]="[status]" [type]="type" tab_error_class=true></errorMessages>
<no-load-paging *ngIf="results.length > pageSize" [type]="type"
<no-load-paging *ngIf="resultsPreview.length > pageSize" [type]="type"
(pageChange)="updatePage($event)"
[page]="page" [pageSize]="pageSize"
[totalResults]="results.length">
[totalResults]="resultsPreview.length">
</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)"
<li *ngFor="let result of resultsPreview.slice((page-1)*pageSize, page*pageSize)">
<result-preview [modal]="modal" [properties]="properties" [hasLink]="false" [result]="result"
[isCard]="false" [prevPath]="prevPath" [isDeletedByInferenceModal]="true"></result-preview>
</li>
</ul>
<no-load-paging *ngIf="results.length > pageSize" [type]="type"
<no-load-paging *ngIf="resultsPreview.length > pageSize" [type]="type"
(pageChange)="updatePage($event)"
[page]="page" [pageSize]="pageSize"
[totalResults]="results.length">
[totalResults]="resultsPreview.length">
</no-load-paging>
</div>
`
})
export class OrganizationsDeletedByInferenceComponent {
@Input() prevPath: string = "";
public results: OrganizationInfo[] = [];
public resultsPreview: ResultPreview[] = [];
@Input() children = [];
@Input() id: string;
@Input() ids: string[] = [];
@Input() type: string;
@ -55,7 +57,7 @@ export class OrganizationsDeletedByInferenceComponent {
public errorCodes:ErrorCodes = new ErrorCodes();
subscriptions = [];
properties:EnvProperties;
properties:EnvProperties = properties;
constructor ( private element: ElementRef,
private _deletedByInferenceService: OrganizationsDeletedByInferenceService,
@ -63,14 +65,11 @@ export class OrganizationsDeletedByInferenceComponent {
}
ngOnInit() {
this.properties = properties;
this.subscriptions.push(this.route.queryParams.subscribe(data => {
this.errorCodes = new ErrorCodes();
this.status = this.errorCodes.LOADING;
this.getDeletedByInference();
this.parseDeletedByInference();
}));
}
@ -81,25 +80,36 @@ export class OrganizationsDeletedByInferenceComponent {
}
});
}
getDeletedByInference() {
this.results = [];
this.status = this.errorCodes.LOADING;
this.subscriptions.push(this._deletedByInferenceService.getDeletedByInferenceResults(this.id, String(this.ids.length), this.properties).subscribe(
data => {
this.results = data;
this.status = this.errorCodes.DONE;
},
error => {
if(error.status == '404') {
this.status = this.errorCodes.NOT_FOUND;
} else if(error.status == '500') {
this.status = this.errorCodes.ERROR;
public parseDeletedByInference() {
let length = Array.isArray(this.children) ? this.children.length : 1;
for (let i = 0; i < length; i++) {
let result = Array.isArray(this.children) ? this.children[i] : this.children;
let preview = new ResultPreview();
if(result.hasOwnProperty("websiteurl")) {
preview.websiteURL = result.websiteurl;
}
if(result.hasOwnProperty("legalshortname")) {
preview.title = result.legalshortname;
}
if(result.hasOwnProperty("legalname")) {
if(preview.title && preview.title != result.legalname) {
preview.title += "("+result.legalname+")";
} else {
this.status = this.errorCodes.NOT_AVAILABLE;
preview.title = result.legalname;
}
}
));
if(result.hasOwnProperty("country")) {
preview.countries = [result['country'].classname];
}
preview.resultType = 'organization';
this.resultsPreview.push(preview);
}
this.status = this.errorCodes.DONE;
}
public getResultPreview(result: OrganizationInfo): ResultPreview {

View File

@ -370,7 +370,8 @@
[id]="organizationInfo.objIdentifier"
[ids]="organizationInfo.deletedByInferenceIds"
[modal]="AlertModalDeletedByInference"
[type]="'organizations'" [prevPath]="prevPath">
[type]="'organizations'" [prevPath]="prevPath"
[children]="organizationInfo.children">
</organizationsDeletedByInference>
</modal-alert>
@ -484,7 +485,8 @@
<organizationsDeletedByInference *ngIf="deleteByInferenceOpened"
[id]="organizationInfo.objIdentifier"
[ids]="organizationInfo.deletedByInferenceIds"
[type]="'organizations'" [prevPath]="prevPath">
[type]="'organizations'" [prevPath]="prevPath"
[children]="organizationInfo.children">
</organizationsDeletedByInference>
</fs-modal>
<!-- Share -->

View File

@ -117,7 +117,7 @@ export class OrganizationComponent {
subscriptions = [];
innerReportSubscriptions = [];
properties: EnvProperties;
properties: EnvProperties = properties;
public openaireEntities = OpenaireEntities;
public indexUpdateDate: Date;
public showFeedback: boolean = false;
@ -167,7 +167,6 @@ export class OrganizationComponent {
this.isBottomIntersecting = isBottomIntersecting;
this.cdr.detectChanges();
}));
this.properties = properties;
if (typeof document !== 'undefined') {
this.subscriptions.push(this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
if (lastIndexUpdate) {

View File

@ -171,7 +171,7 @@ export class ProjectComponent {
subscriptions = [];
private sub: Subscription;
properties: EnvProperties;
properties: EnvProperties = properties;
public openaireEntities = OpenaireEntities;
public isMobile: boolean = false;
@ -214,7 +214,6 @@ export class ProjectComponent {
this.isBottomIntersecting = isBottomIntersecting;
this.cdr.detectChanges();
}));
this.properties = properties;
if (typeof document !== 'undefined') {
this.subscriptions.push(this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
if (lastIndexUpdate) {

View File

@ -8,33 +8,36 @@ import {RouterHelper} from '../../../utils/routerHelper.class';
import {ErrorCodes} from '../../../utils/properties/errorCodes';
import {DeletedByInferenceService} from './deletedByInference.service';
import {ResultPreview} from "../../../utils/result-preview/result-preview";
import {HostedByCollectedFrom, ResultPreview} from "../../../utils/result-preview/result-preview";
import {AlertModal} from "../../../utils/modal/alert";
import {Subscriber} from "rxjs";
import {properties} from "../../../../../environments/environment";
import {HelperFunctions} from "../../../utils/HelperFunctions.class";
import {Dates, StringUtils} from "../../../utils/string-utils.class";
import {ParsingFunctions} from "../../landing-utils/parsingFunctions.class";
@Component({
selector: 'deletedByInference',
template: `
<div id="versions_container">
<errorMessages [status]="[status]" [type]="type" tab_error_class=true></errorMessages>
<no-load-paging *ngIf="results.length > pageSize" [type]="type"
<no-load-paging *ngIf="resultsPreview.length > pageSize" [type]="type"
(pageChange)="updatePage($event)"
[page]="page" [pageSize]="pageSize"
[totalResults]="results.length">
[totalResults]="resultsPreview.length">
</no-load-paging>
<ul class="uk-list uk-margin">
<li *ngFor="let result of results.slice((page-1)*pageSize, page*pageSize)">
<result-preview [modal]="modal" [properties]="properties" [hasLink]="false" [result]="getResultPreview(result)"
<li *ngFor="let result of resultsPreview.slice((page-1)*pageSize, page*pageSize)">
<result-preview [modal]="modal" [properties]="properties" [hasLink]="false" [result]="result"
[showOrcid]="false" [prevPath]="prevPath" [showInline]="true"
[isDeletedByInferenceModal]="true" [isMobile]="isMobile"></result-preview>
</li>
</ul>
<no-load-paging *ngIf="results.length > pageSize" [type]="type"
<no-load-paging *ngIf="resultsPreview.length > pageSize" [type]="type"
(pageChange)="updatePage($event)"
[page]="page" [pageSize]="pageSize"
[totalResults]="results.length">
[totalResults]="resultsPreview.length">
</no-load-paging>
</div>
`
@ -42,7 +45,8 @@ import {HelperFunctions} from "../../../utils/HelperFunctions.class";
export class DeletedByInferenceComponent {
@Input() isMobile: boolean = false;
@Input() prevPath: string = "";
public results: ResultLandingInfo[] = [];
public resultsPreview: ResultPreview[] = [];
@Input() children = [];
@Input() id: string;
@Input() ids: string[] = [];
@Input() type: string;
@ -58,7 +62,7 @@ export class DeletedByInferenceComponent {
public errorCodes: ErrorCodes = new ErrorCodes();
subscriptions = [];
properties: EnvProperties;
properties: EnvProperties = properties;
constructor(private element: ElementRef,
private _deletedByInferenceService: DeletedByInferenceService,
@ -66,15 +70,11 @@ export class DeletedByInferenceComponent {
}
ngOnInit() {
this.properties = properties;
this.subscriptions.push(this.route.queryParams.subscribe(data => {
this.errorCodes = new ErrorCodes();
this.status = this.errorCodes.LOADING;
this.getDeletedByInference();
this.parseDeletedByInference();
}));
}
@ -86,24 +86,88 @@ export class DeletedByInferenceComponent {
});
}
getDeletedByInference() {
this.results = [];
this.status = this.errorCodes.LOADING;
this.subscriptions.push(this._deletedByInferenceService.getDeletedByInferenceResults(this.id, String(this.ids.length), this.properties).subscribe(
data => {
this.results = data;
this.status = this.errorCodes.DONE;
},
error => {
if (error.status == '404') {
this.status = this.errorCodes.NOT_FOUND;
} else if (error.status == '500') {
this.status = this.errorCodes.ERROR;
public parseDeletedByInference() {
let parsingFunctions: ParsingFunctions = new ParsingFunctions();
let length = Array.isArray(this.children) ? this.children.length : 1;
for (let i = 0; i < length; i++) {
let result = Array.isArray(this.children) ? this.children[i] : this.children;
let preview = new ResultPreview();
if(result.hasOwnProperty("creator")) {
preview.authors = [];
let authorsLength = Array.isArray(result.creator) ? result.creator.length : 1;
for (let j = 0; j < authorsLength; j++) {
let author = {"fullName": Array.isArray(result.creator) ? result.creator[j] : result.creator, "orcid": null, "orcid_pending": null};
preview.authors.push(author);
}
}
if(result.hasOwnProperty("dateofacceptance")) {
preview.year = new Date(result.dateofacceptance).getFullYear().toString();
}
if(result.hasOwnProperty("title")) {
let titleLength = Array.isArray(result.title) ? result.title.length : 1;
for (let j = 0; j < titleLength; j++) {
let title = Array.isArray(result.title) ? result.title[j] : result.title;
if (!preview.title || title.classid == "main title") {
preview.title = StringUtils.HTMLToString(String(title.content));
}
}
}
if(result.hasOwnProperty("description")) {
preview.description = result.description;
}
preview.resultType = result?.resulttype?.classid ? result.resulttype.classid : this.resultType;
if (result.hasOwnProperty("instance")) {
preview.hostedBy_collectedFrom = new Array<HostedByCollectedFrom>();
preview.types = new Array<string>();
let types = new Set<string>();
let counter = 0;
let instance;
let instanesLength = Array.isArray(result['instance']) ? result['instance'].length : 1;
for (let j = 0; j < instanesLength; j++) {
instance = Array.isArray(result['instance']) ? result['instance'][j] : result['instance'];
if(result.hasOwnProperty('collectedfrom')) {
if(Array.isArray(result['collectedfrom'])) {
// not sure if this is correct mapping
instance['collectedfrom'] = result['collectedfrom'].length >= j ? result['collectedfrom'][j] : result['collectedfrom'][result['collectedfrom'].length - 1];
} else {
this.status = this.errorCodes.NOT_AVAILABLE;
instance['collectedfrom'] = result['collectedfrom'];
}
}
));
parsingFunctions.parseTypes(preview.types, types, instance);
if (instance.hasOwnProperty("webresource")) {
let url;
if (!Array.isArray(instance['webresource'])) {
url = instance['webresource'].url;
} else {
url = instance['webresource'][0].url;
}
if (url.includes('&amp;')) {
url = url.replace(/&amp;/gmu, '&');
}
/**********************************************************/
if (instance.hasOwnProperty("hostedby")) {
parsingFunctions.parseHostedBy_collectedFrom(preview.hostedBy_collectedFrom, instance, url, null);
}
/**********************************************************/
}
}
// /* Order Download from via openness*/
preview.hostedBy_collectedFrom.sort(parsingFunctions.compareHostedByCollectedFrom);
}
this.resultsPreview.push(preview);
}
this.status = this.errorCodes.DONE;
}
public getResultPreview(result: ResultLandingInfo): ResultPreview {

View File

@ -153,6 +153,10 @@
[tabTitle]="'Related research'" [tabId]="'all_related'"
[tabNumber]="resultLandingInfo.relatedResults.length">
</my-tab>
<my-tab *ngIf="resultLandingInfo.relatedServices?.length > 0"
[tabTitle]="openaireEntities.DATASOURCES" [tabId]="'dataProviders'"
[tabNumber]="resultLandingInfo.relatedServices.length">
</my-tab>
<my-tab *ngIf="resultLandingInfo.bioentities && bioentitiesNum> 0"
[tabTitle]="'External Databases'" [tabId]="'bioentities'" [tabNumber]="bioentitiesNum">
</my-tab>
@ -179,9 +183,13 @@
</ng-container>
<ng-container *ngIf="resultLandingInfo.relatedResults?.length > 0">
<div id="all_related" class="landing-section">
<ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: filteredRelatedResults, header: ''}"></ng-container>
<ng-container *ngTemplateOutlet="relation_in_tab; context: { related: filteredRelatedResults, props: relatedResults, header: ''}"></ng-container>
</div>
</ng-container>
<div *ngIf="resultLandingInfo.relatedServices?.length > 0"
id="dataProviders" class="landing-section">
<ng-container *ngTemplateOutlet="relation_in_tab; context: { related: filteredRelatedServices, props: relatedServices, type: 'datasource', header: ''}"></ng-container>
</div>
<ng-container *ngIf="resultLandingInfo.bioentities && bioentitiesNum> 0">
<div id="bioentities" class="landing-section">
<ng-container *ngTemplateOutlet="bioentities_content"></ng-container>
@ -457,6 +465,14 @@
</div>
<hr>
</ng-container>
<ng-container *ngIf="resultLandingInfo.relatedServices?.length > 0">
<div class="clickable uk-flex uk-flex-middle uk-flex-between"
(click)="openFsModal(servicesFsModal, openaireEntities.DATASOURCES); onSelectActiveTab('dataProviders')">
<span>{{openaireEntities.DATASOURCES}}</span>
<icon name="chevron_right" [ratio]="1.5" [flex]="true"></icon>
</div>
<hr>
</ng-container>
<ng-container *ngIf="resultLandingInfo.bioentities && bioentitiesNum> 0">
<div class="clickable uk-flex uk-flex-middle uk-flex-between" (click)="openFsModal(bioentitiesFsModal, 'External Databases'); onSelectActiveTab('bioentities')">
<span>External Databases</span>
@ -638,7 +654,15 @@
<fs-modal #relatedResearchFsModal classTitle="uk-tile-default uk-border-bottom"
*ngIf="resultLandingInfo.relatedResults?.length > 0">
<div class="landing-section">
<ng-container *ngTemplateOutlet="relation_in_tab; context: { researchResults: filteredRelatedResults, header: ''}"></ng-container>
<ng-container *ngTemplateOutlet="relation_in_tab; context: { related: filteredRelatedResults, props: relatedResults, header: ''}"></ng-container>
</div>
</fs-modal>
<fs-modal *ngIf="isMobile" #servicesFsModal classTitle="uk-tile-default uk-border-bottom">
<div *ngIf="activeTab == 'dataProviders' && resultLandingInfo.relatedServices?.length > 0"
class="landing-section">
<ng-container *ngTemplateOutlet="relation_in_tab; context: { related: filteredRelatedServices, props: relatedServices, type: 'datasource', header: ''}"></ng-container>
</div>
</fs-modal>
@ -700,22 +724,26 @@
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds"
[modal]="AlertModalDeletedByInference"
[resultType]="type" [type]="openaireEntities.PUBLICATIONS" [prevPath]="prevPath"></deletedByInference>
[resultType]="type" [type]="openaireEntities.PUBLICATIONS" [prevPath]="prevPath"
[children]="resultLandingInfo.children"></deletedByInference>
<deletedByInference *ngIf="type == 'dataset' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds"
[modal]="AlertModalDeletedByInference"
[resultType]="'dataset'" [type]="openaireEntities.DATASETS" [prevPath]="prevPath"></deletedByInference>
[resultType]="'dataset'" [type]="openaireEntities.DATASETS" [prevPath]="prevPath"
[children]="resultLandingInfo.children"></deletedByInference>
<deletedByInference *ngIf="type == 'software' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds"
[modal]="AlertModalDeletedByInference"
[resultType]="type" [type]="openaireEntities.SOFTWARE" [prevPath]="prevPath"></deletedByInference>
[resultType]="type" [type]="openaireEntities.SOFTWARE" [prevPath]="prevPath"
[children]="resultLandingInfo.children"></deletedByInference>
<deletedByInference *ngIf="type == 'orp' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds"
[modal]="AlertModalDeletedByInference"
[resultType]="'other'" [type]="openaireEntities.OTHER" [prevPath]="prevPath"></deletedByInference>
[resultType]="'other'" [type]="openaireEntities.OTHER" [prevPath]="prevPath"
[children]="resultLandingInfo.children"></deletedByInference>
</modal-alert>
<modal-alert *ngIf="resultLandingInfo" #citeModal>
<citeThis *ngIf="citeThisClicked" [result]="resultLandingInfo" [id]="id"
@ -763,34 +791,32 @@
</ul>
</ng-template>
<ng-template #relation_in_tab let-researchResults="researchResults" let-header="header">
<div
*ngIf="researchResults && researchResults.length > 0"
class="uk-margin-bottom">
<ng-template #relation_in_tab let-related="related" let-props="props" let-type="type" let-header="header">
<div *ngIf="related && related.length > 0" class="uk-margin-bottom">
<h6 *ngIf="header">{{header}}</h6>
<div *ngIf="relatedClassFilters?.length > 1" class="uk-margin-medium-bottom"
<div *ngIf="props.classFilters?.length > 1" class="uk-margin-medium-bottom"
input type="select" placeholder="Filter by relation" inputClass="flat x-small"
[options]="relatedClassFilters" [(value)]="relatedClassSelected"
(valueChange)="relatedClassChanged()"></div>
[options]="props.classFilters" [(value)]="props.selectedClass"
(valueChange)="relatedClassChanged(type)"></div>
<results-and-pages
[type]="openaireEntities.RESULTS"
[page]="relatedPage" [pageSize]="pageSize"
[totalResults]="researchResults.length">
[type]="((type == 'datasource') ? openaireEntities.DATASOURCES : openaireEntities.RESULTS)"
[page]="props.page" [pageSize]="pageSize"
[totalResults]="related.length">
</results-and-pages>
<ul class="uk-list uk-list-divider uk-margin">
<li *ngFor="let item of researchResults.slice((relatedPage-1)*pageSize, relatedPage*pageSize)">
<li *ngFor="let item of related.slice((props.page-1)*pageSize, props.page*pageSize)">
<result-preview [properties]="properties"
[result]="getResultPreview(item)" [provenanceActionVocabulary]="provenanceActionVocabulary"
[result]="getResultPreview(item, type)" [provenanceActionVocabulary]="provenanceActionVocabulary"
[relationsVocabulary]="relationsVocabulary"
[isCard]="false" [prevPath]="prevPath"></result-preview>
</li>
</ul>
<paging-no-load *ngIf="researchResults.length > pageSize"
<paging-no-load *ngIf="related.length > pageSize"
class="uk-margin-top"
(pageChange)="updateRelatedPage($event)"
[currentPage]="relatedPage" [size]="pageSize"
[totalResults]="researchResults.length">
(pageChange)="updateRelatedPage($event, type)"
[currentPage]="props.page" [size]="pageSize"
[totalResults]="related.length">
</paging-no-load>
</div>
</ng-template>
@ -1130,7 +1156,7 @@
</div>
</ng-container>
</div>
<div *ngIf="resultLandingInfo.measure.countsPerDatasource" class="uk-margin-medium-top uk-width-auto">
<div *ngIf="properties.environment != 'production' && resultLandingInfo.measure.countsPerDatasource" class="uk-margin-medium-top uk-width-auto">
<table class="uk-table uk-table-striped">
<thead>
<tr>
@ -1173,25 +1199,29 @@
[ids]="resultLandingInfo.deletedByInferenceIds"
[resultType]="type" [type]="openaireEntities.PUBLICATIONS"
[isMobile]="isMobile"
[modal]="alertModalDeletedByInferenceFS"></deletedByInference>
[modal]="alertModalDeletedByInferenceFS"
[children]="resultLandingInfo.children"></deletedByInference>
<deletedByInference *ngIf="type == 'dataset' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds"
[resultType]="'dataset'" [type]="openaireEntities.DATASETS"
[isMobile]="isMobile"
[modal]="alertModalDeletedByInferenceFS"></deletedByInference>
[modal]="alertModalDeletedByInferenceFS"
[children]="resultLandingInfo.children"></deletedByInference>
<deletedByInference *ngIf="type == 'software' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds"
[resultType]="type" [type]="openaireEntities.SOFTWARE"
[isMobile]="isMobile"
[modal]="alertModalDeletedByInferenceFS"></deletedByInference>
[modal]="alertModalDeletedByInferenceFS"
[children]="resultLandingInfo.children"></deletedByInference>
<deletedByInference *ngIf="type == 'orp' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds"
[resultType]="'other'" [type]="openaireEntities.OTHER"
[isMobile]="isMobile"
[modal]="alertModalDeletedByInferenceFS"></deletedByInference>
[modal]="alertModalDeletedByInferenceFS"
[children]="resultLandingInfo.children"></deletedByInference>
</fs-modal>
<fs-modal *ngIf="resultLandingInfo" #citeFsModal classTitle="uk-tile-default uk-border-bottom">

View File

@ -13,7 +13,7 @@ import {HelperFunctions} from '../../utils/HelperFunctions.class';
import {HelperService} from '../../utils/helper/helper.service';
import {Location} from "@angular/common";
import {MetricsService} from "../../services/metrics.service";
import {RelationResult, ResultPreview} from "../../utils/result-preview/result-preview";
import {RelationDatasource, RelationResult, ResultPreview} from "../../utils/result-preview/result-preview";
import {IndexInfoService} from "../../utils/indexInfo.service";
import {Identifier, StringUtils} from "../../utils/string-utils.class";
import {properties} from "../../../../environments/environment";
@ -95,12 +95,7 @@ export class ResultLandingComponent {
// Custom tab paging variables
public referencesPage: number = 1;
public bioentitiesPage: number = 1;
public relatedPage: number = 1;
public similarPage: number = 1;
public supplementaryPage: number = 1;
public supplementedByPage: number = 1;
public organizationsPage: number = 1;
public openCitationsPage: number = 1;
public pageSize: number = 10;
// Map counting variables
@ -139,9 +134,28 @@ export class ResultLandingComponent {
public pid: string;
public contextsWithLink: any;
public relatedClassFilters: Option[]=[{"label": "All relations", "value": ""}];
public relatedClassSelected: string = "";
public filteredRelatedResults: RelationResult[];
public relatedResults: {
classFilters: Option[],
selectedClass: string,
page: number
} = {
classFilters: [{"label": "All relations", "value": ""}],
selectedClass: "",
page: 1,
};
filteredRelatedResults: RelationResult[];
public relatedServices: {
classFilters: Option[],
selectedClass: string,
page: number
} = {
classFilters: [{"label": "All relations", "value": ""}],
selectedClass: "",
page: 1
}
filteredRelatedServices: RelationDatasource[];
public provenanceActionVocabulary = null;
public relationsVocabulary = null;
@ -168,6 +182,7 @@ export class ResultLandingComponent {
@ViewChild('subjectsFsModal') subjectsFsModal: FullScreenModalComponent;
@ViewChild('referencesFsModal') referencesFsModal: FullScreenModalComponent;
@ViewChild('relatedResearchFsModal') relatedResearchFsModal: FullScreenModalComponent;
@ViewChild('servicesFsModal') servicesFsModal: FullScreenModalComponent;
@ViewChild('bioentitiesFsModal') bioentitiesFsModal: FullScreenModalComponent;
@ViewChild('compatibleEOSCFsModal') compatibleEOSCFsModal: FullScreenModalComponent;
@ViewChild('fundedByFsModal') fundedByFsModal: FullScreenModalComponent;
@ -558,20 +573,34 @@ export class ResultLandingComponent {
}
}
}
this.relatedClassFilters = [{"label": "All relations", "value": ""}];
this.relatedResults.classFilters = [{"label": "All relations", "value": ""}];
if (this.resultLandingInfo.relatedClassFilters.size > 1) {
for (let relClass of this.resultLandingInfo.relatedClassFilters) {
this.relatedClassFilters.push({
this.relatedResults.classFilters.push({
"label": HelperFunctions.getVocabularyLabel(relClass, this.relationsVocabulary),
"value": relClass
});
}
} else {
this.relatedClassFilters.pop();
this.relatedResults.classFilters.pop();
}
this.relatedClassSelected = "";
this.relatedResults.selectedClass = "";
this.filteredRelatedResults = this.resultLandingInfo.relatedResults;
this.relatedServices.classFilters = [{"label": "All relations", "value": ""}];
if (this.resultLandingInfo.relatedServicesClassFilters.size > 1) {
for (let relClass of this.resultLandingInfo.relatedServicesClassFilters) {
this.relatedServices.classFilters.push({
"label": HelperFunctions.getVocabularyLabel(relClass, this.relationsVocabulary),
"value": relClass
});
}
} else {
this.relatedServices.classFilters.pop();
}
this.relatedServices.selectedClass = "";
this.filteredRelatedServices = this.resultLandingInfo.relatedServices
this.hasViews = false;
this.hasDownloads = false;
if (this.resultLandingInfo.measure && this.resultLandingInfo.measure.counts) {
@ -711,25 +740,14 @@ export class ResultLandingComponent {
this.scrollToTabTop('bioentities');
}
public updateRelatedPage($event) {
this.relatedPage = $event.value;
public updateRelatedPage($event, type) {
if(type == "datasource") {
this.relatedServices.page = $event.value;
this.scrollToTabTop("dataProviders");
} else {
this.relatedResults.page = $event.value;
this.scrollToTabTop('all_related');
}
public updateSimilarPage($event) {
this.similarPage = $event.value;
}
public updateSupplementaryPage($event) {
this.supplementaryPage = $event.value;
}
public updateSupplementedByPage($event) {
this.supplementedByPage = $event.value;
}
public updateOrganizationsPage($event) {
this.organizationsPage = $event.value;
}
scrollToTabTop(tabId:string){
@ -788,8 +806,11 @@ export class ResultLandingComponent {
this.alertModalDeletedByInference.open();
}
public getResultPreview(result: RelationResult): ResultPreview {
return ResultPreview.relationResultConvert(result);
public getResultPreview(result: RelationResult|RelationDatasource, type: string): ResultPreview {
if(type == "datasource") {
return ResultPreview.relationDatasourceConvert(<RelationDatasource>result);
}
return ResultPreview.relationResultConvert(<RelationResult>result);
}
updateUrlWithType(pid) {
@ -983,9 +1004,14 @@ export class ResultLandingComponent {
this.contextsWithLink = contextsWithLink;
}
public relatedClassChanged() {
this.relatedPage = 1;
this.filteredRelatedResults = this.resultLandingInfo.relatedResults.filter(result => !this.relatedClassSelected || result.relationName.toLowerCase() == this.relatedClassSelected.toLowerCase());
public relatedClassChanged(type) {
if(type == "datasource") {
this.relatedServices.page = 1;
this.filteredRelatedServices = this.resultLandingInfo.relatedServices.filter(result => !this.relatedServices.selectedClass || result.relationName.toLowerCase() == this.relatedServices.selectedClass.toLowerCase());
} else {
this.relatedResults.page = 1;
this.filteredRelatedResults = this.resultLandingInfo.relatedResults.filter(result => !this.relatedResults.selectedClass || result.relationName.toLowerCase() == this.relatedResults.selectedClass.toLowerCase());
}
}
public viewAllOrganizationsClick() {

View File

@ -210,6 +210,19 @@ export class ResultLandingService {
this.resultLandingInfo.relatedResults = this.parsingFunctions.parseResults(this.resultLandingInfo.relatedResults, relation, provenanceAction, relationName);
} else if (relation['to'].class && relation['to'].class.toLowerCase() == "hasauthorinstitution") {
this.resultLandingInfo.organizations = this.parseRelatedOrganizations(this.resultLandingInfo.organizations, relation);
} else if (relation['to'].scheme && relation['to'].scheme == "dnet:result_datasource_relations") {
let relationName: string = relation.to.class;
if (!this.resultLandingInfo.relatedServicesClassFilters.has(relationName)) {
this.resultLandingInfo.relatedServicesClassFilters.add(relationName);
}
let provenanceAction: string = relation.provenanceaction;
// this.resultLandingInfo.relatedResults = this.parsingFunctions.parseResults(this.resultLandingInfo.relatedResults, relation, provenanceAction, relationName);
if (this.resultLandingInfo.relatedServices == undefined) {
this.resultLandingInfo.relatedServices = [];
}
this.resultLandingInfo.relatedServices = this.parsingFunctions.parseDatasources(this.resultLandingInfo.relatedServices, relation, provenanceAction, relationName);
}
}
}
@ -225,6 +238,7 @@ export class ResultLandingService {
let result = Array.isArray(data[3]['result']) ? data[3]['result'][i] : data[3]['result'];
this.resultLandingInfo.deletedByInferenceIds.push(result.objidentifier);
}
this.resultLandingInfo.children = data[3]['result'];
}

View File

@ -1324,7 +1324,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
}
if (chart.type == "chart") {
indicatorPaths = chart.indicatorPaths.map(path => this.indicatorUtils.generateIndicatorByChartUrl(this.indicatorUtils.getChartSource(path.url), path.url, chart.type, stakeholder));
indicatorPaths = chart.indicatorPaths.map(path => this.indicatorUtils.generateIndicatorByChartUrl(this.indicatorUtils.getChartSource(path.url), path.url, chart.type, stakeholder, path.tab));
this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.index].charts.forEach((section: Section) => {
section.indicators.forEach(indicator => {
indicator.indicatorPaths.forEach(path => {
@ -1391,6 +1391,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
"indicatorPaths": indicator.indicatorPaths.map(path => {
return {
jsonPath: path.jsonPath,
tab: path.parameters.tab ? path.parameters.tab : path.parameters.title,
url: this.indicatorUtils.getNumberUrl(path.source, this.indicatorUtils.getFullUrl(this.stakeholder, path))
}
}),
@ -1411,6 +1412,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
indicators[indexIndicator] = {
"indicatorPaths": indicator.indicatorPaths.map(path => {
return {
tab: path.parameters.tab ? path.parameters.tab : path.parameters.title,
url: this.getUrlByStakeHolder(path)
}
}),

View File

@ -680,7 +680,7 @@ export class IndicatorUtils {
return indicatorPath;
}
generateIndicatorByChartUrl(source: SourceType, url: string, type: IndicatorPathType = null, stakeholder: Stakeholder): IndicatorPath {
generateIndicatorByChartUrl(source: SourceType, url: string, type: IndicatorPathType = null, stakeholder: Stakeholder, tab: string = null): IndicatorPath {
let indicatorPath = new IndicatorPath(type, source, null, null, []);
try {
if (source === 'stats-tool') {
@ -734,6 +734,9 @@ export class IndicatorUtils {
if (indicatorPath.type == null) {
indicatorPath.type = this.defaultChartType;
}
if(tab) {
indicatorPath.parameters.tab = tab;
}
return indicatorPath;
}
@ -769,45 +772,6 @@ export class IndicatorUtils {
}
private extractStakeHolders(obj, stakeholder: Stakeholder) {
this.extractFunder(obj, stakeholder);
this.extractRI(obj, stakeholder);
this.extractOrganization(obj, stakeholder);
this.extractDatasource(obj, stakeholder);
this.extractResearcher(obj, stakeholder);
this.extractPublisher(obj, stakeholder);
}
private extractFunder(obj, stakeholder: Stakeholder) {
if (stakeholder.type != 'funder') {
return;
}
for (let query of this.getQueryObjectName(obj) ? obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)] : obj[this.getDescriptionObjectName(obj)]) {
if (query["query"]["profile"]) {
query["query"]["profile"] = ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix;
}
if (!query["query"]["filters"]) {
return;
}
for (let filter of query["query"]["filters"]) {
for (let gfilter of filter["groupFilters"]) {
//ignore field No Of Funders
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder);
if (replacedValue) { // don't proceed in replacement if no replaced value matches
if ((gfilter["field"].indexOf(" funder") != -1 && gfilter["field"].indexOf(" funders") == -1) ||
(gfilter["field"].indexOf(".funder") != -1) ||
(gfilter["field"].indexOf(".funder.id") != -1)) {
gfilter["values"][0] = replacedValue;
}
}
}
}
}
}
private extractRI(obj, stakeholder: Stakeholder) {
if (stakeholder.type != 'ri') {
return;
}
for (let query of this.getQueryObjectName(obj) ? obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)] : obj[this.getDescriptionObjectName(obj)]) {
if (query["query"]["profile"]) {
query["query"]["profile"] = ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix;
@ -819,121 +783,12 @@ export class IndicatorUtils {
for (let gfilter of filter["groupFilters"]) {
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder);
if (replacedValue) { // don't proceed in replacement if no replaced value matches
if ((gfilter["field"].indexOf(".context.name") != -1)
|| (gfilter["field"].indexOf(".context.id") != -1)) {
gfilter["values"][0] = replacedValue;
}
}
}
}
}
}
private extractOrganization(obj, stakeholder: Stakeholder) {
// works for publication.project.organization.name
// and publication.organization.name
if (stakeholder.type != 'organization') {
return;
}
for (let query of this.getQueryObjectName(obj) ? obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)] : obj[this.getDescriptionObjectName(obj)]) {
if (query["query"]["profile"]) {
query["query"]["profile"] = ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix;
}
if (!query["query"]["filters"]) {
return;
}
for (let filter of query["query"]["filters"]) {
for (let gfilter of filter["groupFilters"]) {
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder);
if (replacedValue) { // don't proceed in replacement if no replaced value matches
if ((gfilter["field"].indexOf(".organization.name") != -1) ||
(gfilter["field"].indexOf(".organization.id") != -1)) {
gfilter["values"][0] = replacedValue;
}
}
}
}
}
}
private extractPublisher(obj, stakeholder: Stakeholder) {
// works for .publisher
if (stakeholder.type != 'publisher') {
return;
}
for (let query of this.getQueryObjectName(obj) ? obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)] : obj[this.getDescriptionObjectName(obj)]) {
if (query["query"]["profile"]) {
query["query"]["profile"] = ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix;
}
if (!query["query"]["filters"]) {
return;
}
for (let filter of query["query"]["filters"]) {
for (let gfilter of filter["groupFilters"]) {
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder);
console.log(replacedValue)
if (replacedValue) { // don't proceed in replacement if no replaced value matches
if (gfilter["field"].indexOf(".publisher") != -1) {
console.log(gfilter["values"][0])
gfilter["values"][0] = replacedValue;
}
}
}
}
}
}
private extractDatasource(obj, stakeholder: Stakeholder) {
// works for .datasource.name and .HostedBy datasource
// and .datasource.id
if (stakeholder.type != 'datasource' && stakeholder.type != 'journal') {
return;
}
for (let query of this.getQueryObjectName(obj) ? obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)] : obj[this.getDescriptionObjectName(obj)]) {
if (query["query"]["profile"]) {
query["query"]["profile"] = ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix;
}
if (!query["query"]["filters"]) {
return;
}
for (let filter of query["query"]["filters"]) {
for (let gfilter of filter["groupFilters"]) {
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder);
if (replacedValue) { // don't proceed in replacement if no replaced value matches
if ((gfilter["field"].indexOf(".datasource.name") != -1 || gfilter["field"].indexOf(".HostedBy datasource") != -1) ||
(gfilter["field"].indexOf(".datasource.id") != -1) || (gfilter["field"].indexOf(".hostedby") != -1)) {
gfilter["values"][0] = replacedValue;
}
}
}
}
}
}
private extractResearcher(obj, stakeholder: Stakeholder) {
// works for .orcid
if (stakeholder.type != "researcher") {
return;
}
for (let query of this.getQueryObjectName(obj) ? obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)] : obj[this.getDescriptionObjectName(obj)]) {
if (query["query"]["profile"]) {
query["query"]["profile"] = ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix;
}
if (!query["query"]["filters"]) {
return;
}
for (let filter of query["query"]["filters"]) {
for (let gfilter of filter["groupFilters"]) {
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder);
if (replacedValue) { // don't proceed in replacement if no replaced value matches
if ((gfilter["field"].indexOf(".orcid") != -1)) {
gfilter["values"][0] = replacedValue;
}
}
}
}
}
}
private replaceIndexValues(currentValue, stakeholder) {
if (currentValue == stakeholder.index_name) {

View File

@ -121,7 +121,7 @@ export class MyOrcidLinksComponent {
public oldTotalResults: number = 0;
pagingLimit = 0;
properties:EnvProperties;
properties:EnvProperties = properties;
public openaireEntities = OpenaireEntities;
public lastOrcidUpdateDate: string = "";
@ -183,7 +183,6 @@ export class MyOrcidLinksComponent {
}
public ngOnInit() {
this.properties = properties;
this.baseUrl = this.properties.myOrcidLinksPage;
this.pagingLimit = this.properties.pagingLimit;
var description = "Openaire, ORCID linking, publication, research data, software, other research product";

View File

@ -21,7 +21,7 @@ export class searcMyOrcidResultsComponent {
@Input() results: SearchResult[];
@Input() status: number;
@Input() type: string;
@Input() properties:EnvProperties;
@Input() properties:EnvProperties = properties;
public openaireEntities = OpenaireEntities;
@Input() previewResults:{"work":{},results:ResultPreview[]}[];
@ -57,9 +57,6 @@ export class searcMyOrcidResultsComponent {
this.linkToAdvancedSearchPage = this.properties.searchLinkToAdvancedOrps;
this.urlParam = "orpId";
}
this.properties = properties;
}

View File

@ -95,7 +95,7 @@ export class OrcidComponent {
window.close();
}
setTimeout(() => {
this.message += "<div class='uk-margin-top'>If this widnow does not close authomatically, please close it and continue!</div>";
this.message += "<div class='uk-margin-top'>If this window does not close automatically, please close it and continue!</div>";
}, 3000);
} else {
this.message = "<div>Thank you for connecting your ORCID iD with OpenAIRE!</div>" +

View File

@ -77,7 +77,7 @@ export class SearchRecommendedResultsForOrcidComponent {
public oldTotalResults: number = 0;
pagingLimit = 0;
properties:EnvProperties;
properties:EnvProperties = properties;
@Input() public communityId: string = null;
@ -100,7 +100,6 @@ export class SearchRecommendedResultsForOrcidComponent {
}
public ngOnInit() {
this.properties = properties;
this.depositLearnHowPage = this.properties.depositLearnHowPage;
this.baseUrl = this.properties.depositSearchPage;
this.pagingLimit = this.properties.pagingLimit;

View File

@ -17,7 +17,7 @@ export class SearchResultsForOrcidComponent {
@Input() results: SearchResult[];
@Input() status: number;
@Input() type: string;
@Input() properties:EnvProperties;
@Input() properties:EnvProperties = properties;
public urlParam: string;
@ -56,9 +56,6 @@ export class SearchResultsForOrcidComponent {
this.linkToAdvancedSearchPage = this.properties.searchLinkToAdvancedDataProviders;
this.urlParam = "datasourceId";
}
this.properties = properties;
}
public quote(params: string):string {

View File

@ -206,7 +206,7 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
this.error = null;
if(this.service === "irish" || this.service === "monitor") {
this.loading = false;
this.userManagementService.login(properties.domain + '/admin/' + this.verification.entity);
this.userManagementService.login(properties.domain + properties.baseLink + '/admin/' + this.verification.entity);
} else {
this.subscriptions.push(this.emailService.notifyManagers(this.id, 'manager',
Composer.composeEmailToInformOldManagersForTheNewOnes(this.name, this.id)).subscribe(() => {

View File

@ -85,7 +85,7 @@ export class SearchAllComponent {
showServices: boolean = false;
showOrganizations: boolean = false;
advancedSearchLink: string = properties.searchLinkToAdvancedResults;
properties: EnvProperties;
properties: EnvProperties = properties;
offset: number;
public openaireEntities = OpenaireEntities;
@Input() logoURL;
@ -154,7 +154,6 @@ export class SearchAllComponent {
var description = "Search for "+OpenaireEntities.RESULTS+" ("+OpenaireEntities.PUBLICATIONS+", "+OpenaireEntities.DATASETS+", "+OpenaireEntities.SOFTWARE+", "+OpenaireEntities.OTHER+"), "+OpenaireEntities.PROJECTS+", "+OpenaireEntities.ORGANIZATIONS+", "+OpenaireEntities.DATASOURCES+" in the OpenAIRE Graph. ";
var title = "OpenAIRE |Search for "+OpenaireEntities.RESULTS+", "+OpenaireEntities.PROJECTS+", "+OpenaireEntities.DATASOURCES+" & "+OpenaireEntities.ORGANIZATIONS;
this.properties = properties;
var url = this.properties.domain + this.properties.baseLink + this._router.url;
this._title.setTitle(title);
this._meta.updateTag({content: description}, "name='description'");

View File

@ -44,8 +44,8 @@ import {zip} from "rxjs";
[showResultCount]="true" [showIndexInfo]="type!='deposit'"
[tableViewLink]="tableViewLink"
[sort]="false" [showBreadcrumb]="showBreadcrumb" [basicMetaDescription]="metaDescription"
(filterRequestAll)="filterRequestedAll($event)">
(filterRequestAll)="filterRequestedAll($event)"
[hasCompactView]="true">
</new-search-page>
`
@ -80,7 +80,7 @@ export class SearchDataProvidersComponent {
public loadPaging: boolean = true;
public oldTotalResults: number = 0;
public pagingLimit: number = 0;
properties:EnvProperties;
properties:EnvProperties = properties;
public openaireEntities = OpenaireEntities;
@Input() type: "all" | "registries" | "journals" | "compatible" | "deposit" | "services" = "all";
@Input() entityType: "dataprovider" | "service" = "dataprovider";
@ -130,7 +130,6 @@ export class SearchDataProvidersComponent {
if(this.showSwitchSearchLink == null){
this.showSwitchSearchLink = (this.type == "all" || this.type == "services");
}
this.properties= properties;
this.csvPath = this.entityType == "service" ? OpenaireEntities.SERVICES_FILE : OpenaireEntities.DATASOURCES_FILE;
if (!this.simpleSearchLink) {
this.simpleSearchLink = this.entityType == "service" ? this.properties.searchLinkToServices : this.properties.searchLinkToDataProviders;

View File

@ -39,7 +39,8 @@ import {zip} from "rxjs";
[simpleView]="simpleView" formPlaceholderText="Search by organization name..."
[showSwitchSearchLink]="showSwitchSearchLink"
[showBreadcrumb]="showBreadcrumb"
(filterRequestAll)="filterRequestedAll($event)">
(filterRequestAll)="filterRequestedAll($event)"
[hasCompactView]="true">
</new-search-page>
`
})
@ -47,7 +48,7 @@ import {zip} from "rxjs";
export class SearchOrganizationsComponent {
private errorCodes: ErrorCodes;
private errorMessages: ErrorMessagesComponent;
properties:EnvProperties;
properties:EnvProperties = properties;
public openaireEntities = OpenaireEntities;
@Input() searchForm: SearchForm = {class: 'search-form', dark: true};
public results =[];
@ -103,7 +104,6 @@ export class SearchOrganizationsComponent {
}
ngOnInit() {
this.properties= properties;
if (!this.simpleSearchLink) {
this.simpleSearchLink = this.properties.searchLinkToOrganizations;
}

View File

@ -38,7 +38,8 @@ import {zip} from "rxjs";
[simpleView]="simpleView" formPlaceholderText="Search by title, acronym, project code..."
[showSwitchSearchLink]="showSwitchSearchLink"
[sort]="false" [showBreadcrumb]="showBreadcrumb"
(filterRequestAll)="filterRequestedAll($event)">
(filterRequestAll)="filterRequestedAll($event)"
[hasCompactView]="true">
</new-search-page>
`
@ -67,7 +68,7 @@ export class SearchProjectsComponent {
public fieldIdsMap = this.searchFields.PROJECT_FIELDS;
public rangeFields: string[][] = this.searchFields.PROJECT_RANGE_FIELDS;
public selectedFields: AdvancedField[] = [];
properties: EnvProperties;
properties: EnvProperties = properties;
public openaireEntities = OpenaireEntities;
public resourcesQuery = "(oaftype exact project)";
@ -107,8 +108,6 @@ export class SearchProjectsComponent {
}
ngOnInit() {
this.properties = properties;
if (!this.simpleSearchLink) {
this.simpleSearchLink = this.properties.searchLinkToProjects;
}

View File

@ -44,6 +44,7 @@ import {zip} from "rxjs";
[includeOnlyResultsAndFilter]="includeOnlyResultsAndFilter" [showBreadcrumb]="showBreadcrumb"
[showSwitchSearchLink]="showSwitchSearchLink"
[stickyForm]="stickyForm"
[hasCompactView]="true"
(filterRequestAll)="filterRequestedAll($event)"
>
</new-search-page>

View File

@ -51,7 +51,7 @@ export class AdvancedSearchFormComponent implements OnInit, OnDestroy, OnChanges
newFieldName: string;
fieldList: { [id: string]: any[] } = {};
public searchFields: SearchFields = new SearchFields();
properties: EnvProperties;
properties: EnvProperties = properties;
public openaireEntities = OpenaireEntities;
public operators: string[] = this.searchFields.ADVANCED_SEARCH_OPERATORS;
public isOperators: Option[] = [{label: 'is', value: true}, {label: 'is not', value: false}];
@ -70,8 +70,6 @@ export class AdvancedSearchFormComponent implements OnInit, OnDestroy, OnChanges
ngOnInit() {
this.selectedEntity = this.entityType;
this.properties = properties;
for (var i = 0; i < this.fieldIds.length; i++) {
this.fieldList[this.fieldIds[i]] = [];
}

View File

@ -369,7 +369,7 @@
</div>
<!-- Download results -->
<div *ngIf="showDownload && (searchUtils.status !== errorCodes.LOADING || !loadPaging)"
class="uk-margin-small-left uk-flex uk-flex-middle" [class.uk-flex-center]="mobile" [class.uk-margin-medium-top]="mobile">
class="uk-margin-left uk-flex uk-flex-middle" [class.uk-flex-center]="mobile" [class.uk-margin-medium-top]="mobile">
<search-download
*ngIf="( entityType !='community' && entityType != 'stakeholder') && usedBy == 'search'"
[isDisabled]="disabled"
@ -381,6 +381,14 @@
</a>
</ng-container>
</div>
<!-- Compact results -->
<a *ngIf="hasCompactView && (searchUtils.status !== errorCodes.LOADING || !loadPaging)"
class="uk-link-reset custom-view-button active uk-margin-left">
<icon *ngIf="!compactView" uk-tooltip="Compact results" (click)="toggleView(true)"
name="unfold_less" [flex]="true" visuallyHidden="Compact results"></icon>
<icon *ngIf="compactView" uk-tooltip="Expand results" (click)="toggleView(false)"
name="unfold_more" [flex]="true" visuallyHidden="Expand results"></icon>
</a>
</div>
</div>
@ -400,7 +408,8 @@
[results]="results"
[status]=searchUtils.status
[type]="entityType"
[showLoading]="true" [properties]=properties>
[showLoading]="true" [properties]=properties
[compactView]="compactView">
</search-result>
<deposit-result *ngIf="usedBy == 'deposit'"
[results]="results"

View File

@ -165,6 +165,9 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
searchTerm: string = null;
advancedSearchTerms: number = 0;
@Input() hasCompactView: boolean = false; // if true, show buttons for compact view
public compactView: boolean = false; // if true, show less info (e.g. hide description) on each result
@Output() filterRequestAll = new EventEmitter();
constructor(private route: ActivatedRoute,
@ -1943,4 +1946,10 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
detectChanges() {
this.cdr.detectChanges();
}
toggleView(compact) {
if(compact != this.compactView) {
this.compactView = compact;
}
}
}

View File

@ -14,13 +14,12 @@ import {properties} from "../../../../environments/environment";
@Component({
selector: 'search-download',
template: `
<button [attr.uk-tooltip]="'title: Download' + ((totalResults > csvLimit)?' the first 2000 ':' ') + 'results.' +
<a [attr.uk-tooltip]="'title: Download' + ((totalResults > csvLimit)?' the first 2000 ':' ') + 'results.' +
((totalResults > csvLimit && properties.zenodoDumpUrl)?' To get all results download the data dump. ':' ') "
class="uk-button uk-button-link uk-flex uk-flex-middle" [class.uk-disabled]="isDisabled"
[disabled]="isDisabled"
class="custom-view-button uk-flex uk-flex-middle" [class.uk-disabled]="isDisabled" [class.active]="!isDisabled"
(click)="downloadfile(downloadURLAPI+'?format=csv'+csvParams,type+'-report-'+((totalResults > csvLimit)?'2000 ':totalResults))">
<icon name="download" [flex]="true"></icon>
</button>
<icon name="download" [flex]="true" visuallyHidden="Download search results"></icon>
</a>
<modal-loading></modal-loading>
<modal-alert #AlertModalCsvError></modal-alert>
`
@ -39,7 +38,7 @@ export class SearchDownloadComponent {
@ViewChild(ModalLoading) loading: ModalLoading;
// Alert box when something is wrong with CSV requests
@ViewChild('AlertModalCsvError') alertCsvError;
public properties: EnvProperties;
public properties: EnvProperties = properties;
public errorCodes: ErrorCodes = new ErrorCodes();
subscriptions = [];
@ -47,7 +46,6 @@ export class SearchDownloadComponent {
}
ngOnInit() {
this.properties = properties;
this.csvLimit = this.properties.csvLimit;
this.downloadURLAPI = this.properties.csvAPIURL;
}

View File

@ -3,7 +3,7 @@
<li *ngFor="let result of previewResults">
<result-preview [properties]="properties" [showOrganizations]="showOrganizations"
[showSubjects]="showSubjects" [result]="result" [showEnermaps]="showEnermaps"
[isCard]="true" [isMobile]="isMobile" [prevPath]="prevPath">
[isCard]="true" [isMobile]="isMobile" [prevPath]="prevPath" [compactView]="compactView">
</result-preview>
</li>
</ul>

View File

@ -24,6 +24,8 @@ export class SearchResultComponent implements OnInit, OnChanges {
@Input() custom_class: string = "";
@Input() properties: EnvProperties;
@Input() showEnermaps: boolean;
@Input() compactView: boolean = false; // if true, show less info (e.g. hide description) on each result
public isMobile: boolean = false;
private subscriptions: any[] = [];

View File

@ -93,6 +93,7 @@ export class OrganizationService {
this.organizationInfo.deletedByInferenceIds.push(result.objidentifier);
}
}
this.organizationInfo.children = children['organization'];
}
if(organization['pid']) {

View File

@ -50,11 +50,11 @@ export class SearchProjectsService {
//.map(res => <any> res.json())
.pipe(map(res => [res['meta'].total, this.parseResults(res['results'])]));
}
advancedSearchProjects (params: string, page: number, size: number, properties:EnvProperties, refineParams:string=null, refineFields:string[] =null, refineQuery:string = null, minRef: boolean = false):any {
advancedSearchProjects (params: string, page: number, size: number, properties:EnvProperties, refineParams:string=null, refineFields:string[] =null, refineQuery:string = null, minRef: boolean = false, excludeUnidentfied: boolean = true):any {
// &type=projects
let url = properties.searchAPIURLLAst+"resources2/?format=json";
// var basicQuery = "(oaftype exact project) "
var basicQuery = "&fq=(projectcode<>\"unidentified\")";
var basicQuery = excludeUnidentfied ? "&fq=(projectcode<>\"unidentified\")" : "";
// url += "?query=";
if(params!= null && params != '' ) {
url +="&query=(" + params + ")";

View File

@ -11,8 +11,7 @@ export class DataproviderProvenance {
this.provenance.set("fairsharing_::", {"urlPrefix": properties.fairSharingURL, "name": "FAIRsharing"});
this.provenance.set("eosc________::", {
"urlPrefix": properties.eoscMarketplaceURL,
"name": "EOSC Service Catalogue"
});
"name": "EOSC Resource Hub" });
}
}

View File

@ -28,6 +28,7 @@ export class OrganizationInfo {
// organizations: {name: string; url: string}[]}[];
deletedByInferenceIds: string[];
children;
identifiers: Map<string, string[]>; //key is the classname
belongsTo: boolean = true;
message: string;

View File

@ -3,7 +3,7 @@ import {
HostedByCollectedFrom,
Journal, OARoutes,
Organization,
Project,
Project, RelationDatasource,
RelationResult
} from "../result-preview/result-preview";
import {isArray} from "rxjs/internal-compatibility";
@ -185,6 +185,7 @@ export class ResultLandingInfo {
contexts: Context[];
deletedByInferenceIds: string[];
children;
// PUBLICATION, DATASET, ORP
references: Reference[];
@ -194,6 +195,9 @@ export class ResultLandingInfo {
organizations: Organization[];
openCitations: { "url": string, "title": string, "year": string, "doi": string, "authors": string[] }[];
relatedServices: RelationDatasource[];
relatedServicesClassFilters: Set<string> = new Set();
// DATASET
subtitle: string;

View File

@ -10,14 +10,14 @@ import {EnvProperties} from "../properties/env-properties";
@Component({
selector: 'entity-actions',
template: `
<div class="" [ngClass]="isMobile ? 'uk-flex uk-flex-column' : 'uk-grid uk-grid-small uk-child-width-auto'" [attr.uk-grid]="!isMobile ? '' : null">
<div class="" [ngClass]="isMobile ? 'uk-flex uk-flex-column' : 'uk-grid uk-grid-small uk-flex-middle uk-child-width-auto'" [attr.uk-grid]="!isMobile ? '' : null">
<div *ngIf="linking && isRouteAvailable('participate/direct-claim')">
<a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'], [id,type,linkTo])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim"
[attr.uk-tooltip]="showTooltip ? 'title: Link '+openaireEntities.RESULTS+' with a '+openaireEntities.PROJECT+', a '+openaireEntities.COMMUNITY+' or other '+openaireEntities.RESULTS+' and make the new information available in OpenAIRE information space.; pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium' : 'cls: uk-invisible'"
class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'">
<icon [flex]="true" [ratio]="0.7" name="link_to" visuallyHidden="link"></icon>
<span class="uk-margin-xsmall-left">Link to</span>
<span *ngIf="!compactView" class="uk-margin-xsmall-left">Link to</span>
</a>
</div>
<div *ngIf="share">
@ -25,14 +25,14 @@ import {EnvProperties} from "../properties/env-properties";
[attr.uk-tooltip]="showTooltip ? 'title: Share this '+getTypeName()+' in your social networks; pos: bottom; cls: uk-active uk-text-small uk-padding-small' : 'cls: uk-invisible'"
class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'">
<icon class="uk-text-bolder" [flex]="true" [ratio]="0.8" name="share" visuallyHidden="share"></icon>
<span class="uk-margin-xsmall-left">Share</span>
<span *ngIf="!compactView" class="uk-margin-xsmall-left">Share</span>
</a>
</div>
<div *ngIf="cite">
<a (click)="openCiteModal()"
class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'">
<icon class="uk-text-bolder" [flex]="true" [ratio]="0.7" name="cite" visuallyHidden="cite"></icon>
<span class="uk-margin-xsmall-left">Cite</span>
<span *ngIf="!compactView" class="uk-margin-xsmall-left">Cite</span>
</a>
</div>
<div *ngIf="deposit && isRouteAvailable('participate/deposit/learn-how')">
@ -40,7 +40,7 @@ import {EnvProperties} from "../properties/env-properties";
[attr.uk-tooltip]="showTooltip ? 'title: Find a repository to deposit or publish your research in Open Access; pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium' : 'cls: uk-invisible'"
class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'">
<icon flex="true" ratio="0.7" name="upload" visuallyHidden="upload"></icon>
<span class="uk-margin-xsmall-left">Deposit</span>
<span *ngIf="!compactView" class="uk-margin-xsmall-left">Deposit</span>
</a>
</div>
<div *ngIf="embed" >
@ -48,7 +48,7 @@ import {EnvProperties} from "../properties/env-properties";
[attr.uk-tooltip]="showTooltip ? 'title: Embed the related '+openaireEntities.RESULTS+' of this '+getTypeName()+' in your website; pos: bottom; cls: uk-active uk-text-small uk-padding-small uk-width-medium' : 'cls: uk-invisible'"
class="uk-flex uk-flex-middle uk-button-link" [ngClass]="isMobile ? 'uk-margin-left uk-margin-xsmall-bottom' : 'uk-text-bolder uk-flex-center'">
<icon flex="true" ratio="0.8" name="code" visuallyHidden="code"></icon>
<span class="uk-margin-xsmall-left">Embed</span>
<span *ngIf="!compactView" class="uk-margin-xsmall-left">Embed</span>
</a>
</div>
<ng-content></ng-content>
@ -96,6 +96,7 @@ export class EntityActionsComponent implements OnInit {
@Input() url: string;
@Input() isMobile: boolean = false;
@Input() showTooltip: boolean = true;
@Input() compactView: boolean = false; // if true, do not show label for actions
public citeThisClicked: boolean;
public routerHelper: RouterHelper = new RouterHelper();
@ViewChild('citeModal') citeModal;

View File

@ -8,7 +8,8 @@ import {properties} from "../../../../environments/environment";
@Injectable()
export class HelperService {
constructor(private http: HttpClient) {}
constructor(private http: HttpClient) {
}
/**
* @deprecated

View File

@ -1,6 +1,7 @@
export type Environment = "development" | "test" | "beta" | "production";
export type Dashboard = "explore" | "connect" | "monitor" | "aggregator" | "eosc" | "developers" | "faircore4eosc" | "irish";
export type PortalType = "explore" | "connect" | "community" | "monitor" | "funder" | "ri" | "project" | "organization" | "aggregator" | "eosc" | "faircore4eosc" | "country";
export type PortalType = "explore" | "connect" | "community" | "monitor" | "funder" | "ri" | "project" | "organization" |
"aggregator" | "eosc" | "faircore4eosc" | "country" | "datasource" | "journal" | "publisher";
export interface EnvProperties {
environment?: Environment;

View File

@ -25,7 +25,7 @@ export let common: EnvProperties = {
wikiDataURL: "https://www.wikidata.org/wiki/",
fundRefURL: "https://data.crossref.org/fundingdata/funder/",
fairSharingURL: "https://fairsharing.org/",
eoscMarketplaceURL: "https://marketplace.eosc-portal.eu/services/",
eoscMarketplaceURL: "https://open-science-cloud.ec.europa.eu/resources/services/",
sherpaURL: "http://sherpa.ac.uk/romeo/issn/",
sherpaURLSuffix: "/",
zenodo: "https://zenodo.org/",
@ -110,7 +110,7 @@ export let commonDev: EnvProperties = {
orcidAPIURL: "http://duffy.di.uoa.gr:19480/uoa-orcid-service/",
orcidTokenURL: "https://sandbox.orcid.org/oauth/authorize?",
orcidClientId: "APP-A5M3KTX6NCN67L91",
utilsService: "http://mpagasas.di.uoa.gr:8000",
utilsService: "http://scoobydoo.di.uoa.gr:8000",
vocabulariesAPI: "https://dev-openaire.d4science.org/provision/mvc/vocabularies/",
loginServiceURL: "http://mpagasas.di.uoa.gr:19080/login-service/",
cookieDomain: ".di.uoa.gr",

View File

@ -32,7 +32,7 @@
</div>
<div class="uk-width-expand">
<!-- 1st section (title, metadata) -->
<div class="uk-margin-small-bottom">
<div [class.uk-margin-small-bottom]="!compactView">
<!-- Title -->
<div class="uk-grid">
<div [ngClass]="result.websiteURL && promoteWebsiteURL && !isMobile ? 'uk-flex uk-flex-between uk-width-1-1' : 'uk-width-expand'">
@ -48,7 +48,7 @@
</a>
</span>
</div>
<div class="multi-line-ellipsis lines-3 uk-width-expand">
<div [class]="'uk-width-expand multi-line-ellipsis lines-'+(compactView ? '1' : '3')">
<h2 class="uk-margin-remove uk-text-break uk-inline-block uk-h6">
<a *ngIf="!externalUrl && result.id && !customUrl" (click)="onClick()" [queryParams]="addEoscPrevInParams(createParam())"
[routerLink]="url" class="uk-link uk-text-decoration-none uk-width-expand" [class.uk-disabled]="result.id == '-1'">
@ -78,7 +78,7 @@
</div>
</div>
<!-- Metadata -->
<div class="uk-margin-xsmall-top">
<div [class.uk-margin-xsmall-top]="!compactView">
<entity-metadata [resultTitle]="result?.title"
[entityType]="type" [types]="result.types" [startYear]="result.startYear?.toString()"
[endYear]="result.endYear?.toString()"
@ -96,7 +96,7 @@
</div>
</div>
<!-- 2nd section (funders, budget, authors, PIDs, publisher etc.) -->
<div class="uk-text-small uk-margin-small-bottom">
<div class="uk-text-small" [class.uk-margin-small-bottom]="!compactView">
<!-- Funder -->
<div *ngIf="(result.funderShortname || result.funderName) || result.code" class="uk-margin-xsmall-bottom">
<span *ngIf="result.funderShortname || result.funderName">
@ -114,7 +114,7 @@
<!-- </span>-->
</div>
<!-- Funder Budget -->
<div *ngIf="result.budget || result.contribution" class="uk-margin-xsmall-bottom">
<div *ngIf="!compactView && (result.budget || result.contribution)" class="uk-margin-xsmall-bottom">
<span *ngIf="result.budget">
<span class="uk-text-meta">Overall Budget: </span>
{{result.budget | number}}
@ -132,11 +132,11 @@
[showAll]=true [showInline]="showInline"></showAuthors>
</div>
<!-- Identifiers -->
<div *ngIf="result.identifiers && result.identifiers.size > 0" class="uk-margin-xsmall-bottom">
<div *ngIf="!compactView && result.identifiers && result.identifiers.size > 0" class="uk-margin-xsmall-bottom">
<showIdentifiers [identifiers]="result.identifiers"></showIdentifiers>
</div>
<!-- Website URL -->
<div *ngIf="result.websiteURL && result.websiteURL != '' && !promoteWebsiteURL"
<div *ngIf="!compactView && result.websiteURL && result.websiteURL != '' && !promoteWebsiteURL"
class="uk-margin-xsmall-bottom">
<span class="uk-text-meta">Website URL: </span>
<span>
@ -146,7 +146,7 @@
</span>
</div>
<!-- OAI-PMH URL-->
<div *ngIf="result.OAIPMHURL && result.OAIPMHURL != ''" class="uk-margin-xsmall-bottom">
<div *ngIf="!compactView && result.OAIPMHURL && result.OAIPMHURL != ''" class="uk-margin-xsmall-bottom">
<span class="uk-text-meta">OAI-PMH URL: </span>
<span>
<a href="{{result.OAIPMHURL}}" target="_blank" class="custom-external">
@ -156,7 +156,7 @@
</div>
</div>
<!-- 3rd section (description) -->
<div class="uk-text-small uk-visible@m">
<div *ngIf="!compactView" class="uk-text-small uk-visible@m">
<!-- Description -->
<div *ngIf="result.description" class="multi-line-ellipsis lines-2">
<p class="uk-margin-remove" [innerHTML]="result.description"></p>
@ -177,7 +177,7 @@
</div>
</div>
<div *ngIf="(result.hostedBy_collectedFrom || ((hasActions || result.measure?.bip.length || result.measure?.counts.length) && (!isDeletedByInferenceModal && showEntityActions)))"
class="uk-text-small uk-margin-top" [class.uk-border-bottom]="!isMobile">
class="uk-text-small" [class.uk-margin-top]="!compactView" [class.uk-border-bottom]="!isMobile">
<div uk-grid class="uk-grid uk-grid-small uk-text-xsmall uk-flex-middle uk-margin-xsmall-bottom"
[class.uk-flex-between]="!isDeletedByInferenceModal && (result.measure?.bip.length || result.measure?.counts.length) && (result.hostedBy_collectedFrom?.length || hasActions)"
[class.uk-flex-right]="!isDeletedByInferenceModal && !(result.measure?.bip.length || result.measure?.counts.length) && (result.hostedBy_collectedFrom?.length || hasActions)"
@ -191,12 +191,13 @@
[type]="result.resultType"
[result]="result" [id]="result.objId?result.objId:result.id"
[url]="properties.domain + properties.baseLink + url + '?' + urlParam + '=' + result.id"
[showTooltip]="false">
[showTooltip]="false" [compactView]="compactView">
<span *ngIf="orcid">
<orcid-work *ngIf="showOrcid && result.identifiers && result.identifiers.size > 0"
[resultId]="result.relcanId" [resultTitle]="result.title"
[type]="result.resultType" [pageType]="'search'"
[putCodes]="result.orcidPutCodes" [givenPutCode]="true" [identifiers]="result.identifiers">
[putCodes]="result.orcidPutCodes" [givenPutCode]="true" [identifiers]="result.identifiers"
[compactView]="compactView">
</orcid-work>
</span>
<span *ngIf="orcid" class="uk-width-expand uk-text-right">
@ -226,7 +227,7 @@
<span *ngIf="result.oaRoutes.oaColor" class="dot" [ngClass]="result.oaRoutes.oaColor"></span>
<span *ngIf="result.oaRoutes.isInDiamondJournal" class="dot diamond"></span>
</span>
<span class="uk-margin-xsmall-left">Access Routes</span>
<span *ngIf="!compactView" class="uk-margin-xsmall-left">Access Routes</span>
</a>
<div uk-drop="pos: top-right; mode: click" class="uk-drop">
<div class="uk-card uk-card-default uk-border uk-box-no-shadow uk-padding-small">

View File

@ -43,6 +43,7 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
@Input() showInline: boolean = false; // do not open modal for "view more" when this is true
@Input() isDeletedByInferenceModal: boolean = false; // do not show action bar in results when in "Other versions" modal section
@Input() showEntityActions: boolean = true; // we can use this instead of the above as it is more generic
@Input() compactView: boolean = false; // if true, show less info (e.g. hide description) on each result
/* Metadata */
public type: string;

View File

@ -37,6 +37,17 @@ export interface RelationResult {
relationName?: string;
}
export interface RelationDatasource {
name: string;
id: string;
percentage: number;
percentageName?: string;
class: string
provenanceAction?: string;
relationName?: string;
openaireCompatibility: string;
}
export interface Project {
id: string;
acronym: string;
@ -271,6 +282,20 @@ export class ResultPreview {
return resultPreview;
}
public static relationDatasourceConvert(result: RelationDatasource): ResultPreview {
let resultPreview: ResultPreview = new ResultPreview();
resultPreview.id = result.id;
resultPreview.title = result.name;
resultPreview.resultType = "dataprovider";
resultPreview.types = [result.class];
resultPreview.relationName = result.relationName;
resultPreview.relation = result.percentageName;
resultPreview.percentage = result.percentage;
resultPreview.provenanceAction = result.provenanceAction;
resultPreview.compatibility = result.openaireCompatibility;
return resultPreview;
}
public static organizationConvert(result: Organization, relation: string = 'trust'): ResultPreview {
let resultPreview: ResultPreview = new ResultPreview();
resultPreview.id = result.id;