Production release December 2024 [EXPLORE] (angular 16) #56

Merged
konstantina.galouni merged 12 commits from develop into master 2024-12-03 12:03:30 +01:00
26 changed files with 175 additions and 110 deletions

View File

@ -7,21 +7,19 @@ import {properties} from "../../../../../environments/environment";
@Component({ @Component({
selector: 'project-title', selector: 'project-title',
template: ` template: `
<ng-container>
<h6 class="uk-margin-remove multi-line-ellipsis lines-2"> <h6 class="uk-margin-remove multi-line-ellipsis lines-2">
<p class="uk-margin-remove"> <p class="uk-margin-remove">
<a *ngIf="externalPortalUrl" [href]="externalPortalUrl + projectUrl + '?projectId='+project['openaireId']" class="uk-link uk-link-heading" [class.uk-disabled]="project.name == 'unidentified'"> <a *ngIf="externalPortalUrl" [href]="externalPortalUrl + projectUrl + '?projectId='+project['openaireId']" class="uk-link uk-link-heading" [class.uk-disabled]="project.name == 'unidentified'">
<span *ngIf="project['code'] != 'unidentified'">{{(project['acronym'] ? ('[' + project['acronym'] + '] ') : '')}}{{project['name']}}</span> <span *ngIf="project['name'] != 'unidentified'">{{(project['acronym'] ? ('[' + project['acronym'] + '] ') : '')}}{{project['name']}}</span>
<span *ngIf="project['code'] == 'unidentified'">{{project['funderName']}}</span> <span *ngIf="project['name'] == 'unidentified'">{{project['funderName']}}</span>
</a> </a>
<a *ngIf="!externalPortalUrl" [routerLink]="projectUrl" [queryParams]="routerHelper.createQueryParam('projectId',project['openaireId'])" class="uk-link uk-link-heading" [class.uk-disabled]="project.name == 'unidentified'"> <a *ngIf="!externalPortalUrl" [routerLink]="projectUrl" [queryParams]="routerHelper.createQueryParam('projectId',project['openaireId'])" class="uk-link uk-link-heading" [class.uk-disabled]="project.name == 'unidentified'">
<span *ngIf="project['code'] != 'unidentified'">{{(project['acronym'] ? ('[' + project['acronym'] + '] ') : '')}}{{project['name']}}</span> <span *ngIf="project['name'] != 'unidentified'">{{(project['acronym'] ? ('[' + project['acronym'] + '] ') : '')}}{{project['name']}}</span>
<span *ngIf="project['code'] == 'unidentified'">{{project['funderName']}} </span> <span *ngIf="project['name'] == 'unidentified'">{{project['funderName']}} </span>
</a> </a>
</p> </p>
</h6> </h6>
</ng-container> <span *ngIf="project['funderName'] && project['name'] != 'unidentified'" class="uk-margin-small-top">
<span *ngIf="project['funderName'] && project['code'] != 'unidentified'" class="uk-margin-small-top">
<span class="uk-text-meta">Funder: </span>{{project['funderName']}} <span class="uk-text-meta">Funder: </span>{{project['funderName']}}
</span> </span>
` `
@ -40,5 +38,6 @@ export class ProjectTitleFormatter {
ngOnInit() { ngOnInit() {
this.url = this.searchLink + "?projectId=" + this.project["openaireId"]; this.url = this.searchLink + "?projectId=" + this.project["openaireId"];
console.log(this.project)
} }
} }

View File

@ -67,7 +67,7 @@ import {PluginCardInfo} from "./plugin-card-info.component";
<hr class="uk-margin-left"> <hr class="uk-margin-left">
<div class="uk-margin-top" title="Use material icons to update the card icon"> <div class="uk-margin-top" title="Use material icons to update the card icon">
<div class="uk-width-1-1 uk-text-right"> <div class="uk-width-1-1 uk-text-right">
<a href="https://fonts.google.com/icons" target="_blank" class="uk-text-xsmall uk-text-right custom-external">More options</a> <a href="https://fonts.google.com/icons?icon.set=Material+Icons" target="_blank" class="uk-text-xsmall uk-text-right custom-external">More options</a>
</div> </div>
<plugin-field-edit [value]=" pluginObject.cardInfoArray[selectedIndex].icon" <plugin-field-edit [value]=" pluginObject.cardInfoArray[selectedIndex].icon"
type="text" field="icon" placeholder="Material icon" type="text" field="icon" placeholder="Material icon"

View File

@ -18,11 +18,14 @@
<div class="uk-text-center uk-margin-bottom description"> <div class="uk-text-center uk-margin-bottom description">
{{card.description}} {{card.description}}
</div> </div>
<a *ngFor="let url of card.urlsArray" [href]="card.url" [class.uk-hidden]="!(url.url && url.url.length > 0)" <ng-container *ngFor="let url of card.urlsArray">
class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text uk-text-default" <plugin-url [url]="url" [previewInAdmin]="previewInAdmin" classAttribute="uk-display-inline-block uk-text-uppercase uk-button uk-button-text uk-text-default"></plugin-url>
[target]="url.target" [routerLink]="url.route?url.url:null" [class.uk-disabled] =previewInAdmin> </ng-container>
<!--<a *ngFor="let url of card.urlsArray" [route]="url.url" class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text uk-text-default" [target]="url.target"
[class.uk-hidden]="!(url.url && url.url.length > 0)" [routerLink]="url.route?url.url:null" [class.uk-disabled] =previewInAdmin>
{{url.linkText}} {{url.linkText}}
</a> </a>-->
</div> </div>
</ng-container> </ng-container>
</ng-container> </ng-container>

View File

@ -9,10 +9,11 @@ import {IconsService} from "../../../../utils/icons/icons.service";
import {SearchResearchResultsServiceModule} from "../../../../services/searchResearchResultsService.module"; import {SearchResearchResultsServiceModule} from "../../../../services/searchResearchResultsService.module";
import {PluginFieldEditModule} from "../../utils/plugin-field-edit.module"; import {PluginFieldEditModule} from "../../utils/plugin-field-edit.module";
import {PluginCardInfoComponent} from "./plugin-card-info.component"; import {PluginCardInfoComponent} from "./plugin-card-info.component";
import {PluginUrlComponent} from "../../utils/pluginUrl.component";
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, RouterModule, FormsModule, IconsModule, NumberRoundModule, SearchResearchResultsServiceModule, PluginFieldEditModule CommonModule, RouterModule, FormsModule, IconsModule, NumberRoundModule, SearchResearchResultsServiceModule, PluginFieldEditModule, PluginUrlComponent
], ],
providers:[PluginsService], providers:[PluginsService],
declarations: [PluginCardInfoComponent], declarations: [PluginCardInfoComponent],

View File

@ -4,7 +4,7 @@ import {HttpClient} from "@angular/common/http";
export class PluginOpenAIREProducts extends PluginBaseInfo{ export class PluginOpenAIREProducts extends PluginBaseInfo{
title:string ="OpenAIRE services for your community"; title:string ="OpenAIRE services for your community";
serviceIdsArray = ["argos","zenodo","amnesia"]; serviceIdsArray = ["openaire.argos","cern.zenodo","athenarc.amnesia"];
compare(oldObject): any { compare(oldObject): any {
return super.compare(oldObject); return super.compare(oldObject);
} }

View File

@ -38,17 +38,13 @@ import {PluginBaseFormComponent, PluginEditEvent} from "../../utils/base-plugin.
export class PluginOpenaireProductsFormComponent extends PluginBaseFormComponent<PluginOpenAIREProducts>{ export class PluginOpenaireProductsFormComponent extends PluginBaseFormComponent<PluginOpenAIREProducts>{
default = new PluginOpenAIREProducts(); default = new PluginOpenAIREProducts();
services = []; services = [];
excludedServiceIds = ["openaire_login","research_community_dashboard"] excludedServiceIds = ["openaire.aai","openaire.connect"]
api= "https://catalogue.openaire.eu/api/catalogue-resources?from=0&quantity=100&order=asc&orderField=name"; api= "https://catalogue.openaire.eu/api/catalogue-resources?from=0&quantity=100&order=asc&orderField=name";
showErrorMessage = false; showErrorMessage = false;
constructor(http:HttpClient) { constructor(http:HttpClient) {
super() super()
this.subscriptions.push(http.get( this.properties.cacheUrl + encodeURIComponent(this.api)).subscribe(res =>{ this.subscriptions.push(http.get( this.properties.cacheUrl + encodeURIComponent(this.api)).subscribe(res =>{
this.services = res["results"].map( x=> { this.services = res["results"].filter(x=> this.excludedServiceIds.indexOf(x.id) ==-1);
x.id = x.id.split("openaire.")[1]
return x;
});
this.services = this.services.filter(x=> this.excludedServiceIds.indexOf(x.id) ==-1);
}, error => { }, error => {
this.showErrorMessage = true; this.showErrorMessage = true;
})) }))

View File

@ -23,10 +23,8 @@
<div [innerHTML]="pluginObject.paragraph2"></div> <div [innerHTML]="pluginObject.paragraph2"></div>
<div class="uk-margin-top"> <div class="uk-margin-top">
<a [href]="pluginObject.url.url" [target]="pluginObject.url.target" <plugin-url [url]="pluginObject.url" [previewInAdmin]="previewInAdmin" classAttribute="uk-display-inline-block uk-text-uppercase uk-button uk-button-text"></plugin-url>
class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text">
{{pluginObject.url.linkText}}
</a>
</div> </div>
</div> </div>
</div> </div>

View File

@ -6,10 +6,11 @@ import {PluginsService} from "../../../../services/plugins.service";
import {PluginFieldEditModule} from "../../utils/plugin-field-edit.module"; import {PluginFieldEditModule} from "../../utils/plugin-field-edit.module";
import {InputModule} from "../../../../sharedComponents/input/input.module"; import {InputModule} from "../../../../sharedComponents/input/input.module";
import {PluginGraphInfoComponent} from "./plugin-graph-info.component"; import {PluginGraphInfoComponent} from "./plugin-graph-info.component";
import {PluginUrlComponent} from "../../utils/pluginUrl.component";
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, RouterModule, FormsModule, PluginFieldEditModule, InputModule CommonModule, RouterModule, FormsModule, PluginFieldEditModule, InputModule, PluginUrlComponent
], ],
providers: [ providers: [
PluginsService PluginsService

View File

@ -16,10 +16,9 @@
{{card.title}} {{card.title}}
</div> </div>
<div class="uk-text-small">{{card.description}}</div> <div class="uk-text-small">{{card.description}}</div>
<a *ngFor="let url of card.urlsArray" [route]="url.url" class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text uk-text-default" [target]="url.target" <ng-container *ngFor="let url of card.urlsArray">
[class.uk-hidden]="!(url.url && url.url.length > 0)" [routerLink]="url.route?url.url:null" [class.uk-disabled] =previewInAdmin> <plugin-url [url]="url" [previewInAdmin]="previewInAdmin" classAttribute="uk-display-inline-block uk-text-uppercase uk-button uk-button-text uk-text-default"></plugin-url>
{{url.linkText}} </ng-container>
</a>
</slider-nav-item> </slider-nav-item>
</ng-container> </ng-container>
</slider-column> </slider-column>

View File

@ -10,11 +10,12 @@ import {SearchResearchResultsServiceModule} from "../../../../services/searchRes
import {PluginFieldEditModule} from "../../utils/plugin-field-edit.module"; import {PluginFieldEditModule} from "../../utils/plugin-field-edit.module";
import {PluginSearchDepositLinkComponent} from './plugin-search-deposit-link.component'; import {PluginSearchDepositLinkComponent} from './plugin-search-deposit-link.component';
import {SliderUtilsModule} from "../../../../sharedComponents/slider-utils/slider-utils.module"; import {SliderUtilsModule} from "../../../../sharedComponents/slider-utils/slider-utils.module";
import {PluginUrlComponent} from "../../utils/pluginUrl.component";
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule, RouterModule, FormsModule, IconsModule, NumberRoundModule, SearchResearchResultsServiceModule, CommonModule, RouterModule, FormsModule, IconsModule, NumberRoundModule, SearchResearchResultsServiceModule,
PluginFieldEditModule, SliderUtilsModule PluginFieldEditModule, SliderUtilsModule, PluginUrlComponent
], ],
providers:[PluginsService], providers:[PluginsService],
declarations: [PluginSearchDepositLinkComponent], declarations: [PluginSearchDepositLinkComponent],

View File

@ -96,7 +96,7 @@
<plugin-wrapper *ngIf="this.templateForm" [pluginTemplate]="selectedTemplate" <plugin-wrapper *ngIf="this.templateForm" [pluginTemplate]="selectedTemplate"
[plugin]="this.templateForm.getRawValue()" [plugin]="this.templateForm.getRawValue()"
[pluginObject]="this.selectedPlugin.object" [pluginObject]="this.selectedPlugin.object"
class="uk-width-1-1"></plugin-wrapper> class="uk-width-1-1" [previewInAdmin]="true"></plugin-wrapper>
</div> </div>
</div> </div>
</div> </div>

View File

@ -118,7 +118,7 @@ export class PluginsFormComponent implements OnInit {
}else{ }else{
this.selectedPlugin = new Plugin(this.page._id,this.selectedCommunityPid, template); this.selectedPlugin = new Plugin(this.page._id,this.selectedCommunityPid, template);
// this.selectedPlugin.order = this.pluginsByPlacement.get(this.selectedPlacementView).length; // this.selectedPlugin.order = this.pluginsByPlacement.get(this.selectedPlacementView).length;
this.selectedPlugin.object = PluginUtils.initializeObjectAndCompare(template.code,null); this.selectedPlugin.object = PluginUtils.initializeObjectAndCompare(template.code,this.selectedPlugin.object);
this.edit(this.selectedPlugin, this.selectedTemplate); this.edit(this.selectedPlugin, this.selectedTemplate);
} }

View File

@ -68,6 +68,7 @@
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold"> class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
<div>No plugins found</div> <div>No plugins found</div>
</div> </div>
<clear-cache *ngIf="clearCacheRequests && showClearCache()" [requests]="clearCacheRequests"></clear-cache>
<ng-container *ngFor="let placement of pluginUtils.placementsOptions"> <ng-container *ngFor="let placement of pluginUtils.placementsOptions">
<ng-container *ngIf="selectedPlacementView == placement.value || selectedPlacementView == 'all'"> <ng-container *ngIf="selectedPlacementView == placement.value || selectedPlacementView == 'all'">

View File

@ -1,7 +1,7 @@
import {Component, ElementRef, OnInit, ViewChild} from '@angular/core'; import {Component, ElementRef, OnInit, ViewChild} from '@angular/core';
import {ActivatedRoute, Router} from "@angular/router"; import {ActivatedRoute, Router} from "@angular/router";
import {HelpContentService} from "../../services/help-content.service"; import {HelpContentService} from "../../services/help-content.service";
import {FormArray, UntypedFormArray, UntypedFormBuilder, UntypedFormGroup, ValidatorFn} from "@angular/forms"; import {UntypedFormBuilder, ValidatorFn} from "@angular/forms";
import {Page} from "../../utils/entities/adminTool/page"; import {Page} from "../../utils/entities/adminTool/page";
import {EnvProperties} from '../../utils/properties/env-properties'; import {EnvProperties} from '../../utils/properties/env-properties';
import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {HelperFunctions} from "../../utils/HelperFunctions.class";
@ -21,6 +21,8 @@ import {PluginUtils} from "./utils/pluginUtils";
import {CommunityService} from "../../connect/community/community.service"; import {CommunityService} from "../../connect/community/community.service";
import {CommunityInfo} from "../../connect/community/communityInfo"; import {CommunityInfo} from "../../connect/community/communityInfo";
import {AlertModal} from "../../utils/modal/alert"; import {AlertModal} from "../../utils/modal/alert";
import {Session} from "../../login/utils/helper.class";
import {UserManagementService} from "../../services/user-management.service";
@Component({ @Component({
selector: 'plugins', selector: 'plugins',
@ -62,12 +64,13 @@ export class PluginsComponent implements OnInit {
// editSubmenuOpen = false; // editSubmenuOpen = false;
filterActive = false; filterActive = false;
@ViewChild('deleteModal') deleteModal: AlertModal; @ViewChild('deleteModal') deleteModal: AlertModal;
clearCacheRequests = [];
user;
constructor(private element: ElementRef, private route: ActivatedRoute, private _router: Router, constructor(private element: ElementRef, private route: ActivatedRoute, private _router: Router,
private communityService: CommunityService, private communityService: CommunityService,
private title: Title, private _helpContentService: HelpContentService, private title: Title, private _helpContentService: HelpContentService,
private _pluginsService: PluginsService, private _fb: UntypedFormBuilder, private _pluginsService: PluginsService, private _fb: UntypedFormBuilder,
private _clearCacheService: ClearCacheService) { private _clearCacheService: ClearCacheService, private _userManagementService:UserManagementService) {
} }
ngOnInit() { ngOnInit() {
@ -76,11 +79,24 @@ export class PluginsComponent implements OnInit {
community => { community => {
this.communityInfo = community; this.communityInfo = community;
})); }));
this.subscriptions.push(this._userManagementService.getUserInfo().subscribe( user =>{
this.user = user;
}))
this.subscriptions.push(this.route.params.subscribe(params => { this.subscriptions.push(this.route.params.subscribe(params => {
this.portal = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param]; this.portal = (this.route.snapshot.data.portal) ? this.route.snapshot.data.portal : this.route.snapshot.params[this.route.snapshot.data.param];
this.selectedCommunityPid = params.community; this.selectedCommunityPid = params.community;
//initiate requests for clear cache prompt
this.clearCacheRequests = [];
if (properties.deleteBrowserCacheUrl) {
this.clearCacheRequests.push(properties.deleteBrowserCacheUrl + "/" + this.selectedCommunityPid)
}
if (this.properties.deleteCacheUrl) {
this.clearCacheRequests.push(properties.deleteCacheUrl + "?url=" + encodeURIComponent(properties.utilsService +
"/portals/countResults?field=communityId&value=" + encodeURIComponent(this.selectedCommunityPid)));
}
console.log(this.clearCacheRequests)
this.subscriptions.push(this.route.queryParams.subscribe(params => { this.subscriptions.push(this.route.queryParams.subscribe(params => {
HelperFunctions.scroll(); HelperFunctions.scroll();
this.selectedPageId = params['pageId']; this.selectedPageId = params['pageId'];
@ -370,4 +386,8 @@ export class PluginsComponent implements OnInit {
)); ));
this.showLoading = false; this.showLoading = false;
} }
showClearCache(){
return this.user && (Session.isPortalAdministrator(this.user) || Session.isCommunityCurator(this.user));
}
} }

View File

@ -27,6 +27,7 @@ import {PluginWrapperModule} from "./wrapper/plugin-wrapper.module";
import {SideBarModule} from "../sharedComponents/sidebar/sideBar.module"; import {SideBarModule} from "../sharedComponents/sidebar/sideBar.module";
import {PluginEditWrapperModule} from "./wrapper/plugin-edit-wrapper.module"; import {PluginEditWrapperModule} from "./wrapper/plugin-edit-wrapper.module";
import {TransitionGroupModule} from "../../utils/transition-group/transition-group.module"; import {TransitionGroupModule} from "../../utils/transition-group/transition-group.module";
import {ClearCacheComponent} from "../sharedComponents/clearCache.component";
@NgModule({ @NgModule({
@ -34,7 +35,7 @@ import {TransitionGroupModule} from "../../utils/transition-group/transition-gro
CommonModule, RouterModule, FormsModule, CommonModule, RouterModule, FormsModule,
AlertModalModule, ReactiveFormsModule, AdminToolServiceModule, InputModule, MatAutocompleteModule, MatFormFieldModule, MatChipsModule, AlertModalModule, ReactiveFormsModule, AdminToolServiceModule, InputModule, MatAutocompleteModule, MatFormFieldModule, MatChipsModule,
MatCheckboxModule, AdminTabsModule, PageContentModule, PluginsRoutingModule, SearchInputModule, IconsModule, LoadingModule, CKEditorModule, MatCheckboxModule, AdminTabsModule, PageContentModule, PluginsRoutingModule, SearchInputModule, IconsModule, LoadingModule, CKEditorModule,
MatSlideToggleModule, PluginWrapperModule, SideBarModule, PluginEditWrapperModule, TransitionGroupModule MatSlideToggleModule, PluginWrapperModule, SideBarModule, PluginEditWrapperModule, TransitionGroupModule, ClearCacheComponent
], ],
providers:[PluginsService], providers:[PluginsService],
declarations: [PluginsComponent], declarations: [PluginsComponent],

View File

@ -0,0 +1,36 @@
import {Component, Input} from '@angular/core';
import {PluginURL} from "./base-plugin.component";
import {CommonModule} from "@angular/common";
import {RouterModule} from "@angular/router";
@Component({
imports:[CommonModule, RouterModule],
selector: 'plugin-url',
template: `
<span title="{{previewInAdmin?'Note: links are disabled in administration dashboard':''}}">
<a *ngIf="url.route"
[class]="classAttribute"
[routerLink]="url.url" [class.uk-disabled]=previewInAdmin>
{{url.linkText}}
</a>
<a *ngIf="!url.route" [href]="url.url" [class.uk-hidden]="!(url.url && url.url.length > 0)"
[class]="classAttribute"
[target]="url.target" [class.uk-disabled]=previewInAdmin>
{{url.linkText}}
</a>
</span>
`,
standalone :true
})
export class PluginUrlComponent {
@Input() url:PluginURL;
@Input() previewInAdmin:boolean;
@Input() classAttribute;
htmlEditorView = false;
}

View File

@ -0,0 +1,47 @@
import {Component, Input, ViewChild} from "@angular/core";
import {HttpClient} from "@angular/common/http";
import {AlertModal} from "../../utils/modal/alert";
import {AlertModalModule} from "../../utils/modal/alertModal.module";
import {CommonModule} from "@angular/common";
@Component({
standalone: true,
selector: 'clear-cache',
imports: [AlertModalModule, CommonModule],
template: `
<ng-container *ngIf="requests && requests.length > 0">
<div class="uk-alert uk-padding-xsmall uk-text-small uk-text-center">
Made changes but can't see them?
<a (click)="promtToClear()">Try to clear the cache</a> to resolve the issue.
</div>
<modal-alert #deleteCacheModal [overflowBody]="false" (alertOutput)="clear()"
classTitle="uk-background-primary uk-light"></modal-alert>
</ng-container>
`,
})
export class ClearCacheComponent {
@Input() requests:string[] ;
@ViewChild('deleteCacheModal') deleteCacheModal: AlertModal;
constructor(private http: HttpClient ) {
}
promtToClear(){
this.deleteCacheModal.alertTitle = 'Confirm Cache Clear';
this.deleteCacheModal.message = 'Are you sure you want to clear the service cache?';
this.deleteCacheModal.okButtonText = 'Yes';
this.deleteCacheModal.open();
}
clear(){
for( let request of this.requests){
this.http.get(request).subscribe( res => {
console.log( res);
});
}
}
}

View File

@ -599,7 +599,8 @@ export class ParsingFunctions {
if (pid.classid == "doi" || pid.classid == "pmc" || pid.classid == "handle" || pid.classid == "pmid" || pid.classid == "re3data" if (pid.classid == "doi" || pid.classid == "pmc" || pid.classid == "handle" || pid.classid == "pmid" || pid.classid == "re3data"
|| pid.classid == "swhid" || pid.classid == "swhid"
|| pid.classid == "ROR" || pid.classid == "ISNI" || pid.classid == "Wikidata" || pid.classid == "FundRef" || pid.classid == "ROR" || pid.classid == "ISNI" || pid.classid == "Wikidata" || pid.classid == "FundRef"
|| pid.classid == "RRID") { || pid.classid == "RRID"
|| pid.classid == "arXiv") {
if (!identifiers.has(pid.classid)) { if (!identifiers.has(pid.classid)) {
identifiers.set(pid.classid, new Array<string>()); identifiers.set(pid.classid, new Array<string>());
} }
@ -610,7 +611,8 @@ export class ParsingFunctions {
if (pid[i].classid == "doi" || pid[i].classid == "pmc" || pid[i].classid == "handle" || pid[i].classid == "pmid" || pid[i].classid == "re3data" if (pid[i].classid == "doi" || pid[i].classid == "pmc" || pid[i].classid == "handle" || pid[i].classid == "pmid" || pid[i].classid == "re3data"
|| pid[i].classid == "swhid" || pid[i].classid == "swhid"
|| pid[i].classid == "ROR" || pid[i].classid == "ISNI" || pid[i].classid == "Wikidata" || pid[i].classid == "FundRef" || pid[i].classid == "ROR" || pid[i].classid == "ISNI" || pid[i].classid == "Wikidata" || pid[i].classid == "FundRef"
|| pid[i].classid == "RRID") { || pid[i].classid == "RRID"
|| pid[i].classid == "arXiv") {
if (!identifiers.has(pid[i].classid)) { if (!identifiers.has(pid[i].classid)) {
identifiers.set(pid[i].classid, new Array<string>()); identifiers.set(pid[i].classid, new Array<string>());
} }

View File

@ -27,7 +27,8 @@ import {properties} from "../../../../environments/environment";
<span [class.uk-margin-small-left]="modal"> <span [class.uk-margin-small-left]="modal">
<ng-container *ngFor="let item of identifiers.get(key) let j=index"> <ng-container *ngFor="let item of identifiers.get(key) let j=index">
<a *ngIf="key == 'doi' || key == 'pmc' || key == 'pmid' || key == 'handle' || key == 're3data' || key == 'swhid' <a *ngIf="key == 'doi' || key == 'pmc' || key == 'pmid' || key == 'handle' || key == 're3data' || key == 'swhid'
|| key == 'ROR' || key == 'ISNI' || key == 'Wikidata' || key == 'FundRef' || key == 'RRID'" || key == 'ROR' || key == 'ISNI' || key == 'Wikidata' || key == 'FundRef' || key == 'RRID'
|| key == 'arXiv'"
[href]="getUrl(key, item) + item" target="_blank" class="uk-display-inline-block custom-external"> [href]="getUrl(key, item) + item" target="_blank" class="uk-display-inline-block custom-external">
{{item}} {{item}}
</a> </a>
@ -140,6 +141,8 @@ export class ShowIdentifiersComponent implements AfterViewInit {
return properties.fundRefURL; return properties.fundRefURL;
} else if(key == "RRID") { } else if(key == "RRID") {
return properties.rridURL; return properties.rridURL;
} else if(key == "arXiv") {
return properties.arxivURL;
} }
} }

View File

@ -148,56 +148,6 @@
<div [attr.style]="'margin-top: '+(graph_height? 'calc(40px + 20px - '+graph_height+'px)': '40px')"> <div [attr.style]="'margin-top: '+(graph_height? 'calc(40px + 20px - '+graph_height+'px)': '40px')">
<div class="uk-grid uk-grid-small" uk-grid> <div class="uk-grid uk-grid-small" uk-grid>
<div class="uk-width-expand"> <div class="uk-width-expand">
<!-- Actions for mobile viewport -->
<div class="uk-flex uk-flex-right uk-margin-medium-bottom uk-hidden@s">
<div class="uk-margin-small-right">
<a (click)="openAddThisModal()"
[title]="'Share this '+openaireEntities.PROJECT+' in your social networks'"
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
<icon name="share" visuallyHidden="share"></icon>
</span>
</a>
</div>
<div *ngIf="isRouteAvailable('participate/direct-claim')" class="uk-margin-small-right"
[title]="'<span class=\'uk-flex uk-flex-middle\'>Link this project to '+openaireEntities.RESULTS+'<span class=\'material-icons uk-margin-small-left\'>east</span></span>'"
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
<a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[projectId, 'project','result'])"
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
<icon name="link" visuallyHidden="link"></icon>
</span>
</a>
</div>
<div *ngIf="isRouteAvailable('participate/deposit/learn-how')" class="uk-margin-small-right"
[title]="'<span class=\'uk-flex uk-flex-middle\'>Deposit your research <span class=\'material-icons uk-margin-small-left\'>east</span></span>'"
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
<a routerLinkActive="router-link-active" routerLink="/participate/deposit/learn-how">
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
<icon name="upload" visuallyHidden="upload"></icon>
</span>
</a>
</div>
<div class="uk-margin-small-right"
[title]="'Embed results'"
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
<a class="uk-link-text uk-text-bold uk-text-uppercase" (click)="openEmbedResultsModal()">
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
<icon name="code" visuallyHidden="code"></icon>
</span>
</a>
</div>
<div class=""
[title]="'Download report'"
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
<a class="uk-link-text uk-text-bold uk-text-uppercase" (click)="openDownloadReportModal()">
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
<icon name="download" visuallyHidden="download"></icon>
</span>
</a>
</div>
</div>
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0" <helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']"></helper> [texts]="pageContents['top']"></helper>
@ -543,7 +493,7 @@
</div> </div>
<hr class="uk-margin-remove"> <hr class="uk-margin-remove">
</ng-container> </ng-container>
<ng-container> <ng-container *ngIf="properties.environment !== 'beta'">
<div class="uk-padding-small uk-padding-remove-horizontal"> <div class="uk-padding-small uk-padding-remove-horizontal">
<div class="clickable" (click)="openFsModal(embedResultsFsModal, 'Embed results')"> <div class="clickable" (click)="openFsModal(embedResultsFsModal, 'Embed results')">
<div class="uk-button-link uk-flex uk-flex-middle uk-h6 uk-margin-xsmall-bottom"> <div class="uk-button-link uk-flex uk-flex-middle uk-h6 uk-margin-xsmall-bottom">
@ -656,10 +606,6 @@
<addThis></addThis> <addThis></addThis>
</modal-alert> </modal-alert>
<modal-alert *ngIf="projectInfo" #embedResultsModal large="true">
<ng-container *ngTemplateOutlet="embed_content"></ng-container>
</modal-alert>
<modal-alert *ngIf="projectInfo" #downloadReportModal> <modal-alert *ngIf="projectInfo" #downloadReportModal>
<ng-container *ngTemplateOutlet="download_content"></ng-container> <ng-container *ngTemplateOutlet="download_content"></ng-container>
</modal-alert> </modal-alert>

View File

@ -91,7 +91,6 @@ export class ProjectComponent {
// @ViewChild('statisticsModal') statisticsModal; // @ViewChild('statisticsModal') statisticsModal;
// @ViewChild('linkProjectModal') linkProjectModal; // @ViewChild('linkProjectModal') linkProjectModal;
@ViewChild('embedResultsModal') embedResultsModal;
@ViewChild('embedResultsFsModal') embedResultsFsModal: FullScreenModalComponent; @ViewChild('embedResultsFsModal') embedResultsFsModal: FullScreenModalComponent;
@ViewChild('downloadReportModal') downloadReportModal; @ViewChild('downloadReportModal') downloadReportModal;
@ViewChild('downloadReportFsModal') downloadReportFsModal: FullScreenModalComponent; @ViewChild('downloadReportFsModal') downloadReportFsModal: FullScreenModalComponent;
@ -662,13 +661,6 @@ export class ProjectComponent {
this.addThisModal.open(); this.addThisModal.open();
} }
public openEmbedResultsModal() {
this.embedResultsModal.cancelButton = false;
this.embedResultsModal.okButton = false;
this.embedResultsModal.alertTitle = "Embed results";
this.embedResultsModal.open();
}
public openDownloadReportModal() { public openDownloadReportModal() {
if(this.fetchPublications.searchUtils.totalResults > 0 || this.fetchDatasets.searchUtils.totalResults > 0 || if(this.fetchPublications.searchUtils.totalResults > 0 || this.fetchDatasets.searchUtils.totalResults > 0 ||
this.fetchSoftware.searchUtils.totalResults > 0 || this.fetchOrps.searchUtils.totalResults > 0) { this.fetchSoftware.searchUtils.totalResults > 0 || this.fetchOrps.searchUtils.totalResults > 0) {

View File

@ -245,8 +245,13 @@ export class ProjectService {
} }
if (this.projectInfo.funding && this.projectInfo.funding.funderShortName == "EC") { if (this.projectInfo.funding && this.projectInfo.funding.funderShortName == "EC") {
this.projectInfo.url = properties.cordisURL + this.projectInfo.funding.code; if(this.projectInfo.funding.fundingStream && this.projectInfo.funding.fundingStream.includes("ERASMUS+")) {
this.projectInfo.urlInfo = "Detailed project information (CORDIS)"; this.projectInfo.url = properties.erasmusURL + this.projectInfo.funding.code;
this.projectInfo.urlInfo = "Detailed project information (ERASMUS+)";
} else {
this.projectInfo.url = properties.cordisURL + this.projectInfo.funding.code;
this.projectInfo.urlInfo = "Detailed project information (CORDIS)";
}
} }
if (data[0]?.measure) { if (data[0]?.measure) {

View File

@ -43,7 +43,7 @@ import {EnvProperties} from "../properties/env-properties";
<span *ngIf="!compactView" 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 && properties.environment !== 'beta'">
<a (click)="openEmbedResultsModal()" <a (click)="openEmbedResultsModal()"
[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'">

View File

@ -43,6 +43,7 @@ export interface EnvProperties {
pmcURL?: string; pmcURL?: string;
pmidURL?: string; pmidURL?: string;
handleURL?: string; handleURL?: string;
erasmusURL?: string;
cordisURL?: string; cordisURL?: string;
openDoarURL?: string; openDoarURL?: string;
r3DataURL?: string; r3DataURL?: string;
@ -52,6 +53,7 @@ export interface EnvProperties {
wikiDataURL?: string; wikiDataURL?: string;
fundRefURL?: string; fundRefURL?: string;
rridURL?: string; rridURL?: string;
arxivURL?: string;
fairSharingURL?: string, fairSharingURL?: string,
openScienceCloudURL?: string, openScienceCloudURL?: string,
eoscMarketplaceURL?: string, eoscMarketplaceURL?: string,

View File

@ -16,6 +16,7 @@ export let common: EnvProperties = {
pmcURL: "http://europepmc.org/articles/", pmcURL: "http://europepmc.org/articles/",
pmidURL: "https://www.ncbi.nlm.nih.gov/pubmed/", pmidURL: "https://www.ncbi.nlm.nih.gov/pubmed/",
handleURL: "http://hdl.handle.net/", handleURL: "http://hdl.handle.net/",
erasmusURL: "https://erasmus-plus.ec.europa.eu/it/projects/search/details/",
cordisURL: "http://cordis.europa.eu/projects/", cordisURL: "http://cordis.europa.eu/projects/",
openDoarURL: "http://v2.sherpa.ac.uk/id/repository/", openDoarURL: "http://v2.sherpa.ac.uk/id/repository/",
r3DataURL: "http://service.re3data.org/repository/", r3DataURL: "http://service.re3data.org/repository/",
@ -25,6 +26,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/",
rridURL: "https://scicrunch.org/resolver/", rridURL: "https://scicrunch.org/resolver/",
arxivURL: "https://arxiv.org/abs/",
fairSharingURL: "https://fairsharing.org/", fairSharingURL: "https://fairsharing.org/",
openScienceCloudURL: "https://open-science-cloud.ec.europa.eu/resources/services/", openScienceCloudURL: "https://open-science-cloud.ec.europa.eu/resources/services/",
sherpaURL: "http://sherpa.ac.uk/romeo/issn/", sherpaURL: "http://sherpa.ac.uk/romeo/issn/",
@ -103,11 +105,11 @@ export let commonDev: EnvProperties = {
statisticsFrameAPIURL: "https://beta.openaire.eu/stats/", statisticsFrameAPIURL: "https://beta.openaire.eu/stats/",
statisticsFrameNewAPIURL: "https://beta.services.openaire.eu/stats-tool/", statisticsFrameNewAPIURL: "https://beta.services.openaire.eu/stats-tool/",
claimsAPIURL: "http://dl170.madgik.di.uoa.gr:19780/uoa-claims-service/claimsService/", claimsAPIURL: "http://dl170.madgik.di.uoa.gr:19780/uoa-claims-service/claimsService/",
searchAPIURLLAst: "http://beta.services.openaire.eu/search/v2/api/", searchAPIURLLAst: "http://services.openaire.eu/search/v2/api/",
searchResourcesAPIURL: "https://beta.services.openaire.eu/search/v2/api/resources", searchResourcesAPIURL: "https://services.openaire.eu/search/v2/api/resources",
openCitationsAPIURL: "https://services.openaire.eu/opencitations/getCitations?id=", openCitationsAPIURL: "https://services.openaire.eu/opencitations/getCitations?id=",
csvAPIURL: "https://beta.services.openaire.eu/search/v2/api/reports", csvAPIURL: "https://services.openaire.eu/search/v2/api/reports",
orcidAPIURL: "http://dl170.madgik.di.uoa.gr:19480/uoa-orcid-service/", orcidAPIURL: "http://dl170.madgik.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",

View File

@ -150,7 +150,7 @@ export class DOI {
} }
export class Identifier { export class Identifier {
class: "doi" | "pmc" | "pmid" | "handle" | "ORCID" | "re3data" | "swhid" | "ror" | "wikidata" | "fundref" | "isni" | "RRID" = null; class: "doi" | "pmc" | "pmid" | "handle" | "ORCID" | "re3data" | "swhid" | "ror" | "wikidata" | "fundref" | "isni" | "RRID" | "arXiv" = null;
id: string; id: string;
public static getDOIsFromString(str: string): string[] { public static getDOIsFromString(str: string): string[] {
@ -215,13 +215,15 @@ export class Identifier {
return {"class": "isni", "id": pid}; return {"class": "isni", "id": pid};
} else if(Identifier.isValidRrid(pid)) { } else if(Identifier.isValidRrid(pid)) {
return {"class": "RRID", "id": pid}; return {"class": "RRID", "id": pid};
} else if(Identifier.isValidArxiv(pid)) {
return {"class": "arXiv", "id": pid};
} }
//set it as a doi, to catch the case that doi has not valid format //set it as a doi, to catch the case that doi has not valid format
return (strict?null:{"class": "doi", "id": pid}); return (strict?null:{"class": "doi", "id": pid});
} }
public static getPIDFromIdentifiers(identifiers: Map<string, string[]>): Identifier { public static getPIDFromIdentifiers(identifiers: Map<string, string[]>): Identifier {
let classes:string [] = ["doi", "handle", "pmc", "pmid", "re3data", "swhid", "ror", "wikidata", "fundref", "isni", "rrid"]; let classes:string [] = ["doi", "handle", "pmc", "pmid", "re3data", "swhid", "ror", "wikidata", "fundref", "isni", "rrid", "arXiv"];
if(identifiers && identifiers.size > 0) { if(identifiers && identifiers.size > 0) {
for (let cl of classes) { for (let cl of classes) {
if (identifiers.get(cl)) { if (identifiers.get(cl)) {
@ -309,6 +311,14 @@ export class Identifier {
let exp = /^RRID:.*$/g; let exp = /^RRID:.*$/g;
return str.match(exp) != null; return str.match(exp) != null;
} }
public static isValidArxiv(str: string): boolean {
// YYMM.NNNNN
// YYMM.NNNN
// arch-ive/YYMMNNN - hep-th/
let exp = /^([0-9]{2}(0[1-9]|1[0-2])\.[0-9]{3,4})|hep-th\/([0-9]{2}(0[1-9]|1[0-2])[0-9]{3})\w+$/g;
return str.match(exp) != null;
}
} }
export class StringUtils { export class StringUtils {