[Explore | Trunk]: Remove properties resolver and load environment
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@60773 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
17cd584d5d
commit
85af86976e
|
@ -1,95 +1,123 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
|
||||
import { EnvironmentSpecificResolver} from './openaireLibrary/utils/properties/environmentSpecificResolver';
|
||||
import { EnvironmentSpecificService} from './openaireLibrary/utils/properties/environment-specific.service';
|
||||
|
||||
import { OpenaireErrorPageComponent } from './error/errorPage.component';
|
||||
import {NgModule} from '@angular/core';
|
||||
import {RouterModule, Routes} from '@angular/router';
|
||||
import {OpenaireErrorPageComponent} from './error/errorPage.component';
|
||||
import {PageURLResolverComponent} from "./openaireLibrary/utils/pageURLResolver.component";
|
||||
|
||||
const routes: Routes = [
|
||||
// Other Pages
|
||||
{ path: '', loadChildren: './home/home.module#HomeModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
//{ path: 'home', loadChildren: './home/home.module#HomeModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
{ path: 'home', redirectTo: '', pathMatch: 'full'},
|
||||
{ path: 'mail-preferences', loadChildren: './userEmailPreferences/mailPrefs.module#LibMailPrefsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
|
||||
{path: '', loadChildren: './home/home.module#HomeModule'},
|
||||
//{ path: 'home', loadChildren: './home/home.module#HomeModule'},
|
||||
{path: 'home', redirectTo: '', pathMatch: 'full'},
|
||||
{path: 'mail-preferences', loadChildren: './userEmailPreferences/mailPrefs.module#LibMailPrefsModule'},
|
||||
// ORCID Pages
|
||||
{ path: 'orcid', loadChildren: './orcid/orcid.module#LibOrcidModule', resolve: {envSpecific: EnvironmentSpecificResolver}},
|
||||
{ path: 'recommended-orcid-links', loadChildren: './orcid/recommend-orcid-links/searchRecommendedResultsForOrcid.module#LibSearchRecommendedResultsForOrcidModule', resolve: {envSpecific: EnvironmentSpecificResolver}},
|
||||
{ path: 'my-orcid-links', loadChildren: './orcid/my-orcid-links/myOrcidLinks.module#LibMyOrcidLinksModule', resolve: {envSpecific: EnvironmentSpecificResolver}},
|
||||
|
||||
{path: 'orcid', loadChildren: './orcid/orcid.module#LibOrcidModule'},
|
||||
{
|
||||
path: 'recommended-orcid-links',
|
||||
loadChildren: './orcid/recommend-orcid-links/searchRecommendedResultsForOrcid.module#LibSearchRecommendedResultsForOrcidModule'
|
||||
},
|
||||
{path: 'my-orcid-links', loadChildren: './orcid/my-orcid-links/myOrcidLinks.module#LibMyOrcidLinksModule'},
|
||||
// Landing Pages
|
||||
{ path: 'search/result', loadChildren: './landingPages/result/libResult.module#LibResultModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
{ path: 'search/publication', loadChildren: './landingPages/publication/libPublication.module#LibPublicationModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
{ path: 'search/dataset', loadChildren: './landingPages/dataset/libDataset.module#LibDatasetModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
{ path: 'search/software', loadChildren: './landingPages/software/libSoftware.module#LibSoftwareModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
{ path: 'search/other', loadChildren: './landingPages/orp/libOrp.module#LibOrpModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
{ path: 'search/project', loadChildren: './landingPages/project/libProject.module#LibProjectModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
{ path: 'search/dataprovider', loadChildren: '././landingPages/dataProvider/libDataProvider.module#LibDataProviderModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
{ path: 'search/organization', loadChildren: './landingPages/organization/libOrganization.module#LibOrganizationModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
|
||||
{ path: 'project-report', loadChildren: './landingPages/htmlProjectReport/libHtmlProjectReport.module#LibHtmlProjectReportModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
|
||||
{path: 'search/result', loadChildren: './landingPages/result/libResult.module#LibResultModule'},
|
||||
{path: 'search/publication', loadChildren: './landingPages/publication/libPublication.module#LibPublicationModule'},
|
||||
{path: 'search/dataset', loadChildren: './landingPages/dataset/libDataset.module#LibDatasetModule'},
|
||||
{path: 'search/software', loadChildren: './landingPages/software/libSoftware.module#LibSoftwareModule'},
|
||||
{path: 'search/other', loadChildren: './landingPages/orp/libOrp.module#LibOrpModule'},
|
||||
{path: 'search/project', loadChildren: './landingPages/project/libProject.module#LibProjectModule'},
|
||||
{
|
||||
path: 'search/dataprovider',
|
||||
loadChildren: '././landingPages/dataProvider/libDataProvider.module#LibDataProviderModule'
|
||||
},
|
||||
{
|
||||
path: 'search/organization',
|
||||
loadChildren: './landingPages/organization/libOrganization.module#LibOrganizationModule'
|
||||
},
|
||||
{
|
||||
path: 'project-report',
|
||||
loadChildren: './landingPages/htmlProjectReport/libHtmlProjectReport.module#LibHtmlProjectReportModule'
|
||||
},
|
||||
// Search Pages
|
||||
{ path: 'search/find', loadChildren: './searchPages/find/libSearch.module#LibMainSearchModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
{ path: 'search/find/research-outcomes', loadChildren: './searchPages/simple/searchResearchResults.module#OpenaireSearchResearchResultsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
|
||||
{ path: 'search/find/publications', component: PageURLResolverComponent},
|
||||
{ path: 'search/find/datasets', component: PageURLResolverComponent},
|
||||
{ path: 'search/find/software', component: PageURLResolverComponent},
|
||||
{ path: 'search/find/other', component: PageURLResolverComponent},
|
||||
{ path: 'search/find/projects', loadChildren: './searchPages/simple/searchProjects.module#LibSearchProjectsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
{ path: 'search/find/dataproviders', loadChildren: './searchPages/simple/searchDataProviders.module#LibSearchDataProvidersModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
{ path: 'search/find/organizations', loadChildren: './searchPages/simple/searchOrganizations.module#LibSearchOrganizationsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
|
||||
{path: 'search/find', loadChildren: './searchPages/find/libSearch.module#LibMainSearchModule'},
|
||||
{
|
||||
path: 'search/find/research-outcomes',
|
||||
loadChildren: './searchPages/simple/searchResearchResults.module#OpenaireSearchResearchResultsModule'
|
||||
},
|
||||
{path: 'search/find/publications', component: PageURLResolverComponent},
|
||||
{path: 'search/find/datasets', component: PageURLResolverComponent},
|
||||
{path: 'search/find/software', component: PageURLResolverComponent},
|
||||
{path: 'search/find/other', component: PageURLResolverComponent},
|
||||
{path: 'search/find/projects', loadChildren: './searchPages/simple/searchProjects.module#LibSearchProjectsModule'},
|
||||
{
|
||||
path: 'search/find/dataproviders',
|
||||
loadChildren: './searchPages/simple/searchDataProviders.module#LibSearchDataProvidersModule'
|
||||
},
|
||||
{
|
||||
path: 'search/find/organizations',
|
||||
loadChildren: './searchPages/simple/searchOrganizations.module#LibSearchOrganizationsModule'
|
||||
},
|
||||
// Advanced Search Pages
|
||||
{ path: 'search/advanced/research-outcomes', loadChildren: './searchPages/advanced/searchResearchResults.module#OpenaireAdvancedSearchResearchResultsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
|
||||
{ path: 'search/advanced/publications', component: PageURLResolverComponent},
|
||||
{ path: 'search/advanced/datasets', component: PageURLResolverComponent},
|
||||
{ path: 'search/advanced/software', component: PageURLResolverComponent},
|
||||
{ path: 'search/advanced/other', component: PageURLResolverComponent},
|
||||
{ path: 'search/advanced/organizations', loadChildren: './searchPages/advanced/advancedSearchOrganizations.module#LibAdvancedSearchOrganizationsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
{ path: 'search/advanced/dataproviders', loadChildren: './searchPages/advanced/advancedSearchDataProviders.module#LibAdvancedSearchDataProvidersModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
{ path: 'search/advanced/projects', loadChildren: './searchPages/advanced/advancedSearchProjects.module#LibAdvancedSearchProjectsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
|
||||
{
|
||||
path: 'search/advanced/research-outcomes',
|
||||
loadChildren: './searchPages/advanced/searchResearchResults.module#OpenaireAdvancedSearchResearchResultsModule'
|
||||
},
|
||||
{path: 'search/advanced/publications', component: PageURLResolverComponent},
|
||||
{path: 'search/advanced/datasets', component: PageURLResolverComponent},
|
||||
{path: 'search/advanced/software', component: PageURLResolverComponent},
|
||||
{path: 'search/advanced/other', component: PageURLResolverComponent},
|
||||
{
|
||||
path: 'search/advanced/organizations',
|
||||
loadChildren: './searchPages/advanced/advancedSearchOrganizations.module#LibAdvancedSearchOrganizationsModule'
|
||||
},
|
||||
{
|
||||
path: 'search/advanced/dataproviders',
|
||||
loadChildren: './searchPages/advanced/advancedSearchDataProviders.module#LibAdvancedSearchDataProvidersModule'
|
||||
},
|
||||
{
|
||||
path: 'search/advanced/projects',
|
||||
loadChildren: './searchPages/advanced/advancedSearchProjects.module#LibAdvancedSearchProjectsModule'
|
||||
},
|
||||
// Search Content Providers Pages
|
||||
{ path: 'search/content-providers', loadChildren: './searchPages/dataProviders/compatibleDataProviders.module#LibCompatibleDataProvidersModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
{ path: 'search/content-providers-table', redirectTo: 'search/content-providers'},
|
||||
{ path: 'search/entity-registries', loadChildren: './searchPages/dataProviders/entityRegistries.module#LibEntityRegistriesModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
{ path: 'search/entity-registries-table', redirectTo: 'search/entity-registries'},
|
||||
{ path: 'search/journals', loadChildren: './searchPages/dataProviders/journals.module#LibJournalsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
{ path: 'search/journals-table', redirectTo: 'search/journals'},
|
||||
|
||||
{
|
||||
path: 'search/content-providers',
|
||||
loadChildren: './searchPages/dataProviders/compatibleDataProviders.module#LibCompatibleDataProvidersModule'
|
||||
},
|
||||
{path: 'search/content-providers-table', redirectTo: 'search/content-providers'},
|
||||
{
|
||||
path: 'search/entity-registries',
|
||||
loadChildren: './searchPages/dataProviders/entityRegistries.module#LibEntityRegistriesModule'
|
||||
},
|
||||
{path: 'search/entity-registries-table', redirectTo: 'search/entity-registries'},
|
||||
{path: 'search/journals', loadChildren: './searchPages/dataProviders/journals.module#LibJournalsModule'},
|
||||
{path: 'search/journals-table', redirectTo: 'search/journals'},
|
||||
// Deposit Pages
|
||||
{ path: 'participate/deposit-datasets', redirectTo: 'participate/deposit/learn-how', pathMatch: 'full'},
|
||||
{ path: 'participate/deposit-datasets-result', redirectTo: 'participate/deposit/learn-how', pathMatch: 'full'},
|
||||
{ path: 'participate/deposit-subject-result', redirectTo: 'participate/deposit/learn-how', pathMatch: 'full'},
|
||||
{ path: 'participate/deposit-publications', redirectTo: 'participate/deposit/learn-how', pathMatch: 'full'},
|
||||
{ path: 'participate/deposit-publications-result', redirectTo: 'participate/deposit/learn-how', pathMatch: 'full'},
|
||||
|
||||
{ path: 'participate/deposit/learn-how', loadChildren: './deposit/deposit.module#LibDepositModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
{ path: 'participate/deposit/search', loadChildren: './deposit/searchDataprovidersToDeposit.module#LibSearchDataprovidersToDepositModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
|
||||
{path: 'participate/deposit-datasets', redirectTo: 'participate/deposit/learn-how', pathMatch: 'full'},
|
||||
{path: 'participate/deposit-datasets-result', redirectTo: 'participate/deposit/learn-how', pathMatch: 'full'},
|
||||
{path: 'participate/deposit-subject-result', redirectTo: 'participate/deposit/learn-how', pathMatch: 'full'},
|
||||
{path: 'participate/deposit-publications', redirectTo: 'participate/deposit/learn-how', pathMatch: 'full'},
|
||||
{path: 'participate/deposit-publications-result', redirectTo: 'participate/deposit/learn-how', pathMatch: 'full'},
|
||||
{path: 'participate/deposit/learn-how', loadChildren: './deposit/deposit.module#LibDepositModule'},
|
||||
{
|
||||
path: 'participate/deposit/search',
|
||||
loadChildren: './deposit/searchDataprovidersToDeposit.module#LibSearchDataprovidersToDepositModule'
|
||||
},
|
||||
// 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: 'myclaims', loadChildren: './claims/myClaims/myClaims.module#LibMyClaimsModule'},
|
||||
{path: 'claims', loadChildren: './claims/claimsAdmin/claimsAdmin.module#LibClaimsAdminModule'},
|
||||
{path: 'participate/claim', loadChildren: './claims/linking/linkingGeneric.module#LibLinkingGenericModule'},
|
||||
{
|
||||
path: 'participate/direct-claim',
|
||||
loadChildren: './claims/directLinking/directLinking.module#LibDirectLinkingModule'
|
||||
},
|
||||
// { path: 'claims-project-manager', loadChildren: './claims/claimsByToken/claimsByToken.module#LibClaimsByTokenModule'},
|
||||
// help pages - do not exist in Admin portal/api/db
|
||||
{ path: 'reload', loadChildren: './reload/libReload.module#LibReloadModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
{ path: 'user-info', loadChildren: './login/libUser.module#LibUserModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
{ path: 'error', component: OpenaireErrorPageComponent, resolve: { envSpecific: EnvironmentSpecificResolver }},
|
||||
{ path: '**',pathMatch: 'full',component: OpenaireErrorPageComponent, resolve: { envSpecific: EnvironmentSpecificResolver }}
|
||||
{path: 'reload', loadChildren: './reload/libReload.module#LibReloadModule'},
|
||||
{path: 'user-info', loadChildren: './login/libUser.module#LibUserModule'},
|
||||
{path: 'error', component: OpenaireErrorPageComponent},
|
||||
{path: '**', pathMatch: 'full', component: OpenaireErrorPageComponent}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forRoot(routes)],
|
||||
exports: [RouterModule],
|
||||
providers: [EnvironmentSpecificResolver, EnvironmentSpecificService]
|
||||
exports: [RouterModule]
|
||||
})
|
||||
export class AppRoutingModule { }
|
||||
export class AppRoutingModule {
|
||||
}
|
||||
|
|
|
@ -19,11 +19,14 @@ import {properties} from "../environments/environment";
|
|||
//encapsulation: ViewEncapsulation.Emulated,
|
||||
selector: 'app-root',
|
||||
template: `
|
||||
<navbar *ngIf="properties && header" [header]="header" [portal]="properties.dashboard" [properties]=properties [onlyTop]=false [user]="user"
|
||||
<navbar *ngIf="properties && header" [header]="header" [portal]="properties.dashboard" [properties]=properties
|
||||
[onlyTop]=false [user]="user"
|
||||
[communityId]="properties.adminToolsCommunity" [userMenuItems]=userMenuItems [menuItems]=menuItems></navbar>
|
||||
<schema2jsonld *ngIf="properties" [URL]="properties.domain+properties.baseLink"
|
||||
[logoURL]="properties.domain+properties.baseLink+'/assets/common-assets/logo-small-explore.png'" type="home"
|
||||
name="OpenAIRE | Find and Share research" description="OpenAIRE Explore: Over 100M of research deduplicated, 170K research software, 11M research data. One of the largest open scholarly records collection worldwide."></schema2jsonld>
|
||||
<schema2jsonld *ngIf="properties" [URL]="properties.domain+properties.baseLink"
|
||||
[logoURL]="properties.domain+properties.baseLink+'/assets/common-assets/logo-small-explore.png'"
|
||||
type="home"
|
||||
name="OpenAIRE | Find and Share research"
|
||||
description="OpenAIRE Explore: Over 100M of research deduplicated, 170K research software, 11M research data. One of the largest open scholarly records collection worldwide."></schema2jsonld>
|
||||
<div class="custom-main-content">
|
||||
<main>
|
||||
<router-outlet></router-outlet>
|
||||
|
@ -34,93 +37,67 @@ import {properties} from "../environments/environment";
|
|||
Cookies are small pieces of data that websites store in your browser to allow us to give you the best browsing
|
||||
experience possible.
|
||||
By using the OpenAIRE portal you accept our use of cookies. <a
|
||||
href="//ec.europa.eu/ipg/basics/legal/cookies/index_en.htm" target="_blank"> Read more <span class="uk-icon">
|
||||
href="//ec.europa.eu/ipg/basics/legal/cookies/index_en.htm" target="_blank"> Read more <span class="uk-icon">
|
||||
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="chevron-right"
|
||||
ratio="1"><polyline fill="none" stroke="#000" stroke-width="1.03" points="7 4 13 10 7 16"></polyline></svg>
|
||||
</span></a>
|
||||
</cookie-law>
|
||||
<bottom *ngIf="isClient && properties" [properties]="properties"></bottom>
|
||||
|
||||
|
||||
`
|
||||
|
||||
|
||||
})
|
||||
export class AppComponent {
|
||||
isClient: boolean = false;
|
||||
clientLoad = 0;
|
||||
|
||||
userMenuItems: MenuItem[] = [];
|
||||
|
||||
// userMenuItems: MenuItem[] = [new MenuItem("", "My profile", "", "", false, [], [], {}),
|
||||
// new MenuItem("", "My links", "", "/myclaims", false, [], ["/myclaims"], {})]
|
||||
|
||||
menuItems: RootMenuItem [] = [];
|
||||
|
||||
feedbackmail: string;
|
||||
properties: EnvProperties;
|
||||
properties: EnvProperties = properties;
|
||||
user: User;
|
||||
header: Header;
|
||||
logoPath: string = 'assets/common-assets/';
|
||||
subscriptions = [];
|
||||
|
||||
|
||||
constructor(private route: ActivatedRoute, private propertiesService: EnvironmentSpecificService,
|
||||
private router: Router, private userManagementService: UserManagementService,
|
||||
private configurationService: ConfigurationService, private _meta: Meta) {
|
||||
private configurationService: ConfigurationService, private _meta: Meta) {
|
||||
this.userMenuItems.push(new MenuItem("", "My profile", "", "", false, [], [], {}));
|
||||
this.userMenuItems.push(new MenuItem("", "My ORCID links", "", "/my-orcid-links", false, [], [""], {}));
|
||||
this.userMenuItems.push(new MenuItem("", "My links", "", "/myclaims", false, [], ["/myclaims"], {}));
|
||||
|
||||
|
||||
this.subscriptions.push(router.events.forEach((event) => {
|
||||
if (event instanceof NavigationStart) {
|
||||
// console.log(event.url);
|
||||
HelperFunctions.scroll();
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
|
||||
|
||||
|
||||
if (typeof document !== 'undefined') {
|
||||
try {
|
||||
this.isClient = true;
|
||||
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
this.isClient = true;
|
||||
}
|
||||
this.subscriptions.push(this.propertiesService.loadEnvironment()
|
||||
.then(es => {
|
||||
this.propertiesService.setEnvProperties(es);
|
||||
this.properties = this.propertiesService.envSpecific;
|
||||
this.configurationService.initCommunityInformation(this.properties, this.properties.adminToolsCommunity);
|
||||
this.feedbackmail = this.properties.feedbackmail;
|
||||
if(this.properties.environment == "production" || this.properties.environment == "development") {
|
||||
this.subscriptions.push(this.route.queryParams.subscribe(data => {
|
||||
this._meta.updateTag({content: 'all', name: 'robots'});
|
||||
}));
|
||||
}
|
||||
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
|
||||
this.user = user;
|
||||
this.buildMenu();
|
||||
this.header = {
|
||||
route: "/",
|
||||
url: null,
|
||||
title: 'explore',
|
||||
logoUrl: this.logoPath + 'logo-large-explore.png',
|
||||
logoSmallUrl:this.logoPath + 'logo-small-explore.png',
|
||||
position:'left',
|
||||
badge:true
|
||||
};
|
||||
}));
|
||||
//console.log(this.properties.loginUrl);
|
||||
}, error => {
|
||||
console.log("App couldn't fetch properties");
|
||||
console.log(error);
|
||||
|
||||
this.configurationService.initCommunityInformation(this.properties, this.properties.adminToolsCommunity);
|
||||
this.feedbackmail = this.properties.feedbackmail;
|
||||
if (this.properties.environment == "production" || this.properties.environment == "development") {
|
||||
this.subscriptions.push(this.route.queryParams.subscribe(data => {
|
||||
this._meta.updateTag({content: 'all', name: 'robots'});
|
||||
}));
|
||||
}
|
||||
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
|
||||
this.user = user;
|
||||
this.buildMenu();
|
||||
this.header = {
|
||||
route: "/",
|
||||
url: null,
|
||||
title: 'explore',
|
||||
logoUrl: this.logoPath + 'logo-large-explore.png',
|
||||
logoSmallUrl: this.logoPath + 'logo-small-explore.png',
|
||||
position: 'left',
|
||||
badge: true
|
||||
};
|
||||
}));
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.subscriptions.forEach(subscription => {
|
||||
if (subscription instanceof Subscriber) {
|
||||
|
@ -130,13 +107,14 @@ export class AppComponent {
|
|||
this.configurationService.clearSubscriptions();
|
||||
this.userManagementService.clearSubscriptions();
|
||||
}
|
||||
|
||||
buildMenu() {
|
||||
//TODO add check for research results route
|
||||
//TODO add check for research results route
|
||||
this.menuItems = [
|
||||
{
|
||||
rootItem: new MenuItem("search", "Search", "", "/search/find", false, [], ["/search/find"], {qf:true}),
|
||||
rootItem: new MenuItem("search", "Search", "", "/search/find", false, [], ["/search/find"], {qf: true}),
|
||||
items: [
|
||||
new MenuItem("", "Research Outcomes", "", "/search/find/research-outcomes", false, [], ["/search/find/research-outcomes"], {qf:true}),
|
||||
new MenuItem("", "Research Outcomes", "", "/search/find/research-outcomes", false, [], ["/search/find/research-outcomes"], {qf: true}),
|
||||
new MenuItem("", "Projects", "", "/search/find/projects/", false, ["project"], ["/search/find/projects"], {}),
|
||||
new MenuItem("", "Content Providers", "", "/search/find/dataproviders", false, ["datasource"], ["/search/find/dataproviders"], {}),
|
||||
new MenuItem("", "Organizations", "", "/search/find/organizations/", false, ["organization"], ["/search/find/organizations"], {})
|
||||
|
@ -168,12 +146,12 @@ export class AppComponent {
|
|||
this.userMenuItems.push(new MenuItem("", "Manage all links", "", "/claims", false, [], ["/claims"], {}));
|
||||
this.userMenuItems.push(new MenuItem("", "Manage helptexts",
|
||||
((this.properties.environment == "beta") ? "https://beta.admin.connect.openaire.eu" : "https://admin.explore.openaire.eu") + "/dashboard?communityId=openaire", "", true, [], [], {}))
|
||||
|
||||
|
||||
} else if (Session.isClaimsCurator(this.user)) {
|
||||
this.userMenuItems.push(new MenuItem("", "Manage all links", "", "/claims", false, [], ["/claims"], {}));
|
||||
|
||||
|
||||
}
|
||||
if(this.user) {
|
||||
if (this.user) {
|
||||
this.userMenuItems.push(new MenuItem("", "User information", "", "/user-info", false, [], [], {}));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,15 +5,10 @@ import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
|
|||
import {CommonModule} from '@angular/common';
|
||||
import {HTTP_INTERCEPTORS, HttpClientModule} from '@angular/common/http';
|
||||
import {AppComponent} from './app.component';
|
||||
|
||||
|
||||
import {NavigationBarModule} from './openaireLibrary/sharedComponents/navigationBar.module';
|
||||
import {CookieLawModule} from './openaireLibrary/sharedComponents/cookie-law/cookie-law.module';
|
||||
|
||||
import {BottomModule} from './openaireLibrary/sharedComponents/bottom.module';
|
||||
import {EnvironmentSpecificResolver} from './openaireLibrary/utils/properties/environmentSpecificResolver';
|
||||
import {ErrorModule} from './openaireLibrary/error/error.module';
|
||||
|
||||
import {OpenaireErrorPageComponent} from './error/errorPage.component';
|
||||
import {AppRoutingModule} from './app-routing.module';
|
||||
import {HttpInterceptorService} from "./openaireLibrary/http-interceptor.service";
|
||||
|
@ -23,9 +18,7 @@ import {CacheInterceptorService} from "./openaireLibrary/cache-interceptor.servi
|
|||
import {DEFAULT_TIMEOUT, TimeoutInterceptor} from "./openaireLibrary/timeout-interceptor.service";
|
||||
import {ErrorInterceptorService} from "./openaireLibrary/error-interceptor.service";
|
||||
|
||||
|
||||
@NgModule({
|
||||
|
||||
imports: [
|
||||
SharedModule,
|
||||
CommonModule,
|
||||
|
@ -37,16 +30,10 @@ import {ErrorInterceptorService} from "./openaireLibrary/error-interceptor.servi
|
|||
AppRoutingModule,
|
||||
BrowserTransferStateModule,
|
||||
BrowserAnimationsModule, PageURLResolverModule, Schema2jsonldModule
|
||||
//NoopAnimationsModule
|
||||
],
|
||||
declarations: [AppComponent, OpenaireErrorPageComponent],
|
||||
exports: [AppComponent],
|
||||
providers: [
|
||||
/*{
|
||||
provide: REQUEST_TOKEN,
|
||||
useClass: EnvironmentSpecificService
|
||||
},*/
|
||||
EnvironmentSpecificResolver,
|
||||
{
|
||||
provide: HTTP_INTERCEPTORS,
|
||||
useClass: CacheInterceptorService,
|
||||
|
|
Loading…
Reference in New Issue