[Aggregator|Trunk]

- use mock admin tool response for enabled entities/ pages
- disable helptexts
- remove unused components
- add again isRoute enabled for claims/ deposit pages



git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-aggregator-portal/trunk@59969 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2020-11-25 17:39:05 +00:00
parent de6cd40fc1
commit fcf246099e
20 changed files with 67 additions and 228 deletions

View File

@ -93,10 +93,8 @@ const routes: Routes = [
// Linking Pages
{ path: 'myclaims', loadChildren: './claims/myClaims/myClaims.module#LibMyClaimsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
{ path: 'claims', loadChildren: './claims/claimsAdmin/claimsAdmin.module#LibClaimsAdminModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
{ path: 'participate/claim', loadChildren: './claims/linking/linkingGeneric.module#LibLinkingGenericModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
{ path: 'participate/direct-claim', loadChildren: './claims/directLinking/directLinking.module#LibDirectLinkingModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
{ path: 'claims-project-manager', loadChildren: './claims/claimsByToken/claimsByToken.module#LibClaimsByTokenModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
{path: 'user-info', loadChildren: './login/libUser.module#LibUserModule'},
{path: 'error', component: OpenaireErrorPageComponent},
{path: '**', pathMatch: 'full', component: OpenaireErrorPageComponent}

View File

@ -1,10 +1,8 @@
import {Component} from '@angular/core';
import {ActivatedRoute, NavigationEnd, NavigationStart, Router} from '@angular/router';
import {EnvProperties} from './openaireLibrary/utils/properties/env-properties';
import {MenuItem, RootMenuItem} from './openaireLibrary/sharedComponents/menu';
import {EnvironmentSpecificService} from './openaireLibrary/utils/properties/environment-specific.service';
import {HelperFunctions} from "./openaireLibrary/utils/HelperFunctions.class";
import {FilterInfo, PortalAggregators} from "./utils/aggregators";
import {UserManagementService} from "./openaireLibrary/services/user-management.service";
import {User} from "./openaireLibrary/login/utils/helper.class";
@ -12,6 +10,8 @@ import {Header} from "./openaireLibrary/sharedComponents/navigationBar.component
import {portalProperties} from "../environments/environment-aggregator";
import {properties} from "../environments/environment";
import {ConnectHelper} from "./openaireLibrary/connect/connectHelper";
import {ConfigurationService} from "./openaireLibrary/utils/configuration/configuration.service";
import {Subscriber} from "rxjs";
@Component({
selector: 'app-root',
@ -53,11 +53,22 @@ export class AppComponent {
footer = portalProperties.sectionFooter;
header: Header;
agg: FilterInfo = null;
subscriptions = [];
constructor(private propertiesService: EnvironmentSpecificService,
private userManagementService: UserManagementService) {
private userManagementService: UserManagementService, private configurationService: ConfigurationService) {
this.id = ConnectHelper.getCommunityFromDomain(this.properties.domain);
this.agg = PortalAggregators.getFilterInfoByMenuId(this.id);
this.configurationService.initStaticCommunityInformation(PortalAggregators.getCommunityInfoByMenuId(this.id));
}
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
subscription.unsubscribe();
}
});
this.configurationService.clearSubscriptions();
this.userManagementService.clearSubscriptions();
}
ngOnInit() {
if (typeof document !== 'undefined') {
this.isClient = true;
@ -76,56 +87,41 @@ export class AppComponent {
};
this.buildMenu();
}
this.userManagementService.getUserInfo().subscribe(user => {
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
this.user = user;
this.loginCheck = true;
this.userMenuItems = [];
if (this.user) {
this.userMenuItems.push(new MenuItem("", "User information", "", "/user-info", false, [], [], {}));
}
});
}));
}
private buildMenu() {
this.menuItems = [
{rootItem: new MenuItem("home", "Home", "", "/", false, [], null, {}), items: []},
{
rootItem: new MenuItem("search", "Search", "", "/search/find", false, [], null, {}),
rootItem: new MenuItem("search", "Search", "", "/search/find", false, [], ["/search/find"], {}),
items: []
},
{
rootItem: new MenuItem("deposit", "Deposit", "", "/participate/deposit/learn-how", false, [], null, {}),
//rootItem: new MenuItem("deposit", "Deposit", "", "/participate/deposit/learn-how", false, [], ["/participate/deposit/learn-how"], {}),
rootItem: new MenuItem("deposit", "Deposit", "", "/participate/deposit/learn-how", false, [], ["/participate/deposit/learn-how"], {}),
items: []
//rootItem: new MenuItem("share", "Share", "", "", false, [], null, {}),
//items: [new MenuItem("", "Publications", "", "/participate/deposit-publications", false, ["publication"], null, {}),
// new MenuItem("", "Research Data", "", "/participate/deposit-datasets", false, ["dataset"], null, {})]
},
{
rootItem: new MenuItem("link", "Link", "", "/participate/claim", false, [], null, {}),
items: [new MenuItem("", "Start linking", "", "/participate/claim", false, [], null, {}),
rootItem: new MenuItem("link", "Link", "", "/participate/claim", false, [], ["/participate/claim"], {}),
items: [new MenuItem("", "Start linking", "", "/participate/claim", false, [], ["/participate/claim"], {}),
new MenuItem("", "Learn more", this.properties.claimsInformationLink, "", false, [], [], {})]
}
];
let params = {};
params[this.agg.queryFieldName] = this.agg.valueId;
if ((portalProperties.entities.publication.isEnabled && portalProperties.entities.publication.simpleSearchPage) ||
(portalProperties.entities.dataset.isEnabled && portalProperties.entities.dataset.simpleSearchPage) ||
(portalProperties.entities.software.isEnabled && portalProperties.entities.software.simpleSearchPage) ||
portalProperties.entities.other.isEnabled && portalProperties.entities.other.simpleSearchPage) {
this.menuItems[1].items.push(new MenuItem("", "Research outcomes", "", "/search/find/research-outcomes", false, [], ["/search/find/research-outcomes"], params))
this.menuItems[1].items.push(new MenuItem("", "Research outcomes", "", "/search/find/research-outcomes", false, [], [], params))
}
this.menuItems[1].items.push(new MenuItem("", "Projects", "", "/search/find/projects", false, ["project"], ["/search/find/projects"],
{cf: true}));
this.menuItems[1].items.push(new MenuItem("", "Content Providers", "", "/search/find/dataproviders", false, ["datasource"], ["/search/find/dataproviders"], params))
this.menuItems[1].items.push(new MenuItem("", "Organizations", "", "/search/find/organizations", false, ["organization"], ["/search/find/organizations"], params))
if (portalProperties.entities.project.isEnabled && portalProperties.entities.project.simpleSearchPage) {
this.menuItems[1].items.push(new MenuItem("", "Projects", "", "/search/find/projects/", false, [], [],
{cf: true}))
}
if (portalProperties.entities.datasource.isEnabled && portalProperties.entities.datasource.simpleSearchPage) {
this.menuItems[1].items.push(new MenuItem("", "Content Providers", "", "/search/find/dataproviders", false, [], [], params))
}
if (portalProperties.entities.organization.isEnabled && portalProperties.entities.organization.simpleSearchPage) {
this.menuItems[1].items.push(new MenuItem("", "Organizations", "", "/search/find/organizations/", false, [], [], params))
}
}
}

View File

@ -20,6 +20,7 @@ import {AppRoutingModule} from './app-routing.module';
import {HttpInterceptorService} from "./openaireLibrary/http-interceptor.service";
import {ErrorInterceptorService} from "./openaireLibrary/error-interceptor.service";
import {DEFAULT_TIMEOUT, TimeoutInterceptor} from "./openaireLibrary/timeout-interceptor.service";
import {ConfigurationService} from "./openaireLibrary/utils/configuration/configuration.service";
@NgModule({
@ -39,7 +40,7 @@ import {DEFAULT_TIMEOUT, TimeoutInterceptor} from "./openaireLibrary/timeout-int
declarations: [AppComponent, OpenaireErrorPageComponent],
exports: [AppComponent],
providers: [
EnvironmentSpecificResolver,
EnvironmentSpecificResolver, ConfigurationService,
{
provide: HTTP_INTERCEPTORS,
useClass: HttpInterceptorService,

View File

@ -1,15 +0,0 @@
import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {OpenaireClaimsAdminComponent} from './claimsAdmin.component';
import {ClaimsCuratorGuard} from '../../openaireLibrary/login/claimsCuratorGuard.guard';
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: OpenaireClaimsAdminComponent, canActivate: [ClaimsCuratorGuard],
data: {redirect: '/error', community : 'openaire'}, canDeactivate: [PreviousRouteRecorder]}])
]
})
export class ClaimsAdminRoutingModule { }

