From: Jane Sandberg Date: Wed, 27 Mar 2019 00:51:54 +0000 (-0700) Subject: fixing lifecycle issue X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=cdb35a258d9a7850b8de6f5c25419d98dde5ca3f;p=working%2FEvergreen.git fixing lifecycle issue --- diff --git a/Open-ILS/src/eg2/src/app/staff/booking/create-reservation.component.ts b/Open-ILS/src/eg2/src/app/staff/booking/create-reservation.component.ts index c42558f677..f2da2d14ad 100644 --- a/Open-ILS/src/eg2/src/app/staff/booking/create-reservation.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/booking/create-reservation.component.ts @@ -29,8 +29,6 @@ export class CreateReservationComponent implements OnInit { scheduleSource: GridDataSource = new GridDataSource(); - handleResourceTypeChange: ($event: ComboboxEntry) => void; - resources: IdlObject[] = []; limitByAttr: (attributeId: number, $event: ComboboxEntry) => void; @@ -101,19 +99,6 @@ export class CreateReservationComponent implements OnInit { console.log('event: ' + JSON.stringify($event)); }; - this.handleResourceTypeChange = ($event: ComboboxEntry) => { - // TODO: unset resource barcode - this.attributes = []; - if ($event.id) { - this.pcrud.search('bra', {resource_type : $event.id}, { - order_by: 'name ASC', - flesh: 1, - flesh_fields: {'bra' : ['valid_values']} - }).subscribe( - a => { this.attributes.push(a); }); - this.fetchData('type', $event.id); - } - }; } showNewDialog(idlThing: IdlObject) { @@ -125,6 +110,21 @@ export class CreateReservationComponent implements OnInit { err => {} ); } + + this.handleResourceTypeChange($event: ComboboxEntry) { + // TODO: unset resource barcode + this.attributes = []; + if ($event.id) { + this.pcrud.search('bra', {resource_type : $event.id}, { + order_by: 'name ASC', + flesh: 1, + flesh_fields: {'bra' : ['valid_values']} + }).subscribe( + a => { this.attributes.push(a); }); + this.fetchData('type', $event.id); + } + } + private _firstTimeIsSmaller(first: NgbTimeStruct, second: NgbTimeStruct) { if (first.hour < second.hour) { return true; } if ((first.hour === second.hour) && (first.minute < second.minute)) { return true; }