<eg-hold-notify-update-dialog #holdNotifyUpdateDialog>
</eg-hold-notify-update-dialog>
-<div class="row" *ngIf="loading">
+<div class="row" *ngIf="!showForm">
<div class="col-lg-6 offset-lg-3">
<eg-progress-inline></eg-progress-inline>
</div>
<!-- The List O' Fields -->
-<div class="mt-3 striped-rows-even patron-edit-container form-validated" *ngIf="patron && !loading">
+<div class="mt-3 striped-rows-even patron-edit-container form-validated" *ngIf="patron && showForm">
<div class="row pt-1 pb-1 mt-1" *ngIf="showField('ac.barcode')">
<ng-container *ngTemplateOutlet="fieldLabel;
modifiedPatron: IdlObject;
changeHandlerNeeded = false;
nameTab = 'primary';
+
+ // Are we still fetching data and applying values?
loading = false;
+ // Should the user be able to see the form?
+ // On page load, we want to show the form just before we are
+ // done loading, so values can be applied to inputs after they
+ // are rendered but before those changes would result in setting
+ // changesPending = true
+ showForm = false;
surveys: IdlObject[];
smsCarriers: ComboboxEntry[];
load(): Promise<any> {
this.loading = true;
+ this.showForm = false;
return this.setStatCats()
.then(_ => this.getFieldDocs())
.then(_ => this.setSurveys())
.then(_ => this.setOptInSettings())
.then(_ => this.setSmsCarriers())
.then(_ => this.setFieldPatterns())
- .then(_ => this.loading = false)
+ .then(_ => this.showForm = true)
// Not my preferred way to handle this, but some values are
// applied to widgets slightly after the load() is done and the
// widgets are rendered. If a widget is required and has no
// non-saveable state on page load without forcing the page into
// an nonsaveable state on every page load, check the save state
// after a 1 second delay.
- .then(_ => setTimeout(() => this.emitSaveState(), 1000));
+ .then(_ => setTimeout(() => {
+ this.emitSaveState();
+ this.loading = false;
+ }, 1000));
}
setEditProfiles(): Promise<any> {
}
nonDeletedAddresses(): IdlObject[] {
- console.log('nonDeletedAddresses() are ', this.patron.addresses().filter(a => !a.isdeleted()).map(a => a.id()));
return this.patron.addresses().filter(a => !a.isdeleted());
}
this.changesPending = false;
this.loading = true;
+ this.showForm = false;
return this.saveUser()
.then(_ => this.saveUserSettings())