From a2b9cf612d5fb6e811aa5b28dfc84b1f3b62c3f4 Mon Sep 17 00:00:00 2001 From: Jane Sandberg Date: Sun, 2 Dec 2018 07:50:19 -0800 Subject: [PATCH] lp1793241: porting booking pull list to angular Signed-off-by: Jane Sandberg --- .../booking/pull-list/pull-list.component.html | 26 ++++++++++++++ .../staff/booking/pull-list/pull-list.component.ts | 41 ++++++++++++++++++++++ .../staff/booking/pull-list/pull-list.module.ts | 20 +++++++++++ .../eg2/src/app/staff/booking/routing.module.ts | 19 ++++++++++ Open-ILS/src/eg2/src/app/staff/routing.module.ts | 3 ++ 5 files changed, 109 insertions(+) create mode 100644 Open-ILS/src/eg2/src/app/staff/booking/pull-list/pull-list.component.html create mode 100644 Open-ILS/src/eg2/src/app/staff/booking/pull-list/pull-list.component.ts create mode 100644 Open-ILS/src/eg2/src/app/staff/booking/pull-list/pull-list.module.ts create mode 100644 Open-ILS/src/eg2/src/app/staff/booking/routing.module.ts diff --git a/Open-ILS/src/eg2/src/app/staff/booking/pull-list/pull-list.component.html b/Open-ILS/src/eg2/src/app/staff/booking/pull-list/pull-list.component.html new file mode 100644 index 0000000000..daa9f095cf --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/booking/pull-list/pull-list.component.html @@ -0,0 +1,26 @@ +{{dataSource | json }} + + +
+
+ + + +
+
+ + +
+
+ + + + + + + + + + + diff --git a/Open-ILS/src/eg2/src/app/staff/booking/pull-list/pull-list.component.ts b/Open-ILS/src/eg2/src/app/staff/booking/pull-list/pull-list.component.ts new file mode 100644 index 0000000000..e722afa427 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/booking/pull-list/pull-list.component.ts @@ -0,0 +1,41 @@ +import { Component, Input, OnInit } from '@angular/core'; +import { GridDataSource } from '@eg/share/grid/grid'; +import { NetRequest, NetService } from '@eg/core/net.service'; +import { Pager } from '@eg/share/util/pager'; +import { AuthService } from '@eg/core/auth.service'; + +@Component({ + selector: 'eg-pull-list', + templateUrl: './pull-list.component.html' +}) + +export class PullListComponent implements OnInit { + @Input( ) daysHence: number; + + public dataSource: GridDataSource; + private auth: AuthService; + + constructor( + private net: NetService, + egAuth: AuthService + ){ + this.auth = egAuth; + this.daysHence = 5; + } + + fill_grid () { + this.net.request( + 'open-ils.booking', 'open-ils.booking.reservations.get_pull_list', + this.auth.token(), null, + (86400 * this.daysHence), // convert seconds to days + 4 + ).subscribe( data => { + this.dataSource.data = data; + }) + } + + ngOnInit() { + this.dataSource = new GridDataSource(); + this.fill_grid(); + } +} diff --git a/Open-ILS/src/eg2/src/app/staff/booking/pull-list/pull-list.module.ts b/Open-ILS/src/eg2/src/app/staff/booking/pull-list/pull-list.module.ts new file mode 100644 index 0000000000..489f702213 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/booking/pull-list/pull-list.module.ts @@ -0,0 +1,20 @@ +import {NgModule} from '@angular/core'; +import {StaffCommonModule} from '@eg/staff/common.module'; +import {BookingRoutingModule} from '../routing.module'; +import {PullListComponent} from './pull-list.component'; + +@NgModule({ + declarations: [ + PullListComponent + ], + imports: [ + StaffCommonModule, + BookingRoutingModule, + ], + providers: [ + ] +}) + +export class PullListModule { + +} diff --git a/Open-ILS/src/eg2/src/app/staff/booking/routing.module.ts b/Open-ILS/src/eg2/src/app/staff/booking/routing.module.ts new file mode 100644 index 0000000000..6de91de296 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/booking/routing.module.ts @@ -0,0 +1,19 @@ +import {NgModule} from '@angular/core'; +import {RouterModule, Routes} from '@angular/router'; +import {PullListComponent} from './pull-list/pull-list.component'; + +const routes: Routes = [ + { + path: 'pull_list', + component: PullListComponent + } + +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], + providers: [] +}) + +export class BookingRoutingModule {} diff --git a/Open-ILS/src/eg2/src/app/staff/routing.module.ts b/Open-ILS/src/eg2/src/app/staff/routing.module.ts index b515f389af..f15900fe8a 100644 --- a/Open-ILS/src/eg2/src/app/staff/routing.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/routing.module.ts @@ -37,6 +37,9 @@ const routes: Routes = [{ path: 'sandbox', loadChildren : '@eg/staff/sandbox/sandbox.module#SandboxModule' }, { + path: 'booking', + loadChildren : '@eg/staff/booking/routing.module#BookingRoutingModule' + }, { path: 'admin', loadChildren : '@eg/staff/admin/routing.module#AdminRoutingModule' }] -- 2.11.0