Prepare Edit and New separation.

This commit is contained in:
Alexis Lahouze 2018-06-13 21:37:40 +02:00
parent c92b1bed11
commit 45207d6500
4 changed files with 61 additions and 2 deletions

View File

@ -19,10 +19,14 @@ import { OperationRowComponent } from './operationRow.component';
import { CategoryService } from './category.service'; import { CategoryService } from './category.service';
import { OperationService } from './operation.service'; import { OperationService } from './operation.service';
import { OperationListComponent } from './operationList.component'; import { OperationListComponent } from './operationList.component';
import { OperationNewComponent } from './operationNew.component';
import { OperationEditComponent } from './operationEdit.component';
import { OperationDeleteModalComponent } from './operationDeleteModal.component'; import { OperationDeleteModalComponent } from './operationDeleteModal.component';
import { OperationFormComponent } from './operationForm.component'; import { OperationFormComponent } from './operationForm.component';
import { OperationEditModalComponent } from './operationEditModal.component'; import { OperationEditModalComponent } from './operationEditModal.component';
import { OperationListState } from './operation.states'; import { OperationListState } from './operation.states';
import { OperationNewState } from './operation.states';
import { OperationEditState } from './operation.states';
@NgModule({ @NgModule({
imports: [ imports: [
@ -30,7 +34,9 @@ import { OperationListState } from './operation.states';
CommonModule, CommonModule,
ReactiveFormsModule, ReactiveFormsModule,
RouterModule.forChild([ RouterModule.forChild([
OperationListState OperationListState,
OperationNewState,
OperationEditState
]), ]),
NgLoggerModule, NgLoggerModule,
ToastrModule, ToastrModule,
@ -48,6 +54,8 @@ import { OperationListState } from './operation.states';
CategoryChartComponent, CategoryChartComponent,
OperationRowComponent, OperationRowComponent,
OperationListComponent, OperationListComponent,
OperationEditComponent,
OperationNewComponent,
OperationDeleteModalComponent, OperationDeleteModalComponent,
OperationFormComponent, OperationFormComponent,
OperationEditModalComponent, OperationEditModalComponent,

View File

@ -1,9 +1,21 @@
// vim: set tw=80 ts=2 sw=2 sts=2 : // vim: set tw=80 ts=2 sw=2 sts=2 :
import { OperationListComponent } from './operationList.component'; import { OperationListComponent } from './operationList.component';
import { OperationNewComponent } from './operationNew.component';
import { OperationEditComponent } from './operationEdit.component';
export const OperationListState = { export const OperationListState = {
path: 'account/:accountId/operations', path: 'account/:accountId/operations',
component: OperationListComponent, component: OperationListComponent,
onSameUrlNavigation: 'reload' onSameUrlNavigation: 'reload'
} };
export const OperationNewState = {
path: 'account/:accountId/operations/new',
component: OperationNewComponent,
};
export const OperationEditState = {
path: 'account/:accountId/operations/:operationId/edit',
component: OperationEditComponent,
};

View File

@ -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: `
<div>
<div class="row">
</div>
</div>
`
})
export class OperationEditComponent implements OnInit {
ngOnInit(): void {
}
}

View File

@ -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: `
<div>
<div class="row">
</div>
</div>
`
})
export class OperationNewComponent implements OnInit {
ngOnInit(): void {
}
}