From 18de763606925de7c34de47c419386de0b66b56d Mon Sep 17 00:00:00 2001 From: apapachristou Date: Wed, 5 Jun 2019 10:20:17 +0300 Subject: [PATCH] Adds: Logout on view my profile --- .../user-profile/user-profile.component.html | 25 ++++++++++++++----- .../ui/user-profile/user-profile.component.ts | 5 ++++ dmp-frontend/src/assets/i18n/en.json | 3 ++- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/dmp-frontend/src/app/ui/user-profile/user-profile.component.html b/dmp-frontend/src/app/ui/user-profile/user-profile.component.html index 58ffc6288..651eb0677 100644 --- a/dmp-frontend/src/app/ui/user-profile/user-profile.component.html +++ b/dmp-frontend/src/app/ui/user-profile/user-profile.component.html @@ -6,7 +6,8 @@
-
+
+
{{userProfile.name}} @@ -14,6 +15,11 @@
{{userProfile.email}}
+
@@ -26,7 +32,8 @@
- +
{{dmp.label}}
@@ -37,7 +44,8 @@
- + @@ -60,7 +68,9 @@
- + {{ timezone | timezoneInfoDisplay }} @@ -68,7 +78,9 @@ - + {{ culture.displayName }} - {{ culture.nativeName }} @@ -76,7 +88,8 @@ - + {{ language.label }} diff --git a/dmp-frontend/src/app/ui/user-profile/user-profile.component.ts b/dmp-frontend/src/app/ui/user-profile/user-profile.component.ts index 706dc6edb..352897589 100644 --- a/dmp-frontend/src/app/ui/user-profile/user-profile.component.ts +++ b/dmp-frontend/src/app/ui/user-profile/user-profile.component.ts @@ -38,6 +38,7 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes private language: TranslateService, private cultureService: CultureService, private translate: TranslateService, + private authentication: AuthService ) { super(); } ngOnInit() { @@ -70,6 +71,10 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes ngOnDestroy(): void { } + logout(): void { + this.authentication.logout(); + } + getUserRole(dmp: DmpModel) { if (dmp.creator.id === this.currentUserId) { return this.language.instant('USER-PROFILE.DMPS.CREATOR'); } else if (dmp.associatedUsers.map(x => x.id).indexOf(this.currentUserId) !== -1) { return this.language.instant('USER-PROFILE.DMPS.MEMBER'); } return ''; diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index f7ce596f3..a94f5ab72 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -752,7 +752,8 @@ }, "USER-DIALOG": { "USER-PROFILE": "My Profile", - "EXIT": "Exit " + "EXIT": "Exit ", + "LOG-OUT": "Log Out" }, "USER-PROFILE": { "SETTINGS": {