13ef1799a89ea8915c981cfdf2c7cffe58fb82e8
[working/Evergreen.git] /
1 import {Component} from '@angular/core';
2 import {DialogComponent} from '@eg/share/dialog/dialog.component';
3 import {IdlObject} from '@eg/core/idl.service';
4 import {NgbModal} from '@ng-bootstrap/ng-bootstrap';
5
6 @Component({
7   selector: 'eg-admin-edit-org-unit-setting-dialog',
8   templateUrl: './edit-org-unit-setting-dialog.component.html'
9 })
10
11 export class EditOuSettingDialogComponent extends DialogComponent {
12
13     // What OU Setting we're editing
14     entry: any = {};
15     entryValue: any;
16     entryContext: IdlObject;
17     linkedFieldOptions: IdlObject[];
18
19     constructor(
20         private modal: NgbModal
21     ) {
22         super(modal);
23         if (!this.entry) {
24             this.entryValue = null;
25             this.entryContext = null;
26             this.linkedFieldOptions = null;
27         }
28     }
29
30     inputType() {
31         return this.entry.dataType;
32     }
33
34     setInputValue(inputValue) {
35         this.entryValue = inputValue;
36     }
37
38     getFieldClass() {
39         return this.entry.fm_class;
40     }
41
42     delete() {
43         this.close({setting: {[this.entry.name]: null}, context: this.entryContext});
44     }
45
46     update() {
47         this.close({setting: {[this.entry.name]: this.entryValue}, context: this.entryContext});
48     }
49 }
50
51