From bc0fd3672229d7d3591e7ff45ac25592ff956dab Mon Sep 17 00:00:00 2001 From: gkolokythas Date: Fri, 3 Jan 2020 18:38:27 +0200 Subject: [PATCH] Hides "Contact-Support" footer option when user not logged in. --- .../sidebar/sidebar-footer/sidebar-footer.component.html | 2 +- .../ui/sidebar/sidebar-footer/sidebar-footer.component.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.html b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.html index ba92feae2..4dd12fe7f 100644 --- a/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.html +++ b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.html @@ -20,7 +20,7 @@
-
+

{{'FOOTER.CONTACT-SUPPORT' | translate}}

diff --git a/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.ts b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.ts index fcab57335..dda6326be 100644 --- a/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.ts +++ b/dmp-frontend/src/app/ui/sidebar/sidebar-footer/sidebar-footer.component.ts @@ -13,6 +13,7 @@ import { FormService } from '@common/forms/form-service'; import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model'; import { TranslateService } from '@ngx-translate/core'; import { takeUntil } from 'rxjs/operators'; +import { AuthService } from "@app/core/services/auth/auth.service"; @Component({ selector: 'app-sidebar-footer', @@ -30,7 +31,8 @@ export class SidebarFooterComponent extends BaseComponent implements OnInit { public router: Router, private contactSupportService: ContactSupportService, private uiNotificationService: UiNotificationService, - private formService: FormService + private formService: FormService, + private authentication: AuthService, ) { super(); } @@ -110,4 +112,8 @@ export class SidebarFooterComponent extends BaseComponent implements OnInit { (this.contactEmailFormModel.validationErrorModel)[item] = (validationErrorModel)[item]; }); } + + public isAuthenticated(): boolean { + return !(!this.authentication.current()); + } }