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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -166,7 +166,7 @@ export class ClassContentFormComponent implements OnInit {
this._router.navigate(['../'], {queryParams: {"pageId": this.pageId}, relativeTo: this.route}); this._router.navigate(['../'], {queryParams: {"pageId": this.pageId}, relativeTo: this.route});
NotificationHandler.rise('Page content has been <b>successfully updated</b>'); NotificationHandler.rise('Page content has been <b>successfully updated</b>');
this.showLoading = false; 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) err => this.handleUpdateError('System error saving page content', err)
)); ));

View File

@ -155,7 +155,7 @@ export class ClassHelpContentsComponent implements OnInit {
this.deletePageHelpContentsFromArray(this.selectedPageContents); this.deletePageHelpContentsFromArray(this.selectedPageContents);
NotificationHandler.rise('Page content(s) has been <b>successfully deleted</b>'); NotificationHandler.rise('Page content(s) has been <b>successfully deleted</b>');
this.showLoading = false; 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) error => this.handleUpdateError('System error deleting the selected page content(s)', error)
)); ));
@ -198,7 +198,7 @@ export class ClassHelpContentsComponent implements OnInit {
this.countClassHelpContents(); this.countClassHelpContents();
this.applyCheck(false); this.applyCheck(false);
NotificationHandler.rise('Page content(s) has been <b>successfully updated</b>'); 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) 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.checkboxes[i].entity.isEnabled = this.toggleStatus;
} }
this.applyCheck(false); 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); this._clearCacheService.purgeBrowserCache("entity's status changed", this.portal);
}, },
error => this.handleUpdateError('System error changing the status of the selected entity(-ies)', error) 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>'); NotificationHandler.rise('Page content has been <b>successfully ' + (this.pageContentId ? 'updated' : 'created') + '</b>');
this._router.navigate(['../'], {queryParams: {"pageId": this.pageId}, relativeTo: this.route}); this._router.navigate(['../'], {queryParams: {"pageId": this.pageId}, relativeTo: this.route});
this.showLoading = false; 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) err => this.handleUpdateError('System error saving page content', err)
)); ));

View File

@ -165,7 +165,7 @@ export class PageHelpContentsComponent implements OnInit {
this.deletePageHelpContentsFromArray(this.selectedPageContents); this.deletePageHelpContentsFromArray(this.selectedPageContents);
NotificationHandler.rise('Page content(s) has been <b>successfully deleted</b>'); NotificationHandler.rise('Page content(s) has been <b>successfully deleted</b>');
this.showLoading = false; 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) 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>'); NotificationHandler.rise('Page content(s) has been <b>successfully updated</b>');
this.countPageHelpContents(); this.countPageHelpContents();
this.applyCheck(false); 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) 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 <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'"> [class]="isPortalAdministrator ? 'uk-flex-between@m':'uk-flex-right@m'">
<div> <div>
<div input inputClass="border-bottom" type="select" [options]="menuTypes" [(value)]="selectedMenuType" (valueChange)="valueChange()" <!--<div input inputClass="border-bottom" type="select" [options]="menuTypes" [(value)]="selectedMenuType" (valueChange)="valueChange()"
*ngIf="isPortalAdministrator"></div> *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>
<div> <div>
<button class="uk-button uk-button-default uk-flex uk-flex-middle" <button class="uk-button uk-button-default uk-flex uk-flex-middle"
@ -163,9 +168,9 @@
<span class="uk-margin-small-left">Hidden</span> <span class="uk-margin-small-left">Hidden</span>
</label> </label>
</div> </div>
<ng-container *ngIf="selectedMenuType == 'customMenu'">
<h6 class="uk-margin-medium-top">Menu alignment</h6> <h6 class="uk-margin-medium-top">Menu alignment</h6>
<div *ngIf="selectedMenuType == 'customMenu'"> <div >
<div> <div>
<label (click)="alignMenu('LEFT')"> <label (click)="alignMenu('LEFT')">
<input class="uk-radio" type="radio" name="menuAlign" [checked]="(featuredAlignment == 'LEFT')"> <input class="uk-radio" type="radio" name="menuAlign" [checked]="(featuredAlignment == 'LEFT')">
@ -185,6 +190,7 @@
</label> </label>
</div> </div>
</div> </div>
</ng-container>
</div> </div>
</div> </div>
<div *ngIf="displayMenuItems && displayMenuItems.length == 0" <div *ngIf="displayMenuItems && displayMenuItems.length == 0"

View File

