From: Bill Erickson Date: Mon, 1 Apr 2019 16:47:02 +0000 (-0400) Subject: LP1822414 Ang date select readOnly & fixes X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=92ae4f263ac848d99fdba70779f8003c5cd0a780;p=working%2FEvergreen.git 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. Signed-off-by: Bill Erickson --- 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 575bbde5c8..6524606eb9 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,23 +1,29 @@ -
- -
- + + {{initialDate | formatValue:'timestamp'}} + + +
+ +
+ +
-
+ 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 625629026f..02d30e2def 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 @@ -9,7 +9,9 @@ import {NgbDateStruct} from '@ng-bootstrap/ng-bootstrap'; @Component({ selector: 'eg-date-select', - templateUrl: './date-select.component.html' + templateUrl: './date-select.component.html', + /* prevent the calendar mat icon from expanding the button */ + styles: ['.material-icons {font-size: 15px}'] }) export class DateSelectComponent implements OnInit { @@ -19,11 +21,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 aad65d15d6..1c44a565ec 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 @@ -40,6 +40,7 @@ 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 84e127e3c0..c5d6341d2f 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 @@ -152,3 +152,12 @@

PCRUD auto flesh and FormatService detection

Fingerprint: {{aMetarecord}}
+ + + + + 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 9b058cd5b1..bf11691616 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 @@ -33,6 +33,9 @@ export class SandboxComponent implements OnInit { @ViewChild('fmRecordEditor') private fmRecordEditor: FmRecordEditorComponent; + @ViewChild('bresvEditor') + private bresvEditor: FmRecordEditorComponent; + // @ViewChild('helloStr') private helloStr: StringComponent; gridDataSource: GridDataSource = new GridDataSource(); @@ -134,6 +137,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; } openEditor() {