[Trunk|Connect]: Remove a duplicate here on user-info page.

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@56708 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2019-07-23 09:58:53 +00:00
parent 7f22bf970d
commit 8a4ea7d70e
2 changed files with 61 additions and 54 deletions

View File

@ -13,91 +13,98 @@ import {SubscribeComponent} from '../utils/subscribe/subscribe.component';
import {ConnectHelper} from '../openaireLibrary/connect/connectHelper';
@Component({
selector: 'openaire-user',
template: `
<div id="tm-main" class="uk-section uk-margin-small-top tm-middle">
selector: 'openaire-user',
template: `
<div id="tm-main" class="uk-section uk-margin-small-top tm-middle">
<user [mainComponent]=false></user>
<div *ngIf="!server" class=" uk-container uk-container-small uk-position-relative">
<user [mainComponent]=false></user>
<div *ngIf="!server" class=" uk-container uk-container-small uk-position-relative">
<div *ngIf="usercomponent.errorCode == '6'" class="uk-alert uk-alert-warning">
<div *ngIf="usercomponent.errorCode == '6'" class="uk-alert uk-alert-warning">
<span *ngIf="!isSubscribed">For this action you have to login and subscribe to research community.
<span *ngIf="subscribe && !subscribeLoading ">Login and Subscribe here <a [class]="'' + (subscribe.loading ? ' uk-disabled' : '')" (click)="subscribeTo()" > here</a>.</span>
<span *ngIf="subscribe && !subscribeLoading ">Login and Subscribe <a
[class]="'' + (subscribe.loading ? ' uk-disabled' : '')" (click)="subscribeTo()">here</a>.</span>
</span>
<span *ngIf="subscribeLoading ">Subscribing to community....</span>
<span *ngIf="subscribeError ">An error occured while trying to subscribe to community....</span>
<span *ngIf="subscribeLoading ">Subscribing to community....</span>
<span *ngIf="subscribeError ">An error occured while trying to subscribe to community....</span>
</div>
<div *ngIf="usercomponent.errorCode == '7'" class="uk-alert uk-alert-warning">
This action requires authentication.
<span *ngIf="!loggedIn">
Please <a class="" (click)="login()" > sign in</a> to continue.
</div>
<div *ngIf="usercomponent.errorCode == '7'" class="uk-alert uk-alert-warning">
This action requires authentication.
<span *ngIf="!loggedIn">
Please <a class="" (click)="login()"> sign in</a> to continue.
</span>
</div>
</div>
</div>
</div>
</div>
<subscribe [communityId]="communityId" [showTemplate]= false class="" (subscribeEvent)="afterSubscibeEvent($event)"></subscribe>
`
})
<subscribe [communityId]="communityId" [showTemplate]=false class=""
(subscribeEvent)="afterSubscibeEvent($event)"></subscribe>
`
})
export class OpenaireUserComponent {
@ViewChild(UserComponent) usercomponent:UserComponent;
@ViewChild(SubscribeComponent) subscribe:SubscribeComponent;
properties:EnvProperties;
@ViewChild(UserComponent) usercomponent: UserComponent;
@ViewChild(SubscribeComponent) subscribe: SubscribeComponent;
properties: EnvProperties;
communityId = null;
subscribeLoading:boolean = false;
subscribeError:boolean = false;
isSubscribed:boolean = false;
subscribeLoading: boolean = false;
subscribeError: boolean = false;
isSubscribed: boolean = false;
public server: boolean = true;
constructor(private _subscribeService: SubscribeService,
private _emailService: EmailService, private route: ActivatedRoute){}
private _emailService: EmailService, private route: ActivatedRoute) {
}
public ngOnInit() {
if( typeof document !== 'undefined') {
if (typeof document !== 'undefined') {
this.server = false;
}
this.route.data
.subscribe((data: { envSpecific: any }) => {
this.route.queryParams.subscribe(
communityId => {
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
if(!this.communityId) {
this.communityId = communityId['communityId'];
}
});
});
.subscribe((data: { envSpecific: any }) => {
this.route.queryParams.subscribe(
communityId => {
this.communityId = ConnectHelper.getCommunityFromDomain(data.envSpecific.domain);
if (!this.communityId) {
this.communityId = communityId['communityId'];
}
});
});
}
login(){
login() {
this.usercomponent.logIn();
}
subscribeTo(){
if(this.subscribe && this.communityId){
subscribeTo() {
if (this.subscribe && this.communityId) {
this.subscribeLoading = true;
this.subscribe.subscribe();
}
}
afterSubscibeEvent($event){
var res = $event.value;
this.subscribeLoading = false;
if(res == "ok"){
this.isSubscribed = true;
this.usercomponent.redirect();
}else{
this.subscribeError = true;
}
afterSubscibeEvent($event) {
var res = $event.value;
this.subscribeLoading = false;
if (res == "ok") {
this.isSubscribed = true;
this.usercomponent.redirect();
} else {
this.subscribeError = true;
}
}
loginAndsubscribe(){
loginAndsubscribe() {
}
}

View File

@ -56,7 +56,7 @@
"cacheUrl" :"http://scoobydoo.di.uoa.gr:3000/get?url=",
"adminToolsAPIURL" :"http://duffy.di.uoa.gr:8080/uoa-admin-tools",
"adminToolsAPIURL" :"http://mpagasas.di.uoa.gr:8080/uoa-admin-tools",
"adminToolsCommunity" :"connect",
"datasourcesAPI": "https://beta.services.openaire.eu/openaire/ds/search/",