@ -46,8 +46,9 @@ export class MenuComponent implements OnInit {
public menuItemForm: FormGroup; public menuItemForm: FormGroup;
public pageForm: FormGroup; public pageForm: FormGroup;
public menuTypes = [ public menuTypes = [
{label: 'Normal Menu', value: 'normalMenu'}, {label: 'Custom', value: 'customMenu'},
{label: 'Custom Menu', value: 'customMenu'} {label: 'Main', value: 'normalMenu'}
]; ];
public selectedMenuType = this.menuTypes[0].value; public selectedMenuType = this.menuTypes[0].value;
public normalMenuItems: MenuItemExtended[] = []; public normalMenuItems: MenuItemExtended[] = [];
@ -126,8 +127,8 @@ export class MenuComponent implements OnInit {
} else { } else {
this.title.setTitle('Administrator Dashboard | Menu'); this.title.setTitle('Administrator Dashboard | Menu');
} }
this.isPortalAdministrator = Session.isPortalAdministrator(user); this.isPortalAdministrator = false;//Session.isPortalAdministrator(user);
this.selectedMenuType = this.isPortalAdministrator ? this.menuTypes[0].value : this.menuTypes[1].value; this.selectedMenuType = this.menuTypes[0].value
}); });
} }
@ -271,7 +272,7 @@ export class MenuComponent implements OnInit {
this.deleteMenuItemFromArray(this.selectedMenuItem, this.isChild); this.deleteMenuItemFromArray(this.selectedMenuItem, this.isChild);
NotificationHandler.rise("Menu item have been <b>successfully deleted</b>"); NotificationHandler.rise("Menu item have been <b>successfully deleted</b>");
this.showLoading = false; 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) error => this.handleError("Server error deleting menu item", error)
@ -313,7 +314,7 @@ export class MenuComponent implements OnInit {
menuItem => { menuItem => {
this.menuItemSavedSuccessfully(menuItem, true); this.menuItemSavedSuccessfully(menuItem, true);
NotificationHandler.rise('Menu item <b>' + menuItem.title + '</b> has been <b>successfully created</b>'); 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) error => this.handleError("System error creating menu item", error)
) )
@ -324,7 +325,7 @@ export class MenuComponent implements OnInit {
menuItem => { menuItem => {
this.menuItemSavedSuccessfully(menuItem, false); this.menuItemSavedSuccessfully(menuItem, false);
NotificationHandler.rise('Menu item <b>' + menuItem.title + '</b> has been <b>successfully updated</b>'); 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) error => this.handleError("System error updating menu item", error)
) )
@ -390,7 +391,7 @@ export class MenuComponent implements OnInit {
HelperFunctions.swap(temp, index, newIndex); HelperFunctions.swap(temp, index, newIndex);
this._helpContentService.reorderMenuItems(temp, this.portal).subscribe(() => { this._helpContentService.reorderMenuItems(temp, this.portal).subscribe(() => {
HelperFunctions.swap(this.featuredMenuItems, index, newIndex); HelperFunctions.swap(this.featuredMenuItems, index, newIndex);
this._clearCacheService.clearCacheInRoute("Menu items reordered",this.portal, "/"); this._clearCacheService.purgeBrowserCache("Menu items reordered",this.portal);
}, error => { }, error => {
this.handleError("System error reordering menu items", error); this.handleError("System error reordering menu items", error);
}); });
@ -402,7 +403,7 @@ export class MenuComponent implements OnInit {
HelperFunctions.swap(temp, index, newIndex); HelperFunctions.swap(temp, index, newIndex);
this._helpContentService.reorderMenuItems(temp, this.portal).subscribe(() => { this._helpContentService.reorderMenuItems(temp, this.portal).subscribe(() => {
HelperFunctions.swap(children && children.length ? children : this.normalMenuItems, index, newIndex); 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 => { }, error => {
this.handleError("System error reordering menu items", error); this.handleError("System error reordering menu items", error);
}); });
@ -417,7 +418,7 @@ export class MenuComponent implements OnInit {
} else { } else {
this.showNormalMenu = status; 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>"); NotificationHandler.rise("Menu has been <b>successfully toggled to be "+(status?"visible":"hidden")+"</b>");
}, error => { }, error => {
this.handleError("System error toggling menu", error); this.handleError("System error toggling menu", error);
@ -429,7 +430,7 @@ export class MenuComponent implements OnInit {
this.subscriptions.push( this.subscriptions.push(
this._helpContentService.alignMenu(MenuAlignment[alignment], this.portal).subscribe(() => { this._helpContentService.alignMenu(MenuAlignment[alignment], this.portal).subscribe(() => {
this.featuredAlignment = alignment; 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>"); NotificationHandler.rise("Menu has been <b>successfully "+alignment.toLowerCase()+" aligned</b>");
}, error => { }, error => {
this.handleError("System error aligning menu to the "+alignment.toLowerCase(), 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.checkboxes[i].page.isEnabled = status;
} }
this.applyCheck(false); this.applyCheck(false);
this._clearCacheService.clearCacheInRoute("Page's status changed",this.portal, "/");
this._clearCacheService.purgeBrowserCache("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) 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" type="checkbox" field="sdgs" (editClicked)="pluginEditEvent = $event"
(changed)="indicatorsChanged(indicator._id,$event)"> (changed)="indicatorsChanged(indicator._id,$event)">
</plugin-field-edit> </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"> <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> </div>
</ng-container> </ng-container>
@ -78,4 +78,7 @@ export class PluginStatsFormComponent extends PluginBaseFormComponent<PluginStat
$event.value = this.pluginObject['url']; $event.value = this.pluginObject['url'];
this.valuesChanged.emit($event) 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(''); private searchText: RegExp = new RegExp('');
public keyword = ''; public keyword = '';
public properties: EnvProperties = null; public properties: EnvProperties = properties;
public showLoading = true; public showLoading = true;
public portalUtils: PortalUtils = new PortalUtils(); public portalUtils: PortalUtils = new PortalUtils();
@ -61,7 +61,6 @@ export class PortalsComponent implements OnInit {
})); }));
HelperFunctions.scroll(); HelperFunctions.scroll();
this.properties = properties;
this.getPortals(); this.getPortals();
} }

View File

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

View File

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

View File

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

View File

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

View File

@ -78,15 +78,12 @@ export class StatisticsTabComponent {
private dataProjectsUrl:string ; private dataProjectsUrl:string ;
private pubsProjectsUrl:string; private pubsProjectsUrl:string;
public errorCodes:ErrorCodes = new ErrorCodes(); public errorCodes:ErrorCodes = new ErrorCodes();
properties:EnvProperties; properties:EnvProperties = properties;
public openaireEntities = OpenaireEntities; public openaireEntities = OpenaireEntities;
sub; sub;
constructor (private route: ActivatedRoute) {} constructor (private route: ActivatedRoute) {}
ngOnInit() { ngOnInit() {
this.properties = properties;
if (this.properties.useNewStatistisTool) { if (this.properties.useNewStatistisTool) {
this.docsTimelineUrl = this.properties.statisticsFrameNewAPIURL + 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"}}}'); '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 selectedStyle: string = null;
public selectedFormat: string = null; public selectedFormat: string = null;
public fileText: string; public fileText: string;
properties:EnvProperties; properties:EnvProperties = properties;
public citationText: string; public citationText: string;
public citation: Citation = new Citation(); public citation: Citation = new Citation();
@Input() result: any; @Input() result: any;
@ -55,7 +55,6 @@ export class CiteThisComponent implements OnInit, OnDestroy {
constructor( @Inject(DOCUMENT) private document, private rendererFactory: RendererFactory2, private _piwikService: PiwikService){ constructor( @Inject(DOCUMENT) private document, private rendererFactory: RendererFactory2, private _piwikService: PiwikService){
} }
ngOnInit() { ngOnInit() {
this.properties = properties;
try{ try{
if (!this.document.getElementById('citationjs')) { if (!this.document.getElementById('citationjs')) {
const renderer = this.rendererFactory.createRenderer(this.document, { 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 {Context, Measure, Metric, MetricPerDatasource, Reference} from "../../utils/entities/resultLandingInfo";
import {Injectable} from '@angular/core'; import {Injectable} from '@angular/core';
import {properties} from "../../../../environments/environment"; import {properties} from "../../../../environments/environment";
@ -527,6 +532,56 @@ export class ParsingFunctions {
return researchResults; 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[] { sortByPercentage(results: RelationResult[]): RelationResult[] {
if (results) { if (results) {
return results.sort(function (a, b) { return results.sort(function (a, b) {
@ -643,11 +698,11 @@ export class ParsingFunctions {
if (!classifiedSubjects.has(subject.classname)) { if (!classifiedSubjects.has(subject.classname)) {
classifiedSubjects.set(subject.classname, new Array<string>()); classifiedSubjects.set(subject.classname, new Array<string>());
} }
if(properties.environment == "production") { // if(properties.environment == "production") {
classifiedSubjects.get(subject.classname).push(content); // classifiedSubjects.get(subject.classname).push(content);
} else { // } else {
classifiedSubjects.get(subject.classname).push(subject.classid + ": " + content); classifiedSubjects.get(subject.classname).push(subject.classid + ": " + content);
} // }
// } // }
} }
} else { } else {
@ -668,7 +723,7 @@ export class ParsingFunctions {
} }
} }
if(properties.environment != "production" && classifiedSubjects != null) { if(classifiedSubjects != null) {
if (subjects == undefined) { if (subjects == undefined) {
subjects = new Array<string>(); subjects = new Array<string>();
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8,33 +8,36 @@ import {RouterHelper} from '../../../utils/routerHelper.class';
import {ErrorCodes} from '../../../utils/properties/errorCodes'; import {ErrorCodes} from '../../../utils/properties/errorCodes';
import {DeletedByInferenceService} from './deletedByInference.service'; 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 {AlertModal} from "../../../utils/modal/alert";
import {Subscriber} from "rxjs"; import {Subscriber} from "rxjs";
import {properties} from "../../../../../environments/environment"; import {properties} from "../../../../../environments/environment";
import {HelperFunctions} from "../../../utils/HelperFunctions.class"; import {HelperFunctions} from "../../../utils/HelperFunctions.class";
import {Dates, StringUtils} from "../../../utils/string-utils.class";
import {ParsingFunctions} from "../../landing-utils/parsingFunctions.class";
@Component({ @Component({
selector: 'deletedByInference', selector: 'deletedByInference',
template: ` template: `
<div id="versions_container"> <div id="versions_container">
<errorMessages [status]="[status]" [type]="type" tab_error_class=true></errorMessages> <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)" (pageChange)="updatePage($event)"
[page]="page" [pageSize]="pageSize" [page]="page" [pageSize]="pageSize"
[totalResults]="results.length"> [totalResults]="resultsPreview.length">
</no-load-paging> </no-load-paging>
<ul class="uk-list uk-margin"> <ul class="uk-list uk-margin">
<li *ngFor="let result of results.slice((page-1)*pageSize, page*pageSize)"> <li *ngFor="let result of resultsPreview.slice((page-1)*pageSize, page*pageSize)">
<result-preview [modal]="modal" [properties]="properties" [hasLink]="false" [result]="getResultPreview(result)" <result-preview [modal]="modal" [properties]="properties" [hasLink]="false" [result]="result"
[showOrcid]="false" [prevPath]="prevPath" [showInline]="true" [showOrcid]="false" [prevPath]="prevPath" [showInline]="true"
[isDeletedByInferenceModal]="true" [isMobile]="isMobile"></result-preview> [isDeletedByInferenceModal]="true" [isMobile]="isMobile"></result-preview>
</li> </li>
</ul> </ul>
<no-load-paging *ngIf="results.length > pageSize" [type]="type" <no-load-paging *ngIf="resultsPreview.length > pageSize" [type]="type"
(pageChange)="updatePage($event)" (pageChange)="updatePage($event)"
[page]="page" [pageSize]="pageSize" [page]="page" [pageSize]="pageSize"
[totalResults]="results.length"> [totalResults]="resultsPreview.length">
</no-load-paging> </no-load-paging>
</div> </div>
` `
@ -42,7 +45,8 @@ import {HelperFunctions} from "../../../utils/HelperFunctions.class";
export class DeletedByInferenceComponent { export class DeletedByInferenceComponent {
@Input() isMobile: boolean = false; @Input() isMobile: boolean = false;
@Input() prevPath: string = ""; @Input() prevPath: string = "";
public results: ResultLandingInfo[] = []; public resultsPreview: ResultPreview[] = [];
@Input() children = [];
@Input() id: string; @Input() id: string;
@Input() ids: string[] = []; @Input() ids: string[] = [];
@Input() type: string; @Input() type: string;
@ -58,7 +62,7 @@ export class DeletedByInferenceComponent {
public errorCodes: ErrorCodes = new ErrorCodes(); public errorCodes: ErrorCodes = new ErrorCodes();
subscriptions = []; subscriptions = [];
properties: EnvProperties; properties: EnvProperties = properties;
constructor(private element: ElementRef, constructor(private element: ElementRef,
private _deletedByInferenceService: DeletedByInferenceService, private _deletedByInferenceService: DeletedByInferenceService,
@ -66,15 +70,11 @@ export class DeletedByInferenceComponent {
} }
ngOnInit() { ngOnInit() {
this.properties = properties;
this.subscriptions.push(this.route.queryParams.subscribe(data => { this.subscriptions.push(this.route.queryParams.subscribe(data => {
this.errorCodes = new ErrorCodes(); this.errorCodes = new ErrorCodes();
this.status = this.errorCodes.LOADING; this.status = this.errorCodes.LOADING;
this.getDeletedByInference(); this.parseDeletedByInference();
})); }));
} }
@ -86,24 +86,88 @@ export class DeletedByInferenceComponent {
}); });
} }
getDeletedByInference() { public parseDeletedByInference() {
this.results = []; let parsingFunctions: ParsingFunctions = new ParsingFunctions();
this.status = this.errorCodes.LOADING; let length = Array.isArray(this.children) ? this.children.length : 1;
this.subscriptions.push(this._deletedByInferenceService.getDeletedByInferenceResults(this.id, String(this.ids.length), this.properties).subscribe( for (let i = 0; i < length; i++) {
data => { let result = Array.isArray(this.children) ? this.children[i] : this.children;
this.results = data; let preview = new ResultPreview();
this.status = this.errorCodes.DONE; if(result.hasOwnProperty("creator")) {
}, preview.authors = [];
error => { let authorsLength = Array.isArray(result.creator) ? result.creator.length : 1;
if (error.status == '404') { for (let j = 0; j < authorsLength; j++) {
this.status = this.errorCodes.NOT_FOUND; let author = {"fullName": Array.isArray(result.creator) ? result.creator[j] : result.creator, "orcid": null, "orcid_pending": null};
} else if (error.status == '500') { preview.authors.push(author);
this.status = this.errorCodes.ERROR;
} else {
this.status = this.errorCodes.NOT_AVAILABLE;
} }
} }
)); 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 {
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 { public getResultPreview(result: ResultLandingInfo): ResultPreview {

View File

@ -153,6 +153,10 @@
[tabTitle]="'Related research'" [tabId]="'all_related'" [tabTitle]="'Related research'" [tabId]="'all_related'"
[tabNumber]="resultLandingInfo.relatedResults.length"> [tabNumber]="resultLandingInfo.relatedResults.length">
</my-tab> </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" <my-tab *ngIf="resultLandingInfo.bioentities && bioentitiesNum> 0"
[tabTitle]="'External Databases'" [tabId]="'bioentities'" [tabNumber]="bioentitiesNum"> [tabTitle]="'External Databases'" [tabId]="'bioentities'" [tabNumber]="bioentitiesNum">
</my-tab> </my-tab>
@ -179,9 +183,13 @@
</ng-container> </ng-container>
<ng-container *ngIf="resultLandingInfo.relatedResults?.length > 0"> <ng-container *ngIf="resultLandingInfo.relatedResults?.length > 0">
<div id="all_related" class="landing-section"> <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> </div>
</ng-container> </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"> <ng-container *ngIf="resultLandingInfo.bioentities && bioentitiesNum> 0">
<div id="bioentities" class="landing-section"> <div id="bioentities" class="landing-section">
<ng-container *ngTemplateOutlet="bioentities_content"></ng-container> <ng-container *ngTemplateOutlet="bioentities_content"></ng-container>
@ -457,6 +465,14 @@
</div> </div>
<hr> <hr>
</ng-container> </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"> <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')"> <div class="clickable uk-flex uk-flex-middle uk-flex-between" (click)="openFsModal(bioentitiesFsModal, 'External Databases'); onSelectActiveTab('bioentities')">
<span>External Databases</span> <span>External Databases</span>
@ -638,7 +654,15 @@
<fs-modal #relatedResearchFsModal classTitle="uk-tile-default uk-border-bottom" <fs-modal #relatedResearchFsModal classTitle="uk-tile-default uk-border-bottom"
*ngIf="resultLandingInfo.relatedResults?.length > 0"> *ngIf="resultLandingInfo.relatedResults?.length > 0">
<div class="landing-section"> <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> </div>
</fs-modal> </fs-modal>
@ -700,22 +724,26 @@
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds" [ids]="resultLandingInfo.deletedByInferenceIds"
[modal]="AlertModalDeletedByInference" [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" <deletedByInference *ngIf="type == 'dataset' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds" [ids]="resultLandingInfo.deletedByInferenceIds"
[modal]="AlertModalDeletedByInference" [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" <deletedByInference *ngIf="type == 'software' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds" [ids]="resultLandingInfo.deletedByInferenceIds"
[modal]="AlertModalDeletedByInference" [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" <deletedByInference *ngIf="type == 'orp' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds" [ids]="resultLandingInfo.deletedByInferenceIds"
[modal]="AlertModalDeletedByInference" [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>
<modal-alert *ngIf="resultLandingInfo" #citeModal> <modal-alert *ngIf="resultLandingInfo" #citeModal>
<citeThis *ngIf="citeThisClicked" [result]="resultLandingInfo" [id]="id" <citeThis *ngIf="citeThisClicked" [result]="resultLandingInfo" [id]="id"
@ -763,34 +791,32 @@
</ul> </ul>
</ng-template> </ng-template>
<ng-template #relation_in_tab let-researchResults="researchResults" let-header="header"> <ng-template #relation_in_tab let-related="related" let-props="props" let-type="type" let-header="header">
<div <div *ngIf="related && related.length > 0" class="uk-margin-bottom">
*ngIf="researchResults && researchResults.length > 0"
class="uk-margin-bottom">
<h6 *ngIf="header">{{header}}</h6> <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" input type="select" placeholder="Filter by relation" inputClass="flat x-small"
[options]="relatedClassFilters" [(value)]="relatedClassSelected" [options]="props.classFilters" [(value)]="props.selectedClass"
(valueChange)="relatedClassChanged()"></div> (valueChange)="relatedClassChanged(type)"></div>
<results-and-pages <results-and-pages
[type]="openaireEntities.RESULTS" [type]="((type == 'datasource') ? openaireEntities.DATASOURCES : openaireEntities.RESULTS)"
[page]="relatedPage" [pageSize]="pageSize" [page]="props.page" [pageSize]="pageSize"
[totalResults]="researchResults.length"> [totalResults]="related.length">
</results-and-pages> </results-and-pages>
<ul class="uk-list uk-list-divider uk-margin"> <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-preview [properties]="properties"
[result]="getResultPreview(item)" [provenanceActionVocabulary]="provenanceActionVocabulary" [result]="getResultPreview(item, type)" [provenanceActionVocabulary]="provenanceActionVocabulary"
[relationsVocabulary]="relationsVocabulary" [relationsVocabulary]="relationsVocabulary"
[isCard]="false" [prevPath]="prevPath"></result-preview> [isCard]="false" [prevPath]="prevPath"></result-preview>
</li> </li>
</ul> </ul>
<paging-no-load *ngIf="researchResults.length > pageSize" <paging-no-load *ngIf="related.length > pageSize"
class="uk-margin-top" class="uk-margin-top"
(pageChange)="updateRelatedPage($event)" (pageChange)="updateRelatedPage($event, type)"
[currentPage]="relatedPage" [size]="pageSize" [currentPage]="props.page" [size]="pageSize"
[totalResults]="researchResults.length"> [totalResults]="related.length">
</paging-no-load> </paging-no-load>
</div> </div>
</ng-template> </ng-template>
@ -1130,7 +1156,7 @@
</div> </div>
</ng-container> </ng-container>
</div> </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"> <table class="uk-table uk-table-striped">
<thead> <thead>
<tr> <tr>
@ -1173,25 +1199,29 @@
[ids]="resultLandingInfo.deletedByInferenceIds" [ids]="resultLandingInfo.deletedByInferenceIds"
[resultType]="type" [type]="openaireEntities.PUBLICATIONS" [resultType]="type" [type]="openaireEntities.PUBLICATIONS"
[isMobile]="isMobile" [isMobile]="isMobile"
[modal]="alertModalDeletedByInferenceFS"></deletedByInference> [modal]="alertModalDeletedByInferenceFS"
[children]="resultLandingInfo.children"></deletedByInference>
<deletedByInference *ngIf="type == 'dataset' && deleteByInferenceOpened" <deletedByInference *ngIf="type == 'dataset' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds" [ids]="resultLandingInfo.deletedByInferenceIds"
[resultType]="'dataset'" [type]="openaireEntities.DATASETS" [resultType]="'dataset'" [type]="openaireEntities.DATASETS"
[isMobile]="isMobile" [isMobile]="isMobile"
[modal]="alertModalDeletedByInferenceFS"></deletedByInference> [modal]="alertModalDeletedByInferenceFS"
[children]="resultLandingInfo.children"></deletedByInference>
<deletedByInference *ngIf="type == 'software' && deleteByInferenceOpened" <deletedByInference *ngIf="type == 'software' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds" [ids]="resultLandingInfo.deletedByInferenceIds"
[resultType]="type" [type]="openaireEntities.SOFTWARE" [resultType]="type" [type]="openaireEntities.SOFTWARE"
[isMobile]="isMobile" [isMobile]="isMobile"
[modal]="alertModalDeletedByInferenceFS"></deletedByInference> [modal]="alertModalDeletedByInferenceFS"
[children]="resultLandingInfo.children"></deletedByInference>
<deletedByInference *ngIf="type == 'orp' && deleteByInferenceOpened" <deletedByInference *ngIf="type == 'orp' && deleteByInferenceOpened"
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
[ids]="resultLandingInfo.deletedByInferenceIds" [ids]="resultLandingInfo.deletedByInferenceIds"
[resultType]="'other'" [type]="openaireEntities.OTHER" [resultType]="'other'" [type]="openaireEntities.OTHER"
[isMobile]="isMobile" [isMobile]="isMobile"
[modal]="alertModalDeletedByInferenceFS"></deletedByInference> [modal]="alertModalDeletedByInferenceFS"
[children]="resultLandingInfo.children"></deletedByInference>
</fs-modal> </fs-modal>
<fs-modal *ngIf="resultLandingInfo" #citeFsModal classTitle="uk-tile-default uk-border-bottom"> <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 {HelperService} from '../../utils/helper/helper.service';
import {Location} from "@angular/common"; import {Location} from "@angular/common";
import {MetricsService} from "../../services/metrics.service"; 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 {IndexInfoService} from "../../utils/indexInfo.service";
import {Identifier, StringUtils} from "../../utils/string-utils.class"; import {Identifier, StringUtils} from "../../utils/string-utils.class";
import {properties} from "../../../../environments/environment"; import {properties} from "../../../../environments/environment";
@ -95,12 +95,7 @@ export class ResultLandingComponent {
// Custom tab paging variables // Custom tab paging variables
public referencesPage: number = 1; public referencesPage: number = 1;
public bioentitiesPage: 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; public pageSize: number = 10;
// Map counting variables // Map counting variables
@ -139,9 +134,28 @@ export class ResultLandingComponent {
public pid: string; public pid: string;
public contextsWithLink: any; public contextsWithLink: any;
public relatedClassFilters: Option[]=[{"label": "All relations", "value": ""}]; public relatedResults: {
public relatedClassSelected: string = ""; classFilters: Option[],
public filteredRelatedResults: RelationResult[]; 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 provenanceActionVocabulary = null;
public relationsVocabulary = null; public relationsVocabulary = null;
@ -168,6 +182,7 @@ export class ResultLandingComponent {
@ViewChild('subjectsFsModal') subjectsFsModal: FullScreenModalComponent; @ViewChild('subjectsFsModal') subjectsFsModal: FullScreenModalComponent;
@ViewChild('referencesFsModal') referencesFsModal: FullScreenModalComponent; @ViewChild('referencesFsModal') referencesFsModal: FullScreenModalComponent;
@ViewChild('relatedResearchFsModal') relatedResearchFsModal: FullScreenModalComponent; @ViewChild('relatedResearchFsModal') relatedResearchFsModal: FullScreenModalComponent;
@ViewChild('servicesFsModal') servicesFsModal: FullScreenModalComponent;
@ViewChild('bioentitiesFsModal') bioentitiesFsModal: FullScreenModalComponent; @ViewChild('bioentitiesFsModal') bioentitiesFsModal: FullScreenModalComponent;
@ViewChild('compatibleEOSCFsModal') compatibleEOSCFsModal: FullScreenModalComponent; @ViewChild('compatibleEOSCFsModal') compatibleEOSCFsModal: FullScreenModalComponent;
@ViewChild('fundedByFsModal') fundedByFsModal: 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) { if (this.resultLandingInfo.relatedClassFilters.size > 1) {
for (let relClass of this.resultLandingInfo.relatedClassFilters) { for (let relClass of this.resultLandingInfo.relatedClassFilters) {
this.relatedClassFilters.push({ this.relatedResults.classFilters.push({
"label": HelperFunctions.getVocabularyLabel(relClass, this.relationsVocabulary), "label": HelperFunctions.getVocabularyLabel(relClass, this.relationsVocabulary),
"value": relClass "value": relClass
}); });
} }
} else { } else {
this.relatedClassFilters.pop(); this.relatedResults.classFilters.pop();
} }
this.relatedClassSelected = ""; this.relatedResults.selectedClass = "";
this.filteredRelatedResults = this.resultLandingInfo.relatedResults; 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.hasViews = false;
this.hasDownloads = false; this.hasDownloads = false;
if (this.resultLandingInfo.measure && this.resultLandingInfo.measure.counts) { if (this.resultLandingInfo.measure && this.resultLandingInfo.measure.counts) {
@ -711,25 +740,14 @@ export class ResultLandingComponent {
this.scrollToTabTop('bioentities'); this.scrollToTabTop('bioentities');
} }
public updateRelatedPage($event) { public updateRelatedPage($event, type) {
this.relatedPage = $event.value; if(type == "datasource") {
this.scrollToTabTop('all_related'); this.relatedServices.page = $event.value;
} this.scrollToTabTop("dataProviders");
} else {
public updateSimilarPage($event) { this.relatedResults.page = $event.value;
this.similarPage = $event.value; this.scrollToTabTop('all_related');
} }
public updateSupplementaryPage($event) {
this.supplementaryPage = $event.value;
}
public updateSupplementedByPage($event) {
this.supplementedByPage = $event.value;
}
public updateOrganizationsPage($event) {
this.organizationsPage = $event.value;
} }
scrollToTabTop(tabId:string){ scrollToTabTop(tabId:string){
@ -788,8 +806,11 @@ export class ResultLandingComponent {
this.alertModalDeletedByInference.open(); this.alertModalDeletedByInference.open();
} }
public getResultPreview(result: RelationResult): ResultPreview { public getResultPreview(result: RelationResult|RelationDatasource, type: string): ResultPreview {
return ResultPreview.relationResultConvert(result); if(type == "datasource") {
return ResultPreview.relationDatasourceConvert(<RelationDatasource>result);
}
return ResultPreview.relationResultConvert(<RelationResult>result);
} }
updateUrlWithType(pid) { updateUrlWithType(pid) {
@ -983,9 +1004,14 @@ export class ResultLandingComponent {
this.contextsWithLink = contextsWithLink; this.contextsWithLink = contextsWithLink;
} }
public relatedClassChanged() { public relatedClassChanged(type) {
this.relatedPage = 1; if(type == "datasource") {
this.filteredRelatedResults = this.resultLandingInfo.relatedResults.filter(result => !this.relatedClassSelected || result.relationName.toLowerCase() == this.relatedClassSelected.toLowerCase()); 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() { public viewAllOrganizationsClick() {

View File

@ -210,6 +210,19 @@ export class ResultLandingService {
this.resultLandingInfo.relatedResults = this.parsingFunctions.parseResults(this.resultLandingInfo.relatedResults, relation, provenanceAction, relationName); this.resultLandingInfo.relatedResults = this.parsingFunctions.parseResults(this.resultLandingInfo.relatedResults, relation, provenanceAction, relationName);
} else if (relation['to'].class && relation['to'].class.toLowerCase() == "hasauthorinstitution") { } else if (relation['to'].class && relation['to'].class.toLowerCase() == "hasauthorinstitution") {
this.resultLandingInfo.organizations = this.parseRelatedOrganizations(this.resultLandingInfo.organizations, relation); 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']; let result = Array.isArray(data[3]['result']) ? data[3]['result'][i] : data[3]['result'];
this.resultLandingInfo.deletedByInferenceIds.push(result.objidentifier); 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") { 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) => { this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories[this.index].charts.forEach((section: Section) => {
section.indicators.forEach(indicator => { section.indicators.forEach(indicator => {
indicator.indicatorPaths.forEach(path => { indicator.indicatorPaths.forEach(path => {
@ -1391,6 +1391,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
"indicatorPaths": indicator.indicatorPaths.map(path => { "indicatorPaths": indicator.indicatorPaths.map(path => {
return { return {
jsonPath: path.jsonPath, 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)) url: this.indicatorUtils.getNumberUrl(path.source, this.indicatorUtils.getFullUrl(this.stakeholder, path))
} }
}), }),
@ -1411,6 +1412,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
indicators[indexIndicator] = { indicators[indexIndicator] = {
"indicatorPaths": indicator.indicatorPaths.map(path => { "indicatorPaths": indicator.indicatorPaths.map(path => {
return { return {
tab: path.parameters.tab ? path.parameters.tab : path.parameters.title,
url: this.getUrlByStakeHolder(path) url: this.getUrlByStakeHolder(path)
} }
}), }),

View File

@ -680,7 +680,7 @@ export class IndicatorUtils {
return indicatorPath; 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, []); let indicatorPath = new IndicatorPath(type, source, null, null, []);
try { try {
if (source === 'stats-tool') { if (source === 'stats-tool') {
@ -734,6 +734,9 @@ export class IndicatorUtils {
if (indicatorPath.type == null) { if (indicatorPath.type == null) {
indicatorPath.type = this.defaultChartType; indicatorPath.type = this.defaultChartType;
} }
if(tab) {
indicatorPath.parameters.tab = tab;
}
return indicatorPath; return indicatorPath;
} }
@ -769,45 +772,6 @@ export class IndicatorUtils {
} }
private extractStakeHolders(obj, stakeholder: Stakeholder) { 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)]) { for (let query of this.getQueryObjectName(obj) ? obj[this.getDescriptionObjectName(obj)][this.getQueryObjectName(obj)] : obj[this.getDescriptionObjectName(obj)]) {
if (query["query"]["profile"]) { if (query["query"]["profile"]) {
query["query"]["profile"] = ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix; query["query"]["profile"] = ChartHelper.prefix + this.statsProfileParameter + ChartHelper.suffix;
@ -819,116 +783,7 @@ export class IndicatorUtils {
for (let gfilter of filter["groupFilters"]) { for (let gfilter of filter["groupFilters"]) {
let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder); let replacedValue = this.replaceIndexValues(gfilter["values"][0], stakeholder);
if (replacedValue) { // don't proceed in replacement if no replaced value matches 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; 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;
}
} }
} }
} }

View File

@ -121,7 +121,7 @@ export class MyOrcidLinksComponent {
public oldTotalResults: number = 0; public oldTotalResults: number = 0;
pagingLimit = 0; pagingLimit = 0;
properties:EnvProperties; properties:EnvProperties = properties;
public openaireEntities = OpenaireEntities; public openaireEntities = OpenaireEntities;
public lastOrcidUpdateDate: string = ""; public lastOrcidUpdateDate: string = "";
@ -183,7 +183,6 @@ export class MyOrcidLinksComponent {
} }
public ngOnInit() { public ngOnInit() {
this.properties = properties;
this.baseUrl = this.properties.myOrcidLinksPage; this.baseUrl = this.properties.myOrcidLinksPage;
this.pagingLimit = this.properties.pagingLimit; this.pagingLimit = this.properties.pagingLimit;
var description = "Openaire, ORCID linking, publication, research data, software, other research product"; 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() results: SearchResult[];
@Input() status: number; @Input() status: number;
@Input() type: string; @Input() type: string;
@Input() properties:EnvProperties; @Input() properties:EnvProperties = properties;
public openaireEntities = OpenaireEntities; public openaireEntities = OpenaireEntities;
@Input() previewResults:{"work":{},results:ResultPreview[]}[]; @Input() previewResults:{"work":{},results:ResultPreview[]}[];
@ -57,9 +57,6 @@ export class searcMyOrcidResultsComponent {
this.linkToAdvancedSearchPage = this.properties.searchLinkToAdvancedOrps; this.linkToAdvancedSearchPage = this.properties.searchLinkToAdvancedOrps;
this.urlParam = "orpId"; this.urlParam = "orpId";
} }
this.properties = properties;
} }

View File

@ -95,7 +95,7 @@ export class OrcidComponent {
window.close(); window.close();
} }
setTimeout(() => { 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); }, 3000);
} else { } else {
this.message = "<div>Thank you for connecting your ORCID iD with OpenAIRE!</div>" + 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; public oldTotalResults: number = 0;
pagingLimit = 0; pagingLimit = 0;
properties:EnvProperties; properties:EnvProperties = properties;
@Input() public communityId: string = null; @Input() public communityId: string = null;
@ -100,7 +100,6 @@ export class SearchRecommendedResultsForOrcidComponent {
} }
public ngOnInit() { public ngOnInit() {
this.properties = properties;
this.depositLearnHowPage = this.properties.depositLearnHowPage; this.depositLearnHowPage = this.properties.depositLearnHowPage;
this.baseUrl = this.properties.depositSearchPage; this.baseUrl = this.properties.depositSearchPage;
this.pagingLimit = this.properties.pagingLimit; this.pagingLimit = this.properties.pagingLimit;

View File

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

View File

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

View File

@ -85,7 +85,7 @@ export class SearchAllComponent {
showServices: boolean = false; showServices: boolean = false;
showOrganizations: boolean = false; showOrganizations: boolean = false;
advancedSearchLink: string = properties.searchLinkToAdvancedResults; advancedSearchLink: string = properties.searchLinkToAdvancedResults;
properties: EnvProperties; properties: EnvProperties = properties;
offset: number; offset: number;
public openaireEntities = OpenaireEntities; public openaireEntities = OpenaireEntities;
@Input() logoURL; @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 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; 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; var url = this.properties.domain + this.properties.baseLink + this._router.url;
this._title.setTitle(title); this._title.setTitle(title);
this._meta.updateTag({content: description}, "name='description'"); this._meta.updateTag({content: description}, "name='description'");

View File

@ -44,8 +44,8 @@ import {zip} from "rxjs";
[showResultCount]="true" [showIndexInfo]="type!='deposit'" [showResultCount]="true" [showIndexInfo]="type!='deposit'"
[tableViewLink]="tableViewLink" [tableViewLink]="tableViewLink"
[sort]="false" [showBreadcrumb]="showBreadcrumb" [basicMetaDescription]="metaDescription" [sort]="false" [showBreadcrumb]="showBreadcrumb" [basicMetaDescription]="metaDescription"
(filterRequestAll)="filterRequestedAll($event)"> (filterRequestAll)="filterRequestedAll($event)"
[hasCompactView]="true">
</new-search-page> </new-search-page>
` `
@ -80,7 +80,7 @@ export class SearchDataProvidersComponent {
public loadPaging: boolean = true; public loadPaging: boolean = true;
public oldTotalResults: number = 0; public oldTotalResults: number = 0;
public pagingLimit: number = 0; public pagingLimit: number = 0;
properties:EnvProperties; properties:EnvProperties = properties;
public openaireEntities = OpenaireEntities; public openaireEntities = OpenaireEntities;
@Input() type: "all" | "registries" | "journals" | "compatible" | "deposit" | "services" = "all"; @Input() type: "all" | "registries" | "journals" | "compatible" | "deposit" | "services" = "all";
@Input() entityType: "dataprovider" | "service" = "dataprovider"; @Input() entityType: "dataprovider" | "service" = "dataprovider";
@ -130,7 +130,6 @@ export class SearchDataProvidersComponent {
if(this.showSwitchSearchLink == null){ if(this.showSwitchSearchLink == null){
this.showSwitchSearchLink = (this.type == "all" || this.type == "services"); this.showSwitchSearchLink = (this.type == "all" || this.type == "services");
} }
this.properties= properties;
this.csvPath = this.entityType == "service" ? OpenaireEntities.SERVICES_FILE : OpenaireEntities.DATASOURCES_FILE; this.csvPath = this.entityType == "service" ? OpenaireEntities.SERVICES_FILE : OpenaireEntities.DATASOURCES_FILE;
if (!this.simpleSearchLink) { if (!this.simpleSearchLink) {
this.simpleSearchLink = this.entityType == "service" ? this.properties.searchLinkToServices : this.properties.searchLinkToDataProviders; 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..." [simpleView]="simpleView" formPlaceholderText="Search by organization name..."
[showSwitchSearchLink]="showSwitchSearchLink" [showSwitchSearchLink]="showSwitchSearchLink"
[showBreadcrumb]="showBreadcrumb" [showBreadcrumb]="showBreadcrumb"
(filterRequestAll)="filterRequestedAll($event)"> (filterRequestAll)="filterRequestedAll($event)"
[hasCompactView]="true">
</new-search-page> </new-search-page>
` `
}) })
@ -47,7 +48,7 @@ import {zip} from "rxjs";
export class SearchOrganizationsComponent { export class SearchOrganizationsComponent {
private errorCodes: ErrorCodes; private errorCodes: ErrorCodes;
private errorMessages: ErrorMessagesComponent; private errorMessages: ErrorMessagesComponent;
properties:EnvProperties; properties:EnvProperties = properties;
public openaireEntities = OpenaireEntities; public openaireEntities = OpenaireEntities;
@Input() searchForm: SearchForm = {class: 'search-form', dark: true}; @Input() searchForm: SearchForm = {class: 'search-form', dark: true};
public results =[]; public results =[];
@ -103,7 +104,6 @@ export class SearchOrganizationsComponent {
} }
ngOnInit() { ngOnInit() {
this.properties= properties;
if (!this.simpleSearchLink) { if (!this.simpleSearchLink) {
this.simpleSearchLink = this.properties.searchLinkToOrganizations; this.simpleSearchLink = this.properties.searchLinkToOrganizations;
} }

View File

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

View File

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

View File

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

View File

@ -369,7 +369,7 @@
</div> </div>
<!-- Download results --> <!-- Download results -->
<div *ngIf="showDownload && (searchUtils.status !== errorCodes.LOADING || !loadPaging)" <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 <search-download
*ngIf="( entityType !='community' && entityType != 'stakeholder') && usedBy == 'search'" *ngIf="( entityType !='community' && entityType != 'stakeholder') && usedBy == 'search'"
[isDisabled]="disabled" [isDisabled]="disabled"
@ -381,6 +381,14 @@
</a> </a>
</ng-container> </ng-container>
</div> </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>
</div> </div>
@ -400,7 +408,8 @@
[results]="results" [results]="results"
[status]=searchUtils.status [status]=searchUtils.status
[type]="entityType" [type]="entityType"
[showLoading]="true" [properties]=properties> [showLoading]="true" [properties]=properties
[compactView]="compactView">
</search-result> </search-result>
<deposit-result *ngIf="usedBy == 'deposit'" <deposit-result *ngIf="usedBy == 'deposit'"
[results]="results" [results]="results"

View File

@ -165,6 +165,9 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
searchTerm: string = null; searchTerm: string = null;
advancedSearchTerms: number = 0; 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(); @Output() filterRequestAll = new EventEmitter();
constructor(private route: ActivatedRoute, constructor(private route: ActivatedRoute,
@ -1943,4 +1946,10 @@ export class NewSearchPageComponent implements OnInit, OnDestroy, OnChanges {
detectChanges() { detectChanges() {
this.cdr.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({ @Component({
selector: 'search-download', selector: 'search-download',
template: ` 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. ':' ') " ((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" class="custom-view-button uk-flex uk-flex-middle" [class.uk-disabled]="isDisabled" [class.active]="!isDisabled"
[disabled]="isDisabled"
(click)="downloadfile(downloadURLAPI+'?format=csv'+csvParams,type+'-report-'+((totalResults > csvLimit)?'2000 ':totalResults))"> (click)="downloadfile(downloadURLAPI+'?format=csv'+csvParams,type+'-report-'+((totalResults > csvLimit)?'2000 ':totalResults))">
<icon name="download" [flex]="true"></icon> <icon name="download" [flex]="true" visuallyHidden="Download search results"></icon>
</button> </a>
<modal-loading></modal-loading> <modal-loading></modal-loading>
<modal-alert #AlertModalCsvError></modal-alert> <modal-alert #AlertModalCsvError></modal-alert>
` `
@ -39,7 +38,7 @@ export class SearchDownloadComponent {
@ViewChild(ModalLoading) loading: ModalLoading; @ViewChild(ModalLoading) loading: ModalLoading;
// Alert box when something is wrong with CSV requests // Alert box when something is wrong with CSV requests
@ViewChild('AlertModalCsvError') alertCsvError; @ViewChild('AlertModalCsvError') alertCsvError;
public properties: EnvProperties; public properties: EnvProperties = properties;
public errorCodes: ErrorCodes = new ErrorCodes(); public errorCodes: ErrorCodes = new ErrorCodes();
subscriptions = []; subscriptions = [];
@ -47,7 +46,6 @@ export class SearchDownloadComponent {
} }
ngOnInit() { ngOnInit() {
this.properties = properties;
this.csvLimit = this.properties.csvLimit; this.csvLimit = this.properties.csvLimit;
this.downloadURLAPI = this.properties.csvAPIURL; this.downloadURLAPI = this.properties.csvAPIURL;
} }

View File

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

View File

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

View File

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

View File

@ -50,11 +50,11 @@ export class SearchProjectsService {
//.map(res => <any> res.json()) //.map(res => <any> res.json())
.pipe(map(res => [res['meta'].total, this.parseResults(res['results'])])); .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 // &type=projects
let url = properties.searchAPIURLLAst+"resources2/?format=json"; let url = properties.searchAPIURLLAst+"resources2/?format=json";
// var basicQuery = "(oaftype exact project) " // var basicQuery = "(oaftype exact project) "
var basicQuery = "&fq=(projectcode<>\"unidentified\")"; var basicQuery = excludeUnidentfied ? "&fq=(projectcode<>\"unidentified\")" : "";
// url += "?query="; // url += "?query=";
if(params!= null && params != '' ) { if(params!= null && params != '' ) {
url +="&query=(" + 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("fairsharing_::", {"urlPrefix": properties.fairSharingURL, "name": "FAIRsharing"});
this.provenance.set("eosc________::", { this.provenance.set("eosc________::", {
"urlPrefix": properties.eoscMarketplaceURL, "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}[]}[]; // organizations: {name: string; url: string}[]}[];
deletedByInferenceIds: string[]; deletedByInferenceIds: string[];
children;
identifiers: Map<string, string[]>; //key is the classname identifiers: Map<string, string[]>; //key is the classname
belongsTo: boolean = true; belongsTo: boolean = true;
message: string; message: string;

View File

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

View File

@ -10,14 +10,14 @@ import {EnvProperties} from "../properties/env-properties";
@Component({ @Component({
selector: 'entity-actions', selector: 'entity-actions',
template: ` 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')"> <div *ngIf="linking && isRouteAvailable('participate/direct-claim')">
<a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'], [id,type,linkTo])" <a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'], [id,type,linkTo])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim" 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'" [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'"> 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> <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> </a>
</div> </div>
<div *ngIf="share"> <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'" [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'"> 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> <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> </a>
</div> </div>
<div *ngIf="cite"> <div *ngIf="cite">
<a (click)="openCiteModal()" <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'"> 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> <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> </a>
</div> </div>
<div *ngIf="deposit && isRouteAvailable('participate/deposit/learn-how')"> <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'" [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'"> 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> <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> </a>
</div> </div>
<div *ngIf="embed" > <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'" [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'"> 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> <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> </a>
</div> </div>
<ng-content></ng-content> <ng-content></ng-content>
@ -96,6 +96,7 @@ export class EntityActionsComponent implements OnInit {
@Input() url: string; @Input() url: string;
@Input() isMobile: boolean = false; @Input() isMobile: boolean = false;
@Input() showTooltip: boolean = true; @Input() showTooltip: boolean = true;
@Input() compactView: boolean = false; // if true, do not show label for actions
public citeThisClicked: boolean; public citeThisClicked: boolean;
public routerHelper: RouterHelper = new RouterHelper(); public routerHelper: RouterHelper = new RouterHelper();
@ViewChild('citeModal') citeModal; @ViewChild('citeModal') citeModal;

View File

@ -8,63 +8,64 @@ import {properties} from "../../../../environments/environment";
@Injectable() @Injectable()
export class HelperService { export class HelperService {
constructor(private http: HttpClient) {} constructor(private http: HttpClient) {
}
/** /**
* @deprecated * @deprecated
*/ */
getHelper (router: string, position: string, before: boolean, div: string, properties:EnvProperties, communityId:string ):any { getHelper(router: string, position: string, before: boolean, div: string, properties: EnvProperties, communityId: string): any {
//console.info("get router helpText for : "+router+" - position="+position+" - before="+before + " - div="+div); //console.info("get router helpText for : "+router+" - position="+position+" - before="+before + " - div="+div);
let url = properties.adminToolsAPIURL; let url = properties.adminToolsAPIURL;
if(div) { if (div) {
url += '/divhelpcontent?active=true&community='+communityId+'&page='+router+'&div=' + div; url += '/divhelpcontent?active=true&community=' + communityId + '&page=' + router + '&div=' + div;
} else { } else {
url += '/pagehelpcontent?active=true&community='+communityId+'&page='+router+'&position=' + position; url += '/pagehelpcontent?active=true&community=' + communityId + '&page=' + router + '&position=' + position;
if(before) { if (before) {
url += '&before='+before; url += '&before=' + before;
}
}
return this.http.get(/*(properties.useLongCache)? (properties.cacheUrl+encodeURIComponent(url)+ (properties.forceCacheReload?'&forceReload=true':'')):*/ url);
//.map(res => <any> res.json());
}
getPageHelpContents(properties:EnvProperties, portal:string, router: string, portalType = properties.adminToolsPortalType):any {
if(!portal) {
portal = properties.adminToolsCommunity;
}
if(!portal) {
portal = 'openaire';
}
if(typeof properties.useHelpTexts == "undefined" || properties.useHelpTexts) {
let page_route: string = router.split('?')[0].substring(0);
let url = properties.adminToolsAPIURL;
url += '/' + portalType + '/' + portal + '/pagehelpcontent/grouped?active=true&page=' +
((page_route.indexOf("/"+portal+"/")!=-1 ) ? ("/" + page_route.split("/"+portal+"/")[1]) : page_route);
return this.http.get(/*(properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)+ (properties.forceCacheReload?'&forceReload=true':'')) :*/ url);
}else {
return of(null);
} }
} }
getDivHelpContents(properties:EnvProperties, communityId:string, router: string):any { return this.http.get(/*(properties.useLongCache)? (properties.cacheUrl+encodeURIComponent(url)+ (properties.forceCacheReload?'&forceReload=true':'')):*/ url);
if(!communityId) { //.map(res => <any> res.json());
communityId = properties.adminToolsCommunity;
} }
if(!communityId) {
communityId = 'openaire'; getPageHelpContents(properties: EnvProperties, portal: string, router: string, portalType = properties.adminToolsPortalType): any {
} if (!portal) {
if(typeof properties.useHelpTexts == "undefined" || properties.useHelpTexts) { portal = properties.adminToolsCommunity;
}
if (!portal) {
portal = 'openaire';
}
if (typeof properties.useHelpTexts == "undefined" || properties.useHelpTexts) {
let page_route: string = router.split('?')[0].substring(0); let page_route: string = router.split('?')[0].substring(0);
let url = properties.adminToolsAPIURL; let url = properties.adminToolsAPIURL;
url += '/'+properties.adminToolsPortalType+'/' + communityId + '/divhelpcontent/grouped?active=true&page='+ url += '/' + portalType + '/' + portal + '/pagehelpcontent/grouped?active=true&page=' +
((page_route.indexOf("/"+communityId+"/")!=-1 ) ? ("/" + page_route.split("/"+communityId+"/")[1]) : page_route); ((page_route.indexOf("/" + portal + "/") != -1) ? ("/" + page_route.split("/" + portal + "/")[1]) : page_route);
return this.http.get((properties.useLongCache)? (properties.cacheUrl+encodeURIComponent(url)+ (properties.forceCacheReload?'&forceReload=true':'')): url); return this.http.get(/*(properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)+ (properties.forceCacheReload?'&forceReload=true':'')) :*/ url);
}else { } else {
return of(null); return of(null);
}
} }
}
getDivHelpContents(properties: EnvProperties, communityId: string, router: string): any {
if (!communityId) {
communityId = properties.adminToolsCommunity;
}
if (!communityId) {
communityId = 'openaire';
}
if (typeof properties.useHelpTexts == "undefined" || properties.useHelpTexts) {
let page_route: string = router.split('?')[0].substring(0);
let url = properties.adminToolsAPIURL;
url += '/' + properties.adminToolsPortalType + '/' + communityId + '/divhelpcontent/grouped?active=true&page=' +
((page_route.indexOf("/" + communityId + "/") != -1) ? ("/" + page_route.split("/" + communityId + "/")[1]) : page_route);
return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url) + (properties.forceCacheReload ? '&forceReload=true' : '')) : url);
} else {
return of(null);
}
}
} }

View File

@ -1,6 +1,7 @@
export type Environment = "development" | "test" | "beta" | "production"; export type Environment = "development" | "test" | "beta" | "production";
export type Dashboard = "explore" | "connect" | "monitor" | "aggregator" | "eosc" | "developers" | "faircore4eosc" | "irish"; 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 { export interface EnvProperties {
environment?: Environment; environment?: Environment;

View File

@ -25,7 +25,7 @@ export let common: EnvProperties = {
wikiDataURL: "https://www.wikidata.org/wiki/", wikiDataURL: "https://www.wikidata.org/wiki/",
fundRefURL: "https://data.crossref.org/fundingdata/funder/", fundRefURL: "https://data.crossref.org/fundingdata/funder/",
fairSharingURL: "https://fairsharing.org/", 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/", sherpaURL: "http://sherpa.ac.uk/romeo/issn/",
sherpaURLSuffix: "/", sherpaURLSuffix: "/",
zenodo: "https://zenodo.org/", zenodo: "https://zenodo.org/",
@ -110,7 +110,7 @@ export let commonDev: EnvProperties = {
orcidAPIURL: "http://duffy.di.uoa.gr:19480/uoa-orcid-service/", orcidAPIURL: "http://duffy.di.uoa.gr:19480/uoa-orcid-service/",
orcidTokenURL: "https://sandbox.orcid.org/oauth/authorize?", orcidTokenURL: "https://sandbox.orcid.org/oauth/authorize?",
orcidClientId: "APP-A5M3KTX6NCN67L91", 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/", vocabulariesAPI: "https://dev-openaire.d4science.org/provision/mvc/vocabularies/",
loginServiceURL: "http://mpagasas.di.uoa.gr:19080/login-service/", loginServiceURL: "http://mpagasas.di.uoa.gr:19080/login-service/",
cookieDomain: ".di.uoa.gr", cookieDomain: ".di.uoa.gr",

View File

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

View File

@ -37,6 +37,17 @@ export interface RelationResult {
relationName?: string; relationName?: string;
} }
export interface RelationDatasource {
name: string;
id: string;
percentage: number;
percentageName?: string;
class: string
provenanceAction?: string;
relationName?: string;
openaireCompatibility: string;
}
export interface Project { export interface Project {
id: string; id: string;
acronym: string; acronym: string;
@ -271,6 +282,20 @@ export class ResultPreview {
return 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 { public static organizationConvert(result: Organization, relation: string = 'trust'): ResultPreview {
let resultPreview: ResultPreview = new ResultPreview(); let resultPreview: ResultPreview = new ResultPreview();
resultPreview.id = result.id; resultPreview.id = result.id;