ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject [3/3] ambari git commit: AMBARI-15261. Hide Admin Settings / Login Message features (alexantonenko)
Date Wed, 02 Mar 2016 22:20:07 GMT
AMBARI-15261. Hide Admin Settings / Login Message features (alexantonenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9df2eb74
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9df2eb74
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9df2eb74

Branch: refs/heads/trunk
Commit: 9df2eb74e517c59c5c2149712b0198d52ce9cc1f
Parents: 06747ad
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Wed Mar 2 16:11:59 2016 +0200
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Thu Mar 3 00:20:01 2016 +0200

----------------------------------------------------------------------
 ambari-admin/src/main/resources/ui/admin-web/app/scripts/app.js | 3 ++-
 .../src/main/resources/ui/admin-web/app/scripts/routes.js       | 5 +++++
 .../src/main/resources/ui/admin-web/app/views/leftNavbar.html   | 4 ++--
 3 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9df2eb74/ambari-admin/src/main/resources/ui/admin-web/app/scripts/app.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/app.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/app.js
index a0c0323..63aa4eb 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/app.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/app.js
@@ -29,7 +29,8 @@ angular.module('ambariAdminConsole', [
 	baseUrl: '/api/v1',
   testMode: (window.location.port == 8000),
   mockDataPrefix: 'assets/data/',
-  isLDAPConfigurationSupported: false
+  isLDAPConfigurationSupported: false,
+  isLoginActivitiesSupported: false
 })
 .config(['RestangularProvider', '$httpProvider', '$provide', function(RestangularProvider,
$httpProvider, $provide) {
   // Config Ajax-module

http://git-wip-us.apache.org/repos/asf/ambari/blob/9df2eb74/ambari-admin/src/main/resources/ui/admin-web/app/scripts/routes.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/routes.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/routes.js
index 8901738..4fc4ea6 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/routes.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/routes.js
@@ -154,4 +154,9 @@ angular.module('ambariAdminConsole')
       e.preventDefault();
     }
   });
+  $rootScope.$on('$locationChangeStart', function (e, nextUrl) {
+    if ((/\/loginMessage$/.test(nextUrl) || /\/homeDirectory$/.test(nextUrl)) &&
!Settings.isLoginActivitiesSupported) {
+      e.preventDefault();
+    }
+  });
 }]);

http://git-wip-us.apache.org/repos/asf/ambari/blob/9df2eb74/ambari-admin/src/main/resources/ui/admin-web/app/views/leftNavbar.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/leftNavbar.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/leftNavbar.html
index 1646d7c..3bb89ba 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/leftNavbar.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/leftNavbar.html
@@ -105,12 +105,12 @@
     </div>
   </div>
 
-  <div class="panel panel-default">
+  <div class="panel panel-default" ng-show="settings.isLoginActivitiesSupported || settings.isLDAPConfigurationSupported">
     <div class="panel-heading"><span class="glyphicon glyphicon-cog"></span>
{{'common.settings' | translate}}</div>
     <div class="panel-body">
       <ul class="nav nav-pills nav-stacked">
         <li ng-class="{active: isActive('authentication.main')}" ng-show="settings.isLDAPConfigurationSupported"><link-to
route="authentication.main">{{'common.authentication' | translate}}</link-to></li>
-        <li ng-class="{active: isActive('loginActivities.loginMessage')}"><link-to
route="loginActivities.loginMessage">{{'common.loginActivities.loginActivities' | translate}}</link-to></li>
+        <li ng-class="{active: isActive('loginActivities.loginMessage')}" ng-show="settings.isLoginActivitiesSupported"><link-to
route="loginActivities.loginMessage">{{'common.loginActivities.loginActivities' | translate}}</link-to></li>
       </ul>
     </div>
   </div>


Mime
View raw message