diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 8e1f3ca..d142987 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,10 +1,9 @@ -import { Component, Directive, ElementRef, Renderer, ChangeDetectionStrategy, ViewEncapsulation, Injector } from '@angular/core'; -import {Observable} from 'rxjs/Observable'; +import {Component} from '@angular/core'; import {ActivatedRoute} from '@angular/router'; -import { EnvProperties} from './openaireLibrary/utils/properties/env-properties'; -import{MenuItem, RootMenuItem} from './openaireLibrary/sharedComponents/menu'; -import { EnvironmentSpecificService} from './openaireLibrary/utils/properties/environment-specific.service'; +import {EnvProperties} from './openaireLibrary/utils/properties/env-properties'; +import {MenuItem, RootMenuItem} from './openaireLibrary/sharedComponents/menu'; +import {EnvironmentSpecificService} from './openaireLibrary/utils/properties/environment-specific.service'; import {CommunitiesService} from "./openaireLibrary/connect/communities/communities.service"; import {Session} from './openaireLibrary/login/utils/helper.class'; import {ConnectHelper} from './openaireLibrary/connect/connectHelper'; @@ -20,10 +19,10 @@ import {SubscribeService} from './openaireLibrary/utils/subscribe/subscribe.serv `], template: ` - - + +
@@ -38,8 +37,8 @@ import {SubscribeService} from './openaireLibrary/utils/subscribe/subscribe.serv - - + + ` @@ -323,7 +322,7 @@ export class AppComponent { myCommunities.push( new MenuItem("","Managing communities","","/search/find/communities",false,[],[],{role:"%22manager%22"})) } if(Session.isLoggedIn()){ - this._subscribeService.getCommunitiesSubscribedTo(Session.getUserEmail(), this.properties.adminToolsAPIURL).subscribe ( + this._subscribeService.getCommunitiesSubscribedTo(this.properties, Session.getUserEmail()).subscribe ( pids => { if(pids.length > 0 ) { myCommunities.push( new MenuItem("","Subscribed to communities","","/search/find/communities",false,[],[],{status:"%22subscribed%22"})) diff --git a/src/app/communities/communities.component.ts b/src/app/communities/communities.component.ts index fc3c71c..250a7b9 100644 --- a/src/app/communities/communities.component.ts +++ b/src/app/communities/communities.component.ts @@ -1,19 +1,17 @@ import {Component} from '@angular/core'; -import {ActivatedRoute, Router} from '@angular/router'; -import {Title, Meta} from '@angular/platform-browser'; +import {ActivatedRoute, Router} from '@angular/router'; +import {Meta, Title} from '@angular/platform-browser'; +import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; +import {CommunitiesService} from '../openaireLibrary/connect/communities/communities.service'; +import {SubscribeService} from '../openaireLibrary/utils/subscribe/subscribe.service'; +import {CommunityInfo} from '../openaireLibrary/connect/community/communityInfo'; -import "rxjs/add/observable/zip"; -import {EnvProperties} from '../openaireLibrary/utils/properties/env-properties'; -import {CommunitiesService} from '../openaireLibrary/connect/communities/communities.service'; -import {SubscribeService} from '../openaireLibrary/utils/subscribe/subscribe.service'; -import {CommunityInfo} from '../openaireLibrary/connect/community/communityInfo'; +import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; +import {Session} from '../openaireLibrary/login/utils/helper.class'; +import {StringUtils} from '../openaireLibrary/utils/string-utils.class'; -import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service'; -import {Session} from '../openaireLibrary/login/utils/helper.class'; -import {StringUtils} from '../openaireLibrary/utils/string-utils.class'; - -import {ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes'; -import {ErrorMessagesComponent} from '../openaireLibrary/utils/errorMessages.component'; +import {ErrorCodes} from '../openaireLibrary/utils/properties/errorCodes'; +import {ErrorMessagesComponent} from '../openaireLibrary/utils/errorMessages.component'; @Component({ selector: 'communities', @@ -129,7 +127,7 @@ export class CommunitiesComponent { this.status = this.errorCodes.DONE; if(mail != null && showCommunity) { - this._subscribeService.isSubscribedToCommunity(community.communityId, mail, this.properties.adminToolsAPIURL).subscribe ( + this._subscribeService.isSubscribedToCommunity( this.properties, community.communityId, mail).subscribe ( res => { isSubscriber = res; if(isSubscriber) { diff --git a/src/app/community/community.component.html b/src/app/community/community.component.html index ea3b69a..aad6849 100644 --- a/src/app/community/community.component.html +++ b/src/app/community/community.component.html @@ -178,7 +178,9 @@