LP1840050 FM Editor WIP
authorBill Erickson <berickxx@gmail.com>
Wed, 14 Aug 2019 20:45:30 +0000 (16:45 -0400)
committerBill Erickson <berickxx@gmail.com>
Wed, 14 Aug 2019 20:45:30 +0000 (16:45 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html
Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts
Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.module.ts

index 2621b3e..768c95f 100644 (file)
                 [required]="field.isRequired()"
                 [entries]="field.linkedValues"
                 [asyncDataSource]="field.linkedValuesSource"
-                [startId]="record[field.name]()"
+                [selectedId]="record[field.name]()"
                 (onChange)="record[field.name]($event ? $event.id : null)">
               </eg-combobox>
             </ng-container>
     </form>
   </div>
   <div class="modal-footer">
+    <button type="button" class="btn btn-outline-dark" 
+      *ngFor="let action of actions" [disabled]="action.disabled"
+      (click)="action.actionClick.emit(action.key)">
+      {{action.label}}
+    </button>
     <ng-container *ngIf="isDialog()">
       <button type="button" class="btn btn-success" *ngIf="mode == 'view'"
         (click)="close()" i18n>Close</button>
index 674d348..95968eb 100644 (file)
@@ -11,6 +11,7 @@ import {StringComponent} from '@eg/share/string/string.component';
 import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
 import {ComboboxEntry} from '@eg/share/combobox/combobox.component';
 import {TranslateComponent} from '@eg/share/translate/translate.component';
+import {FmRecordEditorActionComponent} from './fm-editor-action.component';
 
 
 interface CustomFieldTemplate {
@@ -195,6 +196,8 @@ export class FmRecordEditorComponent
         return this._record;
     }
 
+    actions: FmRecordEditorActionComponent[] = [];
+
     initDone: boolean;
 
     // Comma-separated list of field names defining the order in which
index 7be4cf8..6e9c5c3 100644 (file)
@@ -4,11 +4,13 @@ import {CommonWidgetsModule} from '@eg/share/common-widgets.module';
 import {StringModule} from '@eg/share/string/string.module';
 import {TranslateModule} from '@eg/share/translate/translate.module';
 import {FmRecordEditorComponent} from './fm-editor.component';
+import {FmRecordEditorActionComponent} from './fm-editor-action.component';
 
 
 @NgModule({
     declarations: [
-        FmRecordEditorComponent
+        FmRecordEditorComponent,
+        FmRecordEditorActionComponent
     ],
     imports: [
         EgCommonModule,
@@ -17,7 +19,8 @@ import {FmRecordEditorComponent} from './fm-editor.component';
         CommonWidgetsModule
     ],
     exports: [
-        FmRecordEditorComponent
+        FmRecordEditorComponent,
+        FmRecordEditorActionComponent
     ],
     providers: [
     ]