[Trunk | Connect]:

1. app-routing.module.ts: Added paths "orcid" and "my-orcid-links".
2. app.component.ts: Added "My ORCID links" in usermenu.
3. environment.beta.ts & environment.prod.ts && environment.ts: Added property "myOrcidLinksPage".
4. Added folder "orcid" and files for ORCID Search & Link functionality.


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@60879 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2021-04-16 09:14:07 +00:00
parent 93ab3a8a00
commit 60f54a0574
11 changed files with 155 additions and 3 deletions

View File

@ -5,6 +5,10 @@ import {PageURLResolverComponent} from "./openaireLibrary/utils/pageURLResolver.
import {IsCommunity} from "./openaireLibrary/connect/communityGuard/isCommunity.guard";
const routes: Routes = [
// ORCID Pages
{path: 'orcid', loadChildren: './orcid/orcid.module#LibOrcidModule'},
{path: 'my-orcid-links', loadChildren: './orcid/my-orcid-links/myOrcidLinks.module#LibMyOrcidLinksModule'},
/** Other Pages */
{path: '', loadChildren: './communitywrapper/communityWrapper.module#CommunityWrapperModule'},
{path: 'about', redirectTo: 'about/learn-how', pathMatch: 'full'},

View File

@ -265,6 +265,7 @@ export class AppComponent {
}
if (this.user) {
this.userMenuItems = [ /*new MenuItem("","My profile","","",false,[],[],{}),*/
new MenuItem("", "My ORCID links", "", "/my-orcid-links", false, [], [], {}),
new MenuItem("", "My links", "", "/myclaims", false, [], ["/myclaims"], {}),
new MenuItem("", "Invite users", "", "/invite", false, [], [], {}),
];

View File

@ -0,0 +1,20 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import {PreviousRouteRecorder} from "../../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
import {OpenaireMyOrcidLinksComponent} from "./myOrcidLinks.component";
import {LoginGuard} from "../../openaireLibrary/login/loginGuard.guard";
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: OpenaireMyOrcidLinksComponent,
canActivate: [LoginGuard], data: {
redirect: '/error', community : 'openaire'
},
canDeactivate: [PreviousRouteRecorder]
}
])
]
})
export class MyOrcidLinksRoutingModule { }

View File

@ -0,0 +1,44 @@
import {Component} from '@angular/core';
import {ActivatedRoute} from "@angular/router";
import {Subscriber, Subscription} from "rxjs";
import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties";
import {properties} from "../../../environments/environment";
import {CommunityService} from "../../openaireLibrary/connect/community/community.service";
import {PiwikHelper} from "../../utils/piwikHelper";
@Component({
selector: 'openaire-my-orcid-links',
template: `
<my-orcid-links [piwikSiteId]=piwikSiteId
[communityId]="communityId"></my-orcid-links>
`
})
export class OpenaireMyOrcidLinksComponent {
properties: EnvProperties = properties;
piwikSiteId = null;
public communityId = null;
subs: Subscription[] = [];
constructor(private route: ActivatedRoute, private _communityService: CommunityService) {}
public ngOnInit() {
this.subs.push(this._communityService.getCommunityAsObservable().subscribe(
community => {
if(community) {
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId, this.properties.environment);
this.communityId = community.communityId;
}
}));
}
public ngOnDestroy() {
for (let sub of this.subs) {
if (sub instanceof Subscriber) {
sub.unsubscribe();
}
}
}
}

View File

@ -0,0 +1,24 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import {PreviousRouteRecorder} from "../../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
import {OpenaireMyOrcidLinksComponent} from './myOrcidLinks.component';
import {MyOrcidLinksModule} from "../../openaireLibrary/orcid/my-orcid-links/myOrcidLinks.module";
import {MyOrcidLinksRoutingModule} from "./myOrcidLinks-routing.module";
import {LoginGuard} from "../../openaireLibrary/login/loginGuard.guard";
@NgModule({
imports: [
CommonModule, FormsModule,
MyOrcidLinksModule,
MyOrcidLinksRoutingModule
],
declarations: [
OpenaireMyOrcidLinksComponent
],
exports: [
OpenaireMyOrcidLinksComponent
],
providers: [PreviousRouteRecorder, LoginGuard]
})
export class LibMyOrcidLinksModule { }

View File

@ -0,0 +1,20 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import {OpenaireOrcidComponent} from './orcid.component';
import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
import {LoginGuard} from "../openaireLibrary/login/loginGuard.guard";
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: OpenaireOrcidComponent,
canActivate: [LoginGuard], data: {
redirect: '/error', community : 'openaire'
},
canDeactivate: [PreviousRouteRecorder] }
])
]
})
export class OrcidRoutingModule { }

View File

@ -0,0 +1,10 @@
import { Component } from '@angular/core';
@Component({
selector: 'openaire-orcid',
template: `
<orcid></orcid>
`
})
export class OpenaireOrcidComponent {}

View File

@ -0,0 +1,24 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {OpenaireOrcidComponent} from './orcid.component';
import {OrcidRoutingModule} from './orcid-routing.module';
import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
import {FormsModule} from "@angular/forms";
import {OrcidModule} from "../openaireLibrary/orcid/orcid.module";
import {LoginGuard} from "../openaireLibrary/login/loginGuard.guard";
@NgModule({
imports: [
CommonModule, FormsModule,
OrcidModule, OrcidRoutingModule
],
declarations: [
OpenaireOrcidComponent
],
providers: [PreviousRouteRecorder, LoginGuard],
exports: [
OpenaireOrcidComponent
]
})
export class LibOrcidModule { }

View File

@ -129,5 +129,7 @@ export let properties: EnvProperties = {
indexInfoAPI: "https://beta.services.openaire.eu/openaire/info/",
altMetricsAPIURL: "https://api.altmetric.com/v1/doi/",
b2noteAPIURL: 'https://b2note.eudat.eu/',
adminPortalURL: "https://beta.admin.connect.openaire.eu"
adminPortalURL: "https://beta.admin.connect.openaire.eu",
myOrcidLinksPage: "/my-orcid-links"
};

View File

@ -128,5 +128,7 @@ export let properties: EnvProperties = {
lastIndexUpdate: "2019-07-24",
indexInfoAPI: "https://services.openaire.eu/openaire/info/",
altMetricsAPIURL: "https://api.altmetric.com/v1/doi/",
adminPortalURL: "https://admin.connect.openaire.eu"
adminPortalURL: "https://admin.connect.openaire.eu",
myOrcidLinksPage: "/my-orcid-links"
};

View File

@ -118,5 +118,6 @@ export let properties: EnvProperties = {
indexInfoAPI: 'https://dev-openaire.d4science.org/openaire/info/',
altMetricsAPIURL: 'https://api.altmetric.com/v1/doi/',
b2noteAPIURL: 'https://b2note.eudat.eu/',
adminPortalURL: 'https://beta.admin.connect.openaire.eu'
adminPortalURL: 'https://beta.admin.connect.openaire.eu',
myOrcidLinksPage: "/my-orcid-links"
};