View File

@ -1,35 +0,0 @@
import {Component} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
import {Subscriber} from "rxjs";
@Component({
selector: 'openaire-claims-admin',
template: `
<claims-admin *ngIf="claimsInfoURL && userInfoURL" [claimsInfoURL]=claimsInfoURL [userInfoURL]="userInfoURL">
</claims-admin>
`,
})
export class OpenaireClaimsAdminComponent {
claimsInfoURL:string;
userInfoURL: string;
sub;
constructor (private route: ActivatedRoute) {
}
ngOnDestroy() {
if (this.sub instanceof Subscriber) {
this.sub.unsubscribe();
}
}
public ngOnInit() {
this.sub = this.route.data
.subscribe((data: { envSpecific: EnvProperties }) => {
this.claimsInfoURL = data.envSpecific.claimsInformationLink;
this.userInfoURL = data.envSpecific.userInfoUrl;
});
}
}

View File

@ -1,23 +0,0 @@
import { NgModule } from '@angular/core';
import { SharedModule } from '../../shared/shared.module';
import { OpenaireClaimsAdminComponent } from './claimsAdmin.component';
import { ClaimsAdminRoutingModule } from './claimsAdmin-routing.module';
import{ClaimsAdminModule } from '../../openaireLibrary/claims/claimsAdmin/claimsAdmin.module';
import{ ClaimsCuratorGuard} from '../../openaireLibrary/login/claimsCuratorGuard.guard';
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard';
@NgModule({
imports: [
SharedModule,
ClaimsAdminRoutingModule,
ClaimsAdminModule
],
providers:[ClaimsCuratorGuard, PreviousRouteRecorder,IsRouteEnabled],
declarations: [
OpenaireClaimsAdminComponent
]
})
export class LibClaimsAdminModule { }

