diff --git a/src/app/utils/manage/manage.component.ts b/src/app/utils/manage/manage.component.ts index 85ba4fd..14ec6c6 100644 --- a/src/app/utils/manage/manage.component.ts +++ b/src/app/utils/manage/manage.component.ts @@ -1,21 +1,11 @@ -import { Component, Input, ViewChild } from '@angular/core'; -import { Location } from '@angular/common'; -import {ActivatedRoute} from '@angular/router'; -import { EnvProperties} from '../../openaireLibrary/utils/properties/env-properties'; -import {CommunityService} from '../../openaireLibrary/connect/community/community.service'; -import {Session} from '../../openaireLibrary/login/utils/helper.class'; +import { Component, Input} from '@angular/core'; @Component({ selector: 'manage', template: ` - - - - - - - - Manage + + Manage + ` @@ -24,40 +14,6 @@ import {Session} from '../../openaireLibrary/login/utils/helper.class'; export class ManageComponent { @Input() communityId:string; - - isManager:boolean = false; - properties:EnvProperties; - constructor (private route: ActivatedRoute, - private _communityService: CommunityService - ) { - } - - public ngOnInit() { - this.route.data - .subscribe((data: { envSpecific: EnvProperties }) => { - this.properties = data.envSpecific; - if(Session.isLoggedIn()){ - if(Session.isPortalAdministrator()||Session.isCommunityCurator()){ - this.isManager = true; - }else if(Session.isLoggedIn()){ - var email = Session.getUserEmail(); - this._communityService.isCommunityManager(this.properties, this.properties.communityAPI+ this.communityId, email).subscribe ( - res => { - this.isManager = res; - }, - error => { - this.handleError("Error getting response if email: "+email+" is community manager for community with id: "+this.communityId, error); - } - ); - } - } - }); - - - - } - - private handleError(message: string, error) { - console.error("Manage (component): "+message, error); - } + constructor() {} } + diff --git a/src/app/utils/manage/manage.module.ts b/src/app/utils/manage/manage.module.ts index ff61e55..0cf0282 100644 --- a/src/app/utils/manage/manage.module.ts +++ b/src/app/utils/manage/manage.module.ts @@ -2,7 +2,6 @@ import { NgModule} from '@angular/core'; import { CommonModule } from '@angular/common'; import { RouterModule } from '@angular/router'; -import {CommunityService} from '../../openaireLibrary/connect/community/community.service'; import {ManageComponent} from './manage.component'; import {AlertModalModule} from '../../openaireLibrary/utils/modal/alertModal.module'; @@ -12,12 +11,9 @@ import {AlertModalModule} from '../../openaireLibrary/utils/modal/alertModal.mod ], declarations: [ ManageComponent - ], - providers:[ - CommunityService - ], + ], exports: [ ManageComponent - ] + ] }) export class ManageModule { }