[Connect | Trunk]: Add regisrty property. Add new UM methods on subscribe and curators component.
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@59233 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
d71892ed9e
commit
cafb672ae7
|
@ -150,18 +150,16 @@ export class AppComponent {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (this.user && com['status'] != "hidden") {
|
if (this.user && com['status'] != "hidden") {
|
||||||
if (Session.isCommunityCurator(this.user) || Session.isPortalAdministrator(this.user)) {
|
if (Session.isCommunityCurator(this.user) || Session.isPortalAdministrator(this.user) || Session.isManager('community', this.communityId, this.user)) {
|
||||||
this.managerOfCommunities = true;
|
this.managerOfCommunities = true;
|
||||||
} else if (com.managers.indexOf(this.user.email) != -1) {
|
} else if (com.managers.indexOf(this.user.email) != -1) {
|
||||||
this.managerOfCommunities = true;
|
this.managerOfCommunities = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (communityId && communityId != "" && com.communityId == communityId) {
|
if (communityId && communityId != "" && com.communityId == communityId) {
|
||||||
community = com;
|
community = com;
|
||||||
let isCommunityManager: boolean = false;
|
let isCommunityManager: boolean = false;
|
||||||
if (Session.isCommunityCurator(this.user) || Session.isPortalAdministrator(this.user)) {
|
if (Session.isCommunityCurator(this.user) || Session.isPortalAdministrator(this.user) || Session.isManager('community', this.communityId, this.user)) {
|
||||||
isCommunityManager = true;
|
isCommunityManager = true;
|
||||||
} else if (this.user && com.managers.indexOf(this.user.email) != -1) {
|
} else if (this.user && com.managers.indexOf(this.user.email) != -1) {
|
||||||
isCommunityManager = true;
|
isCommunityManager = true;
|
||||||
|
|
|
@ -15,6 +15,7 @@ import {Breadcrumb} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.compo
|
||||||
import {StringUtils} from "../openaireLibrary/utils/string-utils.class";
|
import {StringUtils} from "../openaireLibrary/utils/string-utils.class";
|
||||||
import {Subscription} from "rxjs";
|
import {Subscription} from "rxjs";
|
||||||
import {properties} from "../../environments/environment";
|
import {properties} from "../../environments/environment";
|
||||||
|
import {UserRegistryService} from "../openaireLibrary/services/user-registry.service";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'curators',
|
selector: 'curators',
|
||||||
|
@ -48,20 +49,22 @@ export class CuratorsComponent {
|
||||||
|
|
||||||
subs: Subscription[] = [];
|
subs: Subscription[] = [];
|
||||||
|
|
||||||
constructor (private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private curatorsService: CuratorService,
|
private curatorsService: CuratorService,
|
||||||
private communityService: CommunityService,
|
private communityService: CommunityService,
|
||||||
|
private userRegistryService: UserRegistryService,
|
||||||
private _router: Router,
|
private _router: Router,
|
||||||
private helper: HelperService,
|
private helper: HelperService,
|
||||||
private _meta: Meta,
|
private _meta: Meta,
|
||||||
private _title: Title,
|
private _title: Title,
|
||||||
private seoService: SEOService,
|
private seoService: SEOService,
|
||||||
private _piwikService: PiwikService) {}
|
private _piwikService: PiwikService) {
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.showLoading = true;
|
this.showLoading = true;
|
||||||
this.properties = properties;
|
this.properties = properties;
|
||||||
if(this.longView) {
|
if (this.longView) {
|
||||||
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
|
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
|
||||||
this.subs.push(this._piwikService.trackView(this.properties, this.pageTitle, PiwikHelper.getSiteId(this.communityId, this.properties.environment)).subscribe());
|
this.subs.push(this._piwikService.trackView(this.properties, this.pageTitle, PiwikHelper.getSiteId(this.communityId, this.properties.environment)).subscribe());
|
||||||
}
|
}
|
||||||
|
@ -72,12 +75,13 @@ export class CuratorsComponent {
|
||||||
this.updateDescription("OpenAIRE - Connect, Community Gateway, research community");
|
this.updateDescription("OpenAIRE - Connect, Community Gateway, research community");
|
||||||
}
|
}
|
||||||
this.downloadUrl = this.properties.utilsService + '/download/';
|
this.downloadUrl = this.properties.utilsService + '/download/';
|
||||||
if(!this.longView) {
|
if (properties.environment !== 'development') {
|
||||||
|
if (!this.longView) {
|
||||||
let emails = this.managers.join();
|
let emails = this.managers.join();
|
||||||
this.subs.push(this.curatorsService.getCurators(this.properties, emails).subscribe(curators => {
|
this.subs.push(this.curatorsService.getCurators(this.properties, emails).subscribe(curators => {
|
||||||
this.curators = curators;
|
this.curators = curators;
|
||||||
for(let i = 0; i < this.curators.length; i++) {
|
for (let i = 0; i < this.curators.length; i++) {
|
||||||
this.showMore[i]= false;
|
this.showMore[i] = false;
|
||||||
}
|
}
|
||||||
this.showLoading = false;
|
this.showLoading = false;
|
||||||
HelperFunctions.scroll();
|
HelperFunctions.scroll();
|
||||||
|
@ -85,7 +89,7 @@ export class CuratorsComponent {
|
||||||
} else {
|
} else {
|
||||||
this.subs.push(this.route.queryParams.subscribe(data => {
|
this.subs.push(this.route.queryParams.subscribe(data => {
|
||||||
this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||||
if(!this.communityId) {
|
if (!this.communityId) {
|
||||||
this.communityId = data['communityId'];
|
this.communityId = data['communityId'];
|
||||||
}
|
}
|
||||||
//this.getDivContents();
|
//this.getDivContents();
|
||||||
|
@ -96,8 +100,31 @@ export class CuratorsComponent {
|
||||||
let emails = this.managers.join();
|
let emails = this.managers.join();
|
||||||
this.subs.push(this.curatorsService.getCurators(this.properties, emails).subscribe(curators => {
|
this.subs.push(this.curatorsService.getCurators(this.properties, emails).subscribe(curators => {
|
||||||
this.curators = curators;
|
this.curators = curators;
|
||||||
for(let i = 0; i < this.curators.length; i++) {
|
for (let i = 0; i < this.curators.length; i++) {
|
||||||
this.showMore[i]= false;
|
this.showMore[i] = false;
|
||||||
|
}
|
||||||
|
this.showLoading = false;
|
||||||
|
HelperFunctions.scroll();
|
||||||
|
}));
|
||||||
|
}));
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.subs.push(this.route.queryParams.subscribe(data => {
|
||||||
|
this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||||
|
if (!this.communityId) {
|
||||||
|
this.communityId = data['communityId'];
|
||||||
|
}
|
||||||
|
if(this.longView) {
|
||||||
|
//this.getDivContents();
|
||||||
|
this.getPageContents();
|
||||||
|
}
|
||||||
|
this.subs.push(this.userRegistryService.getManagersEmail('community', this.communityId).subscribe(managers => {
|
||||||
|
let emails = managers.map(manager => manager.email).join();
|
||||||
|
this.subs.push(this.curatorsService.getCurators(this.properties, emails).subscribe(curators => {
|
||||||
|
this.curators = curators;
|
||||||
|
for (let i = 0; i < this.curators.length; i++) {
|
||||||
|
this.showMore[i] = false;
|
||||||
}
|
}
|
||||||
this.showLoading = false;
|
this.showLoading = false;
|
||||||
HelperFunctions.scroll();
|
HelperFunctions.scroll();
|
||||||
|
@ -129,8 +156,8 @@ export class CuratorsComponent {
|
||||||
this.showMore[index] = !this.showMore[index];
|
this.showMore[index] = !this.showMore[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
_format(name: string){
|
_format(name: string) {
|
||||||
if(name) {
|
if (name) {
|
||||||
return (((name).length > this.maxCharacters) ? (name.substring(0, (this.maxCharacters - ('...').length)) + '...') : name);
|
return (((name).length > this.maxCharacters) ? (name.substring(0, (this.maxCharacters - ('...').length)) + '...') : name);
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -14,6 +14,7 @@ import {LoginErrorCodes} from '../../openaireLibrary/login/utils/guardHelper.cla
|
||||||
import {UserManagementService} from "../../openaireLibrary/services/user-management.service";
|
import {UserManagementService} from "../../openaireLibrary/services/user-management.service";
|
||||||
import {Subscription} from "rxjs";
|
import {Subscription} from "rxjs";
|
||||||
import {properties} from "../../../environments/environment";
|
import {properties} from "../../../environments/environment";
|
||||||
|
import {UserRegistryService} from "../../openaireLibrary/services/user-registry.service";
|
||||||
|
|
||||||
declare var UIkit: any;
|
declare var UIkit: any;
|
||||||
|
|
||||||
|
@ -26,22 +27,26 @@ declare var UIkit: any;
|
||||||
<a class="uk-alert-close" uk-close></a>
|
<a class="uk-alert-close" uk-close></a>
|
||||||
<p>Please login first to subscribe</p>
|
<p>Please login first to subscribe</p>
|
||||||
</div>
|
</div>
|
||||||
<button *ngIf="!subscribed" [class]="'uk-button portal-button uk-button-small uk-width-1-1 ' + (loading ? ' uk-disabled' : '')"
|
<button *ngIf="!subscribed"
|
||||||
|
[class]="'uk-button portal-button uk-button-small uk-width-1-1 ' + (loading ? ' uk-disabled' : '')"
|
||||||
(click)="subscribe()">
|
(click)="subscribe()">
|
||||||
<span class="uk-icon uk-flex uk-flex-middle">
|
<span class="uk-icon uk-flex uk-flex-middle">
|
||||||
<svg height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
<svg height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path d="M0 0h24v24H0z" fill="none"></path>
|
<path d="M0 0h24v24H0z" fill="none"></path>
|
||||||
<path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"></path>
|
<path
|
||||||
|
d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"></path>
|
||||||
</svg>
|
</svg>
|
||||||
<span class="space">Subscribe</span>
|
<span class="space">Subscribe</span>
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
<button *ngIf="subscribed" [class]="'subscribed-button uk-button uk-button-small uk-width-1-1 ' + (loading ? ' uk-disabled' : '')"
|
<button *ngIf="subscribed"
|
||||||
|
[class]="'subscribed-button uk-button uk-button-small uk-width-1-1 ' + (loading ? ' uk-disabled' : '')"
|
||||||
(click)="confirmOpen()">
|
(click)="confirmOpen()">
|
||||||
<span class="uk-icon uk-flex uk-flex-middle">
|
<span class="uk-icon uk-flex uk-flex-middle">
|
||||||
<svg height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
<svg height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||||
<path d="M0 0h24v24H0z" fill="none"></path>
|
<path d="M0 0h24v24H0z" fill="none"></path>
|
||||||
<path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"></path>
|
<path
|
||||||
|
d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"></path>
|
||||||
</svg>
|
</svg>
|
||||||
<span class="space">Subscribed</span>
|
<span class="space">Subscribed</span>
|
||||||
</span>
|
</span>
|
||||||
|
@ -82,22 +87,20 @@ export class SubscribeComponent {
|
||||||
private _emailService: EmailService,
|
private _emailService: EmailService,
|
||||||
private _communityService: CommunityService,
|
private _communityService: CommunityService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private userManagementService: UserManagementService
|
private userManagementService: UserManagementService,
|
||||||
) {}
|
private userRegistryService: UserRegistryService
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
public ngOnInit() {
|
public ngOnInit() {
|
||||||
if(!this.properties) {
|
if (!this.properties) {
|
||||||
this.properties = properties;
|
this.properties = properties;
|
||||||
}
|
}
|
||||||
if(!this.showNumbers) {
|
if (!this.showNumbers) {
|
||||||
this.subs.push(this.userManagementService.getUserInfo().subscribe(
|
this.subs.push(this.userManagementService.getUserInfo().subscribe(
|
||||||
user => {
|
user => {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.init();
|
this.init();
|
||||||
},
|
|
||||||
error => {},
|
|
||||||
() => {
|
|
||||||
this.init();
|
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
|
@ -113,6 +116,8 @@ export class SubscribeComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
private isSubscribed() {
|
private isSubscribed() {
|
||||||
|
this.subscribed = Session.isSubscriber('community', this.communityId, this.user);
|
||||||
|
if (!this.subscribed) {
|
||||||
this.subs.push(this._subscribeService.isSubscribed.subscribe(
|
this.subs.push(this._subscribeService.isSubscribed.subscribe(
|
||||||
res => {
|
res => {
|
||||||
this.subscribed = res;
|
this.subscribed = res;
|
||||||
|
@ -123,6 +128,13 @@ export class SubscribeComponent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
} else {
|
||||||
|
if (this.subscribed) {
|
||||||
|
this.subscribeEvent.emit({
|
||||||
|
value: "ok"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private init() {
|
private init() {
|
||||||
|
@ -132,25 +144,13 @@ export class SubscribeComponent {
|
||||||
this.subscribed = false;
|
this.subscribed = false;
|
||||||
} else {
|
} else {
|
||||||
if (this.communityId) {
|
if (this.communityId) {
|
||||||
// this._subscribeService.isSubscribedToCommunity(this.properties, this.communityId).subscribe(
|
|
||||||
// res => {
|
|
||||||
// this.subscribed = res;
|
|
||||||
// if (this.subscribed) {
|
|
||||||
// this.subscribeEvent.emit({
|
|
||||||
// value: "ok"
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// error => {
|
|
||||||
// this.handleError("Error getting response if email: " + email + " is subscribed to community with id: " + this.communityId, error);
|
|
||||||
// });
|
|
||||||
|
|
||||||
this._subscribeService.initIsSubscribedToCommunity(this.properties, this.communityId);
|
this._subscribeService.initIsSubscribedToCommunity(this.properties, this.communityId);
|
||||||
this.isSubscribed();
|
this.isSubscribed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this.communityId) {
|
if (this.communityId) {
|
||||||
|
if (properties.environment !== 'development') {
|
||||||
this.subs.push(this._subscribeService.getNumberOfCommunitySubscribers(this.properties, this.communityId).subscribe(
|
this.subs.push(this._subscribeService.getNumberOfCommunitySubscribers(this.properties, this.communityId).subscribe(
|
||||||
res => {
|
res => {
|
||||||
this.subscribers = (res && res.value) ? res.value : 0;//(res && res.subscribers && res.subscribers.length) ? res.subscribers.length : 0;
|
this.subscribers = (res && res.value) ? res.value : 0;//(res && res.subscribers && res.subscribers.length) ? res.subscribers.length : 0;
|
||||||
|
@ -161,6 +161,17 @@ export class SubscribeComponent {
|
||||||
error => {
|
error => {
|
||||||
this.handleError("Error getting community subscribers for community with id: " + this.communityId, error);
|
this.handleError("Error getting community subscribers for community with id: " + this.communityId, error);
|
||||||
}));
|
}));
|
||||||
|
} else {
|
||||||
|
this.subs.push(this.userRegistryService.getSubscribersCount('community', this.communityId).subscribe(res => {
|
||||||
|
this.subscribers = (res && res.response) ? res.response : 0;
|
||||||
|
this.countSubscribersEvent.emit({
|
||||||
|
value: this.subscribers
|
||||||
|
});
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
this.handleError("Error getting community subscribers for community with id: " + this.communityId, error);
|
||||||
|
}));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.communityId) {
|
if (this.communityId) {
|
||||||
|
@ -178,6 +189,25 @@ export class SubscribeComponent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private successfulSubscribe(email) {
|
||||||
|
if (!this.subscribed) {
|
||||||
|
this.subscribed = true;
|
||||||
|
this.subscribeEvent.emit({
|
||||||
|
value: "ok"
|
||||||
|
});
|
||||||
|
this.subs.push(this._emailService.notifyForNewManagers(this.properties, this.communityId, Composer.composeEmailToInformManagers(this.community.title, this.communityId, this.community.managers,
|
||||||
|
email, this.properties.adminPortalURL)).subscribe(
|
||||||
|
res => {
|
||||||
|
//console.log("The email has been sent successfully!")
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
//console.log(error)
|
||||||
|
this.handleError("Error notifying managers about new subscribers for community with id: " + this.communityId, error);
|
||||||
|
}
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
subscribe() {
|
subscribe() {
|
||||||
var email = (this.user) ? this.user.email : null;
|
var email = (this.user) ? this.user.email : null;
|
||||||
if (email == null) {
|
if (email == null) {
|
||||||
|
@ -192,6 +222,23 @@ export class SubscribeComponent {
|
||||||
} else {
|
} else {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.showLoginAlert = false;
|
this.showLoginAlert = false;
|
||||||
|
if(properties.environment === 'development') {
|
||||||
|
this.subs.push(this.userRegistryService.subscribeTo('community', this.communityId).subscribe(res => {
|
||||||
|
this.userManagementService.updateUserInfo();
|
||||||
|
this.loading = false;
|
||||||
|
this.successfulSubscribe(email);
|
||||||
|
},error => {
|
||||||
|
this.loading = false;
|
||||||
|
UIkit.notification({
|
||||||
|
message: '<strong>An error occurred. Please try again!<strong>',
|
||||||
|
status: 'warning',
|
||||||
|
timeout: 3000,
|
||||||
|
pos: 'top-center'
|
||||||
|
});
|
||||||
|
//console.log(error)
|
||||||
|
this.handleError("Error subscribing email: " + email + " from community with id: " + this.communityId, error);
|
||||||
|
}));
|
||||||
|
}
|
||||||
this.subs.push(this._subscribeService.subscribeToCommunity(this.properties, this.communityId).subscribe(
|
this.subs.push(this._subscribeService.subscribeToCommunity(this.properties, this.communityId).subscribe(
|
||||||
res => {
|
res => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
@ -200,28 +247,13 @@ export class SubscribeComponent {
|
||||||
value: "error"
|
value: "error"
|
||||||
});
|
});
|
||||||
UIkit.notification({
|
UIkit.notification({
|
||||||
message: '<strong>An error occured. Please try again!<strong>',
|
message: '<strong>An error occurred. Please try again!<strong>',
|
||||||
status: 'warning',
|
status: 'warning',
|
||||||
timeout: 3000,
|
timeout: 3000,
|
||||||
pos: 'top-center'
|
pos: 'top-center'
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (!this.subscribed) {
|
this.successfulSubscribe(email);
|
||||||
this.subscribed = true;
|
|
||||||
this.subscribeEvent.emit({
|
|
||||||
value: "ok"
|
|
||||||
});
|
|
||||||
this.subs.push(this._emailService.notifyForNewManagers(this.properties, this.communityId, Composer.composeEmailToInformManagers(this.community.title, this.communityId, this.community.managers,
|
|
||||||
email, this.properties.adminPortalURL)).subscribe(
|
|
||||||
res => {
|
|
||||||
//console.log("The email has been sent successfully!")
|
|
||||||
},
|
|
||||||
error => {
|
|
||||||
//console.log(error)
|
|
||||||
this.handleError("Error notifying managers about new subscribers for community with id: " + this.communityId, error);
|
|
||||||
}
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
|
@ -230,7 +262,7 @@ export class SubscribeComponent {
|
||||||
value: "error"
|
value: "error"
|
||||||
});
|
});
|
||||||
UIkit.notification({
|
UIkit.notification({
|
||||||
message: '<strong>An error occured. Please try again!<strong>',
|
message: '<strong>An error occurred. Please try again!<strong>',
|
||||||
status: 'warning',
|
status: 'warning',
|
||||||
timeout: 3000,
|
timeout: 3000,
|
||||||
pos: 'top-center'
|
pos: 'top-center'
|
||||||
|
@ -247,13 +279,29 @@ export class SubscribeComponent {
|
||||||
this.subscribed = false;
|
this.subscribed = false;
|
||||||
} else {
|
} else {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
//this.properties.adminToolsAPIURL
|
if(properties.environment === 'development') {
|
||||||
|
this.subs.push(this.userRegistryService.unsubscribeFrom('community', this.communityId).subscribe(res => {
|
||||||
|
this.userManagementService.updateUserInfo();
|
||||||
|
this.loading = false;
|
||||||
|
this.subscribed = false;
|
||||||
|
},error => {
|
||||||
|
this.loading = false;
|
||||||
|
UIkit.notification({
|
||||||
|
message: '<strong>An error occurred. Please try again!<strong>',
|
||||||
|
status: 'warning',
|
||||||
|
timeout: 3000,
|
||||||
|
pos: 'top-center'
|
||||||
|
});
|
||||||
|
//console.log(error)
|
||||||
|
this.handleError("Error unsubscribing email: " + email + " from community with id: " + this.communityId, error);
|
||||||
|
}));
|
||||||
|
}
|
||||||
this.subs.push(this._subscribeService.unSubscribeToCommunity(this.properties, this.communityId).subscribe(
|
this.subs.push(this._subscribeService.unSubscribeToCommunity(this.properties, this.communityId).subscribe(
|
||||||
res => {
|
res => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (res.status && res.status != 200) {
|
if (res.status && res.status != 200) {
|
||||||
UIkit.notification({
|
UIkit.notification({
|
||||||
message: '<strong>An error occured. Please try again!<strong>',
|
message: '<strong>An error occurred. Please try again!<strong>',
|
||||||
status: 'warning',
|
status: 'warning',
|
||||||
timeout: 3000,
|
timeout: 3000,
|
||||||
pos: 'top-center'
|
pos: 'top-center'
|
||||||
|
@ -268,7 +316,7 @@ export class SubscribeComponent {
|
||||||
error => {
|
error => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
UIkit.notification({
|
UIkit.notification({
|
||||||
message: '<strong>An error occured. Please try again!<strong>',
|
message: '<strong>An error occurred. Please try again!<strong>',
|
||||||
status: 'warning',
|
status: 'warning',
|
||||||
timeout: 3000,
|
timeout: 3000,
|
||||||
pos: 'top-center'
|
pos: 'top-center'
|
||||||
|
|
|
@ -51,7 +51,7 @@ export let properties: EnvProperties = {
|
||||||
loginUrl: "https://beta.services.openaire.eu/connect-user-management/openid_connect_login",
|
loginUrl: "https://beta.services.openaire.eu/connect-user-management/openid_connect_login",
|
||||||
|
|
||||||
userInfoUrl: "https://beta.services.openaire.eu/uoa-user-management/api/users/getUserInfo?accessToken=",
|
userInfoUrl: "https://beta.services.openaire.eu/uoa-user-management/api/users/getUserInfo?accessToken=",
|
||||||
|
registryUrl: 'https://beta.services.openaire.eu/uoa-user-management/api/registry/',
|
||||||
logoutUrl: "https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=",
|
logoutUrl: "https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=",
|
||||||
|
|
||||||
cookieDomain: ".openaire.eu",
|
cookieDomain: ".openaire.eu",
|
||||||
|
|
|
@ -51,7 +51,7 @@ export let properties: EnvProperties = {
|
||||||
loginUrl: "https://services.openaire.eu/connect-user-management/openid_connect_login",
|
loginUrl: "https://services.openaire.eu/connect-user-management/openid_connect_login",
|
||||||
|
|
||||||
userInfoUrl: " https://services.openaire.eu/uoa-user-management/api/users/getUserInfo?accessToken=",
|
userInfoUrl: " https://services.openaire.eu/uoa-user-management/api/users/getUserInfo?accessToken=",
|
||||||
|
registryUrl: 'https://services.openaire.eu/uoa-user-management/api/registry/',
|
||||||
logoutUrl: "https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=",
|
logoutUrl: "https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=",
|
||||||
|
|
||||||
cookieDomain: ".openaire.eu",
|
cookieDomain: ".openaire.eu",
|
||||||
|
|
|
@ -51,7 +51,7 @@ export let properties: EnvProperties = {
|
||||||
loginUrl: "https://services.openaire.eu/connect-user-management/openid_connect_login",
|
loginUrl: "https://services.openaire.eu/connect-user-management/openid_connect_login",
|
||||||
|
|
||||||
userInfoUrl: " https://services.openaire.eu/uoa-user-management/api/users/getUserInfo?accessToken=",
|
userInfoUrl: " https://services.openaire.eu/uoa-user-management/api/users/getUserInfo?accessToken=",
|
||||||
|
registryUrl: 'https://services.openaire.eu/uoa-user-management/api/registry/',
|
||||||
logoutUrl: "https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=",
|
logoutUrl: "https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=",
|
||||||
|
|
||||||
cookieDomain: ".openaire.eu",
|
cookieDomain: ".openaire.eu",
|
||||||
|
|
|
@ -51,9 +51,10 @@ export let properties: EnvProperties = {
|
||||||
vocabulariesAPI: 'https://dev-openaire.d4science.org/provision/mvc/vocabularies/',
|
vocabulariesAPI: 'https://dev-openaire.d4science.org/provision/mvc/vocabularies/',
|
||||||
piwikBaseUrl: 'https://analytics.openaire.eu/piwik.php?idsite=',
|
piwikBaseUrl: 'https://analytics.openaire.eu/piwik.php?idsite=',
|
||||||
piwikSiteId: '80',
|
piwikSiteId: '80',
|
||||||
loginUrl: 'http://dl170.madgik.di.uoa.gr:8180/dnet-openaire-users-1.0.0-SNAPSHOT/openid_connect_login',
|
loginUrl: 'http://mpagasas.di.uoa.gr:8080/dnet-openaire-users-1.0.0-SNAPSHOT/openid_connect_login',
|
||||||
userInfoUrl: 'http://dl170.madgik.di.uoa.gr:8180/dnet-openaire-users-1.0.0-SNAPSHOT/api/users/getUserInfo?accessToken=',
|
userInfoUrl: 'http://mpagasas.di.uoa.gr:8080/dnet-openaire-users-1.0.0-SNAPSHOT/api/users/getUser',
|
||||||
logoutUrl: 'https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=',
|
registryUrl: 'http://mpagasas.di.uoa.gr:8080/dnet-openaire-users-1.0.0-SNAPSHOT/api/registry/',
|
||||||
|
logoutUrl: 'https://openaire-dev.aai-dev.grnet.gr/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=',
|
||||||
cookieDomain: '.di.uoa.gr',
|
cookieDomain: '.di.uoa.gr',
|
||||||
feedbackmail: 'openaire.test@gmail.com',
|
feedbackmail: 'openaire.test@gmail.com',
|
||||||
cacheUrl: 'http://dl170.madgik.di.uoa.gr:3000/get?url=',
|
cacheUrl: 'http://dl170.madgik.di.uoa.gr:3000/get?url=',
|
||||||
|
|
Loading…
Reference in New Issue