5 |
5 |
import { EnvProperties} from './openaireLibrary/utils/properties/env-properties';
|
6 |
6 |
import{MenuItem, RootMenuItem} from './openaireLibrary/sharedComponents/menu';
|
7 |
7 |
import { EnvironmentSpecificService} from './openaireLibrary/utils/properties/environment-specific.service';
|
8 |
|
import {CommunityService} from "./openaireLibrary/connect/community/community.service";
|
|
8 |
import {CommunitiesService} from "./openaireLibrary/connect/communities/communities.service";
|
|
9 |
import {Session} from './openaireLibrary/login/utils/helper.class';
|
9 |
10 |
|
10 |
11 |
|
11 |
12 |
@Component({
|
... | ... | |
17 |
18 |
template: `
|
18 |
19 |
|
19 |
20 |
<navbar *ngIf= "properties" portal="connect" onlyTop=false [(communityId)]="properties.adminToolsCommunity" [userMenuItems]=userMenuItems [menuItems]=menuItems
|
20 |
|
[(APIUrl)]="properties.adminToolsAPIURL" [(logInUrl)]="properties.loginUrl" [(logOutUrl)]="properties.logoutUrl" [(cookieDomain)]="properties.cookieDomain" [(community)]=community></navbar>
|
|
21 |
[(APIUrl)]="properties.adminToolsAPIURL" [(logInUrl)]="properties.loginUrl" [(logOutUrl)]="properties.logoutUrl" [(cookieDomain)]="properties.cookieDomain" [(community)]=community [showMenu]=showMenu>2</navbar>
|
|
22 |
|
21 |
23 |
<div class="custom-main-content" >
|
22 |
24 |
<main>
|
23 |
25 |
<router-outlet></router-outlet>
|
24 |
26 |
</main>
|
25 |
27 |
</div>
|
26 |
|
<feedback *ngIf= "isClient" portalName="Connect" [feedbackmail]=feedbackmail></feedback>
|
|
28 |
<feedback *ngIf= "isClient && properties" portalName="Connect" [feedbackmail]=properties.feedbackmail></feedback>
|
27 |
29 |
<cookie-law *ngIf= "isClient" position="bottom">
|
28 |
30 |
OpenAIRE uses cookies in order to function properly.<br>
|
29 |
31 |
Cookies are small pieces of data that websites store in your browser to allow us to give you the best browsing experience possible.
|
... | ... | |
45 |
47 |
|
46 |
48 |
menuItems:RootMenuItem []=[];
|
47 |
49 |
public community = null;
|
48 |
|
feedbackmail:string
|
49 |
|
properties:EnvProperties;
|
|
50 |
properties:EnvProperties;
|
|
51 |
showMenu:boolean = false;
|
50 |
52 |
// community: {id:string, name:string, logoUrl:string};
|
51 |
|
constructor( private route: ActivatedRoute, private propertiesService:EnvironmentSpecificService, private _communityService:CommunityService ) {
|
|
53 |
constructor( private route: ActivatedRoute, private propertiesService:EnvironmentSpecificService, private _communitiesService:CommunitiesService ) {
|
52 |
54 |
}
|
53 |
55 |
|
54 |
56 |
ngOnInit() {
|
... | ... | |
56 |
58 |
.then(es => {
|
57 |
59 |
this.propertiesService.setEnvProperties(es);
|
58 |
60 |
this.properties = this.propertiesService.envSpecific;
|
59 |
|
this.feedbackmail = this.properties.feedbackmail;
|
60 |
61 |
|
61 |
62 |
this.route.queryParams.subscribe(data => {
|
|
63 |
var community = null;
|
|
64 |
this.showMenu = false;
|
|
65 |
this._communitiesService.getCommunities(this.properties.communityAPI+"communities").subscribe (
|
|
66 |
communities => {
|
|
67 |
// this.community = community;
|
62 |
68 |
|
63 |
|
if((data['communityId'] && data['communityId']!="") || (data['community'] && data['community']!="") ){
|
64 |
|
this.menuItems=[];
|
65 |
|
this._communityService.getCommunity(this.properties.communityAPI+((data['communityId'])?data['communityId']:data['community'])).subscribe (
|
66 |
|
community => {
|
67 |
|
// this.community = community;
|
68 |
|
this.community = {id: community.communityId, name: (community.shortTitle)?community.shortTitle:community.title, logoUrl:community.logoUrl};
|
|
69 |
this.userMenuItems =[ new MenuItem("","My profile","","",false,[],[],{}),
|
|
70 |
new MenuItem("","My claims","","/myclaims",false,[],["/myclaims"],{}),
|
|
71 |
];
|
|
72 |
for(var com of communities){
|
|
73 |
for(var manager of com.managers){
|
|
74 |
if(manager== Session.getUserEmail()){
|
|
75 |
this.userMenuItems.push(new MenuItem("","Manage "+((com.shortTitle)?com.shortTitle:com.title),"https://admin.demo.openaire.eu?communityId="+com.communityId,"",false,[],[],{}));
|
|
76 |
}
|
|
77 |
}
|
|
78 |
if((data['communityId'] && data['communityId']!="" && com.communityId ==data['communityId']) || (data['community'] && data['community']!="" && com.communityId ==data['communityId'])){
|
|
79 |
community = com;
|
|
80 |
this.community = {id: community.communityId, name: (community.shortTitle)?community.shortTitle:community.title, logoUrl:community.logoUrl};
|
|
81 |
this.menuItems= [
|
|
82 |
{rootItem: new MenuItem("home","Home","","/",false,[],[],{}),
|
|
83 |
items: []},
|
|
84 |
{rootItem: new MenuItem("dashboard","Dashboard","","/community",false,[],[],{communityId:community.communityId}),
|
|
85 |
items: []
|
|
86 |
},
|
|
87 |
{rootItem: new MenuItem("search","Search","","",false,[],[],{}),
|
|
88 |
items: [new MenuItem("","Publications","","/search/find/publications",false,["publication"],["/search/find/publications"],{community: encodeURIComponent('"'+community.queryId+'"'), communityId: community.communityId}),
|
|
89 |
new MenuItem("","Research Data","","/search/find/datasets",false,["dataset"],["/search/find/datasets"],{community: encodeURIComponent('"'+community.queryId+'"'), communityId: community.communityId}),
|
|
90 |
new MenuItem("","Software","","/search/find/software",false,["software"],["/search/find/software"],{community: encodeURIComponent('"'+community.queryId+'"'), communityId: community.communityId}),
|
|
91 |
new MenuItem("","Projects","","/search/find/projects/",false,["project"],["/search/find/projects"],{communityId: community.communityId}),
|
|
92 |
new MenuItem("","Content Providers","","/search/find/dataproviders",false,["datasource"],["/search/find/dataproviders"],{communityId: community.communityId}),
|
|
93 |
// new MenuItem("","Organizations","","/search/find/organizations/",false,["organization"],["/search/find/organizations"],{community: community.communityId}),
|
|
94 |
]},
|
|
95 |
{
|
|
96 |
rootItem: new MenuItem("monitor","Monitor","","/statistics",false,[],["/statistics"],{communityId:community.communityId}),
|
|
97 |
items: []
|
|
98 |
},
|
|
99 |
{
|
|
100 |
rootItem: new MenuItem("share","Share","","",false,[],["/participate/deposit-publications","/participate/deposit-datasets"],{communityId:community.communityId}),
|
|
101 |
items: [new MenuItem("","Publications","","/participate/deposit-publications",false,["publication"],["/participate/deposit-publications"],{communityId:community.communityId}),
|
|
102 |
new MenuItem("","Research Data","","/participate/deposit-datasets",false,["dataset"],["/participate/deposit-datasets"],{communityId:community.communityId})]
|
|
103 |
},
|
|
104 |
{
|
|
105 |
rootItem: new MenuItem("link","Link","","/participate/claim",false,[],["/participate/claim"],{communityId:community.communityId}),
|
|
106 |
items: []
|
|
107 |
}
|
|
108 |
];
|
|
109 |
this.showMenu = true;
|
|
110 |
}
|
69 |
111 |
|
70 |
|
this.userMenuItems = [ new MenuItem("","My profile","","",false,[],[],{}),
|
71 |
|
new MenuItem("","My claims","","/myclaims",false,[],["/myclaims"],{}),
|
72 |
|
new MenuItem("","Manage all claims","","/claims",true,[],["/claims"],{}),]
|
|
112 |
}
|
|
113 |
if(!((data['communityId'] && data['communityId']!="") || (data['community'] && data['community']!="") )){
|
73 |
114 |
|
74 |
|
this.menuItems= [{
|
75 |
|
rootItem: new MenuItem("dashboard","Dashboard","","/community",false,[],[],{communityId:community.communityId}),
|
76 |
|
items: []
|
77 |
|
},
|
78 |
|
{rootItem: new MenuItem("search","Search","","",false,[],[],{}),
|
79 |
|
items: [new MenuItem("","Publications","","/search/find/publications",false,["publication"],["/search/find/publications"],{community: encodeURIComponent('"'+community.queryId+'"'), communityId: community.communityId}),
|
80 |
|
new MenuItem("","Research Data","","/search/find/datasets",false,["dataset"],["/search/find/datasets"],{community: encodeURIComponent('"'+community.queryId+'"'), communityId: community.communityId}),
|
81 |
|
new MenuItem("","Software","","/search/find/software",false,["software"],["/search/find/software"],{community: encodeURIComponent('"'+community.queryId+'"'), communityId: community.communityId}),
|
82 |
|
new MenuItem("","Projects","","/search/find/projects/",false,["project"],["/search/find/projects"],{communityId: community.communityId}),
|
83 |
|
// new MenuItem("","Content Providers","","/search/find/dataproviders",false,["datasource"],["/search/find/dataproviders"],{community: "%22egi%7C%7CEGI%20Federation%22"}),
|
84 |
|
// new MenuItem("","Organizations","","/search/find/organizations/",false,["organization"],["/search/find/organizations"],{community: "%22egi%7C%7CEGI%20Federation%22"}),
|
85 |
|
]},
|
86 |
|
{
|
87 |
|
rootItem: new MenuItem("monitor","Monitor","","/statistics",false,[],["/statistics"],{communityId:community.communityId}),
|
88 |
|
items: []
|
89 |
|
},
|
90 |
|
{
|
91 |
|
rootItem: new MenuItem("share","Share","","",false,[],["/participate/deposit-publications","/participate/deposit-datasets"],{communityId:community.communityId}),
|
92 |
|
items: [new MenuItem("","Publications","","/participate/deposit-publications",false,["publication"],["/participate/deposit-publications"],{communityId:community.communityId}),
|
93 |
|
new MenuItem("","Research Data","","/participate/deposit-datasets",false,["dataset"],["/participate/deposit-datasets"],{communityId:community.communityId})]
|
94 |
|
},
|
95 |
|
{
|
96 |
|
rootItem: new MenuItem("link","Link","","/participate/claim",false,[],["/participate/claim"],{communityId:community.communityId}),
|
97 |
|
items: []
|
98 |
|
}
|
99 |
|
];
|
100 |
|
});
|
|
115 |
this.community = null;
|
101 |
116 |
|
102 |
|
}else{
|
103 |
|
this.community = null;
|
104 |
|
this.userMenuItems = [ new MenuItem("","My profile","","",false,[],[],{}),
|
105 |
|
new MenuItem("","My claims","","/myclaims",false,[],["/myclaims"],{}),
|
106 |
|
new MenuItem("","Manage all claims","","/claims",true,[],["/claims"],{}),];
|
107 |
|
this.menuItems= [
|
108 |
|
{
|
109 |
|
rootItem: new MenuItem("communities","Communities","","/",false,[],[],{}),
|
110 |
|
items: []
|
111 |
|
}
|
112 |
|
];
|
113 |
|
}
|
|
117 |
this.menuItems= [
|
|
118 |
{rootItem: new MenuItem("communities","Communities","","/",false,[],[],{}),
|
|
119 |
items: []
|
|
120 |
}
|
|
121 |
];
|
|
122 |
this.showMenu = true;
|
|
123 |
}
|
114 |
124 |
|
|
125 |
});
|
|
126 |
|
|
127 |
|
115 |
128 |
});
|
116 |
129 |
if (typeof document !== 'undefined') {
|
117 |
130 |
try{
|
fixing urls in properties json| add manage links in user menu