From eb7cd332c344b2ed6ef7679d86c9e2f1fd1e427a Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 7 Nov 2017 15:32:33 -0500 Subject: [PATCH] LP#1730752 Webstaff grid column batch config dialog Adds a new "Manage Columns" grid action which opens a batch grid column configuration dialog. In the dialog, users can show/hide multiple columns at once. The column position actions (left/right/far-left/far-right) and sort priority settings have also been moved to this new UI. The existing 'Configure Columns' action has been renamed to 'Managed Column Widths' and now only supports making columns wider and narrower. Signed-off-by: Bill Erickson Signed-off-by: Kathy Lussier --- .../src/templates/staff/css/style.css.tt2 | 17 +++++ .../src/templates/staff/share/t_autogrid.tt2 | 45 +++---------- .../templates/staff/share/t_grid_columns.tt2 | 64 +++++++++++++++++++ .../web/js/ui/default/staff/services/grid.js | 25 +++++++- 4 files changed, 112 insertions(+), 39 deletions(-) create mode 100644 Open-ILS/src/templates/staff/share/t_grid_columns.tt2 diff --git a/Open-ILS/src/templates/staff/css/style.css.tt2 b/Open-ILS/src/templates/staff/css/style.css.tt2 index 74cf439656..b20f720244 100644 --- a/Open-ILS/src/templates/staff/css/style.css.tt2 +++ b/Open-ILS/src/templates/staff/css/style.css.tt2 @@ -473,6 +473,23 @@ table.list tr.selected td { /* deprecated? */ height: 25px; } +.eg-grid-columns-modal-body { + max-height: 400px; + overflow: scroll; +} + +.eg-grid-columns-modal-body .row { + padding: 2px 0px 2px 0px; + border-bottom: 1px solid #aaa; +} + +.eg-grid-columns-modal-body .visible { + color: rgb(51, 51, 51); + background-color: rgb(201, 221, 225); + border-bottom: 1px solid #888; +} + + eg-grid-field { display: none; } diff --git a/Open-ILS/src/templates/staff/share/t_autogrid.tt2 b/Open-ILS/src/templates/staff/share/t_autogrid.tt2 index e8f94d77bd..941aa63086 100644 --- a/Open-ILS/src/templates/staff/share/t_autogrid.tt2 +++ b/Open-ILS/src/templates/staff/share/t_autogrid.tt2 @@ -158,9 +158,15 @@
    +
  • + + + [% l('Manage Columns') %] + +
  • - - [% l('Configure Columns') %] + + [% l('Manage Column Widths') %]
  • @@ -253,11 +259,6 @@
    [% l('Expand') %]
    [% l('Shrink') %]
    -
    [% l('Left') %]
    -
    [% l('Right') %]
    -
    [% l('Far Left') %]
    -
    [% l('Far Right') %]
    -
    [% l('Sort') %]
    -
    - - - -
    -
    - - - -
    -
    - - - -
    -
    - - - -
    -
    -
    - -
    -
    diff --git a/Open-ILS/src/templates/staff/share/t_grid_columns.tt2 b/Open-ILS/src/templates/staff/share/t_grid_columns.tt2 new file mode 100644 index 0000000000..4393446140 --- /dev/null +++ b/Open-ILS/src/templates/staff/share/t_grid_columns.tt2 @@ -0,0 +1,64 @@ +
    + + + +
    diff --git a/Open-ILS/web/js/ui/default/staff/services/grid.js b/Open-ILS/web/js/ui/default/staff/services/grid.js index fab8679d69..e85171dce4 100644 --- a/Open-ILS/web/js/ui/default/staff/services/grid.js +++ b/Open-ILS/web/js/ui/default/staff/services/grid.js @@ -119,10 +119,10 @@ angular.module('egGridMod', controller : [ '$scope','$q','egCore','egGridFlatDataProvider','$location', 'egGridColumnsProvider','$filter','$window','$sce','$timeout', - 'egProgressDialog', + 'egProgressDialog','$uibModal', function($scope, $q , egCore, egGridFlatDataProvider , $location, egGridColumnsProvider , $filter , $window , $sce , $timeout, - egProgressDialog) { + egProgressDialog , $uibModal) { var grid = this; @@ -1077,6 +1077,27 @@ angular.module('egGridMod', }); } + $scope.showColumnDialog = function() { + return $uibModal.open({ + templateUrl: './share/t_grid_columns', + backdrop: 'static', + size : 'lg', + controller: ['$scope', '$uibModalInstance', + function($dialogScope, $uibModalInstance) { + $dialogScope.modifyColumnPos = $scope.modifyColumnPos; + $dialogScope.disableMultiSort = $scope.disableMultiSort; + $dialogScope.columns = $scope.columns; + $dialogScope.toggle = function(col) { + col.visible = !Boolean(col.visible); + } + $dialogScope.ok = $dialogScope.cancel = function() { + $uibModalInstance.close() + } + } + ] + }); + }, + // generates CSV for the currently visible grid contents grid.generateCSV = function() { return grid.getAllItemsAsText().then(function(text_items) { -- 2.43.2