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

Evergreen Git git at git.evergreen-ils.org
Wed Jul 31 11:00:10 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  bb2a65d91c4ad803efd45c2907307b3b3c544813 (commit)
       via  c21dcc67d0122cb1f8a811a1962b46c57f69f67c (commit)
       via  bd0fd68d7363d5ab81b0453cfbc6874b9477875f (commit)
      from  25d9c5ddc03f673b87f1aaff788a79dff92ba075 (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 bb2a65d91c4ad803efd45c2907307b3b3c544813
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Wed Jul 31 10:55:06 2019 -0400

    LP#1822414: (follow-up) remove au-linked fields sandbox editDialog
    
    Otherwise, the drop-downs for the User and Capture Staff fields
    will attempt to fetch all user IDs from the database, which would
    be awkward if attempted on a large database.
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.css b/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.css
index 277f1314ce..e4ab7a0438 100644
--- a/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.css
+++ b/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.css
@@ -1,3 +1,6 @@
 .eg-date-select {
     max-width: 11em;
 }
+.material-icons {
+    font-size: 15px;
+}
diff --git a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html
index a4af3368ba..f6df154702 100644
--- a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html
+++ b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html
@@ -250,10 +250,12 @@
   <span i18n>Are you sure you want to confirm {numThings, plural, =1 {this thing} other {these {{numThings}} things}}?</span>
 </ng-template>
 
-<eg-fm-record-editor #bresvEditor
-  idlClass="bresv"
-  readonlyFields="cancel_time">
-</eg-fm-record-editor>
-<button class="btn btn-info" (click)="bresvEditor.open({})">
-  Test Readonly Date
-</button>
+<div class="row">
+  <eg-fm-record-editor #bresvEditor
+    idlClass="bresv"
+    hiddenFields="capture_staff,usr" readonlyFields="cancel_time">
+  </eg-fm-record-editor>
+  <button class="btn btn-info" (click)="bresvEditor.open({})">
+    Test Readonly Date
+  </button>
+</div>

commit c21dcc67d0122cb1f8a811a1962b46c57f69f67c
Author: Bill Erickson <berickxx at gmail.com>
Date:   Sun May 26 11:02:44 2019 -0700

    LP1822414 Ang date select readOnly & fixes
    
    Adds an @Input() readOnly field to eg-date-select.  When set, the date
    value will be displayed as plain text - no widget.
    
    Teach the eg-fm-editor to pass the readOnly flag to the eg-date-select.
    
    Includes sandbox example.
    
    Fixes a display issue where the date select calendar button was bigger
    than the paired input group adding text input, because the material
    icon was too big.
    
    2019-07-31 rebasing note: the style added in the original patch was
    moved to data-select.component.css.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.html b/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.html
index 41425339a3..0ff48314c1 100644
--- a/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.html
+++ b/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.html
@@ -1,25 +1,29 @@
-
-<div class="input-group eg-date-select form-validated">
-  <input 
-    class="form-control"
-    ngbDatepicker
-    #datePicker="ngbDatepicker"
-    [attr.id]="domId.length ? domId : null"
-    placeholder="yyyy-mm-dd"
-    class="form-control"
-    container="body"
-    name="{{fieldName}}"
-    [disabled]="_disabled"
-    [required]="required"
-    [(ngModel)]="current"
-    (keyup.enter)="onDateEnter()"
-    (dateSelect)="onDateSelect($event)"/>
-  <div class="input-group-append">
-    <button class="btn btn-outline-secondary" [disabled]="_disabled"
-      (click)="datePicker.toggle()" type="button">
-      <span title="Select Date" i18n-title
-        class="material-icons mat-icon-in-button">calendar_today</span>
-    </button>
+<ng-container *ngIf="readOnly">
+  {{initialDate | formatValue:'timestamp'}}
+</ng-container>
+<ng-container *ngIf="!readOnly">
+  <div class="input-group eg-date-select form-validated">
+    <input 
+      class="form-control"
+      type="text"
+      ngbDatepicker
+      #datePicker="ngbDatepicker"
+      [attr.id]="domId.length ? domId : null"
+      placeholder="yyyy-mm-dd"
+      class="form-control"
+      container="body"
+      name="{{fieldName}}"
+      [disabled]="disabled"
+      [required]="required"
+      [(ngModel)]="current"
+      (keyup.enter)="onDateEnter()"
+      (dateSelect)="onDateSelect($event)"/>
+    <div class="input-group-append">
+      <button class="btn btn-outline-secondary" [disabled]="disabled"
+        (click)="datePicker.toggle()" type="button">
+        <span title="Select Date" i18n-title
+          class="material-icons mat-icon-in-button">calendar_today</span>
+      </button>
+    </div>
   </div>
-</div>
-
+</ng-container>
diff --git a/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.ts b/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.ts
index 077058a6e8..d877300677 100644
--- a/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.ts
+++ b/Open-ILS/src/eg2/src/app/share/date-select/date-select.component.ts
@@ -20,11 +20,8 @@ export class DateSelectComponent implements OnInit {
     @Input() required: boolean;
     @Input() fieldName: string;
     @Input() domId = '';
-
-    _disabled: boolean;
-    @Input() set disabled(d: boolean) {
-        this._disabled = d;
-    }
+    @Input() disabled: boolean;
+    @Input() readOnly: boolean;
 
     current: NgbDateStruct;
 
diff --git a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html
index 5db749af35..ad0c0b77a3 100644
--- a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html
+++ b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html
@@ -48,6 +48,7 @@
             <ng-container *ngSwitchCase="'timestamp'">
               <eg-date-select
                 domId="{{idPrefix}}-{{field.name}}"
+                [readOnly]="field.readOnly"
                 (onChangeAsIso)="record[field.name]($event)"
                 initialIso="{{record[field.name]()}}">
               </eg-date-select>
diff --git a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html
index 4ff0950751..a4af3368ba 100644
--- a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html
+++ b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html
@@ -249,3 +249,11 @@
 <ng-template #confirmMsg>
   <span i18n>Are you sure you want to confirm {numThings, plural, =1 {this thing} other {these {{numThings}} things}}?</span>
 </ng-template>
+
+<eg-fm-record-editor #bresvEditor
+  idlClass="bresv"
+  readonlyFields="cancel_time">
+</eg-fm-record-editor>
+<button class="btn btn-info" (click)="bresvEditor.open({})">
+  Test Readonly Date
+</button>
diff --git a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts
index d2d4ead1d9..d3410b6d05 100644
--- a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts
+++ b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts
@@ -40,6 +40,10 @@ export class SandboxComponent implements OnInit {
 
     public numThings = 0;
 
+    @ViewChild('bresvEditor')
+    private bresvEditor: FmRecordEditorComponent;
+
+
     // @ViewChild('helloStr') private helloStr: StringComponent;
 
     gridDataSource: GridDataSource = new GridDataSource();
@@ -166,6 +170,11 @@ export class SandboxComponent implements OnInit {
                 idlField: 'metarecord'
             });
         });
