From 45207d6500ada2605960326c95206d694eaf6e2d Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Wed, 13 Jun 2018 21:37:40 +0200 Subject: [PATCH] Prepare Edit and New separation. --- src/operations/operation.module.ts | 10 +++++++++- src/operations/operation.states.ts | 14 +++++++++++++- src/operations/operationEdit.component.ts | 20 ++++++++++++++++++++ src/operations/operationNew.component.ts | 19 +++++++++++++++++++ 4 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 src/operations/operationEdit.component.ts create mode 100644 src/operations/operationNew.component.ts diff --git a/src/operations/operation.module.ts b/src/operations/operation.module.ts index c2ebcd3..7226281 100644 --- a/src/operations/operation.module.ts +++ b/src/operations/operation.module.ts @@ -19,10 +19,14 @@ import { OperationRowComponent } from './operationRow.component'; import { CategoryService } from './category.service'; import { OperationService } from './operation.service'; import { OperationListComponent } from './operationList.component'; +import { OperationNewComponent } from './operationNew.component'; +import { OperationEditComponent } from './operationEdit.component'; import { OperationDeleteModalComponent } from './operationDeleteModal.component'; import { OperationFormComponent } from './operationForm.component'; import { OperationEditModalComponent } from './operationEditModal.component'; import { OperationListState } from './operation.states'; +import { OperationNewState } from './operation.states'; +import { OperationEditState } from './operation.states'; @NgModule({ imports: [ @@ -30,7 +34,9 @@ import { OperationListState } from './operation.states'; CommonModule, ReactiveFormsModule, RouterModule.forChild([ - OperationListState + OperationListState, + OperationNewState, + OperationEditState ]), NgLoggerModule, ToastrModule, @@ -48,6 +54,8 @@ import { OperationListState } from './operation.states'; CategoryChartComponent, OperationRowComponent, OperationListComponent, + OperationEditComponent, + OperationNewComponent, OperationDeleteModalComponent, OperationFormComponent, OperationEditModalComponent, diff --git a/src/operations/operation.states.ts b/src/operations/operation.states.ts index bc98d35..035dc46 100644 --- a/src/operations/operation.states.ts +++ b/src/operations/operation.states.ts @@ -1,9 +1,21 @@ // vim: set tw=80 ts=2 sw=2 sts=2 : import { OperationListComponent } from './operationList.component'; +import { OperationNewComponent } from './operationNew.component'; +import { OperationEditComponent } from './operationEdit.component'; export const OperationListState = { path: 'account/:accountId/operations', component: OperationListComponent, onSameUrlNavigation: 'reload' -} +}; + +export const OperationNewState = { + path: 'account/:accountId/operations/new', + component: OperationNewComponent, +}; + +export const OperationEditState = { + path: 'account/:accountId/operations/:operationId/edit', + component: OperationEditComponent, +}; diff --git a/src/operations/operationEdit.component.ts b/src/operations/operationEdit.component.ts new file mode 100644 index 0000000..1818037 --- /dev/null +++ b/src/operations/operationEdit.component.ts @@ -0,0 +1,20 @@ +// vim: set tw=80 ts=2 sw=2 sts=2 : + +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; + +@Component({ + selector: 'operation-edit', + template: ` +
+
+
+
+ ` +}) +export class OperationEditComponent implements OnInit { + ngOnInit(): void { + + } +} + diff --git a/src/operations/operationNew.component.ts b/src/operations/operationNew.component.ts new file mode 100644 index 0000000..f196bdf --- /dev/null +++ b/src/operations/operationNew.component.ts @@ -0,0 +1,19 @@ +// vim: set tw=80 ts=2 sw=2 sts=2 : + +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute, Router } from '@angular/router'; + +@Component({ + selector: 'operation-new', + template: ` +
+
+
+
+ ` +}) +export class OperationNewComponent implements OnInit { + ngOnInit(): void { + + } +}