[open-ils-commits] [GIT] Evergreen ILS branch rel_3_2 updated. 52ae1b1d5adbba0c860db59c06c84b19541e3fc2

Evergreen Git git at git.evergreen-ils.org
Fri Mar 22 16:16:46 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_2 has been updated
       via  52ae1b1d5adbba0c860db59c06c84b19541e3fc2 (commit)
       via  4a054a7ef822f1094e28f8c0fc3faacd77bd6df4 (commit)
       via  4574eaf3442ee4dc9b0cde6e6e2d941ce9c17eef (commit)
       via  d794c5b848a6007a134ac8782309d87be5ed5e84 (commit)
      from  baabffdfc14c2a648c503cf6fe26df07a694bcaf (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 52ae1b1d5adbba0c860db59c06c84b19541e3fc2
Author: Bill Erickson <berickxx at gmail.com>
Date:   Wed Jan 23 17:30:26 2019 -0500

    LP1807461 Admin page avoid errors on dialog dismissal
    
    Add support to the base DialogComponent class for passing information to
    the caller via the reject handler about whether a dialog was dismissed
    via user interface interaction (body click, esc key, cross click, cancel
    button) or for some other reason, presumably an error.
    
    Teach the generic admin page to avoid toasting errors when an edit or
    create dialog is dismissed via UI.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/src/eg2/src/app/share/dialog/dialog.component.ts b/Open-ILS/src/eg2/src/app/share/dialog/dialog.component.ts
index 3ffd5db069..b7531a2a20 100644
--- a/Open-ILS/src/eg2/src/app/share/dialog/dialog.component.ts
+++ b/Open-ILS/src/eg2/src/app/share/dialog/dialog.component.ts
@@ -7,6 +7,13 @@ import {NgbModal, NgbModalRef, NgbModalOptions} from '@ng-bootstrap/ng-bootstrap
  * at the root of the template (see ConfirmDialogComponent).
  */
 
+export interface DialogRejectionResponse {
+    // Did the user simply close the dialog without performing an action.
+    dismissed?: boolean;
+    // Relays error, etc. messages from the dialog handler to the caller.
+    message?: string;
+}
+
 @Component({
     selector: 'eg-dialog',
     template: '<ng-template></ng-template>'
@@ -55,9 +62,26 @@ export class DialogComponent implements OnInit {
                     resolve(result);
                     this.modalRef = null;
                 },
+
                 (result) => {
+                    // NgbModal creates some result values for us, which
+                    // are outside of our control.  Other dismissal
+                    // reasons are agreed upon by implementing subclasses.
                     console.debug('dialog closed with ' + result);
-                    reject(result);
+
+                    const dismissed = (
+                           result === 0 // body click
+                        || result === 1 // Esc key
+                        || result === 'canceled' // Cancel button
+                        || result === 'cross_click' // modal top-right X
+                    );
+
+                    const rejection: DialogRejectionResponse = {
+                        dismissed: dismissed,
+                        message: result
+                    };
+
+                    reject(rejection);
                     this.modalRef = null;
                 }
             );
diff --git a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts
index 751ba75d64..ff47237bf5 100644
--- a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts
+++ b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts
@@ -177,9 +177,11 @@ export class AdminPageComponent implements OnInit {
                         .then(str => this.toast.success(str));
                     this.grid.reload();
                 },
-                err => {
-                    this.createErrString.current()
-                        .then(str => this.toast.danger(str));
+                rejection => {
+                    if (!rejection.dismissed) {
+                        this.createErrString.current()
+                            .then(str => this.toast.danger(str));
+                    }
                 }
             );
         };
@@ -323,9 +325,11 @@ export class AdminPageComponent implements OnInit {
                     .then(str => this.toast.success(str));
                 this.grid.reload();
             },
-            err => {
-                this.updateFailedString.current()
-                    .then(str => this.toast.danger(str));
+            rejection => {
+                if (!rejection.dismissed) {
+                    this.updateFailedString.current()
+                        .then(str => this.toast.danger(str));
+                }
             }
         );
     }

commit 4a054a7ef822f1094e28f8c0fc3faacd77bd6df4
Author: Bill Erickson <berickxx at gmail.com>
Date:   Wed Jan 23 16:13:52 2019 -0500

    LP1807458 Eg2 grid Edit option lint repairs
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts
index 2ffcfa7409..751ba75d64 100644
--- a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts
+++ b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts
@@ -160,13 +160,14 @@ export class AdminPageComponent implements OnInit {
 
             // Edit each IDL thing one at a time
             const editOneThing = (thing: IdlObject) => {
-                if (!thing) return;
+                if (!thing) { return; }
 
                 this.showEditDialog(thing).then(
                     () => editOneThing(idlThings.shift()));
-            }
+            };
 
