From 25fcc34b689e50e0911ece31a2de45fcd3b17bac Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Sun, 30 Jul 2017 16:36:54 +0200 Subject: [PATCH] Merge add ans modify functions in Operation List Component. --- src/operations/operationList.component.ts | 24 +++++++++-------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/operations/operationList.component.ts b/src/operations/operationList.component.ts index 28285e6..9b5a5ac 100644 --- a/src/operations/operationList.component.ts +++ b/src/operations/operationList.component.ts @@ -92,7 +92,15 @@ export class OperationListComponent implements OnInit { var operation = new Operation(); operation.account_id = this.accountIdService.get(); - return this.modify(operation); + // FIXME Alexis Lahouze 2017-06-15 i18n + const modal = this.ngbModal.open(OperationEditModalComponent); + + modal.componentInstance.operation = operation; + + modal.result.then((operation: Operation) => { + this.save(operation); + }, (reason) => { + }); }; /* @@ -138,20 +146,6 @@ export class OperationListComponent implements OnInit { }); }; - modify(operation) { - // FIXME Alexis Lahouze 2017-06-15 i18n - const modal = this.ngbModal.open(OperationEditModalComponent, { - windowClass: 'in' - }); - - modal.componentInstance.operation = operation; - - modal.result.then((operation: Operation) => { - this.save(operation); - }, (reason) => { - }); - }; - onUpdate(dateRange) { this.load(dateRange.minDate, dateRange.maxDate); };