View File

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

View File

@ -1,11 +0,0 @@
import {Component} from '@angular/core';
@Component({
selector: 'openaire-claims-project-manager',
template: `
<claims-project-manager></claims-project-manager>
`,
})
export class OpenaireClaimsByTokenComponent {
}

View File

@ -1,30 +0,0 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { SharedModule } from '../../shared/shared.module';
import { OpenaireClaimsByTokenComponent } from './claimsByToken.component';
import {ClaimsByTokenModule} from '../../openaireLibrary/claims/claimsByToken/claimsByToken.module';
import {LoginGuard} from '../../openaireLibrary/login/loginGuard.guard';
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard';
import { ClaimsByTokenRoutingModule } from './claimsByToken-routing.module';
@NgModule({
imports: [
RouterModule,
SharedModule,
ClaimsByTokenModule,
ClaimsByTokenRoutingModule
],
providers:[
LoginGuard, PreviousRouteRecorder, IsRouteEnabled
],
declarations: [
OpenaireClaimsByTokenComponent
],
exports: [
OpenaireClaimsByTokenComponent
]
})
export class LibClaimsByTokenModule { }

View File

@ -4,12 +4,13 @@ import {RouterModule} from '@angular/router';
import {OpenaireDirectLinkingComponent} from './directLinking.component';
import {LoginGuard} from '../../openaireLibrary/login/loginGuard.guard';
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {IsRouteEnabled} from "../../openaireLibrary/error/isRouteEnabled.guard";
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: OpenaireDirectLinkingComponent, canActivate: [LoginGuard], data: {
{ path: '', component: OpenaireDirectLinkingComponent, canActivate: [IsRouteEnabled, LoginGuard], data: {
redirect: '/error', community : 'openaire'
}, canDeactivate: [PreviousRouteRecorder]},

View File

@ -3,12 +3,13 @@ import {RouterModule} from '@angular/router';
import {OpenaireLinkingComponent} from './linkingGeneric.component';
import {LoginGuard} from '../../openaireLibrary/login/loginGuard.guard';
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {IsRouteEnabled} from "../../openaireLibrary/error/isRouteEnabled.guard";
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: OpenaireLinkingComponent, canActivate: [LoginGuard], data: {
{ path: '', component: OpenaireLinkingComponent, canActivate: [IsRouteEnabled, LoginGuard], data: {
redirect: '/error', community : 'openaire'
}, canDeactivate: [PreviousRouteRecorder]},

View File

@ -4,12 +4,13 @@ import {RouterModule} from '@angular/router';
import {OpenaireMyClaimsComponent} from './myClaims.component';
import {LoginGuard} from '../../openaireLibrary/login/loginGuard.guard';
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {IsRouteEnabled} from "../../openaireLibrary/error/isRouteEnabled.guard";
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: OpenaireMyClaimsComponent, canActivate: [LoginGuard],
{ path: '', component: OpenaireMyClaimsComponent, canActivate: [IsRouteEnabled, LoginGuard],
data: {redirect: '/error', community : 'openaire'}, canDeactivate: [PreviousRouteRecorder]}])
]
})

