ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pallav...@apache.org
Subject ambari git commit: AMBARI-16771. View URLs: UX edits #4 (pallavkul)
Date Fri, 20 May 2016 11:09:24 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 2d310cf0e -> 848f40766


AMBARI-16771. View URLs: UX edits #4 (pallavkul)


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

Branch: refs/heads/trunk
Commit: 848f40766cede55a4926d05f459fe001b9993fb4
Parents: 2d310cf
Author: Pallav Kulshreshtha <pallav.kul@gmail.com>
Authored: Fri May 20 16:39:08 2016 +0530
Committer: Pallav Kulshreshtha <pallav.kul@gmail.com>
Committed: Fri May 20 16:39:08 2016 +0530

----------------------------------------------------------------------
 .../controllers/ambariViews/ViewsEditCtrl.js    | 20 +++++++++++++++++++-
 .../ui/admin-web/app/scripts/i18n.config.js     |  5 ++---
 .../resources/ui/admin-web/app/styles/main.css  |  4 ++++
 .../admin-web/app/views/ambariViews/edit.html   |  8 ++++----
 .../app/views/ambariViews/listTable.html        |  2 +-
 .../app/views/ambariViews/listUrls.html         |  4 ++--
 .../ui/admin-web/app/views/urls/create.html     |  8 ++++----
 .../ui/admin-web/app/views/urls/edit.html       |  4 ++--
 8 files changed, 38 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/848f4076/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsEditCtrl.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsEditCtrl.js
b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsEditCtrl.js
index 2b1fb3b..6066f74 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsEditCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/ambariViews/ViewsEditCtrl.js
@@ -18,7 +18,7 @@
 'use strict';
 
 angular.module('ambariAdminConsole')
