Please chose a date in the future">
</eg-alert-dialog>
+<eg-alert-dialog #nextHourAlert
+ i18n-dialogTitle i18n-dialogBody
+ dialogTitle="Can Not Suspend"
+ dialogBody="Hold can not be suspended because the pickup library is either open
+ or does not have hours of operation defined.">
+</eg-alert-dialog>
+
<div class="row">
<div class="col-lg-1">
<button class="btn btn-info label-with-material-icon"
@ViewChild('smsCbox', {static: false}) smsCbox: ComboboxComponent;
@ViewChild('activeDateAlert') private activeDateAlert: AlertDialogComponent;
-
+ @ViewChild('nextHourAlert') private nextHourAlert: AlertDialogComponent;
+
constructor(
private router: Router,
private route: ActivatedRoute,
}
nextOpenTime(){
+ this.activeDateStr = "";
this.net.request('open-ils.actor',
'open-ils.actor.org_unit.next_operating_hour',this.pickupLib
).subscribe(
resp => {
console.log(resp);
- if(resp){
+ if(resp && typeof resp === 'string'){
this.activeDateSelected(resp);
}
- else{
+ },
+ error => {
+ console.log(error);
+ },
+ () => {
+ if(!this.activeDateStr){
this.suspend = false;
this.suspendTilOpen = false;
+ this.nextHourAlert.open();
}
- },
- error => {
- this.suspend = false;
- this.suspendTilOpen = false;
}
);
}