[open-ils-commits] [GIT] Evergreen ILS branch rel_3_3 updated. 0db57c033a40f8399ffd16901e6e811c87ebfe5b

Evergreen Git git at git.evergreen-ils.org
Wed Jul 31 16:15:32 EDT 2019


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_3_3 has been updated
       via  0db57c033a40f8399ffd16901e6e811c87ebfe5b (commit)
      from  ce1132b18492d2c0615f667c23134daede7d92ce (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 0db57c033a40f8399ffd16901e6e811c87ebfe5b
Author: Bill Erickson <berickxx at gmail.com>
Date:   Tue Jun 25 10:44:57 2019 -0400

    LP1832148 Clear selection for deleted grid rows
    
    Ignore rows which are no longer present in the grid when displaying the
    "X selected" rows label along the top of the Angular grid.
    
    Additionally, teach the grid to clear selected indexes for rows that are
    no longer present for a bit of low-impact release of memory.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>

diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.html b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.html
index be7b19cb7e..d75ef88b60 100644
--- a/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.html
+++ b/Open-ILS/src/eg2/src/app/share/grid/grid-toolbar.component.html
@@ -30,7 +30,7 @@
   <div class="flex-1"></div>
 
   <div class="font-sm font-italic d-flex flex-column-reverse mr-2">
-    {{gridContext.rowSelector.selected().length}} selected
+    {{gridContext.getSelectedRows().length}} selected
   </div>
   <div ngbDropdown class="mr-1" placement="bottom-right">
     <button ngbDropdownToggle [disabled]="!gridContext.toolbarActions.length"
diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid.ts b/Open-ILS/src/eg2/src/app/share/grid/grid.ts
index ae681694d8..e7c7f711b6 100644
--- a/Open-ILS/src/eg2/src/app/share/grid/grid.ts
+++ b/Open-ILS/src/eg2/src/app/share/grid/grid.ts
@@ -383,8 +383,11 @@ export class GridRowSelector {
     }
 
     // Returns the list of selected index values.
-    // in some contexts (template checkboxes) the value for an index is
+    // In some contexts (template checkboxes) the value for an index is
     // set to false to deselect instead of having it removed (via deselect()).
+    // NOTE GridRowSelector has no knowledge of when a row is no longer
+    // present in the grid.  Use GridContext.getSelectedRows() to get 
+    // list of selected rows that are still present in the grid.
     selected() {
         return Object.keys(this.indexes).filter(
             ind => Boolean(this.indexes[ind]));
@@ -640,14 +643,22 @@ export class GridContext {
 
     // Returns all selected rows, regardless of whether they are
     // currently visible in the grid display.
+    // De-selects previously selected rows which are no longer
+    // present in the grid.
     getSelectedRows(): any[] {
         const selected = [];
+        const deleted = [];
+
         this.rowSelector.selected().forEach(index => {
             const row = this.getRowByIndex(index);
             if (row) {
                 selected.push(row);
+            } else {
+                deleted.push(index);
             }
         });
+
+        this.rowSelector.deselect(deleted);
         return selected;
     }
 

-----------------------------------------------------------------------

Summary of changes:
 .../src/eg2/src/app/share/grid/grid-toolbar.component.html  |  2 +-
 Open-ILS/src/eg2/src/app/share/grid/grid.ts                 | 13 ++++++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list