[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 {NgModule} from '@angular/core';
|
||||||
import { Routes, RouterModule } from '@angular/router';
|
import {RouterModule, Routes} from '@angular/router';
|
||||||
|
import {OpenaireErrorPageComponent} from './error/errorPage.component';
|
||||||
|
|
||||||
import { EnvironmentSpecificResolver} from './openaireLibrary/utils/properties/environmentSpecificResolver';
|
|
||||||
import { EnvironmentSpecificService} from './openaireLibrary/utils/properties/environment-specific.service';
|
|
||||||
|
|
||||||
import { OpenaireErrorPageComponent } from './error/errorPage.component';
|
|
||||||
import {PageURLResolverComponent} from "./openaireLibrary/utils/pageURLResolver.component";
|
import {PageURLResolverComponent} from "./openaireLibrary/utils/pageURLResolver.component";
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
// Other Pages
|
// Other Pages
|
||||||
{ path: '', loadChildren: './home/home.module#HomeModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{path: '', loadChildren: './home/home.module#HomeModule'},
|
||||||
//{ path: 'home', loadChildren: './home/home.module#HomeModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
//{ path: 'home', loadChildren: './home/home.module#HomeModule'},
|
||||||
{ path: 'home', redirectTo: '', pathMatch: 'full'},
|
{path: 'home', redirectTo: '', pathMatch: 'full'},
|
||||||
{ path: 'mail-preferences', loadChildren: './userEmailPreferences/mailPrefs.module#LibMailPrefsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{path: 'mail-preferences', loadChildren: './userEmailPreferences/mailPrefs.module#LibMailPrefsModule'},
|
||||||
|
|
||||||
// ORCID Pages
|
// ORCID Pages
|
||||||
{ path: 'orcid', loadChildren: './orcid/orcid.module#LibOrcidModule', resolve: {envSpecific: EnvironmentSpecificResolver}},
|
{path: 'orcid', loadChildren: './orcid/orcid.module#LibOrcidModule'},
|
||||||
{ 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: '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
|
// Landing Pages
|
||||||
{ path: 'search/result', loadChildren: './landingPages/result/libResult.module#LibResultModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{path: 'search/result', loadChildren: './landingPages/result/libResult.module#LibResultModule'},
|
||||||
{ path: 'search/publication', loadChildren: './landingPages/publication/libPublication.module#LibPublicationModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{path: 'search/publication', loadChildren: './landingPages/publication/libPublication.module#LibPublicationModule'},
|
||||||
{ path: 'search/dataset', loadChildren: './landingPages/dataset/libDataset.module#LibDatasetModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{path: 'search/dataset', loadChildren: './landingPages/dataset/libDataset.module#LibDatasetModule'},
|
||||||
{ path: 'search/software', loadChildren: './landingPages/software/libSoftware.module#LibSoftwareModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{path: 'search/software', loadChildren: './landingPages/software/libSoftware.module#LibSoftwareModule'},
|
||||||
{ path: 'search/other', loadChildren: './landingPages/orp/libOrp.module#LibOrpModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{path: 'search/other', loadChildren: './landingPages/orp/libOrp.module#LibOrpModule'},
|
||||||
{ path: 'search/project', loadChildren: './landingPages/project/libProject.module#LibProjectModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{path: 'search/project', loadChildren: './landingPages/project/libProject.module#LibProjectModule'},
|
||||||
{ 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: 'search/dataprovider',
|
||||||
|
loadChildren: '././landingPages/dataProvider/libDataProvider.module#LibDataProviderModule'
|
||||||
{ path: 'project-report', loadChildren: './landingPages/htmlProjectReport/libHtmlProjectReport.module#LibHtmlProjectReportModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
},
|
||||||
|
{
|
||||||
|
path: 'search/organization',
|
||||||
|
loadChildren: './landingPages/organization/libOrganization.module#LibOrganizationModule'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'project-report',
|
||||||
|
loadChildren: './landingPages/htmlProjectReport/libHtmlProjectReport.module#LibHtmlProjectReportModule'
|
||||||
|
},
|
||||||
// Search Pages
|
// Search Pages
|
||||||
{ path: 'search/find', loadChildren: './searchPages/find/libSearch.module#LibMainSearchModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{path: 'search/find', loadChildren: './searchPages/find/libSearch.module#LibMainSearchModule'},
|
||||||
{ path: 'search/find/research-outcomes', loadChildren: './searchPages/simple/searchResearchResults.module#OpenaireSearchResearchResultsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{
|
||||||
|
path: 'search/find/research-outcomes',
|
||||||
{ path: 'search/find/publications', component: PageURLResolverComponent},
|
loadChildren: './searchPages/simple/searchResearchResults.module#OpenaireSearchResearchResultsModule'
|
||||||
{ path: 'search/find/datasets', component: PageURLResolverComponent},
|
},
|
||||||
{ path: 'search/find/software', component: PageURLResolverComponent},
|
{path: 'search/find/publications', component: PageURLResolverComponent},
|
||||||
{ path: 'search/find/other', component: PageURLResolverComponent},
|
{path: 'search/find/datasets', component: PageURLResolverComponent},
|
||||||
{ path: 'search/find/projects', loadChildren: './searchPages/simple/searchProjects.module#LibSearchProjectsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{path: 'search/find/software', component: PageURLResolverComponent},
|
||||||
{ path: 'search/find/dataproviders', loadChildren: './searchPages/simple/searchDataProviders.module#LibSearchDataProvidersModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{path: 'search/find/other', component: PageURLResolverComponent},
|
||||||
{ path: 'search/find/organizations', loadChildren: './searchPages/simple/searchOrganizations.module#LibSearchOrganizationsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{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
|
// Advanced Search Pages
|
||||||
{ path: 'search/advanced/research-outcomes', loadChildren: './searchPages/advanced/searchResearchResults.module#OpenaireAdvancedSearchResearchResultsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{
|
||||||
|
path: 'search/advanced/research-outcomes',
|
||||||
{ path: 'search/advanced/publications', component: PageURLResolverComponent},
|
loadChildren: './searchPages/advanced/searchResearchResults.module#OpenaireAdvancedSearchResearchResultsModule'
|
||||||
{ path: 'search/advanced/datasets', component: PageURLResolverComponent},
|
},
|
||||||
{ path: 'search/advanced/software', component: PageURLResolverComponent},
|
{path: 'search/advanced/publications', component: PageURLResolverComponent},
|
||||||
{ path: 'search/advanced/other', component: PageURLResolverComponent},
|
{path: 'search/advanced/datasets', component: PageURLResolverComponent},
|
||||||
{ path: 'search/advanced/organizations', loadChildren: './searchPages/advanced/advancedSearchOrganizations.module#LibAdvancedSearchOrganizationsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{path: 'search/advanced/software', component: PageURLResolverComponent},
|
||||||
{ path: 'search/advanced/dataproviders', loadChildren: './searchPages/advanced/advancedSearchDataProviders.module#LibAdvancedSearchDataProvidersModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{path: 'search/advanced/other', component: PageURLResolverComponent},
|
||||||
{ path: 'search/advanced/projects', loadChildren: './searchPages/advanced/advancedSearchProjects.module#LibAdvancedSearchProjectsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{
|
||||||
|
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
|
// 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/content-providers',
|
||||||
{ path: 'search/entity-registries', loadChildren: './searchPages/dataProviders/entityRegistries.module#LibEntityRegistriesModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
loadChildren: './searchPages/dataProviders/compatibleDataProviders.module#LibCompatibleDataProvidersModule'
|
||||||
{ path: 'search/entity-registries-table', redirectTo: 'search/entity-registries'},
|
},
|
||||||
{ path: 'search/journals', loadChildren: './searchPages/dataProviders/journals.module#LibJournalsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{path: 'search/content-providers-table', redirectTo: 'search/content-providers'},
|
||||||
{ path: 'search/journals-table', redirectTo: 'search/journals'},
|
{
|
||||||
|
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
|
// Deposit Pages
|
||||||
{ path: 'participate/deposit-datasets', redirectTo: 'participate/deposit/learn-how', pathMatch: 'full'},
|
{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-datasets-result', redirectTo: 'participate/deposit/learn-how', pathMatch: 'full'},
|
||||||
{ path: 'participate/deposit-subject-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', redirectTo: 'participate/deposit/learn-how', pathMatch: 'full'},
|
||||||
{ path: 'participate/deposit-publications-result', 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/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/search',
|
||||||
|
loadChildren: './deposit/searchDataprovidersToDeposit.module#LibSearchDataprovidersToDepositModule'
|
||||||
|
},
|
||||||
// Linking Pages
|
// Linking Pages
|
||||||
{ path: 'myclaims', loadChildren: './claims/myClaims/myClaims.module#LibMyClaimsModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{path: 'myclaims', loadChildren: './claims/myClaims/myClaims.module#LibMyClaimsModule'},
|
||||||
{ path: 'claims', loadChildren: './claims/claimsAdmin/claimsAdmin.module#LibClaimsAdminModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{path: 'claims', loadChildren: './claims/claimsAdmin/claimsAdmin.module#LibClaimsAdminModule'},
|
||||||
{ path: 'participate/claim', loadChildren: './claims/linking/linkingGeneric.module#LibLinkingGenericModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{path: 'participate/claim', loadChildren: './claims/linking/linkingGeneric.module#LibLinkingGenericModule'},
|
||||||
{ 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: '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
|
// help pages - do not exist in Admin portal/api/db
|
||||||
{ path: 'reload', loadChildren: './reload/libReload.module#LibReloadModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{path: 'reload', loadChildren: './reload/libReload.module#LibReloadModule'},
|
||||||
{ path: 'user-info', loadChildren: './login/libUser.module#LibUserModule', resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{path: 'user-info', loadChildren: './login/libUser.module#LibUserModule'},
|
||||||
{ path: 'error', component: OpenaireErrorPageComponent, resolve: { envSpecific: EnvironmentSpecificResolver }},
|
{path: 'error', component: OpenaireErrorPageComponent},
|
||||||
{ path: '**',pathMatch: 'full',component: OpenaireErrorPageComponent, resolve: { envSpecific: EnvironmentSpecificResolver }}
|
{path: '**', pathMatch: 'full', component: OpenaireErrorPageComponent}
|
||||||
];
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [RouterModule.forRoot(routes)],
|
imports: [RouterModule.forRoot(routes)],
|
||||||
exports: [RouterModule],
|
exports: [RouterModule]
|
||||||
providers: [EnvironmentSpecificResolver, EnvironmentSpecificService]
|
|
||||||
})
|
})
|
||||||
export class AppRoutingModule { }
|
export class AppRoutingModule {
|
||||||
|
}
|
||||||
|
|
|
@ -19,11 +19,14 @@ import {properties} from "../environments/environment";
|
||||||
//encapsulation: ViewEncapsulation.Emulated,
|
//encapsulation: ViewEncapsulation.Emulated,
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
template: `
|
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>
|
[communityId]="properties.adminToolsCommunity" [userMenuItems]=userMenuItems [menuItems]=menuItems></navbar>
|
||||||
<schema2jsonld *ngIf="properties" [URL]="properties.domain+properties.baseLink"
|
<schema2jsonld *ngIf="properties" [URL]="properties.domain+properties.baseLink"
|
||||||
[logoURL]="properties.domain+properties.baseLink+'/assets/common-assets/logo-small-explore.png'" type="home"
|
[logoURL]="properties.domain+properties.baseLink+'/assets/common-assets/logo-small-explore.png'"
|
||||||
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>
|
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">
|
<div class="custom-main-content">
|
||||||
<main>
|
<main>
|
||||||
<router-outlet></router-outlet>
|
<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
|
Cookies are small pieces of data that websites store in your browser to allow us to give you the best browsing
|
||||||
experience possible.
|
experience possible.
|
||||||
By using the OpenAIRE portal you accept our use of cookies. <a
|
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"
|
<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>
|
ratio="1"><polyline fill="none" stroke="#000" stroke-width="1.03" points="7 4 13 10 7 16"></polyline></svg>
|
||||||
</span></a>
|
</span></a>
|
||||||
</cookie-law>
|
</cookie-law>
|
||||||
<bottom *ngIf="isClient && properties" [properties]="properties"></bottom>
|
<bottom *ngIf="isClient && properties" [properties]="properties"></bottom>
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
})
|
})
|
||||||
export class AppComponent {
|
export class AppComponent {
|
||||||
isClient: boolean = false;
|
isClient: boolean = false;
|
||||||
clientLoad = 0;
|
|
||||||
|
|
||||||
userMenuItems: MenuItem[] = [];
|
userMenuItems: MenuItem[] = [];
|
||||||
|
|
||||||
// userMenuItems: MenuItem[] = [new MenuItem("", "My profile", "", "", false, [], [], {}),
|
|
||||||
// new MenuItem("", "My links", "", "/myclaims", false, [], ["/myclaims"], {})]
|
|
||||||
|
|
||||||
menuItems: RootMenuItem [] = [];
|
menuItems: RootMenuItem [] = [];
|
||||||
|
|
||||||
feedbackmail: string;
|
feedbackmail: string;
|
||||||
properties: EnvProperties;
|
properties: EnvProperties = properties;
|
||||||
user: User;
|
user: User;
|
||||||
header: Header;
|
header: Header;
|
||||||
logoPath: string = 'assets/common-assets/';
|
logoPath: string = 'assets/common-assets/';
|
||||||
subscriptions = [];
|
subscriptions = [];
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute, private propertiesService: EnvironmentSpecificService,
|
constructor(private route: ActivatedRoute, private propertiesService: EnvironmentSpecificService,
|
||||||
private router: Router, private userManagementService: UserManagementService,
|
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 profile", "", "", false, [], [], {}));
|
||||||
this.userMenuItems.push(new MenuItem("", "My ORCID links", "", "/my-orcid-links", false, [], [""], {}));
|
this.userMenuItems.push(new MenuItem("", "My ORCID links", "", "/my-orcid-links", false, [], [""], {}));
|
||||||
this.userMenuItems.push(new MenuItem("", "My links", "", "/myclaims", false, [], ["/myclaims"], {}));
|
this.userMenuItems.push(new MenuItem("", "My links", "", "/myclaims", false, [], ["/myclaims"], {}));
|
||||||
|
|
||||||
this.subscriptions.push(router.events.forEach((event) => {
|
this.subscriptions.push(router.events.forEach((event) => {
|
||||||
if (event instanceof NavigationStart) {
|
if (event instanceof NavigationStart) {
|
||||||
// console.log(event.url);
|
|
||||||
HelperFunctions.scroll();
|
HelperFunctions.scroll();
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (typeof document !== 'undefined') {
|
if (typeof document !== 'undefined') {
|
||||||
try {
|
this.isClient = true;
|
||||||
this.isClient = true;
|
|
||||||
|
|
||||||
} catch (e) {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
this.subscriptions.push(this.propertiesService.loadEnvironment()
|
this.configurationService.initCommunityInformation(this.properties, this.properties.adminToolsCommunity);
|
||||||
.then(es => {
|
this.feedbackmail = this.properties.feedbackmail;
|
||||||
this.propertiesService.setEnvProperties(es);
|
if (this.properties.environment == "production" || this.properties.environment == "development") {
|
||||||
this.properties = this.propertiesService.envSpecific;
|
this.subscriptions.push(this.route.queryParams.subscribe(data => {
|
||||||
this.configurationService.initCommunityInformation(this.properties, this.properties.adminToolsCommunity);
|
this._meta.updateTag({content: 'all', name: 'robots'});
|
||||||
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.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() {
|
ngOnDestroy() {
|
||||||
this.subscriptions.forEach(subscription => {
|
this.subscriptions.forEach(subscription => {
|
||||||
if (subscription instanceof Subscriber) {
|
if (subscription instanceof Subscriber) {
|
||||||
|
@ -130,13 +107,14 @@ export class AppComponent {
|
||||||
this.configurationService.clearSubscriptions();
|
this.configurationService.clearSubscriptions();
|
||||||
this.userManagementService.clearSubscriptions();
|
this.userManagementService.clearSubscriptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
buildMenu() {
|
buildMenu() {
|
||||||
//TODO add check for research results route
|
//TODO add check for research results route
|
||||||
this.menuItems = [
|
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: [
|
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("", "Projects", "", "/search/find/projects/", false, ["project"], ["/search/find/projects"], {}),
|
||||||
new MenuItem("", "Content Providers", "", "/search/find/dataproviders", false, ["datasource"], ["/search/find/dataproviders"], {}),
|
new MenuItem("", "Content Providers", "", "/search/find/dataproviders", false, ["datasource"], ["/search/find/dataproviders"], {}),
|
||||||
new MenuItem("", "Organizations", "", "/search/find/organizations/", false, ["organization"], ["/search/find/organizations"], {})
|
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 all links", "", "/claims", false, [], ["/claims"], {}));
|
||||||
this.userMenuItems.push(new MenuItem("", "Manage helptexts",
|
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, [], [], {}))
|
((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)) {
|
} else if (Session.isClaimsCurator(this.user)) {
|
||||||
this.userMenuItems.push(new MenuItem("", "Manage all links", "", "/claims", false, [], ["/claims"], {}));
|
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, [], [], {}));
|
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 {CommonModule} from '@angular/common';
|
||||||
import {HTTP_INTERCEPTORS, HttpClientModule} from '@angular/common/http';
|
import {HTTP_INTERCEPTORS, HttpClientModule} from '@angular/common/http';
|
||||||
import {AppComponent} from './app.component';
|
import {AppComponent} from './app.component';
|
||||||
|
|
||||||
|
|
||||||
import {NavigationBarModule} from './openaireLibrary/sharedComponents/navigationBar.module';
|
import {NavigationBarModule} from './openaireLibrary/sharedComponents/navigationBar.module';
|
||||||
import {CookieLawModule} from './openaireLibrary/sharedComponents/cookie-law/cookie-law.module';
|
import {CookieLawModule} from './openaireLibrary/sharedComponents/cookie-law/cookie-law.module';
|
||||||
|
|
||||||
import {BottomModule} from './openaireLibrary/sharedComponents/bottom.module';
|
import {BottomModule} from './openaireLibrary/sharedComponents/bottom.module';
|
||||||
import {EnvironmentSpecificResolver} from './openaireLibrary/utils/properties/environmentSpecificResolver';
|
|
||||||
import {ErrorModule} from './openaireLibrary/error/error.module';
|
import {ErrorModule} from './openaireLibrary/error/error.module';
|
||||||
|
|
||||||
import {OpenaireErrorPageComponent} from './error/errorPage.component';
|
import {OpenaireErrorPageComponent} from './error/errorPage.component';
|
||||||
import {AppRoutingModule} from './app-routing.module';
|
import {AppRoutingModule} from './app-routing.module';
|
||||||
import {HttpInterceptorService} from "./openaireLibrary/http-interceptor.service";
|
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 {DEFAULT_TIMEOUT, TimeoutInterceptor} from "./openaireLibrary/timeout-interceptor.service";
|
||||||
import {ErrorInterceptorService} from "./openaireLibrary/error-interceptor.service";
|
import {ErrorInterceptorService} from "./openaireLibrary/error-interceptor.service";
|
||||||
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
|
||||||
imports: [
|
imports: [
|
||||||
SharedModule,
|
SharedModule,
|
||||||
CommonModule,
|
CommonModule,
|
||||||
|
@ -37,16 +30,10 @@ import {ErrorInterceptorService} from "./openaireLibrary/error-interceptor.servi
|
||||||
AppRoutingModule,
|
AppRoutingModule,
|
||||||
BrowserTransferStateModule,
|
BrowserTransferStateModule,
|
||||||
BrowserAnimationsModule, PageURLResolverModule, Schema2jsonldModule
|
BrowserAnimationsModule, PageURLResolverModule, Schema2jsonldModule
|
||||||
//NoopAnimationsModule
|
|
||||||
],
|
],
|
||||||
declarations: [AppComponent, OpenaireErrorPageComponent],
|
declarations: [AppComponent, OpenaireErrorPageComponent],
|
||||||
exports: [AppComponent],
|
exports: [AppComponent],
|
||||||
providers: [
|
providers: [
|
||||||
/*{
|
|
||||||
provide: REQUEST_TOKEN,
|
|
||||||
useClass: EnvironmentSpecificService
|
|
||||||
},*/
|
|
||||||
EnvironmentSpecificResolver,
|
|
||||||
{
|
{
|
||||||
provide: HTTP_INTERCEPTORS,
|
provide: HTTP_INTERCEPTORS,
|
||||||
useClass: CacheInterceptorService,
|
useClass: CacheInterceptorService,
|
||||||
|
|
Loading…
Reference in New Issue