LP1840050 FM Editor WIP
authorBill Erickson <berickxx@gmail.com>
Fri, 16 Aug 2019 19:44:37 +0000 (15:44 -0400)
committerBill Erickson <berickxx@gmail.com>
Fri, 16 Aug 2019 19:44:37 +0000 (15:44 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor-action.component.html [deleted file]
Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor-action.component.ts
Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html

diff --git a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor-action.component.html b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor-action.component.html
deleted file mode 100644 (file)
index 139597f..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
index fbc718f..ab52b40 100644 (file)
@@ -1,4 +1,4 @@
-import {Component, Input, Output, EventEmitter, Host} from '@angular/core';
+import {Component, Input, Output, EventEmitter, Host, OnInit} from '@angular/core';
 import {FmRecordEditorComponent} from './fm-editor.component';
 
 @Component({
@@ -6,13 +6,15 @@ import {FmRecordEditorComponent} from './fm-editor.component';
   template: '<ng-template></ng-template>' // no-op
 })
 
-export class FmRecordEditorActionComponent {
+export class FmRecordEditorActionComponent implements OnInit {
 
     // unique identifier
     @Input() key: string;
 
     @Input() label: string;
 
+    @Input() buttonCss: string = 'btn-outline-dark';
+
     // Emits the 'key' of the clicked action.
     @Output() actionClick: EventEmitter<string>;
 
@@ -20,6 +22,9 @@ export class FmRecordEditorActionComponent {
 
     constructor(@Host() private editor: FmRecordEditorComponent) {
         this.actionClick = new EventEmitter<string>();
+    }
+
+    ngOnInit() {
         this.editor.actions.push(this);
     }
 }
index ecde681..afae0ef 100644 (file)
     </form>
   </div>
   <div class="modal-footer">
-    <button type="button" class="btn btn-outline-dark" 
+    <button type="button" class="btn {{action.buttonCss}}"
       *ngFor="let action of actions" [disabled]="action.disabled"
-      (click)="action.actionClick.emit(action.key)">
+      (click)="action.actionClick.emit({action: action.key, record: record})">
       {{action.label}}
     </button>
     <ng-container *ngIf="isDialog()">
     </ng-container>
 
     <ng-container *ngIf="showDelete && mode != 'view'">
-    <button type="button" class="btn btn-warning" (click)="remove()"
-      [disabled]="record && record.isnew()" i18n>Delete</button>
+      <button type="button" class="btn btn-warning" (click)="remove()"
+        [disabled]="record && record.isnew()" i18n>Delete</button>
     </ng-container>
 
     <button type="button" class="btn btn-info"