View File

@ -1,51 +0,0 @@
// import {Component, Input} from '@angular/core';
// import {Observable} from 'rxjs/Observable';
// import { Router } from '@angular/router';
//
//
//
// @Component({
// selector: 'my-claims-demo',
// template: `
// <div *ngIf="user" class="container">
// <div class="page-header">
// <h1> My Claims Demo</h1>
// </div>
// <div>
// <div class=""><a routerLink="/Linking">Linking</a></div>
// <div class=""><a routerLink]="/MyClaims">MyClaims</a></div>
// <div class=""><a routerLink="/Claims">Claims Admin</a></div>
// <p> Extra parameters for claims admin</p>
// <div class=""><a href="claims?fetchBy=User&fetchId=amelie.baecker@uni-bielefeld.de">Claims By user</a></div>
// <div class=""><a href="claims?fetchBy=Project&fetchId=corda_______::2c37878a0cede85dbbd1081bb9b4a2f8">Claims By project</a></div>
// <div class=""><a href="claims?fetchBy=Context&fetchId=egi::country::gr">Claims By context</a></div>
//
// <!-- <p>Orcid
// <p>N.M.
// 0000-0002-3477-3082
// </p>
// </p> -->
// <div class=""><a href="publication?articleId=od_______908::3a5b2885656a91307156325644e73b92" >Publication od_______908::3a5b2885656a91307156325644e73b92</a></div>
// <!--<div class=""><a href="publication?articleId=od_______908::3a5b2885656a91307156325644e73b92" >Publication od_______908::3a5b2885656a91307156325644e73b92</a></div>
// <div class=""><a href="publication?articleId=od_______908::3a5b2885656a91307156325644e73b92" >Publication od_______908::3a5b2885656a91307156325644e73b92</a></div>-->
// </div>
// </div>
//
//
//
// `
// //(click)="changeOrderby('target')"
// //od_______908::3a5b2885656a91307156325644e73b92
//
// })
// export class MyClaimsDemoComponent {
// constructor ( private _router: Router ) {
// }
// user:string="argirok@di.uoa.gr";
// ngOnInit() {
//
// }
// goToPub(id: number){
// this._router.navigate( ['Publication', { articleId: id}] );
// }
// }

View File

@ -2,13 +2,14 @@ import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {OpenaireDepositComponent} from './deposit.component';
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {IsRouteEnabled} from "../openaireLibrary/error/isRouteEnabled.guard";
@NgModule({
imports: [
RouterModule.forChild([
{ path: '', component: OpenaireDepositComponent, data: {
redirect: '/error'
}, canDeactivate: [PreviousRouteRecorder] }
}, canDeactivate: [PreviousRouteRecorder], canActivate: [IsRouteEnabled] }
])
]

View File

