From c21dcc67d0122cb1f8a811a1962b46c57f69f67c Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Sun, 26 May 2019 11:02:44 -0700 Subject: [PATCH] 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 Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- .../date-select/date-select.component.html | 52 ++++++++++--------- .../date-select/date-select.component.ts | 7 +-- .../share/fm-editor/fm-editor.component.html | 1 + .../app/staff/sandbox/sandbox.component.html | 8 +++ .../app/staff/sandbox/sandbox.component.ts | 9 ++++ 5 files changed, 48 insertions(+), 29 deletions(-) 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 @@ - -
- -
- + + {{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 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 @@ 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 @@ Are you sure you want to confirm {numThings, plural, =1 {this thing} other {these {{numThings}} things}}? + + + + 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 => { -- 2.43.2