+
+        const b = this.idl.create('bresv');
+        b.cancel_time('2019-03-25T11:07:59-0400');
+        this.bresvEditor.mode = 'create';
+        this.bresvEditor.record = b;
     }
 
     sbChannelHandler = msg => {

commit bd0fd68d7363d5ab81b0453cfbc6874b9477875f
Author: Bill Erickson <berickxx at gmail.com>
Date:   Sun May 26 11:01:40 2019 -0700

    LP1822414 Angular format service formatValue pipe
    
    Create a pipe version of FormatService.transform() function so strings
    may be generated from fields directly in templates.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Jane Sandberg <sandbej at linnbenton.edu>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/eg2/src/app/core/format.service.ts b/Open-ILS/src/eg2/src/app/core/format.service.ts
index d2b2ce51e2..b0e8072a53 100644
--- a/Open-ILS/src/eg2/src/app/core/format.service.ts
+++ b/Open-ILS/src/eg2/src/app/core/format.service.ts
@@ -108,6 +108,10 @@ export class FormatService {
 
             case 'timestamp':
                 const date = new Date(value);
+                if (Number.isNaN(date.getTime())) {
+                    console.error('Invalid date in format service', value);
+                    return '';
+                }
                 let fmt = this.dateFormat || 'shortDate';
                 if (params.datePlusTime) {
                     fmt = this.dateTimeFormat || 'short';

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

Summary of changes:
 Open-ILS/src/eg2/src/app/core/format.service.ts    |  4 ++
 .../share/date-select/date-select.component.css    |  3 ++
 .../share/date-select/date-select.component.html   | 52 ++++++++++++----------
 .../app/share/date-select/date-select.component.ts |  7 +--
 .../app/share/fm-editor/fm-editor.component.html   |  1 +
 .../src/app/staff/sandbox/sandbox.component.html   | 10 +++++
 .../eg2/src/app/staff/sandbox/sandbox.component.ts |  9 ++++
 7 files changed, 57 insertions(+), 29 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list