2019-06-05 15:39:02 +02:00
import { Component } from '@angular/core' ;
2019-08-28 14:54:35 +02:00
import { ActivatedRoute , NavigationStart , Router } from '@angular/router' ;
2018-02-12 12:41:40 +01:00
2019-06-05 15:39:02 +02:00
import { EnvProperties } from './openaireLibrary/utils/properties/env-properties' ;
import { MenuItem , RootMenuItem } from './openaireLibrary/sharedComponents/menu' ;
import { EnvironmentSpecificService } from './openaireLibrary/utils/properties/environment-specific.service' ;
2018-03-16 09:55:38 +01:00
import { CommunitiesService } from "./openaireLibrary/connect/communities/communities.service" ;
2019-09-13 09:47:29 +02:00
import { Session , User } from './openaireLibrary/login/utils/helper.class' ;
2018-03-29 10:28:04 +02:00
import { ConnectHelper } from './openaireLibrary/connect/connectHelper' ;
2019-06-20 10:13:31 +02:00
import { HelperFunctions } from "./openaireLibrary/utils/HelperFunctions.class" ;
2019-09-13 09:47:29 +02:00
import { UserManagementService } from "./openaireLibrary/services/user-management.service" ;
2020-07-15 17:53:19 +02:00
import { ConfigurationService } from "./openaireLibrary/utils/configuration/configuration.service" ;
2020-09-24 13:43:34 +02:00
import { properties } from '../environments/environment' ;
2020-10-14 12:14:09 +02:00
import { Header } from "./openaireLibrary/sharedComponents/navigationBar.component" ;
2020-11-12 16:59:26 +01:00
import { Subscriber } from "rxjs" ;
2020-11-30 18:04:05 +01:00
import { CommunityService } from "./openaireLibrary/connect/community/community.service" ;
2021-03-04 14:46:40 +01:00
import { StringUtils } from "./openaireLibrary/utils/string-utils.class" ;
2021-03-29 16:05:20 +02:00
import { LoginErrorCodes } from "./openaireLibrary/login/utils/guardHelper.class" ;
2021-04-08 12:58:48 +02:00
import { CustomizationOptions } from "./openaireLibrary/connect/community/CustomizationOptions" ;
import { LayoutService } from "./openaireLibrary/services/layout.service" ;
2021-04-20 17:20:05 +02:00
import { SmoothScroll } from "./openaireLibrary/utils/smooth-scroll" ;
2021-05-12 09:31:21 +02:00
import { Meta } from "@angular/platform-browser" ;
2021-04-01 16:25:15 +02:00
2018-01-26 16:00:07 +01:00
@Component ( {
//changeDetection: ChangeDetectionStrategy.Default,
//encapsulation: ViewEncapsulation.Emulated,
selector : 'app-root' ,
styles : [ `
` ],
template : `
2020-04-23 15:35:54 +02:00
< div [ class ] = " ( community ) ? ( community.id + ' App communityApp ' ) : ' connectApp ' " >
2020-10-14 12:14:09 +02:00
< navbar * ngIf = "properties && showMenu && !community && header" [ portal ] = " properties.dashboard " [ onlyTop ] = false
[ userMenuItems ] = userMenuItems [ menuItems ] = menuItems [ user ] = "user" [ header ] = "header"
2020-04-23 15:35:54 +02:00
[ showMenu ] = showMenu [ properties ] = "properties" [ showHomeMenuItem ] = "false" communityId = "connect" > < / navbar >
2020-12-01 12:17:53 +01:00
< navbar * ngIf = "properties && showMenu && community && header" [ portal ] = " community.id " [ onlyTop ] = false
2020-10-14 12:14:09 +02:00
[ communityId ] = "community.id" [ header ] = "header"
2019-09-13 09:47:29 +02:00
[ userMenuItems ] = userMenuItems [ menuItems ] = menuItems [ user ] = "user"
2020-10-14 12:14:09 +02:00
[ showMenu ] = showMenu [ properties ] = "properties" [ enableSearch ] = "false"
2020-04-23 15:35:54 +02:00
searchRoute = "/search/find/research-outcomes"
[ showHomeMenuItem ] = "false" > < / navbar >
2021-04-16 18:20:27 +02:00
< customization * ngIf = "properties && showMenu && communityId && communityId.length > 0 && layout" [ properties ] = " properties "
[ communityId ] = "communityId" [ layout ] = "layout" > < / customization >
2021-02-19 18:52:12 +01:00
< schema2jsonld * ngIf = "properties && showMenu && !community" [ URL ] = " properties.domain + properties.baseLink "
[ logoURL ] = "properties.domain + properties.baseLink+'/assets/common-assets/logo-small-connect.png'"
type = "home"
2020-08-10 17:32:33 +02:00
[ searchActionRoute ] = "properties.searchLinkToCommunities" [ searchAction ] = "true"
name = "OpenAIRE Connect"
description = "Build a Gateway for your Community: Turn Open Science into Practice. It takes your open and linked research outcomes." >
< / schema2jsonld >
2021-02-19 18:52:12 +01:00
< schema2jsonld * ngIf = "properties && showMenu && communityId && communityId.length > 0 && community"
[ URL ] = "properties.domain + properties.baseLink"
2020-08-10 17:32:33 +02:00
[ logoURL ] = "community.logoUrl" type = "home" [ searchActionRoute ] = "properties.searchLinkToResults"
2021-02-19 18:52:12 +01:00
[ name ] = "community.name" [ description ] = "community.description" >
2020-08-10 17:32:33 +02:00
< / schema2jsonld >
2019-08-28 14:54:35 +02:00
< div class = "custom-main-content" >
< main >
< router - outlet > < / r o u t e r - o u t l e t >
< / main >
2019-07-15 14:21:18 +02:00
< / div >
2021-04-23 18:27:37 +02:00
< div id = "subscribeAndInviteBtn" * ngIf = "isClient && community" >
< subscribe [ communityId ] = " community.id " > < / subscribe >
< invite * ngIf = "isManager" [ longView ] = " false " > < / invite >
2020-04-28 13:07:36 +02:00
< / div >
2019-08-28 14:54:35 +02:00
<!-- feedback * ngIf = "isClient && properties" portalName = "Connect" [ feedbackQuestionaire ] = properties . feedbackQuestionaire > < / f e e d b a c k - - >
< cookie - law * ngIf = "isClient" position = "bottom" >
OpenAIRE uses cookies in order to function properly . < br >
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
2021-02-19 18:52:12 +01:00
href = "//ec.europa.eu/ipg/basics/legal/cookies/index_en.htm" target = "_blank" > Read more < span class = "uk-icon" >
2019-08-28 14:54:35 +02:00
< 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 >
< / c o o k i e - l a w >
< bottom * ngIf = "properties && isClient && showMenu && !community" [ grantAdvance ] = " false "
[ properties ] = "properties" > < / bottom >
2020-05-07 15:31:13 +02:00
< bottom * ngIf = "properties && isClient && showMenu && community" class = " communityPanelBackground "
2019-08-28 14:54:35 +02:00
[ showSocialButtons ] = "true" [ showMenuItems ] = "true" [ grantAdvance ] = "false" [ showOpenaire ] = "true"
2020-04-23 15:35:54 +02:00
[ communityId ] = "community.id" [ menuItems ] = bottomMenuItems [ properties ] = "properties"
2020-05-07 15:31:13 +02:00
[ darkBackground ] = "true" [ centered ] = "true" > < / bottom >
2021-02-19 18:52:12 +01:00
< role - verification * ngIf = "community" service = "connect"
[ id ] = "community.id" [ name ] = "community.name" [ type ] = "'community'" > < / r o l e - v e r i f i c a t i o n >
2019-08-28 14:54:35 +02:00
< / div >
`
2021-04-01 16:25:15 +02:00
2018-01-26 16:00:07 +01:00
} )
export class AppComponent {
2019-08-28 14:54:35 +02:00
isClient : boolean = false ;
userMenuItems : MenuItem [ ] = [ ] ;
menuItems : RootMenuItem [ ] = [ ] ;
bottomMenuItems : MenuItem [ ] = [ ] ;
2018-03-01 12:45:37 +01:00
public community = null ;
2021-04-23 18:27:37 +02:00
properties : EnvProperties = properties ;
2019-08-28 14:54:35 +02:00
showMenu : boolean = false ;
2018-03-22 17:01:06 +01:00
communities = null ;
2019-09-13 09:47:29 +02:00
user : User ;
2020-04-24 18:38:35 +02:00
communityId : string = "" ;
2020-10-14 12:14:09 +02:00
header : Header ;
logoPath : string = 'assets/common-assets/' ;
2020-11-12 16:59:26 +01:00
subscriptions = [ ] ;
2021-04-08 12:58:48 +02:00
layout : CustomizationOptions = null ;
2019-08-28 14:54:35 +02:00
constructor ( private route : ActivatedRoute , private propertiesService : EnvironmentSpecificService ,
2021-04-20 17:20:05 +02:00
private _communitiesService : CommunitiesService , private smoothScroll : SmoothScroll ,
2020-07-15 17:53:19 +02:00
private router : Router , private userManagementService : UserManagementService ,
2021-05-12 09:31:21 +02:00
private configurationService : ConfigurationService , private _communityService : CommunityService , private _layoutService : LayoutService , private _meta : Meta ) {
2020-11-12 16:59:26 +01:00
}
2021-02-19 18:52:12 +01:00
2020-11-12 16:59:26 +01:00
ngOnDestroy() {
this . subscriptions . forEach ( subscription = > {
if ( subscription instanceof Subscriber ) {
subscription . unsubscribe ( ) ;
}
2019-08-28 14:54:35 +02:00
} ) ;
2020-11-12 16:59:26 +01:00
this . _communitiesService . clearSubscriptions ( ) ;
this . userManagementService . clearSubscriptions ( ) ;
this . configurationService . clearSubscriptions ( ) ;
2020-11-30 18:04:05 +01:00
this . _communityService . clearSubscriptions ( ) ;
2021-04-20 17:20:05 +02:00
this . smoothScroll . clearSubscriptions ( ) ;
2019-08-28 14:54:35 +02:00
}
2021-04-01 16:25:15 +02:00
2019-08-28 14:54:35 +02:00
ngOnInit() {
2021-05-12 09:31:21 +02:00
if ( this . properties . environment == "production" || this . properties . environment == "development" ) {
this . subscriptions . push ( this . route . queryParams . subscribe ( data = > {
this . _meta . updateTag ( { content : 'all' , name : 'robots' } ) ;
} ) ) ;
}
2020-11-12 16:59:26 +01:00
this . _communitiesService . updateCommunities ( this . properties , this . properties . communitiesAPI ) ;
if ( typeof document !== 'undefined' ) {
try {
this . isClient = true ;
} catch ( e ) {
}
}
this . subscriptions . push ( this . userManagementService . getUserInfo ( ) . subscribe ( user = > {
this . user = user ;
this . init ( ) ;
2021-04-01 16:25:15 +02:00
} , error = > this . init ( ) ) ) ;
2019-11-08 12:04:10 +01:00
}
2021-02-19 18:52:12 +01:00
get isManager() {
return Session . isCommunityCurator ( this . user ) || Session . isPortalAdministrator ( this . user ) || ( this . communityId && Session . isManager ( 'community' , this . communityId , this . user ) )
}
2021-04-01 16:25:15 +02:00
2019-11-08 12:04:10 +01:00
private init() {
2021-03-29 16:05:20 +02:00
let communityId : string = ConnectHelper . getCommunityFromDomain ( this . properties . domain ) ;
this . showMenu = false ;
this . initAdminToolCommunity ( communityId ) ;
this . buildMenu ( communityId ) ;
2020-04-24 18:38:35 +02:00
this . communityId = communityId ;
2021-04-01 16:25:15 +02:00
if ( this . communityId === null ) {
2021-03-17 10:58:30 +01:00
this . userManagementService . fixRedirectURL = properties . afterLoginRedirectLink ;
} else {
this . userManagementService . fixRedirectURL = null ;
}
2019-08-28 14:54:35 +02:00
}
2021-04-01 16:25:15 +02:00
initAdminToolCommunity ( communityId ) {
if ( communityId ) {
2021-03-29 16:05:20 +02:00
this . properties . adminToolsPortalType = "community" ;
2021-04-16 18:20:27 +02:00
this . initLayout ( communityId ) ;
2021-03-29 16:05:20 +02:00
}
2021-04-01 16:25:15 +02:00
this . configurationService . initCommunityInformation ( this . properties , ( communityId ) ? communityId : this.properties.adminToolsPortalType ) ;
2021-03-29 16:05:20 +02:00
}
2021-04-08 12:58:48 +02:00
initLayout ( communityId ) {
2021-04-16 18:20:27 +02:00
if ( ! this . layout && this . properties . environment == "development" ) {
2021-04-08 12:58:48 +02:00
this . _layoutService . getLayout ( this . properties , communityId ) . subscribe (
layout = > {
if ( layout ) {
2021-04-16 18:20:27 +02:00
this . layout = CustomizationOptions . checkForObsoleteVersion ( layout . layoutOptions , this . communityId ) ;
2021-04-08 12:58:48 +02:00
} else {
this . layout = new CustomizationOptions ( CustomizationOptions . getIdentity ( communityId ) . mainColor , CustomizationOptions . getIdentity ( communityId ) . secondaryColor ) ;
}
} ,
error = > {
this . layout = new CustomizationOptions ( CustomizationOptions . getIdentity ( communityId ) . mainColor , CustomizationOptions . getIdentity ( communityId ) . secondaryColor ) ;
}
) ;
2021-04-16 18:20:27 +02:00
} else {
this . layout = new CustomizationOptions ( CustomizationOptions . getIdentity ( communityId ) . mainColor , CustomizationOptions . getIdentity ( communityId ) . secondaryColor ) ;
2021-04-08 12:58:48 +02:00
}
}
2019-08-28 14:54:35 +02:00
public buildMenu ( communityId : string ) {
2021-04-01 16:25:15 +02:00
if ( communityId ) {
2021-02-19 18:52:12 +01:00
if ( ! this . community || this . community . communityId !== communityId ) {
2021-02-19 19:09:52 +01:00
this . subscriptions . push ( this . _communityService . getCommunity ( communityId ) . subscribe ( community = > {
2021-03-29 16:05:20 +02:00
if ( community && ! this . isPrivate ( community ) ) {
2019-08-28 14:54:35 +02:00
this . community = {
id : community.communityId ,
name : ( community . shortTitle ) ? community.shortTitle : community.title ,
2021-04-01 16:25:15 +02:00
logoUrl : ( community . isUpload ) ? ( properties . utilsService + '/download/' + community . logoUrl ) : ( StringUtils . urlPrefix ( community . logoUrl ) + community . logoUrl ) ,
description : community.description
2019-08-28 14:54:35 +02:00
} ;
2020-10-14 12:14:09 +02:00
this . header = {
2020-12-01 12:17:53 +01:00
// url: 'https://' + (this.properties.environment == 'beta' ? 'beta.' : '') + this.community.id + '.openaire.eu',
route : "/" ,
2020-10-14 12:14:09 +02:00
title : this.community.name ,
logoUrl : this.community.logoUrl ,
logoSmallUrl : this.community.logoUrl ,
position : 'left' ,
badge : true
} ;
2019-08-28 14:54:35 +02:00
this . menuItems = [ ] ;
this . menuItems . push ( {
2021-03-29 16:05:20 +02:00
rootItem : new MenuItem ( "deposit" , "Deposit" , "" , "/participate/deposit/learn-how" , false , [ ] , [ "/participate/deposit/learn-how" ] , { } ) ,
2019-11-08 12:04:10 +01:00
items : [ ]
2019-08-28 14:54:35 +02:00
} ) ;
this . menuItems . push (
{
2021-03-29 16:05:20 +02:00
rootItem : new MenuItem ( "link" , "Link" , "" , "/participate/claim" , false , [ ] , [ "/participate/claim" ] , { } ) ,
2019-08-28 14:54:35 +02:00
items : [
2021-03-29 16:05:20 +02:00
new MenuItem ( "" , "Start linking" , "" , "/participate/claim" , false , [ ] , [ "/participate/claim" ] , { } ) ,
2020-05-07 12:29:52 +02:00
new MenuItem ( "" , "Learn more" , this . properties . claimsInformationLink , "" , false , [ ] , [ ] , { } )
]
} ) ;
this . menuItems . push (
{
2021-03-29 16:05:20 +02:00
rootItem : new MenuItem ( "search" , "Search" , "" , "/search/find" , false , [ ] , [ "/search/find" , "/search/find/publications" , "/search/find/datasets" , "/search/find/software" , "/search/find/other" , "/search/find/projects" , "/search/find/dataproviders" ] , { } ) ,
2020-05-07 12:29:52 +02:00
items : [
2021-03-29 16:05:20 +02:00
new MenuItem ( "" , "Research outcomes" , "" , "/search/find/research-outcomes" , false , [ ] , [ "/search/find/research-outcomes" ] , { } ) ,
new MenuItem ( "" , "Projects" , "" , "/search/find/projects/" , false , [ "project" ] , [ "/search/find/projects" ] , { } ) ,
new MenuItem ( "" , "Content Providers" , "" , "/search/find/dataproviders" , false , [ "datasource" ] , [ "/search/find/dataproviders" ] , { } ) ,
2019-08-28 14:54:35 +02:00
]
} ) ;
2020-04-10 12:04:09 +02:00
this . menuItems . push (
{
rootItem : new MenuItem ( "about" , "About" , "" , "" , false , [ ] , [ ] , { } ) ,
items : [
2021-03-29 16:05:20 +02:00
new MenuItem ( "" , "Supporting organizations" , "" , "/organizations" , false , [ ] , [ "/organizations" ] , { } ) ,
new MenuItem ( "" , "Curators" , "" , "/curators" , false , [ ] , [ "/curators" ] , { } ) ,
new MenuItem ( "" , "Sources and methodology" , "" , "/content" , false , [ ] , [ "/content" ] , { } ) ,
new MenuItem ( "" , "National Bulletins" , "" , "/national-bulletins" , false , [ ] , [ "/national-bulletins" ] , { } ) ,
new MenuItem ( "" , "Subjects" , "" , "/subjects" , false , [ ] , [ "/subjects" ] , { } ) ,
new MenuItem ( "" , "Projects and funding Opportunities" , "" , "/projects" , false , [ ] , [ "/projects" ] , { } ) ,
2020-04-10 12:04:09 +02:00
]
} ) ;
2021-02-19 18:52:12 +01:00
if ( this . isManager ) {
2019-08-28 14:54:35 +02:00
this . menuItems . push (
{
2021-04-01 16:25:15 +02:00
rootItem : new MenuItem ( "manage" , "Manage" , this . properties . adminPortalURL + '/' + community . communityId , "" , false , [ ] , [ ] , { } ) ,
2019-08-28 14:54:35 +02:00
items : [ ]
} ) ;
}
2021-02-19 18:52:12 +01:00
this . bottomMenuItems = [
2021-03-29 16:05:20 +02:00
new MenuItem ( "" , "Supporting organizations" , "" , "/organizations" , false , [ ] , [ "/organizations" ] , { } )
2019-12-03 11:03:58 +01:00
] ;
2021-02-19 18:52:12 +01:00
if ( this . properties . showContent ) {
this . bottomMenuItems . push ( new MenuItem ( "" , "Sources and methodology" , "" , "/content" , false , [ ] , [ ] , { } ) ) ;
}
2021-04-01 16:25:15 +02:00
if ( this . user ) {
2021-02-19 18:52:12 +01:00
this . userMenuItems = [ /*new MenuItem("","My profile","","",false,[],[],{}),*/
2021-04-16 11:14:07 +02:00
new MenuItem ( "" , "My ORCID links" , "" , "/my-orcid-links" , false , [ ] , [ ] , { } ) ,
2021-03-29 16:05:20 +02:00
new MenuItem ( "" , "My links" , "" , "/myclaims" , false , [ ] , [ "/myclaims" ] , { } ) ,
new MenuItem ( "" , "Invite users" , "" , "/invite" , false , [ ] , [ ] , { } ) ,
2021-02-19 18:52:12 +01:00
] ;
if ( this . isManager ) {
this . userMenuItems . push ( new MenuItem ( "" , "Support" , "https://openaire-connect.d4science.org/group/openaire-connect-gateway/explore?siteId=172366611" , "" , false , [ ] , [ ] , { } ) )
}
2019-12-03 11:03:58 +01:00
}
2021-02-19 18:52:12 +01:00
this . showMenu = true ;
} else {
2021-04-01 16:25:15 +02:00
this . showPrivateOrNoCommunity ( community ? community.status : null ) ;
2019-08-28 14:54:35 +02:00
}
2021-02-19 18:52:12 +01:00
} ) ) ;
} else {
2019-08-28 14:54:35 +02:00
this . showMenu = true ;
2021-02-19 18:52:12 +01:00
}
} else {
2021-04-01 16:25:15 +02:00
this . buildConnectMenu ( ) ;
2021-03-29 16:05:20 +02:00
}
}
2021-04-01 16:25:15 +02:00
isPrivate ( community ) {
return community && ( community . status == "hidden" || ( community . status == "manager" && ! ( Session . isCommunityCurator ( this . user ) || Session . isManager ( "community" , community . communityId , this . user ) ) ) )
2021-03-29 16:05:20 +02:00
}
2021-04-01 16:25:15 +02:00
showPrivateOrNoCommunity ( restrictedData : string ) {
2021-03-29 16:05:20 +02:00
this . communityId = null ;
this . community = null ;
this . properties . adminToolsPortalType = "connect" ;
2021-04-01 16:25:15 +02:00
this . configurationService . initCommunityInformation ( this . properties , "connect" ) ;
2021-03-29 16:05:20 +02:00
this . initAdminToolCommunity ( null ) ;
this . buildConnectMenu ( true ) ;
2021-04-01 16:25:15 +02:00
if ( restrictedData == "manager" ) {
2021-04-08 12:58:48 +02:00
if ( ! this . user && typeof location !== 'undefined' ) {
2021-03-29 16:05:20 +02:00
this . router . navigate ( [ '/user-info' ] , {
queryParams : {
"errorCode" : LoginErrorCodes . NOT_LOGIN ,
2021-04-02 11:18:44 +02:00
"redirectUrl" : location . pathname + location . search + location . hash
2021-03-29 16:05:20 +02:00
}
} ) ;
2021-04-01 16:25:15 +02:00
} else {
this . router . navigate ( [ '/error' ] , { queryParams : { 'page' : - 1 } } ) ;
2021-02-19 18:52:12 +01:00
}
2021-04-01 16:25:15 +02:00
} else {
2021-03-29 16:05:20 +02:00
this . router . navigate ( [ '/error' ] , restrictedData ? { queryParams : { 'page' : - 1 } } : { } ) ;
2021-02-19 18:52:12 +01:00
}
}
2021-04-01 16:25:15 +02:00
buildConnectMenu ( restrictedData : boolean = false ) {
let url = "https://" + ( properties . environment != "production" ? "beta." : "" ) + "connect.openaire.eu" ;
2021-03-29 16:05:20 +02:00
this . header = {
route : restrictedData ? "" : "/" ,
2021-04-01 16:25:15 +02:00
url : restrictedData ? url : "" ,
2021-03-29 16:05:20 +02:00
title : 'connect' ,
logoUrl : this.logoPath + 'logo-large-connect.png' ,
2021-04-01 16:25:15 +02:00
logoSmallUrl : this.logoPath + 'logo-small-connect.png' ,
position : 'left' ,
badge : true
2021-03-29 16:05:20 +02:00
} ;
this . menuItems = [ ] ;
this . menuItems . push ( {
2021-04-01 16:25:15 +02:00
rootItem : new MenuItem ( "about" , "About" , restrictedData ? url + "/about/learn-how" : "" , restrictedData ? "" : "/about/learn-how" , false , [ ] , [ "/about/learn-how" ] , { } ) ,
2021-03-29 16:05:20 +02:00
items : [
new MenuItem ( "" , "Learn the process" , restrictedData ? url + "/about/learn-how" : "" , restrictedData ? "" : "/about/learn-how" , false , [ ] , [ "/about/learn-in-depth" ] , { } ) ,
2021-04-01 16:25:15 +02:00
new MenuItem ( "" , "Publications" , restrictedData ? url + "/publications" : "" , restrictedData ? "" : "/publications" , false , [ ] , [ "/publications" ] , { } ) ,
2021-03-29 16:05:20 +02:00
new MenuItem ( "" , "Roadmap" , "https://trello.com/b/yfzUz0kp/openaire-connect-dashboard" , "" , false , [ ] , [ ] , { } ) ,
new MenuItem ( "" , "FAQs" , restrictedData ? url + "/about/faq" : "" , restrictedData ? "" : "/about/faq" , false , [ ] , [ "/about/faq" ] , { } )
]
2021-04-01 16:25:15 +02:00
2021-03-29 16:05:20 +02:00
} ) ;
this . menuItems . push ( {
rootItem : new MenuItem ( "communities" , "Communities" , restrictedData ? url + "/about/faq" : "" , restrictedData ? "" : "/search/find/communities" , false , [ ] , [ '/search/find/communities' ] , { } ) ,
items : [ ]
} ) ;
this . menuItems . push ( {
rootItem : new MenuItem ( "contact-us" , "Contact us" , restrictedData ? url + "/contact-us" : "" , restrictedData ? "" : "/contact-us" , false , [ ] , [ '/contact-us' ] , { } ) ,
items : [ ]
} ) ;
this . bottomMenuItems = [
new MenuItem ( "" , "About" , "https://openaire.eu/project-factsheets" , "" , false , [ ] , [ ] , { } ) ,
new MenuItem ( "" , "News - Events" , "https://openaire.eu/news-events" , "" , false , [ ] , [ ] , { } ) ,
new MenuItem ( "" , "Blog" , "https://blogs.openaire.eu/" , "" , false , [ ] , [ ] , { } ) ,
2021-04-01 16:25:15 +02:00
new MenuItem ( "" , "Contact us" , restrictedData ? url + "/contact-us" : "" , restrictedData ? "" : "/contact-us" , false , [ ] , [ ] , { } )
2021-03-29 16:05:20 +02:00
] ;
this . userMenuItems = [ ] ;
if ( Session . isPortalAdministrator ( this . user ) ) {
this . userMenuItems . push ( new MenuItem ( "" , "Manage Helptexts" ,
2021-04-21 13:07:32 +02:00
properties . adminPortalURL + "/connect/admin-tools/pages" , "" , false , [ ] , [ ] , { } ) )
2021-03-29 16:05:20 +02:00
}
if ( this . user ) {
this . userMenuItems . push ( new MenuItem ( "my-communities" , "My Communities" , restrictedData ? url + "/myCommunities" : "" ,
restrictedData ? "" : "/myCommunities" , false , [ ] , [ ] , { } ) ) ;
}
this . showMenu = true ;
2019-08-28 14:54:35 +02:00
}
2018-01-26 16:00:07 +01:00
}