</eg-patron-secondary-groups>
<eg-patron-barcodes #barcodesDialog [patron]="patron"></eg-patron-barcodes>
+<eg-alert-dialog #addrAlert
+ i18n-dialogTitle dialogTitle="Address Alert">
+</eg-alert-dialog>
+
<div class="row" *ngIf="loading">
<div class="col-lg-6 offset-lg-3">
<eg-progress-inline></eg-progress-inline>
import {ServerStoreService} from '@eg/core/server-store.service';
import {EditToolbarComponent, VisibilityLevel} from './edit-toolbar.component';
import {PatronSearchFieldSet} from '@eg/staff/share/patron/search.component';
+import {AlertDialogComponent} from '@eg/share/dialog/alert.component';
const COMMON_USER_SETTING_TYPES = [
'circ.holds_behind_desk',
private profileSelect: ProfileSelectComponent;
@ViewChild('secondaryGroupsDialog')
private secondaryGroupsDialog: SecondaryGroupsDialogComponent;
+ @ViewChild('addrAlert') private addrAlert: AlertDialogComponent;
+
autoId = -1;
patron: IdlObject;
// TODO address_alert(obj);
break;
+ case 'post_code':
+ this.handlePostCodeChange(obj, value);
+ break;
+
case 'barcode':
this.handleBarcodeChange(value);
break;
this.adjustSaveSate();
}
+ handlePostCodeChange(addr: IdlObject, postCode: any) {
+ this.net.request(
+ 'open-ils.search', 'open-ils.search.zip', postCode
+ ).subscribe(resp => {
+ if (!resp) return;
+
+ ['city', 'state', 'county'].forEach(field => {
+ if (resp[field]) {
+ addr[field](resp[field]);
+ }
+ });
+
+ if (resp.alert) {
+ this.addrAlert.dialogBody = resp.alert;
+ this.addrAlert.open();
+ }
+ });
+ }
+
handleUsernameChange(value: any) {
this.dupeUsername = false;