diff --git a/src/app/app.component.ts b/src/app/app.component.ts index e06b4a4..6390fc9 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -54,12 +54,14 @@ export class AppComponent { this.isPortalAdministrator = Session.isPortalAdministrator(); /*this.isPortalAdministrator = true;*/ } + this._communitiesService.updateCommunities(this.properties, this.properties.communityAPI + "communities"); + this.route.queryParams.subscribe(data => { this.communityId = ((data['communityId']) ? data['communityId'] : ""); this.communityType = null; this.menuItems = []; this.userMenuItems = []; - this._communitiesService.getCommunities(this.properties, this.properties.communityAPI + "communities").subscribe( + this._communitiesService.getCommunitiesState().subscribe( communities => { // this.community = community; this.userMenuItems = []; diff --git a/src/app/pages/wellcome/wellcome.component.ts b/src/app/pages/wellcome/wellcome.component.ts index f5e6644..cbad3cb 100644 --- a/src/app/pages/wellcome/wellcome.component.ts +++ b/src/app/pages/wellcome/wellcome.component.ts @@ -1,36 +1,154 @@ -import { Component, Input } from '@angular/core'; +import {Component, Input, OnInit} from '@angular/core'; import { Location } from '@angular/common'; +import {Session} from "../../openaireLibrary/login/utils/helper.class"; +import {MenuItem} from "../../openaireLibrary/sharedComponents/menu"; +import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties"; +import {ActivatedRoute} from "@angular/router"; +import {EnvironmentSpecificService} from "../../openaireLibrary/utils/properties/environment-specific.service"; +import {CommunitiesService} from "../../openaireLibrary/connect/communities/communities.service"; +import {CommunityInfo} from "../../openaireLibrary/connect/community/communityInfo"; @Component({ selector: 'wellcome', template: ` -
-
-
-
-
-
-
+ + + + -
-

- Research Community
Administration Dashboard -

-

- Are you a community manager?
Configure your Research Community Dashboard -

-
+
+
+
+ + + + + + + + +
+ + -
+ + + + + + + + + + +

Embrace Open Science with OpenAIRE Connect

+
A platform to manage your community profile and to share, access and link community research results
+ +
+
+
+
Create and manage your research community page
+ +
+
+
+
+ + +
-
+ ` }) -export class WellcomeComponent { +export class WellcomeComponent implements OnInit { + properties: EnvProperties = null; + public communities: CommunityInfo[] = []; + constructor( private route: ActivatedRoute, private propertiesService: EnvironmentSpecificService, private _communitiesService: CommunitiesService) {} + + ngOnInit() { + this.propertiesService.loadEnvironment().then(es => { + this.propertiesService.setEnvProperties(es); + this.properties = this.propertiesService.envSpecific; + + //this._communitiesService.getCommunities(this.properties, this.properties.communityAPI + 'communities').subscribe( + this._communitiesService.getCommunitiesState().subscribe( + communities => { + var countCommunities = 0; + var index_managerOfCommunity = null; + for (var i = 0; i < communities.length; i++) { + var com = communities[i]; + if (Session.isPortalAdministrator() || Session.isCommunityCurator()) { + this.communities.push(communities[i]); + } else { + for (var manager of com.managers) { + if (manager == Session.getUserEmail()) { + countCommunities++; + index_managerOfCommunity = i; + this.communities.push(communities[i]); + break; + } + } + } + } + }); + }); + } } diff --git a/src/app/pages/wellcome/wellcome.module.ts b/src/app/pages/wellcome/wellcome.module.ts index 3a30296..a545955 100644 --- a/src/app/pages/wellcome/wellcome.module.ts +++ b/src/app/pages/wellcome/wellcome.module.ts @@ -2,12 +2,17 @@ import { NgModule } from '@angular/core'; import {WellcomeComponent} from './wellcome.component'; import {WellcomeRoutingModule} from './wellcome-routing.module'; import {RouterModule} from '@angular/router'; +import {CommunitiesService} from '../../openaireLibrary/connect/communities/communities.service'; +//import { EnvironmentSpecificResolver} from '../../openaireLibrary/utils/properties/environmentSpecificResolver'; +import { EnvironmentSpecificService} from '../../openaireLibrary/utils/properties/environment-specific.service'; +import { CommonModule } from '@angular/common'; @NgModule({ imports: [ - WellcomeRoutingModule, RouterModule + CommonModule, WellcomeRoutingModule, RouterModule ], declarations: [WellcomeComponent], + providers: [EnvironmentSpecificService], exports: [WellcomeComponent] }) export class WellcomeModule { } diff --git a/src/assets/css/connect-custom.css b/src/assets/css/connect-custom.css index a7dd19e..e22bcde 100644 --- a/src/assets/css/connect-custom.css +++ b/src/assets/css/connect-custom.css @@ -100,3 +100,8 @@ border-color:var(--portal-main-color) !important; border-bottom-color: var(--portal-main-color) !important; } + +.communitiesImageBox{ + width:284px; height:109px; + /*width:107px; height:57px;*/ +} \ No newline at end of file