@ -2,6 +2,7 @@ import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {OpenaireSearchDataprovidersToDepositComponent} from './searchDataprovidersToDeposit.component';
import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
import {IsRouteEnabled} from "../openaireLibrary/error/isRouteEnabled.guard";
@NgModule({
imports: [
@ -9,7 +10,7 @@ import {PreviousRouteRecorder} from '../openaireLibrary/utils/piwik/previousRout
{
path: '', component: OpenaireSearchDataprovidersToDepositComponent, data: {
redirect: '/error'
}, canDeactivate: [PreviousRouteRecorder]
}, canDeactivate: [PreviousRouteRecorder], canActivate: [IsRouteEnabled]
}
])

View File

@ -137,7 +137,7 @@ export class HomeComponent {
}
//this.config.getCommunityInformation(this.properties, this.properties.adminToolsCommunity ).subscribe(data => {
/* this.subs.push(this.config.communityInformationState.subscribe(data => {
this.subs.push(this.config.communityInformationState.subscribe(data => {
if(data) {
var showEntity = {};
for (var i = 0; i < data['entities'].length; i++) {
@ -150,7 +150,7 @@ export class HomeComponent {
this.showOrp = showEntity["orp"];
this.showProjects = showEntity["project"];
this.showDataProviders = showEntity["datasource"];
this.showOrganizations = showEntity["organization"];*/
this.showOrganizations = showEntity["organization"];
if(this.showPublications){
this.resultTypes.values.push({name: "Publications" , id:"publications",selected:true, number:0});
}
@ -164,12 +164,12 @@ export class HomeComponent {
this.resultTypes.values.push({name: "Other research products" , id:"other",selected:true, number:0});
}
this.getNumbers();
/* }
}
},
error => {
this.handleError("Error getting community information", error);
}
));*/
));
}
}

View File

@ -1,4 +1,5 @@
import {SearchCustomFilter} from "../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {Portal} from "../openaireLibrary/utils/entities/adminTool/portal";
export class FilterInfo {
menuId: string;
@ -27,6 +28,11 @@ export class PortalAggregators {
new FilterInfo("greece", "Greek Aggregator", "assets/common-assets/logo-small-aggregator.png", "Country", "country", "GR", "Greece"),
];
static disabled = {
"canada": {pages: [], entities: ["software"]},
"italy": {pages: [], entities: []},
"greece": {pages: [], entities: []}
};
static defaultAggregator: FilterInfo = PortalAggregators.list[0];
public static getList(): FilterInfo[] {
@ -51,6 +57,13 @@ export class PortalAggregators {
}
return filter;
}
public static getCommunityInfoByMenuId(menuId: string): any {
if(PortalAggregators.disabled[menuId]){
return Portal.getMockCommunityInfo(PortalAggregators.disabled[menuId].entities,PortalAggregators.disabled[menuId].pages);
}
return Portal.getMockCommunityInfo([],[]);
}
}

View File

@ -60,7 +60,9 @@ export let properties: EnvProperties = {
datasourcesAPI: "https://beta.services.openaire.eu/openaire/ds/search/",
adminToolsCommunity: "aggregator",
adminToolsAPIURL: "https://beta.services.openaire.eu/uoa-admin-tools/",
useHelpTexts: false,
contextsAPI: "https://beta.services.openaire.eu/openaire/context",
communityAPI: "https://beta.services.openaire.eu/openaire/community/",

View File

@ -60,7 +60,9 @@ export let properties: EnvProperties = {
datasourcesAPI: "https://services.openaire.eu/openaire/ds/search/",
adminToolsCommunity: "aggregator",
adminToolsAPIURL: "https://services.openaire.eu/uoa-admin-tools/",
useHelpTexts:false,
contextsAPI: "https://services.openaire.eu/openaire/context",

View File

@ -63,7 +63,9 @@ export let properties: EnvProperties = {
cacheUrl: "http://dl170.madgik.di.uoa.gr:3000/get?url=",
adminToolsCommunity: "aggregator",
adminToolsAPIURL: "http://duffy.di.uoa.gr:8080/uoa-admin-tools/",
useHelpTexts: false,
datasourcesAPI: "https://beta.services.openaire.eu/openaire/ds/search/",
contextsAPI: "https://dev-openaire.d4science.org/openaire/context",
communityAPI: "https://dev-openaire.d4science.org/openaire/community/",