From e17f5f2088a3c6de77ad84455fc7ec35a2f5ad3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Mon, 3 Sep 2018 15:00:20 +0200 Subject: [PATCH] Display link to help page only if custom suppor url is defined --- .../dropdown-user/dropdown-user.directive.coffee | 2 +- app/modules/navigation-bar/dropdown-user/dropdown-user.jade | 4 ++-- app/modules/navigation-bar/navigation-bar.directive.coffee | 2 +- app/modules/navigation-bar/navigation-bar.jade | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/modules/navigation-bar/dropdown-user/dropdown-user.directive.coffee b/app/modules/navigation-bar/dropdown-user/dropdown-user.directive.coffee index d023811b..e5a6b934 100644 --- a/app/modules/navigation-bar/dropdown-user/dropdown-user.directive.coffee +++ b/app/modules/navigation-bar/dropdown-user/dropdown-user.directive.coffee @@ -23,7 +23,7 @@ DropdownUserDirective = (authService, configService, locationService, link = (scope, el, attrs, ctrl) -> scope.vm = {} scope.vm.isFeedbackEnabled = configService.get("feedbackEnabled") - scope.vm.supportUrl = configService.get("supportUrl") + scope.vm.customSupportUrl = configService.get("supportUrl") taiga.defineImmutableProperty(scope.vm, "user", () -> authService.userData) scope.vm.logout = -> diff --git a/app/modules/navigation-bar/dropdown-user/dropdown-user.jade b/app/modules/navigation-bar/dropdown-user/dropdown-user.jade index b8f12e1b..ed436223 100644 --- a/app/modules/navigation-bar/dropdown-user/dropdown-user.jade +++ b/app/modules/navigation-bar/dropdown-user/dropdown-user.jade @@ -49,9 +49,9 @@ div.navbar-dropdown.dropdown-user ng-click="vm.sendFeedback()", title="{{'PROJECT.NAVIGATION.FEEDBACK_TITLE' | translate}}", translate="PROJECT.NAVIGATION.FEEDBACK") - li + li(ng-if="vm.customSupportUrl") a( - href="{{ vm.supportUrl }}", + href="{{ vm.customSupportUrl }}", target="_blank", title="{{'PROJECT.NAVIGATION.HELP_TITLE' | translate}}", translate="PROJECT.NAVIGATION.HELP") diff --git a/app/modules/navigation-bar/navigation-bar.directive.coffee b/app/modules/navigation-bar/navigation-bar.directive.coffee index 5aaf354c..620d3742 100644 --- a/app/modules/navigation-bar/navigation-bar.directive.coffee +++ b/app/modules/navigation-bar/navigation-bar.directive.coffee @@ -26,7 +26,7 @@ NavigationBarDirective = (currentUserService, navigationBarService, locationServ taiga.defineImmutableProperty(scope.vm, "isEnabledHeader", () -> navigationBarService.isEnabledHeader()) scope.vm.publicRegisterEnabled = config.get("publicRegisterEnabled") - scope.vm.supportUrl = config.get("supportUrl") + scope.vm.customSupportUrl = config.get("supportUrl") scope.vm.login = -> nextUrl = encodeURIComponent(locationService.url()) diff --git a/app/modules/navigation-bar/navigation-bar.jade b/app/modules/navigation-bar/navigation-bar.jade index f424e36c..7a252ee0 100644 --- a/app/modules/navigation-bar/navigation-bar.jade +++ b/app/modules/navigation-bar/navigation-bar.jade @@ -16,7 +16,8 @@ nav.navbar(ng-if="vm.isEnabledHeader") include ../../svg/logo.svg a( - href="{{ vm.supportUrl }}", + ng-if="vm.customSupportUrl" + href="{{ vm.customSupportUrl }}", target="_blank", title="{{'PROJECT.NAVIGATION.HELP_TITLE' | translate}}", translate="PROJECT.NAVIGATION.HELP"