@Input() hideBanner: boolean;
// do not close dialog on error saving record
- @Input() remainOpenOnError: false;
+ @Input() remainOpenOnError = false;
+
+ // Avoid making any pcrud calls. Instead return the modified object
+ // to the caller via recordSaved Output and dialog close().
+ @Input() inPlaceMode = false;
// Emit the modified object when the save action completes.
@Output() recordSaved = new EventEmitter<IdlObject>();
this.preSave(this.mode, recToSave);
}
this.convertDatatypesToIdl(recToSave);
+
+ if (this.inPlaceMode) {
+ this.recordSaved.emit(recToSave);
+ if (this.fmEditForm) {
+ this.fmEditForm.form.markAsPristine();
+ }
+ if (this.isDialog()) {
+ this.record = undefined;
+ this.close(recToSave);
+ }
+ return;
+ }
+
this.pcrud[this.mode]([recToSave]).toPromise().then(
result => {
this.recordSaved.emit(result);
<eg-fm-record-editor #editor
idlClass="sipacc" [mode]="createMode ? 'create' : 'update'"
- hiddenFields="id" displayMode="inline"
+ hiddenFields="id" displayMode="inline" [inPlaceMode]="true"
fieldOrder="sip_username,sip_password,setting_group,usr,workstation,transient,activity_who,enabled"
[fieldOptions]="{
setting_group:{customTemplate:{template:grpTemplate}},
import {map, tap, switchMap, catchError} from 'rxjs/operators';
import {IdlService, IdlObject} from '@eg/core/idl.service';
import {OrgService} from '@eg/core/org.service';
+import {NetService} from '@eg/core/net.service';
import {AuthService} from '@eg/core/auth.service';
import {PcrudService} from '@eg/core/pcrud.service';
import {ToastService} from '@eg/share/toast/toast.service';
private route: ActivatedRoute,
private router: Router,
private idl: IdlService,
+ private net: NetService,
private pcrud: PcrudService
) {}
};
}
-
fetchGroups() {
this.pcrud.retrieveAll('sipsetg',
{order_by: {sipsetg: 'label'}}, {atomic: true})
);
}
- accountSaved(result) {
+ accountSaved(account) {
+ // Create/modify the account via API
+
+ /*
if (this.createMode) {
this.router.navigate(
[`/staff/admin/server/sip/account/${result.id()}`]);
} else {
this.refreshAccount();
}
+ */
}
editFirstSetting(rows: any) {