From f27ed6fdad7d94c0420a350fd542a3180eec2eae Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 14 Aug 2019 16:45:20 -0400 Subject: [PATCH] LP1840050 FM Editor WIP Signed-off-by: Bill Erickson --- .../share/fm-editor/fm-editor-action.component.ts | 31 +++++++++++++++++++ .../app/share/fm-editor/fm-editor.component.html | 18 ++++++++++- .../src/app/share/fm-editor/fm-editor.component.ts | 35 ++++++++++++++++++++-- .../src/app/share/fm-editor/fm-editor.module.ts | 7 +++-- 4 files changed, 86 insertions(+), 5 deletions(-) create mode 100644 Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor-action.component.ts diff --git a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor-action.component.ts b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor-action.component.ts new file mode 100644 index 0000000000..298856d684 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor-action.component.ts @@ -0,0 +1,31 @@ +import {Component, Input, Output, EventEmitter, Host, OnInit} from '@angular/core'; +import {FmRecordEditorComponent} from './fm-editor.component'; + +@Component({ + selector: 'eg-fm-record-editor-action', + template: '' // no-op +}) + +export class FmRecordEditorActionComponent implements OnInit { + + // unique identifier + @Input() key: string; + + @Input() label: string; + + @Input() buttonCss = 'btn-outline-dark'; + + // Emits the 'key' of the clicked action. + @Output() actionClick: EventEmitter; + + @Input() disabled: boolean; + + constructor(@Host() private editor: FmRecordEditorComponent) { + this.actionClick = new EventEmitter(); + } + + ngOnInit() { + this.editor.actions.push(this); + } +} + 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 2621b3e948..afae0effb1 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 @@ -4,6 +4,11 @@ + + +