-  .controller('ViewsEditCtrl', ['$scope', '$routeParams', 'RemoteCluster', 'Cluster', 'View',
'Alert', 'PermissionLoader', 'PermissionSaver', 'ConfirmationModal', '$location', 'UnsavedDialog',
'$translate', function($scope, $routeParams, RemoteCluster, Cluster, View, Alert, PermissionLoader,
PermissionSaver, ConfirmationModal, $location, UnsavedDialog, $translate) {
+  .controller('ViewsEditCtrl', ['$scope','$route', '$templateCache', '$routeParams', 'RemoteCluster',
'Cluster', 'View', 'Alert', 'PermissionLoader', 'PermissionSaver', 'ConfirmationModal', '$location',
'UnsavedDialog', '$translate', function($scope, $route, $templateCache , $routeParams, RemoteCluster,
Cluster, View, Alert, PermissionLoader, PermissionSaver, ConfirmationModal, $location, UnsavedDialog,
$translate) {
     var $t = $translate.instant;
     $scope.identity = angular.identity;
     $scope.isConfigurationEmpty = true;
@@ -432,6 +432,24 @@ angular.module('ambariAdminConsole')
       });
     };
 
+    $scope.deleteShortURL = function(shortUrlName) {
+      ConfirmationModal.show(
+        $t('common.delete', {
+          term: $t('urls.url')
+        }),
+        $t('common.deleteConfirmation', {
+          instanceType: $t('urls.url').toLowerCase(),
+          instanceName: '"' + shortUrlName + '"'
+        })
+      ).then(function() {
+        View.deleteUrl(shortUrlName).then(function() {
+          var currentPageTemplate = $route.current.templateUrl;
+          $templateCache.remove(currentPageTemplate);
+          $route.reload();
+        });
+      });
+    };
+
     $scope.$on('$locationChangeStart', function(event, targetUrl) {
       if( $scope.settingsForm.$dirty || $scope.propertiesForm.$dirty){
         UnsavedDialog().then(function(action) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/848f4076/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
index 3ed2687..02af3aa 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/i18n.config.js
@@ -145,8 +145,8 @@ angular.module('ambariAdminConsole')
         'clusterRenamed': 'The cluster has been renamed to {{clusterName}}.',
         'remoteClusterRegistered': 'The cluster has been registered as {{clusterName}}.',
         'cannotRenameCluster': 'Cannot rename cluster to {{clusterName}}',
-        'tooShort': 'Too short',
-        'tooLong': 'Too long',
+        'minimumTwoChars': 'Minimum length is 2 characters.',
+        'maxTwentyFiveChars': 'Maximum length is 25 characters.',
         'onlyText': 'Only lowercase alphanumeric characters are allowed.',
         'onlyAnScore': 'Invalid input, only alphanumerics allowed eg: My_default_view',
         'passwordRequired':'Password Required',
@@ -222,7 +222,6 @@ angular.module('ambariAdminConsole')
       'pending': 'Pending...',
       'deploying': 'Deploying...',
       'properties': 'properties',
-      'urlCreate':'Create new URL',
       'urlDelete':'Delete URL',
 
       'clusterPermissions': {

http://git-wip-us.apache.org/repos/asf/ambari/blob/848f4076/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css b/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
index bbd8a7c..b15c5ae 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/styles/main.css
@@ -1090,6 +1090,10 @@ button.btn.btn-xs{
   word-wrap:break-word;
 }
 
+a.alert-link, a.alert-link:hover, a.alert-link:visited{
+  color: #a94442;
+}
+
 .alert-info {
   background-color: #E6F1F6;
   border-color: #D2D9DD;

http://git-wip-us.apache.org/repos/asf/ambari/blob/848f4076/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/edit.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/edit.html
b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/edit.html
index 3a69a50..a0bd138 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/edit.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/edit.html
@@ -84,15 +84,15 @@
           <div class="col-sm-9">
             <div ng-if="settings.shortUrl">
             <p class="form-control-static"><a target="_blank" href="/#/main/view/{{instance.ViewInstanceInfo.view_name}}/{{settings.shortUrl}}"
ng-if="settings.shortUrl">/main/view/{{instance.ViewInstanceInfo.view_name}}/{{settings.shortUrl}}&nbsp;<i
class="fa fa-external-link" aria-hidden="true"></i></a>
-             &nbsp; <a ng-hide="editDetailsSettingsDisabled" href="#/urls/edit/{{settings.shortUrlName}}"
class="btn btn-xs btn-primary">{{'urls.change' | translate}}</a>
-            </p>
+             &nbsp;<a ng-hide="editDetailsSettingsDisabled" href="javascript:void(0)"
ng-click="deleteShortURL(settings.shortUrlName)" class="alert-link">{{'common.delete' |
translate }}</a>
+             </p>
           </div>
             <div ng-if="!settings.shortUrl">
               <p ng-hide="!editDetailsSettingsDisabled" class="form-control-static">
-                <span class="label label-block label-default">{{'urls.none' | translate}}</span>
+                <a href="#/urls/link/{{instance.ViewInstanceInfo.view_name}}/{{instance.ViewInstanceInfo.version}}/{{instance.ViewInstanceInfo.instance_name}}">{{'urls.createNewUrl'
| translate}}</a>
               </p>
               <p class="form-control-static" ng-hide="editDetailsSettingsDisabled">
-                <a href="#/urls/link/{{instance.ViewInstanceInfo.view_name}}/{{instance.ViewInstanceInfo.version}}/{{instance.ViewInstanceInfo.instance_name}}"
class="btn btn-primary createuser-btn"><span class="glyphicon glyphicon-plus"></span>
{{'views.urlCreate' | translate}}</a>
+                <a href="#/urls/link/{{instance.ViewInstanceInfo.view_name}}/{{instance.ViewInstanceInfo.version}}/{{instance.ViewInstanceInfo.instance_name}}">{{'urls.createNewUrl'
| translate}}</a>
               </p>
             </div>
           </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/848f4076/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listTable.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listTable.html
b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listTable.html
index 2481d59..bc441cd 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listTable.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listTable.html
@@ -16,7 +16,7 @@
 * limitations under the License.
 -->
 
-<div class="views-list-table">
+<div class="users-pane views-list-table">
     <div class="clearfix">
         <ol class="breadcrumb pull-left">
             <li class="active">{{'common.views' | translate}}</li>

http://git-wip-us.apache.org/repos/asf/ambari/blob/848f4076/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listUrls.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listUrls.html
b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listUrls.html
index e0b8a4e..4654147 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listUrls.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/ambariViews/listUrls.html
@@ -16,7 +16,7 @@
 * limitations under the License.
 -->
 
-<div class="views-list-table" data-ng-init="initViewUrls()">
+<div class="users-pane views-list-table" data-ng-init="initViewUrls()">
 
 
     <div class="clearfix">
@@ -25,7 +25,7 @@
         </ol>
         <div class="pull-right top-margin-4">
             <div class="tooltip-wrapper"  tooltip="{{(createUrlDisabled)? ('urls.noViewInstances'
| translate) : ''}}">
-            <link-to ng-disabled="createUrlDisabled" route="views.createViewUrl" class="btn
btn-primary createuser-btn"><span class="glyphicon glyphicon-plus"></span>
{{'views.urlCreate' | translate}}</link-to>
+            <link-to ng-disabled="createUrlDisabled" route="views.createViewUrl" class="btn
btn-primary createuser-btn"><span class="glyphicon glyphicon-plus"></span>
{{'urls.createNewUrl' | translate}}</link-to>
         </div>
         </div>
     </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/848f4076/ambari-admin/src/main/resources/ui/admin-web/app/views/urls/create.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/urls/create.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/urls/create.html
index c98ec3e..a01024d 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/urls/create.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/urls/create.html
@@ -29,8 +29,8 @@
                     <div class="col-sm-10">
                         <input ng-minlength="3" ng-maxlength="20" type="text" id="urlname"
class="form-control urlname-input" name="url_name" placeholder="{{'urls.name' | translate}}"
ng-model="url.urlName" required autocomplete="off">
                         <div class="alert alert-danger top-margin" ng-show="formHolder.form.url_name.$error.required
 && formHolder.form.submitted">{{'common.alerts.fieldIsRequired' | translate}}</div>
-                        <div class="alert alert-danger top-margin" ng-show="formHolder.form.url_name.$error.minlength
  && formHolder.form.submitted">{{'common.alerts.tooShort' | translate}}</div>
-                        <div class="alert alert-danger top-margin" ng-show="formHolder.form.url_name.$error.maxlength
  && formHolder.form.submitted">{{'common.alerts.tooLong' | translate}}</div>
+                        <div class="alert alert-danger top-margin" ng-show="formHolder.form.url_name.$error.minlength
  && formHolder.form.submitted">{{'common.alerts.minimumTwoChars' | translate}}</div>
+                        <div class="alert alert-danger top-margin" ng-show="formHolder.form.url_name.$error.maxlength
  && formHolder.form.submitted">{{'common.alerts.maxTwentyFiveChars' | translate}}</div>
                     </div>
                 </div>
 
@@ -58,8 +58,8 @@
                             <span id="basic-addon1" class="input-group-addon">/main/view/{{chomp(url.selectedView)}}/</span><input
aria-describedby="basic-addon1" type="text" class="form-control" id="urlsuffixin" name="url_view_suffix"
placeholder="{{'views.shortUrl' | translate}}" ng-model="url.suffix" ng-pattern="/^[a-z0-9-_]+$/"
ng-minlength="3" ng-maxlength="25" required autocomplete="off">
                         </div>
                         <div class="alert alert-danger top-margin" ng-show="formHolder.form.url_view_suffix.$error.required
  && formHolder.form.submitted">{{'common.alerts.fieldIsRequired' | translate}}</div>
-                        <div class="alert alert-danger top-margin" ng-show="formHolder.form.url_view_suffix.$error.minlength
  && formHolder.form.submitted">{{'common.alerts.tooShort' | translate}}</div>
-                        <div class="alert alert-danger top-margin" ng-show="formHolder.form.url_view_suffix.$error.maxlength
  && formHolder.form.submitted">{{'common.alerts.tooLong' | translate}}</div>
+                        <div class="alert alert-danger top-margin" ng-show="formHolder.form.url_view_suffix.$error.minlength
  && formHolder.form.submitted">{{'common.alerts.minimumTwoChars' | translate}}</div>
+                        <div class="alert alert-danger top-margin" ng-show="formHolder.form.url_view_suffix.$error.maxlength
  && formHolder.form.submitted">{{'common.alerts.maxTwentyFiveChars' | translate}}</div>
                         <div class="alert alert-danger top-margin" ng-show="formHolder.form.url_view_suffix.$error.pattern
  && formHolder.form.submitted">{{'common.alerts.onlyText' | translate}}</div>
 
                     </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/848f4076/ambari-admin/src/main/resources/ui/admin-web/app/views/urls/edit.html
----------------------------------------------------------------------
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/views/urls/edit.html b/ambari-admin/src/main/resources/ui/admin-web/app/views/urls/edit.html
index 9e0ef4c..1d0ff8c 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/views/urls/edit.html
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/views/urls/edit.html
@@ -60,8 +60,8 @@
       <span id="basic-addon1" class="input-group-addon">/main/view/{{url.view_instance_common_name}}/</span><input
aria-describedby="basic-addon1" type="text" class="form-control" id="urlsuffixin" name="url_view_suffix"
placeholder="{{'views.shortUrl' | translate}}" ng-model="url.url_suffix" ng-pattern="/^[a-z0-9-_]+$/"
ng-minlength="3" ng-maxlength="25" required autocomplete="off">
         </div>
       <div class="alert alert-danger top-margin" ng-show="url_form.url_view_suffix.$error.required
  && url_form.submitted">{{'common.alerts.fieldIsRequired' | translate}}</div>
-      <div class="alert alert-danger top-margin" ng-show="url_form.url_view_suffix.$error.minlength
  && url_form.submitted">{{'common.alerts.tooShort' | translate}}</div>
-      <div class="alert alert-danger top-margin" ng-show="url_form.url_view_suffix.$error.maxlength
  && url_form.submitted">{{'common.alerts.tooLong' | translate}}</div>
+      <div class="alert alert-danger top-margin" ng-show="url_form.url_view_suffix.$error.minlength
  && url_form.submitted">{{'common.alerts.minimumTwoChars' | translate}}</div>
+      <div class="alert alert-danger top-margin" ng-show="url_form.url_view_suffix.$error.maxlength
  && url_form.submitted">{{'common.alerts.maxTwentyFiveChars' | translate}}</div>
       <div class="alert alert-danger top-margin" ng-show="url_form.url_view_suffix.$error.pattern
  && url_form.submitted">{{'common.alerts.onlyText' | translate}}</div>
 
     </div>


Mime
View raw message