-            editOneThing(idlThings.shift()); };
+            editOneThing(idlThings.shift());
+        };
 
         this.createNew = () => {
             this.editDialog.mode = 'create';

commit 4574eaf3442ee4dc9b0cde6e6e2d941ce9c17eef
Author: Bill Erickson <berickxx at gmail.com>
Date:   Mon Dec 10 15:06:23 2018 -0500

    LP#1807461 FM-editor show danger toasts when create/update fails
    
    Display a danger toast when update or create attempts fail in the
    Angular fieldmapper editor dialog.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html
index ee9a175976..695a54929e 100644
--- a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html
+++ b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html
@@ -1,9 +1,16 @@
 <ng-template #successStrTmpl i18n>{{idlClassDef.label}} Update Succeeded</ng-template>
 <eg-string #successString [template]="successStrTmpl"></eg-string>
 
+<ng-template #updateFailedStrTmpl i18n>Update of {{idlClassDef.label}} failed</ng-template>
+<eg-string #updateFailedString [template]="updateFailedStrTmpl"></eg-string>
+
+
 <ng-template #createStrTmpl i18n>{{idlClassDef.label}} Succeessfully Created</ng-template>
 <eg-string #createString [template]="createStrTmpl"></eg-string>
 
+<ng-template #createErrStrTmpl i18n>Failed to create new {{idlClassDef.label}}</ng-template>
+<eg-string #createErrString [template]="createErrStrTmpl"></eg-string>
+
 <ng-container *ngIf="orgField">
   <div class="d-flex">
     <div>
diff --git a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts
index 6e865f1702..2ffcfa7409 100644
--- a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts
+++ b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts
@@ -66,6 +66,8 @@ export class AdminPageComponent implements OnInit {
     @ViewChild('editDialog') editDialog: FmRecordEditorComponent;
     @ViewChild('successString') successString: StringComponent;
     @ViewChild('createString') createString: StringComponent;
+    @ViewChild('createErrString') createErrString: StringComponent;
+    @ViewChild('updateFailedString') updateFailedString: StringComponent;
     @ViewChild('translator') translator: TranslateComponent;
 
     idlClassDef: any;
@@ -174,7 +176,10 @@ export class AdminPageComponent implements OnInit {
                         .then(str => this.toast.success(str));
                     this.grid.reload();
                 },
-                err => {}
+                err => {
+                    this.createErrString.current()
+                        .then(str => this.toast.danger(str));
+                }
             );
         };
 
@@ -317,7 +322,10 @@ export class AdminPageComponent implements OnInit {
                     .then(str => this.toast.success(str));
                 this.grid.reload();
             },
-            err => {}
+            err => {
+                this.updateFailedString.current()
+                    .then(str => this.toast.danger(str));
+            }
         );
     }
 

commit d794c5b848a6007a134ac8782309d87be5ed5e84
Author: Bill Erickson <berickxx at gmail.com>
Date:   Mon Dec 10 13:09:36 2018 -0500

    LP#1807458 Angular admin grid Edit Selected option
    
    Adds a new "Edit Selected" action to the "Actions for Selected Items"
    menu in the general purpose admin grid.  This only visibly affects the
    ACQ admin grids at time of writing, but applies to all auto-generated
    admin grids.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html
index 194f06b515..ee9a175976 100644
--- a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html
+++ b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html
@@ -49,6 +49,8 @@
   <eg-grid-toolbar-button [disabled]="translatableFields.length == 0" 
     label="Apply Translations" i18n-label [action]="translate">
   </eg-grid-toolbar-button>
+  <eg-grid-toolbar-action label="Edit Selected" i18n-label [action]="editSelected">
+  </eg-grid-toolbar-action>
   <eg-grid-toolbar-action label="Delete Selected" i18n-label [action]="deleteSelected">
   </eg-grid-toolbar-action>
 </eg-grid>
diff --git a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts
index be4452b1b3..6e865f1702 100644
--- a/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts
+++ b/Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts
@@ -72,6 +72,7 @@ export class AdminPageComponent implements OnInit {
     pkeyField: string;
     createNew: () => void;
     deleteSelected: (rows: IdlObject[]) => void;
+    editSelected: (rows: IdlObject[]) => void;
 
     // True if any columns on the object support translations
     translateRowIdx: number;
@@ -150,20 +151,21 @@ export class AdminPageComponent implements OnInit {
 
         // TODO: pass the row activate handler via the grid markup
         this.grid.onRowActivate.subscribe(
-            (idlThing: IdlObject) => {
-                this.editDialog.mode = 'update';
-                this.editDialog.recId = idlThing[this.pkeyField]();
-                this.editDialog.open({size: this.dialogSize}).then(
-                    ok => {
-                        this.successString.current()
-                            .then(str => this.toast.success(str));
-                        this.grid.reload();
-                    },
-                    err => {}
-                );
-            }
+            (idlThing: IdlObject) => this.showEditDialog(idlThing)
         );
 
+        this.editSelected = (idlThings: IdlObject[]) => {
+
+            // Edit each IDL thing one at a time
+            const editOneThing = (thing: IdlObject) => {
+                if (!thing) return;
+
+                this.showEditDialog(thing).then(
+                    () => editOneThing(idlThings.shift()));
+            }
+
+            editOneThing(idlThings.shift()); };
+
         this.createNew = () => {
             this.editDialog.mode = 'create';
             this.editDialog.open({size: this.dialogSize}).then(
@@ -306,6 +308,19 @@ export class AdminPageComponent implements OnInit {
         return this.contextOrg && this.contextOrg.children().length === 0;
     }
 
+    showEditDialog(idlThing: IdlObject) {
+        this.editDialog.mode = 'update';
+        this.editDialog.recId = idlThing[this.pkeyField]();
+        return this.editDialog.open({size: this.dialogSize}).then(
+            ok => {
+                this.successString.current()
+                    .then(str => this.toast.success(str));
+                this.grid.reload();
+            },
+            err => {}
+        );
+    }
+
 }
 
 

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

Summary of changes:
 .../eg2/src/app/share/dialog/dialog.component.ts   | 26 ++++++++++-
 .../share/admin-page/admin-page.component.html     |  9 ++++
 .../staff/share/admin-page/admin-page.component.ts | 54 ++++++++++++++++------
 3 files changed, 75 insertions(+), 14 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list