[Trunk | Connect]:

1. my-communities.component.ts: Use new method "isSubscribedToCommunity()" without email parameter (subscribe.service).
2. subscribe.component.ts: Do not reveal users' (subscribers') emails:
	a. Check when method "init()" is called .
	b. Use new methods "isSubscribedToCommunity()", "subscribeToCommunity", "unSubscribeToCommunity" without email parameter (subscribe.service). 
	c. Use method "getNumberOfCommunitySubscribers()" instead of "getCommunitySubscribers()".


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@58460 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2020-04-10 05:24:24 +00:00
parent eb0732a8c7
commit 33d12026ff
2 changed files with 14 additions and 10 deletions

View File

@ -152,7 +152,7 @@ export class MyCommunitiesComponent {
this.status = this.errorCodes.DONE;
if (mail != null && showCommunity) {
this._subscribeService.isSubscribedToCommunity(this.properties, community.communityId, mail).subscribe(
this._subscribeService.isSubscribedToCommunity(this.properties, community.communityId).subscribe(
res => {
isSubscriber = res;
if (isSubscriber) {

View File

@ -68,12 +68,16 @@ export class SubscribeComponent {
public ngOnInit() {
this.route.data.subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific;
this.userManagementService.getUserInfo().subscribe(user => {
this.user = user;
if(!this.showNumbers) {
this.userManagementService.getUserInfo().subscribe(user => {
this.user = user;
this.init();
});
} else {
this.init();
});
}
});
this.init();
//this.init();
}
private init() {
@ -83,7 +87,7 @@ export class SubscribeComponent {
this.subscribed = false;
} else {
if (this.communityId) {
this._subscribeService.isSubscribedToCommunity(this.properties, this.communityId, email).subscribe(
this._subscribeService.isSubscribedToCommunity(this.properties, this.communityId).subscribe(
res => {
this.subscribed = res;
if (this.subscribed) {
@ -99,9 +103,9 @@ export class SubscribeComponent {
}
} else {
if (this.communityId) {
this._subscribeService.getCommunitySubscribers(this.properties, this.communityId).subscribe(
this._subscribeService.getNumberOfCommunitySubscribers(this.properties, this.communityId).subscribe(
res => {
this.subscribers = (res && res.subscribers && res.subscribers.length) ? res.subscribers.length : 0;
this.subscribers = res;//(res && res.subscribers && res.subscribers.length) ? res.subscribers.length : 0;
},
error => {
this.handleError("Error getting community subscribers for community with id: " + this.communityId, error);
@ -137,7 +141,7 @@ export class SubscribeComponent {
} else {
this.loading = true;
this.showLoginAlert = false;
this._subscribeService.subscribeToCommunity(this.properties, this.communityId, email).subscribe(
this._subscribeService.subscribeToCommunity(this.properties, this.communityId).subscribe(
res => {
this.loading = false;
if (res.status && res.status != 200) {
@ -192,7 +196,7 @@ export class SubscribeComponent {
} else {
this.loading = true;
//this.properties.adminToolsAPIURL
this._subscribeService.unSubscribeToCommunity(this.properties, this.communityId, email).subscribe(
this._subscribeService.unSubscribeToCommunity(this.properties, this.communityId).subscribe(
res => {
this.loading = false;
if (res.status && res.status != 200) {