thingsboard-aplcache

UI: Fix minor bugs/issues.

10/5/2017 2:34:34 PM

Details

diff --git a/ui/src/app/components/contact.tpl.html b/ui/src/app/components/contact.tpl.html
index 2c52fd3..7b360f7 100644
--- a/ui/src/app/components/contact.tpl.html
+++ b/ui/src/app/components/contact.tpl.html
@@ -54,6 +54,6 @@
 </md-input-container>					
 <md-input-container class="md-block">
 	<label translate>contact.email</label>
-	<input name="email" type="email" ng-model="contact.email">	
-</md-input-container>					
+	<input name="email" type="text" ng-pattern='/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\_\-0-9]+\.)+[a-zA-Z]{2,}))$/' ng-model="contact.email">
+</md-input-container>
 	
\ No newline at end of file
diff --git a/ui/src/app/components/grid.directive.js b/ui/src/app/components/grid.directive.js
index 69f8e7e..727b999 100644
--- a/ui/src/app/components/grid.directive.js
+++ b/ui/src/app/components/grid.directive.js
@@ -125,7 +125,7 @@ function Grid() {
 }
 
 /*@ngInject*/
-function GridController($scope, $state, $mdDialog, $document, $q, $timeout, $translate, $mdMedia, $templateCache, $window) {
+function GridController($scope, $state, $mdDialog, $document, $q, $mdUtil, $timeout, $translate, $mdMedia, $templateCache, $window) {
 
     var vm = this;
 
@@ -237,6 +237,10 @@ function GridController($scope, $state, $mdDialog, $document, $q, $timeout, $tra
                                     vm.items.nextPageLink.limit = pageSize;
                                 }
                                 vm.items.pending = false;
+                                if (vm.items.loadCallback) {
+                                    vm.items.loadCallback();
+                                    vm.items.loadCallback = null;
+                                }
                             }
                         },
                         function fail() {
@@ -469,7 +473,25 @@ function GridController($scope, $state, $mdDialog, $document, $q, $timeout, $tra
     }
 
     function refreshList() {
-        $state.go($state.current, vm.refreshParamsFunc(), {reload: true});
+        let preservedTopIndex = vm.topIndex;
+        vm.items.data.length = 0;
+        vm.items.rowData.length = 0;
+        vm.items.nextPageLink = {
+            limit: preservedTopIndex + pageSize,
+            textSearch: $scope.searchConfig.searchText
+        };
+        vm.items.selections = {};
+        vm.items.selectedCount = 0;
+        vm.items.hasNext = true;
+        vm.items.pending = false;
+        vm.detailsConfig.isDetailsOpen = false;
+        vm.items.reloadPending = false;
+        vm.items.loadCallback = () => {
+            $mdUtil.nextTick(() => {
+                moveToIndex(preservedTopIndex);
+            });
+        };
+        vm.itemRows.getItemAtIndex(preservedTopIndex+pageSize);
     }
 
     function addItem($event) {
diff --git a/ui/src/app/components/grid.scss b/ui/src/app/components/grid.scss
index 573c736..6af1f67 100644
--- a/ui/src/app/components/grid.scss
+++ b/ui/src/app/components/grid.scss
@@ -22,10 +22,20 @@
 .tb-card-item {
   @include transition(all .2s ease-in-out);
   md-card-content {
+    padding-top: 0px;
     max-height: 53px;
   }
-  md-card-title-text {
-    max-height: 32px;
+  md-card-title {
+    width: 100%;
+    md-card-title-text {
+      max-height: 32px;
+      min-width: 50%;
+      .md-headline {
+        overflow: hidden;
+        text-overflow: ellipsis;
+        white-space: nowrap;
+      }
+    }
   }
 }
 
diff --git a/ui/src/app/user/user-fieldset.tpl.html b/ui/src/app/user/user-fieldset.tpl.html
index e02e6a4..d03b462 100644
--- a/ui/src/app/user/user-fieldset.tpl.html
+++ b/ui/src/app/user/user-fieldset.tpl.html
@@ -30,7 +30,7 @@
         <md-input-container class="md-block">
             <label translate>user.email</label>
             <input required name="email"
-                   ng-pattern='/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/'
+                   ng-pattern='/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\_\-0-9]+\.)+[a-zA-Z]{2,}))$/'
                    ng-model="user.email">
             <div ng-messages="theForm.email.$error">
                 <div translate ng-message="required">user.email-required</div>