Merge from origin/develop
This commit is contained in:
commit
302419dd5d
|
@ -10,14 +10,27 @@ const routes: Routes = [
|
||||||
{path: 'my-orcid-links', loadChildren: () => import('./orcid/my-orcid-links/myOrcidLinks.module').then(m => m.LibMyOrcidLinksModule)},
|
{path: 'my-orcid-links', loadChildren: () => import('./orcid/my-orcid-links/myOrcidLinks.module').then(m => m.LibMyOrcidLinksModule)},
|
||||||
|
|
||||||
/** Other Pages */
|
/** Other Pages */
|
||||||
{path: '', loadChildren: () => import('./communitywrapper/communityWrapper.module').then(m => m.CommunityWrapperModule)},
|
{
|
||||||
|
path: '',
|
||||||
|
loadChildren: () => import('./communitywrapper/communityWrapper.module').then(m => m.CommunityWrapperModule)
|
||||||
|
},
|
||||||
{path: 'about', redirectTo: 'about/learn-how', pathMatch: 'full'},
|
{path: 'about', redirectTo: 'about/learn-how', pathMatch: 'full'},
|
||||||
{path: 'about/learn-how', loadChildren: () => import('./learn-how/learn-how.module').then(m => m.LearnHowModule)},
|
{path: 'about/learn-how', loadChildren: () => import('./learn-how/learn-how.module').then(m => m.LearnHowModule)},
|
||||||
{path: 'about/faq', loadChildren: () => import('./learn-how/faqs/faqs.module').then(m => m.FaqsModule)},
|
{path: 'about/faq', loadChildren: () => import('./learn-how/faqs/faqs.module').then(m => m.FaqsModule)},
|
||||||
{path: 'get-started', loadChildren: () => import('./get-started/get-started.module').then(m => m.GetStartedModule)},
|
{path: 'get-started', loadChildren: () => import('./get-started/get-started.module').then(m => m.GetStartedModule)},
|
||||||
{path: 'contact-us', loadChildren: () => import('./contact/contact.module').then(m => m.ContactModule)},
|
{path: 'contact-us', loadChildren: () => import('./contact/contact.module').then(m => m.ContactModule)},
|
||||||
{path: 'invite', loadChildren: () => import('./utils/subscribe/invite/invite.module').then(m => m.InviteModule)},
|
{path: 'invite', loadChildren: () => import('./utils/subscribe/invite/invite.module').then(m => m.InviteModule)},
|
||||||
{path: 'content', loadChildren: () => import('./content/contentPage.module').then(m => m.ContentPageModule), canActivate: [IsCommunity]},
|
{
|
||||||
|
path: 'content',
|
||||||
|
loadChildren: () => import('./content/contentPage.module').then(m => m.ContentPageModule),
|
||||||
|
canActivate: [IsCommunity]
|
||||||
|
},
|
||||||
|
{path: 'sdgs', loadChildren: () => import('./sdg/sdg.module').then(m => m.LibSdgModule)},
|
||||||
|
{
|
||||||
|
path: 'fields-of-science',
|
||||||
|
loadChildren: () => import('./fos/fos.module').then(m => m.LibFosModule),
|
||||||
|
data: {extraOffset: 100}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'organizations',
|
path: 'organizations',
|
||||||
loadChildren: () => import('./htmlPages/organizations/organizationsPage.module').then(m => m.OrganizationsPageModule),
|
loadChildren: () => import('./htmlPages/organizations/organizationsPage.module').then(m => m.OrganizationsPageModule),
|
||||||
|
|
|
@ -1,4 +1,13 @@
|
||||||
import {Component, ElementRef, Inject, OnDestroy, OnInit, RendererFactory2, ViewChild, ViewEncapsulation} from '@angular/core';
|
import {
|
||||||
|
Component,
|
||||||
|
ElementRef,
|
||||||
|
Inject,
|
||||||
|
OnDestroy,
|
||||||
|
OnInit, PLATFORM_ID,
|
||||||
|
RendererFactory2,
|
||||||
|
ViewChild,
|
||||||
|
ViewEncapsulation
|
||||||
|
} from '@angular/core';
|
||||||
import {ActivatedRoute, NavigationEnd, Router} from '@angular/router';
|
import {ActivatedRoute, NavigationEnd, Router} from '@angular/router';
|
||||||
|
|
||||||
import {EnvProperties} from './openaireLibrary/utils/properties/env-properties';
|
import {EnvProperties} from './openaireLibrary/utils/properties/env-properties';
|
||||||
|
@ -11,14 +20,14 @@ import {UserManagementService} from "./openaireLibrary/services/user-management.
|
||||||
import {ConfigurationService} from "./openaireLibrary/utils/configuration/configuration.service";
|
import {ConfigurationService} from "./openaireLibrary/utils/configuration/configuration.service";
|
||||||
import {properties} from '../environments/environment';
|
import {properties} from '../environments/environment';
|
||||||
import {Header} from "./openaireLibrary/sharedComponents/navigationBar.component";
|
import {Header} from "./openaireLibrary/sharedComponents/navigationBar.component";
|
||||||
import {AsyncSubject, Subscriber} from "rxjs";
|
import {Subscriber} from "rxjs";
|
||||||
import {CommunityService} from "./openaireLibrary/connect/community/community.service";
|
import {CommunityService} from "./openaireLibrary/connect/community/community.service";
|
||||||
import {StringUtils} from "./openaireLibrary/utils/string-utils.class";
|
import {StringUtils} from "./openaireLibrary/utils/string-utils.class";
|
||||||
import {LoginErrorCodes} from "./openaireLibrary/login/utils/guardHelper.class";
|
import {LoginErrorCodes} from "./openaireLibrary/login/utils/guardHelper.class";
|
||||||
import {CustomizationOptions, Layout} from "./openaireLibrary/connect/community/CustomizationOptions";
|
import {Layout} from "./openaireLibrary/connect/community/CustomizationOptions";
|
||||||
import {CustomizationService} from "./openaireLibrary/services/customization.service";
|
import {CustomizationService} from "./openaireLibrary/services/customization.service";
|
||||||
import {SmoothScroll} from "./openaireLibrary/utils/smooth-scroll";
|
import {SmoothScroll} from "./openaireLibrary/utils/smooth-scroll";
|
||||||
import {Meta} from "@angular/platform-browser";
|
import {makeStateKey, Meta, StateKey, TransferState} from "@angular/platform-browser";
|
||||||
import {CommunityInfo} from "./openaireLibrary/connect/community/communityInfo";
|
import {CommunityInfo} from "./openaireLibrary/connect/community/communityInfo";
|
||||||
import {SEOService} from "./openaireLibrary/sharedComponents/SEO/SEO.service";
|
import {SEOService} from "./openaireLibrary/sharedComponents/SEO/SEO.service";
|
||||||
import {UntypedFormBuilder, UntypedFormGroup, Validators} from "@angular/forms";
|
import {UntypedFormBuilder, UntypedFormGroup, Validators} from "@angular/forms";
|
||||||
|
@ -29,7 +38,8 @@ import {QuickContactComponent} from "./openaireLibrary/sharedComponents/quick-co
|
||||||
import {Composer} from "./openaireLibrary/utils/email/composer";
|
import {Composer} from "./openaireLibrary/utils/email/composer";
|
||||||
import {NotificationHandler} from "./openaireLibrary/utils/notification-handler";
|
import {NotificationHandler} from "./openaireLibrary/utils/notification-handler";
|
||||||
import {OpenaireEntities} from "./openaireLibrary/utils/properties/searchFields";
|
import {OpenaireEntities} from "./openaireLibrary/utils/properties/searchFields";
|
||||||
import {DOCUMENT} from "@angular/common";
|
import {DOCUMENT, isPlatformServer} from "@angular/common";
|
||||||
|
import {AdvancedAsyncSubject} from "./openaireLibrary/utils/AdvancedAsyncSubject";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
|
@ -44,7 +54,9 @@ import {DOCUMENT} from "@angular/common";
|
||||||
<a routerLink="/get-started">Get Started</a>
|
<a routerLink="/get-started">Get Started</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<a *ngIf="showGetStarted" extra-m class="uk-button uk-button-small uk-button-primary uk-text-uppercase uk-margin-left" routerLink="/get-started">Get Started</a>
|
<a *ngIf="showGetStarted" extra-m
|
||||||
|
class="uk-button uk-button-small uk-button-primary uk-text-uppercase uk-margin-left"
|
||||||
|
routerLink="/get-started">Get Started</a>
|
||||||
</navbar>
|
</navbar>
|
||||||
<navbar *ngIf="properties && showMenu && community && header" [portal]="community.communityId" [onlyTop]=false
|
<navbar *ngIf="properties && showMenu && community && header" [portal]="community.communityId" [onlyTop]=false
|
||||||
[communityId]="community.communityId" [header]="header"
|
[communityId]="community.communityId" [header]="header"
|
||||||
|
@ -65,7 +77,8 @@ import {DOCUMENT} from "@angular/common";
|
||||||
<schema2jsonld *ngIf="properties && showMenu && communityId && communityId.length > 0 && community"
|
<schema2jsonld *ngIf="properties && showMenu && communityId && communityId.length > 0 && community"
|
||||||
[URL]="properties.domain + properties.baseLink"
|
[URL]="properties.domain + properties.baseLink"
|
||||||
[logoURL]="community.logoUrl" type="home" [searchActionRoute]="properties.searchLinkToResults"
|
[logoURL]="community.logoUrl" type="home" [searchActionRoute]="properties.searchLinkToResults"
|
||||||
[name]="(community.shortTitle) ? community.shortTitle : community.title" [description]="community.description">
|
[name]="(community.shortTitle) ? community.shortTitle : community.title"
|
||||||
|
[description]="community.description">
|
||||||
</schema2jsonld>
|
</schema2jsonld>
|
||||||
<div class="custom-main-content">
|
<div class="custom-main-content">
|
||||||
<main>
|
<main>
|
||||||
|
@ -92,14 +105,14 @@ import {DOCUMENT} from "@angular/common";
|
||||||
[properties]="properties"></bottom>
|
[properties]="properties"></bottom>
|
||||||
<bottom *ngIf="properties && isClient && showMenu && community" class=" communityPanelBackground "
|
<bottom *ngIf="properties && isClient && showMenu && community" class=" communityPanelBackground "
|
||||||
[showSocialButtons]="true" [showMenuItems]="true" [grantAdvance]="false" [showOpenaire]="true"
|
[showSocialButtons]="true" [showMenuItems]="true" [grantAdvance]="false" [showOpenaire]="true"
|
||||||
[communityId]="community.communityId" [menuItems]=bottomMenuItems [properties]="properties"
|
[communityId]="community.communityId" [menuItems]=bottomMenuItems [properties]="properties" [centered]="true"></bottom>
|
||||||
[darkBackground]="true" [centered]="true"></bottom>
|
|
||||||
<quick-contact #quickContact *ngIf="showQuickContact && contactForm" (sendEmitter)="send($event)"
|
<quick-contact #quickContact *ngIf="showQuickContact && contactForm" (sendEmitter)="send($event)"
|
||||||
[contact]="'Help'" [images]="images" [background]="{class: 'uk-background-primary', dark: false}"
|
[contact]="'Help'" [images]="images" [background]="{class: 'uk-background-primary', dark: false}"
|
||||||
[contactForm]="contactForm" [sending]="sending"></quick-contact>
|
[contactForm]="contactForm" [sending]="sending"></quick-contact>
|
||||||
<modal-alert #modal [overflowBody]="false"></modal-alert>
|
<modal-alert #modal [overflowBody]="false"></modal-alert>
|
||||||
<role-verification *ngIf="community" service="connect"
|
<role-verification *ngIf="community" service="connect"
|
||||||
[id]="community.communityId" [name]="community.title" [type]="community.type"></role-verification>
|
[id]="community.communityId" [name]="community.title"
|
||||||
|
[type]="community.type"></role-verification>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
|
|
||||||
|
@ -109,7 +122,7 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||||
userMenuItems: MenuItem[] = [];
|
userMenuItems: MenuItem[] = [];
|
||||||
menuItems: MenuItem [] = [];
|
menuItems: MenuItem [] = [];
|
||||||
bottomMenuItems: MenuItem[] = [];
|
bottomMenuItems: MenuItem[] = [];
|
||||||
public community:CommunityInfo = null;
|
public community: CommunityInfo = null;
|
||||||
properties: EnvProperties = properties;
|
properties: EnvProperties = properties;
|
||||||
showMenu: boolean = false;
|
showMenu: boolean = false;
|
||||||
communities = null;
|
communities = null;
|
||||||
|
@ -131,8 +144,13 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||||
layouts: Layout[] = null;
|
layouts: Layout[] = null;
|
||||||
layoutDefault: Layout = null;
|
layoutDefault: Layout = null;
|
||||||
layoutConnect: Layout = null;
|
layoutConnect: Layout = null;
|
||||||
layoutSub = new AsyncSubject();
|
layoutSub = new AdvancedAsyncSubject<Layout[]>();
|
||||||
previewLayout = null;
|
previewLayout = null;
|
||||||
|
/**
|
||||||
|
* key for portal identity check (client - server: using transfer state
|
||||||
|
* */
|
||||||
|
key: StateKey<string> = makeStateKey<string>('portal');
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute, private propertiesService: EnvironmentSpecificService,
|
constructor(private route: ActivatedRoute, private propertiesService: EnvironmentSpecificService,
|
||||||
private _communitiesService: CommunitiesService, private smoothScroll: SmoothScroll,
|
private _communitiesService: CommunitiesService, private smoothScroll: SmoothScroll,
|
||||||
private router: Router, private userManagementService: UserManagementService,
|
private router: Router, private userManagementService: UserManagementService,
|
||||||
|
@ -141,7 +159,10 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||||
private quickContactService: QuickContactService,
|
private quickContactService: QuickContactService,
|
||||||
private fb: UntypedFormBuilder,
|
private fb: UntypedFormBuilder,
|
||||||
private emailService: EmailService,
|
private emailService: EmailService,
|
||||||
@Inject(DOCUMENT) private document, private rendererFactory: RendererFactory2
|
@Inject(DOCUMENT) private document,
|
||||||
|
private transferState: TransferState,
|
||||||
|
@Inject(PLATFORM_ID) private platformId: any,
|
||||||
|
private rendererFactory: RendererFactory2
|
||||||
) {
|
) {
|
||||||
this.subscriptions.push(router.events.forEach((event) => {
|
this.subscriptions.push(router.events.forEach((event) => {
|
||||||
if (event instanceof NavigationEnd) {
|
if (event instanceof NavigationEnd) {
|
||||||
|
@ -157,9 +178,8 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
this.subscriptions.push(this.route.queryParams.subscribe(data => {
|
this.subscriptions.push(this.route.queryParams.subscribe(data => {
|
||||||
this.previewLayout = (data['previewLayout'] && data['previewLayout'].length >0 ? data['previewLayout']: null);
|
this.previewLayout = (data['previewLayout'] && data['previewLayout'].length > 0 ? data['previewLayout'] : null);
|
||||||
if (this.properties.environment == "production" || this.properties.environment == "development") {
|
if (this.properties.environment == "production" || this.properties.environment == "development") {
|
||||||
this._meta.updateTag({content: 'all', name: 'robots'});
|
this._meta.updateTag({content: 'all', name: 'robots'});
|
||||||
this.seoService.removeLinkForPrevURL();
|
this.seoService.removeLinkForPrevURL();
|
||||||
|
@ -177,7 +197,8 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.init();
|
this.init();
|
||||||
}, error => {
|
}, error => {
|
||||||
this.init()}));
|
this.init();
|
||||||
|
}));
|
||||||
this.subscriptions.push(this.quickContactService.isDisplayed.subscribe(display => {
|
this.subscriptions.push(this.quickContactService.isDisplayed.subscribe(display => {
|
||||||
this.showQuickContact = display;
|
this.showQuickContact = display;
|
||||||
}));
|
}));
|
||||||
|
@ -228,7 +249,7 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||||
private init() {
|
private init() {
|
||||||
let communityId: string = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
let communityId: string = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||||
this.showMenu = false;
|
this.showMenu = false;
|
||||||
this.initAdminToolCommunity(communityId);
|
// this.initAdminToolCommunity(communityId);
|
||||||
this.buildMenu(communityId);
|
this.buildMenu(communityId);
|
||||||
// this.communityId = communityId;
|
// this.communityId = communityId;
|
||||||
if (!communityId) {
|
if (!communityId) {
|
||||||
|
@ -238,9 +259,9 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||||
this.userManagementService.fixRedirectURL = null;
|
this.userManagementService.fixRedirectURL = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
initCss(communityId, suffix=null) {
|
|
||||||
try {
|
|
||||||
|
|
||||||
|
initCss(communityId, suffix = null) {
|
||||||
|
try {
|
||||||
const renderer = this.rendererFactory.createRenderer(this.document, {
|
const renderer = this.rendererFactory.createRenderer(this.document, {
|
||||||
id: '-1',
|
id: '-1',
|
||||||
encapsulation: ViewEncapsulation.None,
|
encapsulation: ViewEncapsulation.None,
|
||||||
|
@ -251,70 +272,74 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||||
if (head === null) {
|
if (head === null) {
|
||||||
throw new Error('<head> not found within DOCUMENT.');
|
throw new Error('<head> not found within DOCUMENT.');
|
||||||
}
|
}
|
||||||
if(!this.document.getElementById("dashboardStyle")) {
|
if (!this.document.getElementById("dashboardStyle")) {
|
||||||
const script = renderer.createElement('link');
|
const script = renderer.createElement('link');
|
||||||
renderer.setAttribute(script, "id", "dashboardStyle");
|
renderer.setAttribute(script, "id", "dashboardStyle");
|
||||||
renderer.setAttribute(script, "href", ((communityId) ? communityId : this.properties.adminToolsPortalType) + (suffix?"-"+suffix:"") + ".css");
|
renderer.setAttribute(script, "href", ((communityId) ? communityId : this.properties.adminToolsPortalType) + (suffix ? "-" + suffix : "") + ".css");
|
||||||
renderer.setAttribute(script, "rel", "stylesheet");
|
renderer.setAttribute(script, "rel", "stylesheet");
|
||||||
renderer.appendChild(head, script);
|
renderer.appendChild(head, script);
|
||||||
}else if(!this.previewLayout){
|
} else if (!this.previewLayout) {
|
||||||
this.document.getElementById("dashboardStyle").href = ((communityId) ? communityId : this.properties.adminToolsPortalType)+ (suffix?"-"+suffix:"") + ".css";
|
this.document.getElementById("dashboardStyle").href = ((communityId) ? communityId : this.properties.adminToolsPortalType) + (suffix ? "-" + suffix : "") + ".css";
|
||||||
// console.log(this.document.getElementById("dashboardStyle"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('Renderrer Error to append style ', e);
|
console.error('Renderrer Error to append style ', e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initAdminToolCommunity(communityId) {
|
initAdminToolCommunity(communityId) {
|
||||||
if (communityId) {
|
if (communityId) {
|
||||||
this.properties.adminToolsPortalType = "community";
|
this.properties.adminToolsPortalType = "community";
|
||||||
if (typeof document === 'undefined') {
|
if (this.document) {
|
||||||
this.initLayout(communityId);
|
this.initLayout(communityId);
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
this.properties.adminToolsPortalType = "connect";
|
this.properties.adminToolsPortalType = "connect";
|
||||||
if (typeof document === 'undefined') {
|
if (this.document) {
|
||||||
this.initLayout('connect');
|
this.initLayout('connect');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.configurationService.initPortal(this.properties, (communityId) ? communityId : this.properties.adminToolsPortalType);
|
this.configurationService.initPortal(this.properties, (communityId) ? communityId : this.properties.adminToolsPortalType);
|
||||||
|
|
||||||
}
|
}
|
||||||
getLayouts(){
|
|
||||||
|
getLayouts() {
|
||||||
this.customizationService.getLayouts(this.properties).subscribe(
|
this.customizationService.getLayouts(this.properties).subscribe(
|
||||||
layouts => {
|
layouts => {
|
||||||
this.layouts = layouts;
|
this.layouts = layouts;
|
||||||
this.layoutDefault = layouts.filter(layout => layout.portalPid == 'default')[0];
|
this.layoutDefault = layouts.filter(layout => layout.portalPid == 'default')[0];
|
||||||
this.layoutConnect = layouts.filter(layout => layout.portalPid == 'connect')[0];
|
this.layoutConnect = layouts.filter(layout => layout.portalPid == 'connect')[0];
|
||||||
this.layoutSub.next(this.layouts);
|
this.layoutSub.next(this.layouts);
|
||||||
this.layoutSub.complete();
|
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
|
this.layoutSub.next([]);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
initLayout(communityId){
|
|
||||||
if(!this.layout && (typeof location == 'undefined') && !this.previewLayout) {
|
initLayout(communityId) {
|
||||||
|
let portal = this.transferState.get<string>(this.key, null);
|
||||||
|
if(isPlatformServer(this.platformId)) {
|
||||||
|
this.transferState.set(this.key, communityId);
|
||||||
|
}
|
||||||
|
if (!this.layout && (portal !== communityId) && !this.previewLayout) {
|
||||||
|
// if((typeof location == 'undefined') && !this.previewLayout) {
|
||||||
this.subscriptions.push(this.layoutSub.subscribe(value => {
|
this.subscriptions.push(this.layoutSub.subscribe(value => {
|
||||||
this.layout = this.layouts.filter(layout => layout.portalPid == communityId)[0]?this.layouts.filter(layout => layout.portalPid == communityId)[0]:this.layouts.filter(layout => layout.portalPid == 'default')[0];
|
this.layouts = value;
|
||||||
this.initCss(this.layout.portalPid, this.layout.date?this.layout.date:null)
|
this.layout = this.layouts.filter(layout => layout.portalPid == communityId)[0] ? this.layouts.filter(layout => layout.portalPid == communityId)[0] : this.layouts.filter(layout => layout.portalPid == 'default')[0];
|
||||||
|
this.initCss(this.layout.portalPid, this.layout.date ? this.layout.date : null)
|
||||||
}));
|
}));
|
||||||
|
|
||||||
}else if(this.previewLayout && this.previewLayout.split("-preview-")[0] == communityId){
|
} else if (this.previewLayout && this.previewLayout.split("-preview-")[0] == communityId) {
|
||||||
this.initCss(communityId, this.previewLayout.split(communityId)[1]);
|
this.initCss(communityId, this.previewLayout.split(communityId)[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public buildMenu(communityId: string) {
|
public buildMenu(communityId: string) {
|
||||||
if (communityId) {
|
if (communityId) {
|
||||||
if (!this.community || this.communityId !== communityId) {
|
if (!this.community || this.communityId !== communityId) {
|
||||||
this.subscriptions.push(this._communityService.getCommunity(communityId).subscribe(community => {
|
this.subscriptions.push(this._communityService.getCommunity(communityId).subscribe(community => {
|
||||||
if (community) {
|
if (community) {
|
||||||
this.community = community;
|
this.community = community;
|
||||||
}else{
|
} else {
|
||||||
this.community = null;
|
this.community = null;
|
||||||
this.communityId = null;
|
this.communityId = null;
|
||||||
}
|
}
|
||||||
|
@ -328,9 +353,10 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buildCommunityMenu(){
|
buildCommunityMenu() {
|
||||||
if (this.community && !ConnectHelper.isPrivate(this.community, this.user)) {
|
if (this.community && !ConnectHelper.isPrivate(this.community, this.user)) {
|
||||||
this.communityId = this.community.communityId;
|
this.communityId = this.community.communityId;
|
||||||
|
this.initAdminToolCommunity(this.communityId);
|
||||||
this.header = {
|
this.header = {
|
||||||
// url: 'https://' + (this.properties.environment == 'beta' ? 'beta.' : '') + this.community.id + '.openaire.eu',
|
// url: 'https://' + (this.properties.environment == 'beta' ? 'beta.' : '') + this.community.id + '.openaire.eu',
|
||||||
route: "/",
|
route: "/",
|
||||||
|
@ -377,6 +403,8 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||||
new MenuItem("", "National Bulletins", "", "/national-bulletins", false, [], ["/national-bulletins"], {}),
|
new MenuItem("", "National Bulletins", "", "/national-bulletins", false, [], ["/national-bulletins"], {}),
|
||||||
new MenuItem("", "Subjects", "", "/subjects", false, [], ["/subjects"], {}),
|
new MenuItem("", "Subjects", "", "/subjects", false, [], ["/subjects"], {}),
|
||||||
new MenuItem("", "Projects and funding Opportunities", "", "/projects", false, [], ["/projects"], {}),
|
new MenuItem("", "Projects and funding Opportunities", "", "/projects", false, [], ["/projects"], {}),
|
||||||
|
new MenuItem("", "Fields of Science", "", "/fields-of-science", false, [], ["/fields-of-science"], {}),
|
||||||
|
new MenuItem("", "Sustainable Development Goals", "", "/sdgs", false, [], ["/sdgs"], {}),
|
||||||
]
|
]
|
||||||
));
|
));
|
||||||
this.menuItems.push(
|
this.menuItems.push(
|
||||||
|
@ -406,13 +434,11 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||||
this.showMenu = true;
|
this.showMenu = true;
|
||||||
} else {
|
} else {
|
||||||
this.communityId = null;
|
this.communityId = null;
|
||||||
this.properties.adminToolsPortalType = "connect";
|
|
||||||
this.configurationService.initPortal(this.properties, "connect");
|
this.configurationService.initPortal(this.properties, "connect");
|
||||||
this.initAdminToolCommunity(null);
|
|
||||||
this.buildConnectMenu(true);
|
this.buildConnectMenu(true);
|
||||||
if (this.community && this.community.status == "manager") {
|
if (this.community && this.community.status == "manager") {
|
||||||
if (!this.user ) {
|
if (!this.user) {
|
||||||
if(typeof location !== 'undefined' && location.pathname.indexOf("user-info") == -1) {
|
if (typeof location !== 'undefined' && location.pathname.indexOf("user-info") == -1) {
|
||||||
this.router.navigate(['/user-info'], {
|
this.router.navigate(['/user-info'], {
|
||||||
queryParams: {
|
queryParams: {
|
||||||
"errorCode": LoginErrorCodes.NOT_LOGIN,
|
"errorCode": LoginErrorCodes.NOT_LOGIN,
|
||||||
|
@ -421,18 +447,20 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(typeof location !== 'undefined' && location.pathname.indexOf("user-info") == -1) {
|
if (typeof location !== 'undefined' && location.pathname.indexOf("user-info") == -1) {
|
||||||
this.router.navigate(['/'], {queryParamsHandling: "merge"});
|
this.router.navigate(['/'], {queryParamsHandling: "merge"});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else if (this.community && this.community.status == "hidden") {
|
} else if (this.community && this.community.status == "hidden") {
|
||||||
this.router.navigate([this.properties.errorLink]);
|
this.router.navigate([this.properties.errorLink]);
|
||||||
}else{
|
} else {
|
||||||
this.router.navigate(['/'], this.community && this.community.status ? { queryParamsHandling: "merge" } : {});
|
this.router.navigate(['/'], this.community && this.community.status ? {queryParamsHandling: "merge"} : {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buildConnectMenu(restrictedData: boolean = false) {
|
buildConnectMenu(restrictedData: boolean = false) {
|
||||||
|
this.initAdminToolCommunity(null);
|
||||||
let url = "https://" + (properties.environment != "production" ? "beta." : "") + "connect.openaire.eu";
|
let url = "https://" + (properties.environment != "production" ? "beta." : "") + "connect.openaire.eu";
|
||||||
this.header = {
|
this.header = {
|
||||||
route: restrictedData ? "" : "/",
|
route: restrictedData ? "" : "/",
|
||||||
|
@ -474,7 +502,7 @@ export class AppComponent implements OnInit, OnDestroy {
|
||||||
restrictedData ? "" : "/myCommunities", false, [], [], {}));
|
restrictedData ? "" : "/myCommunities", false, [], [], {}));
|
||||||
}
|
}
|
||||||
this.showMenu = true;
|
this.showMenu = true;
|
||||||
if (typeof document !== "undefined") {
|
if (typeof document !== "undefined" && this.bottom) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.createObservers();
|
this.createObservers();
|
||||||
});
|
});
|
||||||
|
|
|
@ -307,6 +307,7 @@ export class CommunityComponent {
|
||||||
this.showOrp = !!showEntity["orp"];
|
this.showOrp = !!showEntity["orp"];
|
||||||
this.showProjects = !!showEntity["project"];
|
this.showProjects = !!showEntity["project"];
|
||||||
this.showDataProviders = !!showEntity["datasource"];
|
this.showDataProviders = !!showEntity["datasource"];
|
||||||
|
this.resultTypes.values = [];
|
||||||
if (this.showPublications) {
|
if (this.showPublications) {
|
||||||
this.resultTypes.values.push({
|
this.resultTypes.values.push({
|
||||||
name: this.openaireEntities.PUBLICATIONS,
|
name: this.openaireEntities.PUBLICATIONS,
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
import {NgModule} from "@angular/core";
|
||||||
|
import {RouterModule} from "@angular/router";
|
||||||
|
import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
|
||||||
|
import {CommunityFosComponent} from "./fos.component";
|
||||||
|
import {IsRouteEnabled} from "../openaireLibrary/error/isRouteEnabled.guard";
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
RouterModule.forChild([
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: CommunityFosComponent,
|
||||||
|
canActivate: [IsRouteEnabled],
|
||||||
|
canDeactivate: [PreviousRouteRecorder]
|
||||||
|
}
|
||||||
|
])
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class LibFosRoutingModule {
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
import {Component} from "@angular/core";
|
||||||
|
import {properties} from "../../environments/environment";
|
||||||
|
import {ConnectHelper} from "../openaireLibrary/connect/connectHelper";
|
||||||
|
import {PiwikHelper} from "../utils/piwikHelper";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'community-fos',
|
||||||
|
template: `
|
||||||
|
<fos [piwikSiteId]="piwikSiteId"></fos>
|
||||||
|
`
|
||||||
|
})
|
||||||
|
|
||||||
|
export class CommunityFosComponent {
|
||||||
|
piwikSiteId;
|
||||||
|
communityId;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
|
||||||
|
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
import {CommonModule} from "@angular/common";
|
||||||
|
import {NgModule} from "@angular/core";
|
||||||
|
import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
|
||||||
|
import {LibFosRoutingModule} from "./fos-routing.module";
|
||||||
|
import {FosRoutingModule} from "../openaireLibrary/fos/fos-routing.module";
|
||||||
|
import {FosModule} from "../openaireLibrary/fos/fos.module";
|
||||||
|
import {CommunityFosComponent} from "./fos.component";
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
LibFosRoutingModule,
|
||||||
|
FosRoutingModule,
|
||||||
|
FosModule
|
||||||
|
],
|
||||||
|
declarations: [
|
||||||
|
CommunityFosComponent
|
||||||
|
],
|
||||||
|
exports: [
|
||||||
|
CommunityFosComponent
|
||||||
|
],
|
||||||
|
providers: [
|
||||||
|
PreviousRouteRecorder
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class LibFosModule {
|
||||||
|
}
|
|
@ -28,6 +28,7 @@ export class HtmlPageComponent {
|
||||||
@Input() description: string;
|
@Input() description: string;
|
||||||
private subscriptions = [];
|
private subscriptions = [];
|
||||||
communityId;
|
communityId;
|
||||||
|
piwikSiteId;
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute, private _router: Router,
|
constructor(private route: ActivatedRoute, private _router: Router,
|
||||||
private _meta: Meta,
|
private _meta: Meta,
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 49e2edfe84d441bf1b5bf4bbfb7f94f98d88cb7a
|
Subproject commit b6ead8d7e2fa94ede8f45c6295d9b37575fc1f92
|
|
@ -0,0 +1,20 @@
|
||||||
|
import {NgModule} from "@angular/core";
|
||||||
|
import {RouterModule} from "@angular/router";
|
||||||
|
import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
|
||||||
|
import {CommunitySdgComponent} from "./sdg.component";
|
||||||
|
import {IsRouteEnabled} from "../openaireLibrary/error/isRouteEnabled.guard";
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
RouterModule.forChild([
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
component: CommunitySdgComponent,
|
||||||
|
canActivate: [IsRouteEnabled],
|
||||||
|
canDeactivate: [PreviousRouteRecorder]
|
||||||
|
}
|
||||||
|
])
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class LibSdgRoutingModule {
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
import {Component} from "@angular/core";
|
||||||
|
import {properties} from "../../environments/environment";
|
||||||
|
import {ConnectHelper} from "../openaireLibrary/connect/connectHelper";
|
||||||
|
import {PiwikHelper} from "../utils/piwikHelper";
|
||||||
|
import {SearchCustomFilter} from "../openaireLibrary/searchPages/searchUtils/searchUtils.class";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'community-sdg',
|
||||||
|
template: `
|
||||||
|
<sdg [piwikSiteId]="piwikSiteId" [customFilter]="customFilter"></sdg>
|
||||||
|
`
|
||||||
|
})
|
||||||
|
export class CommunitySdgComponent {
|
||||||
|
piwikSiteId;
|
||||||
|
communityId;
|
||||||
|
customFilter: SearchCustomFilter = null;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.communityId = ConnectHelper.getCommunityFromDomain(properties.domain);
|
||||||
|
this.piwikSiteId = PiwikHelper.getSiteId(this.communityId);
|
||||||
|
this.customFilter = new SearchCustomFilter("Community", "communityId", this.communityId, "");
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
import {CommonModule} from "@angular/common";
|
||||||
|
import {NgModule} from "@angular/core";
|
||||||
|
import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
|
||||||
|
import {LibSdgRoutingModule} from "./sdg-routing.module";
|
||||||
|
import {SdgRoutingModule} from "../openaireLibrary/sdg/sdg-routing.module";
|
||||||
|
import {SdgModule} from "../openaireLibrary/sdg/sdg.module";
|
||||||
|
import {CommunitySdgComponent} from "./sdg.component";
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
LibSdgRoutingModule,
|
||||||
|
SdgRoutingModule,
|
||||||
|
SdgModule
|
||||||
|
],
|
||||||
|
declarations: [
|
||||||
|
CommunitySdgComponent
|
||||||
|
],
|
||||||
|
exports: [
|
||||||
|
CommunitySdgComponent
|
||||||
|
],
|
||||||
|
providers: [
|
||||||
|
PreviousRouteRecorder
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class LibSdgModule {
|
||||||
|
}
|
|
@ -30,21 +30,23 @@ export class PiwikHelper{
|
||||||
"inspired-ris":530,
|
"inspired-ris":530,
|
||||||
"citizen-science":538,
|
"citizen-science":538,
|
||||||
"eut":558,
|
"eut":558,
|
||||||
"aurora":560,
|
"aurora": 560,
|
||||||
"ebrains": 592,
|
"ebrains": 592,
|
||||||
"neanias-space":604,
|
"neanias-space": 604,
|
||||||
"heritage-science":607,
|
"heritage-science": 607,
|
||||||
"eutopia":608,
|
"eutopia": 608,
|
||||||
"north-america-studies": 609,
|
"north-america-studies": 609,
|
||||||
"iperionhs":610,
|
"iperionhs": 610,
|
||||||
"neanias-atmospheric": 613,
|
"neanias-atmospheric": 613,
|
||||||
"forthem": 625,
|
"forthem": 625,
|
||||||
"argo-france": 634,
|
"argo-france": 634,
|
||||||
"knowmad": 640
|
"knowmad": 640,
|
||||||
|
"egrise": 710,
|
||||||
|
"euconexus": 707,
|
||||||
|
"dth": 719
|
||||||
};
|
};
|
||||||
|
|
||||||
public static getSiteId(communityId:string){
|
public static getSiteId(communityId:string){
|
||||||
return this.siteIDs[communityId];
|
return this.siteIDs[communityId];
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit ca209a54baaa2d9e0004613a68088fdcf4bee43a
|
Subproject commit f15bbfa7265f170e06b256f086f2acedfa3f72e0
|
|
@ -1 +1 @@
|
||||||
Subproject commit aa1e6c9df390a4ba0919b5f8591374f7eec75089
|
Subproject commit 468b2b008f474c88dacc52991a5231693833f1f9
|
|
@ -114,5 +114,6 @@ export let properties: EnvProperties = {
|
||||||
altMetricsAPIURL: "https://api.altmetric.com/v1/doi/",
|
altMetricsAPIURL: "https://api.altmetric.com/v1/doi/",
|
||||||
b2noteAPIURL: 'https://b2note.eudat.eu/',
|
b2noteAPIURL: 'https://b2note.eudat.eu/',
|
||||||
adminPortalURL: "https://admin.connect.openaire.eu",
|
adminPortalURL: "https://admin.connect.openaire.eu",
|
||||||
myOrcidLinksPage: "/my-orcid-links"
|
myOrcidLinksPage: "/my-orcid-links",
|
||||||
|
hasMachineCache: true
|
||||||
};
|
};
|
||||||
|
|
|
@ -58,7 +58,7 @@ export let properties: EnvProperties = {
|
||||||
piwikBaseUrl: 'https://analytics.openaire.eu/piwik.php?idsite=',
|
piwikBaseUrl: 'https://analytics.openaire.eu/piwik.php?idsite=',
|
||||||
piwikSiteId: '80',
|
piwikSiteId: '80',
|
||||||
registryUrl: 'http://mpagasas.di.uoa.gr:8080/dnet-openaire-users-1.0.0-SNAPSHOT/api/registry/',
|
registryUrl: 'http://mpagasas.di.uoa.gr:8080/dnet-openaire-users-1.0.0-SNAPSHOT/api/registry/',
|
||||||
loginUrl: "http://mpagasas.di.uoa.gr:19080/login-service//openid_connect_login",
|
loginUrl: "http://mpagasas.di.uoa.gr:19080/login-service/openid_connect_login",
|
||||||
userInfoUrl: "http://mpagasas.di.uoa.gr:19080/login-service/userInfo",
|
userInfoUrl: "http://mpagasas.di.uoa.gr:19080/login-service/userInfo",
|
||||||
logoutUrl: "http://mpagasas.di.uoa.gr:19080/login-service/openid_logout",
|
logoutUrl: "http://mpagasas.di.uoa.gr:19080/login-service/openid_logout",
|
||||||
cookieDomain: '.di.uoa.gr',
|
cookieDomain: '.di.uoa.gr',
|
||||||
|
|
Loading…
Reference in New Issue