Repository: ignite
Updated Branches:
  refs/heads/master 06908d29e -> 97c7ed7b3


IGNITE-4472 Minor UI fix.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/97c7ed7b
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/97c7ed7b
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/97c7ed7b

Branch: refs/heads/master
Commit: 97c7ed7b36eb605f275df707ebe726b905b3db54
Parents: 06908d2
Author: Andrey Novikov <anovi...@gridgain.com>
Authored: Thu Feb 16 14:22:22 2017 +0700
Committer: Andrey Novikov <anovi...@gridgain.com>
Committed: Thu Feb 16 14:22:22 2017 +0700

----------------------------------------------------------------------
 .../list-of-registered-users.column-defs.js     |  8 ++--
 .../list-of-registered-users.controller.js      | 18 +++++++++
 .../list-of-registered-users.jade               | 16 +++++---
 .../ui-grid-settings/ui-grid-settings.scss      | 39 +++++++++++++++++---
 4 files changed, 66 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/97c7ed7b/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.column-defs.js
----------------------------------------------------------------------
diff --git 
a/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.column-defs.js
 
b/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.column-defs.js
index 4dc4655..e6ba842 100644
--- 
a/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.column-defs.js
+++ 
b/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.column-defs.js
@@ -49,7 +49,7 @@ const ACTIONS_TEMPLATE = `
 const EMAIL_TEMPLATE = '<div class="ui-grid-cell-contents"><a 
ng-href="mailto:{{ COL_FIELD }}">{{ COL_FIELD }}</a></div>';
 
 export default [
-    {displayName: 'Actions', categoryDisplayName: 'Actions', cellTemplate: 
ACTIONS_TEMPLATE, field: 'actions', minWidth: 70, width: 70, enableFiltering: 
false, enableSorting: false, pinnedLeft: true},
+    {displayName: 'Actions', categoryDisplayName: 'Actions', cellTemplate: 
ACTIONS_TEMPLATE, field: 'actions', minWidth: 65, width: 65, enableFiltering: 
false, enableSorting: false, pinnedLeft: true},
     {displayName: 'User', categoryDisplayName: 'User', field: 'userName', 
cellTemplate: USER_TEMPLATE, minWidth: 160, enableFiltering: true, filter: { 
placeholder: 'Filter by name...' }, pinnedLeft: true},
     {displayName: 'Email', categoryDisplayName: 'Email', field: 'email', 
cellTemplate: EMAIL_TEMPLATE, minWidth: 160, enableFiltering: true, filter: { 
placeholder: 'Filter by email...' }},
     {displayName: 'Company', categoryDisplayName: 'Company', field: 'company', 
minWidth: 160, enableFiltering: true},
@@ -64,9 +64,9 @@ export default [
     // Activities Total
     {displayName: 'Cfg', categoryDisplayName: 'Total activities', field: 
'activitiesTotal["configuration"] || 0', type: 'number', headerTooltip: 'Total 
count of configuration usages', minWidth: 50, width: 50, enableFiltering: 
false},
     {displayName: 'Qry', categoryDisplayName: 'Total activities', field: 
'activitiesTotal["queries"] || 0', type: 'number', headerTooltip: 'Total count 
of queries usages', minWidth: 50, width: 50, enableFiltering: false},
-    {displayName: 'Demo', categoryDisplayName: 'Total activities', field: 
'activitiesTotal["demo"] || 0', type: 'number', headerTooltip: 'Total count of 
demo startup', minWidth: 50, width: 50, enableFiltering: false},
-    {displayName: 'Dnld', categoryDisplayName: 'Total activities', field: 
'activitiesDetail["/agent/download"] || 0', type: 'number', headerTooltip: 
'Total count of agent downloads', minWidth: 50, width: 50, enableFiltering: 
false},
-    {displayName: 'Str', categoryDisplayName: 'Total activities', field: 
'activitiesDetail["/agent/start"] || 0', type: 'number', headerTooltip: 'Total 
count of agent startup', minWidth: 50, width: 50, enableFiltering: false},
+    {displayName: 'Demo', categoryDisplayName: 'Total activities', field: 
'activitiesTotal["demo"] || 0', type: 'number', headerTooltip: 'Total count of 
demo startup', minWidth: 60, width: 60, enableFiltering: false},
+    {displayName: 'Dnld', categoryDisplayName: 'Total activities', field: 
'activitiesDetail["/agent/download"] || 0', type: 'number', headerTooltip: 
'Total count of agent downloads', minWidth: 55, width: 55, enableFiltering: 
false},
+    {displayName: 'Starts', categoryDisplayName: 'Total activities', field: 
'activitiesDetail["/agent/start"] || 0', type: 'number', headerTooltip: 'Total 
count of agent startup', minWidth: 60, width: 60, enableFiltering: false},
     // Activities Configuration
     {displayName: 'Clusters', categoryDisplayName: 'Configuration\'s 
activities', field: 'activitiesDetail["/configuration/clusters"] || 0', type: 
'number', headerTooltip: 'Configuration clusters', minWidth: 50, width: 80, 
enableFiltering: false, visible: false},
     {displayName: 'Model', categoryDisplayName: 'Configuration\'s activities', 
field: 'activitiesDetail["/configuration/domains"] || 0', type: 'number', 
headerTooltip: 'Configuration model', minWidth: 50, width: 80, enableFiltering: 
false, visible: false},

http://git-wip-us.apache.org/repos/asf/ignite/blob/97c7ed7b/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.controller.js
----------------------------------------------------------------------
diff --git 
a/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.controller.js
 
b/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.controller.js
index 1f2a348..5761073 100644
--- 
a/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.controller.js
+++ 
b/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.controller.js
@@ -96,6 +96,18 @@ export default class IgniteListOfRegisteredUsersCtrl {
             return new ActivitiesUserDialog({ user });
         };
 
+        const companiesExcludeFilter = (renderableRows) => {
+            if (_.isNil($ctrl.params.companiesExclude))
+                return renderableRows;
+
+            _.forEach(renderableRows, (row) => {
+                row.visible = _.isEmpty($ctrl.params.companiesExclude) ||
+                    
row.entity.company.toLowerCase().indexOf($ctrl.params.companiesExclude.toLowerCase())
 === -1;
+            });
+
+            return renderableRows;
+        };
+
         $ctrl.gridOptions = {
             data: [],
             columnVirtualizationThreshold: 30,
@@ -120,6 +132,8 @@ export default class IgniteListOfRegisteredUsersCtrl {
                 api.removeUser = removeUser;
                 api.toggleAdmin = toggleAdmin;
                 api.showActivities = showActivities;
+
+                api.grid.registerRowsProcessor(companiesExcludeFilter, 300);
             }
         };
 
@@ -153,6 +167,10 @@ export default class IgniteListOfRegisteredUsersCtrl {
                 .then((data) => $ctrl.adjustHeight(data.length));
         };
 
+        $scope.$watch(() => $ctrl.params.companiesExclude, () => {
+            $ctrl.gridApi.grid.refreshRows();
+        });
+
         $scope.$watch(() => $ctrl.params.startDate, (dt) => {
             $ctrl.gridOptions.exporterCsvFilename = 
`web_console_users_${dtFilter(dt, 'yyyy_MM')}.csv`;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/97c7ed7b/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.jade
----------------------------------------------------------------------
diff --git 
a/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.jade
 
b/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.jade
index efed9c0..1195910 100644
--- 
a/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.jade
+++ 
b/modules/web-console/frontend/app/components/list-of-registered-users/list-of-registered-users.jade
@@ -39,16 +39,20 @@ mixin grid-settings()
         +grid-settings
         label Total users: 
             strong {{ $ctrl.gridOptions.data.length }}&nbsp;&nbsp;&nbsp;
-        label Showing users: 
+        label Showing users:
             strong {{ $ctrl.gridApi.grid.getVisibleRows().length }}
             sub(ng-show='users.length === 
$ctrl.gridApi.grid.getVisibleRows().length') all
-        div.ui-grid-settings-dateperiod
-            form(ng-form=form novalidate)
-                -var form = 'admin'
 
+        form.pull-right(ng-form=form novalidate)
+            -var form = 'admin'
+
+            button.btn.btn-primary(ng-click='$ctrl.exportCsv()' bs-tooltip 
data-title='Export table to csv') Export
+
+            .ui-grid-settings-dateperiod
                 +ignite-form-field-datepicker('Period:', 
'$ctrl.params.startDate', '"period"')
-                
-                button.btn.btn-primary(ng-click='$ctrl.exportCsv()' bs-tooltip 
data-title='Export table to csv') Export
+
+            .ui-grid-settings-filter
+                +ignite-form-field-text('Exclude:', 
'$ctrl.params.companiesExclude', '"exclude"', false, false, 'Exclude by company 
name...')
 
     .panel-collapse
         .grid.ui-grid--ignite(ui-grid='$ctrl.gridOptions' 
ui-grid-resize-columns ui-grid-selection ui-grid-exporter ui-grid-pinning)

http://git-wip-us.apache.org/repos/asf/ignite/blob/97c7ed7b/modules/web-console/frontend/app/components/ui-grid-settings/ui-grid-settings.scss
----------------------------------------------------------------------
diff --git 
a/modules/web-console/frontend/app/components/ui-grid-settings/ui-grid-settings.scss
 
b/modules/web-console/frontend/app/components/ui-grid-settings/ui-grid-settings.scss
index 3016488..bc16271 100644
--- 
a/modules/web-console/frontend/app/components/ui-grid-settings/ui-grid-settings.scss
+++ 
b/modules/web-console/frontend/app/components/ui-grid-settings/ui-grid-settings.scss
@@ -36,6 +36,40 @@
         cursor: pointer;
     }
 
+    .btn {
+        float: right;
+
+        line-height: 20px;
+        margin-right: 0;
+    }
+
+    &-filter {
+        float: right;
+
+        .ignite-form-field {
+            width: 260px;
+            margin-right: 10px;
+
+            &__label {
+            }
+
+            &__control {
+            }
+
+            &:nth-child(1) {
+                float: left;
+
+                .ignite-form-field__label {
+                    width: 30%;
+                }
+
+                .ignite-form-field__control {
+                    width: 70%;
+                }
+            }
+        }
+    }
+
     &-dateperiod {
         float: right;
 
@@ -61,10 +95,5 @@
                 }
             }
         }
-
-        .btn {
-            line-height: 20px;
-            margin-right: 0;
-        }
     }
 }

Reply via email to