[open-ils-commits] [GIT] Evergreen ILS branch master updated. 0e18c2fe13b72c9b91f9b4dbcaf883c70cae2d4b

Evergreen Git git at git.evergreen-ils.org
Fri Mar 22 16:13:57 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, master has been updated
       via  0e18c2fe13b72c9b91f9b4dbcaf883c70cae2d4b (commit)
       via  84d627cc3a74c1f2a6f37ce985ae5f62693f7b98 (commit)
       via  aa0b57799eebdd19b1996a84e4792f8eefc13a51 (commit)
       via  89948f54cdecb41ee126b96d2404b55a47264dea (commit)
      from  e685683c315532087da35169589c06c8f23a61d2 (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 0e18c2fe13b72c9b91f9b4dbcaf883c70cae2d4b
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 cfb01e5fa3..cd6e706660 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
@@ -180,9 +180,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));
+                    }
                 }
             );
         };
@@ -326,9 +328,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 84d627cc3a74c1f2a6f37ce985ae5f62693f7b98
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 001836daa2..cfb01e5fa3 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
@@ -163,13 +163,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 aa0b57799eebdd19b1996a84e4792f8eefc13a51
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 8cf50709c1..44e407b862 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 03ba326894..001836daa2 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
@@ -69,6 +69,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;
@@ -177,7 +179,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));
+                }
             );
         };
 
@@ -320,7 +325,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 89948f54cdecb41ee126b96d2404b55a47264dea
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 0fc5c44b51..8cf50709c1 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 80fd2fdf6c..03ba326894 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
@@ -75,6 +75,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;
@@ -153,20 +154,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(
@@ -309,6 +311,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