From d28634f2a1c802df624f4d79808f926f22f80c58 Mon Sep 17 00:00:00 2001 From: "CORP\\vapadwal" Date: Tue, 20 Nov 2018 18:17:42 +0530 Subject: [PATCH 1/2] Fixed issue #142 for migration to devon4j --- .../order-cockpit/order-cockpit.component.ts | 7 ++++++- .../reservation-cockpit/reservation-cockpit.component.ts | 8 ++++++-- angular/src/app/menu/menu.component.ts | 9 ++++++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/angular/src/app/cockpit-area/order-cockpit/order-cockpit.component.ts b/angular/src/app/cockpit-area/order-cockpit/order-cockpit.component.ts index 2087e792f..b3672cc75 100644 --- a/angular/src/app/cockpit-area/order-cockpit/order-cockpit.component.ts +++ b/angular/src/app/cockpit-area/order-cockpit/order-cockpit.component.ts @@ -69,7 +69,12 @@ export class OrderCockpitComponent implements OnInit { applyFilters(): void { this.waiterCockpitService.getOrders(this.pageable, this.sorting, this.filters) .subscribe((data: any) => { - this.orders = data.content; + if (data == null) { + this.orders = []; + } + else{ + this.orders = data.content; + } this.totalOrders = data.totalElements; }); } diff --git a/angular/src/app/cockpit-area/reservation-cockpit/reservation-cockpit.component.ts b/angular/src/app/cockpit-area/reservation-cockpit/reservation-cockpit.component.ts index 8feae7ace..7387e8fef 100644 --- a/angular/src/app/cockpit-area/reservation-cockpit/reservation-cockpit.component.ts +++ b/angular/src/app/cockpit-area/reservation-cockpit/reservation-cockpit.component.ts @@ -30,7 +30,7 @@ export class ReservationCockpitComponent implements OnInit { //total: 1, }; - reservations: ReservationView; + reservations: ReservationView[]; totalReservations: number; columns: ITdDataTableColumn[]; @@ -74,7 +74,11 @@ export class ReservationCockpitComponent implements OnInit { applyFilters(): void { this.waiterCockpitService.getReservations(this.pageable, this.sorting, this.filters) .subscribe((data: any) => { - this.reservations = data.content; + if(data == null){ + this.reservations = []; + }else{ + this.reservations = data.content; + } this.totalReservations = data.totalElements; }); } diff --git a/angular/src/app/menu/menu.component.ts b/angular/src/app/menu/menu.component.ts index ffa5c4912..d76233fc0 100644 --- a/angular/src/app/menu/menu.component.ts +++ b/angular/src/app/menu/menu.component.ts @@ -44,7 +44,14 @@ export class MenuComponent { }; const composedFilters: Filter = this.menuService.composeFilters(pageable,filters); this.dishes$ = this.menuService.getDishes(composedFilters).pipe( - map((res) => res.content), + map((res) => + { + if(res==null){ + return []; + }else{ + return res.content; + } + }), ); } } From b4412017c4fc19883ef0f0f537676348b654b5b2 Mon Sep 17 00:00:00 2001 From: "CORP\\vapadwal" Date: Fri, 23 Nov 2018 11:37:52 +0530 Subject: [PATCH 2/2] Fixed issues related to lint- migration to devon4j --- .../order-cockpit/order-cockpit.component.ts | 10 ++++------ .../reservation-cockpit.component.ts | 8 ++++---- angular/src/app/menu/menu.component.ts | 20 +++++++------------ angular/src/app/menu/shared/menu.service.ts | 10 +++++----- java/mtsj/pom.xml | 2 +- 5 files changed, 21 insertions(+), 29 deletions(-) diff --git a/angular/src/app/cockpit-area/order-cockpit/order-cockpit.component.ts b/angular/src/app/cockpit-area/order-cockpit/order-cockpit.component.ts index b3672cc75..724852c28 100644 --- a/angular/src/app/cockpit-area/order-cockpit/order-cockpit.component.ts +++ b/angular/src/app/cockpit-area/order-cockpit/order-cockpit.component.ts @@ -24,7 +24,7 @@ export class OrderCockpitComponent implements OnInit { private pageable: Pageable = { pageSize: 8, pageNumber: 0, - //total: 1, + // total: 1, }; private sorting: any[] = []; @@ -69,10 +69,9 @@ export class OrderCockpitComponent implements OnInit { applyFilters(): void { this.waiterCockpitService.getOrders(this.pageable, this.sorting, this.filters) .subscribe((data: any) => { - if (data == null) { + if (!data) { this.orders = []; - } - else{ + } else { this.orders = data.content; } this.totalOrders = data.totalElements; @@ -89,7 +88,6 @@ export class OrderCockpitComponent implements OnInit { pageSize: pagingEvent.pageSize, pageNumber: pagingEvent.page - 1, sort: this.pageable.sort, - //total: 1, }; this.applyFilters(); } @@ -100,7 +98,7 @@ export class OrderCockpitComponent implements OnInit { property: sortEvent.name, direction: '' + sortEvent.order, }); - this.applyFilters(); + this.applyFilters(); } selected(selection: ITdDataTableSelectAllEvent): void { diff --git a/angular/src/app/cockpit-area/reservation-cockpit/reservation-cockpit.component.ts b/angular/src/app/cockpit-area/reservation-cockpit/reservation-cockpit.component.ts index 7387e8fef..9b05d24d4 100644 --- a/angular/src/app/cockpit-area/reservation-cockpit/reservation-cockpit.component.ts +++ b/angular/src/app/cockpit-area/reservation-cockpit/reservation-cockpit.component.ts @@ -27,7 +27,7 @@ export class ReservationCockpitComponent implements OnInit { pageable: Pageable = { pageSize: 8, pageNumber: 0, - //total: 1, + // total: 1, }; reservations: ReservationView[]; @@ -74,9 +74,9 @@ export class ReservationCockpitComponent implements OnInit { applyFilters(): void { this.waiterCockpitService.getReservations(this.pageable, this.sorting, this.filters) .subscribe((data: any) => { - if(data == null){ + if (!data) { this.reservations = []; - }else{ + } else { this.reservations = data.content; } this.totalReservations = data.totalElements; @@ -93,7 +93,7 @@ export class ReservationCockpitComponent implements OnInit { pageSize: pagingEvent.pageSize, pageNumber: pagingEvent.page - 1, sort: this.pageable.sort, - //total: 1, + // total: 1, }; this.applyFilters(); } diff --git a/angular/src/app/menu/menu.component.ts b/angular/src/app/menu/menu.component.ts index d76233fc0..3d9431eee 100644 --- a/angular/src/app/menu/menu.component.ts +++ b/angular/src/app/menu/menu.component.ts @@ -24,11 +24,6 @@ export class MenuComponent { dishes$: Observable; - /*pageable: Pageable = { - pageSize: 8, - pageNumber: 0, - };*/ - constructor( private menuService: MenuService, ) {} @@ -39,16 +34,15 @@ export class MenuComponent { pageNumber: 0, sort: [{ property: filters.sort.property, - direction: filters.sort.direction - }] - }; - const composedFilters: Filter = this.menuService.composeFilters(pageable,filters); + direction: filters.sort.direction, + }], + }; + const composedFilters: Filter = this.menuService.composeFilters(pageable, filters); this.dishes$ = this.menuService.getDishes(composedFilters).pipe( - map((res) => - { - if(res==null){ + map((res) => { + if (!res) { return []; - }else{ + } else { return res.content; } }), diff --git a/angular/src/app/menu/shared/menu.service.ts b/angular/src/app/menu/shared/menu.service.ts index 369a28cda..b438fbe52 100644 --- a/angular/src/app/menu/shared/menu.service.ts +++ b/angular/src/app/menu/shared/menu.service.ts @@ -36,14 +36,14 @@ export class MenuService { }; } - composeFilters(pageable: Pageable,filters: FilterFormData): Filter { + composeFilters(pageable: Pageable, filters: FilterFormData): Filter { const categories: { id: string }[] = Object.keys(filters.categories) .filter((categoryKey: string) => filters.categories[categoryKey]) .map((categoryKey: string) => ({id: categoryNameToServerId[categoryKey].toString()})); - if (filters.sort.property == null) { - filters.sort = null; - pageable.sort = null; - } + if (!filters.sort.property) { + filters.sort = undefined; + pageable.sort = undefined; + } return { categories, diff --git a/java/mtsj/pom.xml b/java/mtsj/pom.xml index aaf06cc70..f5f24e094 100644 --- a/java/mtsj/pom.xml +++ b/java/mtsj/pom.xml @@ -12,7 +12,7 @@ 2.0.4.RELEASE - 3.0.0-alpha.1 + 3.0.0 1.8 81 ${devon.port.range}81