2021-05-19 13:40:29 +02:00
import { ChangeDetectorRef , Component , HostListener , OnInit } from '@angular/core' ;
2022-09-21 09:29:11 +02:00
import { MenuItem } from './openaireLibrary/sharedComponents/menu' ;
2021-07-14 14:04:42 +02:00
import { ActivatedRoute , Data , NavigationEnd , Params , Router } from '@angular/router' ;
2019-04-22 12:43:22 +02:00
import { EnvProperties } from './openaireLibrary/utils/properties/env-properties' ;
2019-09-13 11:39:18 +02:00
import { Session , User } from './openaireLibrary/login/utils/helper.class' ;
import { UserManagementService } from './openaireLibrary/services/user-management.service' ;
2020-10-14 11:54:49 +02:00
import { Header } from './openaireLibrary/sharedComponents/navigationBar.component' ;
2021-05-19 13:40:29 +02:00
import { LayoutService } from "./openaireLibrary/dashboard/sharedComponents/sidebar/layout.service" ;
import { properties } from "../environments/environment" ;
import { BehaviorSubject , Subscriber } from "rxjs" ;
import { CommunityInfo } from "./openaireLibrary/connect/community/communityInfo" ;
import { CommunityService } from "./openaireLibrary/connect/community/community.service" ;
import { SmoothScroll } from "./openaireLibrary/utils/smooth-scroll" ;
2021-07-14 14:04:42 +02:00
import { ConnectHelper } from './openaireLibrary/connect/connectHelper' ;
import { ConfigurationService } from './openaireLibrary/utils/configuration/configuration.service' ;
2021-11-12 13:22:44 +01:00
import { StringUtils } from "./openaireLibrary/utils/string-utils.class" ;
2022-07-01 10:27:47 +02:00
import { OpenaireEntities } from "./openaireLibrary/utils/properties/searchFields" ;
2022-07-04 20:45:20 +02:00
import { mining } from "./openaireLibrary/utils/icons/icons" ;
2018-10-30 16:31:16 +01:00
@Component ( {
2021-05-19 13:40:29 +02:00
selector : 'app-root' ,
2018-10-30 16:31:16 +01:00
templateUrl : './app.component.html' ,
} )
2019-09-13 11:39:18 +02:00
export class AppComponent implements OnInit {
2021-05-19 13:40:29 +02:00
title = 'Research Community Dashboard | Administrator' ;
properties : EnvProperties = properties ;
2019-09-13 11:39:18 +02:00
user : User ;
2021-05-19 13:40:29 +02:00
params : BehaviorSubject < Params > = new BehaviorSubject < Params > ( null ) ;
2021-07-14 14:04:42 +02:00
data : BehaviorSubject < Data > = new BehaviorSubject < Data > ( null ) ;
2021-05-19 13:40:29 +02:00
hasSidebar : boolean = false ;
2023-11-03 15:53:39 +01:00
hasInternalSidebar : boolean = false ;
2022-07-02 13:45:34 +02:00
hasHeader : boolean = true ;
2021-05-19 13:40:29 +02:00
hasAdminMenu : boolean = false ;
isFrontPage : boolean = false ;
sideBarItems : MenuItem [ ] = [ ] ;
2023-03-01 15:25:54 +01:00
backItem : MenuItem = null ;
2022-09-21 09:29:11 +02:00
menuItems : MenuItem [ ] = [ ] ;
2021-05-19 13:40:29 +02:00
menuHeader : Header = {
route : "/" ,
url : null ,
title : "Default menu header" ,
logoUrl : null ,
logoSmallUrl : null ,
position : 'center' ,
2022-08-04 17:44:55 +02:00
badge : false
2021-05-19 13:40:29 +02:00
} ;
userMenuItems : MenuItem [ ] = [ ] ;
loading : boolean = true ;
paramsResolved : boolean = false ;
innerWidth ;
public community : CommunityInfo = null ;
private subscriptions : any [ ] = [ ] ;
headerLogoUrl : string ;
headerUrl : string ;
2022-07-01 10:27:47 +02:00
2019-07-12 11:11:38 +02:00
constructor ( private route : ActivatedRoute ,
2021-05-19 13:40:29 +02:00
private communityService : CommunityService ,
private router : Router ,
private cdr : ChangeDetectorRef ,
private smoothScroll : SmoothScroll ,
private layoutService : LayoutService ,
2021-07-14 14:04:42 +02:00
private userManagementService : UserManagementService ,
private configurationService : ConfigurationService ) {
2021-05-19 13:40:29 +02:00
this . subscriptions . push ( this . router . events . subscribe ( event = > {
if ( event instanceof NavigationEnd ) {
let r = this . route ;
2021-07-14 14:04:42 +02:00
while ( r . firstChild ) {
2021-05-19 13:40:29 +02:00
r = r . firstChild ;
}
this . paramsResolved = true ;
2021-07-14 14:04:42 +02:00
this . params . next ( r . snapshot . params ) ;
this . data . next ( r . snapshot . data ) ;
2019-07-15 14:32:41 +02:00
}
2021-05-19 13:40:29 +02:00
} ) ) ;
2019-04-22 12:43:22 +02:00
}
2021-05-19 13:40:29 +02:00
2019-04-22 12:43:22 +02:00
ngOnInit() {
2021-05-19 13:40:29 +02:00
if ( typeof document !== 'undefined' && window ) {
this . innerWidth = window . innerWidth ;
}
this . subscriptions . push ( this . layoutService . hasSidebar . subscribe ( hasSidebar = > {
this . hasSidebar = hasSidebar ;
this . cdr . detectChanges ( ) ;
} ) ) ;
2023-11-03 15:53:39 +01:00
this . subscriptions . push ( this . layoutService . hasInternalSidebar . subscribe ( hasInternalSidebar = > {
this . hasInternalSidebar = hasInternalSidebar ;
this . cdr . detectChanges ( ) ;
} ) ) ;
2021-05-19 13:40:29 +02:00
this . subscriptions . push ( this . layoutService . hasHeader . subscribe ( hasHeader = > {
this . hasHeader = hasHeader ;
this . cdr . detectChanges ( ) ;
} ) ) ;
this . subscriptions . push ( this . layoutService . hasAdminMenu . subscribe ( hasAdminMenu = > {
this . hasAdminMenu = hasAdminMenu ;
this . cdr . detectChanges ( ) ;
} ) ) ;
this . subscriptions . push ( this . layoutService . isFrontPage . subscribe ( isFrontPage = > {
this . isFrontPage = isFrontPage ;
this . cdr . detectChanges ( ) ;
} ) ) ;
2022-06-23 18:48:02 +02:00
this . layoutService . setSmallScreen ( ( this . innerWidth && this . innerWidth <= 640 ) ) ;
this . layoutService . setOpen ( ! ( this . innerWidth && this . innerWidth <= 640 ) ) ;
2021-05-19 13:40:29 +02:00
this . subscriptions . push ( this . params . subscribe ( params = > {
if ( this . paramsResolved ) {
this . loading = true ;
if ( params && params [ 'community' ] ) {
if ( ! this . community || this . community . communityId !== params [ 'community' ] ) {
this . subscriptions . push ( this . communityService . getCommunity ( params [ 'community' ] ) . subscribe ( community = > {
if ( community ) {
this . community = community ;
2021-07-14 14:04:42 +02:00
this . setProperties ( community . communityId ) ;
2021-05-19 13:40:29 +02:00
this . buildMenu ( ) ;
this . loading = false ;
} else {
this . community = null ;
this . buildMenu ( ) ;
this . loading = false ;
2019-04-22 12:43:22 +02:00
}
2021-05-19 13:40:29 +02:00
} ) ) ;
} else {
this . loading = false ;
2019-04-22 12:43:22 +02:00
}
2021-05-19 13:40:29 +02:00
} else {
2022-07-04 10:53:55 +02:00
this . communityService . setCommunity ( null ) ;
this . community = null ;
this . buildMenu ( ) ;
2021-05-19 13:40:29 +02:00
this . loading = false ;
2019-04-22 12:43:22 +02:00
}
}
2021-05-19 13:40:29 +02:00
} ) ) ;
2021-07-14 14:04:42 +02:00
this . subscriptions . push ( this . data . subscribe ( data = > {
if ( data && data . portal ) {
this . setProperties ( data . portal ) ;
2023-07-14 11:12:32 +02:00
this . configurationService . initPortal ( this . properties , this . properties . adminToolsCommunity ) ;
2021-07-14 14:04:42 +02:00
}
} ) ) ;
2021-05-19 13:40:29 +02:00
this . subscriptions . push ( this . userManagementService . getUserInfo ( ) . subscribe ( user = > {
2022-09-08 15:44:46 +02:00
if ( user ) {
this . user = user ;
2021-05-19 13:40:29 +02:00
localStorage . setItem ( 'user_id' , this . user . id ) ;
localStorage . setItem ( 'mining_backend_address' , this . properties . miningBackendURL ) ;
localStorage . setItem ( 'isCommunityManager' , Session . isCommunityCurator ( this . user ) + '' ) ;
this . buildMenu ( ) ;
2022-09-08 15:44:46 +02:00
} else if ( this . user ) {
this . user = user ;
this . buildMenu ( ) ;
[Trunk | Admin]:
1. pages.component: Show link to add pageHelpContents only when at least one posiiton is enabled.
2. help-content.service:
Add 'pid' parameter in 'getDivIdsFull()' method to be able to get divIds that are enabled in a community.
Add 'with_positions' parameter in 'getPages()' method to be able to get pages that have at least one position or no positions enabled.
3. app.component: Hide '/classContents' route for communities (currently no divIds for communities).
4. div-help-content-form.component: Get divIds that are enabled for the community.
5. div-help-contents.component: When a page is pre-selected ('pageId' url param exists), check if page is enabled in the community, otherwise redirect.
6. edit-div-help-content.component & new-div-help-content.component:
Add 'getPage()' method, to get page (if disabled in community, redirect - if pageId is pre-selected) and show it in the page title.
7. edit-div-help-content.component: If there is no 'divContentId' url param, redirect
8. edit-page-help-content.component:
If there is no 'pageContentId' url param, redirect
Add 'getPage()' method, to get page (if disabled in community, redirect - if pageId is pre-selected or use pageHelpContent.page - if pageId != pageHelpContent.page, redirect) and show it in the p$
9. new-page-help-content.component: Add 'getPage()' method, to get page (if disabled in community, redirect - if pageId is pre-selected) and show it in the page title.
10. page-help-content-form.component: Do not perform a query to get page when it is pre-selected (new & edit do the query now) | Get pages with at least one posiiton enabled.
11. page-help-contents.component: When a page is pre-selected ('pageId' url param exists), check if page is enabled in the community, otherwise redirect | Get pages with at least one posiiton enabled.
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-admin-portal/trunk@56740 d315682c-612b-4755-9ff5-7f18f6832af3
2019-07-24 11:16:42 +02:00
}
2021-05-19 13:40:29 +02:00
} ) ) ;
}
@HostListener ( 'window:resize' , [ '$event' ] )
onResize ( event ) {
if ( this . layoutService . isSmallScreen && event . target . innerWidth > 1219 ) {
this . layoutService . setSmallScreen ( false ) ;
} else if ( ! this . layoutService . isSmallScreen && event . target . innerWidth < 1219 ) {
this . layoutService . setSmallScreen ( true ) ;
this . layoutService . setOpen ( false ) ;
}
}
public ngOnDestroy() {
this . subscriptions . forEach ( value = > {
if ( value instanceof Subscriber ) {
value . unsubscribe ( ) ;
2019-04-22 12:43:22 +02:00
}
2021-05-19 13:40:29 +02:00
} ) ;
this . communityService . clearSubscriptions ( ) ;
this . userManagementService . clearSubscriptions ( ) ;
this . layoutService . clearSubscriptions ( ) ;
this . smoothScroll . clearSubscriptions ( ) ;
}
2021-07-14 14:04:42 +02:00
setProperties ( id , type = null ) {
this . properties . adminToolsCommunity = id ;
if ( type ) {
this . properties . adminToolsPortalType = type ;
} else {
ConnectHelper . setPortalTypeFromPid ( id ) ;
}
2023-07-14 11:12:32 +02:00
this . configurationService . initPortal ( this . properties , this . properties . adminToolsCommunity ) ;
2021-07-14 14:04:42 +02:00
}
2021-05-19 13:40:29 +02:00
public get open() {
return this . layoutService . open ;
}
2023-03-01 15:25:54 +01:00
public get hover() {
return this . layoutService . hover ;
}
2021-05-19 13:40:29 +02:00
private buildMenu() {
this . userMenuItems = [ ] ;
this . sideBarItems = [ ] ;
if ( this . user ) {
if ( this . isCurator ( ) ) {
2022-08-05 10:47:07 +02:00
this . userMenuItems . push ( new MenuItem ( "" , "Manage communities" ,
2021-05-19 13:40:29 +02:00
"" , "/" , false , [ ] , [ ] , { } ) ) ;
}
if ( Session . isPortalAdministrator ( this . user ) ) {
this . userMenuItems . push ( new MenuItem ( "adminOptions" , "Super Admin options" , "" , "/admin-tools/portals" , false , [ ] , [ ] , { } ) ) ;
this . userMenuItems . push ( new MenuItem ( "connectOptions" , "Connect portal options" , "" , "/connect/admin-tools/pages" , false , [ ] , [ ] , { } ) ) ;
this . userMenuItems . push ( new MenuItem ( "exploreOptions" , "Explore portal options" , "" , "/openaire/admin-tools/pages" , false , [ ] , [ ] , { } ) ) ;
}
2022-07-01 10:27:47 +02:00
if ( this . community ) {
this . userMenuItems . push ( new MenuItem ( "" , "User information" , "" , "/" + this . community . communityId + "/user-info" , false , [ ] , [ ] , { } ) ) ;
} else {
this . userMenuItems . push ( new MenuItem ( "" , "User information" , "" , "/user-info" , false , [ ] , [ ] , { } ) ) ;
}
2019-04-22 12:43:22 +02:00
}
2021-05-19 13:40:29 +02:00
if ( this . community ) {
2021-11-12 13:22:44 +01:00
this . headerLogoUrl = StringUtils . getLogoUrl ( this . community ) ;
2021-05-19 13:40:29 +02:00
this . headerUrl = 'https://' + ( ( properties . environment !== 'production' ) ? 'beta.' : '' ) + this . community . communityId + '.openaire.eu' ;
this . menuHeader = {
route : "/" + this . community . communityId ,
url : null ,
2022-07-01 10:27:47 +02:00
title : this.community.shortTitle ,
logoUrl : this.headerLogoUrl ,
logoSmallUrl : this.headerLogoUrl ,
position : 'left' ,
2022-08-05 14:23:45 +02:00
badge : true
2021-05-19 13:40:29 +02:00
} ;
2023-03-01 15:25:54 +01:00
let communityInfo = new MenuItem ( "community" , "Community Info" , "" , "/" + this . community . communityId , false , [ ] , [ ] , { } , { name : 'badge' } , null , null , "/" + this . community . communityId + "/info" ) ;
communityInfo . items = [
new MenuItem ( "profile" , "Profile" , "" , "/" + this . community . communityId + "/info/profile" , false , [ ] , [ ] , { } , null , null , null , "/" + this . community . communityId + "/info/profile" ) ,
new MenuItem ( "organizations" , "Organizations" , "" , "/" + this . community . communityId + "/info/organizations" , false , [ ] , [ ] , { } , null , null , null , "/" + this . community . communityId + "/info/organizations" ) ,
new MenuItem ( "projects" , OpenaireEntities . PROJECTS , "" , "/" + this . community . communityId + "/info/projects" , false , [ ] , [ ] , { } , null , null , null , "/" + this . community . communityId + "/info/projects" ) ,
new MenuItem ( "content-providers" , OpenaireEntities . DATASOURCES , "" , "/" + this . community . communityId + "/info/content-providers" , false , [ ] , [ ] , { } , null , null , null , "/" + this . community . communityId + "/info/content-providers" ) ,
new MenuItem ( "zenodo-communities" , "Zenodo Communities " , "" , "/" + this . community . communityId + "/info/zenodo-communities" , false , [ ] , [ ] , { } , null , null , null , "/" + this . community . communityId + "/info/zenodo-communities" ) ,
2023-03-10 16:15:26 +01:00
new MenuItem ( "advanced-criteria" , "Advanced Criteria" , "" , "/" + this . community . communityId + "/info/advanced-criteria" , false , [ ] , [ ] , { } , null , null , null , "/" + this . community . communityId + "/info/advanced-criteria" )
2023-03-01 15:25:54 +01:00
]
2023-03-10 16:15:26 +01:00
if ( this . community . type === 'community' ) {
communityInfo . items . splice ( 4 , 0 , new MenuItem ( "subjects" , "Subjects" , "" , "/" + this . community . communityId + "/info/subjects" , false , [ ] , [ ] , { } , null , null , null , "/" + this . community . communityId + "/info/subjects" ) )
}
2023-03-01 15:25:54 +01:00
this . sideBarItems . push ( communityInfo ) ;
2022-07-02 13:45:34 +02:00
this . sideBarItems . push ( new MenuItem ( "users" , "Users" , "" , "/" + this . community . communityId + "/users" , false , [ ] , [ ] , { } , { name : 'group' } , null , null , "/" + this . community . communityId + "/users" ) ) ;
2022-08-05 14:23:45 +02:00
this . sideBarItems . push ( new MenuItem ( "admin-tools" , "Pages & Menus" , "" , "/" + this . community . communityId + "/admin-tools/pages" , false , [ ] , [ ] , { } , { name : 'description' } , null , null , "/" + this . community . communityId + "/admin-tools" ) ) ;
2022-07-02 13:45:34 +02:00
this . sideBarItems . push ( new MenuItem ( "customization" , "Customization" , "" , "/" + this . community . communityId + "/customize-layout" , false , [ ] , [ ] , { } , { name : 'brush' } ) ) ;
2021-05-19 13:40:29 +02:00
if ( this . community . type === 'ri' ) {
2022-07-04 20:45:20 +02:00
this . sideBarItems . push ( new MenuItem ( "mining" , "Mining" , "" , "/" + this . community . communityId + "/mining/manage-profiles" , false , [ ] , [ ] , { } , { svg : mining.data } , null , null , "/" + this . community . communityId + "/mining" ) ) ;
2021-05-19 13:40:29 +02:00
}
2023-03-01 15:25:54 +01:00
this . backItem = new MenuItem ( "back" , "Manage Communities" , "" , "/" , false , [ ] , null , { } , { name : 'west' } ) ;
2022-07-01 10:27:47 +02:00
this . menuItems = [ ] ;
2022-09-21 09:29:11 +02:00
this . menuItems . push ( new MenuItem ( "home" , "Home" ,
2022-07-01 10:27:47 +02:00
"https://" + ( properties . environment == "beta" ? "beta." : "" ) + this . community . communityId + ".openaire.eu/" , "" , false , [ ] , null , null
2022-09-21 09:29:11 +02:00
, null , null , null , null , "_self" )
) ;
2022-07-01 10:27:47 +02:00
this . menuItems . push (
2023-01-18 13:50:37 +01:00
new MenuItem ( "deposit" , "Deposit" , "https://" + ( properties . environment == "beta" ? "beta." : "" ) + this . community . communityId + ".openaire.eu/participate/deposit/learn-how" , "" , false , [ ] , [ '/participate/deposit/learn-how' ] , null , null , null , null , null , "_self" )
2022-09-21 09:29:11 +02:00
) ;
this . menuItems . push (
new MenuItem ( "link" , "Link" , "https://" + ( properties . environment == "beta" ? "beta." : "" ) + this . community . communityId + ".openaire.eu/participate/claim" , "" , false , [ ] , [ '/participate/claim' ] , null , null , null , null , null , "_self" ,
"_internal" , false ,
[
2022-07-01 10:27:47 +02:00
new MenuItem ( "" , "Start linking" , "https://" + ( properties . environment == "beta" ? "beta." : "" ) + this . community . communityId + ".openaire.eu/participate/claim" , "" , false , [ ] , [ '/participate/claim' ] , null , null , null , null , null , "_self" ) ,
new MenuItem ( "" , "Learn more" , this . properties . claimsInformationLink , "" , false , [ ] , [ ] , null ) ,
2022-09-21 09:29:11 +02:00
]
)
) ;
2022-07-01 10:27:47 +02:00
this . menuItems . push (
2022-09-21 09:29:11 +02:00
new MenuItem ( "search" , "Search" , "https://" + ( properties . environment == "beta" ? "beta." : "" ) + this . community . communityId + ".openaire.eu/search/find" , "" , false , [ ] , [ "/search/find" ] , null , null , null , null , null , "_self" ,
"internal" , false ,
[
2022-07-01 10:27:47 +02:00
new MenuItem ( "" , OpenaireEntities . RESULTS , "https://" + ( properties . environment == "beta" ? "beta." : "" ) + this . community . communityId + ".openaire.eu/search/find/research-outcomes?resultbestaccessright=\"" + encodeURIComponent ( "Open Access" ) + '"' , "" , false , [ ] , [ "/search/find/research-outcomes" ] , null , null , null , null , null , "_self" ) ,
new MenuItem ( "" , OpenaireEntities . PROJECTS , "https://" + ( properties . environment == "beta" ? "beta." : "" ) + this . community . communityId + ".openaire.eu/search/find/projects" , "" , false , [ ] , [ "/search/find/projects" ] , null , null , null , null , null , "_self" ) ,
new MenuItem ( "" , OpenaireEntities . DATASOURCES , "https://" + ( properties . environment == "beta" ? "beta." : "" ) + this . community . communityId + ".openaire.eu/search/find/dataproviders" , "" , false , [ ] , [ "/search/find/dataproviders" ] , null , null , null , null , null , "_self" )
]
2022-09-21 09:29:11 +02:00
)
) ;
2022-07-01 10:27:47 +02:00
this . menuItems . push (
2022-09-21 09:29:11 +02:00
new MenuItem ( "about" , "About" , "" , "" , false , [ ] , [ ] , { } ,
null , null , null , null , "_blank" , "internal" , false ,
[
2022-07-01 10:27:47 +02:00
new MenuItem ( "" , "Supporting organizations" , "https://" + ( properties . environment == "beta" ? "beta." : "" ) + this . community . communityId + ".openaire.eu/organizations" , "" , false , [ ] , [ "/organizations" ] , null , null , null , null , null , "_self" ) ,
new MenuItem ( "" , "Curators" , "https://" + ( properties . environment == "beta" ? "beta." : "" ) + this . community . communityId + ".openaire.eu/curators" , "" , false , [ ] , [ "/organizations" ] , null , null , null , null , null , "_self" ) ,
new MenuItem ( "" , "Sources and methodology" , "https://" + ( properties . environment == "beta" ? "beta." : "" ) + this . community . communityId + ".openaire.eu/content" , "" , false , [ ] , [ "/content" ] , null , null , null , null , null , "_self" ) ,
new MenuItem ( "" , "National Bulletins" , "https://" + ( properties . environment == "beta" ? "beta." : "" ) + this . community . communityId + ".openaire.eu/national-bulletins" , "" , false , [ ] , [ "/national-bulletins" ] , null , null , null , null , null , "_self" ) ,
new MenuItem ( "" , "Subjects" , "https://" + ( properties . environment == "beta" ? "beta." : "" ) + this . community . communityId + ".openaire.eu/subjects" , "" , false , [ ] , [ "/subjects" ] , null , null , null , null , null , "_self" ) ,
2023-05-26 13:46:53 +02:00
new MenuItem ( "" , "Projects and funding Opportunities" , "https://" + ( properties . environment == "beta" ? "beta." : "" ) + this . community . communityId + ".openaire.eu/projects" , "" , false , [ ] , [ "/projects" ] , null , null , null , null , null , "_self" ) ,
new MenuItem ( "" , "Fields of Science" , "https://" + ( properties . environment == "beta" ? "beta." : "" ) + this . community . communityId + ".openaire.eu/fields-of-science" , "" , false , [ ] , [ "/fields-of-science" ] , null , null , null , null , null , "_self" ) ,
new MenuItem ( "" , "Sustainable Development Goals" , "https://" + ( properties . environment == "beta" ? "beta." : "" ) + this . community . communityId + ".openaire.eu/sdgs" , "" , false , [ ] , [ "/sdgs" ] , null , null , null , null , null , "_self" ) ,
2022-07-01 10:27:47 +02:00
]
2022-09-21 09:29:11 +02:00
)
) ;
this . menuItems . push (
new MenuItem ( "develop" , "Develop" , "https://" + ( properties . environment == "beta" ? "beta." : "" ) + this . community . communityId + ".openaire.eu/develop" , "" , false , [ ] , [ '/develop' ] , null , null , null , null , null , "_self" ) ,
) ;
2022-07-01 10:27:47 +02:00
// if (this.isManager) {
this . menuItems . push (
2022-09-21 09:29:11 +02:00
new MenuItem ( "manage" , "Manage" ,
"" , "/" + this . community . communityId , false , [ ] , null , { } ,
null , null , null , "/" + this . community . communityId )
) ;
2022-07-01 10:27:47 +02:00
// }
2021-05-19 13:40:29 +02:00
} else {
this . headerLogoUrl = null ;
this . headerUrl = 'https://' + ( ( properties . environment !== 'production' ) ? 'beta.' : '' ) + 'connect.openaire.eu' ;
this . menuHeader = {
route : null ,
2022-08-04 17:44:55 +02:00
url : this.headerUrl ,
title : "Monitor" ,
logoUrl : 'assets/common-assets/logo-services/connect/small.svg' ,
logoSmallUrl : "assets/common-assets/logo-services/connect/small.svg" ,
position : 'left' ,
badge : true ,
menuPosition : "center"
2021-05-19 13:40:29 +02:00
} ;
2022-08-04 17:44:55 +02:00
this . menuItems = [ ] ;
2022-09-21 09:29:11 +02:00
this . menuItems . push (
new MenuItem ( "about" , "About" , this . headerUrl + "/about/learn-how" , "" , false , [ ] , [ ] , { } , null , null , null , null , "_self" ,
"internal" , false ,
[
new MenuItem ( "" , "Learn the process" , this . headerUrl + "/about/learn-how" , "" , false , [ ] , [ ] , { } , null , null , null , null , "_self" ) ,
new MenuItem ( "" , "Publications" , this . headerUrl + "/publications" , "" , false , [ ] , [ ] , { } , null , null , null , null , "_self" ) ,
new MenuItem ( "" , "Roadmap" , "https://trello.com/b/yfzUz0kp/openaire-connect-dashboard" , "" , false , [ ] , [ ] , { } ) ,
new MenuItem ( "" , "FAQs" , this . headerUrl + "/about/faq" , "" , false , [ ] , [ ] , { } , null , null , null , null , "_self" )
]
)
) ;
this . menuItems . push (
new MenuItem ( "communities" , "Communities" , this . headerUrl + "/search/find/communities" , "" , false , [ ] , [ ] , { } , null , null , null , null , "_self" )
) ;
2022-07-02 13:45:34 +02:00
if ( this . isCurator ( ) ) {
2022-08-05 10:47:07 +02:00
this . sideBarItems . push ( new MenuItem ( "communities" , "Manage communities" , "" , "/" , false , [ ] , [ ] , { } , { name : 'settings' } ) ) ;
2022-07-02 13:45:34 +02:00
}
2022-06-23 18:48:02 +02:00
if ( Session . isPortalAdministrator ( this . user ) ) {
2022-06-26 22:33:02 +02:00
this . sideBarItems . push ( new MenuItem ( "super_admin" , "Super Admin Options" , "" , "/admin-tools/portals" , false , [ ] , [ ] , { } , { name : 'settings' } , null , null , '/admin-tools' ) ) ;
this . sideBarItems . push ( new MenuItem ( "connect" , "Connect Options" , "" , "/connect/admin-tools/pages" , false , [ ] , [ ] , { } , { name : 'settings' } , null , null , '/connect/admin-tools' ) ) ;
this . sideBarItems . push ( new MenuItem ( "explore" , "Explore Options" , "" , "/openaire/admin-tools/pages" , false , [ ] , [ ] , { } , { name : 'settings' } , null , null , '/openaire/admin-tools' ) ) ;
2022-06-23 18:48:02 +02:00
}
2023-03-01 15:25:54 +01:00
this . backItem = null ;
2019-04-22 12:43:22 +02:00
}
2022-08-04 17:44:55 +02:00
this . hasSidebar = this . hasSidebar && this . sideBarItems . length > 1 ;
2018-10-30 16:31:16 +01:00
}
2021-05-19 13:40:29 +02:00
private isCurator() {
return this . user && ( Session . isPortalAdministrator ( this . user ) || Session . isCommunityCurator ( this . user ) || Session . isKindOfCommunityManager ( this . user ) ) ;
}
2018-10-30 16:31:16 +01:00
}